Improve acid2. Fix line height calculation. Text fragments get correct enclosing element style.

* Enabled acid2 on mac + linux. Updated the reference image. The only difference from the
real acid2 now is the paint order and a 1 pixel horizontal offset on the nose.
* Change line-height to be calculated correctly.
* Apply enclosing element style to text fragments.
This commit is contained in:
Glenn Watson 2014-09-26 17:12:22 +10:00
parent 20f5fdd000
commit cf79e64a5a
14 changed files with 118 additions and 101 deletions

View file

@ -421,7 +421,7 @@ impl<'a> FlowConstructor<'a> {
let mut fragment = Fragment::from_opaque_node_and_style(whitespace_node,
whitespace_style.clone(),
fragment_info);
inline_fragment_accumulator.fragments.push(&mut fragment, whitespace_style);
inline_fragment_accumulator.fragments.push(&mut fragment);
}
ConstructionItemConstructionResult(TableColumnFragmentConstructionItem(_)) => {
// TODO: Implement anonymous table objects for missing parents
@ -449,7 +449,7 @@ impl<'a> FlowConstructor<'a> {
if node.get_pseudo_element_type() != Normal {
let fragment_info = UnscannedTextFragment(UnscannedTextFragmentInfo::new(node));
let mut fragment = Fragment::new_from_specific_info(node, fragment_info);
inline_fragment_accumulator.fragments.push(&mut fragment, node.style().clone());
inline_fragment_accumulator.fragments.push(&mut fragment);
first_fragment = false;
}
@ -585,7 +585,7 @@ impl<'a> FlowConstructor<'a> {
let mut fragment = Fragment::from_opaque_node_and_style(whitespace_node,
whitespace_style.clone(),
fragment_info);
fragment_accumulator.fragments.push(&mut fragment, whitespace_style)
fragment_accumulator.fragments.push(&mut fragment)
}
ConstructionItemConstructionResult(TableColumnFragmentConstructionItem(_)) => {
// TODO: Implement anonymous table objects for missing parents
@ -639,7 +639,7 @@ impl<'a> FlowConstructor<'a> {
};
let mut fragments = InlineFragments::new();
fragments.push(&mut fragment, node.style().clone());
fragments.push(&mut fragment);
let construction_item = InlineFragmentsConstructionItem(InlineFragmentsConstructionResult {
splits: Vec::new(),
@ -661,7 +661,7 @@ impl<'a> FlowConstructor<'a> {
let mut fragment = Fragment::new_from_specific_info(node, fragment_info);
let mut fragment_accumulator = InlineFragmentsAccumulator::from_inline_node(node);
fragment_accumulator.fragments.push(&mut fragment, node.style().clone());
fragment_accumulator.fragments.push(&mut fragment);
let construction_item = InlineFragmentsConstructionItem(InlineFragmentsConstructionResult {
splits: Vec::new(),