| Index: Source/core/layout/line/BreakingContextInlineHeaders.h
|
| diff --git a/Source/core/layout/line/BreakingContextInlineHeaders.h b/Source/core/layout/line/BreakingContextInlineHeaders.h
|
| index a33c7bb57207c4f5f2262173fe2ab28b993a9ff7..fdb79d72f32ccdc155112a4ece20f86418fee2fb 100644
|
| --- a/Source/core/layout/line/BreakingContextInlineHeaders.h
|
| +++ b/Source/core/layout/line/BreakingContextInlineHeaders.h
|
| @@ -30,6 +30,7 @@
|
| #include "core/layout/LayoutRubyRun.h"
|
| #include "core/layout/LayoutTextCombine.h"
|
| #include "core/layout/TextRunConstructor.h"
|
| +#include "core/layout/api/LineLayoutBox.h"
|
| #include "core/layout/line/InlineIterator.h"
|
| #include "core/layout/line/InlineTextBox.h"
|
| #include "core/layout/line/LayoutTextInfo.h"
|
| @@ -49,7 +50,7 @@ const unsigned cMaxLineDepth = 200;
|
|
|
| class BreakingContext {
|
| public:
|
| - BreakingContext(InlineBidiResolver& resolver, LineInfo& inLineInfo, LineWidth& lineWidth, LayoutTextInfo& inLayoutTextInfo, FloatingObject* inLastFloatFromPreviousLine, bool appliedStartWidth, LayoutBlockFlow* block)
|
| + BreakingContext(InlineBidiResolver& resolver, LineInfo& inLineInfo, LineWidth& lineWidth, LayoutTextInfo& inLayoutTextInfo, FloatingObject* inLastFloatFromPreviousLine, bool appliedStartWidth, LineLayoutBlockFlow block)
|
| : m_resolver(resolver)
|
| , m_current(resolver.position())
|
| , m_lineBreak(resolver.position())
|
| @@ -115,7 +116,7 @@ private:
|
| InlineIterator m_lineBreak;
|
| InlineIterator m_startOfIgnoredSpaces;
|
|
|
| - LayoutBlockFlow* m_block;
|
| + LineLayoutBlockFlow m_block;
|
| LayoutObject* m_lastObject;
|
| LayoutObject* m_nextObject;
|
|
|
| @@ -198,25 +199,25 @@ inline bool requiresLineBox(const InlineIterator& it, const LineInfo& lineInfo =
|
| return notJustWhitespace || isEmptyInline(it.object());
|
| }
|
|
|
| -inline void setStaticPositions(LayoutBlockFlow* block, LayoutBox* child)
|
| +inline void setStaticPositions(LineLayoutBlockFlow block, LayoutBox* child)
|
| {
|
| ASSERT(child->isOutOfFlowPositioned());
|
| // FIXME: The math here is actually not really right. It's a best-guess approximation that
|
| // will work for the common cases
|
| LayoutObject* containerBlock = child->container();
|
| - LayoutUnit blockHeight = block->logicalHeight();
|
| + LayoutUnit blockHeight = block.logicalHeight();
|
| if (containerBlock->isLayoutInline()) {
|
| // A relative positioned inline encloses us. In this case, we also have to determine our
|
| // position as though we were an inline. Set |staticInlinePosition| and |staticBlockPosition| on the relative positioned
|
| // inline so that we can obtain the value later.
|
| - toLayoutInline(containerBlock)->layer()->setStaticInlinePosition(block->startAlignedOffsetForLine(blockHeight, false));
|
| + toLayoutInline(containerBlock)->layer()->setStaticInlinePosition(block.startAlignedOffsetForLine(blockHeight, false));
|
| toLayoutInline(containerBlock)->layer()->setStaticBlockPosition(blockHeight);
|
|
|
| // If |child| is a leading or trailing positioned object this is its only opportunity to ensure it moves with an inline
|
| // container changing width.
|
| child->moveWithEdgeOfInlineContainerIfNecessary(child->isHorizontalWritingMode());
|
| }
|
| - block->updateStaticInlinePositionForChild(*child, blockHeight);
|
| + block.updateStaticInlinePositionForChild(*child, blockHeight);
|
| child->layer()->setStaticBlockPosition(blockHeight);
|
| }
|
|
|
| @@ -233,7 +234,7 @@ inline void BreakingContext::skipTrailingWhitespace(InlineIterator& iterator, co
|
| if (object->isOutOfFlowPositioned())
|
| setStaticPositions(m_block, toLayoutBox(object));
|
| else if (object->isFloating())
|
| - m_block->insertFloatingObject(*toLayoutBox(object));
|
| + m_block.insertFloatingObject(*toLayoutBox(object));
|
| iterator.increment();
|
| }
|
| }
|
| @@ -343,11 +344,11 @@ inline void BreakingContext::handleOutOfFlowPositioned(Vector<LayoutBox*>& posit
|
| LayoutBox* box = toLayoutBox(m_current.object());
|
| bool isInlineType = box->style()->isOriginalDisplayInlineType();
|
| if (!isInlineType) {
|
| - m_block->setStaticInlinePositionForChild(*box, m_block->startOffsetForContent());
|
| + m_block.setStaticInlinePositionForChild(*box, m_block.startOffsetForContent());
|
| } else {
|
| // If our original display was an INLINE type, then we can go ahead
|
| // and determine our static y position now.
|
| - box->layer()->setStaticBlockPosition(m_block->logicalHeight());
|
| + box->layer()->setStaticBlockPosition(m_block.logicalHeight());
|
| }
|
|
|
| // If we're ignoring spaces, we have to stop and include this object and
|
| @@ -367,13 +368,13 @@ inline void BreakingContext::handleOutOfFlowPositioned(Vector<LayoutBox*>& posit
|
| inline void BreakingContext::handleFloat()
|
| {
|
| LayoutBox* floatBox = toLayoutBox(m_current.object());
|
| - FloatingObject* floatingObject = m_block->insertFloatingObject(*floatBox);
|
| + FloatingObject* floatingObject = m_block.insertFloatingObject(*floatBox);
|
| // check if it fits in the current line.
|
| // If it does, position it now, otherwise, position
|
| // it after moving to next line (in newLine() func)
|
| // FIXME: Bug 110372: Properly position multiple stacked floats with non-rectangular shape outside.
|
| - if (m_floatsFitOnLine && m_width.fitsOnLine(m_block->logicalWidthForFloat(*floatingObject).toFloat(), ExcludeWhitespace)) {
|
| - m_block->positionNewFloatOnLine(*floatingObject, m_lastFloatFromPreviousLine, m_lineInfo, m_width);
|
| + if (m_floatsFitOnLine && m_width.fitsOnLine(m_block.logicalWidthForFloat(*floatingObject).toFloat(), ExcludeWhitespace)) {
|
| + m_block.positionNewFloatOnLine(*floatingObject, m_lastFloatFromPreviousLine, m_lineInfo, m_width);
|
| if (m_lineBreak.object() == m_current.object()) {
|
| ASSERT(!m_lineBreak.offset());
|
| m_lineBreak.increment();
|
| @@ -387,7 +388,7 @@ inline void BreakingContext::handleFloat()
|
|
|
| // This is currently just used for list markers and inline flows that have line boxes. Neither should
|
| // have an effect on whitespace at the start of the line.
|
| -inline bool shouldSkipWhitespaceAfterStartObject(LayoutBlockFlow* block, LayoutObject* o, LineMidpointState& lineMidpointState)
|
| +inline bool shouldSkipWhitespaceAfterStartObject(LineLayoutBlockFlow block, LayoutObject* o, LineMidpointState& lineMidpointState)
|
| {
|
| LayoutObject* next = bidiNextSkippingEmptyInlines(block, o);
|
| while (next && next->isFloatingOrOutOfFlowPositioned())
|
| @@ -462,7 +463,7 @@ inline void BreakingContext::handleReplaced()
|
|
|
| // Optimize for a common case. If we can't find whitespace after the list
|
| // item, then this is all moot.
|
| - LayoutUnit replacedLogicalWidth = m_block->logicalWidthForChild(*replacedBox) + m_block->marginStartForChild(*replacedBox) + m_block->marginEndForChild(*replacedBox) + inlineLogicalWidth(m_current.object());
|
| + LayoutUnit replacedLogicalWidth = m_block.logicalWidthForChild(*replacedBox) + m_block.marginStartForChild(*replacedBox) + m_block.marginEndForChild(*replacedBox) + inlineLogicalWidth(m_current.object());
|
| if (m_current.object()->isListMarker()) {
|
| if (m_blockStyle->collapseWhiteSpace() && shouldSkipWhitespaceAfterStartObject(m_block, m_current.object(), m_lineMidpointState)) {
|
| // Like with inline flows, we start ignoring spaces to make sure that any
|
|
|