Commit graph

169 commits

Author SHA1 Message Date
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
Ting-Yu Lin
585c00f235 style: Introduce Chrome UI privilege for parsers
The motivation is that Chrome XBL stylesheets can be parsed under author
level, but we allow some event-state pseudo classes like
:-moz-handled-clicktoplay to be used.

Also synchronize the privilege of pseudo classes in
non_ts_pseudo_class_list.rs and nsCSSPseudoClassList.h (except :fullscreen).

MozReview-Commit-ID: 8fUjjC8hbQO
2017-08-03 16:30:08 +08:00
Ting-Yu Lin
fd3b399d26 style: Rename PSEUDO_CLASS_INTERNAL to PSEUDO_CLASS_ENABLED_IN_UA_SHEETS
Some of the pseudo classes in nsCSSPseudoClassList are enabled only in UA
sheets but not in chrome. Rename the "internal" flag to "enabled in UA
sheets" to make the semantics clearer.

MozReview-Commit-ID: LKIiPk4pHFv
2017-08-03 16:30:03 +08:00
Simon Sapin
eb98ae6e04 Update cssparser to 0.18
https://github.com/servo/rust-cssparser/pull/171
2017-07-24 11:39:12 +02:00
Xidorn Quan
a307653581 Implement parsing of tree pseudo-elements. 2017-07-12 20:33:11 +10:00
Xidorn Quan
2649d0332a Call non-functional pseudo-elements simple pseudo-element. 2017-07-12 15:07:29 +10:00
Emilio Cobos Álvarez
d5a5a7ff16
style: Don't treat some document-state-related pseudo-classes as revalidation selectors. 2017-06-29 08:45:05 -07:00
Bobby Holley
1d242ad760 Store selectors in matching order, rather than parse order.
We add a slow in-place reverse during parsing to achieve this for now, which
gets fixed up later on.

MozReview-Commit-ID: 42QkOzSgV3T
2017-06-20 11:59:10 -07:00
Boris Zbarsky
eddca4d6f6 :-moz-locale-dir shouldn't be a revalidation selector.
Fixes Gecko bug 1374019 <https://bugzilla.mozilla.org/show_bug.cgi?id=1374019>
2017-06-17 23:01:02 -04:00
Simon Sapin
b83afdedc8 Upgrade cssparser to 0.15 2017-06-16 15:05:46 +02:00
Nazım Can Altınova
15fe48f3f6
stylo: Support :hover and :active quirk 2017-06-10 22:18:32 +03:00
Josh Matthews
27ae1ef2e7 Thread ParseError return values through CSS parsing. 2017-06-09 16:46:25 -04:00
Cameron McCormack
c7e2500311 style: Note :lang() as being sensitive to attributes. 2017-06-08 09:37:09 +08:00
Cameron McCormack
e299905606 style: Define types for pseudo-class string argument storage. 2017-06-08 09:37:09 +08:00
Cameron McCormack
17e5c19d70 style: Support matching :-moz-browser-frame and :-moz-table-border-nonzero against snapshots. 2017-06-06 12:26:45 +08:00
Bobby Holley
5ddabef636 Collapse Selector, SelectorInner, and ComplexSelector into a single Selector.
The refcounting is still internal. We'll fix that up next.

