Closed Bug 1363088 Opened 6 years ago Closed 5 years ago

Inheritance logic in HasAuthorSpecifiedRules is slightly wrong for text-shadow


(Core :: CSS Parsing and Computation, enhancement, P3)




Tracking Status
firefox58 --- fixed


(Reporter: mbrubeck, Assigned: xidorn)




(2 files)

This is a minor bug in nsRuleNode::HasAuthorSpecifiedRules that I noticed while porting its code to Stylo (bug 1349651).  nsRuleNode.cpp contains this comment:

>  // We need to be careful not to count styles covered up by user-important or
>  // UA-important declarations.  But we do want to catch explicit inherit
>  // styling in those and check our parent style context to see whether we have
>  // user styling for those properties.  Note that we don't care here about
>  // inheritance due to lack of a specified value, since all the properties we
>  // care about are reset properties.

However, the last sentence (and the associated code) became incorrect when bug 721750 added 'text-shadow' to the list of "properties we care about."

It's probably rare for this to affect any users. Because Gecko's UA stylesheets don't contain any UA-important declarations that set 'text-shadow', this bug is only triggered if there is a user stylesheet with a !important declaration that sets 'text-shadow'.

The effect of the bug is that the wrong 'text-shadow' style could be applied to selected text.
Priority: -- → P3
Blocks: 1384691
No longer blocks: 1384691
Depends on: 1384691
Assignee: nobody → xidorn+moz
Comment on attachment 8917642 [details]
Bug 1363088 - Remove text-shadow handling from HasAuthorSpecifiedRules.

::: layout/style/nsRuleNode.cpp:10514
(Diff revision 1)
> -
>    // properties in the SIDS, whether or not we care about them
>    size_t nprops = 0,
> -         backgroundOffset, borderOffset, paddingOffset, textShadowOffset;
> +         backgroundOffset, borderOffset, paddingOffset;
>    // We put the reset properties the start of the nsCSSValue array....

Can drop this comment.
Attachment #8917642 - Flags: review?(cam) → review+
Attached file Servo PR
Pushed by
Remove text-shadow handling from HasAuthorSpecifiedRules. r=heycam
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla58
You need to log in before you can comment on or make changes to this bug.