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 upstylo: Rearrange some data structures in preparation for the new incremental restyle algorithm #13863
Conversation
highfive
commented
Oct 21, 2016
|
Heads up! This PR modifies the following files:
|
highfive
commented
Oct 21, 2016
|
@bors-servo try |
|
|
8fe5efb
to
3001bda
|
@bors-servo try |
stylo: Rearrange some data structures in preparation for the new incremental restyle algorithm <!-- 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/13863) <!-- Reviewable:end -->
|
|
3001bda
to
c3d5214
|
@bors-servo try |
stylo: Rearrange some data structures in preparation for the new incremental restyle algorithm <!-- 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/13863) <!-- Reviewable:end -->
|
|
c3d5214
to
fa54cd7
|
r? @emilio |
|
|
|
A few comments, the rest looks ok, but I'd like to review it again once the comments are addressed and this is rebased. |
| }; | ||
| } | ||
|
|
||
| pub fn ensure_restyle_data(&mut self) { |
This comment has been minimized.
This comment has been minimized.
emilio
Oct 21, 2016
Member
This doesn't seem to be called. It's fine if it's intentional, but if not should be removed.
| /// immutable, but for now we need to mutate it a bit before styling to | ||
| /// handle animations. | ||
| EmptyPrevious, | ||
| Previous(NodeStyles), |
This comment has been minimized.
This comment has been minimized.
emilio
Oct 21, 2016
Member
I think size_of::<NodeStyles>() should be equal to size_of::<Option<NodeStyles>>, since it contains an arc, and the discriminant of the option becomes the nullness of the Arc: https://play.rust-lang.org/?gist=bc261480736b63367ed39cc9c4feee82&version=stable&backtrace=0
So I think if it's clearer we should just use Option<NodeStyles>. Otherwise remove the comment about packing.
| } | ||
| } | ||
|
|
||
| pub fn gather_previous_styles<F>(&mut self, f: F) |
This comment has been minimized.
This comment has been minimized.
emilio
Oct 21, 2016
Member
I think to stick to the convention that Option has, we should call this take_previous_styles. I think the fact that the closure is only executed if it's Uninitialized is not documented nowhere.
Probably the more rusty name is something like take_previous_styles_or_else.
Also, if we change to Option<NodeStyles> instead of EmptyPrevious, this function would be way more idiomatic if you ask me.
This comment has been minimized.
This comment has been minimized.
| impl RestyleData { | ||
| fn new() -> Self { | ||
| RestyleData { | ||
| _dummy: 42, |
This comment has been minimized.
This comment has been minimized.
fa54cd7
to
273bd4e
|
@bors-servo r=emilio |
|
|
|
|
273bd4e
to
ae7efd4
|
@bors-servo r=emilio |
|
|
stylo: Rearrange some data structures in preparation for the new incremental restyle algorithm <!-- 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/13863) <!-- Reviewable:end -->
|
|
ae7efd4
to
6e11e35
… restyle algorithm. MozReview-Commit-ID: 8iOALQylOuK
6e11e35
to
adf0fe9
|
@bors-servo r=emilio |
|
|
stylo: Rearrange some data structures in preparation for the new incremental restyle algorithm <!-- 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/13863) <!-- Reviewable:end -->
|
|
|
@bors-servo retry #13887 |
|
|
|
|
bholley commentedOct 21, 2016
•
edited by larsbergstrom
This change is