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: Avoid selector-matching when only the style attribute is changed. #15317

Merged
merged 2 commits into from Feb 2, 2017

Conversation

Projects
None yet
4 participants
@emilio
Member

emilio commented Jan 31, 2017

r? @bholley


This change is Reviewable

@highfive

This comment has been minimized.

Show comment
Hide comment
@highfive

highfive Jan 31, 2017

Heads up! This PR modifies the following files:

  • @bholley: components/style/data.rs, components/style/restyle_hints.rs, components/style/rule_tree/mod.rs, components/style/traversal.rs, components/style/matching.rs

highfive commented Jan 31, 2017

Heads up! This PR modifies the following files:

  • @bholley: components/style/data.rs, components/style/restyle_hints.rs, components/style/rule_tree/mod.rs, components/style/traversal.rs, components/style/matching.rs
@highfive

This comment has been minimized.

Show comment
Hide comment
@highfive

highfive Jan 31, 2017

warning Warning warning

  • These commits modify style code, but no tests are modified. Please consider adding a test!

highfive commented Jan 31, 2017

warning Warning warning

  • These commits modify style code, but no tests are modified. Please consider adding a test!
@emilio

This comment has been minimized.

Show comment
Hide comment
@emilio
Member

emilio commented Jan 31, 2017

@bors-servo

This comment has been minimized.

Show comment
Hide comment
@bors-servo

bors-servo Jan 31, 2017

Contributor

⌛️ Trying commit 9830752 with merge 2b7124f...

Contributor

bors-servo commented Jan 31, 2017

⌛️ Trying commit 9830752 with merge 2b7124f...

bors-servo added a commit that referenced this pull request Jan 31, 2017

Auto merge of #15317 - emilio:style-attr-restyle, r=<try>
style: Avoid selector-matching when only the style attribute is changed.

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/15317)
<!-- Reviewable:end -->
@emilio

This comment has been minimized.

Show comment
Hide comment
@emilio
Member

emilio commented Jan 31, 2017

@bors-servo

This comment has been minimized.

Show comment
Hide comment
@bors-servo

bors-servo Jan 31, 2017

Contributor

💔 Test failed - linux-rel-css

Contributor

bors-servo commented Jan 31, 2017

💔 Test failed - linux-rel-css

@emilio

This comment has been minimized.

Show comment
Hide comment
@emilio

emilio Jan 31, 2017

Member

So there are two tests failing there, and I believe none of them is my fault.

The first seems like a timing-related incremental table layout bug (/css21_dev/html4/border-collapse-dynamic-table-002.htm). I can reproduce it sort-of reliably with my patch, but the reflow logs are identical for both, and I've verified that the styles applying are correct (thus my conclusion).

The second I can't reproduce it at all, but seems similarly a reflow issue, not a styling issue:

table
bidi

Member

emilio commented Jan 31, 2017

So there are two tests failing there, and I believe none of them is my fault.

The first seems like a timing-related incremental table layout bug (/css21_dev/html4/border-collapse-dynamic-table-002.htm). I can reproduce it sort-of reliably with my patch, but the reflow logs are identical for both, and I've verified that the styles applying are correct (thus my conclusion).

The second I can't reproduce it at all, but seems similarly a reflow issue, not a styling issue:

table
bidi

@emilio

This comment has been minimized.

Show comment
Hide comment
@emilio
Member

emilio commented Jan 31, 2017

@bors-servo retry

@bors-servo

This comment has been minimized.

Show comment
Hide comment
@bors-servo

bors-servo Jan 31, 2017

Contributor

⌛️ Trying commit 9830752 with merge 75a5eeb...

Contributor

bors-servo commented Jan 31, 2017

⌛️ Trying commit 9830752 with merge 75a5eeb...

bors-servo added a commit that referenced this pull request Jan 31, 2017

Auto merge of #15317 - emilio:style-attr-restyle, r=<try>
style: Avoid selector-matching when only the style attribute is changed.

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/15317)
<!-- Reviewable:end -->
@bholley

lgtm with those changes. Thanks for doing this!

/// The rule nodes for each of the pseudo-elements of an element.
///
/// TODO(emilio): Probably shouldn't be a `HashMap` by default, but a smaller
/// array.

This comment has been minimized.

@bholley

