diff options
author | Emilio Cobos Álvarez <emilio@crisal.io> | 2017-12-18 11:58:59 +0100 |
---|---|---|
committer | Emilio Cobos Álvarez <emilio@crisal.io> | 2018-01-09 14:26:03 +0100 |
commit | ce1d8cd232dfbc9e0a52f9467ba2bc209087ea63 (patch) | |
tree | 247174638e834b872e457d9ccbf89c71772d5eba /ports | |
parent | 5115cbd1c0e0d2c1a791c285ed0bf443e1fd7fca (diff) | |
download | servo-ce1d8cd232dfbc9e0a52f9467ba2bc209087ea63.tar.gz servo-ce1d8cd232dfbc9e0a52f9467ba2bc209087ea63.zip |
style: Make invalidation state also be with the ::slotted rules.
MozReview-Commit-ID: GYmsXYvL9vj
Diffstat (limited to 'ports')
-rw-r--r-- | ports/geckolib/glue.rs | 31 |
1 files changed, 6 insertions, 25 deletions
diff --git a/ports/geckolib/glue.rs b/ports/geckolib/glue.rs index e12b4d1307d..f38346a1532 100644 --- a/ports/geckolib/glue.rs +++ b/ports/geckolib/glue.rs @@ -4326,25 +4326,14 @@ pub extern "C" fn Servo_StyleSet_MightHaveAttributeDependency( ) -> bool { let data = PerDocumentStyleData::from_ffi(raw_data).borrow(); let element = GeckoElement(element); - let mut has_dep = false; unsafe { Atom::with(local_name, |atom| { - has_dep = data.stylist.might_have_attribute_dependency(atom); - - if !has_dep { - // TODO(emilio): Consider optimizing this storing attribute - // dependencies from UA sheets separately, so we could optimize - // the above lookup if cut_off_inheritance is true. - element.each_xbl_stylist(|stylist| { - has_dep = - has_dep || stylist.might_have_attribute_dependency(atom); - }); - } + data.stylist.any_applicable_rule_data(element, |data, _| { + data.might_have_attribute_dependency(atom) + }) }) } - - has_dep } #[no_mangle] @@ -4358,17 +4347,9 @@ pub extern "C" fn Servo_StyleSet_HasStateDependency( let state = ElementState::from_bits_truncate(state); let data = PerDocumentStyleData::from_ffi(raw_data).borrow(); - let mut has_dep = data.stylist.has_state_dependency(state); - if !has_dep { - // TODO(emilio): Consider optimizing this storing attribute - // dependencies from UA sheets separately, so we could optimize - // the above lookup if cut_off_inheritance is true. - element.each_xbl_stylist(|stylist| { - has_dep = has_dep || stylist.has_state_dependency(state); - }); - } - - has_dep + data.stylist.any_applicable_rule_data(element, |data, _| { + data.has_state_dependency(state) + }) } #[no_mangle] |