Commit graph

17 commits

Author SHA1 Message Date
Emilio Cobos Álvarez
3119db724a
selectors: Simplify :visited by only using the "is inside link" information.
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.
2017-12-08 05:35:12 +01:00
Xidorn Quan
2dc714f0ac Implement XUL tree pseudo style resolution for stylo. 2017-10-20 14:08:56 +11:00
Emilio Cobos Álvarez
b0e54968ec
style: Make MatchingContext generic over SelectorImpl.
This will help Xidorn implement tree pseudos, and in general makes sense,
allowing to put specific matching data in a selectors implementation.
2017-10-19 11:33:13 +02:00
Emilio Cobos Álvarez
11485edc9e
style: Hide LocalMatchingContext.
This type is a lot of complexity related to a very specific thing such as the
hover and active quirk.

Instead of that, move `nesting_level` to `MatchingContext`, and simplify all
this computing whether the quirk applies upfront, for each complex selector we
test.

This is less error-prone, and also allows simplifying more stuff in a bit.
2017-10-14 17:03:35 +02:00
Xidorn Quan
ab46a0bbe0 Add support for :scope pseudo-class 2017-10-09 22:04:08 +11:00
Emilio Cobos Álvarez
36223fc16d
style: Cleanup MatchingContext construction. 2017-10-07 13:02:32 +02:00
Bobby Holley
438740b912 Implement an nth-index cache.
MozReview-Commit-ID: Ee0um3QXkxl
2017-09-21 15:25:38 -07:00
Bobby Holley
48466bf876 Introduce an NthIndexCache type and pipe it from ThreadLocalStyleContext to MatchingContext.
Some future refactoring here to pass fewer things as parameters would be nice.
2017-09-20 23:22:38 -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
Gecko Backout
f022936ebb Backed out changeset a417b9d7712d for vendoring bustage. r=backout on a CLOSED TREE
Backs out https://github.com/servo/servo/pull/17565
2017-07-28 22:06:00 +00:00
Nikhil Shagrithaya
8ebd70d402 Run the async HTML Tokenizer on a new thread 2017-07-24 23:54:07 +05:30
Emilio Cobos Álvarez
6d6c80e79b
style: Remove StyleRelations.
They're unused now. We can add them back if needed.

MozReview-Commit-ID: 92Y2Na0ZbVn
2017-07-12 09:26:55 +02:00
Emilio Cobos Álvarez
95a2ac51c4
style: Remove unused AFFECTED_BY_PSEUDO_ELEMENTS StyleRelation.
MozReview-Commit-ID: yHldvHm87b
2017-07-12 08:39:25 +02:00
Emilio Cobos Álvarez
4434509088
style: Add an AllLinksVisitedAndUnvisited for invalidation.
Otherwise, tests like the following fail, given we always match as unvisited,
and we'd never mark the link as needing invalidation.

<!doctype html>
<style>
a {
  color: red !important;
}

.foo :visited {
  color: green !important;
}
</style>
<div>
  <a href="https://google.es">visit me</a>
  <button onclick="this.parentNode.className = 'foo'">Then click me</button>
</div>

Bug: 1368240
MozReview-Commit-ID: LDv6S28c4ju
2017-06-13 13:27:06 +02:00
Simon Sapin
b82713924c Pre-compute classes and IDs case-sensitivity 2017-06-13 00:36:12 +02:00
Simon Sapin
9316c41bf7 Make MatchingContext::quirks_mode field private, add read-only accessor. 2017-06-13 00:35:56 +02:00
Simon Sapin
700aaf2bd6 Move MatchingContext to a new module 2017-06-13 00:31:29 +02:00