Closed Bug 1363088 Opened 7 years ago Closed 7 years ago

Inheritance logic in HasAuthorSpecifiedRules is slightly wrong for text-shadow

Categories

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

enhancement

Tracking

()

RESOLVED FIXED
mozilla58
Tracking Status
firefox58 --- fixed

People

(Reporter: mbrubeck, Assigned: xidorn)

References

Details

Attachments

(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.

https://reviewboard.mozilla.org/r/188572/#review193830

::: 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 xquan@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/8189460a08a7
Remove text-shadow handling from HasAuthorSpecifiedRules. r=heycam
https://hg.mozilla.org/mozilla-central/rev/8189460a08a7
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla58
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: