0
Commit Graph

140 Commits

Author SHA1 Message Date
Aldo Culquicondor
195c75dd21 Reland "Apply resampling and filtering to back transition gesture"
This is a reland of commit 11fd863068

Some browser tests failed in larger screens due to precision. This
change adds more precision to the input for expected values and
increases the float tolerance for pixel translation comparisons.

Tested:
- TestLivePageTransformBackNavigation/LTR https://ci.chromium.org/ui/inv/u-acondor-2025-01-08-15-55-00-521b4d6171e75910
- TestScreenshotTransformScrimColorForwardNavigation/LTR https://ci.chromium.org/ui/inv/u-acondor-2025-01-08-16-10-00-8067a3c29582dd58

Original change's description:
> Apply resampling and filtering to back transition gesture
>
> To improve the smoothness of the gesture.
>
> This moves the code to set up translations to OnAnimate, which has a
> reference timestamp for the vsync.
>
> Because this adds lag, it exposed a bug in the cancel spring where the
> direction of the initial velocity was wrong, leading to an excessive
> rebound on the left edge.
>
> Bug: 383163623, 40945408
> Change-Id: I1f0ebab932aa2477bb686e3cc277cdbf8575247b
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6064026
> Reviewed-by: Jonathan Ross <jonross@chromium.org>
> Reviewed-by: William Liu <liuwilliam@chromium.org>
> Commit-Queue: Aldo Culquicondor <acondor@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#1403106}

Bug: 383163623, 40945408
Change-Id: I36aeab441355d14f9d8d3f270bd9b3f48582dd20
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6157438
Commit-Queue: Aldo Culquicondor <acondor@chromium.org>
Reviewed-by: William Liu <liuwilliam@chromium.org>
Reviewed-by: Jonathan Ross <jonross@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1404435}
2025-01-09 14:22:33 -08:00
luci-bisection@appspot.gserviceaccount.com
d7aff8028d Revert "Apply resampling and filtering to back transition gesture"
This reverts commit 11fd863068.

Reason for revert:
LUCI Bisection has identified this change as the cause of a test failure. See the analysis: https://ci.chromium.org/ui/p/chromium/bisection/test-analysis/b/5583115201282048

Sample build with failed test: https://ci.chromium.org/b/8726372260772879841
Affected test(s):
[ninja://content/test:content_browsertests/All/BackForwardTransitionAnimationManagerBothEdgeBrowserTest.TestLivePageTransformBackNavigation/LTR](https://ci.chromium.org/ui/test/chromium/ninja:%2F%2Fcontent%2Ftest:content_browsertests%2FAll%2FBackForwardTransitionAnimationManagerBothEdgeBrowserTest.TestLivePageTransformBackNavigation%2FLTR?q=VHash%3A6e0f9c1d8add64dd)
[ninja://content/test:content_browsertests/All/BackForwardTransitionAnimationManagerBothEdgeBrowserTest.TestLivePageTransformBackNavigation/RTL](https://ci.chromium.org/ui/test/chromium/ninja:%2F%2Fcontent%2Ftest:content_browsertests%2FAll%2FBackForwardTransitionAnimationManagerBothEdgeBrowserTest.TestLivePageTransformBackNavigation%2FRTL?q=VHash%3A6e0f9c1d8add64dd)
[ninja://content/test:content_browsertests/All/BackForwardTransitionAnimationManagerBothEdgeBrowserTest.TestScreenshotTransformScrimColorForwardNavigation/LTR](https://ci.chromium.org/ui/test/chromium/ninja:%2F%2Fcontent%2Ftest:content_browsertests%2FAll%2FBackForwardTransitionAnimationManagerBothEdgeBrowserTest.TestScreenshotTransformScrimColorForwardNavigation%2FLTR?q=VHash%3A6e0f9c1d8add64dd)
[ninja://content/test:content_browsertests/All/BackForwardTransitionAnimationManagerBothEdgeBrowserTest.TestScreenshotTransformScrimColorForwardNavigation/LTRFractionalDSF](https://ci.chromium.org/ui/test/chromium/ninja:%2F%2Fcontent%2Ftest:content_browsertests%2FAll%2FBackForwardTransitionAnimationManagerBothEdgeBrowserTest.TestScreenshotTransformScrimColorForwardNavigation%2FLTRFractionalDSF?q=VHash%3A6e0f9c1d8add64dd)
[ninja://content/test:content_browsertests/All/BackForwardTransitionAnimationManagerBothEdgeBrowserTest.TestScreenshotTransformScrimColorForwardNavigation/RTL](https://ci.chromium.org/ui/test/chromium/ninja:%2F%2Fcontent%2Ftest:content_browsertests%2FAll%2FBackForwardTransitionAnimationManagerBothEdgeBrowserTest.TestScreenshotTransformScrimColorForwardNavigation%2FRTL?q=VHash%3A6e0f9c1d8add64dd)
and 1 more ...

If this is a false positive, please report it at http://b.corp.google.com/createIssue?component=1199205&description=Analysis%3A+https%3A%2F%2Fci.chromium.org%2Fui%2Fp%2Fchromium%2Fbisection%2Ftest-analysis%2Fb%2F5583115201282048&format=PLAIN&priority=P3&title=Wrongly+blamed+https%3A%2F%2Fchromium-review.googlesource.com%2Fc%2Fchromium%2Fsrc%2F%2B%2F6064026&type=BUG

Original change's description:
> Apply resampling and filtering to back transition gesture
>
> To improve the smoothness of the gesture.
>
> This moves the code to set up translations to OnAnimate, which has a
> reference timestamp for the vsync.
>
> Because this adds lag, it exposed a bug in the cancel spring where the
> direction of the initial velocity was wrong, leading to an excessive
> rebound on the left edge.
>
> Bug: 383163623, 40945408
> Change-Id: I1f0ebab932aa2477bb686e3cc277cdbf8575247b
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6064026
> Reviewed-by: Jonathan Ross <jonross@chromium.org>
> Reviewed-by: William Liu <liuwilliam@chromium.org>
> Commit-Queue: Aldo Culquicondor <acondor@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#1403106}
>

Bug: 383163623, 40945408
Change-Id: I761410b15e95f151865172ff0d0a1ba21b9b7542
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6154719
Owners-Override: Yoshisato Yanagisawa <yyanagisawa@google.com>
Commit-Queue: Yoshisato Yanagisawa <yyanagisawa@chromium.org>
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1403379}
2025-01-07 19:45:13 -08:00
Aldo Culquicondor
11fd863068 Apply resampling and filtering to back transition gesture
To improve the smoothness of the gesture.

This moves the code to set up translations to OnAnimate, which has a
reference timestamp for the vsync.

Because this adds lag, it exposed a bug in the cancel spring where the
direction of the initial velocity was wrong, leading to an excessive
rebound on the left edge.

Bug: 383163623, 40945408
Change-Id: I1f0ebab932aa2477bb686e3cc277cdbf8575247b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6064026
Reviewed-by: Jonathan Ross <jonross@chromium.org>
Reviewed-by: William Liu <liuwilliam@chromium.org>
Commit-Queue: Aldo Culquicondor <acondor@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1403106}
2025-01-07 10:41:54 -08:00
Aldo Culquicondor
1872d259cd Add hasUAVisualTransition to popstate event
Fixed: 382540647
Change-Id: I61cc7896cb36ac197130a8cd1a006fa844e95c18
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6086378
Commit-Queue: Aldo Culquicondor <acondor@chromium.org>
Reviewed-by: William Liu <liuwilliam@chromium.org>
Reviewed-by: Khushal Sagar <khushalsagar@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1395046}
2024-12-11 12:41:32 -08:00
Baran Erfani
0488f29e94 Revert "[DNT] Disable a flaky test"
This reverts commit b3725574f7.

Reason for revert: Disabled another test which wasn't flaky.

Original change's description:
> [DNT] Disable a flaky test
>
> Fixed: 376867441
> Bug: 379166889
> Change-Id: Iec31960382ae113ceb0342bc4a5dd8c36678f0b1
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6021966
> Commit-Queue: William Liu <liuwilliam@chromium.org>
> Reviewed-by: Theresa Sullivan <twellington@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#1383290}

Bug: 379166889
Change-Id: Ide5c44b089b9b4e33d77c68a1fb541815cd2e812
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6037478
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Reviewed-by: William Liu <liuwilliam@chromium.org>
Commit-Queue: William Liu <liuwilliam@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1386250}
2024-11-21 15:55:24 +00:00
Ioana Pandele
1a561e3ff0 [Gardener] Disable flaky BackForwardTransitionAnimationManagerBrowserTestSubframeTransitions
Bug: 376867441
Change-Id: I0e866304e4d1fe75b1ed7c65aee4ff81072b2875
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6037901
Auto-Submit: Ioana Pandele <ioanap@chromium.org>
Commit-Queue: Ioana Pandele <ioanap@chromium.org>
Reviewed-by: Anna Tsvirchkova <atsvirchkova@google.com>
Owners-Override: Ioana Pandele <ioanap@chromium.org>
Commit-Queue: Anna Tsvirchkova <atsvirchkova@google.com>
Cr-Commit-Position: refs/heads/main@{#1386137}
2024-11-21 10:11:06 +00:00
Lijin Shen
e1da7c83e8 [DNT] Hide toolbar when swiping back from NTP
Do not force to show the toolabr when swiping back from NTP such that
the logo/doodle can still be visible.

Bug: 365818512
Change-Id: I49c4d7fe4afdc6aee47e3973b76d68d78863b7cb
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5980230
Reviewed-by: Theresa Sullivan <twellington@chromium.org>
Reviewed-by: Khushal Sagar <khushalsagar@chromium.org>
Commit-Queue: Lijin Shen <lazzzis@google.com>
Code-Coverage: findit-for-me@appspot.gserviceaccount.com <findit-for-me@appspot.gserviceaccount.com>
Cr-Commit-Position: refs/heads/main@{#1385312}
2024-11-19 23:28:57 +00:00
William Liu
b3725574f7 [DNT] Disable a flaky test
Fixed: 376867441
Bug: 379166889
Change-Id: Iec31960382ae113ceb0342bc4a5dd8c36678f0b1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6021966
Commit-Queue: William Liu <liuwilliam@chromium.org>
Reviewed-by: Theresa Sullivan <twellington@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1383290}
2024-11-14 22:45:45 +00:00
William Liu
0c323bfce2 [DNT] Fix same-doc nav restarts as cross-doc
By adding a `was_reset_for_cross_document_restart()` on the request, we
abort the transition whenever this happens.

R=khushalsagar@chromium.org

Bug: 378504116
Change-Id: I36a41c56cf514adb8f7ed11a838f64ec13b6d3d4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6011318
Reviewed-by: Mark Pearson <mpearson@chromium.org>
Reviewed-by: Khushal Sagar <khushalsagar@chromium.org>
Commit-Queue: William Liu <liuwilliam@chromium.org>
Reviewed-by: Rakina Zata Amni <rakina@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1382583}
2024-11-13 21:21:10 +00:00
Peter Boström
e1cbaa0450 Rename NOTREACHED_NORETURN() uses to NOTREACHED()
These used to be different (before NOTREACHED() was CHECK-fatal), now
they're not and NOTREACHED_NORETURN() is an implementation detail.

Bug: 40580068
Change-Id: Ibc868244fa01f12dee872f4ff4d5c164e957af1f
Low-Coverage-Reason: OTHER Should-be-unreachable code
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6009949
Owners-Override: Lei Zhang <thestig@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Peter Boström <pbos@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1381388}
2024-11-11 21:15:00 +00:00
William Liu
460328dd6e [DNT] Dump state transfer and the navigation request when crashing
Change-Id: Id544dbd88c7a41dc08142dfc926510fd226999cf
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6000399
Reviewed-by: Khushal Sagar <khushalsagar@chromium.org>
Reviewed-by: Vladimir Levin <vmpstr@chromium.org>
Commit-Queue: William Liu <liuwilliam@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1380544}
2024-11-08 19:41:54 +00:00
Baran Erfani
1a028c7a3c [DNT] Added a new Unique ID to NavigationTransitionData
The new id uniquely identifies a screenshot and its navigation entry.
The new id is introduced since the navigation entry's unique ID is
actually not unique (`NavigationEntryImpl::set_unique_id()`), which leads to unexpected behaviour.


Bug: 377381009
Change-Id: I8ada3a70f4134a9d3356a5946f112fbe707d866a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5999901
Commit-Queue: Baran Erfani <baranerf@google.com>
Reviewed-by: William Liu <liuwilliam@chromium.org>
Reviewed-by: Khushal Sagar <khushalsagar@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1380512}
2024-11-08 19:01:03 +00:00
William Liu
15d3a6b22d [DNT] Fix a browser test assertion
It's flaky because we need to wait the callback in order to assert it
has happened.

Cq-Include-Trybots: luci.chromium.try:android-12-x64-rel,android-12l-x64-dbg,android-13-x64-rel,android-14-x64-rel,android-15-x64-rel,android-pie-x86-rel,android-oreo-x86-rel

Bug: 366023026
Fixed: 376867441

Change-Id: Ie9643222a70c50bc0905a90b6c9e142a0c2b6496
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5989252
Reviewed-by: Baran Erfani <baranerf@google.com>
Commit-Queue: William Liu <liuwilliam@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1380437}
2024-11-08 17:10:11 +00:00
Baran Erfani
2e9e2ad5fe [DNT] Removed entry sequence number CHECK
This CL is to handle the cases where the destination
FrameNavigationEntry::item_sequence_number() == -1. When that happens,
we immediately play the cross-fade animation after the invoke animation
has finished. Otherwise the user will have to wait for the stale
screenshot to dismiss after 3 seconds timeout.

Bug: 376944343
Change-Id: I8ec0dbdf973755414ea06f67713c95e8060dad16
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5989194
Commit-Queue: Baran Erfani <baranerf@google.com>
Reviewed-by: William Liu <liuwilliam@chromium.org>
Reviewed-by: Rakina Zata Amni <rakina@chromium.org>
Reviewed-by: Khushal Sagar <khushalsagar@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1379874}
2024-11-07 19:57:43 +00:00
William Liu
31d4a68e68 [DNT] Remove a CHECK for new nav commits during cancel animation
Bug: 376943354
Change-Id: I78c26d14ed3d98e6d32d7865b91dd05de50c9ebd
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6000074
Reviewed-by: Khushal Sagar <khushalsagar@chromium.org>
Commit-Queue: William Liu <liuwilliam@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1379075}
2024-11-06 17:24:33 +00:00
Khushal Sagar
7f6b0f59b9 content: Fix erroneous assert when notified of a draw by the embedder
R=liuwilliam@chromium.org

