summaryrefslogtreecommitdiff
path: root/Source/WebCore/rendering/LayoutState.h
diff options
context:
space:
mode:
authorLorry Tar Creator <lorry-tar-importer@lorry>2015-05-20 09:56:07 +0000
committerLorry Tar Creator <lorry-tar-importer@lorry>2015-05-20 09:56:07 +0000
commit41386e9cb918eed93b3f13648cbef387e371e451 (patch)
treea97f9d7bd1d9d091833286085f72da9d83fd0606 /Source/WebCore/rendering/LayoutState.h
parente15dd966d523731101f70ccf768bba12435a0208 (diff)
downloadWebKitGtk-tarball-41386e9cb918eed93b3f13648cbef387e371e451.tar.gz
webkitgtk-2.4.9webkitgtk-2.4.9
Diffstat (limited to 'Source/WebCore/rendering/LayoutState.h')
-rw-r--r--Source/WebCore/rendering/LayoutState.h42
1 files changed, 28 insertions, 14 deletions
diff --git a/Source/WebCore/rendering/LayoutState.h b/Source/WebCore/rendering/LayoutState.h
index 0fe4fec4f..5471fabf4 100644
--- a/Source/WebCore/rendering/LayoutState.h
+++ b/Source/WebCore/rendering/LayoutState.h
@@ -26,6 +26,7 @@
#ifndef LayoutState_h
#define LayoutState_h
+#include "ColumnInfo.h"
#include "LayoutRect.h"
#include <wtf/HashMap.h>
#include <wtf/Noncopyable.h>
@@ -41,8 +42,7 @@ class RenderObject;
class ShapeInsideInfo;
class LayoutState {
- WTF_MAKE_NONCOPYABLE(LayoutState); WTF_MAKE_FAST_ALLOCATED;
-
+ WTF_MAKE_NONCOPYABLE(LayoutState);
public:
LayoutState()
: m_clipped(false)
@@ -52,18 +52,30 @@ public:
, m_layoutDeltaXSaturated(false)
, m_layoutDeltaYSaturated(false)
#endif
+ , m_columnInfo(nullptr)
+ , m_lineGrid(nullptr)
+#if ENABLE(CSS_SHAPES)
+ , m_shapeInsideInfo(nullptr)
+#endif
+ , m_pageLogicalHeight(0)
+#ifndef NDEBUG
+ , m_renderer(nullptr)
+#endif
{
}
- LayoutState(std::unique_ptr<LayoutState>, RenderBox*, const LayoutSize& offset, LayoutUnit pageHeight, bool pageHeightChanged);
+ LayoutState(std::unique_ptr<LayoutState> state, RenderBox*, const LayoutSize& offset, LayoutUnit pageHeight, bool pageHeightChanged, ColumnInfo*);
explicit LayoutState(RenderObject&);
void clearPaginationInformation();
+ bool isPaginatingColumns() const { return m_columnInfo && m_columnInfo->paginationUnit() == ColumnInfo::Column; }
bool isPaginated() const { return m_isPaginated; }
// The page logical offset is the object's offset from the top of the page in the page progression
// direction (so an x-offset in vertical text and a y-offset for horizontal text).
LayoutUnit pageLogicalOffset(RenderBox*, LayoutUnit childLogicalOffset) const;
+
+ void addForcedColumnBreak(RenderBox*, LayoutUnit childLogicalOffset);
LayoutUnit pageLogicalHeight() const { return m_pageLogicalHeight; }
bool pageLogicalHeightChanged() const { return m_pageLogicalHeightChanged; }
@@ -74,20 +86,19 @@ public:
LayoutSize layoutOffset() const { return m_layoutOffset; }
- LayoutSize pageOffset() const { return m_pageOffset; }
- void setLineGridPaginationOrigin(const LayoutSize& origin) { m_lineGridPaginationOrigin = origin; }
-
bool needsBlockDirectionLocationSetBeforeLayout() const { return m_lineGrid || (m_isPaginated && m_pageLogicalHeight); }
- RenderFlowThread* currentRenderFlowThread() const { return m_currentRenderFlowThread; }
- void setCurrentRenderFlowThread(RenderFlowThread* flowThread) { m_currentRenderFlowThread = flowThread; }
-
+#if ENABLE(CSS_SHAPES)
+ ShapeInsideInfo* shapeInsideInfo() const { return m_shapeInsideInfo; }
+#endif
private:
void propagateLineGridInfo(RenderBox*);
void establishLineGrid(RenderBlockFlow*);
+ void computeLineGridPaginationOrigin(RenderBox*);
+
public:
- // Do not add anything apart from bitfields. See https://bugs.webkit.org/show_bug.cgi?id=100173
+ // Do not add anything apart from bitfields until after m_columnInfo. See https://bugs.webkit.org/show_bug.cgi?id=100173
bool m_clipped : 1;
bool m_isPaginated : 1;
// If our page height has changed, this will force all blocks to relayout.
@@ -97,9 +108,14 @@ public:
bool m_layoutDeltaYSaturated : 1;
#endif
+ // If the enclosing pagination model is a column model, then this will store column information for easy retrieval/manipulation.
+ ColumnInfo* m_columnInfo;
// The current line grid that we're snapping to and the offset of the start of the grid.
- RenderBlockFlow* m_lineGrid { nullptr };
+ RenderBlockFlow* m_lineGrid;
std::unique_ptr<LayoutState> m_next;
+#if ENABLE(CSS_SHAPES)
+ ShapeInsideInfo* m_shapeInsideInfo;
+#endif
// FIXME: Distinguish between the layout clip rect and the paint clip rect which may be larger,
// e.g., because of composited scrolling.
@@ -121,10 +137,8 @@ public:
LayoutSize m_lineGridOffset;
LayoutSize m_lineGridPaginationOrigin;
- RenderFlowThread* m_currentRenderFlowThread { nullptr };
-
#ifndef NDEBUG
- RenderObject* m_renderer { nullptr };
+ RenderObject* m_renderer;
#endif
};