Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign uplayout: Mark flex items properly during construction #14130
Conversation
highfive
commented
Nov 8, 2016
|
Heads up! This PR modifies the following files:
|
highfive
commented
Nov 8, 2016
|
@bors-servo try |
layout: Mark flex items properly during construction <!-- Please describe your changes on the following line: --> Set the flag of the fragment of children in a flex container according to the direction of the container. The mark is done on the fragment because flex item enstablish a stacking context when its z-index is non-zero ,despite its `position' property. Part of #14123. --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [X] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors - [ ] These changes fix #__ (github issue number if applicable). <!-- Either: --> - [ ] There are tests for these changes OR - [X] These changes do not require tests because refactoring <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> r? @pcwalton
|
|
| @@ -3111,6 +3118,16 @@ impl Overflow { | |||
| } | |||
| } | |||
|
|
|||
| bitflags! { | |||
| pub flags FragmentFlags: u8 { | |||
| // TODO(stshine): find a beter name since these flags can also be used for grid item. | |||
This comment has been minimized.
This comment has been minimized.
| @@ -996,6 +1002,7 @@ impl Fragment { | |||
| specific: info, | |||
| inline_context: self.inline_context.clone(), | |||
| pseudo: self.pseudo.clone(), | |||
| flags: FragmentFlags::empty(), | |||
This comment has been minimized.
This comment has been minimized.
pcwalton
Nov 8, 2016
Contributor
Have you verified that adding these flags does not change the size of Fragment?
This comment has been minimized.
This comment has been minimized.
jdm
Nov 8, 2016
Member
We have a unit test that verifies this: https://dxr.mozilla.org/servo/source/tests/unit/layout/size_of.rs#28
This comment has been minimized.
This comment has been minimized.
stshine
Nov 8, 2016
•
Author
Contributor
This flags field are just the one that was removed by #13848 .
| // TODO(stshine): find a better name since these flags can also be used for grid item. | ||
| /// Whether this fragment represent a child in a row flex container. | ||
| const IS_INLINE_FLEX_ITEM = 0b0000_0001, | ||
| /// Whether this fragment represent a child in a column flex container. |
This comment has been minimized.
This comment has been minimized.
| panic!("called as_mut_flex() on a non-flex flow") | ||
| } | ||
|
|
||
|
|
This comment has been minimized.
This comment has been minimized.
|
r=me with a couple of nits |
Set the flag of the fragment of children in a flex container according to the direction of the container. The mark is done on the fragment because flex item enstablish a stacking context when its z-index is non-zero ,despite its `position' property.
|
@bors-servo r=pcwalton |
|
|
layout: Mark flex items properly during construction <!-- Please describe your changes on the following line: --> Set the flag of the fragment of children in a flex container according to the direction of the container. The mark is done on the fragment because flex item enstablish a stacking context when its z-index is non-zero ,despite its `position' property. Part of #14123. --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [X] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors - [ ] These changes fix #__ (github issue number if applicable). <!-- Either: --> - [ ] There are tests for these changes OR - [X] These changes do not require tests because refactoring <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> r? @pcwalton <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/14130) <!-- Reviewable:end -->
|
Thanks @emilio :) |
|
|
stshine commentedNov 8, 2016
•
edited by larsbergstrom
Set the flag of the fragment of children in a flex container according
to the direction of the container. The mark is done on the fragment
because flex item enstablish a stacking context when its z-index is
non-zero ,despite its `position' property.
Part of #14123.
./mach build -ddoes not report any errors./mach test-tidydoes not report any errorsr? @pcwalton
This change is