Commit graph

32 commits

Author SHA1 Message Date
Patrick Walton
b6bed345f5 layout: Take margins in the inline direction into account when
guessing the inline-size of block formatting contexts.

Fixes the layout on reddit.com.

Partially addresses #10571.
2016-05-10 17:11:28 -07:00
Patrick Walton
d2511e33c6 layout: When printing out debug info for the float list, include
information about each float.
2016-05-04 13:20:23 -07:00
Patrick Walton
94306cd183 layout: Speculate that the inline sizes of floats with percentage
inline sizes are nonzero.

This is a bit of a hack.
2016-05-04 13:19:51 -07:00
Patrick Walton
97de2c2afa layout: Reset the speculated inline size of floats out to compensate for
margins for all blocks, not just block formatting contexts.

Partial fix for Reddit /r/rust.
2016-04-28 10:25:49 -07:00
Patrick Walton
a3fd226341 layout: Disallow margins from collapsing through blocks with clearance
per CSS 2.1 § 8.3.1.

Fixes the test failure in #10458.
2016-04-14 17:24:24 -07:00
Patrick Walton
6eb58e2c54 layout: Only take nonnegative margins into account when estimating
inline placement of floats.

Otherwise, the heuristics can pass even when there are no floats,
causing block formatting contexts to be speculated to be flowing around
floats that don't exist!

Closes #10237.
2016-03-28 17:37:57 -07:00
Patrick Walton
b29719e36b layout: Rewrite the block formatting context/float inline-size
speculation code.

The old code tried to do the speculation as a single bottom-up pass
after intrinsic inline-size calculation, which was unable to handle
cases like this:

    <div>
        <div style="float: left">Foo</div>
    </div>
    <div>
        <div style="overflow: hidden">Bar</div>
    </div>

No single bottom-up pass could possibly handle this case, because the
inline-size of the float flowing out of the "Foo" block could never make
it down to the "Bar" block, where it is needed for speculation.

On the pages I tried, this regresses layout performance by 1%-2%.

I first noticed this breaking some pages, like the Google SERPs, several
months ago.
2016-03-25 18:39:16 -07:00
Patrick Walton
24d81e95b4 layout: Allow floats to have negative ceilings due to negative margins.
This fixes `margin-collapse-104.htm`, which is currently accidentally
passing due to lack of #10085. When that PR lands, then that will become
a representative test case.
2016-03-25 15:29:17 -07:00
Tim van der Meij
307f2915f2 Move util::persistent_list to layout 2016-02-20 19:20:38 +01:00
Anthony Ramine
db8d502f41 Move util::logical_geometry to style 2016-02-18 10:17:13 +01:00
Ms2ger
5ec1cdea9b Remove dead code from layout. 2015-11-18 15:00:58 +01:00
Glenn Watson
339a3f869b Split Au type into separate crate, with minimal dependencies. 2015-10-01 07:16:11 +10:00
Johann Tuffe
ec07178b6f sort all uses 2015-08-20 20:47:12 +08:00
Matt Brubeck
0048b4f2ab Positioning fixes for RTL floats 2015-05-18 17:25:06 -07:00
bors-servo
1e150140bd Auto merge of #5480 - SimonSapin:multicol, r=pcwalton
This add some properties to the style system and a new flow type, but the larger issues of dealing with fragmentation in the flow tree is still an open question.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/5480)
<!-- Reviewable:end -->
2015-04-28 19:48:45 -05:00
Simon Sapin
544a02a250 Refactor flow construction to make float less of a special case. 2015-04-29 02:47:46 +02:00
Ms2ger
903305416a Implement Clone for Copy types. 2015-04-28 23:31:10 +02:00
Patrick Walton
00a2685cbe layout: During inline layout, make place_between_floats use the same
line height computation logic as final block size assignment.

Improves Wikipedia.
2015-04-09 14:23:08 -07:00
Ms2ger
95004ee4b6 Use usize for Floats::len. 2015-03-29 12:47:25 +02:00
Dan Fox
559ff68b31 Get rid of servo_util 2015-03-05 17:42:05 +00:00
Simon Sapin
d5dd1d658e Upgrade to rustc ba2f13ef0 2015-02-04 2015-02-11 14:48:34 -08:00
Josh Matthews
95fc29fa0d Update rustc to 00b112c45a604fa6f4b59af2a40c9deeadfdb7c6/rustc-1.0.0-dev. 2015-01-28 10:16:49 +10:00
Ms2ger
16c7060bc8 Update rustc to revision 2cfb5acb5a2751c759627377e602bac4f88f2d19. 2015-01-08 09:58:46 -05:00
Ms2ger
466faac2a5 Update rustc to revision 3dcd2157403163789aaf21a9ab3c4d30a7c6494d. 2014-12-17 15:19:45 -05:00
Joseph Crail
c254d195ad Fix spelling mistakes in comments. 2014-12-11 23:56:29 -05:00
Jack Moffitt
d1b433a3b3 Rust upgrade to rustc hash b03a2755193cd756583bcf5831cf4545d75ecb8a 2014-11-13 11:17:43 +10:00
Patrick Walton
a208463b62 layout: Employ a persistent list data structure to avoid copying floats
all the time.

Improves performance on the maze solver significantly since this was
basically O(n^2) before.
2014-10-31 12:42:32 -07:00
Patrick Walton
68091d7a86 layout: Make some formatting cleanups.
These should have no effect on functionality.
2014-10-28 12:00:35 -07:00
Clark Gaebel
d12c6e7383 Incremental Style Recalc
This patch puts in the initial framework for incremental reflow. Nodes' styles
are no longer recalculated unless the node has changed.

I've been hacking on the general problem of incremental reflow for the past
couple weeks, and I've yet to get a full implementation that actually passes all
the reftests + wikipedia + cnn. Therefore, I'm going to try to land the different
parts of it one by one.

This patch only does incremental style recalc, without incremental flow
construction, inline-size bubbling, reflow, or display lists. Those will be coming
in that order as I finish them.

At least with this strategy, I can land a working version of incremental reflow,
even if not yet complete.

r? @pcwalton
2014-10-09 12:55:21 -04:00
Patrick Walton
62bb9093d7 layout: Float table wrappers directly instead of generating a block
wrapper around them.

Fixes Wikipedia tables leaking out.

Along the way, I refactored tables' width calculation significantly.
This was necessary in order to properly handle floated tables, as some
of the logic had to be ported over from block flows.
2014-09-25 08:06:03 -07:00
Simon Sapin
010d87b93e Remove min/max functions from util::geometry. Use std::cmp instead. 2014-09-19 13:56:35 +01:00
Jack Moffitt
c6ab60dbfc Cargoify servo 2014-09-08 20:21:42 -06:00
Renamed from src/components/layout/floats.rs (Browse further)