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 upstyle: Expose the traversal kind to the style system. #15160
Conversation
highfive
commented
Jan 23, 2017
|
Heads up! This PR modifies the following files:
|
highfive
commented
Jan 23, 2017
| @@ -62,6 +62,23 @@ impl LogBehavior { | |||
| fn allow(&self) -> bool { matches!(*self, MayLog) } | |||
| } | |||
|
|
|||
| /// The kind of traversals we could perform. | |||
| #[derive(Debug, Copy, Clone)] | |||
| pub enum TraversalKind { | |||
This comment has been minimized.
This comment has been minimized.
bholley
Jan 23, 2017
Contributor
Nit: I think it would be a little more specific to refer to this as TraversalDriver. It's a bit of a judgement call though so I won't insist.
| /// regard via the type system via a `TraversalKind` trait for this trait, | ||
| /// that could be one of two concrete types. It's not clear whether the | ||
| /// potential code size impact of that is worth it. | ||
| fn kind(&self) -> TraversalKind; |
This comment has been minimized.
This comment has been minimized.
bholley
Jan 23, 2017
Contributor
Yeah I agree that doing this dynamically makes the most sense.
I think the ergonomics would be a bit better if we just had is_parallel() here, rather than implementing it on TraversalKind, then exposing kind(), then having the caller check that. We can always expose more information as-needed if we ever develop new traversal variants.
|
@bors-servo delegate+ I'd prefer 'driver' to 'kind', but am ok with 'kind' if you prefer it. I'd like to do the other fix mentioned though. |
|
@bors-servo delegate+ (Apparently that doesn't work in review comments) |
|
|
70d4034
to
de53d6b
|
Driver works for me, and I don't feel like bike-shedding about this ;) @bors-servo r=bholley |
|
|
|
@bors-servo r- Let's wait for #15164 to land first. |
| @@ -1173,7 +1173,13 @@ impl LayoutThread { | |||
| data.reflow_info.goal); | |||
|
|
|||
| // NB: Type inference falls apart here for some reason, so we need to be very verbose. :-( | |||
| let traversal = RecalcStyleAndConstructFlows::new(shared_layout_context); | |||
| let traversal_kind = if self.parallel_flag && self.parallel_traversal.is_some() { | |||
This comment has been minimized.
This comment has been minimized.
|
|
||
| if per_doc_data.num_threads == 1 || per_doc_data.work_queue.is_none() { | ||
| sequential::traverse_dom(&traversal, element, token); | ||
| let traversal_kind = if per_doc_data.num_threads == 1 || per_doc_data.work_queue.is_none() { |
This comment has been minimized.
This comment has been minimized.
|
@bors-servo r=bholley |
|
|
This way we'll be able to take different paths for the sequential and parallel traversals in some concrete cases. This is a preliminar patch to fix bug 1332525.
|
@bors-servo r=bholley
|
|
|
style: Expose the traversal kind to the style system. This way we'll be able to take different paths for the sequential and parallel traversals in some concrete cases. This is a preliminar patch to fix bug 1332525. r? @bholley <!-- 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/15160) <!-- Reviewable:end -->
|
|
|
@bors-servo retry servo/saltfs#585 |
|
@bors-servo: r- |
|
@bors-servo r=bholley |
|
|
style: Expose the traversal kind to the style system. This way we'll be able to take different paths for the sequential and parallel traversals in some concrete cases. This is a preliminar patch to fix bug 1332525. r? @bholley <!-- 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/15160) <!-- Reviewable:end -->
|
|
emilio commentedJan 23, 2017
•
edited by larsbergstrom
This way we'll be able to take different paths for the sequential and parallel
traversals in some concrete cases.
This is a preliminar patch to fix bug 1332525.
r? @bholley
This change is