diff options
Diffstat (limited to 'WebCore')
-rw-r--r-- | WebCore/page/EventHandler.cpp | 14 | ||||
-rw-r--r-- | WebCore/platform/graphics/android/LayerAndroid.h | 4 | ||||
-rw-r--r-- | WebCore/platform/graphics/android/android_graphics.cpp | 2 | ||||
-rw-r--r-- | WebCore/platform/graphics/android/android_graphics.h | 1 | ||||
-rw-r--r-- | WebCore/rendering/RenderBox.cpp | 8 | ||||
-rw-r--r-- | WebCore/rendering/RenderLayer.cpp | 26 | ||||
-rw-r--r-- | WebCore/rendering/RenderLayerCompositor.cpp | 15 |
7 files changed, 33 insertions, 37 deletions
diff --git a/WebCore/page/EventHandler.cpp b/WebCore/page/EventHandler.cpp index 89e9424..e2fab6e 100644 --- a/WebCore/page/EventHandler.cpp +++ b/WebCore/page/EventHandler.cpp @@ -1257,7 +1257,14 @@ bool EventHandler::handleMousePressEvent(const PlatformMouseEvent& mouseEvent) } m_mouseDownWasInSubframe = false; +#if ENABLE(COMPOSITED_FIXED_ELEMENTS) + // Add IgnoreClipping because fixed position elements are moved only on the + // UI thread. Nodes in fixed position elements are clipped out by the view + // without IgnoreClipping. + HitTestRequest request(HitTestRequest::Active | HitTestRequest::IgnoreClipping); +#else HitTestRequest request(HitTestRequest::Active); +#endif // Save the document point we generate in case the window coordinate is invalidated by what happens // when we dispatch the event. IntPoint documentPoint = documentPointForWindowPoint(m_frame, mouseEvent.pos()); @@ -1575,7 +1582,14 @@ bool EventHandler::handleMouseReleaseEvent(const PlatformMouseEvent& mouseEvent) return m_lastScrollbarUnderMouse->mouseUp(); } +#if ENABLE(COMPOSITED_FIXED_ELEMENTS) + // Add IgnoreClipping because fixed position elements are moved only on the + // UI thread. Nodes in fixed position elements are clipped out by the view + // without IgnoreClipping. + HitTestRequest request(HitTestRequest::MouseUp | HitTestRequest::IgnoreClipping); +#else HitTestRequest request(HitTestRequest::MouseUp); +#endif MouseEventWithHitTestResults mev = prepareMouseEvent(request, mouseEvent); Frame* subframe = m_capturingMouseEventsNode.get() ? subframeForTargetNode(m_capturingMouseEventsNode.get()) : subframeForHitTestResult(mev); if (m_eventHandlerWillResetCapturingMouseEventsNode) diff --git a/WebCore/platform/graphics/android/LayerAndroid.h b/WebCore/platform/graphics/android/LayerAndroid.h index b74a8c8..712d699 100644 --- a/WebCore/platform/graphics/android/LayerAndroid.h +++ b/WebCore/platform/graphics/android/LayerAndroid.h @@ -135,6 +135,10 @@ public: void setForegroundClip(const SkRect& clip) { m_foregroundClip = clip; } + + // Return the foreground clip offset by the position of the layer. + SkRect foregroundClip() const { return m_foregroundClip; } + bool contentIsScrollable() const; // Returns true if the content position has changed. diff --git a/WebCore/platform/graphics/android/android_graphics.cpp b/WebCore/platform/graphics/android/android_graphics.cpp index fafd3df..a5dafda 100644 --- a/WebCore/platform/graphics/android/android_graphics.cpp +++ b/WebCore/platform/graphics/android/android_graphics.cpp @@ -140,7 +140,9 @@ bool CursorRing::setup() m_rings.clear(); m_rings.append(m_bounds); } + m_absBounds = m_node->bounds(m_frame); m_bounds.inflate(SkScalarCeil(CURSOR_RING_OUTER_DIAMETER)); + m_absBounds.inflate(SkScalarCeil(CURSOR_RING_OUTER_DIAMETER)); if (!m_node->hasCursorRing() || (m_node->isPlugin() && m_node->isFocus())) return false; m_flavor = NORMAL_FLAVOR; diff --git a/WebCore/platform/graphics/android/android_graphics.h b/WebCore/platform/graphics/android/android_graphics.h index dbf1978..46c60e8 100644 --- a/WebCore/platform/graphics/android/android_graphics.h +++ b/WebCore/platform/graphics/android/android_graphics.h @@ -71,6 +71,7 @@ private: WebViewCore* m_viewImpl; // copy for convenience WTF::Vector<IntRect> m_rings; IntRect m_bounds; + IntRect m_absBounds; const CachedRoot* m_root; const CachedFrame* m_frame; const CachedNode* m_node; diff --git a/WebCore/rendering/RenderBox.cpp b/WebCore/rendering/RenderBox.cpp index 8d18440..2deeffc 100644 --- a/WebCore/rendering/RenderBox.cpp +++ b/WebCore/rendering/RenderBox.cpp @@ -73,10 +73,6 @@ bool RenderBox::s_hadOverflowClip = false; RenderBox::RenderBox(Node* node) : RenderBoxModelObject(node) -#ifdef ANDROID_LAYOUT - , m_visibleWidth(0) - , m_isVisibleWidthChangedBeforeLayout(false) -#endif , m_marginLeft(0) , m_marginRight(0) , m_marginTop(0) @@ -84,6 +80,10 @@ RenderBox::RenderBox(Node* node) , m_minPrefWidth(-1) , m_maxPrefWidth(-1) , m_inlineBoxWrapper(0) +#ifdef ANDROID_LAYOUT + , m_visibleWidth(0) + , m_isVisibleWidthChangedBeforeLayout(false) +#endif { setIsBox(); } diff --git a/WebCore/rendering/RenderLayer.cpp b/WebCore/rendering/RenderLayer.cpp index f0c6333..368a1a7 100644 --- a/WebCore/rendering/RenderLayer.cpp +++ b/WebCore/rendering/RenderLayer.cpp @@ -3238,16 +3238,18 @@ void RenderLayer::calculateRects(const RenderLayer* rootLayer, const IntRect& pa if (renderer()->hasOverflowClip() || renderer()->hasClip()) { // This layer establishes a clip of some kind. #if ENABLE(ANDROID_OVERFLOW_SCROLL) - if (renderer()->hasOverflowClip()) { + if (renderer()->hasOverflowClip() && + !m_scrollDimensionsDirty && + (m_scrollWidth > renderBox()->clientWidth() || + m_scrollHeight > renderBox()->clientHeight())) { RenderBox* box = toRenderBox(renderer()); layerBounds = backgroundRect = foregroundRect = outlineRect = IntRect(x, y, box->borderLeft() + box->borderRight() + m_scrollWidth, box->borderTop() + box->borderBottom() + m_scrollHeight); - } -#else + } else +#endif if (renderer()->hasOverflowClip()) foregroundRect.intersect(toRenderBox(renderer())->overflowClipRect(x, y)); -#endif if (renderer()->hasClip()) { // Clip applies to *us* as well, so go ahead and update the damageRect. IntRect newPosClip = toRenderBox(renderer())->clipRect(x, y); @@ -3757,24 +3759,10 @@ bool RenderLayer::shouldBeNormalFlowOnly() const && !isTransparent(); } -#if ENABLE(ANDROID_OVERFLOW_SCROLL) -static bool hasOverflowScroll(const RenderLayer* layer) -{ - RenderBox* box = layer->renderBox(); - if (!box || !box->node() || !box->node()->hasTagName(HTMLNames::divTag)) - return false; - EOverflow x = box->style()->overflowX(); - EOverflow y = box->style()->overflowY(); - return (x == OAUTO || x == OSCROLL || y == OAUTO || y == OSCROLL) && - (box->scrollWidth() > box->clientWidth() || - box->scrollHeight() > box->clientHeight()); -} -#endif - bool RenderLayer::isSelfPaintingLayer() const { #if ENABLE(ANDROID_OVERFLOW_SCROLL) - if (hasOverflowScroll(this)) + if (renderer()->hasOverflowClip()) return true; #endif return !isNormalFlowOnly() || renderer()->hasReflection() || renderer()->hasMask() || renderer()->isTableRow() || renderer()->isVideo() || renderer()->isEmbeddedObject() || renderer()->isRenderIFrame(); diff --git a/WebCore/rendering/RenderLayerCompositor.cpp b/WebCore/rendering/RenderLayerCompositor.cpp index 46278a2..f6e1442 100644 --- a/WebCore/rendering/RenderLayerCompositor.cpp +++ b/WebCore/rendering/RenderLayerCompositor.cpp @@ -1155,19 +1155,6 @@ bool RenderLayerCompositor::requiresCompositingForMobileSites(const RenderLayer* } #endif -#if ENABLE(ANDROID_OVERFLOW_SCROLL) -static bool requiresCompositingForOverflowScroll(const RenderLayer* layer) { - RenderBox* box = layer->renderBox(); - if (!box || !box->node()->hasTagName(HTMLNames::divTag)) - return false; - EOverflow x = box->style()->overflowX(); - EOverflow y = box->style()->overflowY(); - return (x == OAUTO || x == OSCROLL || y == OAUTO || y == OSCROLL) && - (box->scrollWidth() > box->clientWidth() || - box->scrollHeight() > box->clientHeight()); -} -#endif - // Note: this specifies whether the RL needs a compositing layer for intrinsic reasons. // Use needsToBeComposited() to determine if a RL actually needs a compositing layer. // static @@ -1183,7 +1170,7 @@ bool RenderLayerCompositor::requiresCompositingLayer(const RenderLayer* layer) c #if PLATFORM(ANDROID) || requiresCompositingForMobileSites(layer) #if ENABLE(ANDROID_OVERFLOW_SCROLL) - || requiresCompositingForOverflowScroll(layer) + || renderer->hasOverflowClip() #endif #endif || requiresCompositingForVideo(renderer) |