Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(244)

Unified Diff: third_party/WebKit/Source/core/page/FocusControllerTest.cpp

Issue 2967493002: Relanding [Android] Adding Smart GO/NEXT feature in Chrome (Closed)
Patch Set: Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/page/FocusControllerTest.cpp
diff --git a/third_party/WebKit/Source/core/page/FocusControllerTest.cpp b/third_party/WebKit/Source/core/page/FocusControllerTest.cpp
index 1f648b937c78d2f305df048dfa5559ed44f6c446..767d70cb086779edbfbcd7a964639527229b6f64 100644
--- a/third_party/WebKit/Source/core/page/FocusControllerTest.cpp
+++ b/third_party/WebKit/Source/core/page/FocusControllerTest.cpp
@@ -94,4 +94,30 @@ TEST_F(FocusControllerTest, SetActiveOnInactiveDocument) {
PageHolder()->GetPage().GetFocusController().SetActive(true);
}
+// This test is for crbug.com/733218
+TEST_F(FocusControllerTest, SVGFocusableElementInForm) {
+ GetDocument().body()->setInnerHTML(
+ "<form>"
+ "<input id='first'>"
+ "<svg width='100px' height='100px' tabindex='0'>"
+ "<circle cx='50' cy='50' r='30' />"
+ "</svg>"
+ "<input id='last'>"
+ "</form>");
+
+ Element* form = ToElement(GetDocument().body()->firstChild());
+ Element* first = ToElement(form->firstChild());
+ Element* last = ToElement(form->lastChild());
+
+ Element* next = GetFocusController().NextFocusableElementInForm(
+ first, kWebFocusTypeForward);
+ EXPECT_EQ(next, last)
+ << "SVG Element should be skipped even when focusable in form.";
+
+ Element* prev = GetFocusController().NextFocusableElementInForm(
+ next, kWebFocusTypeBackward);
+ EXPECT_EQ(prev, first)
+ << "SVG Element should be skipped even when focusable in form.";
+}
+
} // namespace blink
« no previous file with comments | « third_party/WebKit/Source/core/page/FocusController.cpp ('k') | third_party/WebKit/Source/web/WebLocalFrameImpl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698