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

Unified Diff: Source/web/WebViewImpl.cpp

Issue 1303123002: Revert of Adding support for Smart GO NEXT feature in Android Chrome (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Remove DocumentMarkerController.h include Created 5 years, 4 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
« no previous file with comments | « Source/web/WebViewImpl.h ('k') | Source/web/tests/WebViewTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/web/WebViewImpl.cpp
diff --git a/Source/web/WebViewImpl.cpp b/Source/web/WebViewImpl.cpp
index c5bfd48b4c7655020c518237540f45ddf6c3139e..db8f9bff299ca730b6eb3b6ad6a1ad1299a71eb0 100644
--- a/Source/web/WebViewImpl.cpp
+++ b/Source/web/WebViewImpl.cpp
@@ -36,7 +36,6 @@
#include "core/InputTypeNames.h"
#include "core/clipboard/DataObject.h"
#include "core/dom/Document.h"
-#include "core/dom/ElementTraversal.h"
#include "core/dom/Fullscreen.h"
#include "core/dom/LayoutTreeBuilderTraversal.h"
#include "core/dom/Text.h"
@@ -62,7 +61,6 @@
#include "core/frame/SmartClip.h"
#include "core/frame/TopControls.h"
#include "core/frame/VisualViewport.h"
-#include "core/html/HTMLFormElement.h"
#include "core/html/HTMLInputElement.h"
#include "core/html/HTMLMediaElement.h"
#include "core/html/HTMLPlugInElement.h"
@@ -2493,78 +2491,9 @@ int WebViewImpl::textInputFlags()
}
}
- if (isListeningToKeyboardEvents(element))
- flags |= WebTextInputFlagListeningToKeyboardEvents;
-
- if (nextFocusableElementInForm(element, WebFocusTypeForward))
- flags |= WebTextInputFlagHaveNextFocusableElement;
-
- if (nextFocusableElementInForm(element, WebFocusTypeBackward))
- flags |= WebTextInputFlagHavePreviousFocusableElement;
-
return flags;
}
-Element* WebViewImpl::nextFocusableElementInForm(Element* element, WebFocusType focusType)
-{
- if (!element->isFormControlElement() && !element->isContentEditable())
- return nullptr;
-
- HTMLFormElement* formOwner = nullptr;
- if (element->isContentEditable())
- formOwner = Traversal<HTMLFormElement>::firstAncestor(*element);
- else
- formOwner = toHTMLFormControlElement(element)->formOwner();
-
- if (!formOwner)
- return nullptr;
-
- Element* nextElement = element;
- for (nextElement = page()->focusController().findFocusableElement(focusType, *nextElement); nextElement; nextElement = page()->focusController().findFocusableElement(focusType, *nextElement)) {
- if (nextElement->isContentEditable() && nextElement->isDescendantOf(formOwner))
- return nextElement;
- if (!nextElement->isFormControlElement())
- continue;
- HTMLFormControlElement* formElement = toHTMLFormControlElement(nextElement);
- if (formElement->formOwner() != formOwner)
- continue;
- // Skip disabled or readonly editable elements.
- if (formElement->isDisabledOrReadOnly())
- continue;
- LayoutObject* layout = nextElement->layoutObject();
- if (layout && layout->isTextControl()) {
- // TODO(ajith.v) Extend it for Select element, Radio button and Check boxes
- return nextElement;
- }
- }
- return nullptr;
-}
-
-bool WebViewImpl::isListeningToKeyboardEvents(Element* element)
-{
- if (!element->isFormControlElement() && !element->isContentEditable())
- return false;
- for (Node* node = element; node; node = node->parentNode()) {
- if (node->hasEventListeners(EventTypeNames::keydown) || node->hasEventListeners(EventTypeNames::keypress) || node->hasEventListeners(EventTypeNames::keyup))
- return true;
- }
- return false;
-}
-
-void WebViewImpl::advanceFocusInForm(WebFocusType focusType)
-{
- Element* element = focusedElement();
- if (!element)
- return;
-
- RefPtrWillBeRawPtr<Element> nextElement = nextFocusableElementInForm(element, focusType);
- if (!nextElement)
- return;
-
- nextElement->scrollIntoViewIfNeeded(true /*centerIfNeeded*/);
- nextElement->focus(false, focusType);
-}
-
WebString WebViewImpl::inputModeOfFocusedElement()
{
if (!RuntimeEnabledFeatures::inputModeAttributeEnabled())
« no previous file with comments | « Source/web/WebViewImpl.h ('k') | Source/web/tests/WebViewTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698