Bug: 376943354
Change-Id: Ibaf6fbbb62e60709b6c7b40b971d30d871c5d5bc
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5996656
Auto-Submit: Khushal Sagar <khushalsagar@chromium.org>
Commit-Queue: William Liu <liuwilliam@chromium.org>
Reviewed-by: William Liu <liuwilliam@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1379029}
2024-11-06 15:58:53 +00:00
Baran Erfani
7cd8603427 [DNT] Replaced cache hit or miss reason CHECK
Replaced the CHECK with explicitly setting the cache hit or miss reason to `kCacheHit` to avoid the crashes. Created a new bug crbug.com/377566662 to identify the reason behind having an incorrect cache hit or miss reason in this case for the future.

Bug: 377338996
Change-Id: I980a0284a4ed82a8d4518f328b75a8849cfd1866
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5994816
Reviewed-by: Khushal Sagar <khushalsagar@chromium.org>
Commit-Queue: Baran Erfani <baranerf@google.com>
Cr-Commit-Position: refs/heads/main@{#1378795}
2024-11-06 05:33:49 +00:00
William Liu
08baed49d6 [DNT] Remove a CHECK on the effect model vector
Bug: 377341853
Change-Id: I641a7e17f254209c7051975fef38f39dee3fa07f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5991390
Reviewed-by: Khushal Sagar <khushalsagar@chromium.org>
Commit-Queue: Khushal Sagar <khushalsagar@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1378689}
2024-11-06 01:10:22 +00:00
William Liu
fa720a6932 [DNT] Unregister RWH observer for OnContentForNavigationEntryShown
Bug: 373057473
Change-Id: Iecf970d893f18de96c9aa0329051598c5693b100
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5994632
Reviewed-by: Khushal Sagar <khushalsagar@chromium.org>
Commit-Queue: William Liu <liuwilliam@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1378573}
2024-11-05 20:32:23 +00:00
Khushal Sagar
0b28d6f53d content: Handle navigation entry changing mid gesture.
If a navigation entry is deleted in the middle of a user gesture, the
invoke action should safely become a no-op. This is already being done
for the case where the gesture has an animation. Also fix it when the
gesture is not animated.

Bug: 376928606
Change-Id: I08debc240fcf121601732e826fd1060c9063d5c1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5991673
Auto-Submit: Khushal Sagar <khushalsagar@chromium.org>
Commit-Queue: William Liu <liuwilliam@chromium.org>
Reviewed-by: William Liu <liuwilliam@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1378477}
2024-11-05 18:48:43 +00:00
William Liu
c6a65b7f78 [DNT] Unregister RenderWidgetHostObserver for 204/205/Download
For 204/205/Download, we start to play the cancel animation when the
navigation commits, at which the animator is still a
RenderWidgetHostObserver, meaning we could be getting the
OnRenderFrameMetadataChangedAfterActivation() notification during the
cancel animation.

And this bug also caused another crash in the dtor
(crbug.com/377279187)

Bug: 377279187, 377340540
Change-Id: I59d28ef5fb21b998fdf497837d54ccb7ffbbf460
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5990993
Commit-Queue: William Liu <liuwilliam@chromium.org>
Reviewed-by: Khushal Sagar <khushalsagar@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1378345}
2024-11-05 15:57:44 +00:00
Baran Erfani
fe9cee97cf [DNT] Aborting the animation when the renderer crashes
Added a new function override from `WebContentsObserver` called `PrimaryMainFrameRenderProcessGone` which gets notified if the primary main frame renderer is destroyed. In that case, the animation manager destroys the animator when the function is called. Also, added a new enum value to keep track of this animation abort reason in the UMA metrics.

Bug: 328601834
Change-Id: I009ba9d4cea1ec17a69a0fe81a1879ce4bf4d050
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5979352
Reviewed-by: William Liu <liuwilliam@chromium.org>
Reviewed-by: Khushal Sagar <khushalsagar@chromium.org>
Reviewed-by: Robert Kaplow <rkaplow@chromium.org>
Commit-Queue: Baran Erfani <baranerf@google.com>
Cr-Commit-Position: refs/heads/main@{#1377752}
2024-11-04 18:20:39 +00:00
William Liu
1e48cdeaf3 [DNT] Clean up staled TODOs
Change-Id: I5630e2ad26efe0656118662d3e4cedffe1bc7687
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5984830
Reviewed-by: Khushal Sagar <khushalsagar@chromium.org>
Commit-Queue: William Liu <liuwilliam@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1377738}
2024-11-04 17:51:51 +00:00
William Liu
66e1c05388 [DNT] Unregister RenderWidgetHost observer in the dtor
Bug: 377279187
Change-Id: I80ca7d875d6a554050849f8ce318b596e3fb21a0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5988970
Commit-Queue: William Liu <liuwilliam@chromium.org>
Reviewed-by: Khushal Sagar <khushalsagar@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1377736}
2024-11-04 17:50:32 +00:00
William Liu
c9173756c2 [DNT] Record kFinished state
Without tracking kFinished, we don't know the portion of transitions
that are aborted.

