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

Side by Side Diff: Source/core/layout/LayoutInline.h

Issue 1162383003: C++11: Replace 0 with nullptr where applicable in layout code. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Add one more file. Created 5 years, 6 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
« no previous file with comments | « Source/core/layout/LayoutImageResource.cpp ('k') | Source/core/layout/LayoutInline.cpp » ('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) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. 4 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
5 * 5 *
6 * This library is free software; you can redistribute it and/or 6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public 7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either 8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version. 9 * version 2 of the License, or (at your option) any later version.
10 * 10 *
(...skipping 26 matching lines...) Expand all
37 37
38 static LayoutInline* createAnonymous(Document*); 38 static LayoutInline* createAnonymous(Document*);
39 39
40 LayoutObject* firstChild() const { ASSERT(children() == virtualChildren()); return children()->firstChild(); } 40 LayoutObject* firstChild() const { ASSERT(children() == virtualChildren()); return children()->firstChild(); }
41 LayoutObject* lastChild() const { ASSERT(children() == virtualChildren()); r eturn children()->lastChild(); } 41 LayoutObject* lastChild() const { ASSERT(children() == virtualChildren()); r eturn children()->lastChild(); }
42 42
43 // If you have a LayoutInline, use firstChild or lastChild instead. 43 // If you have a LayoutInline, use firstChild or lastChild instead.
44 void slowFirstChild() const = delete; 44 void slowFirstChild() const = delete;
45 void slowLastChild() const = delete; 45 void slowLastChild() const = delete;
46 46
47 virtual void addChild(LayoutObject* newChild, LayoutObject* beforeChild = 0) override; 47 virtual void addChild(LayoutObject* newChild, LayoutObject* beforeChild = nu llptr) override;
48 48
49 Element* node() const { return toElement(LayoutBoxModelObject::node()); } 49 Element* node() const { return toElement(LayoutBoxModelObject::node()); }
50 50
51 virtual LayoutRectOutsets marginBoxOutsets() const override final; 51 virtual LayoutRectOutsets marginBoxOutsets() const override final;
52 virtual LayoutUnit marginLeft() const override final; 52 virtual LayoutUnit marginLeft() const override final;
53 virtual LayoutUnit marginRight() const override final; 53 virtual LayoutUnit marginRight() const override final;
54 virtual LayoutUnit marginTop() const override final; 54 virtual LayoutUnit marginTop() const override final;
55 virtual LayoutUnit marginBottom() const override final; 55 virtual LayoutUnit marginBottom() const override final;
56 virtual LayoutUnit marginBefore(const ComputedStyle* otherStyle = 0) const o verride final; 56 virtual LayoutUnit marginBefore(const ComputedStyle* otherStyle = nullptr) c onst override final;
57 virtual LayoutUnit marginAfter(const ComputedStyle* otherStyle = 0) const ov erride final; 57 virtual LayoutUnit marginAfter(const ComputedStyle* otherStyle = nullptr) co nst override final;
58 virtual LayoutUnit marginStart(const ComputedStyle* otherStyle = 0) const ov erride final; 58 virtual LayoutUnit marginStart(const ComputedStyle* otherStyle = nullptr) co nst override final;
59 virtual LayoutUnit marginEnd(const ComputedStyle* otherStyle = 0) const over ride final; 59 virtual LayoutUnit marginEnd(const ComputedStyle* otherStyle = nullptr) cons t override final;
60 60
61 virtual void absoluteRects(Vector<IntRect>&, const LayoutPoint& accumulatedO ffset) const override final; 61 virtual void absoluteRects(Vector<IntRect>&, const LayoutPoint& accumulatedO ffset) const override final;
62 virtual void absoluteQuads(Vector<FloatQuad>&, bool* wasFixed) const overrid e; 62 virtual void absoluteQuads(Vector<FloatQuad>&, bool* wasFixed) const overrid e;
63 63
64 virtual LayoutSize offsetFromContainer(const LayoutObject*, const LayoutPoin t&, bool* offsetDependsOnPoint = 0) const override final; 64 virtual LayoutSize offsetFromContainer(const LayoutObject*, const LayoutPoin t&, bool* offsetDependsOnPoint = nullptr) const override final;
65 65
66 IntRect linesBoundingBox() const; 66 IntRect linesBoundingBox() const;
67 LayoutRect linesVisualOverflowBoundingBox() const; 67 LayoutRect linesVisualOverflowBoundingBox() const;
68 68
69 InlineFlowBox* createAndAppendInlineFlowBox(); 69 InlineFlowBox* createAndAppendInlineFlowBox();
70 70
71 void dirtyLineBoxes(bool fullLayout); 71 void dirtyLineBoxes(bool fullLayout);
72 72
73 LineBoxList* lineBoxes() { return &m_lineBoxes; } 73 LineBoxList* lineBoxes() { return &m_lineBoxes; }
74 const LineBoxList* lineBoxes() const { return &m_lineBoxes; } 74 const LineBoxList* lineBoxes() const { return &m_lineBoxes; }
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 LayoutRect culledInlineVisualOverflowBoundingBox() const; 120 LayoutRect culledInlineVisualOverflowBoundingBox() const;
121 InlineBox* culledInlineFirstLineBox() const; 121 InlineBox* culledInlineFirstLineBox() const;
122 InlineBox* culledInlineLastLineBox() const; 122 InlineBox* culledInlineLastLineBox() const;
123 123
124 template<typename GeneratorContext> 124 template<typename GeneratorContext>
125 void generateLineBoxRects(GeneratorContext& yield) const; 125 void generateLineBoxRects(GeneratorContext& yield) const;
126 template<typename GeneratorContext> 126 template<typename GeneratorContext>
127 void generateCulledLineBoxRects(GeneratorContext& yield, const LayoutInline* container) const; 127 void generateCulledLineBoxRects(GeneratorContext& yield, const LayoutInline* container) const;
128 128
129 void addChildToContinuation(LayoutObject* newChild, LayoutObject* beforeChil d); 129 void addChildToContinuation(LayoutObject* newChild, LayoutObject* beforeChil d);
130 virtual void addChildIgnoringContinuation(LayoutObject* newChild, LayoutObje ct* beforeChild = 0) override final; 130 virtual void addChildIgnoringContinuation(LayoutObject* newChild, LayoutObje ct* beforeChild = nullptr) override final;
131 131
132 void moveChildrenToIgnoringContinuation(LayoutInline* to, LayoutObject* star tChild); 132 void moveChildrenToIgnoringContinuation(LayoutInline* to, LayoutObject* star tChild);
133 133
134 void splitInlines(LayoutBlock* fromBlock, LayoutBlock* toBlock, LayoutBlock* middleBlock, 134 void splitInlines(LayoutBlock* fromBlock, LayoutBlock* toBlock, LayoutBlock* middleBlock,
135 LayoutObject* beforeChild, LayoutBoxModelObject* oldCont); 135 LayoutObject* beforeChild, LayoutBoxModelObject* oldCont);
136 void splitFlow(LayoutObject* beforeChild, LayoutBlock* newBlockBox, 136 void splitFlow(LayoutObject* beforeChild, LayoutBlock* newBlockBox,
137 LayoutObject* newChild, LayoutBoxModelObject* oldCont); 137 LayoutObject* newChild, LayoutBoxModelObject* oldCont);
138 138
139 virtual void layout() override final { ASSERT_NOT_REACHED(); } // Do nothing for layout() 139 virtual void layout() override final { ASSERT_NOT_REACHED(); } // Do nothing for layout()
140 140
141 virtual void paint(const PaintInfo&, const LayoutPoint&) override final; 141 virtual void paint(const PaintInfo&, const LayoutPoint&) override final;
142 142
143 virtual bool nodeAtPoint(HitTestResult&, const HitTestLocation& locationInCo ntainer, const LayoutPoint& accumulatedOffset, HitTestAction) override final; 143 virtual bool nodeAtPoint(HitTestResult&, const HitTestLocation& locationInCo ntainer, const LayoutPoint& accumulatedOffset, HitTestAction) override final;
144 144
145 virtual DeprecatedPaintLayerType layerTypeRequired() const override { return isRelPositioned() || createsGroup() || hasClipPath() || style()->shouldComposit eForCurrentAnimations() || style()->hasCompositorProxy() ? NormalDeprecatedPaint Layer : NoDeprecatedPaintLayer; } 145 virtual DeprecatedPaintLayerType layerTypeRequired() const override { return isRelPositioned() || createsGroup() || hasClipPath() || style()->shouldComposit eForCurrentAnimations() || style()->hasCompositorProxy() ? NormalDeprecatedPaint Layer : NoDeprecatedPaintLayer; }
146 146
147 virtual LayoutUnit offsetLeft() const override final; 147 virtual LayoutUnit offsetLeft() const override final;
148 virtual LayoutUnit offsetTop() const override final; 148 virtual LayoutUnit offsetTop() const override final;
149 virtual LayoutUnit offsetWidth() const override final { return linesBounding Box().width(); } 149 virtual LayoutUnit offsetWidth() const override final { return linesBounding Box().width(); }
150 virtual LayoutUnit offsetHeight() const override final { return linesBoundin gBox().height(); } 150 virtual LayoutUnit offsetHeight() const override final { return linesBoundin gBox().height(); }
151 151
152 virtual LayoutRect absoluteClippedOverflowRect() const override; 152 virtual LayoutRect absoluteClippedOverflowRect() const override;
153 virtual LayoutRect clippedOverflowRectForPaintInvalidation(const LayoutBoxMo delObject* paintInvalidationContainer, const PaintInvalidationState* = 0) const override; 153 virtual LayoutRect clippedOverflowRectForPaintInvalidation(const LayoutBoxMo delObject* paintInvalidationContainer, const PaintInvalidationState* = nullptr) const override;
154 virtual LayoutRect rectWithOutlineForPaintInvalidation(const LayoutBoxModelO bject* paintInvalidationContainer, LayoutUnit outlineWidth, const PaintInvalidat ionState* = 0) const override final; 154 virtual LayoutRect rectWithOutlineForPaintInvalidation(const LayoutBoxModelO bject* paintInvalidationContainer, LayoutUnit outlineWidth, const PaintInvalidat ionState* = nullptr) const override final;
155 virtual void mapRectToPaintInvalidationBacking(const LayoutBoxModelObject* p aintInvalidationContainer, LayoutRect&, const PaintInvalidationState*) const ove rride final; 155 virtual void mapRectToPaintInvalidationBacking(const LayoutBoxModelObject* p aintInvalidationContainer, LayoutRect&, const PaintInvalidationState*) const ove rride final;
156 156
157 // This method differs from clippedOverflowRectForPaintInvalidation in that it includes 157 // This method differs from clippedOverflowRectForPaintInvalidation in that it includes
158 // the rects for culled inline boxes, which aren't necessary for paint inval idation. 158 // the rects for culled inline boxes, which aren't necessary for paint inval idation.
159 LayoutRect clippedOverflowRect(const LayoutBoxModelObject*, const PaintInval idationState* = 0) const; 159 LayoutRect clippedOverflowRect(const LayoutBoxModelObject*, const PaintInval idationState* = nullptr) const;
160 160
161 virtual void mapLocalToContainer(const LayoutBoxModelObject* paintInvalidati onContainer, TransformState&, MapCoordinatesFlags = ApplyContainerFlip, bool* wa sFixed = 0, const PaintInvalidationState* = 0) const override; 161 virtual void mapLocalToContainer(const LayoutBoxModelObject* paintInvalidati onContainer, TransformState&, MapCoordinatesFlags = ApplyContainerFlip, bool* wa sFixed = 0, const PaintInvalidationState* = nullptr) const override;
162 162
163 virtual PositionWithAffinity positionForPoint(const LayoutPoint&) override f inal; 163 virtual PositionWithAffinity positionForPoint(const LayoutPoint&) override f inal;
164 164
165 virtual IntRect borderBoundingBox() const override final 165 virtual IntRect borderBoundingBox() const override final
166 { 166 {
167 IntRect boundingBox = linesBoundingBox(); 167 IntRect boundingBox = linesBoundingBox();
168 return IntRect(0, 0, boundingBox.width(), boundingBox.height()); 168 return IntRect(0, 0, boundingBox.width(), boundingBox.height());
169 } 169 }
170 170
171 virtual InlineFlowBox* createInlineFlowBox(); // Subclassed by SVG and Ruby 171 virtual InlineFlowBox* createInlineFlowBox(); // Subclassed by SVG and Ruby
172 172
173 virtual void dirtyLinesFromChangedChild(LayoutObject* child) override final { m_lineBoxes.dirtyLinesFromChangedChild(this, child); } 173 virtual void dirtyLinesFromChangedChild(LayoutObject* child) override final { m_lineBoxes.dirtyLinesFromChangedChild(this, child); }
174 174
175 virtual LayoutUnit lineHeight(bool firstLine, LineDirectionMode, LinePositio nMode = PositionOnContainingLine) const override final; 175 virtual LayoutUnit lineHeight(bool firstLine, LineDirectionMode, LinePositio nMode = PositionOnContainingLine) const override final;
176 virtual int baselinePosition(FontBaseline, bool firstLine, LineDirectionMode , LinePositionMode = PositionOnContainingLine) const override final; 176 virtual int baselinePosition(FontBaseline, bool firstLine, LineDirectionMode , LinePositionMode = PositionOnContainingLine) const override final;
177 177
178 virtual void childBecameNonInline(LayoutObject* child) override final; 178 virtual void childBecameNonInline(LayoutObject* child) override final;
179 179
180 virtual void updateHitTestResult(HitTestResult&, const LayoutPoint&) overrid e final; 180 virtual void updateHitTestResult(HitTestResult&, const LayoutPoint&) overrid e final;
181 181
182 virtual void imageChanged(WrappedImagePtr, const IntRect* = 0) override fina l; 182 virtual void imageChanged(WrappedImagePtr, const IntRect* = nullptr) overrid e final;
183 183
184 virtual void addAnnotatedRegions(Vector<AnnotatedRegionValue>&) override fin al; 184 virtual void addAnnotatedRegions(Vector<AnnotatedRegionValue>&) override fin al;
185 185
186 virtual void updateFromStyle() override final; 186 virtual void updateFromStyle() override final;
187 187
188 LayoutInline* clone() const; 188 LayoutInline* clone() const;
189 189
190 LayoutBoxModelObject* continuationBefore(LayoutObject* beforeChild); 190 LayoutBoxModelObject* continuationBefore(LayoutObject* beforeChild);
191 191
192 LayoutObjectChildList m_children; 192 LayoutObjectChildList m_children;
193 LineBoxList m_lineBoxes; // All of the line boxes created for this inline fl ow. For example, <i>Hello<br>world.</i> will have two <i> line boxes. 193 LineBoxList m_lineBoxes; // All of the line boxes created for this inline fl ow. For example, <i>Hello<br>world.</i> will have two <i> line boxes.
194 }; 194 };
195 195
196 DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutInline, isLayoutInline()); 196 DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutInline, isLayoutInline());
197 197
198 } // namespace blink 198 } // namespace blink
199 199
200 #endif // LayoutInline_h 200 #endif // LayoutInline_h
OLDNEW
« no previous file with comments | « Source/core/layout/LayoutImageResource.cpp ('k') | Source/core/layout/LayoutInline.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698