mirror of
https://github.com/servo/servo.git
synced 2025-08-10 07:55:33 +01:00
Auto merge of #15910 - bzbarsky:anon-box-nofixup, r=emilio
Add support for skipping display fixup for pseudos. This is needed for https://bugzilla.mozilla.org/show_bug.cgi?id=1346481 <!-- Please describe your changes on the following line: --> --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [X] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors - [ ] These changes fix #__ (github issue number if applicable). <!-- Either: --> - [ ] There are tests for these changes OR - [X] These changes do not require tests because will be tested on the Gecko side <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> <!-- 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/15910) <!-- Reviewable:end -->
This commit is contained in:
commit
e648ebd161
4 changed files with 24 additions and 15 deletions
|
@ -1666,6 +1666,7 @@ extern "C" {
|
|||
pub fn Servo_ComputedValues_GetForAnonymousBox(parent_style_or_null:
|
||||
ServoComputedValuesBorrowedOrNull,
|
||||
pseudoTag: *mut nsIAtom,
|
||||
skip_display_fixup: bool,
|
||||
set:
|
||||
RawServoStyleSetBorrowed)
|
||||
-> ServoComputedValuesStrong;
|
||||
|
|
|
@ -14,7 +14,9 @@ use keyframes::KeyframesAnimation;
|
|||
use media_queries::Device;
|
||||
use parking_lot::RwLock;
|
||||
use pdqsort::sort_by;
|
||||
use properties::{self, CascadeFlags, ComputedValues, INHERIT_ALL};
|
||||
use properties::{self, CascadeFlags, ComputedValues};
|
||||
#[cfg(feature = "servo")]
|
||||
use properties::INHERIT_ALL;
|
||||
use properties::PropertyDeclarationBlock;
|
||||
use restyle_hints::{RestyleHint, DependencySet};
|
||||
use rule_tree::{CascadeLevel, RuleTree, StrongRuleNode, StyleSource};
|
||||
|
@ -294,7 +296,7 @@ impl Stylist {
|
|||
pseudo: &PseudoElement,
|
||||
parent: Option<&Arc<ComputedValues>>,
|
||||
default: &Arc<ComputedValues>,
|
||||
inherit_all: bool)
|
||||
cascade_flags: CascadeFlags)
|
||||
-> ComputedStyle {
|
||||
debug_assert!(SelectorImpl::pseudo_element_cascade_type(pseudo).is_precomputed());
|
||||
|
||||
|
@ -308,11 +310,6 @@ impl Stylist {
|
|||
None => self.rule_tree.root(),
|
||||
};
|
||||
|
||||
let mut flags = CascadeFlags::empty();
|
||||
if inherit_all {
|
||||
flags.insert(INHERIT_ALL)
|
||||
}
|
||||
|
||||
// NOTE(emilio): We skip calculating the proper layout parent style
|
||||
// here.
|
||||
//
|
||||
|
@ -335,7 +332,7 @@ impl Stylist {
|
|||
default,
|
||||
None,
|
||||
Box::new(StdoutErrorReporter),
|
||||
flags);
|
||||
cascade_flags);
|
||||
ComputedStyle::new(rule_node, Arc::new(computed))
|
||||
}
|
||||
|
||||
|
@ -363,7 +360,11 @@ impl Stylist {
|
|||
unreachable!("That pseudo doesn't represent an anonymous box!")
|
||||
}
|
||||
};
|
||||
self.precomputed_values_for_pseudo(&pseudo, Some(parent_style), default_style, inherit_all)
|
||||
let mut cascade_flags = CascadeFlags::empty();
|
||||
if inherit_all {
|
||||
cascade_flags.insert(INHERIT_ALL);
|
||||
}
|
||||
self.precomputed_values_for_pseudo(&pseudo, Some(parent_style), default_style, cascade_flags)
|
||||
.values.unwrap()
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue