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

style: Expose the traversal kind to the style system. #15160

Merged
merged 1 commit into from Jan 25, 2017

Conversation

@emilio
Copy link
Member

emilio commented Jan 23, 2017

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 Reviewable

@highfive
Copy link

highfive commented Jan 23, 2017

Heads up! This PR modifies the following files:

  • @bholley: components/style/parallel.rs, components/style/sequential.rs, components/style/gecko/traversal.rs, components/style/traversal.rs
@highfive
Copy link

highfive commented Jan 23, 2017

warning Warning warning

  • These commits modify style and layout code, but no tests are modified. Please consider adding a test!
@emilio emilio force-pushed the emilio:expose-traversal-kind branch from 1828302 to ff88d9a 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.

Copy link
@bholley

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.

Copy link
@bholley

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.

Copy link
Contributor

bholley left a comment

@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.

@bholley
Copy link
Contributor

bholley commented Jan 23, 2017

@bors-servo delegate+

(Apparently that doesn't work in review comments)

@bors-servo
Copy link
Contributor

bors-servo commented Jan 23, 2017

✌️ @emilio can now approve this pull request

@emilio emilio force-pushed the emilio:expose-traversal-kind branch 2 times, most recently from 70d4034 to de53d6b Jan 24, 2017
@emilio
Copy link
Member Author

emilio commented Jan 24, 2017

Driver works for me, and I don't feel like bike-shedding about this ;)

@bors-servo r=bholley

@bors-servo
Copy link
Contributor

bors-servo commented Jan 24, 2017

📌 Commit de53d6b has been approved by bholley

@emilio
Copy link
Member Author

emilio commented Jan 24, 2017

@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.

Copy link
@bholley

bholley Jan 24, 2017

Contributor

Nit: probably call this variable |driver|.


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.

Copy link
@bholley

bholley Jan 24, 2017

Contributor

same here.

@emilio emilio force-pushed the emilio:expose-traversal-kind branch from de53d6b to c675cdd Jan 24, 2017
@emilio
Copy link
Member Author

emilio commented Jan 24, 2017

@bors-servo r=bholley

@bors-servo
Copy link
Contributor

bors-servo commented Jan 24, 2017

📌 Commit c675cdd has been approved by 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.
@emilio emilio force-pushed the emilio:expose-traversal-kind branch from c675cdd to f00b628 Jan 24, 2017
@emilio
Copy link
Member Author

emilio commented Jan 24, 2017

@bors-servo r=bholley

  • You can't sed fast enough
@bors-servo
Copy link
Contributor

bors-servo commented Jan 24, 2017

📌 Commit f00b628 has been approved by bholley

@bors-servo
Copy link
Contributor

bors-servo commented Jan 24, 2017

Testing commit f00b628 with merge 55165bf...

bors-servo added a commit that referenced this pull request Jan 24, 2017
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
Copy link
Contributor

bors-servo commented Jan 24, 2017

💔 Test failed - windows-gnu-dev

@Ms2ger
Copy link
Contributor

Ms2ger commented Jan 24, 2017

@jdm
Copy link
Member

jdm commented Jan 24, 2017

@mbrubeck
Copy link
Contributor

mbrubeck commented Jan 24, 2017

@bors-servo r=bholley

@bors-servo
Copy link
Contributor

bors-servo commented Jan 24, 2017

📌 Commit f00b628 has been approved by bholley

@bors-servo
Copy link
Contributor

bors-servo commented Jan 25, 2017

Testing commit f00b628 with merge 1934a33...

bors-servo added a commit that referenced this pull request Jan 25, 2017
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 bors-servo merged commit f00b628 into servo:master Jan 25, 2017
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
@emilio emilio deleted the emilio:expose-traversal-kind branch Jan 25, 2017
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

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