mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-28 21:28:55 +00:00
Bug 1591987 - Fix ElementWrapper::is_link. r=jwatt
And do a full restyle only when the state goes from visited to unvisited or vice versa. That is, use regular invalidation for addition or removals of href attributes, for example. Differential Revision: https://phabricator.services.mozilla.com/D50821 --HG-- extra : moz-landing-system : lando
This commit is contained in:
parent
799a5345a7
commit
e75a804980
@ -2191,8 +2191,7 @@ impl<'le> ::selectors::Element for GeckoElement<'le> {
|
||||
|
||||
#[inline]
|
||||
fn is_link(&self) -> bool {
|
||||
self.state()
|
||||
.intersects(NonTSPseudoClass::AnyLink.state_flag())
|
||||
self.state().intersects(ElementState::IN_VISITED_OR_UNVISITED_STATE)
|
||||
}
|
||||
|
||||
#[inline]
|
||||
|
@ -270,7 +270,10 @@ where
|
||||
}
|
||||
|
||||
fn is_link(&self) -> bool {
|
||||
self.element.is_link()
|
||||
match self.snapshot().and_then(|s| s.state()) {
|
||||
Some(state) => state.intersects(ElementState::IN_VISITED_OR_UNVISITED_STATE),
|
||||
None => self.element.is_link(),
|
||||
}
|
||||
}
|
||||
|
||||
fn opaque(&self) -> OpaqueElement {
|
||||
|
@ -159,14 +159,10 @@ where
|
||||
// doesn't depend on the actual visited state at all, so we can't look
|
||||
// at matching results to decide what to do for this case.
|
||||
//
|
||||
// TODO(emilio): This should be contains(), to avoid doing subtree
|
||||
// restyles when adding or removing an href attribute, but invalidation
|
||||
// for that case is broken right now (bug 1591987).
|
||||
//
|
||||
// This piece of code should be removed when
|
||||
// TODO(emilio): This piece of code should be removed when
|
||||
// layout.css.always-repaint-on-unvisited is true, since we cannot get
|
||||
// into this situation in that case.
|
||||
if state_changes.intersects(ElementState::IN_VISITED_OR_UNVISITED_STATE) {
|
||||
if state_changes.contains(ElementState::IN_VISITED_OR_UNVISITED_STATE) {
|
||||
trace!(" > visitedness change, force subtree restyle");
|
||||
// We can't just return here because there may also be attribute
|
||||
// changes as well that imply additional hints for siblings.
|
||||
|
Loading…
x
Reference in New Issue
Block a user