mirror of
https://github.com/servo/servo.git
synced 2025-08-03 20:50:07 +01:00
style: Remove an assertion that doesn't hold in some cases.
This commit is contained in:
parent
86b4b70369
commit
dceb58664e
1 changed files with 10 additions and 5 deletions
|
@ -159,13 +159,18 @@ where
|
||||||
// force a restyle here. Matching doesn't depend on the actual visited
|
// force a restyle here. Matching doesn't depend on the actual visited
|
||||||
// state at all, so we can't look at matching results to decide what to
|
// state at all, so we can't look at matching results to decide what to
|
||||||
// do for this case.
|
// do for this case.
|
||||||
if state_changes.intersects(ElementState::IN_VISITED_OR_UNVISITED_STATE) {
|
if state_changes.intersects(ElementState::IN_VISITED_OR_UNVISITED_STATE) &&
|
||||||
|
self.shared_context.visited_styles_enabled
|
||||||
|
{
|
||||||
trace!(" > visitedness change, force subtree restyle");
|
trace!(" > visitedness change, force subtree restyle");
|
||||||
// If we get here with visited links disabled, we should probably
|
// We shouldn't get here with visited links disabled, but it's hard
|
||||||
// just avoid the restyle and remove the state change here, not only
|
// to assert in cases where you record a visitedness change and
|
||||||
// as an optimization, but also because it kind of would kill the
|
// afterwards you change some of the stuff (like the pref) that
|
||||||
|
// changes whether visited styles are enabled.
|
||||||
|
//
|
||||||
|
// So just avoid the restyle here, because it kind of would kill the
|
||||||
// point of disabling visited links.
|
// 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
|
// We can't just return here because there may also be attribute
|
||||||
// changes as well that imply additional hints for siblings.
|
// changes as well that imply additional hints for siblings.
|
||||||
self.data.hint.insert(RestyleHint::restyle_subtree());
|
self.data.hint.insert(RestyleHint::restyle_subtree());
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue