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:
bors-servo 2018-02-21 06:09:15 -05:00 committed by GitHub
commit 691f3be24a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 4 additions and 11 deletions

View file

@ -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, _) |

View file

@ -3200,7 +3200,6 @@ extern "C" {
rule_inclusion: StyleRuleInclusion,
snapshots: *const ServoElementSnapshotTable,
set: RawServoStyleSetBorrowed,
ignore_existing_styles: bool,
) -> ServoStyleContextStrong;
}
extern "C" {

View file

@ -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());