Use an accelerated animation for scrollbar fades.
Categories
(Core :: Layout: Scrolling and Overflow, enhancement)
Tracking
()
People
(Reporter: emilio, Assigned: emilio)
References
Details
(Keywords: perf-alert)
Attachments
(5 files, 1 obsolete file)
It seems this ought to simplify a bunch of the code in ScrollbarActivity.
Assignee | ||
Comment 1•1 years ago
|
||
Assignee | ||
Comment 2•1 years ago
|
||
So the attached patch seems to work (and ought to work), but it causes some flicker, only on root scrollframes. For example searchfox.org works great, but this page shows some minor flickering when scrolling.
Hiro do you happen to know off-hand what might be going on? Otherwise I'll dig more tomorrow.
Assignee | ||
Comment 3•1 years ago
|
||
The transitions seem to start / stop at the right time...
Comment 4•1 years ago
•
|
||
I don't know offhand. And I actually tried the change locally I don't see any flickers at all. And in the searchfox.org case, it's not root, it's a sub scroll container. Maybe what I am seeing is a different version of searchfox?
Also note that flickering during scrolling sounds odd, because the change should only affect things during the scrollbar is fading out, right? Then it's not while scrolling.
My best guess is the searchfox what you are seeing is a different version and it uses position:sticky or some such and the flicker has happened without the change.
Assignee | ||
Comment 5•1 years ago
|
||
The flicker is not in searchfox, it's in pages where we use the root scrollbar. But actually I found it, we're not doing the post-traversal for style roots other than the document element, fix:
diff --git a/layout/style/ServoStyleSet.cpp b/layout/style/ServoStyleSet.cpp
index e2055b7ce6dfc..91baf008a382c 100644
--- a/layout/style/ServoStyleSet.cpp
+++ b/layout/style/ServoStyleSet.cpp
@@ -811,9 +811,9 @@ bool ServoStyleSet::StyleDocument(ServoTraversalFlags aFlags) {
!parent->HasAnyOfFlags(Element::kAllServoDescendantBits));
postTraversalRequired |=
- Servo_TraverseSubtree(root, mRawData.get(), &snapshots, aFlags);
- postTraversalRequired |= root->HasAnyOfFlags(
- Element::kAllServoDescendantBits | NODE_NEEDS_FRAME);
+ Servo_TraverseSubtree(root, mRawData.get(), &snapshots, aFlags) ||
+ root->HasAnyOfFlags(Element::kAllServoDescendantBits |
+ NODE_NEEDS_FRAME);
{
uint32_t existingBits = mDocument->GetServoRestyleRootDirtyBits();
@@ -851,14 +851,13 @@ bool ServoStyleSet::StyleDocument(ServoTraversalFlags aFlags) {
// traversal caused, for example, the font-size to change, the SMIL style
// won't be updated until the next tick anyway.
if (GetPresContext()->EffectCompositor()->PreTraverse(aFlags)) {
- nsINode* styleRoot = mDocument->GetServoRestyleRoot();
- Element* root =
- styleRoot->IsElement() ? styleRoot->AsElement() : rootElement;
-
- postTraversalRequired |=
- Servo_TraverseSubtree(root, mRawData.get(), &snapshots, aFlags);
- postTraversalRequired |= root->HasAnyOfFlags(
- Element::kAllServoDescendantBits | NODE_NEEDS_FRAME);
+ DocumentStyleRootIterator iter(mDocument->GetServoRestyleRoot());
+ while (Element* root = iter.GetNextStyleRoot()) {
+ postTraversalRequired |=
+ Servo_TraverseSubtree(root, mRawData.get(), &snapshots, aFlags) ||
+ root->HasAnyOfFlags(Element::kAllServoDescendantBits |
+ NODE_NEEDS_FRAME);
+ }
}
return postTraversalRequired;
Comment 6•1 years ago
|
||
Great to hear that. I was totally mis-reading the original comment. Now I see the flickers (on bugzilla for example), the flickers you meant is flickering on the fading out scrollbar thumb, rather than the scrolled content, that totally makes sense. :)
Assignee | ||
Comment 7•1 years ago
|
||
This fixes some flickering when transitioning doc-level anonymous
content.
Assignee | ||
Comment 8•1 years ago
|
||
This makes sure that the URLExtraData contains the right referrer info,
and thus that mChromeRulesEnabled is correct.
Remove some useless includes while at it.
Depends on D193046
Assignee | ||
Comment 9•1 years ago
|
||
This is needed to be able to use chrome environment variables in
chrome stylesheets and have them work in non-chrome documents.
This will be used to communicate the right transition duration in
scrollbars.css, but should also be useful to have the right base URI for
<url>-typed custom properties.
Depends on D193047
Assignee | ||
Comment 10•1 years ago
|
||
This also simplifies ScrollbarActivity, and removes some attributes that
aren't looked up while at it.
Depends on D193048
Comment 11•1 years ago
|
||
Updated•1 years ago
|
Assignee | ||
Updated•1 years ago
|
Comment 12•1 years ago
|
||
Comment 13•1 years ago
|
||
Comment 14•1 years ago
|
||
Backed out changeset 2c84b8379060 for causing failures on test_group_mouseevents.html | helper_drag_root_scrollbar_mouse_not_over_thumb.html
Comment 15•1 years ago
|
||
Comment 17•1 years ago
|
||
bugherder |
Comment 18•1 years ago
|
||
Comment 19•1 years ago
|
||
bugherder |
Assignee | ||
Comment 21•1 years ago
|
||
browser/base/content/test/pageinfo/browser_pageinfo_rtl.js
and a couple others fail with a "never disabled vsync". I need to look into that.
Assignee | ||
Updated•1 year ago
|
Comment 22•1 year ago
|
||
Comment 23•1 year ago
|
||
Comment 24•1 year ago
|
||
(In reply to Pulsebot from comment #23)
Pushed by emilio@crisal.io:
https://hg.mozilla.org/integration/autoland/rev/298c668b4347
Disable overlay scrollbar animations in more tests.
I'm curious, how is this causing tests to fail?
Assignee | ||
Comment 25•1 year ago
|
||
Partially faded scrollbars in WPT. That's because we know trigger the transition also when we show the scrollbars, not only when we hide them. On android (only) we used to not have the fade animation because the scrollbars remained visible.
Comment 26•1 year ago
•
|
||
Backed out for causing multiple failures
Backout link: https://hg.mozilla.org/integration/autoland/rev/f21ddbefe76eef1f2801d2157a2d1c3ee0e21556
Updated•1 year ago
|
Assignee | ||
Comment 27•1 year ago
|
||
Before the animation was mutating the style attribute, and WPT on
android actually triggered the mutation before unload, and never mutated
again, because of a testing-only pref:
It's possible that this improves bfcache on android given that.
Depends on D193049
Assignee | ||
Updated•1 year ago
|
Comment 28•1 year ago
|
||
Comment 29•1 year ago
|
||
bugherder |
Assignee | ||
Updated•1 year ago
|
Updated•1 year ago
|
Comment 30•1 year ago
|
||
(In reply to Pulsebot from comment #23)
Pushed by emilio@crisal.io:
https://hg.mozilla.org/integration/autoland/rev/298c668b4347
Disable overlay scrollbar animations in more tests.
== Change summary for alert #40367 (as of Thu, 23 Nov 2023 11:01:58 GMT) ==
Improvements:
Ratio | Test | Platform | Options | Absolute values (old vs new) | Performance Profiles |
---|---|---|---|---|---|
2% | twitter LastVisualChange | linux1804-64-shippable-qr | bytecode-cached fission warm webrender | 1,105.85 -> 1,078.88 | Before/After |
2% | twitter LastVisualChange | linux1804-64-shippable-qr | bytecode-cached fission warm webrender | 1,100.32 -> 1,080.57 | Before/After |
For up to date results, see: https://treeherder.mozilla.org/perfherder/alerts?id=40367
Updated•1 year ago
|
Comment hidden (obsolete) |
Updated•1 year ago
|
Comment 32•1 year ago
|
||
Backed out of beta
https://hg.mozilla.org/releases/mozilla-beta/rev/48d2052b377a35b0f40e52b8efad5e0ea10e0ebe
Description
•