layout: Make absolutely-positioned blocks not generate {ib} splits.

Improves YouTube.

Closes #10642.
This commit is contained in:
Patrick Walton 2016-04-15 17:25:24 -07:00
parent ccfd768c4b
commit e840c7aaa0
4 changed files with 47 additions and 13 deletions

View file

@ -512,10 +512,9 @@ impl<'a, ConcreteThreadSafeLayoutNode: ThreadSafeLayoutNode>
} else if flow.need_anonymous_flow(&*kid_flow) {
consecutive_siblings.push(kid_flow)
} else {
if !flow::base(&*kid_flow).flags.contains(IS_ABSOLUTELY_POSITIONED) {
// Flush any inline fragments that we were gathering up. This allows us to
// handle {ib} splits.
debug!("flushing {} inline box(es) to flow A",
inline_fragment_accumulator.fragments.fragments.len());
let old_inline_fragment_accumulator =
mem::replace(inline_fragment_accumulator,
InlineFragmentsAccumulator::new());
@ -525,6 +524,8 @@ impl<'a, ConcreteThreadSafeLayoutNode: ThreadSafeLayoutNode>
consecutive_siblings,
abs_descendants,
node);
}
if !consecutive_siblings.is_empty() {
let consecutive_siblings = mem::replace(consecutive_siblings, vec!());
self.generate_anonymous_missing_child(consecutive_siblings, flow, node);

View file

@ -94,6 +94,18 @@
"url": "/_mozilla/css/absolute_hypothetical_with_intervening_inline_block_a.html"
}
],
"css/absolute_ib_split_a.html": [
{
"path": "css/absolute_ib_split_a.html",
"references": [
[
"/_mozilla/css/absolute_ib_split_ref.html",
"=="
]
],
"url": "/_mozilla/css/absolute_ib_split_a.html"
}
],
"css/absolute_inline_containing_block_a.html": [
{
"path": "css/absolute_inline_containing_block_a.html",
@ -6720,6 +6732,18 @@
"url": "/_mozilla/css/absolute_hypothetical_with_intervening_inline_block_a.html"
}
],
"css/absolute_ib_split_a.html": [
{
"path": "css/absolute_ib_split_a.html",
"references": [
[
"/_mozilla/css/absolute_ib_split_ref.html",
"=="
]
],
"url": "/_mozilla/css/absolute_ib_split_a.html"
}
],
"css/absolute_inline_containing_block_a.html": [
{
"path": "css/absolute_inline_containing_block_a.html",

View file

@ -0,0 +1,5 @@
<!DOCTYPE html>
<meta charset="utf-8">
<link rel="match" href="absolute_ib_split_ref.html">
Ser<div style="position: absolute"></div>vo

View file

@ -0,0 +1,4 @@
<!DOCTYPE html>
<meta charset="utf-8">
Servo