You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
!important in an inline style stays in the value, which drops a border shorthand and corrupts a padding one #523
CssParser::parseCssProperties() strips !important from stylesheet declarations (src/Css/CssParser.php:316). InlineStyleParser::parse() does not, so the flag stays in the value, and shorthand expansion counts it as one of the values.
Measured on gravitypdf at b6a07921, PHP 8.5.4.
Inline style
Result
border:1px solid #f00 !important
no border is drawn; BORDER-TOP to BORDER-LEFT are empty
padding:1px 2px !important
PADDING-BOTTOM is !important
margin:1px 2px 3px 4px !important
fine: a fifth value is ignored
font-size:20pt !important, color:#0f0 !important
fine, by luck: the converters ignore the tail
The same border in a stylesheet is drawn.
Fix. Strip !important in InlineStyleParser::parse() as the stylesheet parser does. #532 later gives it meaning.
Tests. A border shorthand and a two-value padding shorthand with !important, inline, drawn as they are without it.
Activity