mirror of
https://github.com/servo/servo.git
synced 2025-10-01 09:09:15 +01:00
Auto merge of #20082 - emilio:ignore-existing-styles, r=bholley
style: Cleanup always-false argument to Servo_ResolveStyleLazily. I changed this setup in https://bugzilla.mozilla.org/show_bug.cgi?id=1414999, because it was totally unsound. <!-- 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/20082) <!-- Reviewable:end -->
This commit is contained in:
commit
691f3be24a
4 changed files with 4 additions and 11 deletions
|
@ -3646,7 +3646,6 @@ pub extern "C" fn Servo_ResolveStyleLazily(
|
|||
rule_inclusion: StyleRuleInclusion,
|
||||
snapshots: *const ServoElementSnapshotTable,
|
||||
raw_data: RawServoStyleSetBorrowed,
|
||||
ignore_existing_styles: bool,
|
||||
) -> ServoStyleContextStrong {
|
||||
debug_assert!(!snapshots.is_null());
|
||||
let global_style_data = &*GLOBAL_STYLE_DATA;
|
||||
|
@ -3678,14 +3677,12 @@ pub extern "C" fn Servo_ResolveStyleLazily(
|
|||
let is_before_or_after = pseudo.as_ref().map_or(false, |p| p.is_before_or_after());
|
||||
|
||||
// In the common case we already have the style. Check that before setting
|
||||
// up all the computation machinery. (Don't use it when we're getting
|
||||
// default styles or in a bfcached document (as indicated by
|
||||
// ignore_existing_styles), though.)
|
||||
// up all the computation machinery.
|
||||
//
|
||||
// Also, only probe in the ::before or ::after case, since their styles may
|
||||
// not be in the `ElementData`, given they may exist but not be applicable
|
||||
// to generate an actual pseudo-element (like, having a `content: none`).
|
||||
if rule_inclusion == RuleInclusion::All && !ignore_existing_styles {
|
||||
if rule_inclusion == RuleInclusion::All {
|
||||
let styles = element.mutate_data().and_then(|d| {
|
||||
if d.has_styles() {
|
||||
finish(&d.styles, is_before_or_after)
|
||||
|
@ -3714,7 +3711,6 @@ pub extern "C" fn Servo_ResolveStyleLazily(
|
|||
&mut context,
|
||||
element,
|
||||
rule_inclusion,
|
||||
ignore_existing_styles,
|
||||
pseudo.as_ref()
|
||||
);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue