mirror of
https://github.com/servo/servo.git
synced 2025-10-01 17:19:16 +01:00
Auto merge of #17959 - emilio:no-moar-parent, r=heycam
style: Move nsStyleContext::mParent to GeckoStyleContext. Unfortunately this means that we lose the NS_STYLE_INHERIT_BIT optimization to avoid posting changes if we had not requested the struct. In practice, I'm not sure this optimization matters much, though, and we already compare all the structs anyway. We _could_ keep a weak parent pointer from the text style if needed, given we're going to keep alive the text style at least until the parent style context goes away, so should be safe, but I don't think the extra churn is worth it, to be honest. Happy to do so as part of bug 1368290 if you think it's worth it. Bug: 1385896 Reviewed-by: heycam MozReview-Commit-ID: ka6tNwf4Ke <!-- 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/17959) <!-- Reviewable:end -->
This commit is contained in:
commit
452268eca9
7 changed files with 48 additions and 5 deletions
|
@ -1783,6 +1783,7 @@ pub extern "C" fn Servo_ComputedValues_Inherit(
|
|||
#[no_mangle]
|
||||
pub extern "C" fn Servo_ComputedValues_GetStyleBits(values: ServoStyleContextBorrowed) -> u64 {
|
||||
use style::properties::computed_value_flags::*;
|
||||
// FIXME(emilio): We could do this more efficiently I'm quite sure.
|
||||
let flags = values.flags;
|
||||
let mut result = 0;
|
||||
if flags.contains(IS_RELEVANT_LINK_VISITED) {
|
||||
|
@ -1797,6 +1798,12 @@ pub extern "C" fn Servo_ComputedValues_GetStyleBits(values: ServoStyleContextBor
|
|||
if flags.contains(IS_TEXT_COMBINED) {
|
||||
result |= structs::NS_STYLE_IS_TEXT_COMBINED as u64;
|
||||
}
|
||||
if flags.contains(IS_IN_PSEUDO_ELEMENT_SUBTREE) {
|
||||
result |= structs::NS_STYLE_HAS_PSEUDO_ELEMENT_DATA as u64;
|
||||
}
|
||||
if flags.contains(IS_IN_DISPLAY_NONE_SUBTREE) {
|
||||
result |= structs::NS_STYLE_IN_DISPLAY_NONE_SUBTREE as u64;
|
||||
}
|
||||
result
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue