Clear non-inherited properties on anonymous block

Add a modify_style_for_anonymous_flow() function to use initial values
for non-inherited properties and parent values for inherited properties
as the block style. It also set border and outline to zero and set the
display property from the parameter.
This commit is contained in:
Pu Xingyu 2016-07-09 22:51:07 +08:00
parent c2a22bd05e
commit d40e6c5738
3 changed files with 44 additions and 3 deletions

View file

@ -1304,6 +1304,9 @@ impl<'a> ImmutableFlowUtils for &'a Flow {
Arc::new(TableCellFlow::from_node_fragment_and_visibility_flag(node, fragment, !hide))
},
FlowClass::Flex => {
properties::modify_style_for_anonymous_flow(
&mut style,
display::T::block);
let fragment =
Fragment::from_opaque_node_and_style(node.opaque(),
PseudoElementType::Normal,