Closed Bug 921713 Opened 11 years ago Closed 3 years ago

nsRuleNode::HasAuthorSpecifiedRules should handle inherited properties differently?

Categories

(Core :: CSS Parsing and Computation, defect)

defect
Not set
normal

Tracking

()

RESOLVED INCOMPLETE

People

(Reporter: heycam, Unassigned)

Details

Attachments

(1 file)

In nsRuleNode::HasAuthorSpecifiedRules there is 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.

text-shadow is one of the properties we look at now, though, after bug 721750, and that's an inherited property.  Is there something in the loop below that that we need to change to handle the inherited property?  Otherwise, might it be possible that HasAuthorSpecifiedRules(NS_AUTHOR_SPECIFIED_TEXT_SHADOW) returns false when it should return true, if it finds a eCSSUnit_Null value for text-shadow?

This might only ever come up if we had say:

  div { text-shadow: 2px 2px 0 red; }
  span { letter-spacing: inherit; }

in an author or UA style sheet, and then with this content:

  <div><span>select me</span></div>

the selected text should paint with a text shadow but wouldn't.
Attached patch untested patchSplinter Review
Something like this?
Assignee: nobody → cam
Status: NEW → ASSIGNED
Attachment #811489 - Flags: feedback?(dbaron)
The original use of HasAuthorSpecifiedRules was to decide whether to disable native theme.  What does the current set of uses look like, especially for the callers that care about text-shadow?
Flags: needinfo?(cam)
So the only use of HasAuthorSpecifiedRules that cares about text-shadow is here:

  https://mxr.mozilla.org/mozilla-central/source/layout/generic/nsTextFrame.cpp#3590

That's not to disable any native theming, but to allow a ::-moz-selection rule that doesn't have a text-shadow declaration to not clobber any text-shadow specified on the element without that pseudo.
Flags: needinfo?(cam) → needinfo?(dbaron)

Just notice this bug on my triage monitor. Do we still need this because we don't have nsRuleNode now?

Emilio, I assume there is nothing to be fixed in the new code and this bug can be closed?

Flags: needinfo?(dbaron) → needinfo?(emilio)
Assignee: cam → nobody
Status: ASSIGNED → NEW

Yeah, I think so.

Status: NEW → RESOLVED
Closed: 3 years ago
Flags: needinfo?(emilio)
Resolution: --- → INCOMPLETE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: