layout: Make overflow calculation take relative percentages into

account.

This necessitated changing overflow to be calculated by the parent flow
if relatively positioned children are present. That is because the
overflow regions cannot be calculated without knowing relative offsets,
which themselves cannot be calculated without knowing the parent size
(because of percentages). To accomplish this without sacrificing
parallelism in the non-relative case, this patch splits overflow into
"early" and "late" computation. Late overflow computation cannot be
parallelized across children, while early overflow computation can.

Makes the "Apple Music" text show up over the full-bleed promotional
background on apple.com.
This commit is contained in:
Patrick Walton 2015-08-21 13:49:40 -07:00
parent 108251bece
commit b66f17a445
12 changed files with 203 additions and 75 deletions

View file

@ -294,6 +294,7 @@ flaky_cpu == linebreak_simple_a.html linebreak_simple_b.html
== position_relative_painting_order_a.html position_relative_painting_order_ref.html
== position_relative_stacking_context_a.html position_relative_stacking_context_ref.html
== position_relative_top_percentage_a.html position_relative_top_percentage_b.html
== position_relative_vertical_percentage_overflow_a.html position_relative_vertical_percentage_overflow_ref.html
== pre_ignorable_whitespace_a.html pre_ignorable_whitespace_ref.html
== pre_with_tab.html pre_with_tab_ref.html
== pseudo_element_a.html pseudo_element_b.html

View file

@ -0,0 +1,25 @@
<!DOCTYPE html>
<style>
body, html {
margin: 0;
}
#a {
display: block;
position: absolute;
top: 100px;
left: 100px;
width: 100px;
height: 100px;
transform: translateX(0px); /* force creation of stacking context */
}
#b {
display: block;
position: relative;
top: -50%;
width: 100px;
height: 100px;
background: purple;
}
</style>
<div id=a><div id=b>

View file

@ -0,0 +1,17 @@
<!DOCTYPE html>
<style>
body, html {
margin: 0;
}
#a {
display: block;
position: absolute;
top: 50px;
left: 100px;
width: 100px;
height: 100px;
background: purple;
}
</style>
<div id=a>