bholley Jan 31, 2017

Contributor

Can you file a bug against stylo-perf for this?

@bholley

bholley Jan 31, 2017

Contributor

Can you file a bug against stylo-perf for this?

///
/// FIXME(emilio): We could in theory avoid creating these when we have
/// support for just re-cascading an element. Then the input to
/// `cascade_node` could be `MatchResults` or just `UseExistingStyle`.

This comment has been minimized.

@bholley

bholley Jan 31, 2017

Contributor

This too.

@bholley

bholley Jan 31, 2017

Contributor

This too.

Show outdated Hide outdated components/style/data.rs Outdated
Show outdated Hide outdated components/style/data.rs Outdated
Show outdated Hide outdated components/style/traversal.rs Outdated
Show outdated Hide outdated components/style/restyle_hints.rs Outdated
Show outdated Hide outdated components/style/matching.rs Outdated
Show outdated Hide outdated components/style/matching.rs Outdated
// transitions, but could not be so for SMIL animations, which we'd need
// to special-case (isn't hard, it's just about removing the `if` and
// special cases, and replacing them for a `while` loop, avoiding the
// optimizations).

This comment has been minimized.

@bholley

bholley Jan 31, 2017

Contributor

Can you file this as a dependency to https://bugzilla.mozilla.org/show_bug.cgi?id=1302948 ?

@bholley

bholley Jan 31, 2017

Contributor

Can you file this as a dependency to https://bugzilla.mozilla.org/show_bug.cgi?id=1302948 ?

Show outdated Hide outdated components/style/rule_tree/mod.rs Outdated
@bholley

This comment has been minimized.

Show comment
Hide comment
@bholley

bholley Jan 31, 2017

Contributor

@bors-servo delegate+

Contributor

bholley commented Jan 31, 2017

@bors-servo delegate+

@bors-servo

This comment has been minimized.

Show comment
Hide comment
@bors-servo

bors-servo Jan 31, 2017

Contributor

✌️ @emilio can now approve this pull request

Contributor

bors-servo commented Jan 31, 2017

✌️ @emilio can now approve this pull request

@bors-servo

This comment has been minimized.

Show comment
Hide comment
@bors-servo

bors-servo Jan 31, 2017

Contributor

💔 Test failed - linux-rel-css

Contributor

bors-servo commented Jan 31, 2017

💔 Test failed - linux-rel-css

@emilio

This comment has been minimized.

Show comment
Hide comment
@emilio
Member

emilio commented Feb 1, 2017

@bors-servo

This comment has been minimized.

Show comment
Hide comment
@bors-servo

bors-servo Feb 1, 2017

Contributor

⌛️ Trying commit bc7c4f0 with merge 5980d6a...

Contributor

bors-servo commented Feb 1, 2017

⌛️ Trying commit bc7c4f0 with merge 5980d6a...

bors-servo added a commit that referenced this pull request Feb 1, 2017

Auto merge of #15317 - emilio:style-attr-restyle, r=<try>
style: Avoid selector-matching when only the style attribute is changed.

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/15317)
<!-- Reviewable:end -->
@emilio

This comment has been minimized.

Show comment
Hide comment
@emilio

emilio Feb 1, 2017

Member

Bobby, I added another large-ish commit refactoring stuff and adding support for the cascade-only thing, I'd appreciate if you can take another look at it.

Member

emilio commented Feb 1, 2017

Bobby, I added another large-ish commit refactoring stuff and adding support for the cascade-only thing, I'd appreciate if you can take another look at it.

@bors-servo

This comment has been minimized.

Show comment
Hide comment
@bors-servo

bors-servo Feb 1, 2017

Contributor

💔 Test failed - mac-rel-css

Contributor

bors-servo commented Feb 1, 2017

💔 Test failed - mac-rel-css

@emilio

This comment has been minimized.

Show comment
Hide comment
@emilio
Member

emilio commented Feb 1, 2017

@bors-servo

This comment has been minimized.

Show comment
Hide comment
@bors-servo

bors-servo Feb 1, 2017

Contributor

⌛️ Trying commit bc7c4f0 with merge abc0548...

Contributor

bors-servo commented Feb 1, 2017

⌛️ Trying commit bc7c4f0 with merge abc0548...