MozReview-Commit-ID: CTxZNaR3Qgj
2017-06-05 19:44:00 -07:00
Matt Brubeck
08a53a3810 Bug 1367315 - stylo: Make :dir argument a case-insensitive identifier 2017-06-05 11:09:23 -07:00
Manish Goregaokar
25d193ba34 stylo: Use namespace ids for content: attr(..)
MozReview-Commit-ID: FZ9YEpHQCBh
2017-06-01 14:11:31 -07:00
Emilio Cobos Álvarez
dd38117487
stylo: Parse but never match :-moz-placeholder as a pseudo-class.
Fixes bug 1366709.
2017-05-22 11:47:17 +02:00
Emilio Cobos Álvarez
522f8489d6
Bug 1364850: Move PseudoElement to be just another combinator in selectors. r=bholley
MozReview-Commit-ID: 8OoOIodkKJ5
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
2017-05-17 10:58:24 +02:00
Boris Zbarsky
e03e9de6d0 Add :-moz-is-html support for stylo. 2017-05-16 14:33:44 -04:00
Boris Zbarsky
993cb6eb41 Don't require style sharing cache invalidation for :dir 2017-05-16 09:55:37 -04:00
Simon Sapin
984d696717 Turns out, we never actual hash selectors 2017-05-16 10:24:50 +02:00
Emilio Cobos Álvarez
fe8da51fee
Bug 1364412: Properly reject to parse pseudo-element states that don't support state. r=bholley
MozReview-Commit-ID: KQCFPtOTGQI
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
2017-05-16 02:53:44 +02:00
Emilio Cobos Álvarez
5820e3ecac
Bug 1364412: Convert pseudo-elements to an enum. r=hiro,xidorn 2017-05-16 02:53:41 +02:00
Emilio Cobos Álvarez
84f5a90668
Bug 1364412: Use the pseudo selector to reject state selectors. r=bholley
MozReview-Commit-ID: 73dnp6nZpdU
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
2017-05-16 02:49:30 +02:00
Emilio Cobos Álvarez
10560ae043
Bug 1364412: Allow pseudo-element selectors to store state. r=bholley
MozReview-Commit-ID: CzAwg2uxqO2
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
2017-05-16 02:49:22 +02:00
Emilio Cobos Álvarez
46bf5d61f0
Bug 1355343: Take all the snapshots into account. r=bholley
I've chosen this approach mainly because there's no other good way to guarantee
the model is correct than holding the snapshots alive until a style refresh.

What I tried before this (storing them in a sort of "immutable element data") is
a pain, since we call into style from the frame constructor and other content
notifications, which makes keeping track of which snapshots should be cleared an
which shouldn't an insane task.

Ideally we'd have a single entry-point for style, but that's not the case right
now, and changing that requires pretty non-trivial changes to the frame
constructor.

MozReview-Commit-ID: FF1KWZv2iBM
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
2017-05-10 12:05:39 +02:00
Xidorn Quan
10b7001dd1 Make atom files generated at build-time. 2017-05-08 21:33:58 +10:00
Xidorn Quan
869e5e025e Rename gecko_ prefix of pseudo_element_helper file. 2017-05-08 21:33:53 +10:00
Bobby Holley
f4d81b010b Properly handle -moz-any for revalidation selectors.
Note that, while the comment is correct that there is a fair amount of -moz-any
usage in the UA sheet, it's always used as an ancestor selector, and thus ignored
for our purposes. Nevertheless, it's straightforward enough to support properly,
so we do that here.

MozReview-Commit-ID: Kz1yNfPUIaP
2017-04-27 11:13:11 -07:00
Emilio Cobos Álvarez
be0139ff3c
Bug 1331047: Implement the new traversal semantics for stylo. r=bholley,hiro
MozReview-Commit-ID: 4BXx9JpGZKX
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
2017-04-27 14:26:48 +02:00
Emilio Cobos Álvarez
e136863939
stylo: Fix a serialization bug for string pseudos.
The string is null-terminated, so we need to avoid passing that last null
character.
2017-04-24 19:28:11 +02:00
Bobby Holley
cf06e2bf1e Use Boxed slices for Empty and MozAny.
MozReview-Commit-ID: CmVK3u0vYn0
2017-04-20 15:00:50 -07:00
Bobby Holley
6d66ec5e11 Store selectors and combinators inline in a single sequence.
This improves cache locality and reduces allocations during parsing.

Note that this reverses the iteration order within a sequence of simple selectors,
but that shouldn't matter.
2017-04-20 15:00:43 -07:00
Emilio Cobos Álvarez
568fa4cc0d
style: Fix dynamic changes of attributes when combined with :not. 2017-04-13 01:00:59 +08:00