mirror of
https://github.com/SpartanJ/eepp.git
synced 2026-05-28 17:16:29 +03:00
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:
@@ -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" );
|
||||
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user