summaryrefslogtreecommitdiffstats
path: root/WebCore/rendering/RenderView.h
diff options
context:
space:
mode:
Diffstat (limited to 'WebCore/rendering/RenderView.h')
-rw-r--r--WebCore/rendering/RenderView.h127
1 files changed, 79 insertions, 48 deletions
diff --git a/WebCore/rendering/RenderView.h b/WebCore/rendering/RenderView.h
index 8145cac..55aa3b4 100644
--- a/WebCore/rendering/RenderView.h
+++ b/WebCore/rendering/RenderView.h
@@ -77,19 +77,6 @@ public:
void selectionStartEnd(int& startPos, int& endPos) const;
bool printing() const;
- void setPrintImages(bool enable) { m_printImages = enable; }
- bool printImages() const { return m_printImages; }
-
- IntRect printRect() const { return m_printRect; }
- void setPrintRect(const IntRect& r) { m_printRect = r; }
-
- void setTruncatedAt(int y) { m_truncatedAt = y; m_bestTruncatedAt = m_truncatorWidth = 0; m_minimumColumnHeight = 0; m_forcedPageBreak = false; }
- void setBestTruncatedAt(int y, RenderBoxModelObject* forRenderer, bool forcedBreak = false);
- void setMinimumColumnHeight(int height) { m_minimumColumnHeight = height; }
- int bestTruncatedAt() const { return m_bestTruncatedAt; }
- int minimumColumnHeight() const { return m_minimumColumnHeight; }
-
- int truncatedAt() const { return m_truncatedAt; }
virtual void absoluteRects(Vector<IntRect>&, int tx, int ty);
virtual void absoluteQuads(Vector<FloatQuad>&);
@@ -125,24 +112,9 @@ public:
bool doingFullRepaint() const { return m_frameView->needsFullRepaint(); }
- void pushLayoutState(RenderBox* renderer, const IntSize& offset)
- {
- if (doingFullRepaint())
- return;
- // We push LayoutState even if layoutState is disabled because it stores layoutDelta too.
- m_layoutState = new (renderArena()) LayoutState(m_layoutState, renderer, offset);
- }
-
+ // Subtree push/pop
void pushLayoutState(RenderObject*);
-
- void popLayoutState()
- {
- if (doingFullRepaint())
- return;
- LayoutState* state = m_layoutState;
- m_layoutState = state->m_next;
- state->destroy(renderArena());
- }
+ void popLayoutState(RenderObject*) { return popLayoutState(); } // Just doing this to keep popLayoutState() private and to make the subtree calls symmetrical.
bool shouldDisableLayoutStateForSubtree(RenderObject*) const;
@@ -159,6 +131,30 @@ public:
virtual void updateHitTestResult(HitTestResult&, const IntPoint&);
+ unsigned pageHeight() const { return m_pageHeight; }
+ void setPageHeight(unsigned height)
+ {
+ if (m_pageHeight != height) {
+ m_pageHeight = height;
+ markDescendantBlocksAndLinesForLayout();
+ }
+ }
+
+ // FIXME: These functions are deprecated. No code should be added that uses these.
+ int bestTruncatedAt() const { return m_legacyPrinting.m_bestTruncatedAt; }
+ void setBestTruncatedAt(int y, RenderBoxModelObject* forRenderer, bool forcedBreak = false);
+ int truncatedAt() const { return m_legacyPrinting.m_truncatedAt; }
+ void setTruncatedAt(int y)
+ {
+ m_legacyPrinting.m_truncatedAt = y;
+ m_legacyPrinting.m_bestTruncatedAt = 0;
+ m_legacyPrinting.m_truncatorWidth = 0;
+ m_legacyPrinting.m_forcedPageBreak = false;
+ }
+ const IntRect& printRect() const { return m_legacyPrinting.m_printRect; }
+ 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();
@@ -182,6 +178,26 @@ public: // used by layout function
int docHeight() const;
int docWidth() const;
+ // These functions may only be accessed by LayoutStateMaintainer.
+ bool pushLayoutState(RenderBox* renderer, const IntSize& offset, int pageHeight = 0, ColumnInfo* colInfo = 0)
+ {
+ // We push LayoutState even if layoutState is disabled because it stores layoutDelta too.
+ if (!doingFullRepaint() || renderer->hasColumns() || m_layoutState->isPaginated()) {
+ m_layoutState = new (renderArena()) LayoutState(m_layoutState, renderer, offset, pageHeight, colInfo);
+ return true;
+ }
+ return false;
+ }
+
+ void popLayoutState()
+ {
+ LayoutState* state = m_layoutState;
+ m_layoutState = state->m_next;
+ state->destroy(renderArena());
+ }
+
+ friend class LayoutStateMaintainer;
+
protected:
FrameView* m_frameView;
@@ -190,22 +206,31 @@ protected:
int m_selectionStartPos;
int m_selectionEndPos;
- // used to ignore viewport width when printing to the printer
- bool m_printImages;
- int m_truncatedAt;
+ // FIXME: Only used by embedded WebViews inside AppKit NSViews. Find a way to remove.
+ struct LegacyPrinting {
+ LegacyPrinting()
+ : m_bestTruncatedAt(0)
+ , m_truncatedAt(0)
+ , m_truncatorWidth(0)
+ , m_forcedPageBreak(false)
+ { }
+
+ int m_bestTruncatedAt;
+ int m_truncatedAt;
+ int m_truncatorWidth;
+ IntRect m_printRect;
+ bool m_forcedPageBreak;
+ };
+ LegacyPrinting m_legacyPrinting;
+ // End deprecated members.
int m_maximalOutlineSize; // Used to apply a fudge factor to dirty-rect checks on blocks/tables.
- IntRect m_printRect; // Used when printing.
typedef HashSet<RenderWidget*> RenderWidgetSet;
-
RenderWidgetSet m_widgets;
-
+
private:
- int m_bestTruncatedAt;
- int m_truncatorWidth;
- int m_minimumColumnHeight;
- bool m_forcedPageBreak;
+ unsigned m_pageHeight;
LayoutState* m_layoutState;
unsigned m_layoutStateDisableCount;
#if USE(ACCELERATED_COMPOSITING)
@@ -233,13 +258,14 @@ void toRenderView(const RenderView*);
class LayoutStateMaintainer : public Noncopyable {
public:
// ctor to push now
- LayoutStateMaintainer(RenderView* view, RenderBox* root, IntSize offset, bool disableState = false)
+ LayoutStateMaintainer(RenderView* view, RenderBox* root, IntSize offset, bool disableState = false, int pageHeight = 0, ColumnInfo* colInfo = 0)
: m_view(view)
, m_disabled(disableState)
, m_didStart(false)
, m_didEnd(false)
+ , m_didCreateLayoutState(false)
{
- push(root, offset);
+ push(root, offset, pageHeight, colInfo);
}
// ctor to maybe push later
@@ -248,6 +274,7 @@ public:
, m_disabled(false)
, m_didStart(false)
, m_didEnd(false)
+ , m_didCreateLayoutState(false)
{
}
@@ -256,12 +283,12 @@ public:
ASSERT(m_didStart == m_didEnd); // if this fires, it means that someone did a push(), but forgot to pop().
}
- void push(RenderBox* root, IntSize offset)
+ void push(RenderBox* root, IntSize offset, int pageHeight = 0, ColumnInfo* colInfo = 0)
{
ASSERT(!m_didStart);
// We push state even if disabled, because we still need to store layoutDelta
- m_view->pushLayoutState(root, offset);
- if (m_disabled)
+ m_didCreateLayoutState = m_view->pushLayoutState(root, offset, pageHeight, colInfo);
+ if (m_disabled && m_didCreateLayoutState)
m_view->disableLayoutState();
m_didStart = true;
}
@@ -270,9 +297,12 @@ public:
{
if (m_didStart) {
ASSERT(!m_didEnd);
- m_view->popLayoutState();
- if (m_disabled)
- m_view->enableLayoutState();
+ if (m_didCreateLayoutState) {
+ m_view->popLayoutState();
+ if (m_disabled)
+ m_view->enableLayoutState();
+ }
+
m_didEnd = true;
}
}
@@ -284,6 +314,7 @@ private:
bool m_disabled : 1; // true if the offset and clip part of layoutState is disabled
bool m_didStart : 1; // true if we did a push or disable
bool m_didEnd : 1; // true if we popped or re-enabled
+ bool m_didCreateLayoutState : 1; // true if we actually made a layout state.
};
} // namespace WebCore