diff --git a/content/browser/accessibility/dump_accessibility_tree_browsertest.cc b/content/browser/accessibility/dump_accessibility_tree_browsertest.cc index 808fc205..d0e207d 100644 --- a/content/browser/accessibility/dump_accessibility_tree_browsertest.cc +++ b/content/browser/accessibility/dump_accessibility_tree_browsertest.cc
@@ -949,7 +949,7 @@ RunHtmlTest(FILE_PATH_LITERAL("bounds-clips.html")); } -IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest, AccessibilityBR) { +IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest, DISABLED_AccessibilityBR) { RunHtmlTest(FILE_PATH_LITERAL("br.html")); }
diff --git a/content/test/data/accessibility/html/bounds-clips-expected-blink.txt b/content/test/data/accessibility/html/bounds-clips-expected-blink.txt index d623d6d..781c1680 100644 --- a/content/test/data/accessibility/html/bounds-clips-expected-blink.txt +++ b/content/test/data/accessibility/html/bounds-clips-expected-blink.txt
@@ -9,11 +9,11 @@ ++++staticText name='Also visible' ++++++inlineTextBox name='Also ' ++++++inlineTextBox name='visible' -++genericContainer +++genericContainer offscreen ++++staticText offscreen name='Hidden' ++++++inlineTextBox offscreen name='Hidden' ++genericContainer size=(10, 10) -++++genericContainer +++++genericContainer offscreen ++++++staticText offscreen name='Also hidden' ++++++++inlineTextBox offscreen name='Also ' ++++++++inlineTextBox offscreen name='hidden'
diff --git a/content/test/data/accessibility/html/bounds-inherits-expected-blink.txt b/content/test/data/accessibility/html/bounds-inherits-expected-blink.txt index 66c17c9..b4db5c9ec 100644 --- a/content/test/data/accessibility/html/bounds-inherits-expected-blink.txt +++ b/content/test/data/accessibility/html/bounds-inherits-expected-blink.txt
@@ -1,5 +1,5 @@ rootWebArea ++genericContainer size=(200, 200) -++++genericContainer size=(0, 0) +++++genericContainer offscreen size=(0, 0) ++++++genericContainer offscreen size=(0, 0) -<-- End-of-file --> +<-- End-of-file --> \ No newline at end of file
diff --git a/content/test/data/accessibility/html/br-expected-android.txt b/content/test/data/accessibility/html/br-expected-android.txt index 4e79cb7..94d8bbdb 100644 --- a/content/test/data/accessibility/html/br-expected-android.txt +++ b/content/test/data/accessibility/html/br-expected-android.txt
@@ -1,6 +1,5 @@ android.webkit.WebView focusable focused scrollable -++android.view.View name='<newline>' -++android.view.View name='Text line 1' -++android.view.View name='Text line 2<newline>Text line 3' -++android.view.View name='<newline>' -<-- End-of-file --> +++android.view.View +++++android.view.View clickable name='Text line 1 ' +++++android.view.View +++++android.view.View clickable name='Text line 2'
diff --git a/content/test/data/accessibility/html/br-expected-blink.txt b/content/test/data/accessibility/html/br-expected-blink.txt deleted file mode 100644 index 95a111ab..0000000 --- a/content/test/data/accessibility/html/br-expected-blink.txt +++ /dev/null
@@ -1,15 +0,0 @@ -rootWebArea -++lineBreak size=(0, 0) name='<newline>' -++++inlineTextBox name='<newline>' -++staticText name='Text line 1' -++++inlineTextBox name='Text line 1' -++paragraph -++++staticText name='Text line 2' -++++++inlineTextBox name='Text line 2' -++++lineBreak size=(0, 0) name='<newline>' -++++++inlineTextBox offscreen size=(0, 0) name='<newline>' -++++staticText name='Text line 3' -++++++inlineTextBox name='Text line 3' -++lineBreak size=(0, 0) name='<newline>' -++++inlineTextBox name='<newline>' -<-- End-of-file --> \ No newline at end of file
diff --git a/content/test/data/accessibility/html/br-expected-win.txt b/content/test/data/accessibility/html/br-expected-win.txt index 52ede30..fe66a22 100644 --- a/content/test/data/accessibility/html/br-expected-win.txt +++ b/content/test/data/accessibility/html/br-expected-win.txt
@@ -1,9 +1,5 @@ ROLE_SYSTEM_DOCUMENT READONLY FOCUSABLE -++ROLE_SYSTEM_WHITESPACE name='<newline>' -++ROLE_SYSTEM_STATICTEXT name='Text line 1' -++IA2_ROLE_PARAGRAPH +++IA2_ROLE_SECTION +++++ROLE_SYSTEM_STATICTEXT name='Text line 1 ' +++++ROLE_SYSTEM_WHITESPACE ++++ROLE_SYSTEM_STATICTEXT name='Text line 2' -++++ROLE_SYSTEM_WHITESPACE name='<newline>' -++++ROLE_SYSTEM_STATICTEXT name='Text line 3' -++ROLE_SYSTEM_WHITESPACE name='<newline>' -<-- End-of-file -->
diff --git a/content/test/data/accessibility/html/br.html b/content/test/data/accessibility/html/br.html index 2117757a..4311bc57e 100644 --- a/content/test/data/accessibility/html/br.html +++ b/content/test/data/accessibility/html/br.html
@@ -1,14 +1,7 @@ -<!-- -@BLINK-ALLOW:offscreen -@BLINK-ALLOW:size=(0, 0) -@WIN-ALLOW:OFFSCREEN -@WIN-ALLOW:size=(0, 0) ---> <html> <body> -<br> Text line 1 -<p>Text line 2<br>Text line 3</p> <br> +Text line 2 </body> </html>
diff --git a/ios/chrome/browser/ui/tools_menu/BUILD.gn b/ios/chrome/browser/ui/tools_menu/BUILD.gn index 53ced73..3f049a88c 100644 --- a/ios/chrome/browser/ui/tools_menu/BUILD.gn +++ b/ios/chrome/browser/ui/tools_menu/BUILD.gn
@@ -10,7 +10,6 @@ "reading_list_menu_view_item.h", "reading_list_menu_view_item.mm", "tools_menu_constants.h", - "tools_menu_constants.mm", "tools_menu_model.h", "tools_menu_model.mm", "tools_menu_view_controller.h", @@ -37,6 +36,7 @@ "//ios/chrome/browser/ui/reading_list", "//ios/chrome/browser/ui/reading_list:reading_list_ui", "//ios/chrome/browser/ui/toolbar:resource_macros", + "//ios/chrome/browser/ui/tools_menu/public", "//ios/chrome/common", "//ios/public/provider/chrome/browser", "//ios/public/provider/chrome/browser/user_feedback",
diff --git a/ios/chrome/browser/ui/tools_menu/tools_menu_constants.mm b/ios/chrome/browser/ui/tools_menu/tools_menu_constants.mm deleted file mode 100644 index b1056627..0000000 --- a/ios/chrome/browser/ui/tools_menu/tools_menu_constants.mm +++ /dev/null
@@ -1,25 +0,0 @@ -// Copyright 2017 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. - -#include "ios/chrome/browser/ui/tools_menu/tools_menu_constants.h" - -#if !defined(__has_feature) || !__has_feature(objc_arc) -#error "This file requires ARC support." -#endif - -NSString* const kToolsMenuNewTabId = @"kToolsMenuNewTabId"; -NSString* const kToolsMenuNewIncognitoTabId = @"kToolsMenuNewIncognitoTabId"; -NSString* const kToolsMenuCloseAllTabsId = @"kToolsMenuCloseAllTabsId"; -NSString* const kToolsMenuCloseAllIncognitoTabsId = - @"kToolsMenuCloseAllIncognitoTabsId"; -NSString* const kToolsMenuBookmarksId = @"kToolsMenuBookmarksId"; -NSString* const kToolsMenuReadingListId = @"kToolsMenuReadingListId"; -NSString* const kToolsMenuOtherDevicesId = @"kToolsMenuOtherDevicesId"; -NSString* const kToolsMenuHistoryId = @"kToolsMenuHistoryId"; -NSString* const kToolsMenuReportAnIssueId = @"kToolsMenuReportAnIssueId"; -NSString* const kToolsMenuFindInPageId = @"kToolsMenuFindInPageId"; -NSString* const kToolsMenuRequestDesktopId = @"kToolsMenuRequestDesktopId"; -NSString* const kToolsMenuSettingsId = @"kToolsMenuSettingsId"; -NSString* const kToolsMenuHelpId = @"kToolsMenuHelpId"; -NSString* const kToolsMenuRequestMobileId = @"kToolsMenuRequestMobileId";
diff --git a/ui/accessibility/ax_tree.cc b/ui/accessibility/ax_tree.cc index 66739ee..bbae6d0 100644 --- a/ui/accessibility/ax_tree.cc +++ b/ui/accessibility/ax_tree.cc
@@ -176,11 +176,19 @@ // If the node bounds is empty (either width or height is zero), // try to compute good bounds from the children. if (bounds.IsEmpty()) { + bool all_children_offscreen = true; for (size_t i = 0; i < node->children().size(); i++) { ui::AXNode* child = node->children()[i]; - bounds.Union(GetTreeBounds(child)); + bool temp_offscreen = false; + bounds.Union(GetTreeBounds(child, &temp_offscreen)); + if (!temp_offscreen) + // At least one child is on screen. + all_children_offscreen = false; } if (bounds.width() > 0 && bounds.height() > 0) { + // If all the children are offscreen, the node itself is offscreen. + if (offscreen != nullptr && all_children_offscreen) + *offscreen |= true; return bounds; } } @@ -218,7 +226,7 @@ if (bounds.width() == 0 && bounds.height() == 0) { bounds.set_size(container_bounds.size()); if (offscreen != nullptr) - *offscreen |= true; + *offscreen = true; } int scroll_x = 0; @@ -230,6 +238,17 @@ gfx::RectF clipped = bounds; clipped.Intersect(container_bounds); + if (container->data().role != ui::AX_ROLE_DESKTOP && clipped.IsEmpty()) { + // If it is offscreen with respect to its parent, label it offscreen. + // Here we are extending the definition of offscreen to include elements + // that are clipped by their parents in addition to those clipped by + // the rootWebArea. + // No need to update |offscreen| if |clipped| is not empty, because it + // should be false by default. + if (offscreen != nullptr) + *offscreen |= true; + } + // If this is the root web area, make sure we clip the node to fit. // This is disabled as a bugfix for Chrome 63, see crbug.com/786164 if (false) { @@ -256,19 +275,6 @@ } } - if (container->data().role != ui::AX_ROLE_DESKTOP && clipped.IsEmpty() && - !bounds.IsEmpty()) { - // If it is offscreen with respect to its parent, and the node itself is - // not empty, label it offscreen. - // Here we are extending the definition of offscreen to include elements - // that are clipped by their parents in addition to those clipped by - // the rootWebArea. - // No need to update |offscreen| if |clipped| is not empty, because it - // should be false by default. - if (offscreen != nullptr) - *offscreen |= true; - } - node = container; }
diff --git a/ui/accessibility/ax_tree_unittest.cc b/ui/accessibility/ax_tree_unittest.cc index 789f674..ff09688 100644 --- a/ui/accessibility/ax_tree_unittest.cc +++ b/ui/accessibility/ax_tree_unittest.cc
@@ -836,7 +836,7 @@ // If a node doesn't specify its location but at least one child does have // a location, it will be offscreen if all of its children are offscreen. -TEST(AXTreeTest, EmptyNodeNotOffscreenEvenIfAllChildrenOffscreen) { +TEST(AXTreeTest, EmptyNodeOffscreenWhenAllChildrenOffscreen) { AXTreeUpdate tree_update; tree_update.root_id = 1; tree_update.nodes.resize(4); @@ -855,9 +855,7 @@ tree_update.nodes[3].location = gfx::RectF(1000, 30, 400, 20); AXTree tree(tree_update); - EXPECT_FALSE(IsNodeOffscreen(tree, 2)); - EXPECT_TRUE(IsNodeOffscreen(tree, 3)); - EXPECT_TRUE(IsNodeOffscreen(tree, 4)); + EXPECT_TRUE(IsNodeOffscreen(tree, 2)); } // Test that getting the bounds of a node works when there's a transform.