OLD | NEW |
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) 2007 Eric Seidel <eric@webkit.org> | 4 * Copyright (C) 2007 Eric Seidel <eric@webkit.org> |
5 * Copyright (C) 2009 Google, Inc. | 5 * Copyright (C) 2009 Google, Inc. |
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. |
11 * | 11 * |
12 * This library is distributed in the hope that it will be useful, | 12 * This library is distributed in the hope that it will be useful, |
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
15 * Library General Public License for more details. | 15 * Library General Public License for more details. |
16 * | 16 * |
17 * You should have received a copy of the GNU Library General Public License | 17 * You should have received a copy of the GNU Library General Public License |
18 * along with this library; see the file COPYING.LIB. If not, write to | 18 * along with this library; see the file COPYING.LIB. If not, write to |
19 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | 19 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
20 * Boston, MA 02110-1301, USA. | 20 * Boston, MA 02110-1301, USA. |
21 */ | 21 */ |
22 | 22 |
23 #include "core/layout/svg/LayoutSVGViewportContainer.h" | 23 #include "core/layout/svg/LayoutSVGViewportContainer.h" |
24 | 24 |
25 #include "core/layout/svg/SVGLayoutSupport.h" | 25 #include "core/layout/svg/SVGLayoutSupport.h" |
26 #include "core/paint/SVGContainerPainter.h" | |
27 #include "core/svg/SVGSVGElement.h" | 26 #include "core/svg/SVGSVGElement.h" |
28 #include "core/svg/SVGUseElement.h" | |
29 #include "platform/graphics/GraphicsContext.h" | |
30 | 27 |
31 namespace blink { | 28 namespace blink { |
32 | 29 |
33 LayoutSVGViewportContainer::LayoutSVGViewportContainer(SVGElement* node) | 30 LayoutSVGViewportContainer::LayoutSVGViewportContainer(SVGSVGElement* node) |
34 : LayoutSVGContainer(node), | 31 : LayoutSVGContainer(node), |
35 m_isLayoutSizeChanged(false), | 32 m_isLayoutSizeChanged(false), |
36 m_needsTransformUpdate(true) {} | 33 m_needsTransformUpdate(true) {} |
37 | 34 |
38 void LayoutSVGViewportContainer::determineIfLayoutSizeChanged() { | 35 void LayoutSVGViewportContainer::determineIfLayoutSizeChanged() { |
39 ASSERT(element()); | 36 DCHECK(isSVGSVGElement(element())); |
40 if (!isSVGSVGElement(*element())) | |
41 return; | |
42 | |
43 m_isLayoutSizeChanged = | 37 m_isLayoutSizeChanged = |
44 toSVGSVGElement(element())->hasRelativeLengths() && selfNeedsLayout(); | 38 toSVGSVGElement(element())->hasRelativeLengths() && selfNeedsLayout(); |
45 } | 39 } |
46 | 40 |
47 void LayoutSVGViewportContainer::setNeedsTransformUpdate() { | 41 void LayoutSVGViewportContainer::setNeedsTransformUpdate() { |
48 setMayNeedPaintInvalidationSubtree(); | 42 setMayNeedPaintInvalidationSubtree(); |
49 if (RuntimeEnabledFeatures::slimmingPaintInvalidationEnabled()) { | 43 if (RuntimeEnabledFeatures::slimmingPaintInvalidationEnabled()) { |
50 // The transform paint property relies on the SVG transform being up-to-date | 44 // The transform paint property relies on the SVG transform being up-to-date |
51 // (see: PaintPropertyTreeBuilder::updateTransformForNonRootSVG). | 45 // (see: PaintPropertyTreeBuilder::updateTransformForNonRootSVG). |
52 setNeedsPaintPropertyUpdate(); | 46 setNeedsPaintPropertyUpdate(); |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 HitTestAction action) { | 83 HitTestAction action) { |
90 // Respect the viewport clip which is in parent coordinates. | 84 // Respect the viewport clip which is in parent coordinates. |
91 if (SVGLayoutSupport::isOverflowHidden(this)) { | 85 if (SVGLayoutSupport::isOverflowHidden(this)) { |
92 if (!m_viewport.contains(pointInParent)) | 86 if (!m_viewport.contains(pointInParent)) |
93 return false; | 87 return false; |
94 } | 88 } |
95 return LayoutSVGContainer::nodeAtFloatPoint(result, pointInParent, action); | 89 return LayoutSVGContainer::nodeAtFloatPoint(result, pointInParent, action); |
96 } | 90 } |
97 | 91 |
98 } // namespace blink | 92 } // namespace blink |
OLD | NEW |