Closed
Bug 1364162
Opened 8 years ago
Closed 7 years ago
stylo: Need to support case-insensitive matching for attribute selectors other than equality
Categories
(Core :: CSS Parsing and Computation, enhancement, P2)
Tracking
()
RESOLVED
FIXED
mozilla55
Tracking | Status | |
---|---|---|
firefox55 | --- | fixed |
People
(Reporter: bzbarsky, Assigned: manishearth)
References
Details
Attachments
(2 files)
This needs rust-selectors and other servo-side changes. Right now in servo [foo="bar"i] works but [foo^="bar"i] does not. Same for the other attribute matching operators.
Comment 1•8 years ago
|
||
https://github.com/servo/servo/pull/16915 does the parsing for this. snapshot.rs and wrapper.rs in servo/components/style/gecko now each have a attr_matches method where a ignore_case boolean is passed to Gecko_SnapshotAttrEquals and Gecko_AttrEquals but ignored in other cases.
What’s needed now is to add pass these booleans through FFI, and implement matching accordingly.
Updated•8 years ago
|
Priority: -- → P2
Assignee | ||
Comment 2•7 years ago
|
||
Affects WPT /selectors/attribute-selectors/attribute-case/semantics.html
Blocks: stylo-wpt
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Assignee | ||
Updated•7 years ago
|
Assignee: nobody → manishearth
Status: NEW → ASSIGNED
Assignee | ||
Comment 5•7 years ago
|
||
mozreview-review |
Comment on attachment 8875919 [details]
Bug 1364162 - Part 2: stylo: Make all attribute selectors respect case insensitivity;
https://reviewboard.mozilla.org/r/147318/#review151564
::: layout/style/ServoBindings.cpp:924
(Diff revision 1)
> - nsIAtom* aStr)
> + nsIAtom* aStr, bool aIgnoreCase)
> {
> - auto match = [aStr](const nsAttrValue* aValue) {
> + auto match = [aStr, aIgnoreCase](const nsAttrValue* aValue) {
> nsAutoString str;
> aValue->ToString(str);
> - const nsDefaultStringComparator c;
> + WITH_COMPARATOR(aIgnoreCase, c,
Using macros to wrap the closures would probably be more efficient (since it won't have to check aIgnoreCase each time), but the code is neater this way. Not sure which I should do.
Comment 6•7 years ago
|
||
mozreview-review |
Comment on attachment 8875918 [details]
Bug 1364162 - Part 1: stylo: Remove TElement::attr_equals ;
https://reviewboard.mozilla.org/r/147316/#review151570
Attachment #8875918 -
Flags: review?(simon.sapin) → review+
Comment 7•7 years ago
|
||
mozreview-review |
Comment on attachment 8875919 [details]
Bug 1364162 - Part 2: stylo: Make all attribute selectors respect case insensitivity;
https://reviewboard.mozilla.org/r/147318/#review151576
Looks good to me. I *think* the only case where the closures would be called more than once is with `[*|foo=bar]` wildcard namespaces, which are probably rare.
Attachment #8875919 -
Flags: review?(simon.sapin) → review+
Assignee | ||
Comment 8•7 years ago
|
||
Pushed by manishearth@gmail.com:
https://hg.mozilla.org/integration/autoland/rev/45dfceacb9e8
Part 2: stylo: Make all attribute selectors respect case insensitivity; r=SimonSapin
Comment 10•7 years ago
|
||
bugherder |
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
status-firefox55:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla55
You need to log in
before you can comment on or make changes to this bug.
Description
•