-
Notifications
You must be signed in to change notification settings - Fork 6.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CrOS Settings: Fix direct navigation to About > Additional details page
Cherry-pick to M103. The bug was introduced in http://crrev.com/c/3579664 where the order of MainPageBehavior and RouteObserverBehavior were swapped, causing their respective attached() method call orders to flip. Restoring the original order of the behaviors calls the respective attached() methods in the correct order and initializes `this.scroller` before it is read. Given the new behavior precedence, super.currentRouteChanged() will undesirably call RouteObserverBehavior.currentRouteChanged(). Directly calling MainPageBehavior.currentRouteChanged() works around this and restores the original implementation. (cherry picked from commit a60f51e) Bug: chromium:1324103 Test: out/Default/browser_tests --gtest_filter='*OsSettingsUi2*' Test: (Manual) Page is reachable and operable via direct link Test: (Manual) Page is reachable and operable via search result Test: (Manual) Page is reachable and operable via menu navigation Change-Id: Ibb30663ca3fc0b08c14c5a51d666a3df102eadeb Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3645673 Reviewed-by: Xiaohui Chen <xiaohuic@chromium.org> Commit-Queue: Wes Okuhara <wesokuhara@google.com> Cr-Original-Commit-Position: refs/heads/main@{#1003412} Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3652482 Cr-Commit-Position: refs/branch-heads/5060@{#68} Cr-Branched-From: b83393d-refs/heads/main@{#1002911}
- Loading branch information
Wes Okuhara
authored and
Chromium LUCI CQ
committed
May 18, 2022
1 parent
df14c5c
commit ab0ba06
Showing
3 changed files
with
39 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// Copyright 2020 The Chromium Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
/** | ||
* Returns whether the element both exists and is visible. | ||
* @param {?Element} element | ||
* @return {boolean} | ||
*/ | ||
export function isVisible(element) { | ||
// offsetWidth and offsetHeight reflect more ways that an element could be | ||
// hidden, compared to checking the hidden attribute directly. | ||
return !!element && element.getBoundingClientRect().width > 0 && | ||
element.getBoundingClientRect().height > 0; | ||
} |