diff options
Diffstat (limited to 'Source')
-rw-r--r-- | Source/WebCore/html/HTMLInputElement.cpp | 72 | ||||
-rw-r--r-- | Source/WebCore/html/RangeInputType.cpp | 8 | ||||
-rw-r--r-- | Source/WebCore/page/DOMWindow.cpp | 4 | ||||
-rw-r--r-- | Source/WebCore/page/EventHandler.cpp | 116 | ||||
-rw-r--r-- | Source/WebCore/page/History.cpp | 3 | ||||
-rw-r--r-- | Source/WebCore/platform/graphics/GraphicsContext.cpp | 5 | ||||
-rw-r--r-- | Source/WebCore/rendering/InlineTextBox.cpp | 9 |
7 files changed, 24 insertions, 193 deletions
diff --git a/Source/WebCore/html/HTMLInputElement.cpp b/Source/WebCore/html/HTMLInputElement.cpp index 5ebd640..49888f1 100644 --- a/Source/WebCore/html/HTMLInputElement.cpp +++ b/Source/WebCore/html/HTMLInputElement.cpp @@ -49,19 +49,14 @@ #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); diff --git a/Source/WebCore/html/RangeInputType.cpp b/Source/WebCore/html/RangeInputType.cpp index 5d71da7..7a0d3e4 100644 --- a/Source/WebCore/html/RangeInputType.cpp +++ b/Source/WebCore/html/RangeInputType.cpp @@ -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); } diff --git a/Source/WebCore/page/DOMWindow.cpp b/Source/WebCore/page/DOMWindow.cpp index c2e8c39..be6c179 100644 --- a/Source/WebCore/page/DOMWindow.cpp +++ b/Source/WebCore/page/DOMWindow.cpp @@ -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) diff --git a/Source/WebCore/page/EventHandler.cpp b/Source/WebCore/page/EventHandler.cpp index ab923ac..a04bcf0 100644 --- a/Source/WebCore/page/EventHandler.cpp +++ b/Source/WebCore/page/EventHandler.cpp @@ -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; diff --git a/Source/WebCore/page/History.cpp b/Source/WebCore/page/History.cpp index abbf9ec..1d1e77a 100644 --- a/Source/WebCore/page/History.cpp +++ b/Source/WebCore/page/History.cpp @@ -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); } diff --git a/Source/WebCore/platform/graphics/GraphicsContext.cpp b/Source/WebCore/platform/graphics/GraphicsContext.cpp index 25bade7..b8a6859 100644 --- a/Source/WebCore/platform/graphics/GraphicsContext.cpp +++ b/Source/WebCore/platform/graphics/GraphicsContext.cpp @@ -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 diff --git a/Source/WebCore/rendering/InlineTextBox.cpp b/Source/WebCore/rendering/InlineTextBox.cpp index 8884ed1..aa00b7f 100644 --- a/Source/WebCore/rendering/InlineTextBox.cpp +++ b/Source/WebCore/rendering/InlineTextBox.cpp @@ -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 |