Diff
Modified: trunk/Source/WebKit/chromium/ChangeLog (117401 => 117402)
--- trunk/Source/WebKit/chromium/ChangeLog 2012-05-17 06:22:13 UTC (rev 117401)
+++ trunk/Source/WebKit/chromium/ChangeLog 2012-05-17 06:36:29 UTC (rev 117402)
@@ -1,3 +1,22 @@
+2012-05-16 Sheriff Bot <webkit.review....@gmail.com>
+
+ Unreviewed, rolling out r117396.
+ http://trac.webkit.org/changeset/117396
+ https://bugs.webkit.org/show_bug.cgi?id=86709
+
+ "breaks chromium tree" (Requested by morrita on #webkit).
+
+ * WebKit.gyp:
+ * public/WebTextInputInfo.h: Removed.
+ * public/WebTextInputType.h:
+ * public/WebWidget.h:
+ (WebKit::WebWidget::textInputType):
+ * src/WebTextInputInfo.cpp: Removed.
+ * src/WebViewImpl.cpp:
+ (WebKit::WebViewImpl::textInputType):
+ * src/WebViewImpl.h:
+ (WebViewImpl):
+
2012-05-16 Hao Zheng <zheng...@chromium.org>
[chromium] Get text direction at the start and end of selection.
Modified: trunk/Source/WebKit/chromium/WebKit.gyp (117401 => 117402)
--- trunk/Source/WebKit/chromium/WebKit.gyp 2012-05-17 06:22:13 UTC (rev 117401)
+++ trunk/Source/WebKit/chromium/WebKit.gyp 2012-05-17 06:36:29 UTC (rev 117402)
@@ -273,7 +273,6 @@
'public/WebTextCheckingResult.h',
'public/WebTextDirection.h',
'public/WebTextFieldDecoratorClient.h',
- 'public/WebTextInputInfo.h',
'public/WebTextInputType.h',
'public/WebTextRun.h',
'public/WebTimeRange.h',
@@ -661,7 +660,6 @@
'src/WebStorageQuotaCallbacksImpl.cpp',
'src/WebStorageQuotaCallbacksImpl.h',
'src/WebSurroundingText.cpp',
- 'src/WebTextInputInfo.cpp',
'src/WebTextRun.cpp',
'src/WebURLLoadTiming.cpp',
'src/WebScopedUserGesture.cpp',
Deleted: trunk/Source/WebKit/chromium/public/WebTextInputInfo.h (117401 => 117402)
--- trunk/Source/WebKit/chromium/public/WebTextInputInfo.h 2012-05-17 06:22:13 UTC (rev 117401)
+++ trunk/Source/WebKit/chromium/public/WebTextInputInfo.h 2012-05-17 06:36:29 UTC (rev 117402)
@@ -1,78 +0,0 @@
-/*
- * Copyright (C) 2011 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef WebTextInputInfo_h
-#define WebTextInputInfo_h
-
-#include "WebTextInputType.h"
-#include "platform/WebString.h"
-
-namespace WebKit {
-
-struct WebTextInputInfo {
- WebTextInputType type;
-
- // The value of the currently focused input field.
- WebString value;
-
- // The cursor position of the current selection start, or the caret position
- // if nothing is selected.
- int selectionStart;
-
- // The cursor position of the current selection end, or the caret position
- // if nothing is selected.
- int selectionEnd;
-
- // The start position of the current composition, or -1 if there is none.
- int compositionStart;
-
- // The end position of the current composition, or -1 if there is none.
- int compositionEnd;
-
- WEBKIT_EXPORT bool equals(const WebTextInputInfo&) const;
-
- WebTextInputInfo()
- : type(WebTextInputTypeNone)
- , selectionStart(0)
- , selectionEnd(0)
- , compositionStart(-1)
- , compositionEnd(-1)
- {
- }
-};
-
-inline bool operator==(const WebTextInputInfo& a, const WebTextInputInfo& b)
-{
- return a.equals(b);
-}
-
-inline bool operator!=(const WebTextInputInfo& a, const WebTextInputInfo& b)
-{
- return !(a == b);
-}
-
-} // namespace WebKit
-
-#endif
Modified: trunk/Source/WebKit/chromium/public/WebTextInputType.h (117401 => 117402)
--- trunk/Source/WebKit/chromium/public/WebTextInputType.h 2012-05-17 06:22:13 UTC (rev 117401)
+++ trunk/Source/WebKit/chromium/public/WebTextInputType.h 2012-05-17 06:36:29 UTC (rev 117402)
@@ -39,8 +39,6 @@
// Input caret is in a normal editable node, any input method can be used.
WebTextInputTypeText,
- WebTextInputTypeTextArea,
- WebTextInputTypeContentEditable,
// Input caret is in a specific input field, and input method may be used
// only if it's suitable for the specific input field.
Modified: trunk/Source/WebKit/chromium/public/WebWidget.h (117401 => 117402)
--- trunk/Source/WebKit/chromium/public/WebWidget.h 2012-05-17 06:22:13 UTC (rev 117401)
+++ trunk/Source/WebKit/chromium/public/WebWidget.h 2012-05-17 06:36:29 UTC (rev 117402)
@@ -32,8 +32,8 @@
#define WebWidget_h
#include "WebCompositionUnderline.h"
+#include "WebTextInputType.h"
#include "WebTextDirection.h"
-#include "WebTextInputInfo.h"
#include "platform/WebCanvas.h"
#include "platform/WebCommon.h"
#include "platform/WebRect.h"
@@ -170,12 +170,8 @@
// returns false on failure.
virtual bool compositionRange(size_t* location, size_t* length) { return false; }
- // Returns information about the current text input of this WebWidget.
- virtual WebTextInputInfo textInputInfo() { return WebTextInputInfo(); }
-
// Returns the current text input type of this WebWidget.
- // FIXME: Remove this method. It's redundant with textInputInfo().
- virtual WebTextInputType textInputType() { return WebTextInputTypeNone; }
+ virtual WebTextInputType textInputType() { return WebKit::WebTextInputTypeNone; }
// Returns the start and end bounds of the current selection.
// If the selection range is empty, it returns the caret bounds.
Deleted: trunk/Source/WebKit/chromium/src/WebTextInputInfo.cpp (117401 => 117402)
--- trunk/Source/WebKit/chromium/src/WebTextInputInfo.cpp 2012-05-17 06:22:13 UTC (rev 117401)
+++ trunk/Source/WebKit/chromium/src/WebTextInputInfo.cpp 2012-05-17 06:36:29 UTC (rev 117402)
@@ -1,46 +0,0 @@
-/*
- * Copyright (C) 2012 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following disclaimer
- * in the documentation and/or other materials provided with the
- * distribution.
- * * Neither the name of Google Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "WebTextInputInfo.h"
-
-namespace WebKit {
-
-bool WebTextInputInfo::equals(const WebTextInputInfo& other) const
-{
- return type == other.type
- && value == other.value
- && selectionStart == other.selectionStart
- && selectionEnd == other.selectionEnd
- && compositionStart == other.compositionStart
- && compositionEnd == other.compositionEnd;
-}
-
-} // namespace WebKit
Modified: trunk/Source/WebKit/chromium/src/WebViewImpl.cpp (117401 => 117402)
--- trunk/Source/WebKit/chromium/src/WebViewImpl.cpp 2012-05-17 06:22:13 UTC (rev 117401)
+++ trunk/Source/WebKit/chromium/src/WebViewImpl.cpp 2012-05-17 06:36:29 UTC (rev 117402)
@@ -113,7 +113,6 @@
#include "SpeechInputClientImpl.h"
#include "SpeechRecognitionClientProxy.h"
#include "StyleResolver.h"
-#include "Text.h"
#include "TextFieldDecoratorImpl.h"
#include "TextIterator.h"
#include "Timer.h"
@@ -141,7 +140,6 @@
#include "WebRange.h"
#include "WebRuntimeFeatures.h"
#include "WebSettingsImpl.h"
-#include "WebTextInputInfo.h"
#include "WebViewClient.h"
#include "WheelEvent.h"
#include "cc/CCProxy.h"
@@ -1881,115 +1879,62 @@
return false;
}
-WebTextInputInfo WebViewImpl::textInputInfo()
+WebTextInputType WebViewImpl::textInputType()
{
- WebTextInputInfo info;
-
- Frame* focused = focusedWebCoreFrame();
- if (!focused)
- return info;
-
- Editor* editor = focused->editor();
- if (!editor || !editor->canEdit())
- return info;
-
- FrameSelection* selection = focused->selection();
- if (!selection)
- return info;
-
Node* node = focusedWebCoreNode();
if (!node)
- return info;
+ return WebTextInputTypeNone;
- info.type = textInputType();
- if (info.type == WebTextInputTypeNone)
- return info;
+ if (node->nodeType() == Node::ELEMENT_NODE) {
+ Element* element = static_cast<Element*>(node);
+ if (element->hasLocalName(HTMLNames::inputTag)) {
+ HTMLInputElement* input = static_cast<HTMLInputElement*>(element);
- if (node->hasTagName(HTMLNames::textareaTag))
- info.value = static_cast<HTMLTextAreaElement*>(node)->value();
- else if (node->hasTagName(HTMLNames::inputTag))
- info.value = static_cast<HTMLInputElement*>(node)->value();
- else if (node->shouldUseInputMethod())
- info.value = node->nodeValue();
- else
- return info;
+ if (input->readOnly() || input->disabled())
+ return WebTextInputTypeNone;
- if (info.value.isEmpty())
- return info;
+ if (input->isPasswordField())
+ return WebTextInputTypePassword;
+ if (input->isSearchField())
+ return WebTextInputTypeSearch;
+ if (input->isEmailField())
+ return WebTextInputTypeEmail;
+ if (input->isNumberField())
+ return WebTextInputTypeNumber;
+ if (input->isTelephoneField())
+ return WebTextInputTypeTelephone;
+ if (input->isURLField())
+ return WebTextInputTypeURL;
+ if (input->isDateField())
+ return WebTextInputTypeDate;
+ if (input->isDateTimeField())
+ return WebTextInputTypeDateTime;
+ if (input->isDateTimeLocalField())
+ return WebTextInputTypeDateTimeLocal;
+ if (input->isMonthField())
+ return WebTextInputTypeMonth;
+ if (input->isTimeField())
+ return WebTextInputTypeTime;
+ if (input->isWeekField())
+ return WebTextInputTypeWeek;
+ if (input->isTextField())
+ return WebTextInputTypeText;
- if (node->hasTagName(HTMLNames::textareaTag) || node->hasTagName(HTMLNames::inputTag)) {
- HTMLTextFormControlElement* formElement = static_cast<HTMLTextFormControlElement*>(node);
- info.selectionStart = formElement->selectionStart();
- info.selectionEnd = formElement->selectionEnd();
- if (editor->hasComposition()) {
- info.compositionStart = formElement->indexForVisiblePosition(Position(editor->compositionNode(), editor->compositionStart()));
- info.compositionEnd = formElement->indexForVisiblePosition(Position(editor->compositionNode(), editor->compositionEnd()));
+ return WebTextInputTypeNone;
}
- } else {
- info.selectionStart = selection->start().computeOffsetInContainerNode();
- info.selectionEnd = selection->end().computeOffsetInContainerNode();
- if (editor->hasComposition()) {
- info.compositionStart = static_cast<int>(editor->compositionStart());
- info.compositionEnd = static_cast<int>(editor->compositionEnd());
- }
- }
- return info;
-}
+ if (element->hasLocalName(HTMLNames::textareaTag)) {
+ HTMLTextAreaElement* textarea = static_cast<HTMLTextAreaElement*>(element);
-WebTextInputType WebViewImpl::textInputType()
-{
- Node* node = focusedWebCoreNode();
- if (!node)
- return WebTextInputTypeNone;
-
- if (node->hasTagName(HTMLNames::inputTag)) {
- HTMLInputElement* input = static_cast<HTMLInputElement*>(node);
-
- if (input->readOnly() || input->disabled())
- return WebTextInputTypeNone;
-
- if (input->isPasswordField())
- return WebTextInputTypePassword;
- if (input->isSearchField())
- return WebTextInputTypeSearch;
- if (input->isEmailField())
- return WebTextInputTypeEmail;
- if (input->isNumberField())
- return WebTextInputTypeNumber;
- if (input->isTelephoneField())
- return WebTextInputTypeTelephone;
- if (input->isURLField())
- return WebTextInputTypeURL;
- if (input->isDateField())
- return WebTextInputTypeDate;
- if (input->isDateTimeField())
- return WebTextInputTypeDateTime;
- if (input->isDateTimeLocalField())
- return WebTextInputTypeDateTimeLocal;
- if (input->isMonthField())
- return WebTextInputTypeMonth;
- if (input->isTimeField())
- return WebTextInputTypeTime;
- if (input->isWeekField())
- return WebTextInputTypeWeek;
- if (input->isTextField())
+ if (textarea->readOnly() || textarea->disabled())
+ return WebTextInputTypeNone;
return WebTextInputTypeText;
-
- return WebTextInputTypeNone;
+ }
}
- if (node->hasTagName(HTMLNames::textareaTag)) {
- HTMLTextAreaElement* textarea = static_cast<HTMLTextAreaElement*>(node);
-
- if (textarea->readOnly() || textarea->disabled())
- return WebTextInputTypeNone;
-
- return WebTextInputTypeTextArea;
- }
-
+ // For other situations.
if (node->shouldUseInputMethod())
- return WebTextInputTypeContentEditable;
+ return WebTextInputTypeText;
return WebTextInputTypeNone;
}
Modified: trunk/Source/WebKit/chromium/src/WebViewImpl.h (117401 => 117402)
--- trunk/Source/WebKit/chromium/src/WebViewImpl.h 2012-05-17 06:22:13 UTC (rev 117401)
+++ trunk/Source/WebKit/chromium/src/WebViewImpl.h 2012-05-17 06:36:29 UTC (rev 117402)
@@ -145,7 +145,6 @@
virtual bool confirmComposition();
virtual bool confirmComposition(const WebString& text);
virtual bool compositionRange(size_t* location, size_t* length);
- virtual WebTextInputInfo textInputInfo();
virtual WebTextInputType textInputType();
virtual bool selectionBounds(WebRect& start, WebRect& end) const;
virtual bool selectionTextDirection(WebTextDirection& start, WebTextDirection& end) const;