Text-Fragments: Implement User Activation
Categories
(Core :: DOM: Navigation, task)
Tracking
()
Tracking | Status | |
---|---|---|
firefox129 | --- | fixed |
People
(Reporter: jjaschke, Assigned: jjaschke)
References
(Blocks 2 open bugs)
Details
(Keywords: perf-alert)
Crash Data
Attachments
(7 files, 1 obsolete file)
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
Bug 1888756, part 6 - Text Fragments: Changed order of tests in non-html-documents.html. r=#dom-core
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review |
This bug tracks the implementation of the User Activation behavior of Text Fragments.
Assignee | ||
Updated•8 months ago
|
Assignee | ||
Comment 1•7 months ago
|
||
Assignee | ||
Comment 2•5 months ago
|
||
This commit is a prerequisite for part 5 of this patch set
and introduces the text directive user activation
flag
as well as the necessary boilerplate to transport the value
through process boundaries in nsDocShellLoadState
and LoadInfo
.
There is no changed behavior in this commit.
Assignee | ||
Comment 3•5 months ago
|
||
This commit is a prerequisite for part 5 of this patch set.
This flag is set in the docshell, based on user gesture activation
.
This is not necessarily sufficient,
as the text fragments spec bases the value of
this flag also on User Involvement, which is not
implemented in Gecko yet.
The flag is then plumbed through the parent process
(DocumentLoadListener::CreateDocumentLoadInfo()
)
to the document, where it can be consumed.
This includes client-side redirects as described in [0].
There is no changed behavior in this commit.
[0] https://wicg.github.io/scroll-to-text-fragment/#restricting-the-text-fragment
Assignee | ||
Comment 4•5 months ago
|
||
This commit is a prerequisite for part 5 of this patch set.
The idea is to keep the information whether the last
load done by the doc shell was a same-document navigation.
The value is reset for every navigation, therefore it
should always be correct.
There is no changed behavior in this commit.
Assignee | ||
Comment 5•5 months ago
|
||
This commit is a prerequisite for part 5 of this patch set
and does not introduce any changes in behavior.
Assignee | ||
Comment 6•5 months ago
|
||
This commit implements the rules given in the spec [0]
to determine if a text directive is allowed to be scrolled to.
This includes checking and consuming the text directive user activation
which was introduced in the previous parts of this patch set.
Additionally, a number of checks given in [1] are implemented.
The newly added method is injected into our scroll-to-fragment
algorithms in Document::ScrollToRef()
and nsDocShell::ScrollToAnchor()
.
[0] https://wicg.github.io/scroll-to-text-fragment/#restricting-the-text-fragment
[1] https://wicg.github.io/scroll-to-text-fragment/#check-if-a-text-directive-can-be-scrolled
Assignee | ||
Comment 7•5 months ago
|
||
## non-html-documents.html
Gecko does not fire an onload
event for JSON files,
which causes the test to time out.
Therefore, the test for JSON has been moved
to the end of the file, so that the other tests
run before the test times out.
Note: The rules implemented in part 5 of this
patch set prevent JSON files from being scrolled to;
Failing this test does not imply incorrect behavior.
## iframe-scroll.sub.html
This test opens a same/cross origin iframe with a text fragment.
According to the test file, the iframe should
scroll to the text fragment in both cases.
Additionally, the same-origin case should update
the parent document's scroll position for the same-origin case.
In the same-origin case, the current Gecko implementation
scrolls inside of the iframe, but does not bubble
the scroll position to the parent document.
In the cross-origin case, the iframe does not scroll,
because it is a cross-origin non-top-level navigation.
Assignee | ||
Comment 8•5 months ago
|
||
Currently, user activation is not transported correctly
if fission is disabled.
This makes a lot of tests fail now, as no user activation
prevents scrolling and most tests rely on scrolling.
Updated•5 months ago
|
Assignee | ||
Comment 9•5 months ago
|
||
Here is a current try run.
There are two issues currently:
- User Activation is not moved across process boundaries correctly if Fission is disabled. This would currently prevent text directives from being scrolled to on Android. I've filed Bug 1901064. Once this is fixed, the test expectations added in part 7 of this patchset can be reverted.
- There are issues regarding consumption of the user gesture activation in combination with the popup blocker. If the popup blocker is enabled, it consumes the user activation, before the text directive user activation is created based off of its value. When running WPTs, the popup blocker is disabled, hence the tests pass. However, in real-life scenarios, the text directive will typically not be scrolled to if the page is navigated to using
window.open()
. Edgar is filing a follow-up bug for and looking into this.
Both issues do not leak sensitive information -- text directives that are actually allowed to be scrolled to are not being scrolled to, not vice versa. Therefore these issues should not block landing this feature.
Updated•5 months ago
|
Comment 10•5 months ago
|
||
Comment 12•5 months ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/0eb8b13b0717
https://hg.mozilla.org/mozilla-central/rev/04180e2fb99d
https://hg.mozilla.org/mozilla-central/rev/400a8ff57ae4
https://hg.mozilla.org/mozilla-central/rev/efff3e5e95c2
https://hg.mozilla.org/mozilla-central/rev/a84d886d8753
https://hg.mozilla.org/mozilla-central/rev/1458ad53d229
https://hg.mozilla.org/mozilla-central/rev/85022f2e4129
Updated•5 months ago
|
Comment 14•5 months ago
|
||
Backed out for potentially causing Session History crashes.
Backout link: https://hg.mozilla.org/mozilla-central/rev/deea4a904a0d3d546ab359aeca91a4bb6dc02a77
Updated•5 months ago
|
Comment 17•5 months ago
|
||
Assignee | ||
Comment 19•5 months ago
|
||
The new version fixes the session history crashes and adjusts the test results mentioned in bug 1904773.
Comment 20•5 months ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/c706ebb5cbf8
https://hg.mozilla.org/mozilla-central/rev/3b60fbb80f67
https://hg.mozilla.org/mozilla-central/rev/142591a5a921
https://hg.mozilla.org/mozilla-central/rev/e1915755c9ca
https://hg.mozilla.org/mozilla-central/rev/339436073065
https://hg.mozilla.org/mozilla-central/rev/11957961b0fa
https://hg.mozilla.org/mozilla-central/rev/662204fa8621
Comment 22•5 months ago
|
||
Hello !
The following alert was generated by the backout . Do you think this bug or one of the following Bug 1888756 , Bug 1901064, Bug 1888756 is responsible for generating the alert ?
Perfherder has detected a browsertime performance change from push 5f6f41a83f0ea8d64264cf04f49a5940f9c8705b.
Regressions:
Ratio | Test | Platform | Options | Absolute values (old vs new) | Performance Profiles |
---|---|---|---|---|---|
22% | wikipedia fcp | android-hw-a51-11-0-aarch64-shippable-qr | warm webrender | 69.60 -> 85.21 | Before/After |
11% | speedometer3 TodoMVC-Preact-Complex-DOM/Adding100Items/Sync | macosx1400-64-shippable-qr | fission webrender | 0.70 -> 0.78 | Before/After |
8% | speedometer3 TodoMVC-Svelte-Complex-DOM/Adding100Items/Sync | macosx1400-64-shippable-qr | fission webrender | 1.51 -> 1.62 | Before/After |
7% | speedometer3 TodoMVC-Svelte-Complex-DOM/Adding100Items/Sync | windows10-64-shippable-qr | fission webrender | 3.21 -> 3.43 | Before/After |
6% | speedometer3 TodoMVC-Svelte-Complex-DOM/Adding100Items/Sync | windows10-64-nightlyasrelease-qr | fission webrender | 3.17 -> 3.37 | Before/After |
5% | speedometer3 TodoMVC-Preact-Complex-DOM/Adding100Items/total | macosx1400-64-shippable-qr | fission webrender | 5.19 -> 5.44 | Before/After |
4% | speedometer3 TodoMVC-Svelte-Complex-DOM/CompletingAllItems/total | windows10-64-shippable-qr | fission webrender | 7.37 -> 7.69 | Before/After |
4% | speedometer3 Charts-chartjs/Show tooltip/Sync | macosx1400-64-shippable-qr | fission webrender | 0.08 -> 0.08 | Before/After |
4% | speedometer3 TodoMVC-Svelte-Complex-DOM/CompletingAllItems/Async | windows10-64-shippable-qr | fission webrender | 5.97 -> 6.18 | Before/After |
3% | speedometer3 TodoMVC-Preact-Complex-DOM/total | macosx1400-64-shippable-qr | fission webrender | 11.59 -> 11.93 | Before/After |
2% | speedometer3 TodoMVC-Preact-Complex-DOM/DeletingAllItems/Async | macosx1400-64-shippable-qr | fission webrender | 1.74 -> 1.78 | Before/After |
Improvements:
Ratio | Test | Platform | Options | Absolute values (old vs new) | Performance Profiles |
---|---|---|---|---|---|
17% | fandom largestContentfulPaint | linux1804-64-shippable-qr | fission warm webrender | 47.46 -> 39.44 | Before/After |
9% | speedometer3 TodoMVC-Svelte-Complex-DOM/Adding100Items/Async | windows10-64-nightlyasrelease-qr | fission webrender | 9.35 -> 8.52 | Before/After |
8% | wikia FirstVisualChange | linux1804-64-shippable-qr | cold fission webrender | 330.15 -> 305.37 | Before/After |
7% | speedometer3 TodoMVC-Svelte-Complex-DOM/Adding100Items/Async | windows10-64-shippable-qr | fission webrender | 9.36 -> 8.67 | Before/After |
7% | wikia largestContentfulPaint | linux1804-64-shippable-qr | fission warm webrender | 193.05 -> 180.32 | Before/After |
... | ... | ... | ... | ... | ... |
2% | speedometer3 Charts-observable-plot/Stacked by 6/Async | macosx1400-64-shippable-qr | fission webrender | 2.38 -> 2.33 | Before/After |
As author of one of the patches included in that push, we need your help to address this regression.
Details of the alert can be found in the alert summary, including links to graphs and comparisons for each of the affected tests. Please follow our guide to handling regression bugs and let us know your plans within 3 business days, or the patch(es) may be backed out in accordance with our regression policy.
If you need the profiling jobs you can trigger them yourself from treeherder job view or ask a sheriff to do that for you.
You can run these tests on try with ./mach try perf --alert 899
For more information on performance sheriffing please see our FAQ.
Assignee | ||
Comment 23•5 months ago
|
||
Hi Florin,
I can take a look, but I highly doubt that the backout of this bug, or the bug itself, can cause a perf regression. The underlying feature is prefed off, so the changes in these patches should be (almost) a noop.
Given that the patches have landed again today, I would suggest re-running the tests to see if this still persists. WDYT?
Comment 24•5 months ago
|
||
(In reply to Jan Jaeschke [:jjaschke] from comment #23)
Hi Florin,
I can take a look, but I highly doubt that the backout of this bug, or the bug itself, can cause a perf regression. The underlying feature is prefed off, so the changes in these patches should be (almost) a noop.
Given that the patches have landed again today, I would suggest re-running the tests to see if this still persists. WDYT?
The regression was recorded on this revision : https://treeherder.mozilla.org/jobs?repo=autoland&revision=5f6f41a83f0ea8d64264cf04f49a5940f9c8705b&group_state=expanded&selectedTaskRun=LHnMakbESkuPnRwRmX-4eg.0
In this revision multiple bugs were backed out, including your bugs. (Bug 1901799, Bug 1897271, Bug 1900863, Bug 1902364, Bug 1902671, Bug 1902086, Bug 1901771, Bug 1902003, Bug 1902359, Bug 1888756, Bug 1901064 Bug 1860915 Bug 1888756)
I left a 'need info' request for each of the bug owners, hoping to find out which of the bug caused the alert.
Comment 25•5 months ago
•
|
||
could it be that making text-fragment parsing preffed off actually improved performance and the backout ended up having worse performance? In Bug 1901799#c13 :fbilt mentioned it is the backout that had the worse performance. I see that backout performance profiles introduced extra mozilla::dom::FragmentDirective::FindTextFragmentsInDocument
calls, so backing out the preffing off actually made performance worse? Can you confirm if this is what might have happened?
Assignee | ||
Comment 26•5 months ago
|
||
Ah, sorry for the confusion. The value of the pref has not changed. FragmentDirective::FindTextFragmentsInDocument()
should always be a noop as long as the pref is turned off. Could you show me the exact profile you've been looking into?
Comment 27•5 months ago
•
|
||
Ah I see. This one is the one with our patches (before the backout) and this one is after the backout. I see calls to nsHtml5ExecutorReflusher
increased due to mozilla::dom::Document::ScrollToRef
in the backout. Everything else looks somewhat similar. This is my first time dealing with perfherder, so if my finding is totally wrong, I'm sorry hahaha.
Assignee | ||
Comment 28•5 months ago
|
||
Oof. Nice find. I'll take back everything I said :)
Okay, here's the explanation:
FindTextFragmentsInDocument()
did flush frames unconditionally before this bug was applied. Applying part 4 of the patches added an early return in that function before flushing. Therefore, applying the patch improved performance, and backing it out restored the slowness. Now it all makes sense, sorry. I was not aware that I introduced the early return here, I thought it was there all along.
But, at the end of the day, I think no further action is necessary because the change has now landed (again). Sounds good?
Comment 30•4 months ago
|
||
Yes, sounds good. Thank you :)
Description
•