Cq-Include-Trybots: luci.chromium.try:android-12-x64-rel,android-12l-x64-dbg,android-13-x64-rel,android-14-x64-rel,android-15-x64-rel,android-pie-x86-rel,android-oreo-x86-rel

Fixed: 376091532
Change-Id: I8ff06e1fce073153c41fc5fcdba5a2040978e299
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5984810
Reviewed-by: Baran Erfani <baranerf@google.com>
Reviewed-by: Luc Nguyen <lucnguyen@google.com>
Commit-Queue: William Liu <liuwilliam@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1377696}
2024-11-04 16:44:39 +00:00
William Liu
4db01f1504 [DNT] Do not show the loading bar until commit pending for native pages
Cq-Include-Trybots: luci.chromium.try:android-12-x64-rel,android-12l-x64-dbg,android-13-x64-rel,android-14-x64-rel,android-15-x64-rel,android-pie-x86-rel,android-oreo-x86-rel

Fixed: 371534496
Change-Id: I0c4efe22fcea73cd28920ff7adc5497f3aa67e20
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5967136
Reviewed-by: Dave Tapuska <dtapuska@chromium.org>
Reviewed-by: Theresa Sullivan <twellington@chromium.org>
Reviewed-by: Lijin Shen <lazzzis@google.com>
Reviewed-by: Khushal Sagar <khushalsagar@chromium.org>
Commit-Queue: William Liu <liuwilliam@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1375842}
2024-10-30 14:39:31 +00:00
Baran Erfani
45375d4fdd [DNT] Modified the scrim value to 65% for light/dark modes
Before this change the values were 0.2 -> 0 for dark mode and 0.1 -> 0 for light mode. With this change the scrim will be 0.65 -> 0 for both modes.

Bug: 373956590
Change-Id: Ic55082eba4ca8c04219d28bc5d97ff88ae503a32
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5970420
Commit-Queue: Khushal Sagar <khushalsagar@chromium.org>
Reviewed-by: William Liu <liuwilliam@chromium.org>
Reviewed-by: Khushal Sagar <khushalsagar@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1375819}
2024-10-30 13:55:19 +00:00
Baran Erfani
3a6bc5ab9a [DNT] Continuing animation when a second navigation commits mid gesture
With this change when navigating from B to A, if a new navigation
commits (C), the live page B will be replaced by C and the animation
continues navigating from C to A as expected. This way we are navigating
to A which is consistent with the screenshot that the user is seeing and
we're also handling the navigation to C by replacing the live page with
it.

Bug: 366023026
Change-Id: I3f60396b84630c16e6a467aa6ba6ec917053536c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5935055
Commit-Queue: Baran Erfani <baranerf@google.com>
Reviewed-by: William Liu <liuwilliam@chromium.org>
Reviewed-by: Caitlin Fischer <caitlinfischer@google.com>
Cr-Commit-Position: refs/heads/main@{#1374628}
2024-10-28 15:22:56 +00:00
William Liu
838f82d877 [DNT] Do not abort for same-doc / same-origin redirect
Cq-Include-Trybots: luci.chromium.try:android-12-x64-rel,android-12l-x64-dbg,android-13-x64-rel,android-14-x64-rel,android-15-x64-rel,android-pie-x86-rel,android-oreo-x86-rel

Fixed: 360888470
Change-Id: I43228ac6e81ba4226a9be6d5fac67d425bf68808
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5958007
Reviewed-by: Khushal Sagar <khushalsagar@chromium.org>
Commit-Queue: William Liu <liuwilliam@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1373886}
2024-10-25 14:16:24 +00:00
William Liu
5487c8ffb9 [DNT] Early return for dead renderer
Bug: 373005192
Change-Id: Id196468973007c4979f93191f9eca531a0f9945c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5962298
Commit-Queue: William Liu <liuwilliam@chromium.org>
Reviewed-by: Khushal Sagar <khushalsagar@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1373616}
2024-10-24 22:21:40 +00:00
William Liu
7b0751a750 [DNT] Only play cancel animation when the BeforeUnload dialog is shown
Before this CL, we run the cancel animation if the navigation is
waiting for the BeforeUnload message. This is very conservative as a
page can register a BeforeUnload listener but doesn't perform anything.

This CL changes the behavior, in that we only play the cancel animation
to bring the active page back if a BeforeUnload dialog is shown.

Cq-Include-Trybots: luci.chromium.try:android-12-x64-rel,android-12l-x64-dbg,android-13-x64-rel,android-14-x64-rel,android-15-x64-rel,android-pie-x86-rel,android-oreo-x86-rel

