Xidorn Quan
c587fa3586
style: Make tree pseudo-element prefix not case-sensitive.
...
Differential Revision: https://phabricator.services.mozilla.com/D4185
2018-09-03 12:32:10 +02:00
Emilio Cobos Álvarez
6c5456b4b6
Appease tidy.
2018-08-08 01:34:35 +02:00
Emilio Cobos Álvarez
888ad3eabe
style: Restrict XUL tree pseudos on nightly and early-beta.
...
Differential Revision: https://phabricator.services.mozilla.com/D2598
2018-08-08 01:37:20 +02:00
Cameron McCormack
62419adaaa
style: Shrink selectors::Component to 24 bytes.
...
This saves about 37 KiB of memory across the UA style sheets.
Bug: 1475197
Reviewed-by: emilio
2018-08-08 01:36:53 +02:00
Cameron McCormack
a41127152b
style: Measure heap allocations hanging off selector components.
...
Bug: 1475191
Reviewed-by: emilio
MozReview-Commit-ID: D7vZQ7v8owS
2018-07-16 19:43:15 +02:00
Olli Pettay
b68e4c2352
style: Implement :defined pseudo-class for custom elements.
...
Bug: 1331334
Reviewed-by: emilio
2018-07-01 00:08:33 +02:00
Bobby Holley
c99bcdd4b8
Run rustfmt on selectors, servo_arc, and style.
...
This was generated with:
./mach cargo fmt --package selectors &&
./mach cargo fmt --package servo_arc &&
./mach cargo fmt --package style
Using rustfmt 0.4.1-nightly (a4462d1 2018-03-26)
2018-04-10 17:35:15 -07:00
Bobby Holley
f7ae1a37e3
Manual fixups so that the rustfmt output won't trigger tidy.
2018-04-10 17:33:25 -07:00
Emilio Cobos Álvarez
db5db13559
style: Implement the non-functional :host selector.
...
Kinda tricky because :host only matches rules on the shadow root where the rules
come from. So we need to be careful during invalidation and style sharing.
I didn't use the non_ts_pseudo_class_list bits because as soon as we implement
the :host(..) bits we're going to need to special-case it anyway.
The general schema is the following:
* Rightmost featureless :host selectors are handled inserting them in the
host_rules hashmap. Note that we only insert featureless stuff there. We
could insert all of them and just filter during matching, but that's slightly
annoying.
* The other selectors, like non-featureless :host or what not, are added to the
normal cascade data. This is harmless, since the shadow host rules are never
matched against the host, so we know they'll just never match, and avoids
adding more special-cases.
* Featureless :host selectors to the left of a combinator are handled during
matching, in the special-case of next_element_for_combinator in selectors.
This prevents this from being more invasive, and keeps the usual fast path
slim, but it's a bit hard to match the spec and the implementation.
We could keep a copy of the SelectorIter instead in the matching context to
make the handling of featureless-ness explicit in match_non_ts_pseudo_class,
but we'd still need the special-case anyway, so I'm not fond of it.
* We take advantage of one thing that makes this sound. As you may have
noticed, if you had `root` element which is a ShadowRoot, and you matched
something like `div:host` against it, using a MatchingContext with
current_host == root, we'd incorrectly report a match. But this is impossible
due to the following constraints:
* Shadow root rules aren't matched against the host during styling (except
these featureless selectors).
* DOM APIs' current_host needs to be the _containing_ host, not the element
itself if you're a Shadow host.
Bug: 992245
Reviewed-by: xidorn
MozReview-Commit-ID: KayYNfTXb5h
2018-04-09 12:19:05 +02:00
Bobby Holley
9b5354f953
Stop using Gecko namespace ids in servo.
...
MozReview-Commit-ID: 2532dHCGPXW
2018-04-06 11:32:00 -07:00
Nicholas Nethercote
8705fb3783
Convert StylePrefs to StaticPrefs.
2018-04-03 11:41:03 +10:00
Xidorn Quan
688fb23d25
Remove nsCSSPseudoClasses.{h,cpp} and nsCSSPseudoClassList.h.
2018-03-28 09:50:14 +11:00
Xidorn Quan
bb15111dab
Use Servo to implement GetStatesForPseudoClass function in InspectorUtils.
2018-03-28 09:50:13 +11:00
Emilio Cobos Álvarez
9fa2618197
style: Add infrastructure to match :host.
2018-03-14 15:10:05 +01:00
Anthony Ramine
31036d6510
Derive ToCss for MediaList
...
This uncovered the fancy snowflake `use fmt::Write` in the impl of ToCss
for NonTSPseudoClass.
2018-03-05 12:02:31 +01:00
Emilio Cobos Álvarez
b76bbdf501
style: Make input[type=number] pseudo-elements accessible to chrome.
...
Bug: 1433389
Reviewed-by: jwatt
MozReview-Commit-ID: 2ycajPYd3CV
2018-02-05 13:05:26 +01:00
Anthony Ramine
cd8f96cc9e
Change ToCss to take a CssWriter<W>
...
This more concrete wrapper type can write a prefix the very first time something
is written to it. This allows removing plenty of useless monomorphisations caused
by the former W/SequenceWriter<W> pair of types.
2018-01-23 10:41:42 +01:00
Jessica Jong
2e532b8e00
style: Update shadow dom preference.
2018-01-16 17:52:50 +08:00
Simon Sapin
c14b766ff5
Rename SelectorMethods to Visit, after its one method.
2018-01-12 15:26:56 +01:00
Emilio Cobos Álvarez
5b7d9eb94a
style: Add a document state invalidator.
2018-01-12 12:08:42 +01:00
Emilio Cobos Álvarez
cb1a951477
style: Allow storing a DocumentState for invalidation.
2018-01-12 12:08:39 +01:00
Emilio Cobos Álvarez
1e27f2883b
selectors: Allow defining an implementation-dependent field in the matching context.
2018-01-12 12:08:38 +01:00
Emilio Cobos Álvarez
b6a2bff032
style: Move :-moz-locale-dir matching to rust.
2018-01-11 14:47:29 +01:00
Emilio Cobos Álvarez
d88696023f
style: Parse ::slotted() if the webcomponents pref is on.
...
Bug: 1425834
Reviewed-by: heycam
MozReview-Commit-ID: IOFneIgu7Rm
2018-01-09 14:26:05 +01:00
bors-servo
c6bf85eca9
Auto merge of #19536 - emilio:compound-selector-list, r=mbrubeck
...
style: Move the code to parse a list of compound selectors.
I'll need this for ::slotted().
<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg " height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/19536 )
<!-- Reviewable:end -->
2017-12-09 17:15:14 -06:00
bors-servo
95520ca39c
Auto merge of #19533 - emilio:unused-code-should-die, r=emilio
...
style: Remove unused SelectorImpl::pseudo_element_cascade_type.
<!-- Reviewable:start -->
This change is [<img src="https://reviewable.io/review_button.svg " height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/19533 )
<!-- Reviewable:end -->
2017-12-09 15:27:49 -06:00
Emilio Cobos Álvarez
b1f25a2b1f
style: Move the code to parse a list of compound selectors.
...
I'll need this for ::slotted().
2017-12-09 16:47:37 +01:00
Emilio Cobos Álvarez
bf564e0238
style: Simplify naming and signatures of single-colon pseudo stuff.
...
Also drop a few FIXMEs while at it, since they look bogus.
2017-12-09 16:12:22 +01:00
Emilio Cobos Álvarez
c93b844125
style: Remove unused SelectorImpl::pseudo_element_cascade_type.
2017-12-09 16:03:09 +01:00
Michael Wilson
1ebc1382ce
moving :dir() param serialization FIXME
2017-11-21 21:47:41 -08:00
bors-servo
5905f8d3ea
Auto merge of #19315 - emilio:chrome-rules-user-sheets, r=heycam
...
style: Enable chrome-only CSS features in user stylesheets.
MozReview-Commit-ID: FJ4vTiOrotH
Bug: 1418963
Reviewed-by: heycam
<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg " height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/19315 )
<!-- Reviewable:end -->
2017-11-21 04:27:25 -06:00
Emilio Cobos Álvarez
c7a3c929f6
style: Enable chrome-only CSS features in user stylesheets.
...
MozReview-Commit-ID: FJ4vTiOrotH
Reviewed-by: heycam
Bug: 1418963
2017-11-21 10:59:47 +01:00
Michael Wilson
10f3ef42bb
style: :dir() pseudo class now represented by enum
...
Fixes #19195
2017-11-15 18:12:44 -08:00
Bastien Orivel
29b4eec141
Bump bitflags to 1.0 in every servo crate
2017-10-30 23:36:06 +01:00
bors-servo
b1e6f05ae4
Auto merge of #18962 - upsuper:tree-pseudos, r=emilio
...
Support matching for ::-moz-tree-* pseudo-elements
This is the Servo side change of [bug 1397644](https://bugzilla.mozilla.org/show_bug.cgi?id=1397644 ).
<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg " height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/18962 )
<!-- Reviewable:end -->
2017-10-20 04:18:53 -05:00
Cameron McCormack
d58c967efa
style: Record DocumentState dependencies.
2017-10-20 13:13:13 +08:00
Cameron McCormack
c22dba0b87
style: Remove unused SelectorImpl::pseudo_class_state_flag.
2017-10-20 13:12:44 +08:00
Xidorn Quan
4ce3dc7729
Add slots in PerPseudoElementMap for tree pseudos.
2017-10-20 14:08:35 +11:00
Xidorn Quan
b743d68ccd
Accept argument-less tree pseudo-element selector.
2017-10-20 14:08:33 +11:00
Xidorn Quan
a2182f8dc3
Store args of tree pseudo-elements as Atom.
2017-10-20 14:08:31 +11:00
Gecko Backout
11c64178d8
Backed out changeset e64e659c077d: servo PR #18809 and revendor for reftest failures, e.g. in layout/reftests/bugs/392435-1.html. r=backout on a CLOSED TREE
...
Backs out https://github.com/servo/servo/pull/18809
2017-10-19 21:26:51 +00:00
Bastien Orivel
e8e2d0a4b2
Update bitflags to 1.0 in every servo crate
...
It still needs dependencies update to remove all the other bitflags
versions.
2017-10-19 15:01:17 +02:00
Matt Brubeck
efc3683cc7
Fix commonmark Markdown warnings in docs, part 1
...
Fixes warnings from rust-lang/rust#44229 when `--enable-commonmark` is
passed to rustdoc.
This is mostly a global find-and-replace for bare URIs on lines by
themselves in doc comments.
2017-10-17 11:24:57 -07:00
Simon Sapin
c0f8f15f39
Update to cssparser 0.22 (source location in error types)
2017-10-10 13:28:17 +02:00
Hiroyuki Ikezoe
175b88afcf
Fix mismatched arguments for Servo_SelectorXXX.
2017-10-10 06:35:16 +09:00
Simon Sapin
5d06c9959f
Replace some more uses of write!
in components/style
2017-09-04 19:01:43 +02:00
Josh Matthews
8e20a6a110
Report unknown pseudos (bug 1384216).
2017-08-28 17:19:28 -07:00
Clément DAVID
c5fe235112
order derivable traits lists
...
Ignoring :
- **generated**.rs
- python/tidy/servo_tidy_tests/rust_tidy.rs
2017-08-23 21:38:44 +02:00
Xidorn Quan
d3baa4fb3c
Check pref when parsing :fullscreen pseudo-class
2017-08-15 10:48:35 +10:00
Emilio Cobos Álvarez
faa8646e0f
style: Use an enumerated array for per-pseudo maps.
...
This avoids random HashMaps.
MozReview-Commit-ID: LQeZrLsoOnl
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
2017-08-08 12:40:31 +02:00