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

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

Issue 16402019: Remove clips where we can show that they are unnecessary. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: add TestExpectations for layout test changes due to crbug.com/249478 Created 7 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
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 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
171 171
172 // Visual and layout overflow are in the coordinate space of the box. This means that they aren't purely physical directions. 172 // Visual and layout overflow are in the coordinate space of the box. This means that they aren't purely physical directions.
173 // 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 173 // 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
174 // respectively are flipped when compared to their physical counterparts. F or example minX is on the left in vertical-lr, 174 // respectively are flipped when compared to their physical counterparts. F or example minX is on the left in vertical-lr,
175 // but it is on the right in vertical-rl. 175 // but it is on the right in vertical-rl.
176 LayoutRect layoutOverflowRect() const { return m_overflow ? m_overflow->layo utOverflowRect() : clientBoxRect(); } 176 LayoutRect layoutOverflowRect() const { return m_overflow ? m_overflow->layo utOverflowRect() : clientBoxRect(); }
177 IntRect pixelSnappedLayoutOverflowRect() const { return pixelSnappedIntRect( layoutOverflowRect()); } 177 IntRect pixelSnappedLayoutOverflowRect() const { return pixelSnappedIntRect( layoutOverflowRect()); }
178 LayoutSize maxLayoutOverflow() const { return LayoutSize(layoutOverflowRect( ).maxX(), layoutOverflowRect().maxY()); } 178 LayoutSize maxLayoutOverflow() const { return LayoutSize(layoutOverflowRect( ).maxX(), layoutOverflowRect().maxY()); }
179 LayoutUnit logicalLeftLayoutOverflow() const { return style()->isHorizontalW ritingMode() ? layoutOverflowRect().x() : layoutOverflowRect().y(); } 179 LayoutUnit logicalLeftLayoutOverflow() const { return style()->isHorizontalW ritingMode() ? layoutOverflowRect().x() : layoutOverflowRect().y(); }
180 LayoutUnit logicalRightLayoutOverflow() const { return style()->isHorizontal WritingMode() ? layoutOverflowRect().maxX() : layoutOverflowRect().maxY(); } 180 LayoutUnit logicalRightLayoutOverflow() const { return style()->isHorizontal WritingMode() ? layoutOverflowRect().maxX() : layoutOverflowRect().maxY(); }
181 181
182 virtual LayoutRect visualOverflowRect() const { return m_overflow ? m_overfl ow->visualOverflowRect() : borderBoxRect(); } 182 virtual LayoutRect visualOverflowRect() const { return m_overflow ? m_overfl ow->visualOverflowRect() : borderBoxRect(); }
183 LayoutUnit logicalLeftVisualOverflow() const { return style()->isHorizontalW ritingMode() ? visualOverflowRect().x() : visualOverflowRect().y(); } 183 LayoutUnit logicalLeftVisualOverflow() const { return style()->isHorizontalW ritingMode() ? visualOverflowRect().x() : visualOverflowRect().y(); }
184 LayoutUnit logicalRightVisualOverflow() const { return style()->isHorizontal WritingMode() ? visualOverflowRect().maxX() : visualOverflowRect().maxY(); } 184 LayoutUnit logicalRightVisualOverflow() const { return style()->isHorizontal WritingMode() ? visualOverflowRect().maxX() : visualOverflowRect().maxY(); }
185 185
186 LayoutRect overflowRectForPaintRejection() const; 186 LayoutRect overflowRectForPaintRejection() const;
187 187
188 void addLayoutOverflow(const LayoutRect&); 188 void addLayoutOverflow(const LayoutRect&);
189 void addVisualOverflow(const LayoutRect&); 189
190 190 enum VisualOverflowClipBehavior { VisualOverflowNotClipped, VisualOverflowCl ippedByContentsClip };
191 virtual void addVisualOverflow(const LayoutRect&, VisualOverflowClipBehavior );
Julien - ping for review 2013/06/19 19:42:58 Making this virtual seems to go in the wrong direc
jbroman 2013/08/02 14:28:17 I don't see how any other kind of box can have an
192
191 void addVisualEffectOverflow(); 193 void addVisualEffectOverflow();
192 void addOverflowFromChild(RenderBox* child) { addOverflowFromChild(child, ch ild->locationOffset()); } 194 void addOverflowFromChild(RenderBox* child) { addOverflowFromChild(child, ch ild->locationOffset()); }
193 void addOverflowFromChild(RenderBox* child, const LayoutSize& delta); 195 void addOverflowFromChild(RenderBox* child, const LayoutSize& delta);
194 void clearLayoutOverflow(); 196 void clearLayoutOverflow();
195 197
196 void updateLayerTransform(); 198 void updateLayerTransform();
197 199
198 LayoutUnit contentWidth() const { return clientWidth() - paddingLeft() - pad dingRight(); } 200 LayoutUnit contentWidth() const { return clientWidth() - paddingLeft() - pad dingRight(); }
199 LayoutUnit contentHeight() const { return clientHeight() - paddingTop() - pa ddingBottom(); } 201 LayoutUnit contentHeight() const { return clientHeight() - paddingTop() - pa ddingBottom(); }
200 LayoutUnit contentLogicalWidth() const { return style()->isHorizontalWriting Mode() ? contentWidth() : contentHeight(); } 202 LayoutUnit contentLogicalWidth() const { return style()->isHorizontalWriting Mode() ? contentWidth() : contentHeight(); }
201 LayoutUnit contentLogicalHeight() const { return style()->isHorizontalWritin gMode() ? contentHeight() : contentWidth(); } 203 LayoutUnit contentLogicalHeight() const { return style()->isHorizontalWritin gMode() ? contentHeight() : contentWidth(); }
202 204
203 // IE extensions. Used to calculate offsetWidth/Height. Overridden by inlin es (RenderFlow) 205 // IE extensions. Used to calculate offsetWidth/Height. Overridden by inlin es (RenderFlow)
204 // to return the remaining width on a given line (and the height of a single line). 206 // to return the remaining width on a given line (and the height of a single line).
205 virtual LayoutUnit offsetWidth() const { return width(); } 207 virtual LayoutUnit offsetWidth() const { return width(); }
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after
459 461
460 bool hasUnsplittableScrollingOverflow() const; 462 bool hasUnsplittableScrollingOverflow() const;
461 bool isUnsplittableForPagination() const; 463 bool isUnsplittableForPagination() const;
462 464
463 virtual LayoutRect localCaretRect(InlineBox*, int caretOffset, LayoutUnit* e xtraWidthToEndOfLine = 0); 465 virtual LayoutRect localCaretRect(InlineBox*, int caretOffset, LayoutUnit* e xtraWidthToEndOfLine = 0);
464 466
465 virtual LayoutRect overflowClipRect(const LayoutPoint& location, RenderRegio n*, OverlayScrollbarSizeRelevancy = IgnoreOverlayScrollbarSize); 467 virtual LayoutRect overflowClipRect(const LayoutPoint& location, RenderRegio n*, OverlayScrollbarSizeRelevancy = IgnoreOverlayScrollbarSize);
466 LayoutRect clipRect(const LayoutPoint& location, RenderRegion*); 468 LayoutRect clipRect(const LayoutPoint& location, RenderRegion*);
467 virtual bool hasControlClip() const { return false; } 469 virtual bool hasControlClip() const { return false; }
468 virtual LayoutRect controlClipRect(const LayoutPoint&) const { return Layout Rect(); } 470 virtual LayoutRect controlClipRect(const LayoutPoint&) const { return Layout Rect(); }
469 bool pushContentsClip(PaintInfo&, const LayoutPoint& accumulatedOffset); 471 bool pushContentsClip(PaintInfo&, const LayoutPoint& accumulatedOffset, cons t LayoutRect* visualOverflowRect = 0);
470 void popContentsClip(PaintInfo&, PaintPhase originalPhase, const LayoutPoint & accumulatedOffset); 472 void popContentsClip(PaintInfo&, PaintPhase originalPhase, const LayoutPoint & accumulatedOffset);
471 473
472 virtual void paintObject(PaintInfo&, const LayoutPoint&) { ASSERT_NOT_REACHE D(); } 474 virtual void paintObject(PaintInfo&, const LayoutPoint&) { ASSERT_NOT_REACHE D(); }
473 virtual void paintBoxDecorations(PaintInfo&, const LayoutPoint&); 475 virtual void paintBoxDecorations(PaintInfo&, const LayoutPoint&);
474 virtual void paintMask(PaintInfo&, const LayoutPoint&); 476 virtual void paintMask(PaintInfo&, const LayoutPoint&);
475 virtual void imageChanged(WrappedImagePtr, const IntRect* = 0); 477 virtual void imageChanged(WrappedImagePtr, const IntRect* = 0);
476 478
477 // Called when a positioned object moves but doesn't necessarily change size . A simplified layout is attempted 479 // Called when a positioned object moves but doesn't necessarily change size . A simplified layout is attempted
478 // that just updates the object's position. If the size does change, the obj ect remains dirty. 480 // that just updates the object's position. If the size does change, the obj ect remains dirty.
479 bool tryLayoutDoingPositionedMovementOnly() 481 bool tryLayoutDoingPositionedMovementOnly()
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after
736 if (UNLIKELY(m_inlineBoxWrapper != 0)) 738 if (UNLIKELY(m_inlineBoxWrapper != 0))
737 deleteLineBoxWrapper(); 739 deleteLineBoxWrapper();
738 } 740 }
739 741
740 m_inlineBoxWrapper = boxWrapper; 742 m_inlineBoxWrapper = boxWrapper;
741 } 743 }
742 744
743 } // namespace WebCore 745 } // namespace WebCore
744 746
745 #endif // RenderBox_h 747 #endif // RenderBox_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698