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

Side by Side Diff: sky/engine/core/rendering/RenderBox.h

Issue 691223003: Remove some more assorted code from RenderBox. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: merge to ToT Created 6 years, 1 month 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 | « sky/engine/core/rendering/RenderBlock.cpp ('k') | sky/engine/core/rendering/RenderBox.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, 2006, 2007 Apple Inc. All rights reserved. 4 * Copyright (C) 2003, 2006, 2007 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 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 LayoutUnit x() const { return m_frameRect.x(); } 93 LayoutUnit x() const { return m_frameRect.x(); }
94 LayoutUnit y() const { return m_frameRect.y(); } 94 LayoutUnit y() const { return m_frameRect.y(); }
95 LayoutUnit width() const { return m_frameRect.width(); } 95 LayoutUnit width() const { return m_frameRect.width(); }
96 LayoutUnit height() const { return m_frameRect.height(); } 96 LayoutUnit height() const { return m_frameRect.height(); }
97 97
98 int pixelSnappedWidth() const { return m_frameRect.pixelSnappedWidth(); } 98 int pixelSnappedWidth() const { return m_frameRect.pixelSnappedWidth(); }
99 int pixelSnappedHeight() const { return m_frameRect.pixelSnappedHeight(); } 99 int pixelSnappedHeight() const { return m_frameRect.pixelSnappedHeight(); }
100 100
101 // These represent your location relative to your container as a physical of fset. 101 // These represent your location relative to your container as a physical of fset.
102 // In layout related methods you almost always want the logical location (e. g. x() and y()). 102 // In layout related methods you almost always want the logical location (e. g. x() and y()).
103 LayoutUnit top() const { return topLeftLocation().y(); } 103 LayoutUnit top() const { return location().y(); }
104 LayoutUnit left() const { return topLeftLocation().x(); } 104 LayoutUnit left() const { return location().x(); }
105 105
106 void setX(LayoutUnit x) { m_frameRect.setX(x); } 106 void setX(LayoutUnit x) { m_frameRect.setX(x); }
107 void setY(LayoutUnit y) { m_frameRect.setY(y); } 107 void setY(LayoutUnit y) { m_frameRect.setY(y); }
108 void setWidth(LayoutUnit width) { m_frameRect.setWidth(width); } 108 void setWidth(LayoutUnit width) { m_frameRect.setWidth(width); }
109 void setHeight(LayoutUnit height) { m_frameRect.setHeight(height); } 109 void setHeight(LayoutUnit height) { m_frameRect.setHeight(height); }
110 110
111 LayoutUnit logicalLeft() const { return x(); } 111 LayoutUnit logicalLeft() const { return x(); }
112 LayoutUnit logicalRight() const { return logicalLeft() + logicalWidth(); } 112 LayoutUnit logicalRight() const { return logicalLeft() + logicalWidth(); }
113 LayoutUnit logicalTop() const { return y(); } 113 LayoutUnit logicalTop() const { return y(); }
114 LayoutUnit logicalBottom() const { return logicalTop() + logicalHeight(); } 114 LayoutUnit logicalBottom() const { return logicalTop() + logicalHeight(); }
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
181 181
182 // Use this with caution! No type checking is done! 182 // Use this with caution! No type checking is done!
183 RenderBox* previousSiblingBox() const; 183 RenderBox* previousSiblingBox() const;
184 RenderBox* nextSiblingBox() const; 184 RenderBox* nextSiblingBox() const;
185 RenderBox* parentBox() const; 185 RenderBox* parentBox() const;
186 186
187 // Visual and layout overflow are in the coordinate space of the box. This means that they aren't purely physical directions. 187 // Visual and layout overflow are in the coordinate space of the box. This means that they aren't purely physical directions.
188 // For horizontal-tb and vertical-lr they will match physical directions, bu t for horizontal-bt and vertical-rl, the top/bottom and left/right 188 // For horizontal-tb and vertical-lr they will match physical directions, bu t for horizontal-bt and vertical-rl, the top/bottom and left/right
189 // respectively are flipped when compared to their physical counterparts. F or example minX is on the left in vertical-lr, 189 // respectively are flipped when compared to their physical counterparts. F or example minX is on the left in vertical-lr,
190 // but it is on the right in vertical-rl. 190 // but it is on the right in vertical-rl.
191 LayoutRect noOverflowRect() const; 191 LayoutRect layoutOverflowRect() const { return m_overflow ? m_overflow->layo utOverflowRect() : paddingBoxRect(); }
192 LayoutRect layoutOverflowRect() const { return m_overflow ? m_overflow->layo utOverflowRect() : noOverflowRect(); }
193 IntRect pixelSnappedLayoutOverflowRect() const { return pixelSnappedIntRect( layoutOverflowRect()); } 192 IntRect pixelSnappedLayoutOverflowRect() const { return pixelSnappedIntRect( layoutOverflowRect()); }
194 LayoutSize maxLayoutOverflow() const { return LayoutSize(layoutOverflowRect( ).maxX(), layoutOverflowRect().maxY()); } 193 LayoutSize maxLayoutOverflow() const { return LayoutSize(layoutOverflowRect( ).maxX(), layoutOverflowRect().maxY()); }
195 LayoutUnit logicalLeftLayoutOverflow() const { return layoutOverflowRect().x (); } 194 LayoutUnit logicalLeftLayoutOverflow() const { return layoutOverflowRect().x (); }
196 LayoutUnit logicalRightLayoutOverflow() const { return layoutOverflowRect(). maxX(); } 195 LayoutUnit logicalRightLayoutOverflow() const { return layoutOverflowRect(). maxX(); }
197 196
198 virtual LayoutRect visualOverflowRect() const { return m_overflow ? m_overfl ow->visualOverflowRect() : borderBoxRect(); } 197 virtual LayoutRect visualOverflowRect() const { return m_overflow ? m_overfl ow->visualOverflowRect() : borderBoxRect(); }
199 LayoutUnit logicalLeftVisualOverflow() const { return visualOverflowRect().x (); } 198 LayoutUnit logicalLeftVisualOverflow() const { return visualOverflowRect().x (); }
200 LayoutUnit logicalRightVisualOverflow() const { return visualOverflowRect(). maxX(); } 199 LayoutUnit logicalRightVisualOverflow() const { return visualOverflowRect(). maxX(); }
201 200
202 LayoutRect contentsVisualOverflowRect() const { return m_overflow ? m_overfl ow->contentsVisualOverflowRect() : LayoutRect(); } 201 LayoutRect contentsVisualOverflowRect() const { return m_overflow ? m_overfl ow->contentsVisualOverflowRect() : LayoutRect(); }
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
362 // iterate over structures on the line. 361 // iterate over structures on the line.
363 InlineBox* inlineBoxWrapper() const { return m_rareData ? m_rareData->m_inli neBoxWrapper : 0; } 362 InlineBox* inlineBoxWrapper() const { return m_rareData ? m_rareData->m_inli neBoxWrapper : 0; }
364 void setInlineBoxWrapper(InlineBox*); 363 void setInlineBoxWrapper(InlineBox*);
365 void deleteLineBoxWrapper(); 364 void deleteLineBoxWrapper();
366 365
367 virtual LayoutRect clippedOverflowRectForPaintInvalidation(const RenderLayer ModelObject* paintInvalidationContainer, const PaintInvalidationState* = 0) cons t override; 366 virtual LayoutRect clippedOverflowRectForPaintInvalidation(const RenderLayer ModelObject* paintInvalidationContainer, const PaintInvalidationState* = 0) cons t override;
368 virtual void mapRectToPaintInvalidationBacking(const RenderLayerModelObject* paintInvalidationContainer, LayoutRect&, const PaintInvalidationState*) const o verride; 367 virtual void mapRectToPaintInvalidationBacking(const RenderLayerModelObject* paintInvalidationContainer, LayoutRect&, const PaintInvalidationState*) const o verride;
369 368
370 LayoutUnit containingBlockLogicalHeightForContent(AvailableLogicalHeightType ) const; 369 LayoutUnit containingBlockLogicalHeightForContent(AvailableLogicalHeightType ) const;
371 370
372 LayoutUnit containingBlockAvailableLineWidth() const;
373 LayoutUnit perpendicularContainingBlockLogicalHeight() const;
374
375 virtual void updateLogicalWidth(); 371 virtual void updateLogicalWidth();
376 virtual void updateLogicalHeight(); 372 virtual void updateLogicalHeight();
377 virtual void computeLogicalHeight(LayoutUnit logicalHeight, LayoutUnit logic alTop, LogicalExtentComputedValues&) const; 373 virtual void computeLogicalHeight(LayoutUnit logicalHeight, LayoutUnit logic alTop, LogicalExtentComputedValues&) const;
378 374
379 void computeLogicalWidth(LogicalExtentComputedValues&) const; 375 void computeLogicalWidth(LogicalExtentComputedValues&) const;
380 376
381 virtual LayoutSize intrinsicSize() const { return LayoutSize(); } 377 virtual LayoutSize intrinsicSize() const { return LayoutSize(); }
382 LayoutUnit intrinsicLogicalWidth() const { return intrinsicSize().width(); } 378 LayoutUnit intrinsicLogicalWidth() const { return intrinsicSize().width(); }
383 LayoutUnit intrinsicLogicalHeight() const { return intrinsicSize().height(); } 379 LayoutUnit intrinsicLogicalHeight() const { return intrinsicSize().height(); }
384 virtual LayoutUnit intrinsicContentLogicalHeight() const { return m_intrinsi cContentLogicalHeight; } 380 virtual LayoutUnit intrinsicContentLogicalHeight() const { return m_intrinsi cContentLogicalHeight; }
385 381
386 // Whether or not the element shrinks to its intrinsic width (rather than fi lling the width 382 // Whether or not the element shrinks to its intrinsic width (rather than fi lling the width
387 // of a containing block). HTML4 buttons, <select>s, <input>s, legends, and floating/compact elements do this. 383 // of a containing block). HTML4 buttons, <select>s, <input>s, legends, and floating/compact elements do this.
388 bool sizesLogicalWidthToFitContent(const Length& logicalWidth) const; 384 bool sizesLogicalWidthToFitContent(const Length& logicalWidth) const;
389 385
390 LayoutUnit shrinkLogicalWidthToAvoidFloats(LayoutUnit childMarginStart, Layo utUnit childMarginEnd, const RenderBlockFlow* cb) const;
391
392 LayoutUnit computeLogicalWidthUsing(SizeType, const Length& logicalWidth, La youtUnit availableLogicalWidth, const RenderBlock* containingBlock) const; 386 LayoutUnit computeLogicalWidthUsing(SizeType, const Length& logicalWidth, La youtUnit availableLogicalWidth, const RenderBlock* containingBlock) const;
393 LayoutUnit computeLogicalHeightUsing(const Length& height, LayoutUnit intrin sicContentHeight) const; 387 LayoutUnit computeLogicalHeightUsing(const Length& height, LayoutUnit intrin sicContentHeight) const;
394 LayoutUnit computeContentLogicalHeight(const Length& height, LayoutUnit intr insicContentHeight) const; 388 LayoutUnit computeContentLogicalHeight(const Length& height, LayoutUnit intr insicContentHeight) const;
395 LayoutUnit computeContentLogicalHeightUsing(const Length& height, LayoutUnit intrinsicContentHeight) const; 389 LayoutUnit computeContentLogicalHeightUsing(const Length& height, LayoutUnit intrinsicContentHeight) const;
396 LayoutUnit computeReplacedLogicalWidthUsing(const Length& width) const; 390 LayoutUnit computeReplacedLogicalWidthUsing(const Length& width) const;
397 LayoutUnit computeReplacedLogicalWidthRespectingMinMaxWidth(LayoutUnit logic alWidth, ShouldComputePreferred = ComputeActual) const; 391 LayoutUnit computeReplacedLogicalWidthRespectingMinMaxWidth(LayoutUnit logic alWidth, ShouldComputePreferred = ComputeActual) const;
398 LayoutUnit computeReplacedLogicalHeightUsing(const Length& height) const; 392 LayoutUnit computeReplacedLogicalHeightUsing(const Length& height) const;
399 LayoutUnit computeReplacedLogicalHeightRespectingMinMaxHeight(LayoutUnit log icalHeight) const; 393 LayoutUnit computeReplacedLogicalHeightRespectingMinMaxHeight(LayoutUnit log icalHeight) const;
400 394
401 virtual LayoutUnit computeReplacedLogicalWidth(ShouldComputePreferred = Com puteActual) const; 395 virtual LayoutUnit computeReplacedLogicalWidth(ShouldComputePreferred = Com puteActual) const;
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
463 457
464 virtual PositionWithAffinity positionForPoint(const LayoutPoint&) override; 458 virtual PositionWithAffinity positionForPoint(const LayoutPoint&) override;
465 459
466 void removeFloatingOrPositionedChildFromBlockLists(); 460 void removeFloatingOrPositionedChildFromBlockLists();
467 461
468 RenderLayer* enclosingFloatPaintingLayer() const; 462 RenderLayer* enclosingFloatPaintingLayer() const;
469 463
470 virtual int firstLineBoxBaseline() const { return -1; } 464 virtual int firstLineBoxBaseline() const { return -1; }
471 virtual int inlineBlockBaseline(LineDirectionMode) const { return -1; } // R eturns -1 if we should skip this box when computing the baseline of an inline-bl ock. 465 virtual int inlineBlockBaseline(LineDirectionMode) const { return -1; } // R eturns -1 if we should skip this box when computing the baseline of an inline-bl ock.
472 466
473 bool isFlexItemIncludingDeprecated() const { return !isInline() && !isFloati ngOrOutOfFlowPositioned() && parent() && parent()->isFlexibleBox(); } 467 bool isFlexItem() const { return !isInline() && !isFloatingOrOutOfFlowPositi oned() && parent() && parent()->isFlexibleBox(); }
474 468
475 virtual LayoutUnit lineHeight(bool firstLine, LineDirectionMode, LinePositio nMode = PositionOnContainingLine) const override; 469 virtual LayoutUnit lineHeight(bool firstLine, LineDirectionMode, LinePositio nMode = PositionOnContainingLine) const override;
476 virtual int baselinePosition(FontBaseline, bool firstLine, LineDirectionMode , LinePositionMode = PositionOnContainingLine) const override; 470 virtual int baselinePosition(FontBaseline, bool firstLine, LineDirectionMode , LinePositionMode = PositionOnContainingLine) const override;
477 471
478 virtual LayoutUnit offsetLeft() const override; 472 virtual LayoutUnit offsetLeft() const override;
479 virtual LayoutUnit offsetTop() const override; 473 virtual LayoutUnit offsetTop() const override;
480 474
481 // These represent your location relative to your container as a physical of fset. 475 LayoutRect layoutOverflowRectForPropagation() const;
482 // In layout related methods you almost always want the logical location (e. g. x() and y()).
483 LayoutPoint topLeftLocation() const;
484 LayoutSize topLeftLocationOffset() const;
485
486 LayoutRect logicalVisualOverflowRectForPropagation(RenderStyle*) const;
487 LayoutRect visualOverflowRectForPropagation(RenderStyle*) const;
488 LayoutRect logicalLayoutOverflowRectForPropagation(RenderStyle*) const;
489 LayoutRect layoutOverflowRectForPropagation(RenderStyle*) const;
490 476
491 bool hasRenderOverflow() const { return m_overflow; } 477 bool hasRenderOverflow() const { return m_overflow; }
492 bool hasVisualOverflow() const { return m_overflow && !borderBoxRect().conta ins(m_overflow->visualOverflowRect()); } 478 bool hasVisualOverflow() const { return m_overflow && !borderBoxRect().conta ins(m_overflow->visualOverflowRect()); }
493 479
494 virtual bool needsPreferredWidthsRecalculation() const; 480 virtual bool needsPreferredWidthsRecalculation() const;
495 virtual void computeIntrinsicRatioInformation(FloatSize& /* intrinsicSize */ , double& /* intrinsicRatio */) const { } 481 virtual void computeIntrinsicRatioInformation(FloatSize& /* intrinsicSize */ , double& /* intrinsicRatio */) const { }
496 482
497 IntSize scrolledContentOffset() const; 483 IntSize scrolledContentOffset() const;
498 void applyCachedClipAndScrollOffsetForPaintInvalidation(LayoutRect& paintRec t) const; 484 void applyCachedClipAndScrollOffsetForPaintInvalidation(LayoutRect& paintRec t) const;
499 485
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
678 if (UNLIKELY(inlineBoxWrapper() != 0)) 664 if (UNLIKELY(inlineBoxWrapper() != 0))
679 deleteLineBoxWrapper(); 665 deleteLineBoxWrapper();
680 } 666 }
681 667
682 ensureRareData().m_inlineBoxWrapper = boxWrapper; 668 ensureRareData().m_inlineBoxWrapper = boxWrapper;
683 } 669 }
684 670
685 } // namespace blink 671 } // namespace blink
686 672
687 #endif // RenderBox_h 673 #endif // RenderBox_h
OLDNEW
« no previous file with comments | « sky/engine/core/rendering/RenderBlock.cpp ('k') | sky/engine/core/rendering/RenderBox.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698