aboutsummaryrefslogtreecommitdiffstats
path: root/components/style/servo/selector_parser.rs
Commit message (Collapse)AuthorAgeFilesLines
...
* style: Tidy a couple things.Emilio Cobos Álvarez2018-03-141-8/+15
|
* style: Make Element::id not clone the attribute.Emilio Cobos Álvarez2018-02-241-2/+2
|
* style: Use CascadeFlags for what they're for.Emilio Cobos Álvarez2018-01-231-5/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Now that we have an Element around on cascade, we can stop using the cascade flags mechanism to pass various element-related state, like "is this element the root", or "should it use the item-based display fixup". That fixes handwaviness in the handling of those flags from style reparenting, and code duplication to handle tricky stuff like :visited. There are a number of other changes that are worth noticing: * skip_root_and_item_based_display_fixup is renamed to skip_item_display_fixup: TElement::is_root() already implies being the document element, which by definition is not native anonymous and not a pseudo-element. Thus, you never get fixed-up if your NAC or a pseudo, which is what the code tried to avoid, so the only fixup with a point is the item one, which is necessary. * The pseudo-element probing code was refactored to return early a Option::<CascadeInputs>::None, which is nicer than what it was doing. * The visited_links_enabled check has moved to selector-matching time. The rest of the checks aren't based on whether the element is a link, or are properly guarded by parent_style.visited_style().is_some() or visited_rules.is_some(). Thus you can transitively infer that no element will end up with a :visited style, not even from style reparenting. Anyway, the underlying reason why I want the element in StyleAdjuster is because we're going to implement an adjustment in there depending on the tag of the element (converting display: contents to display: none depending on the tag), so computing that information eagerly, including a hash lookup, wouldn't be nice.
* Rename SelectorMethods to Visit, after its one method.Simon Sapin2018-01-121-2/+2
|
* style: Add a document state invalidator.Emilio Cobos Álvarez2018-01-121-1/+2
|
* selectors: Allow defining an implementation-dependent field in the matching ↵Emilio Cobos Álvarez2018-01-121-0/+1
| | | | context.
* style: Remove unused SelectorImpl::pseudo_element_cascade_type.Emilio Cobos Álvarez2017-12-091-6/+0
|
* style: Make all keywords CamelCase for consistency.Emilio Cobos Álvarez2017-12-061-4/+3
| | | | This prevents confusion and paves the ground for derive(Parse) of them.
* Upgrade to rustc 1.23.0-nightly (02004ef78 2017-11-08)Simon Sapin2017-11-091-1/+0
|
* Bump bitflags to 1.0 in every servo crateBastien Orivel2017-10-301-12/+12
|
* Auto merge of #18962 - upsuper:tree-pseudos, r=emiliobors-servo2017-10-201-7/+6
|\ | | | | | | | | | | | | | | | | | | | | 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 -->
| * Add slots in PerPseudoElementMap for tree pseudos.Xidorn Quan2017-10-201-7/+6
| |
* | style: Record DocumentState dependencies.Cameron McCormack2017-10-201-1/+6
| |
* | style: Remove unused SelectorImpl::pseudo_class_state_flag.Cameron McCormack2017-10-201-6/+0
|/
* Backed out changeset e64e659c077d: servo PR #18809 and revendor for reftest ↵Gecko Backout2017-10-191-12/+12
| | | | | | 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
* Update bitflags to 1.0 in every servo crateBastien Orivel2017-10-191-12/+12
| | | | | It still needs dependencies update to remove all the other bitflags versions.
* Replace all uses of the `heapsize` crate with `malloc_size_of`.Nicholas Nethercote2017-10-181-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Servo currently uses `heapsize`, but Stylo/Gecko use `malloc_size_of`. `malloc_size_of` is better -- it handles various cases that `heapsize` does not -- so this patch changes Servo to use `malloc_size_of`. This patch makes the following changes to the `malloc_size_of` crate. - Adds `MallocSizeOf` trait implementations for numerous types, some built-in (e.g. `VecDeque`), some external and Servo-only (e.g. `string_cache`). - Makes `enclosing_size_of_op` optional, because vanilla jemalloc doesn't support that operation. - For `HashSet`/`HashMap`, falls back to a computed estimate when `enclosing_size_of_op` isn't available. - Adds an extern "C" `malloc_size_of` function that does the actual heap measurement; this is based on the same functions from the `heapsize` crate. This patch makes the following changes elsewhere. - Converts all the uses of `heapsize` to instead use `malloc_size_of`. - Disables the "heapsize"/"heap_size" feature for the external crates that provide it. - Removes the `HeapSizeOf` implementation from `hashglobe`. - Adds `ignore` annotations to a few `Rc`/`Arc`, because `malloc_size_of` doesn't derive those types, unlike `heapsize`.
* style: Remove the ElementExt trait.Emilio Cobos Álvarez2017-10-161-10/+1
| | | | It is likely it's the most useless trait ever existing.
* Update to cssparser 0.22 (source location in error types)Simon Sapin2017-10-101-24/+26
|
* order derivable traits listsClément DAVID2017-08-231-2/+2
| | | | | | Ignoring : - **generated**.rs - python/tidy/servo_tidy_tests/rust_tidy.rs
* stylo: Remove a lot of the restyle damage related complexity.Emilio Cobos Álvarez2017-08-201-2/+14
| | | | | | | | | | The only reason why we had the `existing_style_for_style_damage` bit is to apply some optimizations that we don't have anymore. I still want to reintroduce a few of them, at least for the non-eager pseudo-element case... But I think I won't need this at all. This allows us to remove a fair amount of Gecko code too.
* style: Use an enumerated array for per-pseudo maps.Emilio Cobos Álvarez2017-08-081-22/+15
| | | | | | | This avoids random HashMaps. MozReview-Commit-ID: LQeZrLsoOnl Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
* style: Don't perform parent display-based style fixups on most pseudos.Cameron McCormack2017-08-051-0/+7
|
* style: Move nsStyleContext::mParent to GeckoStyleContext.Emilio Cobos Álvarez2017-08-031-0/+5
| | | | | | | | | | | | | | | | Unfortunately this means that we lose the NS_STYLE_INHERIT_BIT optimization to avoid posting changes if we had not requested the struct. In practice, I'm not sure this optimization matters much, though, and we already compare all the structs anyway. We _could_ keep a weak parent pointer from the text style if needed, given we're going to keep alive the text style at least until the parent style context goes away, so should be safe, but I don't think the extra churn is worth it, to be honest. Happy to do so as part of bug 1368290 if you think it's worth it. Bug: 1385896 Reviewed-by: heycam MozReview-Commit-ID: ka6tNwf4Ke
* Make sure we don't recreate boxes just because we have a ::first-line.Boris Zbarsky2017-07-281-0/+8
| | | | Servo part of part 5 of the fix for Gecko bug 1324619. r=emilio
* Don't reconstruct the layout object when going from no pseudo to pseudo with ↵Boris Zbarsky2017-07-281-0/+17
| | | | | | no content for ::before and ::after. Fixes Gecko bug 1376073. r=emilio
* Update cssparser to 0.18Simon Sapin2017-07-241-7/+6
| | | | https://github.com/servo/rust-cssparser/pull/171
* Filter out non-applying properties when cascading style for ↵Boris Zbarsky2017-07-211-0/+13
| | | | | | ::first-letter/::first-line/::placeholder. r=emilio Part 3 of the fix for Gecko bug 1382786 <https://bugzilla.mozilla.org/show_bug.cgi?id=1382786>.
* Fix tidyManish Goregaokar2017-07-171-1/+1
|
* stylo: Switch Gecko over to ServoStyleContextManish Goregaokar2017-07-171-0/+3
|
* Call non-functional pseudo-elements simple pseudo-element.Xidorn Quan2017-07-121-2/+2
|
* Reframe less on restyles that involve nonexistent first-letter frames in Gecko.Boris Zbarsky2017-06-261-0/+7
| | | | Gecko bug 1324618 part 9 servo bits: https://bugzilla.mozilla.org/show_bug.cgi?id=1324618
* Upgrade cssparser to 0.15Simon Sapin2017-06-161-5/+5
|
* style: Implement a more fine-grained invalidation method.Emilio Cobos Álvarez2017-06-131-1/+1
| | | | | | | | | | | This commit also removes the old restyle_hints module and splits it into multiple modules under components/style/invalidation/element/. The basic approach is to walk down the tree using compound selectors as needed, in order to do as little selector-matching as possible. Bug: 1368240 MozReview-Commit-ID: 2YO8fKFygZI
* Record whether an snapshot is recording a class attribute change or id change.Emilio Cobos Álvarez2017-06-131-0/+24
| | | | | | | | I'll use this information in order to get fewer dependencies out of the dependency set. Bug: 1368240 MozReview-Commit-ID: 5HlmKmSNO8p
* ID and class selectors are ASCII case-insensitive in quirks mode.Simon Sapin2017-06-121-4/+4
| | | | https://bugzilla.mozilla.org/show_bug.cgi?id=1363778
* stylo: Support :hover and :active quirkNazım Can Altınova2017-06-101-0/+6
|
* Thread ParseError return values through CSS parsing.Josh Matthews2017-06-091-26/+30
|
* style: Match :lang() using snapshots correctly.Cameron McCormack2017-06-081-1/+7
|
* style: Note :lang() as being sensitive to attributes.Cameron McCormack2017-06-081-1/+1
|
* style: Define types for pseudo-class string argument storage.Cameron McCormack2017-06-081-1/+4
|
* style: Clean up extended_filtering a bit.Cameron McCormack2017-06-081-25/+20
|
* script: Move extended_filtering to the style crate.Cameron McCormack2017-06-081-0/+58
| | | | | We'll need to call it from the style crate in later patches, when matching :lang() against element snapshots.
* style: Support matching :-moz-browser-frame and :-moz-table-border-nonzero ↵Cameron McCormack2017-06-061-0/+6
| | | | against snapshots.
* stylo: Use namespace ids for content: attr(..)Manish Goregaokar2017-06-011-2/+2
| | | | MozReview-Commit-ID: FZ9YEpHQCBh
* Look for relevant links while matchingJ. Ryan Stinnett2017-05-241-8/+0
| | | | | | | | | | | | | | | | | Adjust the matching process to look for a "relevant link" while matching. A "relevant link" is the element being matched if it is a link or the nearest ancestor link. Matching for links now depends on the `VisitedHandlingMode`, which determines whether all links match as if they are unvisited (the default) or if the relevant link matches as visited (and all others remain unvisited). If a relevant link is ever found for any selector, track this as part of the `MatchingContext` object. This is used in the next patch to determine if an additional match and cascade should be performed to compute the styles when visited. MozReview-Commit-ID: 3xUbRo7vpuD
* Stylo: match both ::placehoder & ::moz-placeholder for placeholder ↵cku2017-05-241-0/+6
| | | | pseudo-elements.
* ol[type=…] and li[type=…] preshints need to be case-sensitiveSimon Sapin2017-05-181-7/+26
|
* Shrink selectors::Component, add case-insensitive for other attr selectorsSimon Sapin2017-05-181-7/+6
| | | | | * https://bugzilla.mozilla.org/show_bug.cgi?id=1364148 * https://bugzilla.mozilla.org/show_bug.cgi?id=1364162
* Simplify rust-selectors API for attribute selectorsSimon Sapin2017-05-181-17/+22
|