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

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