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

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: NeedsRebaseline for Mac Created 7 years, 4 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 22 matching lines...) Expand all
33 class RenderBoxRegionInfo; 33 class RenderBoxRegionInfo;
34 class RenderRegion; 34 class RenderRegion;
35 struct PaintInfo; 35 struct PaintInfo;
36 36
37 enum SizeType { MainOrPreferredSize, MinSize, MaxSize }; 37 enum SizeType { MainOrPreferredSize, MinSize, MaxSize };
38 enum AvailableLogicalHeightType { ExcludeMarginBorderPadding, IncludeMarginBorde rPadding }; 38 enum AvailableLogicalHeightType { ExcludeMarginBorderPadding, IncludeMarginBorde rPadding };
39 enum OverlayScrollbarSizeRelevancy { IgnoreOverlayScrollbarSize, IncludeOverlayS crollbarSize }; 39 enum OverlayScrollbarSizeRelevancy { IgnoreOverlayScrollbarSize, IncludeOverlayS crollbarSize };
40 40
41 enum ShouldComputePreferred { ComputeActual, ComputePreferred }; 41 enum ShouldComputePreferred { ComputeActual, ComputePreferred };
42 42
43 enum VisualOverflowClipBehavior { VisualOverflowNotClipped, VisualOverflowClippe dByContentsClip };
44 enum ContentsClipBehavior { ContentsClipRequired, ContentsClipAutomatic };
45
43 class RenderBox : public RenderBoxModelObject { 46 class RenderBox : public RenderBoxModelObject {
44 public: 47 public:
45 explicit RenderBox(ContainerNode*); 48 explicit RenderBox(ContainerNode*);
46 virtual ~RenderBox(); 49 virtual ~RenderBox();
47 50
48 // hasAutoZIndex only returns true if the element is positioned or a flex-it em since 51 // hasAutoZIndex only returns true if the element is positioned or a flex-it em since
49 // position:static elements that are not flex-items get their z-index coerce d to auto. 52 // position:static elements that are not flex-items get their z-index coerce d to auto.
50 virtual bool requiresLayer() const OVERRIDE { return isRoot() || isPositione d() || createsGroup() || hasClipPath() || hasOverflowClip() || hasTransform() || hasHiddenBackface() || hasReflection() || style()->specifiesColumns() || !style ()->hasAutoZIndex() || isFloatingWithShapeOutside(); } 53 virtual bool requiresLayer() const OVERRIDE { return isRoot() || isPositione d() || createsGroup() || hasClipPath() || hasOverflowClip() || hasTransform() || hasHiddenBackface() || hasReflection() || style()->specifiesColumns() || !style ()->hasAutoZIndex() || isFloatingWithShapeOutside(); }
51 54
52 virtual bool backgroundIsKnownToBeOpaqueInRect(const LayoutRect& localRect) const OVERRIDE; 55 virtual bool backgroundIsKnownToBeOpaqueInRect(const LayoutRect& localRect) const OVERRIDE;
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
179 LayoutSize maxLayoutOverflow() const { return LayoutSize(layoutOverflowRect( ).maxX(), layoutOverflowRect().maxY()); } 182 LayoutSize maxLayoutOverflow() const { return LayoutSize(layoutOverflowRect( ).maxX(), layoutOverflowRect().maxY()); }
180 LayoutUnit logicalLeftLayoutOverflow() const { return style()->isHorizontalW ritingMode() ? layoutOverflowRect().x() : layoutOverflowRect().y(); } 183 LayoutUnit logicalLeftLayoutOverflow() const { return style()->isHorizontalW ritingMode() ? layoutOverflowRect().x() : layoutOverflowRect().y(); }
181 LayoutUnit logicalRightLayoutOverflow() const { return style()->isHorizontal WritingMode() ? layoutOverflowRect().maxX() : layoutOverflowRect().maxY(); } 184 LayoutUnit logicalRightLayoutOverflow() const { return style()->isHorizontal WritingMode() ? layoutOverflowRect().maxX() : layoutOverflowRect().maxY(); }
182 185
183 virtual LayoutRect visualOverflowRect() const { return m_overflow ? m_overfl ow->visualOverflowRect() : borderBoxRect(); } 186 virtual LayoutRect visualOverflowRect() const { return m_overflow ? m_overfl ow->visualOverflowRect() : borderBoxRect(); }
184 LayoutUnit logicalLeftVisualOverflow() const { return style()->isHorizontalW ritingMode() ? visualOverflowRect().x() : visualOverflowRect().y(); } 187 LayoutUnit logicalLeftVisualOverflow() const { return style()->isHorizontalW ritingMode() ? visualOverflowRect().x() : visualOverflowRect().y(); }
185 LayoutUnit logicalRightVisualOverflow() const { return style()->isHorizontal WritingMode() ? visualOverflowRect().maxX() : visualOverflowRect().maxY(); } 188 LayoutUnit logicalRightVisualOverflow() const { return style()->isHorizontal WritingMode() ? visualOverflowRect().maxX() : visualOverflowRect().maxY(); }
186 189
187 LayoutRect overflowRectForPaintRejection() const; 190 LayoutRect overflowRectForPaintRejection() const;
188 191
192 LayoutRect contentsVisualOverflowRect() const { return m_overflow ? m_overfl ow->contentsVisualOverflowRect() : LayoutRect(); }
193
189 void addLayoutOverflow(const LayoutRect&); 194 void addLayoutOverflow(const LayoutRect&);
190 void addVisualOverflow(const LayoutRect&); 195 void addVisualOverflow(const LayoutRect&, VisualOverflowClipBehavior);
Julien - ping for review 2013/08/07 00:17:08 I would rather see 2 functions instead of adding a
jbroman 2013/08/08 14:35:39 Done.
191 196
192 void addVisualEffectOverflow(); 197 void addVisualEffectOverflow();
193 void addOverflowFromChild(RenderBox* child) { addOverflowFromChild(child, ch ild->locationOffset()); } 198 void addOverflowFromChild(RenderBox* child) { addOverflowFromChild(child, ch ild->locationOffset()); }
194 void addOverflowFromChild(RenderBox* child, const LayoutSize& delta); 199 void addOverflowFromChild(RenderBox* child, const LayoutSize& delta);
195 void clearLayoutOverflow(); 200 void clearLayoutOverflow();
196 201
197 void updateLayerTransform(); 202 void updateLayerTransform();
198 203
199 LayoutUnit contentWidth() const { return clientWidth() - paddingLeft() - pad dingRight(); } 204 LayoutUnit contentWidth() const { return clientWidth() - paddingLeft() - pad dingRight(); }
200 LayoutUnit contentHeight() const { return clientHeight() - paddingTop() - pa ddingBottom(); } 205 LayoutUnit contentHeight() const { return clientHeight() - paddingTop() - pa ddingBottom(); }
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after
463 468
464 bool hasUnsplittableScrollingOverflow() const; 469 bool hasUnsplittableScrollingOverflow() const;
465 bool isUnsplittableForPagination() const; 470 bool isUnsplittableForPagination() const;
466 471
467 virtual LayoutRect localCaretRect(InlineBox*, int caretOffset, LayoutUnit* e xtraWidthToEndOfLine = 0); 472 virtual LayoutRect localCaretRect(InlineBox*, int caretOffset, LayoutUnit* e xtraWidthToEndOfLine = 0);
468 473
469 virtual LayoutRect overflowClipRect(const LayoutPoint& location, RenderRegio n*, OverlayScrollbarSizeRelevancy = IgnoreOverlayScrollbarSize); 474 virtual LayoutRect overflowClipRect(const LayoutPoint& location, RenderRegio n*, OverlayScrollbarSizeRelevancy = IgnoreOverlayScrollbarSize);
470 LayoutRect clipRect(const LayoutPoint& location, RenderRegion*); 475 LayoutRect clipRect(const LayoutPoint& location, RenderRegion*);
471 virtual bool hasControlClip() const { return false; } 476 virtual bool hasControlClip() const { return false; }
472 virtual LayoutRect controlClipRect(const LayoutPoint&) const { return Layout Rect(); } 477 virtual LayoutRect controlClipRect(const LayoutPoint&) const { return Layout Rect(); }
473 bool pushContentsClip(PaintInfo&, const LayoutPoint& accumulatedOffset); 478 bool pushContentsClip(PaintInfo&, const LayoutPoint& accumulatedOffset, Cont entsClipBehavior = ContentsClipRequired);
474 void popContentsClip(PaintInfo&, PaintPhase originalPhase, const LayoutPoint & accumulatedOffset); 479 void popContentsClip(PaintInfo&, PaintPhase originalPhase, const LayoutPoint & accumulatedOffset);
475 480
476 virtual void paintObject(PaintInfo&, const LayoutPoint&) { ASSERT_NOT_REACHE D(); } 481 virtual void paintObject(PaintInfo&, const LayoutPoint&) { ASSERT_NOT_REACHE D(); }
477 virtual void paintBoxDecorations(PaintInfo&, const LayoutPoint&); 482 virtual void paintBoxDecorations(PaintInfo&, const LayoutPoint&);
478 virtual void paintMask(PaintInfo&, const LayoutPoint&); 483 virtual void paintMask(PaintInfo&, const LayoutPoint&);
479 virtual void imageChanged(WrappedImagePtr, const IntRect* = 0); 484 virtual void imageChanged(WrappedImagePtr, const IntRect* = 0);
480 485
481 // Called when a positioned object moves but doesn't necessarily change size . A simplified layout is attempted 486 // Called when a positioned object moves but doesn't necessarily change size . A simplified layout is attempted
482 // that just updates the object's position. If the size does change, the obj ect remains dirty. 487 // that just updates the object's position. If the size does change, the obj ect remains dirty.
483 bool tryLayoutDoingPositionedMovementOnly() 488 bool tryLayoutDoingPositionedMovementOnly()
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after
743 if (UNLIKELY(m_inlineBoxWrapper != 0)) 748 if (UNLIKELY(m_inlineBoxWrapper != 0))
744 deleteLineBoxWrapper(); 749 deleteLineBoxWrapper();
745 } 750 }
746 751
747 m_inlineBoxWrapper = boxWrapper; 752 m_inlineBoxWrapper = boxWrapper;
748 } 753 }
749 754
750 } // namespace WebCore 755 } // namespace WebCore
751 756
752 #endif // RenderBox_h 757 #endif // RenderBox_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698