Do not allow to set width and height of html and body from CSS since they need to have very specific sizing.

This commit is contained in:
Martín Lucas Golini
2026-05-02 01:47:08 -03:00
parent 307d9249ac
commit 3226efdb24
2 changed files with 19 additions and 0 deletions

View File

@@ -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" );

View File

@@ -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: