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

Implement flexbox reordering #10178

Merged
merged 1 commit into from Apr 11, 2016
Merged

Implement flexbox reordering #10178

merged 1 commit into from Apr 11, 2016

Conversation

@dlrobertson
Copy link
Contributor

dlrobertson commented Mar 24, 2016

Add style property for order and implement reordering by this property
in flex flow. Based on previous work by @zentner-kyle.

Fixes: #9957


This change is Reviewable

@highfive
Copy link

highfive commented Mar 24, 2016

Heads up! This PR modifies the following files:

  • @bholley: components/style/properties.mako.rs
  • @SimonSapin: components/style/properties.mako.rs
@dlrobertson dlrobertson force-pushed the dlrobertson:flex-order branch from 1b4aba1 to 05874ab Mar 24, 2016
@jdm
Copy link
Member

jdm commented Mar 24, 2016

@bors-servo
Copy link
Contributor

bors-servo commented Mar 24, 2016

Trying commit 05874ab with merge 50ca528...

bors-servo added a commit that referenced this pull request Mar 24, 2016
Implement flexbox reordering

Add style property for `order` and implement reordering by this property
in flex flow. Based on previous work by @zentner-kyle.

Fixes: #9957

<!-- 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/10178)
<!-- Reviewable:end -->
@dlrobertson
Copy link
Contributor Author

dlrobertson commented Mar 24, 2016

#9117 attempted to also correctly implement column-reverse and row-reverse. Implementing reverse will take a bit more work. I plan to submit a separate PR for it. Is anyone else working on FlexFlow? I'd like to continue working on it, but I don't want to step on anyone's toes.


Review status: 0 of 4 files reviewed at latest revision, 2 unresolved discussions.


components/layout/flex.rs, line 72 [r1] (raw file):
I find it more readable to remove these, but could be swayed to think otherwise 😄


components/layout/flex.rs, line 81 [r1] (raw file):
I really don't like that a sort is used each time this is called.


Comments from the review on Reviewable.io

@jdm
Copy link
Member

jdm commented Mar 24, 2016

Nobody else is working on FlexFlow. Step away!

@dlrobertson
Copy link
Contributor Author

dlrobertson commented Mar 24, 2016

Sweet! Thanks!

@bors-servo
Copy link
Contributor

bors-servo commented Mar 24, 2016

💔 Test failed - mac-rel-wpt

@dlrobertson
Copy link
Contributor Author

dlrobertson commented Mar 24, 2016

Review status: 0 of 4 files reviewed at latest revision, 3 unresolved discussions, some commit checks failed.


components/layout/flex.rs, line 76 [r1] (raw file):
Per the failure, as_block should not be used like this. My current thought is to patter match on Flow::class. If you know of a better way, just let me know.


Comments from the review on Reviewable.io

@dlrobertson dlrobertson force-pushed the dlrobertson:flex-order branch from 05874ab to 50a14a6 Mar 25, 2016
@larsbergstrom
Copy link
Contributor

larsbergstrom commented Mar 25, 2016

@bors-servo
Copy link
Contributor

bors-servo commented Mar 25, 2016

🔒 Merge conflict

@dlrobertson dlrobertson force-pushed the dlrobertson:flex-order branch from 50a14a6 to 557c013 Mar 25, 2016
@larsbergstrom
Copy link
Contributor

larsbergstrom commented Mar 25, 2016

@bors-servo
Copy link
Contributor

bors-servo commented Mar 25, 2016

Trying commit 557c013 with merge fce55da...

bors-servo added a commit that referenced this pull request Mar 25, 2016
Implement flexbox reordering

Add style property for `order` and implement reordering by this property
in flex flow. Based on previous work by @zentner-kyle.

Fixes: #9957

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

bors-servo commented Mar 25, 2016

💔 Test failed - linux-rel

@jdm
Copy link
Member

jdm commented Mar 25, 2016

  ▶ PASS [expected FAIL] /css-flexbox-1_dev/html/flexbox_computedstyle_order-inherit.htm

  ▶ PASS [expected FAIL] /css-flexbox-1_dev/html/flexbox_computedstyle_order-invalid.htm

  ▶ PASS [expected FAIL] /css-flexbox-1_dev/html/flexbox_computedstyle_order-integer.htm

  ▶ PASS [expected FAIL] /css-flexbox-1_dev/html/flexbox_computedstyle_order-negative.htm

  ▶ PASS [expected FAIL] /css-flexbox-1_dev/html/flexbox_computedstyle_order.htm
@dlrobertson
Copy link
Contributor Author

dlrobertson commented Mar 25, 2016

Woohoo! More passing tests!

@stshine
Copy link
Contributor

stshine commented Mar 25, 2016

Since the flex items of a container need to be iterated for multiple times by order, IMO a collection of FlexItemInfo is really needed to decrease sorting overheads and furthermore retain states between passes.

@dlrobertson dlrobertson force-pushed the dlrobertson:flex-order branch from 557c013 to 883aa27 Mar 25, 2016
@dlrobertson dlrobertson force-pushed the dlrobertson:flex-order branch from 883aa27 to 402ee16 Mar 25, 2016
@bors-servo
Copy link
Contributor

bors-servo commented Mar 26, 2016

The latest upstream changes (presumably #10085) made this pull request unmergeable. Please resolve the merge conflicts.

@bors-servo
Copy link
Contributor

bors-servo commented Apr 6, 2016

The latest upstream changes (presumably #10407) made this pull request unmergeable. Please resolve the merge conflicts.

@dlrobertson dlrobertson force-pushed the dlrobertson:flex-order branch from 3d8a315 to 0cff0cb Apr 8, 2016
@dlrobertson dlrobertson force-pushed the dlrobertson:flex-order branch from 0cff0cb to b293f94 Apr 9, 2016
@dlrobertson
Copy link
Contributor Author

dlrobertson commented Apr 11, 2016

@highfive highfive assigned SimonSapin and unassigned asajeffrey Apr 11, 2016
@bors-servo
Copy link
Contributor

bors-servo commented Apr 11, 2016

The latest upstream changes (presumably #10490) made this pull request unmergeable. Please resolve the merge conflicts.

@SimonSapin
Copy link
Member

SimonSapin commented Apr 11, 2016

r=me modulo your as_block comment.


Reviewed 2 of 4 files at r1, 5 of 5 files at r4, 1 of 2 files at r5, 2 of 2 files at r10.
Review status: all files reviewed at latest revision, 5 unresolved discussions, some commit checks failed.


components/layout/flex.rs, line 76 [r1] (raw file):
Sorry I don’t understand this and I don’t see what failure this refers to.


components/layout/flex.rs, line 81 [r1] (raw file):
There could be a "dirty" flag that indicates that FlexFlow::items need to be re-created and sorted. It would need be set when a flex item is added or removed or when their order value changes. This sounds non-trival, so it can be later follow-up.


components/style/properties.mako.rs, line 4928 [r10] (raw file):
input.try is not necessary in this case (since you don’t go on to parse something else when it returns Err), parse_integer can be called directly.


Comments from Reviewable

@dlrobertson dlrobertson force-pushed the dlrobertson:flex-order branch from b293f94 to 4570a13 Apr 11, 2016
Add style property for order and implement reordering by this property
in flex flow. Based on previous work by @zentner-kyle.
@dlrobertson dlrobertson force-pushed the dlrobertson:flex-order branch from 4570a13 to 3580f91 Apr 11, 2016
@dlrobertson
Copy link
Contributor Author

dlrobertson commented Apr 11, 2016

r=@SimonSapin


Review status: 8 of 10 files reviewed at latest revision, 5 unresolved discussions.


components/layout/flex.rs, line 76 [r1] (raw file):
This was an old comment before I realized that I forgot to implement as_block for FlexFlow (See the diff a little further down), so there was a test that hit a panic. If there was a flex box that was an item to a flex box, we would hit a panic here. This has been resolved.


components/layout/flex.rs, line 81 [r1] (raw file):
Ah! That is a good idea. It is probably more important now that we store a sorted Vec of FlowRefs in the FlexFlow. I'll add a issue for this.


components/style/properties.mako.rs, line 4928 [r10] (raw file):
Awesome, good catch. I'll make the update shortly


Comments from Reviewable

@KiChjang
Copy link
Member

KiChjang commented Apr 11, 2016

@bors-servo r=SimonSapin

@bors-servo
Copy link
Contributor

bors-servo commented Apr 11, 2016

📌 Commit 3580f91 has been approved by SimonSapin

@SimonSapin
Copy link
Member

SimonSapin commented Apr 11, 2016

Reviewed 2 of 2 files at r11.
Review status: all files reviewed at latest revision, 3 unresolved discussions.


components/layout/flex.rs, line 81 [r1] (raw file):
For future readers: #10531


Comments from Reviewable

@bors-servo
Copy link
Contributor

bors-servo commented Apr 11, 2016

Testing commit 3580f91 with merge df21bb4...

bors-servo added a commit that referenced this pull request Apr 11, 2016
Implement flexbox reordering

Add style property for `order` and implement reordering by this property
in flex flow. Based on previous work by @zentner-kyle.

Fixes: #9957

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

bors-servo commented Apr 11, 2016

@bors-servo bors-servo merged commit 3580f91 into servo:master Apr 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
@dlrobertson dlrobertson deleted the dlrobertson:flex-order branch Apr 12, 2016
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

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