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: Move the StyleSheetSet into the Stylist. #18170

Merged
merged 4 commits into from Aug 22, 2017

Conversation

@emilio
Copy link
Member

emilio commented Aug 21, 2017

This will allow tracking whether there have been only additions to the
stylesheet set, and in that case don't destroy and completely rebuild the
invalidation map.

This is on top of #18143.


This change is Reviewable

@emilio
Copy link
Member Author

emilio commented Aug 21, 2017

@bors-servo
Copy link
Contributor

bors-servo commented Aug 21, 2017

Trying commit 6f7bedf with merge 68aead0...

bors-servo added a commit that referenced this pull request Aug 21, 2017
style: Move the StyleSheetSet into the Stylist.

This will allow tracking whether there have been only additions to the
stylesheet set, and in that case don't destroy and completely rebuild the
invalidation map.

This is on top of #18143.
@highfive
Copy link

highfive commented Aug 21, 2017

Heads up! This PR modifies the following files:

  • @bholley: components/style/gecko/data.rs, components/style/stylesheets/stylesheet.rs, components/style/stylesheet_set.rs, components/style/stylist.rs, components/style/animation.rs and 1 more
  • @canaltinova: components/style/gecko/data.rs, components/style/stylesheets/stylesheet.rs, components/style/stylesheet_set.rs, components/style/stylist.rs, components/style/animation.rs and 1 more
@highfive
Copy link

highfive commented Aug 21, 2017

warning Warning warning

  • These commits modify unsafe code. Please review it carefully!
@bors-servo
Copy link
Contributor

bors-servo commented Aug 21, 2017

💔 Test failed - linux-dev

@emilio emilio force-pushed the emilio:stylist-stylesheet-set branch from 6f7bedf to ed30bbe Aug 21, 2017
@emilio
Copy link
Member Author

emilio commented Aug 21, 2017

@bors-servo
Copy link
Contributor

bors-servo commented Aug 21, 2017

Trying commit ed30bbe with merge 2aed2a0...

bors-servo added a commit that referenced this pull request Aug 21, 2017
style: Move the StyleSheetSet into the Stylist.

This will allow tracking whether there have been only additions to the
stylesheet set, and in that case don't destroy and completely rebuild the
invalidation map.

This is on top of #18143.

<!-- 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/18170)
<!-- Reviewable:end -->
@emilio
Copy link
Member Author

emilio commented Aug 21, 2017

r? @SimonSapin (this is green on Gecko, and I expect too on Stylo)

@emilio
Copy link
Member Author

emilio commented Aug 21, 2017

(or, @heycam, too)

@highfive highfive assigned SimonSapin and unassigned pcwalton Aug 21, 2017
@bors-servo
Copy link
Contributor

bors-servo commented Aug 21, 2017

@emilio emilio force-pushed the emilio:stylist-stylesheet-set branch from ed30bbe to 1700ff3 Aug 21, 2017
@emilio
Copy link
Member Author

emilio commented Aug 21, 2017

This is now rebased on top of #18143, and ready for review.

@emilio
Copy link
Member Author

emilio commented Aug 21, 2017

Since @SimonSapin asked about the unsafe impl Sync for GeckoStyleSheet, and I didn't have a better answer than "our usage happens to be fine", I pushed another commit to isolate the unsafety harder.

Thanks Simon :)

@SimonSapin
Copy link
Member

SimonSapin commented Aug 22, 2017

I’d still like a couple sentences on that impl to say how it’s used etc.


Reviewed 3 of 3 files at r1, 7 of 7 files at r2, 2 of 2 files at r3, 2 of 2 files at r4.
Review status: all files reviewed at latest revision, 3 unresolved discussions.


components/style/stylist.rs, line 54 at r2 (raw file):

/// The type of the stylesheets that the stylist contains.
///
/// FIXME(emilio): It'd be pretty nice to make the stylist generic, but that's

I think cfg over generics is fine.


components/style/stylist.rs, line 330 at r2 (raw file):

/// This structure holds all the selectors and device characteristics
/// for a given document. The selectors are converted into `Rule`s
/// (defined in rust-selectors), and sorted into `SelectorMap`s keyed

Rule is not in rust-selectors anymore.


components/style/stylist.rs, line 333 at r4 (raw file):

#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
struct StylistStylesheetSet(StylesheetSet<StylistSheet>);
unsafe impl Sync for StylistStylesheetSet {}

Please add a doc-comment here to explain why this impl is ok.


Comments from Reviewable

emilio added 3 commits Aug 21, 2017
This will allow tracking whether there have been only additions to the
stylesheet set, and in that case don't destroy and completely rebuild the
invalidation map.
Also add a few comments and similar about pending invalidation work, and avoid
passing a device in script, since the work it performs scanning the stylesheet
is just thrown away in the `flush_without_invalidations` call.
…apper.
@emilio emilio force-pushed the emilio:stylist-stylesheet-set branch from c5f4670 to c73ec5e Aug 22, 2017
@SimonSapin
Copy link
Member

SimonSapin commented Aug 22, 2017

@bors-servo r+


Reviewed 2 of 2 files at r6, 2 of 2 files at r7.
Review status: all files reviewed at latest revision, 3 unresolved discussions.


Comments from Reviewable

@bors-servo
Copy link
Contributor

bors-servo commented Aug 22, 2017

📌 Commit c73ec5e has been approved by SimonSapin

@emilio
Copy link
Member Author

emilio commented Aug 22, 2017

@bors-servo p=1

  • More patches incoming.
bors-servo added a commit that referenced this pull request Aug 22, 2017
style: Implement finer-grained stylist rebuilds.

This is on top of #18170, and aims to resolve https://bugzilla.mozilla.org/show_bug.cgi?id=1386045.

<!-- 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/18191)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

bors-servo commented Aug 22, 2017

Testing commit c73ec5e with merge 019b125...

bors-servo added a commit that referenced this pull request Aug 22, 2017
style: Move the StyleSheetSet into the Stylist.

This will allow tracking whether there have been only additions to the
stylesheet set, and in that case don't destroy and completely rebuild the
invalidation map.

This is on top of #18143.

<!-- 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/18170)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

bors-servo commented Aug 22, 2017

@bors-servo bors-servo merged commit c73ec5e into servo:master Aug 22, 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
bors-servo added a commit that referenced this pull request Aug 22, 2017
style: Implement finer-grained stylist rebuilds.

This is on top of #18170, and aims to resolve https://bugzilla.mozilla.org/show_bug.cgi?id=1386045.

<!-- 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/18191)
<!-- Reviewable:end -->
bors-servo added a commit that referenced this pull request Aug 23, 2017
style: Implement finer-grained stylist rebuilds.

This is on top of #18170, and aims to resolve https://bugzilla.mozilla.org/show_bug.cgi?id=1386045.

<!-- 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/18191)
<!-- Reviewable:end -->
bors-servo added a commit that referenced this pull request Aug 23, 2017
style: Implement finer-grained stylist rebuilds.

This is on top of #18170, and aims to resolve https://bugzilla.mozilla.org/show_bug.cgi?id=1386045.

<!-- 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/18191)
<!-- Reviewable:end -->
bors-servo added a commit that referenced this pull request Aug 23, 2017
style: Implement finer-grained stylist rebuilds.

This is on top of #18170, and aims to resolve https://bugzilla.mozilla.org/show_bug.cgi?id=1386045.

<!-- 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/18191)
<!-- Reviewable:end -->
bors-servo added a commit that referenced this pull request Aug 23, 2017
style: Implement finer-grained stylist rebuilds.

This is on top of #18170, and aims to resolve https://bugzilla.mozilla.org/show_bug.cgi?id=1386045.

<!-- 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/18191)
<!-- Reviewable:end -->
@emilio emilio deleted the emilio:stylist-stylesheet-set branch Aug 24, 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

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