Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(48)

Side by Side Diff: Source/core/rendering/InlineFlowBox.h

Issue 14093017: Add FINAL decorators to the InlineBox class hierarchy. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebased. Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/core/rendering/InlineBox.h ('k') | Source/core/rendering/InlineTextBox.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2003, 2004, 2005, 2006, 2007 Apple Inc. All rights reserved. 2 * Copyright (C) 2003, 2004, 2005, 2006, 2007 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 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 #endif 73 #endif
74 74
75 InlineFlowBox* prevLineBox() const { return m_prevLineBox; } 75 InlineFlowBox* prevLineBox() const { return m_prevLineBox; }
76 InlineFlowBox* nextLineBox() const { return m_nextLineBox; } 76 InlineFlowBox* nextLineBox() const { return m_nextLineBox; }
77 void setNextLineBox(InlineFlowBox* n) { m_nextLineBox = n; } 77 void setNextLineBox(InlineFlowBox* n) { m_nextLineBox = n; }
78 void setPreviousLineBox(InlineFlowBox* p) { m_prevLineBox = p; } 78 void setPreviousLineBox(InlineFlowBox* p) { m_prevLineBox = p; }
79 79
80 InlineBox* firstChild() const { checkConsistency(); return m_firstChild; } 80 InlineBox* firstChild() const { checkConsistency(); return m_firstChild; }
81 InlineBox* lastChild() const { checkConsistency(); return m_lastChild; } 81 InlineBox* lastChild() const { checkConsistency(); return m_lastChild; }
82 82
83 virtual bool isLeaf() const { return false; } 83 virtual bool isLeaf() const FINAL { return false; }
84 84
85 InlineBox* firstLeafChild() const; 85 InlineBox* firstLeafChild() const;
86 InlineBox* lastLeafChild() const; 86 InlineBox* lastLeafChild() const;
87 87
88 typedef void (*CustomInlineBoxRangeReverse)(void* userData, Vector<InlineBox *>::iterator first, Vector<InlineBox*>::iterator last); 88 typedef void (*CustomInlineBoxRangeReverse)(void* userData, Vector<InlineBox *>::iterator first, Vector<InlineBox*>::iterator last);
89 void collectLeafBoxesInLogicalOrder(Vector<InlineBox*>&, CustomInlineBoxRang eReverse customReverseImplementation = 0, void* userData = 0) const; 89 void collectLeafBoxesInLogicalOrder(Vector<InlineBox*>&, CustomInlineBoxRang eReverse customReverseImplementation = 0, void* userData = 0) const;
90 90
91 virtual void setConstructed() 91 virtual void setConstructed() FINAL
92 { 92 {
93 InlineBox::setConstructed(); 93 InlineBox::setConstructed();
94 for (InlineBox* child = firstChild(); child; child = child->nextOnLine() ) 94 for (InlineBox* child = firstChild(); child; child = child->nextOnLine() )
95 child->setConstructed(); 95 child->setConstructed();
96 } 96 }
97 97
98 void addToLine(InlineBox* child); 98 void addToLine(InlineBox* child);
99 virtual void deleteLine(RenderArena*); 99 virtual void deleteLine(RenderArena*) FINAL;
100 virtual void extractLine(); 100 virtual void extractLine() FINAL;
101 virtual void attachLine(); 101 virtual void attachLine() FINAL;
102 virtual void adjustPosition(float dx, float dy); 102 virtual void adjustPosition(float dx, float dy);
103 103
104 virtual void extractLineBoxFromRenderObject(); 104 virtual void extractLineBoxFromRenderObject();
105 virtual void attachLineBoxToRenderObject(); 105 virtual void attachLineBoxToRenderObject();
106 virtual void removeLineBoxFromRenderObject(); 106 virtual void removeLineBoxFromRenderObject();
107 107
108 virtual void clearTruncation() OVERRIDE; 108 virtual void clearTruncation() OVERRIDE;
109 109
110 IntRect roundedFrameRect() const; 110 IntRect roundedFrameRect() const;
111 111
112 virtual void paintBoxDecorations(PaintInfo&, const LayoutPoint&); 112 virtual void paintBoxDecorations(PaintInfo&, const LayoutPoint&) FINAL;
113 virtual void paintMask(PaintInfo&, const LayoutPoint&); 113 virtual void paintMask(PaintInfo&, const LayoutPoint&) FINAL;
114 void paintFillLayers(const PaintInfo&, const Color&, const FillLayer*, const LayoutRect&, CompositeOperator = CompositeSourceOver); 114 void paintFillLayers(const PaintInfo&, const Color&, const FillLayer*, const LayoutRect&, CompositeOperator = CompositeSourceOver);
115 void paintFillLayer(const PaintInfo&, const Color&, const FillLayer*, const LayoutRect&, CompositeOperator = CompositeSourceOver); 115 void paintFillLayer(const PaintInfo&, const Color&, const FillLayer*, const LayoutRect&, CompositeOperator = CompositeSourceOver);
116 void paintBoxShadow(const PaintInfo&, RenderStyle*, ShadowStyle, const Layou tRect&); 116 void paintBoxShadow(const PaintInfo&, RenderStyle*, ShadowStyle, const Layou tRect&);
117 virtual void paint(PaintInfo&, const LayoutPoint&, LayoutUnit lineTop, Layou tUnit lineBottom); 117 virtual void paint(PaintInfo&, const LayoutPoint&, LayoutUnit lineTop, Layou tUnit lineBottom);
118 virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const HitTes tLocation& locationInContainer, const LayoutPoint& accumulatedOffset, LayoutUnit lineTop, LayoutUnit lineBottom) OVERRIDE; 118 virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const HitTes tLocation& locationInContainer, const LayoutPoint& accumulatedOffset, LayoutUnit lineTop, LayoutUnit lineBottom) OVERRIDE;
119 119
120 bool boxShadowCanBeAppliedToBackground(const FillLayer&) const; 120 bool boxShadowCanBeAppliedToBackground(const FillLayer&) const;
121 121
122 virtual RenderLineBoxList* rendererLineBoxes() const; 122 virtual RenderLineBoxList* rendererLineBoxes() const;
123 123
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
194 194
195 LayoutUnit computeOverAnnotationAdjustment(LayoutUnit allowedPosition) const ; 195 LayoutUnit computeOverAnnotationAdjustment(LayoutUnit allowedPosition) const ;
196 LayoutUnit computeUnderAnnotationAdjustment(LayoutUnit allowedPosition) cons t; 196 LayoutUnit computeUnderAnnotationAdjustment(LayoutUnit allowedPosition) cons t;
197 197
198 void computeOverflow(LayoutUnit lineTop, LayoutUnit lineBottom, GlyphOverflo wAndFallbackFontsMap&); 198 void computeOverflow(LayoutUnit lineTop, LayoutUnit lineBottom, GlyphOverflo wAndFallbackFontsMap&);
199 199
200 void removeChild(InlineBox* child); 200 void removeChild(InlineBox* child);
201 201
202 virtual RenderObject::SelectionState selectionState(); 202 virtual RenderObject::SelectionState selectionState();
203 203
204 virtual bool canAccommodateEllipsis(bool ltr, int blockEdge, int ellipsisWid th) const OVERRIDE; 204 virtual bool canAccommodateEllipsis(bool ltr, int blockEdge, int ellipsisWid th) const OVERRIDE FINAL;
205 virtual float placeEllipsisBox(bool ltr, float blockLeftEdge, float blockRig htEdge, float ellipsisWidth, float &truncatedWidth, bool&) OVERRIDE; 205 virtual float placeEllipsisBox(bool ltr, float blockLeftEdge, float blockRig htEdge, float ellipsisWidth, float &truncatedWidth, bool&) OVERRIDE;
206 206
207 bool hasTextChildren() const { return m_hasTextChildren; } 207 bool hasTextChildren() const { return m_hasTextChildren; }
208 bool hasTextDescendants() const { return m_hasTextDescendants; } 208 bool hasTextDescendants() const { return m_hasTextDescendants; }
209 void setHasTextChildren() { m_hasTextChildren = true; setHasTextDescendants( ); } 209 void setHasTextChildren() { m_hasTextChildren = true; setHasTextDescendants( ); }
210 void setHasTextDescendants() { m_hasTextDescendants = true; } 210 void setHasTextDescendants() { m_hasTextDescendants = true; }
211 211
212 void checkConsistency() const; 212 void checkConsistency() const;
213 void setHasBadChildList(); 213 void setHasBadChildList();
214 214
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
292 } 292 }
293 293
294 bool descendantsHaveSameLineHeightAndBaseline() const { return m_descendants HaveSameLineHeightAndBaseline; } 294 bool descendantsHaveSameLineHeightAndBaseline() const { return m_descendants HaveSameLineHeightAndBaseline; }
295 void clearDescendantsHaveSameLineHeightAndBaseline() 295 void clearDescendantsHaveSameLineHeightAndBaseline()
296 { 296 {
297 m_descendantsHaveSameLineHeightAndBaseline = false; 297 m_descendantsHaveSameLineHeightAndBaseline = false;
298 if (parent() && parent()->descendantsHaveSameLineHeightAndBaseline()) 298 if (parent() && parent()->descendantsHaveSameLineHeightAndBaseline())
299 parent()->clearDescendantsHaveSameLineHeightAndBaseline(); 299 parent()->clearDescendantsHaveSameLineHeightAndBaseline();
300 } 300 }
301 301
302 virtual void reportMemoryUsage(MemoryObjectInfo*) const OVERRIDE; 302 virtual void reportMemoryUsage(MemoryObjectInfo*) const OVERRIDE FINAL;
303 303
304 private: 304 private:
305 void addBoxShadowVisualOverflow(LayoutRect& logicalVisualOverflow); 305 void addBoxShadowVisualOverflow(LayoutRect& logicalVisualOverflow);
306 void addBorderOutsetVisualOverflow(LayoutRect& logicalVisualOverflow); 306 void addBorderOutsetVisualOverflow(LayoutRect& logicalVisualOverflow);
307 void addTextBoxVisualOverflow(InlineTextBox*, GlyphOverflowAndFallbackFontsM ap&, LayoutRect& logicalVisualOverflow); 307 void addTextBoxVisualOverflow(InlineTextBox*, GlyphOverflowAndFallbackFontsM ap&, LayoutRect& logicalVisualOverflow);
308 void addReplacedChildOverflow(const InlineBox*, LayoutRect& logicalLayoutOve rflow, LayoutRect& logicalVisualOverflow); 308 void addReplacedChildOverflow(const InlineBox*, LayoutRect& logicalLayoutOve rflow, LayoutRect& logicalVisualOverflow);
309 void constrainToLineTopAndBottomIfNeeded(LayoutRect&) const; 309 void constrainToLineTopAndBottomIfNeeded(LayoutRect&) const;
310 310
311 protected: 311 protected:
312 OwnPtr<RenderOverflow> m_overflow; 312 OwnPtr<RenderOverflow> m_overflow;
313 313
314 virtual bool isInlineFlowBox() const { return true; } 314 virtual bool isInlineFlowBox() const FINAL { return true; }
315 315
316 InlineBox* m_firstChild; 316 InlineBox* m_firstChild;
317 InlineBox* m_lastChild; 317 InlineBox* m_lastChild;
318 318
319 InlineFlowBox* m_prevLineBox; // The previous box that also uses our RenderO bject 319 InlineFlowBox* m_prevLineBox; // The previous box that also uses our RenderO bject
320 InlineFlowBox* m_nextLineBox; // The next box that also uses our RenderObjec t 320 InlineFlowBox* m_nextLineBox; // The next box that also uses our RenderObjec t
321 321
322 #if ENABLE(CSS3_TEXT) 322 #if ENABLE(CSS3_TEXT)
323 // Maximum logicalTop among all children of an InlineFlowBox. Used to 323 // Maximum logicalTop among all children of an InlineFlowBox. Used to
324 // calculate the offset for TextUnderlinePositionUnder. 324 // calculate the offset for TextUnderlinePositionUnder.
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
382 } 382 }
383 383
384 } // namespace WebCore 384 } // namespace WebCore
385 385
386 #ifndef NDEBUG 386 #ifndef NDEBUG
387 // Outside the WebCore namespace for ease of invocation from gdb. 387 // Outside the WebCore namespace for ease of invocation from gdb.
388 void showTree(const WebCore::InlineFlowBox*); 388 void showTree(const WebCore::InlineFlowBox*);
389 #endif 389 #endif
390 390
391 #endif // InlineFlowBox_h 391 #endif // InlineFlowBox_h
OLDNEW
« no previous file with comments | « Source/core/rendering/InlineBox.h ('k') | Source/core/rendering/InlineTextBox.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698