diff options
author | bors-servo <lbergstrom+bors@mozilla.com> | 2018-09-03 08:12:22 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-09-03 08:12:22 -0400 |
commit | d8446f85a95723dec3a18b05bdd30514a57bddab (patch) | |
tree | 3e92a0a5fed4315519a34e8cef33c54840ada0d4 /components/style/invalidation/element/state_and_attributes.rs | |
parent | eb6aec37e9bde5aba2a3dc6b6ce5374579219f31 (diff) | |
parent | 1254cbf313243e8879a464538a5c78383ba3bc8b (diff) | |
download | servo-d8446f85a95723dec3a18b05bdd30514a57bddab.tar.gz servo-d8446f85a95723dec3a18b05bdd30514a57bddab.zip |
Auto merge of #21588 - emilio:gecko-sync, r=emilio
style: Sync changes from mozilla-central.
See each individual commit for details.
https://bugzilla.mozilla.org/show_bug.cgi?id=1488172
<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/21588)
<!-- Reviewable:end -->
Diffstat (limited to 'components/style/invalidation/element/state_and_attributes.rs')
-rw-r--r-- | components/style/invalidation/element/state_and_attributes.rs | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/components/style/invalidation/element/state_and_attributes.rs b/components/style/invalidation/element/state_and_attributes.rs index 1eb022b298a..fa0ccdd8be9 100644 --- a/components/style/invalidation/element/state_and_attributes.rs +++ b/components/style/invalidation/element/state_and_attributes.rs @@ -159,13 +159,18 @@ where // 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 // 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"); - // 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 + // We shouldn't get here with visited links disabled, but it's hard + // to assert in cases where you record a visitedness change and + // 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. - 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 for siblings. self.data.hint.insert(RestyleHint::restyle_subtree()); |