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

Bug #10181 - Implement *-reverse flex-directions #10987

Merged
merged 1 commit into from May 11, 2016

Conversation

@shinglyu
Copy link
Member

shinglyu commented May 3, 2016

This change is Reviewable

@highfive
Copy link

highfive commented May 3, 2016

warning Warning warning

  • These commits modify layout code, but no tests are modified.Please consider adding a test!
@shinglyu
Copy link
Member Author

shinglyu commented May 3, 2016

I ran the test

./mach test-css tests/wpt/css-tests/css-flexbox-1_dev/html/

but got a LOT of timeouts

Ran 612 tests finished in 2425.0 seconds.
  • 78 ran as expected. 0 tests skipped.
  • 534 tests timed out unexpectedly
@dlrobertson
Copy link
Contributor

dlrobertson commented May 3, 2016

I get the following on my server with no timeouts or failures. I get a lot of timeouts when I run test-css on my laptop though.

 ▶ PASS [expected FAIL] /css-flexbox-1_dev/html/order-with-column-reverse.htm

Review status: 0 of 1 files reviewed at latest revision, 1 unresolved discussion.


components/layout/flex.rs, line 120 [r1] (raw file):
Would this be more readable if this were collapsed into one match statement?

let (main_mode, is_reverse) = match fragment.style.get_position().flex_direction {
    flex_direction::T::row => (Mode::Inline, false),
    flex_direction::T::row_reverse => (Mode::Inline, true),
    ...

Just a thought...


Comments from Reviewable

@jdm
Copy link
Member

jdm commented May 3, 2016

@shinglyu Are you using a debug or release build? Are there still timeouts if you run with test-css --release?

@shinglyu
Copy link
Member Author

shinglyu commented May 4, 2016

I didn't specify the build, so I guess it uses the debug build. I'll try it on release build on a more powerful machine.

@shinglyu
Copy link
Member Author

shinglyu commented May 4, 2016

Running 612 tests in web-platform-tests

PASS [expected FAIL] /css-flexbox-1_dev/html/flex-flexitem-percentage-prescation.htm

PASS [expected FAIL] /css-flexbox-1_dev/html/order-with-column-reverse.htm

Unsupported test type wdspec for product servo
Ran 612 tests finished in 96.0 seconds.
• 610 ran as expected. 0 tests skipped.
• 2 tests passed unexpectedly


Let me check those two unexpected passing tests.

@dlrobertson
Copy link
Contributor

dlrobertson commented May 4, 2016

PASS [expected FAIL] /css-flexbox-1_dev/html/order-with-column-reverse.htm

Is definitely expected given the contents of this PR.

PASS [expected FAIL] /css-flexbox-1_dev/html/flex-flexitem-percentage-prescation.htm

Not sure what is going on here. I don't get this on my box.

@shinglyu
Copy link
Member Author

shinglyu commented May 5, 2016

flex-flexitem-percentage-prescation.htm on master branch build looks good (with --pref layout.flex.enabled --pref layout.flex-direction.enabled). I'm not sure why it's not passing before. I'll mark the two as passing.

Also I think the order-with-row-reverse.htm should pass too? I'll check it.

@highfive
Copy link

highfive commented May 5, 2016

New code was committed to pull request.

@larsbergstrom
Copy link
Contributor

larsbergstrom commented May 10, 2016

@highfive highfive assigned mbrubeck and unassigned pcwalton May 10, 2016
@mbrubeck
Copy link
Contributor

mbrubeck commented May 10, 2016

@bors-servo delegate+

r=mbrubeck with one review comment addressed (below).

Previously, larsbergstrom (Lars Bergstrom) wrote…

r? @mbrubeck


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


components/layout/flex.rs, line 284 [r1] (raw file):

                inline_child_start = inline_child_start - even_content_inline_size;
            }
        }

It would be nice if the if and else cases shared more code. Maybe add aa direction variable that is either 1 or -1, and initialize it along with inline_child_start. Then you could have a single loop that ends with inline_child_start = inline_child_start + even_content_inline_size * direction;


Comments from Reviewable

@bors-servo
Copy link
Contributor

bors-servo commented May 10, 2016

✌️ @shinglyu can now approve this pull request

@shinglyu shinglyu force-pushed the shinglyu:flex-reverse branch from 787350a to 26f9b08 May 10, 2016
@highfive
Copy link

highfive commented May 10, 2016

New code was committed to pull request.

@shinglyu
Copy link
Member Author

shinglyu commented May 10, 2016

Review status: 2 of 3 files reviewed at latest revision, 1 unresolved discussion.


