diff --git a/include/eepp/ui/uirichtext.hpp b/include/eepp/ui/uirichtext.hpp index 5c684f745..304ac49fc 100644 --- a/include/eepp/ui/uirichtext.hpp +++ b/include/eepp/ui/uirichtext.hpp @@ -166,6 +166,7 @@ class EE_API UIHTMLHtml : public UIRichText { static UIHTMLHtml* New( const std::string& tag ); virtual Uint32 getType() const override; bool isType( const Uint32& type ) const override; + bool applyProperty( const StyleSheetProperty& attribute ) override; protected: UIHTMLHtml( const std::string& tag = "html" ); diff --git a/src/eepp/ui/uirichtext.cpp b/src/eepp/ui/uirichtext.cpp index 1a703b953..64e7809e8 100644 --- a/src/eepp/ui/uirichtext.cpp +++ b/src/eepp/ui/uirichtext.cpp @@ -34,6 +34,21 @@ bool UIHTMLHtml::isType( const Uint32& type ) const { return UIHTMLHtml::getType() == type ? true : UIRichText::isType( type ); } +bool UIHTMLHtml::applyProperty( const StyleSheetProperty& attribute ) { + if ( !checkPropertyDefinition( attribute ) ) + return false; + + switch ( attribute.getPropertyDefinition()->getPropertyId() ) { + case PropertyId::Width: + case PropertyId::Height: + return false; // Ignore width and height set from CSS + default: + break; + } + + return UIRichText::applyProperty( attribute ); +} + UILineBreak* UILineBreak::New( const std::string& tag ) { return eeNew( UILineBreak, ( tag ) ); } @@ -69,6 +84,9 @@ bool UIHTMLBody::applyProperty( const StyleSheetProperty& attribute ) { return false; switch ( attribute.getPropertyDefinition()->getPropertyId() ) { + case PropertyId::Width: + case PropertyId::Height: + return false; // Ignore width and height set from CSS case PropertyId::BackgroundColor: case PropertyId::BackgroundImage: case PropertyId::BackgroundTint: