style: Fix ElementWrapper::is_link.

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
This commit is contained in:
Emilio Cobos Álvarez 2019-11-05 10:24:36 +00:00
parent d68d6f7c56
commit d797b0e475
No known key found for this signature in database
GPG key ID: E1152D0994E4BF8A
3 changed files with 7 additions and 9 deletions

View file

@ -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 {