OSDN Git Service

Merge WebKit at r75315: Fix conflicts
authorSteve Block <steveblock@google.com>
Mon, 9 May 2011 16:47:02 +0000 (17:47 +0100)
committerSteve Block <steveblock@google.com>
Fri, 13 May 2011 10:32:28 +0000 (11:32 +0100)
- HTMLInputElement.cpp
  Conflict due to ANDROID_ACCEPT_CHANGES_TO_FOCUSED_TEXTFIELDS
  See http://trac.webkit.org/changeset/74895

- HTMLInputElement.cpp and RangeInputType.cpp
  Conflict due to refactoring of event handling on input elements
  See http://trac.webkit.org/changeset/74549

- DOMWindow.cpp
  Conflict due to DOMWindow::clearDOMStorage()
  See http://trac.webkit.org/changeset/74800

- EventHandler.cpp
  Conflict due to longpress and doubletap vs touch event refactoring
  See http://trac.webkit.org/changeset/74553

- History.cpp
  Trivial conflict due to cherry-pick
  See http://trac.webkit.org/changeset/74853

- GraphicsContext.cpp
  Conflict due to PLATFORM(ANDROID) guard
  See http://trac.webkit.org/changeset/74662

- InlineTextBox.cpp
  Conflict due to ANDROID_DISABLE_ROUNDING_HACKS
  See http://trac.webkit.org/changeset/74971

Change-Id: I5c1abe54b9d78f667a41e83a871e9a21be0a89d5

Source/WebCore/html/HTMLInputElement.cpp
Source/WebCore/html/RangeInputType.cpp
Source/WebCore/page/DOMWindow.cpp
Source/WebCore/page/EventHandler.cpp
Source/WebCore/page/History.cpp
Source/WebCore/platform/graphics/GraphicsContext.cpp
Source/WebCore/rendering/InlineTextBox.cpp

index 5ebd640..49888f1 100644 (file)
 #include "RenderTheme.h"
 #include "RuntimeEnabledFeatures.h"
 #include "ScriptEventListener.h"
-<<<<<<< HEAD:WebCore/html/HTMLInputElement.cpp
-#include "Settings.h"
-#include "StepRange.h"
-#include "TextEvent.h"
-#ifdef ANDROID_ACCEPT_CHANGES_TO_FOCUSED_TEXTFIELDS
-#include "PlatformBridge.h"
-#endif
-=======
->>>>>>> webkit.org at r75315:Source/WebCore/html/HTMLInputElement.cpp
 #include "WheelEvent.h"
 #include <wtf/MathExtras.h>
 #include <wtf/StdLibExtras.h>
 
