Inheritance logic in HasAuthorSpecifiedRules is slightly wrong for text-shadow

RESOLVED FIXED in Firefox 58

Status

()

P3
trivial
RESOLVED FIXED
2 years ago
a year ago

People

(Reporter: mbrubeck, Assigned: xidorn)

Tracking

Trunk
mozilla58
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(firefox58 fixed)

Details

Attachments

(2 attachments)

(Reporter)

Description

2 years ago
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
(Reporter)

Updated

a year ago
Blocks: 1384691
(Assignee)

Updated

a year ago
No longer blocks: 1384691
Depends on: 1384691
(Assignee)

Updated

a year ago
Assignee: nobody → xidorn+moz
Comment hidden (mozreview-request)

Comment 2

a year ago
mozreview-review
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+
Comment hidden (mozreview-request)
(Assignee)

Comment 4

a year ago
Created attachment 8917679 [details] [review]
Servo PR

Comment 5

a year ago
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
Last Resolved: a year ago
status-firefox58: --- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla58
You need to log in before you can comment on or make changes to this bug.