Closed
Bug 1387934
Opened 7 years ago
Closed 7 years ago
stylo: inDOMUtils::SelectorMatchesElement should not match with bogus pseudo
Categories
(Core :: CSS Parsing and Computation, defect, P2)
Core
CSS Parsing and Computation
Tracking
()
RESOLVED
FIXED
mozilla57
Tracking | Status | |
---|---|---|
firefox57 | --- | fixed |
People
(Reporter: xidorn, Assigned: ferjm)
References
(Blocks 1 open bug)
Details
Attachments
(1 file)
layout/inspector/tests/test_selectormatcheselement.html fails because of this. It returns true for > utils.selectorMatchesElement(element, elementRule, 0, ":bogus") where the bogus pseudo shouldn't match anything actually. This should be an easy one to fix. Just do a special check before https://searchfox.org/mozilla-central/rev/b52285fffc13f36eca6b47de735d4e4403b3859e/layout/style/ServoStyleRule.cpp#276-291 should be enough.
Assignee | ||
Updated•7 years ago
|
Assignee: nobody → ferjmoreno
Comment hidden (mozreview-request) |
Reporter | ||
Comment 2•7 years ago
|
||
mozreview-review |
Comment on attachment 8896322 [details] Bug 1387934 - stylo: inDOMUtils::SelectorMatchesElement should not match with bogus pseudo. https://reviewboard.mozilla.org/r/167574/#review173034 ::: layout/style/ServoStyleRule.cpp:288 (Diff revision 1) > + *aMatches = (aPseudo.IsEmpty() || pseudoType != CSSPseudoElementType::NotPseudo) > + ? Servo_StyleRule_SelectorMatchesElement(mRawRule, > - aElement, > + aElement, > - aSelectorIndex, > + aSelectorIndex, > - pseudoType); > + pseudoType) > + : false; Doesn't seem to be very readable... Could you just do an early return for that case? Actually, I guess we can just skip `NS_Atomize` and `GetPseudoType` if `aPseudo` is empty, which can make the function slightly faster and should also make the code clearer.
Attachment #8896322 -
Flags: review?(xidorn+moz) → review+
Updated•7 years ago
|
Priority: -- → P2
Comment hidden (mozreview-request) |
Pushed by ferjmoreno@gmail.com: https://hg.mozilla.org/integration/autoland/rev/5cbcc0b81f21 stylo: inDOMUtils::SelectorMatchesElement should not match with bogus pseudo. r=xidorn
Comment 5•7 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/5cbcc0b81f21
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla57
You need to log in
before you can comment on or make changes to this bug.
Description
•