+#ifdef ANDROID_ACCEPT_CHANGES_TO_FOCUSED_TEXTFIELDS
+#include "PlatformBridge.h"
+#endif
+
 using namespace std;
 
 namespace WebCore {
@@ -431,54 +426,13 @@ void HTMLInputElement::setType(const String& type)
 void HTMLInputElement::updateType()
 {
     const AtomicString& typeString = fastGetAttribute(typeAttr);
-<<<<<<< HEAD:WebCore/html/HTMLInputElement.cpp
-    DeprecatedInputType newType = typeString.isEmpty() ? TEXT : typeMap->get(typeString);
+
+    OwnPtr<InputType> newType = InputType::create(this, typeString);
 #ifdef ANDROID_ACCEPT_CHANGES_TO_FOCUSED_TEXTFIELDS
-    if (newType == PASSWORD && document()->focusedNode() == this)
+    if (newType->isPasswordField() && document()->focusedNode() == this)
         PlatformBridge::updateTextfield(document()->view(), this, true, String());
 #endif
 
-    // IMPORTANT: Don't allow the type to be changed to FILE after the first
-    // type change, otherwise a JavaScript programmer would be able to set a text
-    // field's value to something like /etc/passwd and then change it to a file field.
-    if (deprecatedInputType() != newType) {
-        if (newType == FILE && m_haveType)
-            // Set the attribute back to the old value.
-            // Useful in case we were called from inside parseMappedAttribute.
-            setAttribute(typeAttr, type());
-        else {
-            checkedRadioButtons().removeButton(this);
-
-            if (newType == FILE && !m_fileList)
-                m_fileList = FileList::create();
-
-            bool wasAttached = attached();
-            if (wasAttached)
-                detach();
-
-            bool didStoreValue = storesValueSeparateFromAttribute();
-            bool wasPasswordField = deprecatedInputType() == PASSWORD;
-            bool didRespectHeightAndWidth = respectHeightAndWidthAttrs();
-            m_deprecatedTypeNumber = newType;
-            m_inputType = InputType::create(this, typeString);
-            setNeedsWillValidateCheck();
-            bool willStoreValue = storesValueSeparateFromAttribute();
-            bool isPasswordField = deprecatedInputType() == PASSWORD;
-            bool willRespectHeightAndWidth = respectHeightAndWidthAttrs();
-
-            if (didStoreValue && !willStoreValue && !m_data.value().isNull()) {
-                setAttribute(valueAttr, m_data.value());
-                m_data.setValue(String());
-            }
-            if (!didStoreValue && willStoreValue)
-                m_data.setValue(sanitizeValue(getAttribute(valueAttr)));
-            else
-                InputElement::updateValueIfNeeded(m_data, this);
-=======
->>>>>>> webkit.org at r75315:Source/WebCore/html/HTMLInputElement.cpp
-
-    OwnPtr<InputType> newType = InputType::create(this, typeString);
-
     if (m_hasType && !newType->canChangeFromAnotherType()) {
         // Set the attribute back to the old value.
         // Useful in case we were called from inside parseMappedAttribute.
@@ -1087,19 +1041,7 @@ void HTMLInputElement::defaultEventHandler(Event* evt)
             return;
     }
 
-<<<<<<< HEAD:WebCore/html/HTMLInputElement.cpp
-    if (deprecatedInputType() == RANGE
-        && renderer()
-        && (evt->isMouseEvent()
-#if PLATFORM(ANDROID) && ENABLE(TOUCH_EVENTS)
-            || evt->isTouchEvent()
-#endif
-            || evt->isDragEvent()
-            || evt->isWheelEvent()))
-        toRenderSlider(renderer())->forwardEvent(evt);
-=======
     m_inputType->forwardEvent(evt);
->>>>>>> webkit.org at r75315:Source/WebCore/html/HTMLInputElement.cpp
 
     if (!callBaseClassEarly && !evt->defaultHandled())
         HTMLFormControlElementWithState::defaultEventHandler(evt);
index 5d71da7..7a0d3e4 100644 (file)
@@ -182,7 +182,13 @@ void RangeInputType::handleKeydownEvent(KeyboardEvent* event)
 
 void RangeInputType::forwardEvent(Event* event)
 {
-    if (element()->renderer() && (event->isMouseEvent() || event->isDragEvent() || event->isWheelEvent()))
+    if (element()->renderer()
+        && (event->isMouseEvent()
+#if PLATFORM(ANDROID) && ENABLE(TOUCH_EVENTS)
+            || event->isTouchEvent()
+#endif
+            || event->isDragEvent()
+            || event->isWheelEvent()))
         toRenderSlider(element()->renderer())->forwardEvent(event);
 }
 
index c2e8c39..be6c179 100644 (file)
@@ -1634,7 +1634,6 @@ void DOMWindow::revokeObjectURL(const String& blobURLString)
 }
 #endif
 
-<<<<<<< HEAD:WebCore/page/DOMWindow.cpp
 #if ENABLE(DOM_STORAGE) && defined(ANDROID)
 void DOMWindow::clearDOMStorage()
 {
@@ -1648,10 +1647,7 @@ void DOMWindow::clearDOMStorage()
 }
 #endif
 
-void DOMWindow::setLocation(const String& urlString, DOMWindow* activeWindow, DOMWindow* firstWindow)
-=======
 void DOMWindow::setLocation(const String& urlString, DOMWindow* activeWindow, DOMWindow* firstWindow, SetLocationLocking locking)
->>>>>>> webkit.org at r75315:Source/WebCore/page/DOMWindow.cpp
 {
     Frame* activeFrame = activeWindow->frame();
     if (!activeFrame)
index ab923ac..a04bcf0 100644 (file)
@@ -2999,113 +2999,6 @@ bool EventHandler::handleTouchEvent(const PlatformTouchEvent& event)
 
     // Now iterate the changedTouches list and m_targets within it, sending events to the tagets as required.
     bool defaultPrevented = false;
-<<<<<<< HEAD:WebCore/page/EventHandler.cpp
-    Touch* changedTouch = 0;
-    EventTarget* touchEventTarget = 0;
-
-    if (cancelTouches->length() > 0) {
-        // We dispatch the event to the target of the touch that caused this touch event to be generated, i.e.
-        // we take it from the list that will be used as the changedTouches property of the event.
-        // The choice to use the touch at index 0 guarantees that there is a target (as we checked the length
-        // above). In the case that there are multiple touches in what becomes the changedTouches list, it is
-        // difficult to say how we should prioritise touches and as such, item 0 is an arbitrary choice.
-        changedTouch = cancelTouches->item(0);
-        ASSERT(changedTouch);
-        touchEventTarget = changedTouch->target();
-        ASSERT(touchEventTarget);
-
-        eventName = &eventNames().touchcancelEvent;
-        RefPtr<TouchEvent> cancelEv =
-            TouchEvent::create(TouchList::create().get(), TouchList::create().get(), cancelTouches.get(),
-                                                   *eventName, touchEventTarget->toNode()->document()->defaultView(),
-                                                   0, 0, 0, 0, event.ctrlKey(), event.altKey(), event.shiftKey(),
-                                                   event.metaKey());
-        ExceptionCode ec = 0;
-        touchEventTarget->dispatchEvent(cancelEv.get(), ec);
-        defaultPrevented |= cancelEv->defaultPrevented();
-    }
-
-    if (releasedTouches->length() > 0) {
-        Touch* changedTouch = releasedTouches->item(0);
-        ASSERT(changedTouch);
-        touchEventTarget = changedTouch->target();
-        ASSERT(touchEventTarget);
-
-        RefPtr<TouchList> targetTouches = assembleTargetTouches(changedTouch, touches.get());
-
-        eventName = &eventNames().touchendEvent;
-        RefPtr<TouchEvent> endEv = 
-            TouchEvent::create(touches.get(), targetTouches.get(), releasedTouches.get(),
-                                                   *eventName, touchEventTarget->toNode()->document()->defaultView(),
-                                                   0, 0, 0, 0, event.ctrlKey(), event.altKey(), event.shiftKey(),
-                                                   event.metaKey());
-        ExceptionCode ec = 0;
-        touchEventTarget->dispatchEvent(endEv.get(), ec);
-        defaultPrevented |= endEv->defaultPrevented();
-    }
-    if (pressedTouches->length() > 0) {
-        Touch* changedTouch = pressedTouches->item(0);
-        ASSERT(changedTouch);
-        touchEventTarget = changedTouch->target();
-        ASSERT(touchEventTarget);
-
-        RefPtr<TouchList> targetTouches = assembleTargetTouches(changedTouch, touches.get());
-
-#if PLATFORM(ANDROID)
-        if (event.type() == TouchLongPress) {
-            eventName = &eventNames().touchlongpressEvent;
-            RefPtr<TouchEvent> longpressEv =
-                TouchEvent::create(touches.get(), targetTouches.get(), pressedTouches.get(),
-                                                       *eventName, touchEventTarget->toNode()->document()->defaultView(),
-                                                       0, 0, 0, 0, event.ctrlKey(), event.altKey(), event.shiftKey(),
-                                                       event.metaKey());
-            ExceptionCode ec = 0;
-            touchEventTarget->dispatchEvent(longpressEv.get(), ec);
-            defaultPrevented |= longpressEv->defaultPrevented();
-        } else if (event.type() == TouchDoubleTap) {
-            eventName = &eventNames().touchdoubletapEvent;
-            RefPtr<TouchEvent> doubleTapEv =
-                TouchEvent::create(touches.get(), targetTouches.get(), pressedTouches.get(),
-                                                       *eventName, touchEventTarget->toNode()->document()->defaultView(),
-                                                       0, 0, 0, 0, event.ctrlKey(), event.altKey(), event.shiftKey(),
-                                                       event.metaKey());
-            ExceptionCode ec = 0;
-            touchEventTarget->dispatchEvent(doubleTapEv.get(), ec);
-            defaultPrevented |= doubleTapEv->defaultPrevented();
-        } else {
-#endif
-        eventName = &eventNames().touchstartEvent;
-        RefPtr<TouchEvent> startEv =
-            TouchEvent::create(touches.get(), targetTouches.get(), pressedTouches.get(),
-                                                   *eventName, touchEventTarget->toNode()->document()->defaultView(),
-                                                   0, 0, 0, 0, event.ctrlKey(), event.altKey(), event.shiftKey(),
-                                                   event.metaKey());
-        ExceptionCode ec = 0;
-        touchEventTarget->dispatchEvent(startEv.get(), ec);
-        defaultPrevented |= startEv->defaultPrevented();
-#if PLATFORM(ANDROID)
-    }
-#endif
-    }
-
-    if (movedTouches->length() > 0) {
-        Touch* changedTouch = movedTouches->item(0);
-        ASSERT(changedTouch);
-        touchEventTarget = changedTouch->target();
-        ASSERT(touchEventTarget);
-
-        RefPtr<TouchList> targetTouches = assembleTargetTouches(changedTouch, touches.get());
-
-        eventName = &eventNames().touchmoveEvent;
-        RefPtr<TouchEvent> moveEv = 
-            TouchEvent::create(touches.get(), targetTouches.get(), movedTouches.get(),
-                                                   *eventName, touchEventTarget->toNode()->document()->defaultView(),
-                                                   0, 0, 0, 0, event.ctrlKey(), event.altKey(), event.shiftKey(),
-                                                   event.metaKey());
-        ExceptionCode ec = 0;
-        touchEventTarget->dispatchEvent(moveEv.get(), ec);
-        defaultPrevented |= moveEv->defaultPrevented();
-=======
     RefPtr<TouchList> emptyList = TouchList::create();
     for (unsigned state = 0; state != PlatformTouchPoint::TouchStateEnd; ++state) {
         if (!changedTouches[state].m_touches)
@@ -3114,7 +3007,15 @@ bool EventHandler::handleTouchEvent(const PlatformTouchEvent& event)
         // When sending a touch cancel event, use empty touches and targetTouches lists.
         bool isTouchCancelEvent = (state == PlatformTouchPoint::TouchCancelled);
         RefPtr<TouchList>& effectiveTouches(isTouchCancelEvent ? emptyList : touches);
+#if PLATFORM(ANDROID)
+        AtomicString stateName(eventNameForTouchPointState(static_cast<PlatformTouchPoint::State>(state)));
+        if (event.type() == TouchLongPress)
+            stateName = eventNames().touchlongpressEvent;
+        else if (event.type() == TouchDoubleTap)
+            stateName = eventNames().touchdoubletapEvent;
+#else
         const AtomicString& stateName(eventNameForTouchPointState(static_cast<PlatformTouchPoint::State>(state)));
+#endif
         const EventTargetSet& targetsForState = changedTouches[state].m_targets;
 
         for (EventTargetSet::const_iterator it = targetsForState.begin(); it != targetsForState.end(); ++it) {
@@ -3130,7 +3031,6 @@ bool EventHandler::handleTouchEvent(const PlatformTouchEvent& event)
             touchEventTarget->dispatchEvent(touchEvent.get(), ec);
             defaultPrevented |= touchEvent->defaultPrevented();
         }
->>>>>>> webkit.org at r75315:Source/WebCore/page/EventHandler.cpp
     }
 
     return defaultPrevented;
index abbf9ec..1d1e77a 100644 (file)
@@ -85,10 +85,7 @@ void History::go(int distance)
 {
     if (!m_frame)
         return;
-<<<<<<< HEAD:WebCore/page/History.cpp
-=======
 
->>>>>>> webkit.org at r75315:Source/WebCore/page/History.cpp
     m_frame->navigationScheduler()->scheduleHistoryNavigation(distance);
 }
 
index 25bade7..b8a6859 100644 (file)
@@ -621,13 +621,8 @@ void GraphicsContext::setPlatformTextDrawingMode(TextDrawingModeFlags mode)
 }
 #endif
 
-<<<<<<< HEAD:WebCore/platform/graphics/GraphicsContext.cpp
 #if !PLATFORM(QT) && !PLATFORM(CAIRO) && !(PLATFORM(SKIA) && !PLATFORM(ANDROID)) && !PLATFORM(HAIKU) && !PLATFORM(OPENVG)
-void GraphicsContext::setPlatformStrokeStyle(const StrokeStyle&)
-=======
-#if !PLATFORM(QT) && !PLATFORM(CAIRO) && !PLATFORM(SKIA) && !PLATFORM(HAIKU) && !PLATFORM(OPENVG)
 void GraphicsContext::setPlatformStrokeStyle(StrokeStyle)
->>>>>>> webkit.org at r75315:Source/WebCore/platform/graphics/GraphicsContext.cpp
 {
 }
 #endif
index 8884ed1..aa00b7f 100644 (file)
@@ -1221,24 +1221,19 @@ int InlineTextBox::offsetForPosition(int lineOffset, bool includePartialGlyphs)
     RenderText* text = toRenderText(renderer());
     RenderStyle* style = text->style(m_firstLine);
     const Font* f = &style->font();
-<<<<<<< HEAD:WebCore/rendering/InlineTextBox.cpp
 #ifdef ANDROID_DISABLE_ROUNDING_HACKS
     TextRun textRun = TextRun(textRenderer()->text()->characters() + m_start, m_len, textRenderer()->allowTabs(), textPos(), m_toAdd, !isLeftToRightDirection(), m_dirOverride || style->visuallyOrdered());
     if (m_disableRoundingHacks)
         textRun.disableRoundingHacks();
-    return f->offsetForPosition(textRun, lineOffset - logicalLeft(), includePartialGlyphs);
+    int offset = f->offsetForPosition(textRun, lineOffset - logicalLeft(), includePartialGlyphs);
 #else
-    return f->offsetForPosition(TextRun(textRenderer()->text()->characters() + m_start, m_len, textRenderer()->allowTabs(), textPos(), m_toAdd, !isLeftToRightDirection(), m_dirOverride || style->visuallyOrdered()),
-        lineOffset - logicalLeft(), includePartialGlyphs);
-#endif
-=======
     int offset = f->offsetForPosition(TextRun(textRenderer()->text()->characters() + m_start, m_len,
         textRenderer()->allowTabs(), textPos(), m_toAdd, !isLeftToRightDirection(), m_dirOverride || style->visuallyOrdered()),
         lineOffset - logicalLeft(), includePartialGlyphs);
+#endif
     if (blockIsInOppositeDirection && (!offset || offset == m_len))
         return !offset ? m_len : 0;
     return offset;
->>>>>>> webkit.org at r75315:Source/WebCore/rendering/InlineTextBox.cpp
 }
 
 int InlineTextBox::positionForOffset(int offset) const