Fixed: 364694410
Change-Id: Idbe86b5ae5879965fd0559a60ebb47e5b82d3de7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5919513
Reviewed-by: Khushal Sagar <khushalsagar@chromium.org>
Commit-Queue: William Liu <liuwilliam@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1372747}
2024-10-23 16:08:52 +00:00
William Liu
3aef1d167c [DNT] Fix NavigationController raw_ptr during WebContents destruction
GetNavigationEntryScreenshotCache() asserts the frame tree is primary.
However during WebContents destruction, the frame tree is reset before
the animator, so the navigation controller (owned by the FrameTree) back
pointer is a UAF.

This CL adds a shortcut to destroy the animator as the "first" thing
during the WebContents's destruction. Then the animator can still
perform the clean up tasks while the navigation controller is still
valid.

Bug: 373898450
Change-Id: I0d793d536ca99700cf7f8c324f562131f2a480c4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5948024
Commit-Queue: William Liu <liuwilliam@chromium.org>
Reviewed-by: Dave Tapuska <dtapuska@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1372744}
2024-10-23 16:05:44 +00:00
William Liu
040941e6e9 [DNT] Resume dialogs in dtor
Fixed: 374077411
Change-Id: Ib0756e5cb7a00e90383b2ef58e6e42d9a1f87a4e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5937425
Commit-Queue: William Liu <liuwilliam@chromium.org>
Reviewed-by: Khushal Sagar <khushalsagar@chromium.org>
Commit-Queue: Khushal Sagar <khushalsagar@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1370013}
2024-10-17 14:58:26 +00:00
William Liu
255d6a9652 [DNS] Allow float rounding error during comparison
Fixed: 372446139
Bug: 371459551
Change-Id: I540cb3f8786d8a5f6dd66cbac4d2ddf055aa34b6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5920757
Commit-Queue: William Liu <liuwilliam@chromium.org>
Reviewed-by: Khushal Sagar <khushalsagar@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1366866}
2024-10-10 15:48:13 +00:00
Baran Erfani
bfff7795a4 Removed CHECKs in OnRenderWidgetHostDestroyed
Removed state_ and navigation_state_ CHECKs in OnRenderWidgetHostDestroyed since render widget host could be destroyed in other states as well.

Fixed: 370499354
Change-Id: Id89d5fa41a3885e538475247153e74e200711fe4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5916669
Commit-Queue: Baran Erfani <baranerf@google.com>
Reviewed-by: William Liu <liuwilliam@chromium.org>
Reviewed-by: Khushal Sagar <khushalsagar@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1365805}
2024-10-08 21:02:26 +00:00
William Liu
5ee2ed3b76 [DNT] Resume dialog for subframe navs
Fixed: 371972740
Bug: 362301376, 40896070, 370117608
Change-Id: I5dcfa5f57dd4c6b5bddafad4f67bc366fe5f7f74
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5913592
Commit-Queue: William Liu <liuwilliam@chromium.org>
Reviewed-by: Khushal Sagar <khushalsagar@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1365006}
2024-10-07 17:04:25 +00:00
William Liu
9102207b9c [DNT] Abort the animation on size change
Run this test without the new size change hook:
```
[19806:19806:1003/165908.896123:FATAL:back_forward_transition_animator.cc(1730)] Check failed: values.progress <= 1.f (275.4 vs. 1)
```
which looks very similar to the crash in crbug/326850774

Bug: 326850774, 371459551
Change-Id: I28069954e82703f7411138ed9099f25dac52be13
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5905983
Reviewed-by: Dave Tapuska <dtapuska@chromium.org>
Reviewed-by: Luc Nguyen <lucnguyen@google.com>
Commit-Queue: William Liu <liuwilliam@chromium.org>
Reviewed-by: Khushal Sagar <khushalsagar@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1364671}
2024-10-06 03:51:01 +00:00
William Liu
1e51638e76 [DNT] Add two crashkeys on new old_surface_clone edge case
Unclear how this can happen. Need to log the navigation_state_ and
state_. Also add one possible fix: that if a navigation is cancelled
after we have cloned the old surface, reset the clone.

Bug: 371043197
Change-Id: I6fd834459bc86ed13aa0358be177b6906b27d8aa
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5906319
Commit-Queue: William Liu <liuwilliam@chromium.org>
Reviewed-by: Khushal Sagar <khushalsagar@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1363630}
2024-10-03 14:50:08 +00:00
William Liu
c5e4191827 [DNT] Fix a nullptr in teardown
Tested: on android_31_google_apis_x64.textpb and
android_30_google_apis_x86.textpb, tests are skipped properly. Also
android-13-x64-rel and android-14-x64-rel.

