Do display style fixup for Gecko-specific display values.

MozReview-Commit-ID: 1LjnxzgNJsz
This commit is contained in:
Cameron McCormack 2016-12-05 16:12:53 -10:00
parent e11441bdbc
commit 7851163610

View file

@ -1637,17 +1637,27 @@ pub fn apply_declarations<'a, F, I>(viewport_size: Size2D<Au>,
let specified_display = style.get_box().clone_display(); let specified_display = style.get_box().clone_display();
let computed_display = match specified_display { let computed_display = match specified_display {
T::inline_table => { // Values that have a corresponding block-outside version.
Some(T::table) T::inline_table => Some(T::table),
} % if product == "gecko":
T::inline | T::inline_block | T::inline_flex => Some(T::flex),
T::table_row_group | T::table_column | T::inline_grid => Some(T::grid),
T::table_column_group | T::table_header_group | T::_webkit_inline_box => Some(T::_webkit_box),
T::table_footer_group | T::table_row | T::table_cell | % endif
T::table_caption => {
Some(T::block) // Special handling for contents and list-item on the root element for Gecko.
} % if product == "gecko":
_ => None T::contents | T::list_item if is_root_element => Some(T::block),
% endif
// Values that are not changed by blockification.
T::block | T::flex | T::list_item | T::table => None,
% if product == "gecko":
T::contents | T::grid | T::_webkit_box => None,
% endif
// Everything becomes block.
_ => Some(T::block),
}; };
if let Some(computed_display) = computed_display { if let Some(computed_display) = computed_display {
let box_ = style.mutate_box(); let box_ = style.mutate_box();