aboutsummaryrefslogtreecommitdiffstats
path: root/components/style/invalidation
Commit message (Collapse)AuthorAgeFilesLines
...
* style: Convert FnvHash{Set,Map} instances to FxHash{Set,Map}.Nicholas Nethercote2018-08-082-8/+8
| | | | | Bug: 1477628 Reviewed-by: heycam
* style: Make svg:use use an actual shadow tree.Emilio Cobos Álvarez2018-07-241-4/+0
| | | | | | | | | | | | | | | | | This fixes a couple fuzz bugs and prevents special-casing <svg:use> even more in bug 1431255. Unfortunately not as many hacks went away as I'd have hoped, since we still need to match document rules, see the linked SVGWG issues. But blocks_ancestor_combinators goes away, which is nice since it's on a very hot path. Bug: 1450250 Reviewed-by: heycam Differential Revision: https://phabricator.services.mozilla.com/D2154 MozReview-Commit-ID: C4mthjoSNFh
* Run rustfmt on selectors, servo_arc, and style.Bobby Holley2018-04-108-391/+374
| | | | | | | | | | 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)
* Manual fixups so that the rustfmt output won't trigger tidy.Bobby Holley2018-04-101-1/+2
|
* style: Implement the functional :host(..) selector.Emilio Cobos Álvarez2018-04-102-28/+21
| | | | | | | | | We could invalidate in a slightly more fine-grained way, but I don't think it's worth the churn vs. keeping the special-cases minimal. Bug: 1452640 Reviewed-by: xidorn MozReview-Commit-ID: 5DkQrgwg9GW
* style: Implement the non-functional :host selector.Emilio Cobos Álvarez2018-04-091-40/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* style: Add infrastructure to match :host.Emilio Cobos Álvarez2018-03-141-10/+19
|
* style: Separate the XBL and shadow dom styling bits.Emilio Cobos Álvarez2018-03-071-4/+4
| | | | | | Bug: 1441022 Reviewed-by: xidorn MozReview-Commit-ID: 2W0BmZ8wWXg
* style: Indent properly a couple more functions.Emilio Cobos Álvarez2018-02-241-2/+4
|
* style: Make Element::id not clone the attribute.Emilio Cobos Álvarez2018-02-242-9/+11
|
* style: Remove get_ prefix from get_state and get_id.Emilio Cobos Álvarez2018-02-243-4/+4
|
* selectors: Remove the get_ prefix from get_local_name and get_namespace.Emilio Cobos Álvarez2018-02-242-10/+15
|
* Add sizeof for AuthorStyles.Xidorn Quan2018-02-191-3/+2
|
* style: Make XBL / Shadow DOM use something more light-weight than a Stylist.Emilio Cobos Álvarez2018-02-161-3/+2
| | | | | | | | | It's just a struct aggregating stylesheets + CascadeData, with a quirks_mode parameter because XBL sucks so bad. Bug: 1436059 Reviewed-by: xidorn MozReview-Commit-ID: 7q99tSNXo0K
* style: Optimize @keyframes rule insertions.Emilio Cobos Álvarez2018-02-051-4/+15
| | | | | | Bug: 1435214 Reviewed-by: xidorn,hiro MozReview-Commit-ID: AHwhZynLBv
* style: Make insertion of @font-face rules not necessarily restyle the whole ↵Emilio Cobos Álvarez2018-02-051-2/+6
| | | | | | | | document. Bug: 1435214 Reviewed-by: xidorn MozReview-Commit-ID: 5ewKiShUHNi
* style: Temporarily use OrderMap on Gecko.Emilio Cobos Álvarez2018-01-311-2/+2
| | | | This will allow us to discard std hash map as a source of crashes.
* style: Fix sheet invalidation in quirks mode documents.Emilio Cobos Álvarez2018-01-301-11/+14
| | | | Bug: 1433589
* selectors: Never match ::slotted on <slot>s.Emilio Cobos Álvarez2018-01-271-0/+4
| | | | | This fixes the test from https://github.com/w3c/web-platform-tests/pull/9212 in Gecko.
* style: Look at the snapshots when invalidating due to stylesheet changes.Emilio Cobos Álvarez2018-01-272-24/+71
| | | | | | | | | Otherwise removal of stylesheets may get out of sync with other DOM changes, and we may fail to invalidate the style of the affected elements. Bug: 1432850 Reviewed-by: bz MozReview-Commit-ID: DrMTgLzQcnk
* style: Track the visited-handling-mode on the MatchingContext.Emilio Cobos Álvarez2018-01-191-6/+2
| | | | | | | | | Instead of on the stack. This fixes bugs where we're not passing the value around correctly, like from ::-moz-any. This is a fix for https://bugzilla.mozilla.org/show_bug.cgi?id=1431539.
* selectors: Add a MatchingContext::nest function, make nesting_level private.Emilio Cobos Álvarez2018-01-191-5/+4
|
* style: Hook in the document invalidator.Emilio Cobos Álvarez2018-01-172-12/+31
| | | | | | Bug: 1409672 Reviewed-by: xidorn MozReview-Commit-ID: EoSMrYPS7dl
* style: Fix slotted invalidation.Emilio Cobos Álvarez2018-01-172-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | This is a partial revert of https://github.com/servo/servo/commit/ce1d8cd232dfbc9e0a52f9467ba2bc209087ea63 If you're in a shadow tree, you may not be slotted but you still need to look at the slotted rules, since a <slot> could be a descendant of yours. Just use the same invalidation map everywhere, and remove complexity. This means that we can do some extra work while trying to gather invalidation if there are slotted rules, but I don't think it's a problem. The test is ported from https://cs.chromium.org/chromium/src/third_party/WebKit/LayoutTests/fast/css/invalidation/slotted.html?l=1&rcl=58d68fdf783d7edde1c82a642e037464861f2787 Curiously, Blink fails the test as written, presumably because they don't flush styles from getComputedStyle correctly (in their test they do via updateStyleAndReturnAffectedElementCount), due to <slot>s not being in the flat tree in their implementation. Bug: 1429846 Reviewed-by: heycam MozReview-Commit-ID: 6b7BQ6bGMgd
* Optimize selector matching for some common cases.Xidorn Quan2018-01-171-2/+2
|
* Rename SelectorMethods to Visit, after its one method.Simon Sapin2018-01-121-1/+1
|
* style: Use Default for ExtraStyleData instead of Option.Emilio Cobos Álvarez2018-01-121-2/+11
|
* style: Add a comment about figuring out what the best way to deal with XBL is.Emilio Cobos Álvarez2018-01-121-0/+3
|
* style: Use a more compact form for should_process_descendants.Emilio Cobos Álvarez2018-01-122-10/+7
|
* style: Add a document state invalidator.Emilio Cobos Álvarez2018-01-122-0/+99
|
* style: Track document state dependencies in the invalidation maps.Emilio Cobos Álvarez2018-01-121-4/+39
|
* style: Add a couple FIXMEs I've noticed while working on this.Emilio Cobos Álvarez2018-01-121-0/+3
| | | | ::slotted is hard.
* style: Factor out a few invalidation functions that are going to be shared soon.Emilio Cobos Álvarez2018-01-111-26/+49
|
* style: Move invalidation::element::collector to ↵Emilio Cobos Álvarez2018-01-112-1/+1
| | | | | | invalidation::element::state_and_attributes. Since it's what that file is about.
* style: Make invalidation state also be with the ::slotted rules.Emilio Cobos Álvarez2018-01-091-13/+11
| | | | MozReview-Commit-ID: GYmsXYvL9vj
* style: Add invalidation support for ::slotted().Emilio Cobos Álvarez2018-01-093-91/+225
| | | | | | Bug: 1424607 Reviewed-by: heycam MozReview-Commit-ID: 8pIVUx27o7x
* style: Implement GeckoElement::assigned_slot.Emilio Cobos Álvarez2018-01-081-0/+5
| | | | | | | | This allows to selector-match ::slotted, though we still don't parse it. Bug: 1425755 Reviewed-by: heycam MozReview-Commit-ID: ItELHkf2PMl
* style: Use the ? operator for OptionMatt Brubeck2017-12-091-4/+1
|
* selectors: Simplify :visited by only using the "is inside link" information.Emilio Cobos Álvarez2017-12-082-27/+24
| | | | | | | | | | | | | | | | | | | Right now we go through a lot of hoops to see if we ever see a relevant link. However, that information is not needed: if the element is a link, we'll always need to compute its visited style because its its own relevant link. If the element inherits from a link, we need to also compute the visited style anyway. So the "has a relevant link been found" is pretty useless when we know what are we inheriting from. The branches at the beginning of matches_complex_selector_internal were affecting performance, and there are no good reasons to keep them. I've verified that this passes all the visited tests in mozilla central, and that the test-cases too-flaky to be landed still pass.
* style: Bail out from invalidation if we're the root and got tons of ↵Emilio Cobos Álvarez2017-11-301-0/+11
| | | | | | | | descendant invalidations. Bug: 1420741 Reviewed-by: heycam MozReview-Commit-ID: 4Kja20Ep9qD
* Auto merge of #19426 - emilio:cache-invalidation, r=xidornbors-servo2017-11-291-2/+2
|\ | | | | | | | | | | | | | | style: Require an nth-index cache for invalidation. <!-- 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/19426) <!-- Reviewable:end -->
| * style: Require an nth-index cache for invalidation.Emilio Cobos Álvarez2017-11-291-2/+2
| |
* | style: Log a bit more information about invalidation collection.Emilio Cobos Álvarez2017-11-292-3/+18
|/
* style: :dir() pseudo class now represented by enumMichael Wilson2017-11-152-19/+15
| | | | Fixes #19195
* style: Remove some unneeded indirections in the invalidation code.Emilio Cobos Álvarez2017-11-041-6/+6
| | | | | MozReview-Commit-ID: 5h5SE3ieC0A Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
* Backed out changeset dbd300f4d75b for build bustage. r=backout on a CLOSED TREEGecko Backout2017-11-031-6/+6
| | | | Backs out https://github.com/servo/servo/pull/19108
* style: Remove some unneeded indirections in the invalidation code.Emilio Cobos Álvarez2017-11-031-6/+6
| | | | MozReview-Commit-ID: 5h5SE3ieC0A
* Bump bitflags to 1.0 in every servo crateBastien Orivel2017-10-304-48/+48
|
* Auto merge of #19060 - emilio:invalidation-fishy, r=noxbors-servo2017-10-301-1/+5
|\ | | | | | | | | | | | | | | | | | | | | style: Fix some fishiness in the invalidation code. See individual commits for details, I think this is not observable. <!-- 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/19060) <!-- Reviewable:end -->
| * style: Properly forward ElementWrapper::blocks_ancestor_combinators.Emilio Cobos Álvarez2017-10-301-0/+4
| | | | | | | | | | Not doing it is buggy. I think the only outcome of it is that we may over-invalidate, so it's probably not a huge deal, but worth doing it.