Fixed: 369367803
Change-Id: I5aefceb4ac8ca5d31a673d9f967d3972f67f25a6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5905558
Reviewed-by: Robert Flack <flackr@chromium.org>
Commit-Queue: William Liu <liuwilliam@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1363050}
2024-10-02 15:09:34 +00:00
Baran Erfani
94202f7818 Added null check for the delegate in OnAnimationstageChanged
Fixed: 370494381
Change-Id: I90d4928b4dfb9bdd08e5d80b9edbbeddabc047d7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5901710
Reviewed-by: Khushal Sagar <khushalsagar@chromium.org>
Commit-Queue: Baran Erfani <baranerf@google.com>
Reviewed-by: William Liu <liuwilliam@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1363017}
2024-10-02 14:05:08 +00:00
William Liu
196e5aaee0 Reland "[DNT] Defer the dialogs"
This is a reland of commit 9d7ad8f58d

Failure reason: the tests are not triggering transitions in gesture
navigation mode. See https://crsrc.org/c/chrome/android/java/src/org/chromium/chrome/browser/gesturenav/GestureNavigationUtils.java;drc=f522344e45882da4c7f7cb1b3a0a7bd747d654bb;l=35

The test failed with version R but gesture mode back swipe handling API
are only introduce in U and U+:
https://ci.chromium.org/ui/p/chrome/builders/ci/android-arm-tests/27625/overview.

The fix is diff of PS1 and onward.

Original change's description:
> [DNT] Defer the dialogs
>
> When a transition starts, we suspend the tab-level dialogs. These
> dialogs include alert, permissions, and do not include BeforeUnload.
>
> When an animated navigation commits, we immediately resume the dialogs
> before the the invoke animation finishes playing. If the navigation is
> cancelled or the navigation never starts, we also resume.
>
> Fixed: 362301376, 40896070
> Change-Id: Id9ab1f8a088586c66936d21c029d2d9c8971982e
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5823843
> Commit-Queue: William Liu <liuwilliam@chromium.org>
> Reviewed-by: Theresa Sullivan <twellington@chromium.org>
> Reviewed-by: Khushal Sagar <khushalsagar@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#1358810}

Change-Id: If47743ca49d7163e6edac0d0a9c1544fdaccf03e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5895768
Reviewed-by: Khushal Sagar <khushalsagar@chromium.org>
Reviewed-by: Theresa Sullivan <twellington@chromium.org>
Commit-Queue: William Liu <liuwilliam@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1362558}
2024-10-01 18:27:09 +00:00
William Liu
0ecbddc934 [DNT] Destroy the animator when the WebContents is destroyed
Java could call TabAndroid::DestroyWebContents() on a visible
WebContents with its NativeView, layer and compositor still attached.

Fixed: 370494381
Change-Id: Ic8b290106a03710bdaa3d42be679896c4f5b4bbe
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5900113
Commit-Queue: William Liu <liuwilliam@chromium.org>
Reviewed-by: Khushal Sagar <khushalsagar@chromium.org>
Reviewed-by: Mark Pearson <mpearson@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1362408}
2024-10-01 14:28:10 +00:00
Lijin Shen
8be95f91f2 [dnt] Fix flicker when cancel animation of NTP finishes
This CL fixes the flicker when cancel animation of NTP is finished and
does not fix that when cancel animation starts.

When cancel animation is finished, the animation state goes from
AnimationStage.OTHER to NONE. At that moment, live texture is
disallowed, see [1], and we just starts to show the NTP.

It takes Android some time to fully show the NTP and as a result,
there is a gap between when cancel animation finishes and when NTP is
fully shown.

Similar to how to handle the case in which NTP is shown when user
navigates from web page to NTP, this CL adds onContentForNavigationEntryShown state and makes the cc side wait until onContentForNavigationEntryShown is invoked, i.e. the NTP is fully
shown.

screenrecord: https://screencast.googleplex.com/cast/NTA2OTYzOTg4ODQwNDQ4MHw4MWZlMTJmNS04Yw

[1] https://source.chromium.org/chromium/chromium/src/+/main:chrome/android/java/src/org/chromium/chrome/browser/compositor/layouts/StaticLayout.java;l=522;drc=451093bbaf7fe812bf67d27d760f3bb64c92830b

Bug: 361820479
Change-Id: Id16a8c74228e531073d3806cbb4bb7f6f4110d32
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5870632
Reviewed-by: William Liu <liuwilliam@chromium.org>
Reviewed-by: Rakina Zata Amni <rakina@chromium.org>
Reviewed-by: Theresa Sullivan <twellington@chromium.org>
Commit-Queue: Lijin Shen <lazzzis@google.com>
Reviewed-by: Khushal Sagar <khushalsagar@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1360291}
2024-09-26 00:42:54 +00:00
Sinan Sahin
98f322e380 Revert "[DNT] Defer the dialogs"
This reverts commit 9d7ad8f58d.

Reason for revert: Newly added tests are failing, see b/369367803

Original change's description:
> [DNT] Defer the dialogs
>
> When a transition starts, we suspend the tab-level dialogs. These
> dialogs include alert, permissions, and do not include BeforeUnload.
>
> When an animated navigation commits, we immediately resume the dialogs
> before the the invoke animation finishes playing. If the navigation is
> cancelled or the navigation never starts, we also resume.
>
> Fixed: 362301376, 40896070
> Change-Id: Id9ab1f8a088586c66936d21c029d2d9c8971982e
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5823843
> Commit-Queue: William Liu <liuwilliam@chromium.org>
> Reviewed-by: Theresa Sullivan <twellington@chromium.org>
> Reviewed-by: Khushal Sagar <khushalsagar@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#1358810}

Change-Id: Ic5803abdc6ebe323755e44a5502a44d10079fe81
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5887756
Commit-Queue: Sinan Sahin <sinansahin@google.com>
Owners-Override: Sinan Sahin <sinansahin@google.com>
Reviewed-by: William Liu <liuwilliam@chromium.org>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Cr-Commit-Position: refs/heads/main@{#1359433}
2024-09-24 17:05:54 +00:00
William Liu
9d7ad8f58d [DNT] Defer the dialogs
When a transition starts, we suspend the tab-level dialogs. These
dialogs include alert, permissions, and do not include BeforeUnload.

When an animated navigation commits, we immediately resume the dialogs
before the the invoke animation finishes playing. If the navigation is
cancelled or the navigation never starts, we also resume.

Fixed: 362301376, 40896070
Change-Id: Id9ab1f8a088586c66936d21c029d2d9c8971982e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5823843
Commit-Queue: William Liu <liuwilliam@chromium.org>
Reviewed-by: Theresa Sullivan <twellington@chromium.org>
Reviewed-by: Khushal Sagar <khushalsagar@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1358810}
2024-09-23 15:05:23 +00:00
Baran Erfani
574f7c7d6e Added tracing to major DNT functions
This will help with debugging DNT.

Bug: 364683785
Change-Id: If0f003c6626a492ebd632078c6d1becaae553fd4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5844573
Reviewed-by: William Liu <liuwilliam@chromium.org>
Reviewed-by: Vladimir Levin <vmpstr@chromium.org>
Commit-Queue: Baran Erfani <baranerf@google.com>
Reviewed-by: Etienne Pierre-Doray <etiennep@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1357303}
2024-09-18 20:38:05 +00:00
William Liu
6f13c2ba06 [DNT] Reorder tests
Put all the BackForwardTransitionAnimationManagerBrowserTest together.

Bug: 331710055
Change-Id: I968ec7b564345b0a00559a6b10c9fd4235db11a2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5846069
Reviewed-by: Vladimir Levin <vmpstr@chromium.org>
Commit-Queue: William Liu <liuwilliam@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1352915}
2024-09-09 19:32:36 +00:00
Baran Erfani
09614c197b Added a metric to record animation abort reasons
This metric is recorded in an enum histogram once per gesture.
The enum values correspond to reason/state of the current navigation and
any other existing navigation in the background.

Bug: 349815498
Change-Id: I7f06609dd574492b997a1f572a844c3f6b7f91d1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5833108
Reviewed-by: Alexei Svitkine <asvitkine@chromium.org>
Reviewed-by: Vladimir Levin <vmpstr@chromium.org>
Commit-Queue: Baran Erfani <baranerf@google.com>
Cr-Commit-Position: refs/heads/main@{#1352095}
2024-09-06 16:36:39 +00:00
Avi Drissman
f72e86b427 Use an opaque type for FrameTreeNode IDs, part 12
content_browser_client

Bug: 361344235
Change-Id: Ib65d872e91d3ee8db24f2ba0f1768d348540e44e
Include-Ci-Only-Tests: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5836564
Auto-Submit: Avi Drissman <avi@chromium.org>
Commit-Queue: Charlie Reis <creis@chromium.org>
Code-Coverage: findit-for-me@appspot.gserviceaccount.com <findit-for-me@appspot.gserviceaccount.com>
Reviewed-by: Charlie Reis <creis@chromium.org>
Owners-Override: Charlie Reis <creis@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1351740}
2024-09-05 22:10:28 +00:00
Baran Erfani
ffb8f4c35d Added IgnoreInputCount UMA metric - Implementation
This metric counts the number of times that an input with type
WebInputEvent::Type::kTouchStart is ignored while the animator is
processing/animating (in animation invoked and canceled cases).

Implementation logic diagram: https://drive.google.com/file/d/1Wsyqv0hg64wJBPJgoUlesrmEGSCygyFL/view?usp=sharing

Note: This CL includes the implementation of `MaybeRecordIgnoredInput` in addition to histogram definition.

Bug: 331778097
Change-Id: I70118978006f24f4b02c39adbb53a5dc6b032dee
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5807671
Commit-Queue: Baran Erfani <baranerf@google.com>
Reviewed-by: Khushal Sagar <khushalsagar@chromium.org>
Reviewed-by: Luc Nguyen <lucnguyen@google.com>
Reviewed-by: Vladimir Levin <vmpstr@chromium.org>
Reviewed-by: William Liu <liuwilliam@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1350294}
2024-09-03 18:20:53 +00:00