components/layout/flex.rs, line 284 [r1] (raw file):

Previously, mbrubeck (Matt Brubeck) wrote…

It would be nice if the if and else cases shared more code. Maybe add aa direction variable that is either 1 or -1, and initialize it along with inline_child_start. Then you could have a single loop that ends with inline_child_start = inline_child_start + even_content_inline_size * direction;


I end up using an if...else in the for loop, the base.position.start.i line also needs to be handled differently, so this willl make me use two flags, which I believe is dirty.


Comments from Reviewable

@mbrubeck
Copy link
Contributor

mbrubeck commented May 10, 2016

@bors-servo r+

Previously, highfive wrote…

New code was committed to pull request.


Reviewed 1 of 1 files at r4.
Review status: all files reviewed at latest revision, all discussions resolved.


Comments from Reviewable

@bors-servo
Copy link
Contributor

bors-servo commented May 10, 2016

📌 Commit 26f9b08 has been approved by mbrubeck

@bors-servo
Copy link
Contributor

bors-servo commented May 10, 2016

Testing commit 26f9b08 with merge 37ae863...

bors-servo added a commit that referenced this pull request May 10, 2016
Bug #10181 - Implement *-reverse flex-directions

<!-- 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/10987)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

bors-servo commented May 10, 2016

💔 Test failed - linux-rel

@highfive
Copy link

highfive commented May 10, 2016

  ▶ FAIL [expected PASS] /css-flexbox-1_dev/html/flex-flexitem-percentage-prescation.htm
  └   → /css-flexbox-1_dev/html/flex-flexitem-percentage-prescation.htm 549dc2995e7de786feb6065fc8fc76b53746d920
/css-flexbox-1_dev/html/reference/flex-flexitem-percentage-prescation-ref.htm 516cbcf7b447cf7d5a568a4f8b57f030555e6525
Testing 549dc2995e7de786feb6065fc8fc76b53746d920 == 516cbcf7b447cf7d5a568a4f8b57f030555e6525
@dlrobertson
Copy link
Contributor

dlrobertson commented May 10, 2016

I get a failure on my box too. I doubt this PR should affect this test... Did it change the outcome of this test on your machine?

Previously, highfive wrote…

  ▶ FAIL [expected PASS] /css-flexbox-1_dev/html/flex-flexitem-percentage-prescation.htm
  └   → /css-flexbox-1_dev/html/flex-flexitem-percentage-prescation.htm 549dc2995e7de786feb6065fc8fc76b53746d920
/css-flexbox-1_dev/html/reference/flex-flexitem-percentage-prescation-ref.htm 516cbcf7b447cf7d5a568a4f8b57f030555e6525
Testing 549dc2995e7de786feb6065fc8fc76b53746d920 == 516cbcf7b447cf7d5a568a4f8b57f030555e6525
</details>

Review status: all files reviewed at latest revision, all discussions resolved, some commit checks failed.


Comments from Reviewable

@mbrubeck
Copy link
Contributor

mbrubeck commented May 11, 2016

That test is currently marked as failing on Linux only, but I have gotten unexpected PASS results on my Linux box. It might be font-related.

@shinglyu
Copy link
Member Author

shinglyu commented May 11, 2016

This is indeed a font problem. I opened it in Reftest analyzer and the font looks different from my Linux Mint machine. There is a subtle font aliasing effect between the "r" and "b".
_095

@shinglyu
Copy link
Member Author

shinglyu commented May 11, 2016

The test is relatively simple, it should have passed even without this patch. I will mark it as conditionally failing on Linux as before, and file a separate issue for it.

@shinglyu shinglyu force-pushed the shinglyu:flex-reverse branch from 26f9b08 to 89586ed May 11, 2016
@highfive
Copy link

highfive commented May 11, 2016

New code was committed to pull request.

@shinglyu
Copy link
Member Author

shinglyu commented May 11, 2016

@bors-servo
Copy link
Contributor

bors-servo commented May 11, 2016

📌 Commit 89586ed has been approved by shinglyu

@shinglyu
Copy link
Member Author

shinglyu commented May 11, 2016

@mbrubeck I'm r+ing myself since I am only disabled the failing test. Hope you don't mind.

@bors-servo
Copy link
Contributor

bors-servo commented May 11, 2016

Testing commit 89586ed with merge 20f0be2...

bors-servo added a commit that referenced this pull request May 11, 2016
Bug #10181 - Implement *-reverse flex-directions

<!-- 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/10987)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

bors-servo commented May 11, 2016

@bors-servo bors-servo merged commit 89586ed into servo:master May 11, 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
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

8 participants
You can’t perform that action at this time.