diff options
author | Emilio Cobos Álvarez <emilio@crisal.io> | 2017-06-09 17:11:19 +0200 |
---|---|---|
committer | Emilio Cobos Álvarez <emilio@crisal.io> | 2017-06-13 13:27:06 +0200 |
commit | 4434509088bd22dbb94ec97ce90cc82925d01bd0 (patch) | |
tree | b4a50ff5a0715bd77f6720fe976393bf641cd00f /components/selectors/context.rs | |
parent | fdf90934662e331c4206c20613b9d387ba283803 (diff) | |
download | servo-4434509088bd22dbb94ec97ce90cc82925d01bd0.tar.gz servo-4434509088bd22dbb94ec97ce90cc82925d01bd0.zip |
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
Diffstat (limited to 'components/selectors/context.rs')
-rw-r--r-- | components/selectors/context.rs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/components/selectors/context.rs b/components/selectors/context.rs index c40c4b68ab4..12ebd977837 100644 --- a/components/selectors/context.rs +++ b/components/selectors/context.rs @@ -48,6 +48,12 @@ pub enum MatchingMode { pub enum VisitedHandlingMode { /// All links are matched as if they are unvisted. AllLinksUnvisited, + /// All links are matched as if they are visited and unvisited (both :link + /// and :visited match). + /// + /// This is intended to be used from invalidation code, to be conservative + /// about whether we need to restyle a link. + AllLinksVisitedAndUnvisited, /// A element's "relevant link" is the element being matched if it is a link /// or the nearest ancestor link. The relevant link is matched as though it /// is visited, and all other links are matched as if they are unvisited. |