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

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

Issue 752723004: Use references in RenderBlock and RenderBlockFlow methods (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: cover RenderBlockFlow class as well Created 6 years 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 | « no previous file | Source/core/rendering/RenderBlock.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 * (C) 2007 David Smith (catfish.man@gmail.com) 4 * (C) 2007 David Smith (catfish.man@gmail.com)
5 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All r ights reserved. 5 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All r ights reserved.
6 * 6 *
7 * This library is free software; you can redistribute it and/or 7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public 8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either 9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version. 10 * version 2 of the License, or (at your option) any later version.
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after
199 // These two functions take the ColumnInfo* to avoid repeated lookups of the info in the global HashMap. 199 // These two functions take the ColumnInfo* to avoid repeated lookups of the info in the global HashMap.
200 unsigned columnCount(ColumnInfo*) const; 200 unsigned columnCount(ColumnInfo*) const;
201 LayoutRect columnRectAt(ColumnInfo*, unsigned) const; 201 LayoutRect columnRectAt(ColumnInfo*, unsigned) const;
202 202
203 // The page logical offset is the object's offset from the top of the page i n the page progression 203 // The page logical offset is the object's offset from the top of the page i n the page progression
204 // direction (so an x-offset in vertical text and a y-offset for horizontal text). 204 // direction (so an x-offset in vertical text and a y-offset for horizontal text).
205 LayoutUnit pageLogicalOffset() const { return m_pageLogicalOffset; } 205 LayoutUnit pageLogicalOffset() const { return m_pageLogicalOffset; }
206 void setPageLogicalOffset(LayoutUnit offset) { m_pageLogicalOffset = offset; } 206 void setPageLogicalOffset(LayoutUnit offset) { m_pageLogicalOffset = offset; }
207 207
208 // Accessors for logical width/height and margins in the containing block's block-flow direction. 208 // Accessors for logical width/height and margins in the containing block's block-flow direction.
209 LayoutUnit logicalWidthForChild(const RenderBox* child) const { return isHor izontalWritingMode() ? child->width() : child->height(); } 209 LayoutUnit logicalWidthForChild(const RenderBox& child) const { return isHor izontalWritingMode() ? child.width() : child.height(); }
210 LayoutUnit logicalHeightForChild(const RenderBox* child) const { return isHo rizontalWritingMode() ? child->height() : child->width(); } 210 LayoutUnit logicalHeightForChild(const RenderBox& child) const { return isHo rizontalWritingMode() ? child.height() : child.width(); }
211 LayoutSize logicalSizeForChild(const RenderBox* child) const { return isHori zontalWritingMode() ? child->size() : child->size().transposedSize(); } 211 LayoutSize logicalSizeForChild(const RenderBox& child) const { return isHori zontalWritingMode() ? child.size() : child.size().transposedSize(); }
212 LayoutUnit logicalTopForChild(const RenderBox* child) const { return isHoriz ontalWritingMode() ? child->y() : child->x(); } 212 LayoutUnit logicalTopForChild(const RenderBox& child) const { return isHoriz ontalWritingMode() ? child.y() : child.x(); }
213 LayoutUnit marginBeforeForChild(const RenderBoxModelObject* child) const { r eturn child->marginBefore(style()); } 213 LayoutUnit marginBeforeForChild(const RenderBoxModelObject& child) const { r eturn child.marginBefore(style()); }
214 LayoutUnit marginAfterForChild(const RenderBoxModelObject* child) const { re turn child->marginAfter(style()); } 214 LayoutUnit marginAfterForChild(const RenderBoxModelObject& child) const { re turn child.marginAfter(style()); }
215 LayoutUnit marginStartForChild(const RenderBoxModelObject* child) const { re turn child->marginStart(style()); } 215 LayoutUnit marginStartForChild(const RenderBoxModelObject& child) const { re turn child.marginStart(style()); }
216 LayoutUnit marginEndForChild(const RenderBoxModelObject* child) const { retu rn child->marginEnd(style()); } 216 LayoutUnit marginEndForChild(const RenderBoxModelObject& child) const { retu rn child.marginEnd(style()); }
217 void setMarginStartForChild(RenderBox* child, LayoutUnit value) const { chil d->setMarginStart(value, style()); } 217 void setMarginStartForChild(RenderBox& child, LayoutUnit value) const { chil d.setMarginStart(value, style()); }
218 void setMarginEndForChild(RenderBox* child, LayoutUnit value) const { child- >setMarginEnd(value, style()); } 218 void setMarginEndForChild(RenderBox& child, LayoutUnit value) const { child. setMarginEnd(value, style()); }
219 void setMarginBeforeForChild(RenderBox* child, LayoutUnit value) const { chi ld->setMarginBefore(value, style()); } 219 void setMarginBeforeForChild(RenderBox& child, LayoutUnit value) const { chi ld.setMarginBefore(value, style()); }
220 void setMarginAfterForChild(RenderBox* child, LayoutUnit value) const { chil d->setMarginAfter(value, style()); } 220 void setMarginAfterForChild(RenderBox& child, LayoutUnit value) const { chil d.setMarginAfter(value, style()); }
221 LayoutUnit collapsedMarginBeforeForChild(const RenderBox* child) const; 221 LayoutUnit collapsedMarginBeforeForChild(const RenderBox& child) const;
222 LayoutUnit collapsedMarginAfterForChild(const RenderBox* child) const; 222 LayoutUnit collapsedMarginAfterForChild(const RenderBox& child) const;
223 223
224 virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const HitTes tLocation& locationInContainer, const LayoutPoint& accumulatedOffset, HitTestAct ion) override; 224 virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const HitTes tLocation& locationInContainer, const LayoutPoint& accumulatedOffset, HitTestAct ion) override;
225 225
226 virtual void scrollbarsChanged(bool /*horizontalScrollbarChanged*/, bool /*v erticalScrollbarChanged*/) { } 226 virtual void scrollbarsChanged(bool /*horizontalScrollbarChanged*/, bool /*v erticalScrollbarChanged*/) { }
227 227
228 LayoutUnit availableLogicalWidthForContent() const { return max<LayoutUnit>( 0, logicalRightOffsetForContent() - logicalLeftOffsetForContent()); } 228 LayoutUnit availableLogicalWidthForContent() const { return max<LayoutUnit>( 0, logicalRightOffsetForContent() - logicalLeftOffsetForContent()); }
229 LayoutUnit logicalLeftOffsetForContent() const { return isHorizontalWritingM ode() ? borderLeft() + paddingLeft() : borderTop() + paddingTop(); } 229 LayoutUnit logicalLeftOffsetForContent() const { return isHorizontalWritingM ode() ? borderLeft() + paddingLeft() : borderTop() + paddingTop(); }
230 LayoutUnit logicalRightOffsetForContent() const { return logicalLeftOffsetFo rContent() + availableLogicalWidth(); } 230 LayoutUnit logicalRightOffsetForContent() const { return logicalLeftOffsetFo rContent() + availableLogicalWidth(); }
231 LayoutUnit startOffsetForContent() const { return style()->isLeftToRightDire ction() ? logicalLeftOffsetForContent() : logicalWidth() - logicalRightOffsetFor Content(); } 231 LayoutUnit startOffsetForContent() const { return style()->isLeftToRightDire ction() ? logicalLeftOffsetForContent() : logicalWidth() - logicalRightOffsetFor Content(); }
232 LayoutUnit endOffsetForContent() const { return !style()->isLeftToRightDirec tion() ? logicalLeftOffsetForContent() : logicalWidth() - logicalRightOffsetForC ontent(); } 232 LayoutUnit endOffsetForContent() const { return !style()->isLeftToRightDirec tion() ? logicalLeftOffsetForContent() : logicalWidth() - logicalRightOffsetForC ontent(); }
(...skipping 22 matching lines...) Expand all
255 255
256 enum PositionedLayoutBehavior { 256 enum PositionedLayoutBehavior {
257 DefaultLayout, 257 DefaultLayout,
258 LayoutOnlyFixedPositionedObjects, 258 LayoutOnlyFixedPositionedObjects,
259 ForcedLayoutAfterContainingBlockMoved 259 ForcedLayoutAfterContainingBlockMoved
260 }; 260 };
261 261
262 void layoutPositionedObjects(bool relayoutChildren, PositionedLayoutBehavior = DefaultLayout); 262 void layoutPositionedObjects(bool relayoutChildren, PositionedLayoutBehavior = DefaultLayout);
263 void markFixedPositionObjectForLayoutIfNeeded(RenderObject* child, SubtreeLa youtScope&); 263 void markFixedPositionObjectForLayoutIfNeeded(RenderObject* child, SubtreeLa youtScope&);
264 264
265 LayoutUnit marginIntrinsicLogicalWidthForChild(RenderBox* child) const; 265 LayoutUnit marginIntrinsicLogicalWidthForChild(RenderBox& child) const;
266 266
267 int beforeMarginInLineDirection(LineDirectionMode) const; 267 int beforeMarginInLineDirection(LineDirectionMode) const;
268 268
269 virtual void paint(const PaintInfo&, const LayoutPoint&) override; 269 virtual void paint(const PaintInfo&, const LayoutPoint&) override;
270 public: 270 public:
271 virtual void paintObject(const PaintInfo&, const LayoutPoint&) override; 271 virtual void paintObject(const PaintInfo&, const LayoutPoint&) override;
272 virtual void paintChildren(const PaintInfo&, const LayoutPoint&); 272 virtual void paintChildren(const PaintInfo&, const LayoutPoint&);
273 273
274 // FIXME-BLOCKFLOW: Remove virtualizaion when all callers have moved to Rend erBlockFlow 274 // FIXME-BLOCKFLOW: Remove virtualizaion when all callers have moved to Rend erBlockFlow
275 virtual void paintFloats(const PaintInfo&, const LayoutPoint&, bool) { } 275 virtual void paintFloats(const PaintInfo&, const LayoutPoint&, bool) { }
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
313 protected: 313 protected:
314 virtual void addOverflowFromChildren(); 314 virtual void addOverflowFromChildren();
315 void addOverflowFromPositionedObjects(); 315 void addOverflowFromPositionedObjects();
316 void addOverflowFromBlockChildren(); 316 void addOverflowFromBlockChildren();
317 void addVisualOverflowFromTheme(); 317 void addVisualOverflowFromTheme();
318 318
319 virtual void addFocusRingRects(Vector<LayoutRect>&, const LayoutPoint& addit ionalOffset) const override; 319 virtual void addFocusRingRects(Vector<LayoutRect>&, const LayoutPoint& addit ionalOffset) const override;
320 320
321 virtual void computeSelfHitTestRects(Vector<LayoutRect>&, const LayoutPoint& layerOffset) const override; 321 virtual void computeSelfHitTestRects(Vector<LayoutRect>&, const LayoutPoint& layerOffset) const override;
322 322
323 void updateBlockChildDirtyBitsBeforeLayout(bool relayoutChildren, RenderBox* ); 323 void updateBlockChildDirtyBitsBeforeLayout(bool relayoutChildren, RenderBox& );
324 324
325 virtual bool isInlineBlockOrInlineTable() const override final { return isIn line() && isReplaced(); } 325 virtual bool isInlineBlockOrInlineTable() const override final { return isIn line() && isReplaced(); }
326 326
327 virtual void invalidatePaintOfSubtreesIfNeeded(const PaintInvalidationState& childPaintInvalidationState) override; 327 virtual void invalidatePaintOfSubtreesIfNeeded(const PaintInvalidationState& childPaintInvalidationState) override;
328 328
329 private: 329 private:
330 virtual RenderObjectChildList* virtualChildren() override final { return chi ldren(); } 330 virtual RenderObjectChildList* virtualChildren() override final { return chi ldren(); }
331 virtual const RenderObjectChildList* virtualChildren() const override final { return children(); } 331 virtual const RenderObjectChildList* virtualChildren() const override final { return children(); }
332 332
333 virtual const char* renderName() const override; 333 virtual const char* renderName() const override;
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
474 // FIXME: This is temporary as we move code that accesses block flow 474 // FIXME: This is temporary as we move code that accesses block flow
475 // member variables out of RenderBlock and into RenderBlockFlow. 475 // member variables out of RenderBlock and into RenderBlockFlow.
476 friend class RenderBlockFlow; 476 friend class RenderBlockFlow;
477 }; 477 };
478 478
479 DEFINE_RENDER_OBJECT_TYPE_CASTS(RenderBlock, isRenderBlock()); 479 DEFINE_RENDER_OBJECT_TYPE_CASTS(RenderBlock, isRenderBlock());
480 480
481 } // namespace blink 481 } // namespace blink
482 482
483 #endif // RenderBlock_h 483 #endif // RenderBlock_h
OLDNEW
« no previous file with comments | « no previous file | Source/core/rendering/RenderBlock.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698