Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rewrite display list building and opportunistically lay out blocks in parallel even if floats are present #2235

Merged
merged 1 commit into from May 2, 2014

Conversation

pcwalton
Copy link
Contributor

layout: Rewrite display list building to be parallel and to handle
overflow correctly, and opportunistically lay out blocks in parallel
even if floats are present.

This series of commits fixes the inline-height-test in Acid2 by
implementing proper overflow as well as the inline "strut". (See CSS 2.1
§ 10.8.1.) It was accidentally working before because tables' descendant
flows were not being laid out properly.

Display list building is now parallel and is done by bubbling up display
items and layers from parent to child. Speedups of around 60%-70% are
observed on Wikipedia with a 4-core HyperThreaded Core i7. More
optimizations are possible; this is just a start.

To minimize the amount of data that needs to be bubbled up, as well as
to make proper handling of overflow: hidden clipping easier, the
StackingContext abstraction is now purely internal to the display
list. Instead of placing items into a stacking context directly, display
items are placed into display lists with an explicit StackingLevel
provided. The stacking level determines a display item's position within
the stacking context. When a stacking context is finished, it is
flattened with the the flatten method, which shuffles the display
items that make up the context into their proper order while handling
clipping properly.

r? @SimonSapin and/or @larsbergstrom

@highfive
Copy link

warning Warning warning

  • These commits modify unsafe code. Please review it carefully!
  • These commits modify layout code, but no reftests are modified. Please consider adding a reftest!
  • @pcwalton, please confirm that src/test/html/acid1.html and your favourite wikipedia page still render correctly!

@hoppipolla-critic-bot
Copy link

Critic review: https://critic.hoppipolla.co.uk/r/1390

This is an external review system which you may optionally use for the code review of your pull request.

In order to help critic track your changes, please do not make in-place history rewrites (e.g. via git rebase -i or git commit --amend) when updating this pull request.

@pcwalton pcwalton changed the title Rewrite display list building and opportunistically lay out floats in parallel Rewrite display list building and opportunistically lay out blocks in parallel even if floats are present Apr 26, 2014
@pcwalton
Copy link
Contributor Author

Note that the last commit is the only one belonging to this pull request; the others are part of the reenabling parallel layout PR.

overflow correctly, and opportunistically lay out blocks in parallel
even if floats are present.

This commit fixes the `inline-height-test` in Acid2 by implementing
proper overflow as well as the inline "strut".  (See CSS 2.1 § 10.8.1.)
Acid2 was accidentally being rendered properly before because tables'
descendant flows were not being laid out properly.

Display list building is now parallel and is done by bubbling up display
items and layers from parent to child. Speedups of around 60%-70% are
observed on Wikipedia with a 4-core HyperThreaded Core i7.  More
optimizations are possible; this is just a start.

To minimize the amount of data that needs to be bubbled up, as well as
to make proper handling of `overflow: hidden` clipping easier, the
`StackingContext` abstraction is now purely internal to the display
list.  That is, instead of placing items into a stacking context
directly, display items are placed into display lists alongside a
stacking level.  When a stacking context is complete, it is flattened
with the the `flatten` method, which shuffles the display items that
make up the context into their proper order while handling clipping
properly.
bors-servo pushed a commit that referenced this pull request May 2, 2014
layout: Rewrite display list building to be parallel and to handle
overflow correctly, and opportunistically lay out blocks in parallel
even if floats are present.

This series of commits fixes the `inline-height-test` in Acid2 by
implementing proper overflow as well as the inline "strut". (See CSS 2.1
§ 10.8.1.) It was accidentally working before because tables' descendant
flows were not being laid out properly.

Display list building is now parallel and is done by bubbling up display
items and layers from parent to child. Speedups of around 60%-70% are
observed on Wikipedia with a 4-core HyperThreaded Core i7. More
optimizations are possible; this is just a start.

To minimize the amount of data that needs to be bubbled up, as well as
to make proper handling of `overflow: hidden` clipping easier, the
`StackingContext` abstraction is now purely internal to the display
list. Instead of placing items into a stacking context directly, display
items are placed into display lists with an explicit `StackingLevel`
provided. The stacking level determines a display item's position within
the stacking context. When a stacking context is finished, it is
flattened with the the `flatten` method, which shuffles the display
items that make up the context into their proper order while handling
clipping properly.

r? @SimonSapin and/or @larsbergstrom
@bors-servo bors-servo merged commit 81f5da9 into servo:master May 2, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants