mirror of
https://github.com/servo/servo.git
synced 2025-09-08 14:08:22 +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
|
@ -67,8 +67,9 @@ use style::keyframes::KeyframesStepValue;
|
|||
use style::media_queries::{MediaList, parse_media_query_list};
|
||||
use style::parallel;
|
||||
use style::parser::{ParserContext, ParserContextExtraData};
|
||||
use style::properties::{ComputedValues, Importance, ParsedDeclaration};
|
||||
use style::properties::{CascadeFlags, ComputedValues, Importance, ParsedDeclaration};
|
||||
use style::properties::{PropertyDeclarationBlock, PropertyId};
|
||||
use style::properties::SKIP_ROOT_AND_ITEM_BASED_DISPLAY_FIXUP;
|
||||
use style::properties::animated_properties::{AnimationValue, Interpolate, TransitionProperty};
|
||||
use style::properties::parse_one_declaration;
|
||||
use style::restyle_hints::{self, RestyleHint};
|
||||
|
@ -618,8 +619,9 @@ pub extern "C" fn Servo_MediaRule_GetCssText(rule: RawServoMediaRuleBorrowed, re
|
|||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn Servo_ComputedValues_GetForAnonymousBox(parent_style_or_null: ServoComputedValuesBorrowedOrNull,
|
||||
pseudo_tag: *mut nsIAtom,
|
||||
raw_data: RawServoStyleSetBorrowed)
|
||||
pseudo_tag: *mut nsIAtom,
|
||||
skip_display_fixup: bool,
|
||||
raw_data: RawServoStyleSetBorrowed)
|
||||
-> ServoComputedValuesStrong {
|
||||
let data = PerDocumentStyleData::from_ffi(raw_data).borrow_mut();
|
||||
let atom = Atom::from(pseudo_tag);
|
||||
|
@ -627,8 +629,13 @@ pub extern "C" fn Servo_ComputedValues_GetForAnonymousBox(parent_style_or_null:
|
|||
|
||||
|
||||
let maybe_parent = ComputedValues::arc_from_borrowed(&parent_style_or_null);
|
||||
let mut cascade_flags = CascadeFlags::empty();
|
||||
if skip_display_fixup {
|
||||
cascade_flags.insert(SKIP_ROOT_AND_ITEM_BASED_DISPLAY_FIXUP);
|
||||
}
|
||||
data.stylist.precomputed_values_for_pseudo(&pseudo, maybe_parent,
|
||||
data.default_computed_values(), false)
|
||||
data.default_computed_values(),
|
||||
cascade_flags)
|
||||
.values.unwrap()
|
||||
.into_strong()
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue