-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Use parking_lot::RwLock for PropertyDeclarationBlock #13459
Conversation
Heads up! This PR modifies the following files:
|
impl<T: HeapSizeOf> HeapSizeOf for Arc<T>
.impl<T: HeapSizeOf> HeapSizeOf for Arc<T>
.
@bors-servo r+ |
📌 Commit a710b40 has been approved by |
Reviewed 3 of 3 files at r1, 12 of 12 files at r2, 8 of 8 files at r3. Comments from Reviewable |
impl<T: HeapSizeOf> HeapSizeOf for Arc<T>
.961eb33
to
22b2668
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm fine with this. In general, I'd like us to ensure we don't block in most cases (it should only be needed for keyframes), but I see why that's hard. It can become a followup. In any case it's better than the YOLO RefCell we have now.
@@ -119,43 +118,42 @@ impl CSSStyleDeclarationMethods for CSSStyleDeclaration { | |||
|
|||
// Step 2 | |||
if let Some(shorthand) = Shorthand::from_name(&property) { | |||
let style_attribute = owner.style_attribute().borrow(); | |||
let style_attribute = if let Some(ref style_attribute) = *style_attribute { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This might be easier to read with a match
instead?
bb79914
to
d6538f9
Compare
@bors-servo r=emilio p=10 (Prioritized as this is prone to bitrot.) |
📌 Commit d6538f9 has been approved by |
Use parking_lot::RwLock for PropertyDeclarationBlock <!-- Please describe your changes on the following line: --> As discussed in https://bugzilla.mozilla.org/show_bug.cgi?id=1305141 Closes #13176 --- Original PR title: Stop relying on `impl<T: HeapSizeOf> HeapSizeOf for Arc<T>` servo/heapsize#37 (comment) This builds on top of that. --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [ ] These changes fix #__ (github issue number if applicable). <!-- Either: --> - [ ] There are tests for these changes OR - [x] These changes do not require tests because refactor <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> <!-- 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/13459) <!-- Reviewable:end -->
💔 Test failed - linux-dev |
d6538f9
to
90d245a
Compare
90d245a
to
3d1a917
Compare
Rebased and added a "Disable applicable declarations cache for elements with a style attribute" commit. We’ll need to do something (maybe mark the cache as dirty whenever a re-r? @emilio |
@@ -502,7 +502,8 @@ trait PrivateMatchMethods: TNode { | |||
-> Arc<ComputedValues> | |||
where Ctx: StyleContext<'a> | |||
{ | |||
let mut cacheable = true; | |||
let has_style_attribute = self.as_element().map_or(false, |e| e.style_attribute().is_some()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add a comment here about why we need to do that? Something like the commit message might work. I think the consequences of removing are non-trivial enough that it deserves it.
This commit is r=me with that.
Also, I think this is the only not-previously-reviewed commit, so feel free to r=me the whole PR when that comment is added. @bors-servo: try |
Use parking_lot::RwLock for PropertyDeclarationBlock <!-- Please describe your changes on the following line: --> As discussed in https://bugzilla.mozilla.org/show_bug.cgi?id=1305141 Closes #13176 --- Original PR title: Stop relying on `impl<T: HeapSizeOf> HeapSizeOf for Arc<T>` servo/heapsize#37 (comment) This builds on top of that. --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [ ] These changes fix #__ (github issue number if applicable). <!-- Either: --> - [ ] There are tests for these changes OR - [x] These changes do not require tests because refactor <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> <!-- 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/13459) <!-- Reviewable:end -->
☀️ Test successful - arm32, arm64, linux-dev, linux-rel-css, linux-rel-wpt, mac-dev-unit, mac-rel-css, mac-rel-wpt1, mac-rel-wpt2, windows-dev |
…bute. The cache is never effective in this case since a style attribute adds to the set of applicable declarations. This also avoid avoids the cache giving out-dated (incorrect) results when `PropertyDeclarationBlock` becomes mutable in a later commit. This is sufficient for now since CSSOM is only implemented for `Element.style`. When StyleRule mutation is added, some additional mechanism (such as evicting the cache) will be needed.
We’re not using it in style after all.
This reverts commit ec72305.
3d1a917
to
d15ac9b
Compare
Yes, that was the only new significant change. @bors-servo r=emilio |
📌 Commit d15ac9b has been approved by |
💡 This pull request was already approved, no need to approve it again.
|
📌 Commit d15ac9b has been approved by |
⌛ Testing commit d15ac9b with merge aea9545... |
Use parking_lot::RwLock for PropertyDeclarationBlock <!-- Please describe your changes on the following line: --> As discussed in https://bugzilla.mozilla.org/show_bug.cgi?id=1305141 Closes #13176 --- Original PR title: Stop relying on `impl<T: HeapSizeOf> HeapSizeOf for Arc<T>` servo/heapsize#37 (comment) This builds on top of that. --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [ ] These changes fix #__ (github issue number if applicable). <!-- Either: --> - [ ] There are tests for these changes OR - [x] These changes do not require tests because refactor <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> <!-- 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/13459) <!-- Reviewable:end -->
☀️ Test successful - arm32, arm64, linux-dev, linux-rel-css, linux-rel-wpt, mac-dev-unit, mac-rel-css, mac-rel-wpt1, mac-rel-wpt2, windows-dev |
As discussed in https://bugzilla.mozilla.org/show_bug.cgi?id=1305141
Closes #13176
Original PR title: Stop relying on
impl<T: HeapSizeOf> HeapSizeOf for Arc<T>
servo/heapsize#37 (comment)
This builds on top of that.
./mach build -d
does not report any errors./mach test-tidy
does not report any errorsThis change is