Skip to content

Commit

Permalink
style: Remove the display: -moz-box overrides display: -webkit-box hack.
Browse files Browse the repository at this point in the history
display: -moz-box is no longer exposed to content so this is not necessary.

See bug 1407701 for context.

Differential Revision: https://phabricator.services.mozilla.com/D12961
  • Loading branch information
emilio committed Dec 2, 2018
1 parent 2e388e8 commit 8bed8ae
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 40 deletions.
16 changes: 0 additions & 16 deletions components/style/properties/declaration_block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -462,22 +462,6 @@ impl PropertyDeclarationBlock {
return false;
}

// As a compatibility hack, specially on Android,
// don't allow to override a prefixed webkit display
// value with an unprefixed version from parsing
// code.
//
// TODO(emilio): Unship.
if let PropertyDeclaration::Display(old_display) = *slot {
use crate::properties::longhands::display::computed_value::T as display;

if let PropertyDeclaration::Display(new_display) = declaration {
if display::should_ignore_parsed_value(old_display, new_display) {
return false;
}
}
}

index_to_remove = Some(i);
break;
}
Expand Down
24 changes: 0 additions & 24 deletions components/style/values/specified/box.rs
Original file line number Diff line number Diff line change
Expand Up @@ -178,30 +178,6 @@ impl Display {
}
}

/// Whether `new_display` should be ignored, given a previous
/// `old_display` value.
///
/// This is used to ignore `display: -moz-box` declarations after an
/// equivalent `display: -webkit-box` declaration, since the former
/// has a vastly different meaning. See bug 1107378 and bug 1407701.
///
/// FIXME(emilio): This is a pretty decent hack, we should try to
/// remove it.
pub fn should_ignore_parsed_value(_old_display: Self, _new_display: Self) -> bool {
#[cfg(feature = "gecko")]
{
match (_old_display, _new_display) {
(Display::WebkitBox, Display::MozBox) |
(Display::WebkitInlineBox, Display::MozInlineBox) => {
return true;
},
_ => {},
}
}

return false;
}

/// Returns whether this "display" value is one of the types for
/// ruby.
#[cfg(feature = "gecko")]
Expand Down

0 comments on commit 8bed8ae

Please sign in to comment.