diff options
Diffstat (limited to 'Source/WebCore/rendering/line/LineWidth.h')
-rw-r--r-- | Source/WebCore/rendering/line/LineWidth.h | 59 |
1 files changed, 33 insertions, 26 deletions
diff --git a/Source/WebCore/rendering/line/LineWidth.h b/Source/WebCore/rendering/line/LineWidth.h index 11d7ae499..93e4d355d 100644 --- a/Source/WebCore/rendering/line/LineWidth.h +++ b/Source/WebCore/rendering/line/LineWidth.h @@ -27,8 +27,7 @@ * OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef LineWidth_h -#define LineWidth_h +#pragma once #include "LayoutUnit.h" @@ -58,43 +57,51 @@ public: float committedWidth() const { return m_committedWidth; } float availableWidth() const { return m_availableWidth; } float logicalLeftOffset() const { return m_left; } + + bool hasCommitted() const { return m_hasCommitted; } + bool hasCommittedReplaced() const { return m_hasCommittedReplaced; } void updateAvailableWidth(LayoutUnit minimumHeight = 0); - void shrinkAvailableWidthForNewFloatIfNeeded(FloatingObject*); - void addUncommittedWidth(float delta) { m_uncommittedWidth += delta; } + void shrinkAvailableWidthForNewFloatIfNeeded(const FloatingObject&); + void addUncommittedWidth(float delta) + { + m_uncommittedWidth += delta; + } + void addUncommittedReplacedWidth(float delta) + { + addUncommittedWidth(delta); + m_hasUncommittedReplaced = true; + } void commit(); void applyOverhang(RenderRubyRun*, RenderObject* startRenderer, RenderObject* endRenderer); - void fitBelowFloats(); + void fitBelowFloats(bool isFirstLine = false); void setTrailingWhitespaceWidth(float collapsedWhitespace, float borderPaddingMargin = 0); - -#if ENABLE(CSS_SHAPES) - void updateCurrentShapeSegment(); -#endif - - bool shouldIndentText() const { return m_shouldIndentText == IndentText; } + IndentTextOrNot shouldIndentText() const { return m_shouldIndentText; } + + bool isFirstLine() const { return m_isFirstLine; } private: void computeAvailableWidthFromLeftAndRight(); bool fitsOnLineExcludingTrailingCollapsedWhitespace() const; + void updateLineDimension(LayoutUnit newLineTop, LayoutUnit newLineWidth, float newLineLeft, float newLineRight); + void wrapNextToShapeOutside(bool isFirstLine); RenderBlockFlow& m_block; - float m_uncommittedWidth; - float m_committedWidth; - float m_overhangWidth; // The amount by which |m_availableWidth| has been inflated to account for possible contraction due to ruby overhang. - float m_trailingWhitespaceWidth; - float m_trailingCollapsedWhitespaceWidth; - float m_left; - float m_right; - float m_availableWidth; -#if ENABLE(CSS_SHAPES) - const LineSegment* m_segment; -#endif - bool m_isFirstLine; + float m_uncommittedWidth { 0 }; + float m_committedWidth { 0 }; + float m_overhangWidth { 0 }; // The amount by which |m_availableWidth| has been inflated to account for possible contraction due to ruby overhang. + float m_trailingWhitespaceWidth { 0 }; + float m_trailingCollapsedWhitespaceWidth { 0 }; + float m_left { 0 }; + float m_right { 0 }; + float m_availableWidth { 0 }; + bool m_isFirstLine { true }; + bool m_hasCommitted { false }; + bool m_hasCommittedReplaced { false }; + bool m_hasUncommittedReplaced { false }; IndentTextOrNot m_shouldIndentText; }; IndentTextOrNot requiresIndent(bool isFirstLine, bool isAfterHardLineBreak, const RenderStyle&); -} - -#endif // LineWidth_h +} // namespace WebCore |