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

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

Issue 1278543002: Include the whole outline into visual overflow (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Add comment for LayoutObject::addOutlineRects() Created 5 years, 3 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/layout/LayoutInline.cpp ('k') | Source/core/layout/LayoutObject.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) 2000 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 2000 Lars Knoll (knoll@kde.org)
3 * (C) 2000 Antti Koivisto (koivisto@kde.org) 3 * (C) 2000 Antti Koivisto (koivisto@kde.org)
4 * (C) 2000 Dirk Mueller (mueller@kde.org) 4 * (C) 2000 Dirk Mueller (mueller@kde.org)
5 * (C) 2004 Allan Sandfeld Jensen (kde@carewolf.com) 5 * (C) 2004 Allan Sandfeld Jensen (kde@carewolf.com)
6 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2012 Apple Inc. All r ights reserved. 6 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2012 Apple Inc. All r ights reserved.
7 * Copyright (C) 2009 Google Inc. All rights reserved. 7 * Copyright (C) 2009 Google Inc. All rights reserved.
8 * 8 *
9 * This library is free software; you can redistribute it and/or 9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Library General Public 10 * modify it under the terms of the GNU Library General Public
(...skipping 856 matching lines...) Expand 10 before | Expand all | Expand 10 after
867 virtual void invalidatePaintForOverflow(); 867 virtual void invalidatePaintForOverflow();
868 void invalidatePaintForOverflowIfNeeded(); 868 void invalidatePaintForOverflowIfNeeded();
869 869
870 void invalidatePaintIncludingNonCompositingDescendants(); 870 void invalidatePaintIncludingNonCompositingDescendants();
871 void setShouldDoFullPaintInvalidationIncludingNonCompositingDescendants(); 871 void setShouldDoFullPaintInvalidationIncludingNonCompositingDescendants();
872 872
873 // Returns the rect that should have paint invalidated whenever this object changes. The rect is in the view's 873 // Returns the rect that should have paint invalidated whenever this object changes. The rect is in the view's
874 // coordinate space. This method deals with outlines and overflow. 874 // coordinate space. This method deals with outlines and overflow.
875 virtual LayoutRect absoluteClippedOverflowRect() const; 875 virtual LayoutRect absoluteClippedOverflowRect() const;
876 virtual LayoutRect clippedOverflowRectForPaintInvalidation(const LayoutBoxMo delObject* paintInvalidationContainer, const PaintInvalidationState* = nullptr) const; 876 virtual LayoutRect clippedOverflowRectForPaintInvalidation(const LayoutBoxMo delObject* paintInvalidationContainer, const PaintInvalidationState* = nullptr) const;
877 virtual LayoutRect rectWithOutlineForPaintInvalidation(const LayoutBoxModelO bject* paintInvalidationContainer, LayoutUnit outlineWidth, const PaintInvalidat ionState* = nullptr) const;
878 877
879 // Given a rect in the object's coordinate space, compute a rect suitable fo r invalidating paints of 878 // Given a rect in the object's coordinate space, compute a rect suitable fo r invalidating paints of
880 // that rect in the coordinate space of paintInvalidationContainer. 879 // that rect in the coordinate space of paintInvalidationContainer.
881 virtual void mapRectToPaintInvalidationBacking(const LayoutBoxModelObject* p aintInvalidationContainer, LayoutRect&, const PaintInvalidationState*) const; 880 virtual void mapRectToPaintInvalidationBacking(const LayoutBoxModelObject* p aintInvalidationContainer, LayoutRect&, const PaintInvalidationState*) const;
882 881
883 // Return the offset to the column in which the specified point (in flow-thr ead coordinates) 882 // Return the offset to the column in which the specified point (in flow-thr ead coordinates)
884 // lives. This is used to convert a flow-thread point to a visual point. 883 // lives. This is used to convert a flow-thread point to a visual point.
885 virtual LayoutSize columnOffset(const LayoutPoint&) const { return LayoutSiz e(); } 884 virtual LayoutSize columnOffset(const LayoutPoint&) const { return LayoutSiz e(); }
886 885
887 virtual unsigned length() const { return 1; } 886 virtual unsigned length() const { return 1; }
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
982 981
983 // Pushes state onto LayoutGeometryMap about how to map coordinates from thi s layoutObject to its container, or ancestorToStopAt (whichever is encountered f irst). 982 // Pushes state onto LayoutGeometryMap about how to map coordinates from thi s layoutObject to its container, or ancestorToStopAt (whichever is encountered f irst).
984 // Returns the layoutObject which was mapped to (container or ancestorToStop At). 983 // Returns the layoutObject which was mapped to (container or ancestorToStop At).
985 virtual const LayoutObject* pushMappingToContainer(const LayoutBoxModelObjec t* ancestorToStopAt, LayoutGeometryMap&) const; 984 virtual const LayoutObject* pushMappingToContainer(const LayoutBoxModelObjec t* ancestorToStopAt, LayoutGeometryMap&) const;
986 985
987 bool shouldUseTransformFromContainer(const LayoutObject* container) const; 986 bool shouldUseTransformFromContainer(const LayoutObject* container) const;
988 void getTransformFromContainer(const LayoutObject* container, const LayoutSi ze& offsetInContainer, TransformationMatrix&) const; 987 void getTransformFromContainer(const LayoutObject* container, const LayoutSi ze& offsetInContainer, TransformationMatrix&) const;
989 988
990 bool createsGroup() const { return isTransparent() || hasMask() || hasFilter () || style()->hasBlendMode(); } 989 bool createsGroup() const { return isTransparent() || hasMask() || hasFilter () || style()->hasBlendMode(); }
991 990
991 // Collects rectangles that the outline of this object would be drawing arou nd of,
chrishtr 2015/08/28 00:37:27 s/around of/along the outside of/
Xianzhu 2015/08/28 03:48:04 Done.
992 // even if the object isn't styled with a outline for now.
992 virtual void addOutlineRects(Vector<LayoutRect>&, const LayoutPoint& additio nalOffset) const { } 993 virtual void addOutlineRects(Vector<LayoutRect>&, const LayoutPoint& additio nalOffset) const { }
993 994
994 // Compute a list of hit-test rectangles per layer rooted at this layoutObje ct. 995 // Compute a list of hit-test rectangles per layer rooted at this layoutObje ct.
995 virtual void computeLayerHitTestRects(LayerHitTestRects&) const; 996 virtual void computeLayerHitTestRects(LayerHitTestRects&) const;
996 997
997 RespectImageOrientationEnum shouldRespectImageOrientation() const; 998 RespectImageOrientationEnum shouldRespectImageOrientation() const;
998 999
999 bool isRelayoutBoundaryForInspector() const; 1000 bool isRelayoutBoundaryForInspector() const;
1000 1001
1001 // The previous paint invalidation rect, in the the space of the paint inval idation container (*not* the graphics layer that paints 1002 // The previous paint invalidation rect, in the the space of the paint inval idation container (*not* the graphics layer that paints
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after
1187 void setIsSlowRepaintObject(bool); 1188 void setIsSlowRepaintObject(bool);
1188 1189
1189 void clearSelfNeedsOverflowRecalcAfterStyleChange() { m_bitfields.setSelfNee dsOverflowRecalcAfterStyleChange(false); } 1190 void clearSelfNeedsOverflowRecalcAfterStyleChange() { m_bitfields.setSelfNee dsOverflowRecalcAfterStyleChange(false); }
1190 void clearChildNeedsOverflowRecalcAfterStyleChange() { m_bitfields.setChildN eedsOverflowRecalcAfterStyleChange(false); } 1191 void clearChildNeedsOverflowRecalcAfterStyleChange() { m_bitfields.setChildN eedsOverflowRecalcAfterStyleChange(false); }
1191 void setShouldInvalidateOverflowForPaint() { m_bitfields.setShouldInvalidate OverflowForPaint(true); } 1192 void setShouldInvalidateOverflowForPaint() { m_bitfields.setShouldInvalidate OverflowForPaint(true); }
1192 void setEverHadLayout() { m_bitfields.setEverHadLayout(true); } 1193 void setEverHadLayout() { m_bitfields.setEverHadLayout(true); }
1193 1194
1194 // Remove this object and all descendants from the containing LayoutFlowThre ad. 1195 // Remove this object and all descendants from the containing LayoutFlowThre ad.
1195 void removeFromLayoutFlowThread(); 1196 void removeFromLayoutFlowThread();
1196 1197
1198 bool containsInlineWithOutlineAndContinuation() const { return m_bitfields.c ontainsInlineWithOutlineAndContinuation(); }
1199 void setContainsInlineWithOutlineAndContinuation(bool b) { m_bitfields.setCo ntainsInlineWithOutlineAndContinuation(b); }
1200
1197 private: 1201 private:
1198 void fullyInvalidatePaint(const LayoutBoxModelObject& paintInvalidationConta iner, PaintInvalidationReason, const LayoutRect& oldBounds, const LayoutRect& ne wBounds); 1202 void fullyInvalidatePaint(const LayoutBoxModelObject& paintInvalidationConta iner, PaintInvalidationReason, const LayoutRect& oldBounds, const LayoutRect& ne wBounds);
1199 1203
1200 const LayoutRect& previousPaintInvalidationRect() const { return m_previousP aintInvalidationRect; } 1204 const LayoutRect& previousPaintInvalidationRect() const { return m_previousP aintInvalidationRect; }
1201 1205
1202 // Adjusts a paint invalidation rect in the space of |m_previousPaintInvalid ationRect| and |m_previousPositionFromPaintInvalidationBacking| 1206 // Adjusts a paint invalidation rect in the space of |m_previousPaintInvalid ationRect| and |m_previousPositionFromPaintInvalidationBacking|
1203 // to be in the space of the |paintInvalidationContainer|, 1207 // to be in the space of the |paintInvalidationContainer|,
1204 // if needed. They can be different only if |paintInvalidationContainer| is a composited scroller. 1208 // if needed. They can be different only if |paintInvalidationContainer| is a composited scroller.
1205 void adjustInvalidationRectForCompositedScrolling(LayoutRect&, const LayoutB oxModelObject& paintInvalidationContainer) const; 1209 void adjustInvalidationRectForCompositedScrolling(LayoutRect&, const LayoutB oxModelObject& paintInvalidationContainer) const;
1206 1210
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
1313 , m_hasReflection(false) 1317 , m_hasReflection(false)
1314 , m_hasCounterNodeMap(false) 1318 , m_hasCounterNodeMap(false)
1315 , m_everHadLayout(false) 1319 , m_everHadLayout(false)
1316 , m_ancestorLineBoxDirty(false) 1320 , m_ancestorLineBoxDirty(false)
1317 , m_hasPendingResourceUpdate(false) 1321 , m_hasPendingResourceUpdate(false)
1318 , m_isInsideFlowThread(false) 1322 , m_isInsideFlowThread(false)
1319 , m_subtreeChangeListenerRegistered(false) 1323 , m_subtreeChangeListenerRegistered(false)
1320 , m_notifiedOfSubtreeChange(false) 1324 , m_notifiedOfSubtreeChange(false)
1321 , m_consumesSubtreeChangeNotification(false) 1325 , m_consumesSubtreeChangeNotification(false)
1322 , m_childrenInline(false) 1326 , m_childrenInline(false)
1327 , m_containsInlineWithOutlineAndContinuation(false)
1323 , m_alwaysCreateLineBoxesForLayoutInline(false) 1328 , m_alwaysCreateLineBoxesForLayoutInline(false)
1324 , m_lastBoxDecorationBackgroundObscured(false) 1329 , m_lastBoxDecorationBackgroundObscured(false)
1325 , m_isSlowRepaintObject(false) 1330 , m_isSlowRepaintObject(false)
1326 , m_positionedState(IsStaticallyPositioned) 1331 , m_positionedState(IsStaticallyPositioned)
1327 , m_selectionState(SelectionNone) 1332 , m_selectionState(SelectionNone)
1328 , m_boxDecorationBackgroundState(NoBoxDecorationBackground) 1333 , m_boxDecorationBackgroundState(NoBoxDecorationBackground)
1329 , m_fullPaintInvalidationReason(PaintInvalidationNone) 1334 , m_fullPaintInvalidationReason(PaintInvalidationNone)
1330 { 1335 {
1331 } 1336 }
1332 1337
1333 // 32 bits have been used in the first word, and 16 in the second. 1338 // 32 bits have been used in the first word, and 17 in the second.
1334 ADD_BOOLEAN_BITFIELD(selfNeedsLayout, SelfNeedsLayout); 1339 ADD_BOOLEAN_BITFIELD(selfNeedsLayout, SelfNeedsLayout);
1335 ADD_BOOLEAN_BITFIELD(shouldInvalidateOverflowForPaint, ShouldInvalidateO verflowForPaint); // TODO(wangxianzhu): Remove for slimming paint v2. 1340 ADD_BOOLEAN_BITFIELD(shouldInvalidateOverflowForPaint, ShouldInvalidateO verflowForPaint); // TODO(wangxianzhu): Remove for slimming paint v2.
1336 ADD_BOOLEAN_BITFIELD(childShouldCheckForPaintInvalidation, ChildShouldCh eckForPaintInvalidation); 1341 ADD_BOOLEAN_BITFIELD(childShouldCheckForPaintInvalidation, ChildShouldCh eckForPaintInvalidation);
1337 ADD_BOOLEAN_BITFIELD(mayNeedPaintInvalidation, MayNeedPaintInvalidation) ; 1342 ADD_BOOLEAN_BITFIELD(mayNeedPaintInvalidation, MayNeedPaintInvalidation) ;
1338 ADD_BOOLEAN_BITFIELD(shouldInvalidateSelection, ShouldInvalidateSelectio n); // TODO(wangxianzhu): Remove for slimming paint v2. 1343 ADD_BOOLEAN_BITFIELD(shouldInvalidateSelection, ShouldInvalidateSelectio n); // TODO(wangxianzhu): Remove for slimming paint v2.
1339 ADD_BOOLEAN_BITFIELD(neededLayoutBecauseOfChildren, NeededLayoutBecauseO fChildren); // TODO(wangxianzhu): Remove for slimming paint v2. 1344 ADD_BOOLEAN_BITFIELD(neededLayoutBecauseOfChildren, NeededLayoutBecauseO fChildren); // TODO(wangxianzhu): Remove for slimming paint v2.
1340 ADD_BOOLEAN_BITFIELD(needsPositionedMovementLayout, NeedsPositionedMovem entLayout); 1345 ADD_BOOLEAN_BITFIELD(needsPositionedMovementLayout, NeedsPositionedMovem entLayout);
1341 ADD_BOOLEAN_BITFIELD(normalChildNeedsLayout, NormalChildNeedsLayout); 1346 ADD_BOOLEAN_BITFIELD(normalChildNeedsLayout, NormalChildNeedsLayout);
1342 ADD_BOOLEAN_BITFIELD(posChildNeedsLayout, PosChildNeedsLayout); 1347 ADD_BOOLEAN_BITFIELD(posChildNeedsLayout, PosChildNeedsLayout);
1343 ADD_BOOLEAN_BITFIELD(needsSimplifiedNormalFlowLayout, NeedsSimplifiedNor malFlowLayout); 1348 ADD_BOOLEAN_BITFIELD(needsSimplifiedNormalFlowLayout, NeedsSimplifiedNor malFlowLayout);
(...skipping 23 matching lines...) Expand all
1367 1372
1368 ADD_BOOLEAN_BITFIELD(isInsideFlowThread, IsInsideFlowThread); 1373 ADD_BOOLEAN_BITFIELD(isInsideFlowThread, IsInsideFlowThread);
1369 1374
1370 ADD_BOOLEAN_BITFIELD(subtreeChangeListenerRegistered, SubtreeChangeListe nerRegistered); 1375 ADD_BOOLEAN_BITFIELD(subtreeChangeListenerRegistered, SubtreeChangeListe nerRegistered);
1371 ADD_BOOLEAN_BITFIELD(notifiedOfSubtreeChange, NotifiedOfSubtreeChange); 1376 ADD_BOOLEAN_BITFIELD(notifiedOfSubtreeChange, NotifiedOfSubtreeChange);
1372 ADD_BOOLEAN_BITFIELD(consumesSubtreeChangeNotification, ConsumesSubtreeC hangeNotification); 1377 ADD_BOOLEAN_BITFIELD(consumesSubtreeChangeNotification, ConsumesSubtreeC hangeNotification);
1373 1378
1374 // from LayoutBlock 1379 // from LayoutBlock
1375 ADD_BOOLEAN_BITFIELD(childrenInline, ChildrenInline); 1380 ADD_BOOLEAN_BITFIELD(childrenInline, ChildrenInline);
1376 1381
1382 // from LayoutBlockFlow
1383 ADD_BOOLEAN_BITFIELD(containsInlineWithOutlineAndContinuation, ContainsI nlineWithOutlineAndContinuation);
1384
1377 // from LayoutInline 1385 // from LayoutInline
1378 ADD_BOOLEAN_BITFIELD(alwaysCreateLineBoxesForLayoutInline, AlwaysCreateL ineBoxesForLayoutInline); 1386 ADD_BOOLEAN_BITFIELD(alwaysCreateLineBoxesForLayoutInline, AlwaysCreateL ineBoxesForLayoutInline);
1379 1387
1380 // For slimming-paint. 1388 // For slimming-paint.
1381 ADD_BOOLEAN_BITFIELD(lastBoxDecorationBackgroundObscured, LastBoxDecorat ionBackgroundObscured); 1389 ADD_BOOLEAN_BITFIELD(lastBoxDecorationBackgroundObscured, LastBoxDecorat ionBackgroundObscured);
1382 1390
1383 ADD_BOOLEAN_BITFIELD(isSlowRepaintObject, IsSlowRepaintObject); 1391 ADD_BOOLEAN_BITFIELD(isSlowRepaintObject, IsSlowRepaintObject);
1384 1392
1385 private: 1393 private:
1386 unsigned m_positionedState : 2; // PositionedState 1394 unsigned m_positionedState : 2; // PositionedState
(...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after
1669 void showTree(const blink::LayoutObject*); 1677 void showTree(const blink::LayoutObject*);
1670 void showLineTree(const blink::LayoutObject*); 1678 void showLineTree(const blink::LayoutObject*);
1671 void showLayoutTree(const blink::LayoutObject* object1); 1679 void showLayoutTree(const blink::LayoutObject* object1);
1672 // We don't make object2 an optional parameter so that showLayoutTree 1680 // We don't make object2 an optional parameter so that showLayoutTree
1673 // can be called from gdb easily. 1681 // can be called from gdb easily.
1674 void showLayoutTree(const blink::LayoutObject* object1, const blink::LayoutObjec t* object2); 1682 void showLayoutTree(const blink::LayoutObject* object1, const blink::LayoutObjec t* object2);
1675 1683
1676 #endif 1684 #endif
1677 1685
1678 #endif // LayoutObject_h 1686 #endif // LayoutObject_h
OLDNEW
« no previous file with comments | « Source/core/layout/LayoutInline.cpp ('k') | Source/core/layout/LayoutObject.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698