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

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

Issue 1477433004: Use LayoutUnit for SVG container size (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
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) 2004, 2005, 2007 Nikolas Zimmermann <zimmermann@kde.org> 2 * Copyright (C) 2004, 2005, 2007 Nikolas Zimmermann <zimmermann@kde.org>
3 * Copyright (C) 2004, 2005, 2007 Rob Buis <buis@kde.org> 3 * Copyright (C) 2004, 2005, 2007 Rob Buis <buis@kde.org>
4 * Copyright (C) 2009 Google, Inc. All rights reserved. 4 * Copyright (C) 2009 Google, Inc. All rights reserved.
5 * Copyright (C) 2009 Apple Inc. All rights reserved. 5 * Copyright (C) 2009 Apple Inc. All rights reserved.
6 * 6 *
7 * This library is free software; you can redistribute it and/or 7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public 8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either 9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version. 10 * version 2 of the License, or (at your option) any later version.
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 void slowFirstChild() const = delete; 44 void slowFirstChild() const = delete;
45 void slowLastChild() const = delete; 45 void slowLastChild() const = delete;
46 46
47 LayoutObject* firstChild() const { ASSERT(children() == virtualChildren()); return children()->firstChild(); } 47 LayoutObject* firstChild() const { ASSERT(children() == virtualChildren()); return children()->firstChild(); }
48 LayoutObject* lastChild() const { ASSERT(children() == virtualChildren()); r eturn children()->lastChild(); } 48 LayoutObject* lastChild() const { ASSERT(children() == virtualChildren()); r eturn children()->lastChild(); }
49 49
50 bool isLayoutSizeChanged() const { return m_isLayoutSizeChanged; } 50 bool isLayoutSizeChanged() const { return m_isLayoutSizeChanged; }
51 void setNeedsBoundariesUpdate() override { m_needsBoundariesOrTransformUpdat e = true; } 51 void setNeedsBoundariesUpdate() override { m_needsBoundariesOrTransformUpdat e = true; }
52 void setNeedsTransformUpdate() override { m_needsBoundariesOrTransformUpdate = true; } 52 void setNeedsTransformUpdate() override { m_needsBoundariesOrTransformUpdate = true; }
53 53
54 IntSize containerSize() const { return m_containerSize; } 54 LayoutSize containerSize() const { return m_containerSize; }
55 void setContainerSize(const IntSize& containerSize) 55 void setContainerSize(const LayoutSize& containerSize)
56 { 56 {
57 // SVGImage::draw() does a view layout prior to painting, 57 // SVGImage::draw() does a view layout prior to painting,
58 // and we need that layout to know of the new size otherwise 58 // and we need that layout to know of the new size otherwise
59 // the layout may be incorrectly using the old size. 59 // the layout may be incorrectly using the old size.
60 if (m_containerSize != containerSize) 60 if (m_containerSize != containerSize)
61 setNeedsLayoutAndFullPaintInvalidation(LayoutInvalidationReason::Siz eChanged); 61 setNeedsLayoutAndFullPaintInvalidation(LayoutInvalidationReason::Siz eChanged);
62 m_containerSize = containerSize; 62 m_containerSize = containerSize;
63 } 63 }
64 64
65 // localToBorderBoxTransform maps local SVG viewport coordinates to local CS S box coordinates. 65 // localToBorderBoxTransform maps local SVG viewport coordinates to local CS S box coordinates.
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 108
109 bool canBeSelectionLeaf() const override { return false; } 109 bool canBeSelectionLeaf() const override { return false; }
110 bool canHaveChildren() const override { return true; } 110 bool canHaveChildren() const override { return true; }
111 111
112 void descendantIsolationRequirementsChanged(DescendantIsolationState) final; 112 void descendantIsolationRequirementsChanged(DescendantIsolationState) final;
113 113
114 void updateCachedBoundaries(); 114 void updateCachedBoundaries();
115 void buildLocalToBorderBoxTransform(); 115 void buildLocalToBorderBoxTransform();
116 116
117 LayoutObjectChildList m_children; 117 LayoutObjectChildList m_children;
118 IntSize m_containerSize; 118 LayoutSize m_containerSize;
119 FloatRect m_objectBoundingBox; 119 FloatRect m_objectBoundingBox;
120 bool m_objectBoundingBoxValid; 120 bool m_objectBoundingBoxValid;
121 FloatRect m_strokeBoundingBox; 121 FloatRect m_strokeBoundingBox;
122 FloatRect m_paintInvalidationBoundingBox; 122 FloatRect m_paintInvalidationBoundingBox;
123 mutable AffineTransform m_localToParentTransform; 123 mutable AffineTransform m_localToParentTransform;
124 AffineTransform m_localToBorderBoxTransform; 124 AffineTransform m_localToBorderBoxTransform;
125 bool m_isLayoutSizeChanged : 1; 125 bool m_isLayoutSizeChanged : 1;
126 bool m_needsBoundariesOrTransformUpdate : 1; 126 bool m_needsBoundariesOrTransformUpdate : 1;
127 bool m_hasBoxDecorationBackground : 1; 127 bool m_hasBoxDecorationBackground : 1;
128 mutable bool m_hasNonIsolatedBlendingDescendants : 1; 128 mutable bool m_hasNonIsolatedBlendingDescendants : 1;
129 mutable bool m_hasNonIsolatedBlendingDescendantsDirty : 1; 129 mutable bool m_hasNonIsolatedBlendingDescendantsDirty : 1;
130 }; 130 };
131 131
132 DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutSVGRoot, isSVGRoot()); 132 DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutSVGRoot, isSVGRoot());
133 133
134 } // namespace blink 134 } // namespace blink
135 135
136 #endif // LayoutSVGRoot_h 136 #endif // LayoutSVGRoot_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/shapes/ShapeOutsideInfo.cpp ('k') | third_party/WebKit/Source/core/paint/BoxPainter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698