mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
style: no-op visited changes earlier if visited links are disabled.
We force a repaint from ContentStateChangedInternal if visited links are disabled, and that's observable. Let's cut it off as early as we can to avoid timing attacks even when :visited is disabled. Differential Revision: https://phabricator.services.mozilla.com/D3304
This commit is contained in:
parent
cc1897597c
commit
87b1e1cdc9
2 changed files with 14 additions and 41 deletions
|
@ -167,8 +167,13 @@ where
|
|||
// do for this case.
|
||||
if state_changes.intersects(ElementState::IN_VISITED_OR_UNVISITED_STATE) {
|
||||
trace!(" > visitedness change, force subtree restyle");
|
||||
// If we get here with visited links disabled, we should probably
|
||||
// just avoid the restyle and remove the state change here, not only
|
||||
// as an optimization, but also because it kind of would kill the
|
||||
// point of disabling visited links.
|
||||
debug_assert!(self.shared_context.visited_styles_enabled);
|
||||
// We can't just return here because there may also be attribute
|
||||
// changes as well that imply additional hints.
|
||||
// changes as well that imply additional hints for siblings.
|
||||
self.data.hint.insert(RestyleHint::restyle_subtree());
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue