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

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

Issue 2948593002: Relanding [Android] Adding Smart GO/NEXT feature in Chrome (Closed)
Patch Set: Rebased the patch 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 bb96315b9125c70eee6e9a3b693d52104ad8a96b..3639f3619bd1002e40f03e3d24fd9b5e01feb9ed 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