Closed
Bug 881339
Opened 12 years ago
Closed 12 years ago
CSS child selectors do not match when used in style tags with scoped attribute
Categories
(Core :: CSS Parsing and Computation, defect)
Core
CSS Parsing and Computation
Tracking
()
RESOLVED
FIXED
mozilla24
People
(Reporter: bryanrsmith, Assigned: heycam)
References
Details
Attachments
(2 files)
497 bytes,
text/html
|
Details | |
5.38 KB,
patch
|
bzbarsky
:
review+
|
Details | Diff | Splinter Review |
User Agent: Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/28.0.1500.37 Safari/537.36
Steps to reproduce:
Inside a style tag with the HTML5 scoped attribute, use a child selector (>) that does not include the right-most portion of the selector. Eg: .a>.b .c
Actual results:
The selector does not match when the scoped attribute is present on the style tag. Removing the scoped attribute causes the selector to match as expected. The bug does not reproduce when using a child selector that includes the right-most portion. Eg: .a .b>.c
Expected results:
The selector should match.
Chrome's implementation of the scoped attribute does not reproduce this issue (Chrome behaves as expected). The issue tracking the implementation of the scoped attribute (https://bugzilla.mozilla.org/show_bug.cgi?id=508725#c3) does mention that Chrome's implementation behaves incorrectly in some cases, and I'm unsure if this issue is one of those differences. Attached is a simple HTML document that demonstrates the problem.
Updated•12 years ago
|
Attachment #760466 -
Attachment mime type: text/plain → text/html
Comment 1•12 years ago
|
||
Cameron, can you take a look please? Looks like a bug at first glance...
Updated•12 years ago
|
Flags: needinfo?(cam)
Assignee | ||
Comment 2•12 years ago
|
||
It looks like the issue is that in aTreeMatchContext.PopStyleScopeForSelectorMatching, we call aTreeMatchContext.PopStyleScopeForSelectorMatching() when we move up the tree, but when we fail a recursive call to SelectorMatchesTree (for a descendant selector) we don't restore the state of whether we're still in the style scope. So we think we've left the style scope when we haven't.
Flags: needinfo?(cam)
Assignee | ||
Comment 3•12 years ago
|
||
(In reply to Cameron McCormack (:heycam) from comment #2)
> It looks like the issue is that in
> aTreeMatchContext.PopStyleScopeForSelectorMatching, we call ...
*in SelectorMatchesTree
Assignee | ||
Comment 4•12 years ago
|
||
I don't believe we'll ever be in nsCSSRuleProcessor::HasStateDependentStyle or nsCSSRuleProcessor::SelectorListMatches when mForScopedStyle = true, so I've asserted and not done the save/restore of mCurrentScopedStyle in them.
Try run in progress: https://tbpl.mozilla.org/?tree=Try&rev=c71c0f2264d9
Attachment #760726 -
Flags: review?(bzbarsky)
Comment 5•12 years ago
|
||
Comment on attachment 760726 [details] [diff] [review]
patch
r=me
Attachment #760726 -
Flags: review?(bzbarsky) → review+
Assignee | ||
Comment 6•12 years ago
|
||
Status: NEW → ASSIGNED
OS: Windows 8 → All
Hardware: x86_64 → All
Version: 21 Branch → Trunk
Comment 7•12 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla24
You need to log in
before you can comment on or make changes to this bug.
Description
•