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

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

Issue 1537133002: Renaming: distinguish ancestor, container and paintInvalidationContainer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@SelectionInvalidation
Patch Set: Created 5 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
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 757 matching lines...) Expand 10 before | Expand all | Expand 10 after
768 // positioned inline. containingBlock() simply skips relpositioned inlines 768 // positioned inline. containingBlock() simply skips relpositioned inlines
769 // and lets an enclosing block handle the layout of the positioned object. 769 // and lets an enclosing block handle the layout of the positioned object.
770 // This does mean that computePositionedLogicalWidth and 770 // This does mean that computePositionedLogicalWidth and
771 // computePositionedLogicalHeight have to use container(). 771 // computePositionedLogicalHeight have to use container().
772 // 772 //
773 // This function should be used for any invalidation as it would correctly 773 // This function should be used for any invalidation as it would correctly
774 // walk the containing block chain. See e.g. markContainerChainForLayout. 774 // walk the containing block chain. See e.g. markContainerChainForLayout.
775 // It is also used for correctly sizing absolutely positioned elements 775 // It is also used for correctly sizing absolutely positioned elements
776 // (point 3 above). 776 // (point 3 above).
777 // 777 //
778 // If |paintInvalidationContainer| and |paintInvalidationContainerSkipped| 778 // If |ancestor| and |ancestorSkipped| are not null, on return *ancestorSkip ped
779 // are not null, on return *paintInvalidationContainerSkipped is true if 779 // is true if the layoutObject returned is an ancestor of |ancestor|.
780 // the layoutObject returned is an ancestor of |paintInvalidationContainer|. 780 LayoutObject* container(const LayoutBoxModelObject* ancestor = nullptr, bool * ancestorSkipped = nullptr) const;
781 LayoutObject* container(const LayoutBoxModelObject* paintInvalidationContain er = nullptr, bool* paintInvalidationContainerSkipped = nullptr) const;
782 LayoutObject* containerCrossingFrameBoundaries() const; 781 LayoutObject* containerCrossingFrameBoundaries() const;
783 // Finds the container as if this object is fixed-position. 782 // Finds the container as if this object is fixed-position.
784 LayoutBlock* containerForFixedPosition(const LayoutBoxModelObject* paintInva lidationContainer = nullptr, bool* paintInvalidationContainerSkipped = nullptr) const; 783 LayoutBlock* containerForFixedPosition(const LayoutBoxModelObject* ancestor = nullptr, bool* ancestorSkipped = nullptr) const;
785 // Finds the containing block as if this object is absolute-position. 784 // Finds the containing block as if this object is absolute-position.
786 LayoutBlock* containingBlockForAbsolutePosition() const; 785 LayoutBlock* containingBlockForAbsolutePosition() const;
787 786
788 virtual LayoutObject* hoverAncestor() const { return parent(); } 787 virtual LayoutObject* hoverAncestor() const { return parent(); }
789 788
790 Element* offsetParent() const; 789 Element* offsetParent() const;
791 790
792 void markContainerChainForLayout(bool scheduleRelayout = true, SubtreeLayout Scope* = nullptr); 791 void markContainerChainForLayout(bool scheduleRelayout = true, SubtreeLayout Scope* = nullptr);
793 void setNeedsLayout(LayoutInvalidationReasonForTracing, MarkingBehavior = Ma rkContainerChain, SubtreeLayoutScope* = nullptr); 792 void setNeedsLayout(LayoutInvalidationReasonForTracing, MarkingBehavior = Ma rkContainerChain, SubtreeLayoutScope* = nullptr);
794 void setNeedsLayoutAndFullPaintInvalidation(LayoutInvalidationReasonForTraci ng, MarkingBehavior = MarkContainerChain, SubtreeLayoutScope* = nullptr); 793 void setNeedsLayoutAndFullPaintInvalidation(LayoutInvalidationReasonForTraci ng, MarkingBehavior = MarkContainerChain, SubtreeLayoutScope* = nullptr);
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
934 } 933 }
935 934
936 // Convert the given local point to absolute coordinates 935 // Convert the given local point to absolute coordinates
937 // FIXME: Temporary. If UseTransforms is true, take transforms into account. Eventually localToAbsolute() will always be transform-aware. 936 // FIXME: Temporary. If UseTransforms is true, take transforms into account. Eventually localToAbsolute() will always be transform-aware.
938 FloatPoint localToAbsolute(const FloatPoint& localPoint = FloatPoint(), MapC oordinatesFlags = 0) const; 937 FloatPoint localToAbsolute(const FloatPoint& localPoint = FloatPoint(), MapC oordinatesFlags = 0) const;
939 FloatPoint absoluteToLocal(const FloatPoint&, MapCoordinatesFlags = 0) const ; 938 FloatPoint absoluteToLocal(const FloatPoint&, MapCoordinatesFlags = 0) const ;
940 939
941 // Convert a local quad to absolute coordinates, taking transforms into acco unt. 940 // Convert a local quad to absolute coordinates, taking transforms into acco unt.
942 FloatQuad localToAbsoluteQuad(const FloatQuad& quad, MapCoordinatesFlags mod e = 0, bool* wasFixed = nullptr) const 941 FloatQuad localToAbsoluteQuad(const FloatQuad& quad, MapCoordinatesFlags mod e = 0, bool* wasFixed = nullptr) const
943 { 942 {
944 return localToContainerQuad(quad, 0, mode, wasFixed); 943 return localToAncestorQuad(quad, nullptr, mode, wasFixed);
945 } 944 }
946 // Convert an absolute quad to local coordinates. 945 // Convert an absolute quad to local coordinates.
947 FloatQuad absoluteToLocalQuad(const FloatQuad&, MapCoordinatesFlags mode = 0 ) const; 946 FloatQuad absoluteToLocalQuad(const FloatQuad&, MapCoordinatesFlags mode = 0 ) const;
948 947
949 // Convert a local quad into the coordinate system of container, taking tran sforms into account. 948 // Convert a local quad into the coordinate system of container, taking tran sforms into account.
950 FloatQuad localToContainerQuad(const FloatQuad&, const LayoutBoxModelObject* paintInvalidationContainer, MapCoordinatesFlags = 0, bool* wasFixed = nullptr) const; 949 FloatQuad localToAncestorQuad(const FloatQuad&, const LayoutBoxModelObject* ancestor, MapCoordinatesFlags = 0, bool* wasFixed = nullptr) const;
951 FloatPoint localToContainerPoint(const FloatPoint&, const LayoutBoxModelObje ct* paintInvalidationContainer, MapCoordinatesFlags = 0, bool* wasFixed = nullpt r, const PaintInvalidationState* = nullptr) const; 950 FloatPoint localToAncestorPoint(const FloatPoint&, const LayoutBoxModelObjec t* ancestor, MapCoordinatesFlags = 0, bool* wasFixed = nullptr, const PaintInval idationState* = nullptr) const;
952 void localToContainerRects(Vector<LayoutRect>&, const LayoutBoxModelObject* paintInvalidationContainer, const LayoutPoint& preOffset, const LayoutPoint& pos tOffset) const; 951 void localToAncestorRects(Vector<LayoutRect>&, const LayoutBoxModelObject* a ncestor, const LayoutPoint& preOffset, const LayoutPoint& postOffset) const;
953 952
954 // Convert a local point into the coordinate system of backing coordinates. Also returns the backing layer if needed. 953 // Convert a local point into the coordinate system of backing coordinates. Also returns the backing layer if needed.
955 FloatPoint localToInvalidationBackingPoint(const LayoutPoint&, PaintLayer** backingLayer = nullptr); 954 FloatPoint localToInvalidationBackingPoint(const LayoutPoint&, PaintLayer** backingLayer = nullptr);
956 955
957 // Return the offset from the container() layoutObject (excluding transforms ). In multi-column layout, 956 // Return the offset from the container() layoutObject (excluding transforms ). In multi-column layout,
958 // different offsets apply at different points, so return the offset that ap plies to the given point. 957 // different offsets apply at different points, so return the offset that ap plies to the given point.
959 virtual LayoutSize offsetFromContainer(const LayoutObject*, const LayoutPoin t&, bool* offsetDependsOnPoint = nullptr) const; 958 virtual LayoutSize offsetFromContainer(const LayoutObject*, const LayoutPoin t&, bool* offsetDependsOnPoint = nullptr) const;
960 // Return the offset from an object up the container() chain. Asserts that n one of the intermediate objects have transforms. 959 // Return the offset from an object up the container() chain. Asserts that n one of the intermediate objects have transforms.
961 LayoutSize offsetFromAncestorContainer(const LayoutObject*) const; 960 LayoutSize offsetFromAncestorContainer(const LayoutObject*) const;
962 961
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
1081 1080
1082 // Returns the rect that should have paint invalidated whenever this object changes. The rect is in the view's 1081 // Returns the rect that should have paint invalidated whenever this object changes. The rect is in the view's
1083 // coordinate space. This method deals with outlines and overflow. 1082 // coordinate space. This method deals with outlines and overflow.
1084 virtual LayoutRect absoluteClippedOverflowRect() const; 1083 virtual LayoutRect absoluteClippedOverflowRect() const;
1085 virtual LayoutRect clippedOverflowRectForPaintInvalidation(const LayoutBoxMo delObject* paintInvalidationContainer, const PaintInvalidationState* = nullptr) const; 1084 virtual LayoutRect clippedOverflowRectForPaintInvalidation(const LayoutBoxMo delObject* paintInvalidationContainer, const PaintInvalidationState* = nullptr) const;
1086 1085
1087 // Given a rect in the object's coordinate space, compute a rect suitable fo r invalidating paints of that 1086 // Given a rect in the object's coordinate space, compute a rect suitable fo r invalidating paints of that
1088 // rect in the coordinate space of paintInvalidationContainer. If intermedi ate containers have clipping or 1087 // rect in the coordinate space of paintInvalidationContainer. If intermedi ate containers have clipping or
1089 // scrolling of any kind, it is applied; but overflow clipping is *not* appl ied for paintInvalidationContainer 1088 // scrolling of any kind, it is applied; but overflow clipping is *not* appl ied for paintInvalidationContainer
1090 // itself. 1089 // itself.
1091 virtual void mapToVisibleRectInContainerSpace(const LayoutBoxModelObject* pa intInvalidationContainer, LayoutRect&, const PaintInvalidationState*) const; 1090 virtual void mapToVisibleRectInAncestorSpace(const LayoutBoxModelObject* anc estor, LayoutRect&, const PaintInvalidationState*) const;
1092 1091
1093 // Return the offset to the column in which the specified point (in flow-thr ead coordinates) 1092 // Return the offset to the column in which the specified point (in flow-thr ead coordinates)
1094 // lives. This is used to convert a flow-thread point to a visual point. 1093 // lives. This is used to convert a flow-thread point to a visual point.
1095 virtual LayoutSize columnOffset(const LayoutPoint&) const { return LayoutSiz e(); } 1094 virtual LayoutSize columnOffset(const LayoutPoint&) const { return LayoutSiz e(); }
1096 1095
1097 virtual unsigned length() const { return 1; } 1096 virtual unsigned length() const { return 1; }
1098 1097
1099 bool isFloatingOrOutOfFlowPositioned() const { return (isFloating() || isOut OfFlowPositioned()); } 1098 bool isFloatingOrOutOfFlowPositioned() const { return (isFloating() || isOut OfFlowPositioned()); }
1100 1099
1101 bool isTransparent() const { return style()->hasOpacity(); } 1100 bool isTransparent() const { return style()->hasOpacity(); }
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
1184 if (parent()) 1183 if (parent())
1185 parent()->removeChild(this); 1184 parent()->removeChild(this);
1186 } 1185 }
1187 1186
1188 bool visibleToHitTestRequest(const HitTestRequest& request) const { return s tyle()->visibility() == VISIBLE && (request.ignorePointerEventsNone() || style() ->pointerEvents() != PE_NONE) && !isInert(); } 1187 bool visibleToHitTestRequest(const HitTestRequest& request) const { return s tyle()->visibility() == VISIBLE && (request.ignorePointerEventsNone() || style() ->pointerEvents() != PE_NONE) && !isInert(); }
1189 1188
1190 bool visibleToHitTesting() const { return style()->visibility() == VISIBLE & & style()->pointerEvents() != PE_NONE && !isInert(); } 1189 bool visibleToHitTesting() const { return style()->visibility() == VISIBLE & & style()->pointerEvents() != PE_NONE && !isInert(); }
1191 1190
1192 // Map points and quads through elements, potentially via 3d transforms. You should never need to call these directly; use 1191 // Map points and quads through elements, potentially via 3d transforms. You should never need to call these directly; use
1193 // localToAbsolute/absoluteToLocal methods instead. 1192 // localToAbsolute/absoluteToLocal methods instead.
1194 virtual void mapLocalToContainer(const LayoutBoxModelObject* paintInvalidati onContainer, TransformState&, MapCoordinatesFlags = ApplyContainerFlip, bool* wa sFixed = nullptr, const PaintInvalidationState* = nullptr) const; 1193 virtual void mapLocalToAncestor(const LayoutBoxModelObject* ancestor, Transf ormState&, MapCoordinatesFlags = ApplyContainerFlip, bool* wasFixed = nullptr, c onst PaintInvalidationState* = nullptr) const;
1195 virtual void mapAbsoluteToLocalPoint(MapCoordinatesFlags, TransformState&) c onst; 1194 virtual void mapAbsoluteToLocalPoint(MapCoordinatesFlags, TransformState&) c onst;
1196 1195
1197 // Pushes state onto LayoutGeometryMap about how to map coordinates from thi s layoutObject to its container, or ancestorToStopAt (whichever is encountered f irst). 1196 // Pushes state onto LayoutGeometryMap about how to map coordinates from thi s layoutObject to its container, or ancestorToStopAt (whichever is encountered f irst).
1198 // Returns the layoutObject which was mapped to (container or ancestorToStop At). 1197 // Returns the layoutObject which was mapped to (container or ancestorToStop At).
1199 virtual const LayoutObject* pushMappingToContainer(const LayoutBoxModelObjec t* ancestorToStopAt, LayoutGeometryMap&) const; 1198 virtual const LayoutObject* pushMappingToContainer(const LayoutBoxModelObjec t* ancestorToStopAt, LayoutGeometryMap&) const;
1200 1199
1201 bool shouldUseTransformFromContainer(const LayoutObject* container) const; 1200 bool shouldUseTransformFromContainer(const LayoutObject* container) const;
1202 void getTransformFromContainer(const LayoutObject* container, const LayoutSi ze& offsetInContainer, TransformationMatrix&) const; 1201 void getTransformFromContainer(const LayoutObject* container, const LayoutSi ze& offsetInContainer, TransformationMatrix&) const;
1203 1202
1204 bool createsGroup() const { return isTransparent() || hasMask() || hasFilter () || style()->hasBlendMode(); } 1203 bool createsGroup() const { return isTransparent() || hasMask() || hasFilter () || style()->hasBlendMode(); }
(...skipping 856 matching lines...) Expand 10 before | Expand all | Expand 10 after
2061 void showTree(const blink::LayoutObject*); 2060 void showTree(const blink::LayoutObject*);
2062 void showLineTree(const blink::LayoutObject*); 2061 void showLineTree(const blink::LayoutObject*);
2063 void showLayoutTree(const blink::LayoutObject* object1); 2062 void showLayoutTree(const blink::LayoutObject* object1);
2064 // We don't make object2 an optional parameter so that showLayoutTree 2063 // We don't make object2 an optional parameter so that showLayoutTree
2065 // can be called from gdb easily. 2064 // can be called from gdb easily.
2066 void showLayoutTree(const blink::LayoutObject* object1, const blink::LayoutObjec t* object2); 2065 void showLayoutTree(const blink::LayoutObject* object1, const blink::LayoutObjec t* object2);
2067 2066
2068 #endif 2067 #endif
2069 2068
2070 #endif // LayoutObject_h 2069 #endif // LayoutObject_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutListMarker.cpp ('k') | third_party/WebKit/Source/core/layout/LayoutObject.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698