aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbors-servo <lbergstrom+bors@mozilla.com>2018-02-21 06:09:15 -0500
committerGitHub <noreply@github.com>2018-02-21 06:09:15 -0500
commit691f3be24a6fcc90ae7d0b9b0783abf8674e1b0f (patch)
tree8d364d9d09f536ea6eb3d1644545d375b30ac41a
parent554b0c0d06a229e6635bcadcf60b9c477345664a (diff)
parente47b3b23ab39ac6234f2cd14046411a27cef4be3 (diff)
downloadservo-691f3be24a6fcc90ae7d0b9b0783abf8674e1b0f.tar.gz
servo-691f3be24a6fcc90ae7d0b9b0783abf8674e1b0f.zip
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 -->
-rw-r--r--components/layout/query.rs2
-rw-r--r--components/style/gecko/generated/bindings.rs1
-rw-r--r--components/style/traversal.rs4
-rw-r--r--ports/geckolib/glue.rs8
4 files changed, 4 insertions, 11 deletions
diff --git a/components/layout/query.rs b/components/layout/query.rs
index afe5b50d909..bea54d43364 100644
--- a/components/layout/query.rs
+++ b/components/layout/query.rs
@@ -693,7 +693,7 @@ pub fn process_resolved_style_request<'a, N>(context: &LayoutContext,
thread_local: &mut tlc,
};
- let styles = resolve_style(&mut context, element, RuleInclusion::All, false, pseudo.as_ref());
+ let styles = resolve_style(&mut context, element, RuleInclusion::All, pseudo.as_ref());
let style = styles.primary();
let longhand_id = match *property {
PropertyId::LonghandAlias(id, _) |
diff --git a/components/style/gecko/generated/bindings.rs b/components/style/gecko/generated/bindings.rs
index 94bcc13fcfc..a801c5a9c5f 100644
--- a/components/style/gecko/generated/bindings.rs
+++ b/components/style/gecko/generated/bindings.rs
@@ -3200,7 +3200,6 @@ extern "C" {
rule_inclusion: StyleRuleInclusion,
snapshots: *const ServoElementSnapshotTable,
set: RawServoStyleSetBorrowed,
- ignore_existing_styles: bool,
) -> ServoStyleContextStrong;
}
extern "C" {
diff --git a/components/style/traversal.rs b/components/style/traversal.rs
index 6a99d597d1b..8944752f642 100644
--- a/components/style/traversal.rs
+++ b/components/style/traversal.rs
@@ -300,7 +300,6 @@ pub fn resolve_style<E>(
context: &mut StyleContext<E>,
element: E,
rule_inclusion: RuleInclusion,
- ignore_existing_style: bool,
pseudo: Option<&PseudoElement>,
) -> ElementStyles
where
@@ -309,7 +308,6 @@ where
use style_resolver::StyleResolverForElement;
debug_assert!(rule_inclusion == RuleInclusion::DefaultOnly ||
- ignore_existing_style ||
pseudo.map_or(false, |p| p.is_before_or_after()) ||
element.borrow_data().map_or(true, |d| !d.has_styles()),
"Why are we here?");
@@ -321,7 +319,7 @@ where
let mut style = None;
let mut ancestor = element.traversal_parent();
while let Some(current) = ancestor {
- if rule_inclusion == RuleInclusion::All && !ignore_existing_style {
+ if rule_inclusion == RuleInclusion::All {
if let Some(data) = current.borrow_data() {
if let Some(ancestor_style) = data.styles.get_primary() {
style = Some(ancestor_style.clone());
diff --git a/ports/geckolib/glue.rs b/ports/geckolib/glue.rs
index 332193c1817..9f6a64e0dd1 100644
--- a/ports/geckolib/glue.rs
+++ b/ports/geckolib/glue.rs
@@ -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()
);