bors-servo added a commit that referenced this pull request Feb 1, 2017

Auto merge of #15317 - emilio:style-attr-restyle, r=<try>
style: Avoid selector-matching when only the style attribute is changed.

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/15317)
<!-- Reviewable:end -->
@bors-servo

This comment has been minimized.

Show comment
Hide comment
@bors-servo

bors-servo Feb 1, 2017

Contributor

💔 Test failed - linux-rel-css

Contributor

bors-servo commented Feb 1, 2017

💔 Test failed - linux-rel-css

/// Whether this element should be restyled during the traversal, and how.
///
/// This hint is stripped down, and only contains hints that are a subset of
/// RestyleHint::for_single_element().

This comment has been minimized.

@bholley

bholley Feb 2, 2017

Contributor

Nit: This comment needs updating.

@bholley

bholley Feb 2, 2017

Contributor

Nit: This comment needs updating.

shared_context, &mut data) }
};
// TODO(emilio): Make cascade_input less expensive to compute in the cases
// we don't need to run selector matching.

This comment has been minimized.

@bholley

bholley Feb 2, 2017

Contributor

Yeah. I'm not super wild about the structure here, but I'm ok with fixing it up later.

@bholley

bholley Feb 2, 2017

Contributor

Yeah. I'm not super wild about the structure here, but I'm ok with fixing it up later.

@bholley

This comment has been minimized.

Show comment
Hide comment
@bholley

bholley Feb 2, 2017

Contributor

@bors-servo delegate+

Contributor

bholley commented Feb 2, 2017

@bors-servo delegate+

@bors-servo

This comment has been minimized.

Show comment
Hide comment
@bors-servo

bors-servo Feb 2, 2017

Contributor

✌️ @emilio can now approve this pull request

Contributor

bors-servo commented Feb 2, 2017

✌️ @emilio can now approve this pull request

emilio added some commits Jan 31, 2017

@highfive highfive removed the S-tests-failed label Feb 2, 2017

@emilio

This comment has been minimized.

Show comment
Hide comment
@emilio

emilio Feb 2, 2017

Member

@bors-servo r=bholley

I backed out the first inherited_style_changed patch. It's due to a bug in servo's style damage computation, but I'll submit the fix separately.

Member

emilio commented Feb 2, 2017

@bors-servo r=bholley

I backed out the first inherited_style_changed patch. It's due to a bug in servo's style damage computation, but I'll submit the fix separately.

@bors-servo

This comment has been minimized.

Show comment
Hide comment
@bors-servo

bors-servo Feb 2, 2017

Contributor

📌 Commit 2594cb9 has been approved by bholley

Contributor

bors-servo commented Feb 2, 2017

📌 Commit 2594cb9 has been approved by bholley

@bors-servo

This comment has been minimized.

Show comment
Hide comment
@bors-servo

bors-servo Feb 2, 2017

Contributor

⌛️ Testing commit 2594cb9 with merge fb7f65f...

Contributor

bors-servo commented Feb 2, 2017

⌛️ Testing commit 2594cb9 with merge fb7f65f...

bors-servo added a commit that referenced this pull request Feb 2, 2017

Auto merge of #15317 - emilio:style-attr-restyle, r=bholley
style: Avoid selector-matching when only the style attribute is changed.

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/15317)
<!-- Reviewable:end -->
@bors-servo

This comment has been minimized.

Show comment
Hide comment
@bors-servo

bors-servo Feb 2, 2017

Contributor

☀️ Test successful - android, arm32, arm64, linux-dev, linux-rel-css, linux-rel-wpt, mac-dev-unit, mac-rel-css, mac-rel-wpt1, mac-rel-wpt2, windows-gnu-dev, windows-msvc-dev
Approved by: bholley
Pushing fb7f65f to master...

Contributor

bors-servo commented Feb 2, 2017

☀️ Test successful - android, arm32, arm64, linux-dev, linux-rel-css, linux-rel-wpt, mac-dev-unit, mac-rel-css, mac-rel-wpt1, mac-rel-wpt2, windows-gnu-dev, windows-msvc-dev
Approved by: bholley
Pushing fb7f65f to master...

@bors-servo bors-servo merged commit 2594cb9 into servo:master Feb 2, 2017

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:style-attr-restyle branch Feb 2, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment