diff options
Diffstat (limited to 'Source/WebCore/rendering/RenderView.h')
| -rw-r--r-- | Source/WebCore/rendering/RenderView.h | 77 |
1 files changed, 51 insertions, 26 deletions
diff --git a/Source/WebCore/rendering/RenderView.h b/Source/WebCore/rendering/RenderView.h index 99ab1c1a3..09466dec7 100644 --- a/Source/WebCore/rendering/RenderView.h +++ b/Source/WebCore/rendering/RenderView.h @@ -31,8 +31,8 @@ namespace WebCore { class FlowThreadController; -class RenderWidget; class RenderQuote; +class RenderWidget; #if USE(ACCELERATED_COMPOSITING) class RenderLayerCompositor; @@ -44,7 +44,7 @@ class CustomFilterGlobalContext; class RenderView : public RenderBlock { public: - RenderView(Node*, FrameView*); + explicit RenderView(Document*); virtual ~RenderView(); bool hitTest(const HitTestRequest&, HitTestResult&); @@ -61,11 +61,8 @@ public: virtual void layout() OVERRIDE; virtual void updateLogicalWidth() OVERRIDE; virtual void computeLogicalHeight(LayoutUnit logicalHeight, LayoutUnit logicalTop, LogicalExtentComputedValues&) const OVERRIDE; - // FIXME: This override is not needed and should be removed - // it only exists to make computePreferredLogicalWidths public. - virtual void computePreferredLogicalWidths() OVERRIDE; - virtual LayoutUnit availableLogicalHeight() const OVERRIDE; + virtual LayoutUnit availableLogicalHeight(AvailableLogicalHeightType) const OVERRIDE; // The same as the FrameView's layoutHeight/layoutWidth but with null check guards. int viewHeight() const; @@ -77,6 +74,7 @@ public: FrameView* frameView() const { return m_frameView; } + virtual LayoutRect visualOverflowRect() const OVERRIDE; virtual void computeRectForRepaint(const RenderLayerModelObject* repaintContainer, LayoutRect&, bool fixed = false) const OVERRIDE; void repaintViewRectangle(const LayoutRect&, bool immediate = false) const; // Repaint the view, and all composited layers that intersect the given absolute rectangle. @@ -95,6 +93,7 @@ public: RenderObject* selectionEnd() const { return m_selectionEnd; } IntRect selectionBounds(bool clipToVisibleContent = true) const; void selectionStartEnd(int& startPos, int& endPos) const; + void repaintSelection() const; bool printing() const; @@ -161,14 +160,15 @@ public: virtual void updateHitTestResult(HitTestResult&, const LayoutPoint&); - unsigned pageLogicalHeight() const { return m_pageLogicalHeight; } - void setPageLogicalHeight(unsigned height) + LayoutUnit pageLogicalHeight() const { return m_pageLogicalHeight; } + void setPageLogicalHeight(LayoutUnit height) { if (m_pageLogicalHeight != height) { m_pageLogicalHeight = height; m_pageLogicalHeightChanged = true; } } + LayoutUnit pageOrViewLogicalHeight() const; // FIXME: These functions are deprecated. No code should be added that uses these. int bestTruncatedAt() const { return m_legacyPrinting.m_bestTruncatedAt; } @@ -185,10 +185,8 @@ public: void setPrintRect(const IntRect& r) { m_legacyPrinting.m_printRect = r; } // End deprecated functions. - // Notifications that this view became visible in a window, or will be - // removed from the window. - void didMoveOnscreen(); - void willMoveOffscreen(); + // Notification that this view moved into or out of a native window. + void setIsInWindow(bool); #if USE(ACCELERATED_COMPOSITING) RenderLayerCompositor* compositor(); @@ -204,13 +202,13 @@ public: IntRect documentRect() const; + // Renderer that paints the root background has background-images which all have background-attachment: fixed. + bool rootBackgroundIsEntirelyFixed() const; + bool hasRenderNamedFlowThreads() const; + bool checkTwoPassLayoutForAutoHeightRegions() const; FlowThreadController* flowThreadController(); - enum RenderViewLayoutPhase { RenderViewNormalLayout, ConstrainedFlowThreadsLayoutInAutoLogicalHeightRegions }; - bool normalLayoutPhase() const { return m_layoutPhase == RenderViewNormalLayout; } - bool constrainedFlowThreadsLayoutPhase() const { return m_layoutPhase == ConstrainedFlowThreadsLayoutInAutoLogicalHeightRegions; } - void styleDidChange(StyleDifference, const RenderStyle* oldStyle); IntervalArena* intervalArena(); @@ -227,30 +225,37 @@ public: void addRenderCounter() { m_renderCounterCount++; } void removeRenderCounter() { ASSERT(m_renderCounterCount > 0); m_renderCounterCount--; } bool hasRenderCounters() { return m_renderCounterCount; } + + virtual void addChild(RenderObject* newChild, RenderObject* beforeChild = 0) OVERRIDE; + + IntRect pixelSnappedLayoutOverflowRect() const { return pixelSnappedIntRect(layoutOverflowRect()); } protected: - virtual void mapLocalToContainer(const RenderLayerModelObject* repaintContainer, TransformState&, MapCoordinatesFlags = ApplyContainerFlip | SnapOffsetForTransforms, bool* wasFixed = 0) const OVERRIDE; + virtual void mapLocalToContainer(const RenderLayerModelObject* repaintContainer, TransformState&, MapCoordinatesFlags = ApplyContainerFlip, bool* wasFixed = 0) const OVERRIDE; virtual const RenderObject* pushMappingToContainer(const RenderLayerModelObject* ancestorToStopAt, RenderGeometryMap&) const OVERRIDE; virtual void mapAbsoluteToLocalPoint(MapCoordinatesFlags, TransformState&) const; virtual bool requiresColumns(int desiredColumnCount) const OVERRIDE; - + private: + bool initializeLayoutState(LayoutState&); + virtual void calcColumnWidth() OVERRIDE; virtual ColumnInfo::PaginationUnit paginationUnit() const OVERRIDE; bool shouldRepaint(const LayoutRect&) const; // These functions may only be accessed by LayoutStateMaintainer. - void pushLayoutState(RenderFlowThread*, bool regionsChanged); bool pushLayoutState(RenderBox* renderer, const LayoutSize& offset, LayoutUnit pageHeight = 0, bool pageHeightChanged = false, ColumnInfo* colInfo = 0) { // We push LayoutState even if layoutState is disabled because it stores layoutDelta too. - if (!doingFullRepaint() || m_layoutState->isPaginated() || renderer->hasColumns() || renderer->inRenderFlowThread() + if (!doingFullRepaint() || m_layoutState->isPaginated() || renderer->hasColumns() || renderer->flowThreadContainingBlock() || m_layoutState->lineGrid() || (renderer->style()->lineGrid() != RenderStyle::initialLineGrid() && renderer->isBlockFlow()) -#if ENABLE(CSS_EXCLUSIONS) - || (renderer->isRenderBlock() && toRenderBlock(renderer)->exclusionShapeInsideInfo()) +#if ENABLE(CSS_SHAPES) + || (renderer->isRenderBlock() && toRenderBlock(renderer)->shapeInsideInfo()) + || (m_layoutState->shapeInsideInfo() && renderer->isRenderBlock() && !toRenderBlock(renderer)->allowsShapeInsideInfoSharing()) #endif ) { + pushLayoutStateForCurrentFlowThread(renderer); m_layoutState = new (renderArena()) LayoutState(m_layoutState, renderer, offset, pageHeight, pageHeightChanged, colInfo); return true; } @@ -262,6 +267,7 @@ private: LayoutState* state = m_layoutState; m_layoutState = state->m_next; state->destroy(renderArena()); + popLayoutStateForCurrentFlowThread(); } // Suspends the LayoutState optimization. Used under transforms that cannot be represented by @@ -273,12 +279,16 @@ private: void enableLayoutState() { ASSERT(m_layoutStateDisableCount > 0); m_layoutStateDisableCount--; } void layoutContent(const LayoutState&); + void layoutContentInAutoLogicalHeightRegions(const LayoutState&); #ifndef NDEBUG void checkLayoutState(const LayoutState&); #endif size_t getRetainedWidgets(Vector<RenderWidget*>&); void releaseWidgets(Vector<RenderWidget*>&); + + void pushLayoutStateForCurrentFlowThread(const RenderObject*); + void popLayoutStateForCurrentFlowThread(); friend class LayoutStateMaintainer; friend class LayoutStateDisabler; @@ -317,7 +327,7 @@ protected: private: bool shouldUsePrintingLayout() const; - unsigned m_pageLogicalHeight; + LayoutUnit m_pageLogicalHeight; bool m_pageLogicalHeightChanged; LayoutState* m_layoutState; unsigned m_layoutStateDisableCount; @@ -332,18 +342,19 @@ private: RenderQuote* m_renderQuoteHead; unsigned m_renderCounterCount; - RenderViewLayoutPhase m_layoutPhase; + + bool m_selectionWasCaret; }; inline RenderView* toRenderView(RenderObject* object) { - ASSERT(!object || object->isRenderView()); + ASSERT_WITH_SECURITY_IMPLICATION(!object || object->isRenderView()); return static_cast<RenderView*>(object); } inline const RenderView* toRenderView(const RenderObject* object) { - ASSERT(!object || object->isRenderView()); + ASSERT_WITH_SECURITY_IMPLICATION(!object || object->isRenderView()); return static_cast<const RenderView*>(object); } @@ -438,6 +449,20 @@ private: RenderView* m_view; }; +class FragmentationDisabler { + WTF_MAKE_NONCOPYABLE(FragmentationDisabler); +public: + FragmentationDisabler(RenderObject* root); + ~FragmentationDisabler(); +private: + RenderObject* m_root; + RenderObject::FlowThreadState m_flowThreadState; + bool m_fragmenting; +#ifndef NDEBUG + LayoutState* m_layoutState; +#endif +}; + } // namespace WebCore #endif // RenderView_h |
