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

layout: Rewrite the block formatting context/float inline-size speculation code. #10085

Merged
merged 1 commit into from Mar 26, 2016

Conversation

@pcwalton
Copy link
Contributor

pcwalton commented Mar 19, 2016

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.

r? @mbrubeck


This change is Reviewable

@pcwalton pcwalton force-pushed the pcwalton:floats-inout-revamp branch from 33b0363 to 0cfb7a3 Mar 19, 2016
@Ms2ger
Copy link
Contributor

Ms2ger commented Mar 19, 2016

Surely there's something in this PR that's based on a spec requirement that you can point to.

@pcwalton
Copy link
Contributor Author

pcwalton commented Mar 20, 2016

@pcwalton pcwalton force-pushed the pcwalton:floats-inout-revamp branch from 0cfb7a3 to 8e15279 Mar 21, 2016
@pcwalton
Copy link
Contributor Author

pcwalton commented Mar 21, 2016

Rebased.

@jdm
Copy link
Member

jdm commented Mar 21, 2016

./components/layout/table.rs:16: use statement is not in alphabetical order
    expected: flow::{self, BaseFlow, EarlyAbsolutePositionInfo, Flow, FlowClass, ImmutableFlowUtils}
    found: flow::{OpaqueFlow}
./components/layout/traversal.rs:14: use statement is not in alphabetical order
    expected: flow::{self, CAN_BE_FRAGMENTED, Flow, ImmutableFlowUtils, PostorderFlowTraversal}
    found: flow::{PreorderFlowTraversal}
@mbrubeck
Copy link
Contributor

mbrubeck commented Mar 23, 2016

r=mbrubeck with one typo fix

-S-awaiting-review +S-needs-code-changes


Reviewed 7 of 14 files at r1, 5 of 6 files at r2, 2 of 2 files at r3.
Review status: all files reviewed at latest revision, 1 unresolved discussion.


components/layout/block.rs, line 844 [r3] (raw file):
Nit: "if it might"


Comments from the review on Reviewable.io

@pcwalton pcwalton force-pushed the pcwalton:floats-inout-revamp branch from f6b13d0 to 10ee18d Mar 24, 2016
@pcwalton
Copy link
Contributor Author

pcwalton commented Mar 24, 2016

@bors-servo: r=mbrubeck

@mbrubeck
Copy link
Contributor

mbrubeck commented Mar 24, 2016

@bors-servo
Copy link
Contributor

bors-servo commented Mar 24, 2016

📌 Commit 10ee18d has been approved by mbrubeck

@bors-servo
Copy link
Contributor

bors-servo commented Mar 24, 2016

Testing commit 10ee18d with merge 5fc6a74...

bors-servo added a commit that referenced this pull request Mar 24, 2016
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.

r? @mbrubeck

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/10085)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

bors-servo commented Mar 24, 2016

💔 Test failed - mac-rel-wpt

@bors-servo
Copy link
Contributor

bors-servo commented Mar 24, 2016

📌 Commit 43ed77a has been approved by mbrubeck

@bors-servo
Copy link
Contributor

bors-servo commented Mar 25, 2016

Testing commit 43ed77a with merge b785e5d...

bors-servo added a commit that referenced this pull request Mar 25, 2016
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.

r? @mbrubeck

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/10085)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

bors-servo commented Mar 25, 2016

💔 Test failed - mac-rel-css

@larsbergstrom
Copy link
Contributor

larsbergstrom commented Mar 25, 2016

Does not appear to be an intermittent:

Ran 9960 tests finished in 1225.0 seconds.
  • 9959 ran as expected. 129 tests skipped.
  • 1 tests failed unexpectedly

Tests with unexpected results:
  ▶ FAIL [expected PASS] /css21_dev/html4/margin-collapse-104.htm
  └   → /css21_dev/html4/margin-collapse-104.htm b797544bd51831d559a6e66872e3019c0debf3bc
/css21_dev/html4/reference/ref-filled-green-100px-square.htm 82d94d2027e216f7a2d31fcc53afb5e048516cef
Testing b797544bd51831d559a6e66872e3019c0debf3bc == 82d94d2027e216f7a2d31fcc53afb5e048516cef
pcwalton added a commit to pcwalton/servo that referenced this pull request Mar 25, 2016
This fixes `margin-collapse-104.htm`, which is currently accidentally
passing due to lack of servo#10085. When that PR lands, then that will become
a representative test case.
@pcwalton
Copy link
Contributor Author

pcwalton commented Mar 25, 2016

Test failure fixed in #10198, which this is now blocked on. That test was accidentally passing.

bors-servo added a commit that referenced this pull request Mar 26, 2016
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.

r? @mbrubeck

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/10198)
<!-- Reviewable:end -->
@pcwalton pcwalton force-pushed the pcwalton:floats-inout-revamp branch from 43ed77a to b29719e Mar 26, 2016
@pcwalton
Copy link
Contributor Author

pcwalton commented Mar 26, 2016

@bors-servo: r=mbrubeck

(No changes here, just rebasing on top of #10198)

@bors-servo
Copy link
Contributor

bors-servo commented Mar 26, 2016

📌 Commit b29719e has been approved by mbrubeck

@bors-servo
Copy link
Contributor

bors-servo commented Mar 26, 2016

Testing commit b29719e with merge 1554331...

bors-servo added a commit that referenced this pull request Mar 26, 2016
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.

r? @mbrubeck

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/10085)
<!-- Reviewable:end -->
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.
@bors-servo
Copy link
Contributor

bors-servo commented Mar 26, 2016

@bors-servo bors-servo merged commit b29719e into servo:master Mar 26, 2016
3 checks passed
3 checks passed
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
homu Test successful
Details
@paulrouget
Copy link
Contributor

paulrouget commented Mar 28, 2016

Regression: #10237

bors-servo added a commit that referenced this pull request Apr 30, 2016
Remove dead code left over from #10085

cc @pcwalton

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/10941)
<!-- Reviewable:end -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

You can’t perform that action at this time.