diff options
Diffstat (limited to 'Source/WebKit/chromium/src')
-rw-r--r-- | Source/WebKit/chromium/src/FrameLoaderClientImpl.cpp | 6 | ||||
-rw-r--r-- | Source/WebKit/chromium/src/FrameLoaderClientImpl.h | 3 | ||||
-rw-r--r-- | Source/WebKit/chromium/src/NonCompositedContentHost.cpp | 20 | ||||
-rw-r--r-- | Source/WebKit/chromium/src/PlatformSupport.cpp | 17 | ||||
-rw-r--r-- | Source/WebKit/chromium/src/WebFrameImpl.cpp | 66 | ||||
-rw-r--r-- | Source/WebKit/chromium/src/WebFrameImpl.h | 5 | ||||
-rw-r--r-- | Source/WebKit/chromium/src/WebImageSkia.cpp | 48 | ||||
-rw-r--r-- | Source/WebKit/chromium/src/WebPluginScrollbarImpl.cpp | 10 | ||||
-rw-r--r-- | Source/WebKit/chromium/src/WebPluginScrollbarImpl.h | 2 | ||||
-rw-r--r-- | Source/WebKit/chromium/src/WebRuntimeFeatures.cpp | 18 | ||||
-rw-r--r-- | Source/WebKit/chromium/src/WebScrollbarThemeClientImpl.cpp | 10 | ||||
-rw-r--r-- | Source/WebKit/chromium/src/WebScrollbarThemeClientImpl.h | 2 | ||||
-rw-r--r-- | Source/WebKit/chromium/src/WebViewImpl.cpp | 60 | ||||
-rw-r--r-- | Source/WebKit/chromium/src/WebViewImpl.h | 2 |
14 files changed, 146 insertions, 123 deletions
diff --git a/Source/WebKit/chromium/src/FrameLoaderClientImpl.cpp b/Source/WebKit/chromium/src/FrameLoaderClientImpl.cpp index 5dd02b563..7a616c520 100644 --- a/Source/WebKit/chromium/src/FrameLoaderClientImpl.cpp +++ b/Source/WebKit/chromium/src/FrameLoaderClientImpl.cpp @@ -142,6 +142,12 @@ void FrameLoaderClientImpl::documentElementAvailable() m_webFrame->client()->didCreateDocumentElement(m_webFrame); } +void FrameLoaderClientImpl::didExhaustMemoryAvailableForScript() +{ + if (m_webFrame->client()) + m_webFrame->client()->didExhaustMemoryAvailableForScript(m_webFrame); +} + #if USE(V8) void FrameLoaderClientImpl::didCreateScriptContext(v8::Handle<v8::Context> context, int extensionGroup, int worldId) { diff --git a/Source/WebKit/chromium/src/FrameLoaderClientImpl.h b/Source/WebKit/chromium/src/FrameLoaderClientImpl.h index ecb20a2fb..1cf5cd1e1 100644 --- a/Source/WebKit/chromium/src/FrameLoaderClientImpl.h +++ b/Source/WebKit/chromium/src/FrameLoaderClientImpl.h @@ -61,6 +61,9 @@ public: virtual void dispatchDidClearWindowObjectInWorld(WebCore::DOMWrapperWorld*); virtual void documentElementAvailable(); + // Script in the page tried to allocate too much memory. + virtual void didExhaustMemoryAvailableForScript(); + #if USE(V8) virtual void didCreateScriptContext(v8::Handle<v8::Context>, int extensionGroup, int worldId); virtual void willReleaseScriptContext(v8::Handle<v8::Context>, int worldId); diff --git a/Source/WebKit/chromium/src/NonCompositedContentHost.cpp b/Source/WebKit/chromium/src/NonCompositedContentHost.cpp index ae99ba889..9729d05ec 100644 --- a/Source/WebKit/chromium/src/NonCompositedContentHost.cpp +++ b/Source/WebKit/chromium/src/NonCompositedContentHost.cpp @@ -88,6 +88,20 @@ void NonCompositedContentHost::setScrollLayer(WebCore::GraphicsLayer* layer) ASSERT(haveScrollLayer()); } +static void setScrollbarBoundsContainPageScale(WebCore::GraphicsLayer* layer, WebCore::GraphicsLayer* clipLayer) +{ + // Scrollbars are attached outside the root clip rect, so skip the + // clipLayer subtree. + if (layer == clipLayer) + return; + + for (size_t i = 0; i < layer->children().size(); ++i) + setScrollbarBoundsContainPageScale(layer->children()[i], clipLayer); + + if (layer->children().isEmpty()) + layer->setAppliesPageScale(true); +} + void NonCompositedContentHost::setViewport(const WebCore::IntSize& viewportSize, const WebCore::IntSize& contentsSize, const WebCore::IntPoint& scrollPosition, const WebCore::IntPoint& scrollOrigin) { if (!haveScrollLayer()) @@ -119,6 +133,12 @@ void NonCompositedContentHost::setViewport(const WebCore::IntSize& viewportSize, m_graphicsLayer->setNeedsDisplay(); } else if (visibleRectChanged) m_graphicsLayer->setNeedsDisplay(); + + WebCore::GraphicsLayer* clipLayer = m_graphicsLayer->parent()->parent(); + WebCore::GraphicsLayer* rootLayer = clipLayer; + while (rootLayer->parent()) + rootLayer = rootLayer->parent(); + setScrollbarBoundsContainPageScale(rootLayer, clipLayer); } bool NonCompositedContentHost::haveScrollLayer() diff --git a/Source/WebKit/chromium/src/PlatformSupport.cpp b/Source/WebKit/chromium/src/PlatformSupport.cpp index 762055497..2fb6f1059 100644 --- a/Source/WebKit/chromium/src/PlatformSupport.cpp +++ b/Source/WebKit/chromium/src/PlatformSupport.cpp @@ -499,17 +499,6 @@ void PlatformSupport::paintThemePart( // Glue layer. Once the Glue layer moves entirely into the WebKit layer, these // methods will be deleted. -void PlatformSupport::notifyJSOutOfMemory(Frame* frame) -{ - if (!frame) - return; - - WebFrameImpl* webFrame = WebFrameImpl::fromFrame(frame); - if (!webFrame->client()) - return; - webFrame->client()->didExhaustMemoryAvailableForScript(webFrame); -} - int PlatformSupport::screenHorizontalDPI(Widget* widget) { WebWidgetClient* client = toWebWidgetClient(widget); @@ -566,12 +555,6 @@ IntRect PlatformSupport::screenAvailableRect(Widget* widget) return client->screenInfo().availableRect; } -bool PlatformSupport::popupsAllowed(NPP npp) -{ - // FIXME: Give the embedder a way to control this. - return false; -} - #if ENABLE(WORKERS) WorkerContextProxy* WorkerContextProxy::create(Worker* worker) { diff --git a/Source/WebKit/chromium/src/WebFrameImpl.cpp b/Source/WebKit/chromium/src/WebFrameImpl.cpp index 7bb0efeea..6d68a6f23 100644 --- a/Source/WebKit/chromium/src/WebFrameImpl.cpp +++ b/Source/WebKit/chromium/src/WebFrameImpl.cpp @@ -1029,7 +1029,7 @@ void WebFrameImpl::loadHistoryItem(const WebHistoryItem& item) m_frame->loader()->prepareForHistoryNavigation(); RefPtr<HistoryItem> currentItem = m_frame->loader()->history()->currentItem(); - m_inSameDocumentHistoryLoad = currentItem->shouldDoSameDocumentNavigationTo(historyItem.get()); + m_inSameDocumentHistoryLoad = currentItem && currentItem->shouldDoSameDocumentNavigationTo(historyItem.get()); m_frame->page()->goToItem(historyItem.get(), FrameLoadTypeIndexedBackForward); m_inSameDocumentHistoryLoad = false; @@ -1466,71 +1466,15 @@ bool WebFrameImpl::selectWordAroundCaret() return true; } -void WebFrameImpl::selectRange(const WebPoint& start, const WebPoint& end) +void WebFrameImpl::selectRange(const WebPoint& base, const WebPoint& extent) { - if (start == end && moveCaret(start)) - return; - - if (moveSelectionStart(start, true) && moveSelectionEnd(end, true)) - return; - - // Failed to move endpoints, probably because there's no current selection. - // Just set the selection explicitly (but this won't handle editable boundaries correctly). - VisibleSelection newSelection(visiblePositionForWindowPoint(start), visiblePositionForWindowPoint(end)); + VisiblePosition basePos = visiblePositionForWindowPoint(base); + VisiblePosition extentPos = visiblePositionForWindowPoint(extent); + VisibleSelection newSelection = VisibleSelection(basePos, extentPos); if (frame()->selection()->shouldChangeSelection(newSelection)) frame()->selection()->setSelection(newSelection, CharacterGranularity); } -bool WebFrameImpl::moveSelectionStart(const WebPoint& point, bool allowCollapsedSelection) -{ - const VisibleSelection& selection = frame()->selection()->selection(); - if (selection.isNone()) - return false; - - VisiblePosition start = visiblePositionForWindowPoint(point); - if (!allowCollapsedSelection) { - VisiblePosition maxStart = selection.visibleEnd().previous(); - if (comparePositions(start, maxStart) > 0) - start = maxStart; - } - - // start is moving, so base=end, extent=start - VisibleSelection newSelection = VisibleSelection(selection.visibleEnd(), start); - frame()->selection()->setNonDirectionalSelectionIfNeeded(newSelection, CharacterGranularity); - return true; -} - -bool WebFrameImpl::moveSelectionEnd(const WebPoint& point, bool allowCollapsedSelection) -{ - const VisibleSelection& selection = frame()->selection()->selection(); - if (selection.isNone()) - return false; - - VisiblePosition end = visiblePositionForWindowPoint(point); - if (!allowCollapsedSelection) { - VisiblePosition minEnd = selection.visibleStart().next(); - if (comparePositions(end, minEnd) < 0) - end = minEnd; - } - - // end is moving, so base=start, extent=end - VisibleSelection newSelection = VisibleSelection(selection.visibleStart(), end); - frame()->selection()->setNonDirectionalSelectionIfNeeded(newSelection, CharacterGranularity); - return true; -} - -bool WebFrameImpl::moveCaret(const WebPoint& point) -{ - FrameSelection* frameSelection = frame()->selection(); - if (frameSelection->isNone() || !frameSelection->isContentEditable()) - return false; - - VisiblePosition pos = visiblePositionForWindowPoint(point); - frameSelection->setExtent(pos, UserTriggered); - frameSelection->setBase(frameSelection->extent(), UserTriggered); - return true; -} - void WebFrameImpl::selectRange(const WebRange& webRange) { RefPtr<Range> range = static_cast<PassRefPtr<Range> >(webRange); diff --git a/Source/WebKit/chromium/src/WebFrameImpl.h b/Source/WebKit/chromium/src/WebFrameImpl.h index 58525d701..a2fe797e3 100644 --- a/Source/WebKit/chromium/src/WebFrameImpl.h +++ b/Source/WebKit/chromium/src/WebFrameImpl.h @@ -184,11 +184,8 @@ public: virtual WebString selectionAsText() const; virtual WebString selectionAsMarkup() const; virtual bool selectWordAroundCaret(); - virtual void selectRange(const WebPoint& start, const WebPoint& end); + virtual void selectRange(const WebPoint& base, const WebPoint& extent); virtual void selectRange(const WebRange&); - virtual bool moveSelectionStart(const WebPoint&, bool allowCollapsedSelection); - virtual bool moveSelectionEnd(const WebPoint&, bool allowCollapsedSelection); - virtual bool moveCaret(const WebPoint&); virtual int printBegin(const WebPrintParams&, const WebNode& constrainToNode, bool* useBrowserOverlays); diff --git a/Source/WebKit/chromium/src/WebImageSkia.cpp b/Source/WebKit/chromium/src/WebImageSkia.cpp index e1a926050..0198a6806 100644 --- a/Source/WebKit/chromium/src/WebImageSkia.cpp +++ b/Source/WebKit/chromium/src/WebImageSkia.cpp @@ -31,7 +31,7 @@ #include "config.h" #include "Image.h" -#include "ImageSource.h" +#include "ImageDecoder.h" #include "NativeImageSkia.h" #include "SharedBuffer.h" @@ -51,19 +51,23 @@ namespace WebKit { WebImage WebImage::fromData(const WebData& data, const WebSize& desiredSize) { - ImageSource source; - source.setData(PassRefPtr<SharedBuffer>(data).get(), true); - if (!source.isSizeAvailable()) + RefPtr<SharedBuffer> buffer = PassRefPtr<SharedBuffer>(data); + OwnPtr<ImageDecoder> decoder(adoptPtr(ImageDecoder::create(*buffer.get(), ImageSource::AlphaPremultiplied, ImageSource::GammaAndColorProfileApplied))); + if (!decoder) + return WebImage(); + + decoder->setData(buffer.get(), true); + if (!decoder->isSizeAvailable()) return WebImage(); // Frames are arranged by decreasing size, then decreasing bit depth. // Pick the frame closest to |desiredSize|'s area without being smaller, // which has the highest bit depth. - const size_t frameCount = source.frameCount(); + const size_t frameCount = decoder->frameCount(); size_t index = 0; // Default to first frame if none are large enough. int frameAreaAtIndex = 0; for (size_t i = 0; i < frameCount; ++i) { - const IntSize frameSize = source.frameSizeAtIndex(i); + const IntSize frameSize = decoder->frameSizeAtIndex(i); if (WebSize(frameSize) == desiredSize) { index = i; break; // Perfect match. @@ -79,11 +83,15 @@ WebImage WebImage::fromData(const WebData& data, const WebSize& desiredSize) } } - OwnPtr<NativeImageSkia> frame = adoptPtr(source.createFrameAtIndex(index)); + ImageFrame* frame = decoder->frameBufferAtIndex(index); if (!frame) return WebImage(); - return WebImage(frame->bitmap()); + OwnPtr<NativeImageSkia> image = adoptPtr(frame->asNewNativeImage()); + if (!image) + return WebImage(); + + return WebImage(image->bitmap()); } WebVector<WebImage> WebImage::framesFromData(const WebData& data) @@ -91,26 +99,34 @@ WebVector<WebImage> WebImage::framesFromData(const WebData& data) // This is to protect from malicious images. It should be big enough that it's never hit in pracice. const size_t maxFrameCount = 8; - ImageSource source; - source.setData(PassRefPtr<SharedBuffer>(data).get(), true); - if (!source.isSizeAvailable()) + RefPtr<SharedBuffer> buffer = PassRefPtr<SharedBuffer>(data); + OwnPtr<ImageDecoder> decoder(adoptPtr(ImageDecoder::create(*buffer.get(), ImageSource::AlphaPremultiplied, ImageSource::GammaAndColorProfileApplied))); + if (!decoder) + return WebVector<WebImage>(); + + decoder->setData(buffer.get(), true); + if (!decoder->isSizeAvailable()) return WebVector<WebImage>(); // Frames are arranged by decreasing size, then decreasing bit depth. // Keep the first frame at every size, has the highest bit depth. - const size_t frameCount = source.frameCount(); + const size_t frameCount = decoder->frameCount(); IntSize lastSize; Vector<WebImage> frames; for (size_t i = 0; i < std::min(frameCount, maxFrameCount); ++i) { - const IntSize frameSize = source.frameSizeAtIndex(i); + const IntSize frameSize = decoder->frameSizeAtIndex(i); if (frameSize == lastSize) continue; lastSize = frameSize; - OwnPtr<NativeImageSkia> frame = adoptPtr(source.createFrameAtIndex(i)); - if (frame) - frames.append(WebImage(frame->bitmap())); + ImageFrame* frame = decoder->frameBufferAtIndex(i); + if (!frame) + continue; + + OwnPtr<NativeImageSkia> image = adoptPtr(frame->asNewNativeImage()); + if (image.get()) + frames.append(WebImage(image->bitmap())); } return frames; diff --git a/Source/WebKit/chromium/src/WebPluginScrollbarImpl.cpp b/Source/WebKit/chromium/src/WebPluginScrollbarImpl.cpp index f34dbfdc7..b993a1348 100644 --- a/Source/WebKit/chromium/src/WebPluginScrollbarImpl.cpp +++ b/Source/WebKit/chromium/src/WebPluginScrollbarImpl.cpp @@ -268,6 +268,16 @@ bool WebPluginScrollbarImpl::handleInputEvent(const WebInputEvent& event) return false; } +bool WebPluginScrollbarImpl::isAlphaLocked() const +{ + return m_scrollbar->isAlphaLocked(); +} + +void WebPluginScrollbarImpl::setIsAlphaLocked(bool flag) +{ + return m_scrollbar->setIsAlphaLocked(flag); +} + bool WebPluginScrollbarImpl::onMouseDown(const WebInputEvent& event) { WebMouseEvent mousedown = *static_cast<const WebMouseEvent*>(&event); diff --git a/Source/WebKit/chromium/src/WebPluginScrollbarImpl.h b/Source/WebKit/chromium/src/WebPluginScrollbarImpl.h index 43e3fd7b2..90ba94172 100644 --- a/Source/WebKit/chromium/src/WebPluginScrollbarImpl.h +++ b/Source/WebKit/chromium/src/WebPluginScrollbarImpl.h @@ -82,6 +82,8 @@ public: virtual void scroll(ScrollDirection, ScrollGranularity, float multiplier) OVERRIDE; virtual void paint(WebCanvas*, const WebRect&) OVERRIDE; virtual bool handleInputEvent(const WebInputEvent&) OVERRIDE; + virtual bool isAlphaLocked() const OVERRIDE; + virtual void setIsAlphaLocked(bool) OVERRIDE; private: bool onMouseDown(const WebInputEvent&); diff --git a/Source/WebKit/chromium/src/WebRuntimeFeatures.cpp b/Source/WebKit/chromium/src/WebRuntimeFeatures.cpp index bbd71bc82..bcdba86c1 100644 --- a/Source/WebKit/chromium/src/WebRuntimeFeatures.cpp +++ b/Source/WebKit/chromium/src/WebRuntimeFeatures.cpp @@ -368,6 +368,24 @@ bool WebRuntimeFeatures::isPeerConnectionEnabled() #endif } +void WebRuntimeFeatures::enableDeprecatedPeerConnection(bool enable) +{ +#if ENABLE(MEDIA_STREAM) + RuntimeEnabledFeatures::setDeprecatedPeerConnectionEnabled(enable); +#else + UNUSED_PARAM(enable); +#endif +} + +bool WebRuntimeFeatures::isDeprecatedPeerConnectionEnabled() +{ +#if ENABLE(MEDIA_STREAM) + return RuntimeEnabledFeatures::deprecatedPeerConnectionEnabled(); +#else + return false; +#endif +} + void WebRuntimeFeatures::enableFullScreenAPI(bool enable) { #if ENABLE(FULLSCREEN_API) diff --git a/Source/WebKit/chromium/src/WebScrollbarThemeClientImpl.cpp b/Source/WebKit/chromium/src/WebScrollbarThemeClientImpl.cpp index 68c9458d0..f160e5776 100644 --- a/Source/WebKit/chromium/src/WebScrollbarThemeClientImpl.cpp +++ b/Source/WebKit/chromium/src/WebScrollbarThemeClientImpl.cpp @@ -218,4 +218,14 @@ bool WebScrollbarThemeClientImpl::isOverlayScrollbar() const return m_scrollbar->isOverlay(); } +bool WebScrollbarThemeClientImpl::isAlphaLocked() const +{ + return m_scrollbar->isAlphaLocked(); +} + +void WebScrollbarThemeClientImpl::setIsAlphaLocked(bool flag) +{ + m_scrollbar->setIsAlphaLocked(flag); +} + } // namespace WebKit diff --git a/Source/WebKit/chromium/src/WebScrollbarThemeClientImpl.h b/Source/WebKit/chromium/src/WebScrollbarThemeClientImpl.h index b3a6ac956..48f967177 100644 --- a/Source/WebKit/chromium/src/WebScrollbarThemeClientImpl.h +++ b/Source/WebKit/chromium/src/WebScrollbarThemeClientImpl.h @@ -78,6 +78,8 @@ public: virtual bool enabled() const OVERRIDE; virtual void setEnabled(bool) OVERRIDE; virtual bool isOverlayScrollbar() const OVERRIDE; + virtual bool isAlphaLocked() const OVERRIDE; + virtual void setIsAlphaLocked(bool) OVERRIDE; private: WebKit::WebScrollbar* m_scrollbar; diff --git a/Source/WebKit/chromium/src/WebViewImpl.cpp b/Source/WebKit/chromium/src/WebViewImpl.cpp index 97416e024..764ae6dca 100644 --- a/Source/WebKit/chromium/src/WebViewImpl.cpp +++ b/Source/WebKit/chromium/src/WebViewImpl.cpp @@ -682,6 +682,7 @@ void WebViewImpl::scrollBy(const WebCore::IntPoint& delta) #if ENABLE(GESTURE_EVENTS) bool WebViewImpl::handleGestureEvent(const WebGestureEvent& event) { + bool eventSwallowed = false; switch (event.type) { case WebInputEvent::GestureFlingStart: { m_client->cancelScheduledContentIntents(); @@ -692,18 +693,21 @@ bool WebViewImpl::handleGestureEvent(const WebGestureEvent& event) OwnPtr<PlatformGestureCurve> flingCurve = PlatformGestureCurveFactory::get()->createCurve(event.data.flingStart.sourceDevice, FloatPoint(event.data.flingStart.velocityX, event.data.flingStart.velocityY)); m_gestureAnimation = ActivePlatformGestureAnimation::create(flingCurve.release(), this); scheduleAnimation(); - return true; + eventSwallowed = true; + break; } case WebInputEvent::GestureFlingCancel: if (m_gestureAnimation) { m_gestureAnimation.clear(); - return true; + eventSwallowed = true; } - return false; + break; case WebInputEvent::GestureTap: { m_client->cancelScheduledContentIntents(); - if (detectContentOnTouch(WebPoint(event.x, event.y), event.type)) - return true; + if (detectContentOnTouch(WebPoint(event.x, event.y), event.type)) { + eventSwallowed = true; + break; + } RefPtr<WebCore::PopupContainer> selectPopup; selectPopup = m_selectPopup; @@ -716,12 +720,14 @@ bool WebViewImpl::handleGestureEvent(const WebGestureEvent& event) findGoodTouchTargets(boundingBox, mainFrameImpl()->frame(), pageScaleFactor(), goodTargets); // FIXME: replace touch adjustment code when numberOfGoodTargets == 1? // Single candidate case is currently handled by: https://bugs.webkit.org/show_bug.cgi?id=85101 - if (goodTargets.size() >= 2 && m_client && m_client->didTapMultipleTargets(event, goodTargets)) - return true; + if (goodTargets.size() >= 2 && m_client && m_client->didTapMultipleTargets(event, goodTargets)) { + eventSwallowed = true; + break; + } } PlatformGestureEventBuilder platformEvent(mainFrameImpl()->frameView(), event); - bool gestureHandled = mainFrameImpl()->frame()->eventHandler()->handleGestureEvent(platformEvent); + eventSwallowed = mainFrameImpl()->frame()->eventHandler()->handleGestureEvent(platformEvent); if (m_selectPopup && m_selectPopup == selectPopup) { // That tap triggered a select popup which is the same as the one that @@ -731,23 +737,26 @@ bool WebViewImpl::handleGestureEvent(const WebGestureEvent& event) hideSelectPopup(); } - return gestureHandled; + break; } case WebInputEvent::GestureTwoFingerTap: case WebInputEvent::GestureLongPress: { if (!mainFrameImpl() || !mainFrameImpl()->frameView()) - return false; + break; m_client->cancelScheduledContentIntents(); - if (detectContentOnTouch(WebPoint(event.x, event.y), event.type)) - return true; + if (detectContentOnTouch(WebPoint(event.x, event.y), event.type)) { + eventSwallowed = true; + break; + } m_page->contextMenuController()->clearContextMenu(); m_contextMenuAllowed = true; PlatformGestureEventBuilder platformEvent(mainFrameImpl()->frameView(), event); - bool handled = mainFrameImpl()->frame()->eventHandler()->sendContextMenuEventForGesture(platformEvent); + eventSwallowed = mainFrameImpl()->frame()->eventHandler()->sendContextMenuEventForGesture(platformEvent); m_contextMenuAllowed = false; - return handled; + + break; } case WebInputEvent::GestureTapDown: { m_client->cancelScheduledContentIntents(); @@ -757,7 +766,8 @@ bool WebViewImpl::handleGestureEvent(const WebGestureEvent& event) enableTouchHighlight(IntPoint(event.x, event.y)); #endif PlatformGestureEventBuilder platformEvent(mainFrameImpl()->frameView(), event); - return mainFrameImpl()->frame()->eventHandler()->handleGestureEvent(platformEvent); + eventSwallowed = mainFrameImpl()->frame()->eventHandler()->handleGestureEvent(platformEvent); + break; } case WebInputEvent::GestureDoubleTap: case WebInputEvent::GestureScrollBegin: @@ -769,12 +779,14 @@ bool WebViewImpl::handleGestureEvent(const WebGestureEvent& event) case WebInputEvent::GesturePinchEnd: case WebInputEvent::GesturePinchUpdate: { PlatformGestureEventBuilder platformEvent(mainFrameImpl()->frameView(), event); - return mainFrameImpl()->frame()->eventHandler()->handleGestureEvent(platformEvent); + eventSwallowed = mainFrameImpl()->frame()->eventHandler()->handleGestureEvent(platformEvent); + break; } default: ASSERT_NOT_REACHED(); } - return false; + m_client->didHandleGestureEvent(event, eventSwallowed); + return eventSwallowed; } void WebViewImpl::transferActiveWheelFlingAnimation(const WebActiveWheelFlingParameters& parameters) @@ -2223,7 +2235,7 @@ WebTextInputType WebViewImpl::textInputType() return WebTextInputTypeNone; } -bool WebViewImpl::selectionBounds(WebRect& start, WebRect& end) const +bool WebViewImpl::selectionBounds(WebRect& anchor, WebRect& focus) const { const Frame* frame = focusedWebCoreFrame(); if (!frame) @@ -2233,7 +2245,7 @@ bool WebViewImpl::selectionBounds(WebRect& start, WebRect& end) const return false; if (selection->isCaret()) { - start = end = frame->view()->contentsToWindow(selection->absoluteCaretBounds()); + anchor = focus = frame->view()->contentsToWindow(selection->absoluteCaretBounds()); return true; } @@ -2246,20 +2258,20 @@ bool WebViewImpl::selectionBounds(WebRect& start, WebRect& end) const selectedRange->startOffset(), selectedRange->startContainer(), selectedRange->startOffset())); - start = frame->editor()->firstRectForRange(range.get()); + anchor = frame->editor()->firstRectForRange(range.get()); range = Range::create(selectedRange->endContainer()->document(), selectedRange->endContainer(), selectedRange->endOffset(), selectedRange->endContainer(), selectedRange->endOffset()); - end = frame->editor()->firstRectForRange(range.get()); + focus = frame->editor()->firstRectForRange(range.get()); - start = frame->view()->contentsToWindow(start); - end = frame->view()->contentsToWindow(end); + anchor = frame->view()->contentsToWindow(anchor); + focus = frame->view()->contentsToWindow(focus); if (!frame->selection()->selection().isBaseFirst()) - std::swap(start, end); + std::swap(anchor, focus); return true; } diff --git a/Source/WebKit/chromium/src/WebViewImpl.h b/Source/WebKit/chromium/src/WebViewImpl.h index 11a05d0de..865898608 100644 --- a/Source/WebKit/chromium/src/WebViewImpl.h +++ b/Source/WebKit/chromium/src/WebViewImpl.h @@ -167,7 +167,7 @@ public: virtual void extendSelectionAndDelete(int before, int after); virtual bool isSelectionEditable() const; virtual WebColor backgroundColor() const; - virtual bool selectionBounds(WebRect& start, WebRect& end) const; + virtual bool selectionBounds(WebRect& anchor, WebRect& focus) const; virtual bool selectionTextDirection(WebTextDirection& start, WebTextDirection& end) const; virtual bool caretOrSelectionRange(size_t* location, size_t* length); virtual void setTextDirection(WebTextDirection direction); |