diff options
Diffstat (limited to 'WebCore/rendering/RenderLayer.h')
-rw-r--r-- | WebCore/rendering/RenderLayer.h | 90 |
1 files changed, 73 insertions, 17 deletions
diff --git a/WebCore/rendering/RenderLayer.h b/WebCore/rendering/RenderLayer.h index 2c8d184..be3ddc6 100644 --- a/WebCore/rendering/RenderLayer.h +++ b/WebCore/rendering/RenderLayer.h @@ -47,22 +47,17 @@ #include "RenderBox.h" #include "ScrollBehavior.h" #include "ScrollbarClient.h" -#include "Timer.h" #include <wtf/OwnPtr.h> namespace WebCore { -class CachedResource; class HitTestRequest; class HitTestResult; class HitTestingTransformState; -class RenderFrameSet; class RenderMarquee; class RenderReplica; class RenderScrollbarPart; class RenderStyle; -class RenderTable; -class RenderText; class RenderView; class Scrollbar; class TransformationMatrix; @@ -84,6 +79,9 @@ public: : m_overflowClipRect(r) , m_fixedClipRect(r) , m_posClipRect(r) +#if ENABLE(ANDROID_OVERFLOW_SCROLL) + , m_hitTestClip(r) +#endif , m_refCnt(0) , m_fixed(false) { @@ -93,6 +91,9 @@ public: : m_overflowClipRect(other.overflowClipRect()) , m_fixedClipRect(other.fixedClipRect()) , m_posClipRect(other.posClipRect()) +#if ENABLE(ANDROID_OVERFLOW_SCROLL) + , m_hitTestClip(other.hitTestClip()) +#endif , m_refCnt(0) , m_fixed(other.fixed()) { @@ -103,6 +104,9 @@ public: m_overflowClipRect = r; m_fixedClipRect = r; m_posClipRect = r; +#if ENABLE(ANDROID_OVERFLOW_SCROLL) + m_hitTestClip = r; +#endif m_fixed = false; } @@ -114,6 +118,10 @@ public: const IntRect& posClipRect() const { return m_posClipRect; } void setPosClipRect(const IntRect& r) { m_posClipRect = r; } +#if ENABLE(ANDROID_OVERFLOW_SCROLL) + const IntRect& hitTestClip() const { return m_hitTestClip; } + void setHitTestClip(const IntRect& r) { m_hitTestClip = r; } +#endif bool fixed() const { return m_fixed; } void setFixed(bool fixed) { m_fixed = fixed; } @@ -145,8 +153,6 @@ public: m_fixed = other.fixed(); return *this; } - - static IntRect infiniteRect() { return IntRect(INT_MIN/2, INT_MIN/2, INT_MAX, INT_MAX); } private: // The normal operator new is disallowed on all render objects. @@ -156,6 +162,9 @@ private: IntRect m_overflowClipRect; IntRect m_fixedClipRect; IntRect m_posClipRect; +#if ENABLE(ANDROID_OVERFLOW_SCROLL) + IntRect m_hitTestClip; +#endif unsigned m_refCnt : 31; bool m_fixed : 1; }; @@ -227,6 +236,8 @@ public: int width() const { return m_width; } int height() const { return m_height; } + IntSize size() const { return IntSize(m_width, m_height); } + void setWidth(int w) { m_width = w; } void setHeight(int h) { m_height = h; } @@ -237,8 +248,7 @@ public: // Scrolling methods for layers that can scroll their overflow. void scrollByRecursively(int xDelta, int yDelta); - void addScrolledContentOffset(int& x, int& y) const; - void subtractScrolledContentOffset(int& x, int& y) const; + IntSize scrolledContentOffset() const { return IntSize(scrollXOffset() + m_scrollLeftOverflow, scrollYOffset()); } int scrollXOffset() const { return m_scrollX + m_scrollOriginX; } @@ -264,6 +274,10 @@ public: int horizontalScrollbarHeight() const; bool hasOverflowControls() const; +#if ENABLE(ANDROID_OVERFLOW_SCROLL) + bool hasOverflowScroll() const; + bool hasOverflowParent() const; +#endif void positionOverflowControls(int tx, int ty); bool isPointInResizeControl(const IntPoint& absolutePoint) const; bool hitTestOverflowControls(HitTestResult&, const IntPoint& localPoint); @@ -275,7 +289,7 @@ public: void updateScrollInfoAfterLayout(); - bool scroll(ScrollDirection, ScrollGranularity, float multiplier = 1.0f); + bool scroll(ScrollDirection, ScrollGranularity, float multiplier = 1); void autoscroll(); void resize(const PlatformMouseEvent&, const IntSize&); @@ -302,9 +316,10 @@ public: CheckForRepaint = 1 << 1, IsCompositingUpdateRoot = 1 << 2, UpdateCompositingLayers = 1 << 3, + UpdatePagination = 1 << 4 }; typedef unsigned UpdateLayerPositionsFlags; - void updateLayerPositions(UpdateLayerPositionsFlags = DoFullRepaint | IsCompositingUpdateRoot | UpdateCompositingLayers); + void updateLayerPositions(UpdateLayerPositionsFlags = DoFullRepaint | IsCompositingUpdateRoot | UpdateCompositingLayers, IntPoint* cachedOffset = 0); void updateTransform(); @@ -325,11 +340,19 @@ public: bool isFixed() const { return renderer()->isPositioned() && renderer()->style()->position() == FixedPosition; } // If fixed elements are composited, they will be containing children bool isStackingContext() const { +#if ENABLE(ANDROID_OVERFLOW_SCROLL) + if (hasOverflowScroll()) + return true; +#endif return !hasAutoZIndex() || renderer()->isRenderView() || (isComposited() && isFixed()); } #else +#if ENABLE(ANDROID_OVERFLOW_SCROLL) + bool isStackingContext() const { return !hasAutoZIndex() || renderer()->isRenderView() || hasOverflowScroll(); } +#else bool isStackingContext() const { return !hasAutoZIndex() || renderer()->isRenderView() ; } #endif +#endif void dirtyZOrderLists(); void dirtyStackingContextZOrderLists(); @@ -401,7 +424,9 @@ public: // Return a cached repaint rect, computed relative to the layer renderer's containerForRepaint. IntRect repaintRect() const { return m_repaintRect; } + IntRect repaintRectIncludingDescendants() const; void computeRepaintRects(); + void updateRepaintRectsAfterScroll(bool fixed = false); void setNeedsFullRepaint(bool f = true) { m_needsFullRepaint = f; } int staticX() const { return m_staticX; } @@ -483,13 +508,36 @@ private: typedef unsigned PaintLayerFlags; void paintLayer(RenderLayer* rootLayer, GraphicsContext*, const IntRect& paintDirtyRect, - PaintBehavior, RenderObject* paintingRoot, RenderObject::OverlapTestRequestMap* = 0, - PaintLayerFlags paintFlags = 0); + PaintBehavior, RenderObject* paintingRoot, OverlapTestRequestMap* = 0, + PaintLayerFlags = 0); + void paintList(Vector<RenderLayer*>*, RenderLayer* rootLayer, GraphicsContext* p, + const IntRect& paintDirtyRect, PaintBehavior, + RenderObject* paintingRoot, OverlapTestRequestMap*, + PaintLayerFlags); + void paintPaginatedChildLayer(RenderLayer* childLayer, RenderLayer* rootLayer, GraphicsContext*, + const IntRect& paintDirtyRect, PaintBehavior, + RenderObject* paintingRoot, OverlapTestRequestMap*, + PaintLayerFlags); + void paintChildLayerIntoColumns(RenderLayer* childLayer, RenderLayer* rootLayer, GraphicsContext*, + const IntRect& paintDirtyRect, PaintBehavior, + RenderObject* paintingRoot, OverlapTestRequestMap*, + PaintLayerFlags, const Vector<RenderLayer*>& columnLayers, size_t columnIndex); RenderLayer* hitTestLayer(RenderLayer* rootLayer, RenderLayer* containerLayer, const HitTestRequest& request, HitTestResult& result, - const IntRect& hitTestRect, const IntPoint& hitTestPoint, bool appliedTransform, - const HitTestingTransformState* transformState = 0, double* zOffset = 0); - + const IntRect& hitTestRect, const IntPoint& hitTestPoint, bool appliedTransform, + const HitTestingTransformState* transformState = 0, double* zOffset = 0); + RenderLayer* hitTestList(Vector<RenderLayer*>*, RenderLayer* rootLayer, const HitTestRequest& request, HitTestResult& result, + const IntRect& hitTestRect, const IntPoint& hitTestPoint, + const HitTestingTransformState* transformState, double* zOffsetForDescendants, double* zOffset, + const HitTestingTransformState* unflattenedTransformState, bool depthSortDescendants); + RenderLayer* hitTestPaginatedChildLayer(RenderLayer* childLayer, RenderLayer* rootLayer, const HitTestRequest& request, HitTestResult& result, + const IntRect& hitTestRect, const IntPoint& hitTestPoint, + const HitTestingTransformState* transformState, double* zOffset); + RenderLayer* hitTestChildLayerColumns(RenderLayer* childLayer, RenderLayer* rootLayer, const HitTestRequest& request, HitTestResult& result, + const IntRect& hitTestRect, const IntPoint& hitTestPoint, + const HitTestingTransformState* transformState, double* zOffset, + const Vector<RenderLayer*>& columnLayers, size_t columnIndex); + PassRefPtr<HitTestingTransformState> createLocalTransformState(RenderLayer* rootLayer, RenderLayer* containerLayer, const IntRect& hitTestRect, const IntPoint& hitTestPoint, const HitTestingTransformState* containerTransformState) const; @@ -501,6 +549,8 @@ private: bool shouldBeNormalFlowOnly() const; // ScrollBarClient interface + virtual int scrollSize(ScrollbarOrientation orientation) const; + virtual void setScrollOffsetFromAnimation(const IntPoint&); virtual void valueChanged(Scrollbar*); virtual void invalidateScrollbarRect(Scrollbar*, const IntRect&); virtual bool isActive() const; @@ -546,6 +596,9 @@ private: void updateScrollCornerStyle(); void updateResizerStyle(); + void updatePagination(); + bool isPaginated() const { return m_isPaginated; } + #if USE(ACCELERATED_COMPOSITING) bool hasCompositingDescendant() const { return m_hasCompositingDescendant; } void setHasCompositingDescendant(bool b) { m_hasCompositingDescendant = b; } @@ -639,6 +692,8 @@ protected: bool m_visibleDescendantStatusDirty : 1; bool m_hasVisibleDescendant : 1; + bool m_isPaginated : 1; // If we think this layer is split by a multi-column ancestor, then this bit will be set. + bool m_3DTransformedDescendantStatusDirty : 1; bool m_has3DTransformedDescendant : 1; // Set on a stacking context layer that has 3D descendants anywhere // in a preserves3D hierarchy. Hint to do 3D-aware hit testing. @@ -674,7 +729,8 @@ private: #ifndef NDEBUG // Outside the WebCore namespace for ease of invocation from gdb. -void showLayerTree(const WebCore::RenderLayer* layer); +void showLayerTree(const WebCore::RenderLayer*); +void showLayerTree(const WebCore::RenderObject*); #endif #endif // RenderLayer_h |