This is a grab bag of performance improvements that significantly improve style recalculation, layout, and painting on a few static pages.
Let me know if you'd like me to split this PR up.
r? @glennw
This is quite a bit cleaner than abusing the rust debug functionality.
If we start collecting too many debugging options in the servo
executable we could opt to organize them into a single option.
Fixes#2263.
When this option is enabled, the layout task will print an error when
display list items draw outside their owning Flow's position rect. This
will make it easier to detect layout errors before they break rendering.
This is a command-line option for the moment, because we violate this
rule quite a bit still. Once all bugs causing this are fixed, we can be
more aggressive about enabling the option.
construction to avoid cloning and moving flows so much.
Besides amounting to a 5%-10% win on a page with a lot of text, this
simplifies and refactors the text layout code.
Logical geometry is complicated, so the string formatted output is
verbose. This means that flow tree dumps often go well beyond the
edge of the terminal screen. With a simple notation, we can shorten the
output and make it slightly easier to read. This notation also makes it
more similar to the formatted output of Rect, Point2D, and Size2D.
The flow tree is currently dumped for debugging purposes early on in
the flow process, so many values are still zero. If we wait to dump it
until later, the output will more accurately reflect the real flow tree.
The flow tree is currently dumped for debugging purposes early on in
the flow process, so many values are still zero. If we wait to dump it
until later, the output will more accurately reflect the real flow tree.
This also adds some extra debugging infrastructure which I found useful tracking
this bug down. A regression in the br reftests is also uncovered by this patch,
which I'll work on fixing next.
r? @pcwalton
Seems to be a 38% layout win on a site I tested with a lot of text.
Other browser engines typically do not duplicate the information in the font style struct. `FontStyle` actually predates @SimonSapin's CSS selector matching library. It's time to get rid of it!
r? @glennw
`Node.unsafe_get_flags()` returns `*const NodeFlags`, but `NodeFlags` has only `u8` length.
So We should just returns a raw value instead of any pointers.
This fixes#3248.
r? @jdm. Please review for mistakes mercilessly! Also, I got a host of test failures when running the worker tests, not sure if these tests are expected to pass locally or not.
This implements fragment merging, in order to incrementally reflow linebroken
text. This makes the `whitespace_pre.html` reftest pass with incremental reflow
turned on with `-i`.
`Node.unsafe_get_flags()` returns `*const NodeFlags`,
but `NodeFlags` has only `u8` length.
We should just returns a raw value instead of any pointers.