| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2003, 2006, 2007, 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2003, 2006, 2007, 2008 Apple Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * This library is free software; you can redistribute it and/or | 4 * This library is free software; you can redistribute it and/or |
| 5 * modify it under the terms of the GNU Library General Public | 5 * modify it under the terms of the GNU Library General Public |
| 6 * License as published by the Free Software Foundation; either | 6 * License as published by the Free Software Foundation; either |
| 7 * version 2 of the License, or (at your option) any later version. | 7 * version 2 of the License, or (at your option) any later version. |
| 8 * | 8 * |
| 9 * This library is distributed in the hope that it will be useful, | 9 * This library is distributed in the hope that it will be useful, |
| 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 class HitTestResult; | 30 class HitTestResult; |
| 31 class RenderBlockFlow; | 31 class RenderBlockFlow; |
| 32 | 32 |
| 33 struct BidiStatus; | 33 struct BidiStatus; |
| 34 struct GapRects; | 34 struct GapRects; |
| 35 | 35 |
| 36 class RootInlineBox : public InlineFlowBox { | 36 class RootInlineBox : public InlineFlowBox { |
| 37 public: | 37 public: |
| 38 explicit RootInlineBox(RenderBlockFlow&); | 38 explicit RootInlineBox(RenderBlockFlow&); |
| 39 | 39 |
| 40 virtual void destroy() OVERRIDE FINAL; | 40 virtual void destroy() override final; |
| 41 | 41 |
| 42 virtual bool isRootInlineBox() const OVERRIDE FINAL { return true; } | 42 virtual bool isRootInlineBox() const override final { return true; } |
| 43 | 43 |
| 44 void detachEllipsisBox(); | 44 void detachEllipsisBox(); |
| 45 | 45 |
| 46 RootInlineBox* nextRootBox() const { return static_cast<RootInlineBox*>(m_ne
xtLineBox); } | 46 RootInlineBox* nextRootBox() const { return static_cast<RootInlineBox*>(m_ne
xtLineBox); } |
| 47 RootInlineBox* prevRootBox() const { return static_cast<RootInlineBox*>(m_pr
evLineBox); } | 47 RootInlineBox* prevRootBox() const { return static_cast<RootInlineBox*>(m_pr
evLineBox); } |
| 48 | 48 |
| 49 virtual void adjustPosition(float dx, float dy) OVERRIDE FINAL; | 49 virtual void adjustPosition(float dx, float dy) override final; |
| 50 | 50 |
| 51 LayoutUnit lineTop() const { return m_lineTop; } | 51 LayoutUnit lineTop() const { return m_lineTop; } |
| 52 LayoutUnit lineBottom() const { return m_lineBottom; } | 52 LayoutUnit lineBottom() const { return m_lineBottom; } |
| 53 | 53 |
| 54 LayoutUnit lineTopWithLeading() const { return m_lineTopWithLeading; } | 54 LayoutUnit lineTopWithLeading() const { return m_lineTopWithLeading; } |
| 55 LayoutUnit lineBottomWithLeading() const { return m_lineBottomWithLeading; } | 55 LayoutUnit lineBottomWithLeading() const { return m_lineBottomWithLeading; } |
| 56 | 56 |
| 57 LayoutUnit paginationStrut() const { return m_fragmentationData ? m_fragment
ationData->m_paginationStrut : LayoutUnit(0); } | 57 LayoutUnit paginationStrut() const { return m_fragmentationData ? m_fragment
ationData->m_paginationStrut : LayoutUnit(0); } |
| 58 void setPaginationStrut(LayoutUnit strut) { ensureLineFragmentationData()->m
_paginationStrut = strut; } | 58 void setPaginationStrut(LayoutUnit strut) { ensureLineFragmentationData()->m
_paginationStrut = strut; } |
| 59 | 59 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 74 LayoutUnit alignBoxesInBlockDirection(LayoutUnit heightOfBlock, GlyphOverflo
wAndFallbackFontsMap&, VerticalPositionCache&); | 74 LayoutUnit alignBoxesInBlockDirection(LayoutUnit heightOfBlock, GlyphOverflo
wAndFallbackFontsMap&, VerticalPositionCache&); |
| 75 void setLineTopBottomPositions(LayoutUnit top, LayoutUnit bottom, LayoutUnit
topWithLeading, LayoutUnit bottomWithLeading, LayoutUnit selectionBottom = Layo
utUnit::min()) | 75 void setLineTopBottomPositions(LayoutUnit top, LayoutUnit bottom, LayoutUnit
topWithLeading, LayoutUnit bottomWithLeading, LayoutUnit selectionBottom = Layo
utUnit::min()) |
| 76 { | 76 { |
| 77 m_lineTop = top; | 77 m_lineTop = top; |
| 78 m_lineBottom = bottom; | 78 m_lineBottom = bottom; |
| 79 m_lineTopWithLeading = topWithLeading; | 79 m_lineTopWithLeading = topWithLeading; |
| 80 m_lineBottomWithLeading = bottomWithLeading; | 80 m_lineBottomWithLeading = bottomWithLeading; |
| 81 m_selectionBottom = selectionBottom == LayoutUnit::min() ? bottom : sele
ctionBottom; | 81 m_selectionBottom = selectionBottom == LayoutUnit::min() ? bottom : sele
ctionBottom; |
| 82 } | 82 } |
| 83 | 83 |
| 84 virtual RenderLineBoxList* rendererLineBoxes() const OVERRIDE FINAL; | 84 virtual RenderLineBoxList* rendererLineBoxes() const override final; |
| 85 | 85 |
| 86 RenderObject* lineBreakObj() const { return m_lineBreakObj; } | 86 RenderObject* lineBreakObj() const { return m_lineBreakObj; } |
| 87 BidiStatus lineBreakBidiStatus() const; | 87 BidiStatus lineBreakBidiStatus() const; |
| 88 void setLineBreakInfo(RenderObject*, unsigned breakPos, const BidiStatus&); | 88 void setLineBreakInfo(RenderObject*, unsigned breakPos, const BidiStatus&); |
| 89 | 89 |
| 90 unsigned lineBreakPos() const { return m_lineBreakPos; } | 90 unsigned lineBreakPos() const { return m_lineBreakPos; } |
| 91 void setLineBreakPos(unsigned p) { m_lineBreakPos = p; } | 91 void setLineBreakPos(unsigned p) { m_lineBreakPos = p; } |
| 92 | 92 |
| 93 using InlineBox::endsWithBreak; | 93 using InlineBox::endsWithBreak; |
| 94 using InlineBox::setEndsWithBreak; | 94 using InlineBox::setEndsWithBreak; |
| 95 | 95 |
| 96 void childRemoved(InlineBox* box); | 96 void childRemoved(InlineBox* box); |
| 97 | 97 |
| 98 bool lineCanAccommodateEllipsis(bool ltr, int blockEdge, int lineBoxEdge, in
t ellipsisWidth); | 98 bool lineCanAccommodateEllipsis(bool ltr, int blockEdge, int lineBoxEdge, in
t ellipsisWidth); |
| 99 // Return the truncatedWidth, the width of the truncated text + ellipsis. | 99 // Return the truncatedWidth, the width of the truncated text + ellipsis. |
| 100 float placeEllipsis(const AtomicString& ellipsisStr, bool ltr, float blockLe
ftEdge, float blockRightEdge, float ellipsisWidth, InlineBox* markupBox = 0); | 100 float placeEllipsis(const AtomicString& ellipsisStr, bool ltr, float blockLe
ftEdge, float blockRightEdge, float ellipsisWidth, InlineBox* markupBox = 0); |
| 101 // Return the position of the EllipsisBox or -1. | 101 // Return the position of the EllipsisBox or -1. |
| 102 virtual float placeEllipsisBox(bool ltr, float blockLeftEdge, float blockRig
htEdge, float ellipsisWidth, float &truncatedWidth, bool& foundBox) OVERRIDE FIN
AL; | 102 virtual float placeEllipsisBox(bool ltr, float blockLeftEdge, float blockRig
htEdge, float ellipsisWidth, float &truncatedWidth, bool& foundBox) override fin
al; |
| 103 | 103 |
| 104 using InlineBox::hasEllipsisBox; | 104 using InlineBox::hasEllipsisBox; |
| 105 EllipsisBox* ellipsisBox() const; | 105 EllipsisBox* ellipsisBox() const; |
| 106 | 106 |
| 107 virtual void clearTruncation() OVERRIDE FINAL; | 107 virtual void clearTruncation() override final; |
| 108 | 108 |
| 109 virtual int baselinePosition(FontBaseline baselineType) const OVERRIDE FINAL
; | 109 virtual int baselinePosition(FontBaseline baselineType) const override final
; |
| 110 virtual LayoutUnit lineHeight() const OVERRIDE FINAL; | 110 virtual LayoutUnit lineHeight() const override final; |
| 111 | 111 |
| 112 virtual void paint(PaintInfo&, const LayoutPoint&, LayoutUnit lineTop, Layou
tUnit lineBottom) OVERRIDE; | 112 virtual void paint(PaintInfo&, const LayoutPoint&, LayoutUnit lineTop, Layou
tUnit lineBottom) override; |
| 113 virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const HitTes
tLocation& locationInContainer, const LayoutPoint& accumulatedOffset, LayoutUnit
lineTop, LayoutUnit lineBottom) OVERRIDE FINAL; | 113 virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const HitTes
tLocation& locationInContainer, const LayoutPoint& accumulatedOffset, LayoutUnit
lineTop, LayoutUnit lineBottom) override final; |
| 114 | 114 |
| 115 using InlineBox::hasSelectedChildren; | 115 using InlineBox::hasSelectedChildren; |
| 116 using InlineBox::setHasSelectedChildren; | 116 using InlineBox::setHasSelectedChildren; |
| 117 | 117 |
| 118 virtual RenderObject::SelectionState selectionState() const OVERRIDE FINAL; | 118 virtual RenderObject::SelectionState selectionState() const override final; |
| 119 InlineBox* firstSelectedBox() const; | 119 InlineBox* firstSelectedBox() const; |
| 120 InlineBox* lastSelectedBox() const; | 120 InlineBox* lastSelectedBox() const; |
| 121 | 121 |
| 122 GapRects lineSelectionGap(const RenderBlock* rootBlock, const LayoutPoint& r
ootBlockPhysicalPosition, const LayoutSize& offsetFromRootBlock, LayoutUnit selT
op, LayoutUnit selHeight, const PaintInfo*) const; | 122 GapRects lineSelectionGap(const RenderBlock* rootBlock, const LayoutPoint& r
ootBlockPhysicalPosition, const LayoutSize& offsetFromRootBlock, LayoutUnit selT
op, LayoutUnit selHeight, const PaintInfo*) const; |
| 123 | 123 |
| 124 RenderBlockFlow& block() const; | 124 RenderBlockFlow& block() const; |
| 125 | 125 |
| 126 InlineBox* closestLeafChildForPoint(const IntPoint&, bool onlyEditableLeaves
); | 126 InlineBox* closestLeafChildForPoint(const IntPoint&, bool onlyEditableLeaves
); |
| 127 InlineBox* closestLeafChildForLogicalLeftPosition(int, bool onlyEditableLeav
es = false); | 127 InlineBox* closestLeafChildForLogicalLeftPosition(int, bool onlyEditableLeav
es = false); |
| 128 | 128 |
| 129 void appendFloat(RenderBox* floatingBox) | 129 void appendFloat(RenderBox* floatingBox) |
| 130 { | 130 { |
| 131 ASSERT(!isDirty()); | 131 ASSERT(!isDirty()); |
| 132 if (m_floats) | 132 if (m_floats) |
| 133 m_floats->append(floatingBox); | 133 m_floats->append(floatingBox); |
| 134 else | 134 else |
| 135 m_floats= adoptPtr(new Vector<RenderBox*>(1, floatingBox)); | 135 m_floats= adoptPtr(new Vector<RenderBox*>(1, floatingBox)); |
| 136 } | 136 } |
| 137 | 137 |
| 138 Vector<RenderBox*>* floatsPtr() { ASSERT(!isDirty()); return m_floats.get();
} | 138 Vector<RenderBox*>* floatsPtr() { ASSERT(!isDirty()); return m_floats.get();
} |
| 139 | 139 |
| 140 virtual void extractLineBoxFromRenderObject() OVERRIDE FINAL; | 140 virtual void extractLineBoxFromRenderObject() override final; |
| 141 virtual void attachLineBoxToRenderObject() OVERRIDE FINAL; | 141 virtual void attachLineBoxToRenderObject() override final; |
| 142 virtual void removeLineBoxFromRenderObject() OVERRIDE FINAL; | 142 virtual void removeLineBoxFromRenderObject() override final; |
| 143 | 143 |
| 144 FontBaseline baselineType() const { return static_cast<FontBaseline>(m_basel
ineType); } | 144 FontBaseline baselineType() const { return static_cast<FontBaseline>(m_basel
ineType); } |
| 145 | 145 |
| 146 bool hasAnnotationsBefore() const { return m_hasAnnotationsBefore; } | 146 bool hasAnnotationsBefore() const { return m_hasAnnotationsBefore; } |
| 147 bool hasAnnotationsAfter() const { return m_hasAnnotationsAfter; } | 147 bool hasAnnotationsAfter() const { return m_hasAnnotationsAfter; } |
| 148 | 148 |
| 149 LayoutRect paddedLayoutOverflowRect(LayoutUnit endPadding) const; | 149 LayoutRect paddedLayoutOverflowRect(LayoutUnit endPadding) const; |
| 150 | 150 |
| 151 void ascentAndDescentForBox(InlineBox*, GlyphOverflowAndFallbackFontsMap&, i
nt& ascent, int& descent, bool& affectsAscent, bool& affectsDescent) const; | 151 void ascentAndDescentForBox(InlineBox*, GlyphOverflowAndFallbackFontsMap&, i
nt& ascent, int& descent, bool& affectsAscent, bool& affectsDescent) const; |
| 152 LayoutUnit verticalPositionForBox(InlineBox*, VerticalPositionCache&); | 152 LayoutUnit verticalPositionForBox(InlineBox*, VerticalPositionCache&); |
| (...skipping 21 matching lines...) Expand all Loading... |
| 174 return InlineFlowBox::logicalBottomLayoutOverflow(lineBottom()); | 174 return InlineFlowBox::logicalBottomLayoutOverflow(lineBottom()); |
| 175 } | 175 } |
| 176 | 176 |
| 177 // Used to calculate the underline offset for TextUnderlinePositionUnder. | 177 // Used to calculate the underline offset for TextUnderlinePositionUnder. |
| 178 float maxLogicalTop() const; | 178 float maxLogicalTop() const; |
| 179 | 179 |
| 180 Node* getLogicalStartBoxWithNode(InlineBox*&) const; | 180 Node* getLogicalStartBoxWithNode(InlineBox*&) const; |
| 181 Node* getLogicalEndBoxWithNode(InlineBox*&) const; | 181 Node* getLogicalEndBoxWithNode(InlineBox*&) const; |
| 182 | 182 |
| 183 #ifndef NDEBUG | 183 #ifndef NDEBUG |
| 184 virtual const char* boxName() const OVERRIDE; | 184 virtual const char* boxName() const override; |
| 185 #endif | 185 #endif |
| 186 private: | 186 private: |
| 187 LayoutUnit beforeAnnotationsAdjustment() const; | 187 LayoutUnit beforeAnnotationsAdjustment() const; |
| 188 | 188 |
| 189 struct LineFragmentationData; | 189 struct LineFragmentationData; |
| 190 LineFragmentationData* ensureLineFragmentationData() | 190 LineFragmentationData* ensureLineFragmentationData() |
| 191 { | 191 { |
| 192 if (!m_fragmentationData) | 192 if (!m_fragmentationData) |
| 193 m_fragmentationData = adoptPtr(new LineFragmentationData()); | 193 m_fragmentationData = adoptPtr(new LineFragmentationData()); |
| 194 | 194 |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 228 LayoutUnit m_lineTop; | 228 LayoutUnit m_lineTop; |
| 229 LayoutUnit m_lineBottom; | 229 LayoutUnit m_lineBottom; |
| 230 LayoutUnit m_lineTopWithLeading; | 230 LayoutUnit m_lineTopWithLeading; |
| 231 LayoutUnit m_lineBottomWithLeading; | 231 LayoutUnit m_lineBottomWithLeading; |
| 232 LayoutUnit m_selectionBottom; | 232 LayoutUnit m_selectionBottom; |
| 233 }; | 233 }; |
| 234 | 234 |
| 235 } // namespace blink | 235 } // namespace blink |
| 236 | 236 |
| 237 #endif // RootInlineBox_h | 237 #endif // RootInlineBox_h |
| OLD | NEW |