OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006 Apple Inc. All rights reserved. |
3 * Copyright (C) 2008 Nikolas Zimmermann <zimmermann@kde.org> | 3 * Copyright (C) 2008 Nikolas Zimmermann <zimmermann@kde.org> |
4 * | 4 * |
5 * This library is free software; you can redistribute it and/or | 5 * This library is free software; you can redistribute it and/or |
6 * modify it under the terms of the GNU Library General Public | 6 * modify it under the terms of the GNU Library General Public |
7 * License as published by the Free Software Foundation; either | 7 * License as published by the Free Software Foundation; either |
8 * version 2 of the License, or (at your option) any later version. | 8 * version 2 of the License, or (at your option) any later version. |
9 * | 9 * |
10 * This library is distributed in the hope that it will be useful, | 10 * This library is distributed in the hope that it will be useful, |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 } | 131 } |
132 | 132 |
133 LayoutObject* SVGForeignObjectElement::createLayoutObject( | 133 LayoutObject* SVGForeignObjectElement::createLayoutObject( |
134 const ComputedStyle&) { | 134 const ComputedStyle&) { |
135 return new LayoutSVGForeignObject(this); | 135 return new LayoutSVGForeignObject(this); |
136 } | 136 } |
137 | 137 |
138 bool SVGForeignObjectElement::layoutObjectIsNeeded(const ComputedStyle& style) { | 138 bool SVGForeignObjectElement::layoutObjectIsNeeded(const ComputedStyle& style) { |
139 // Suppress foreignObject layoutObjects in SVG hidden containers. | 139 // Suppress foreignObject layoutObjects in SVG hidden containers. |
140 // (https://bugs.webkit.org/show_bug.cgi?id=87297) | 140 // (https://bugs.webkit.org/show_bug.cgi?id=87297) |
141 // Note that we currently do not support foreignObject instantiation via <use>
, hence it is safe | 141 // Note that we currently do not support foreignObject instantiation via |
142 // to use parentElement() here. If that changes, this method should be updated
to use | 142 // <use>, hence it is safe to use parentElement() here. If that changes, this |
143 // parentOrShadowHostElement() instead. | 143 // method should be updated to use parentOrShadowHostElement() instead. |
144 Element* ancestor = parentElement(); | 144 Element* ancestor = parentElement(); |
145 while (ancestor && ancestor->isSVGElement()) { | 145 while (ancestor && ancestor->isSVGElement()) { |
146 if (ancestor->layoutObject() && | 146 if (ancestor->layoutObject() && |
147 ancestor->layoutObject()->isSVGHiddenContainer()) | 147 ancestor->layoutObject()->isSVGHiddenContainer()) |
148 return false; | 148 return false; |
149 | 149 |
150 ancestor = ancestor->parentElement(); | 150 ancestor = ancestor->parentElement(); |
151 } | 151 } |
152 | 152 |
153 return SVGGraphicsElement::layoutObjectIsNeeded(style); | 153 return SVGGraphicsElement::layoutObjectIsNeeded(style); |
154 } | 154 } |
155 | 155 |
156 bool SVGForeignObjectElement::selfHasRelativeLengths() const { | 156 bool SVGForeignObjectElement::selfHasRelativeLengths() const { |
157 return m_x->currentValue()->isRelative() || | 157 return m_x->currentValue()->isRelative() || |
158 m_y->currentValue()->isRelative() || | 158 m_y->currentValue()->isRelative() || |
159 m_width->currentValue()->isRelative() || | 159 m_width->currentValue()->isRelative() || |
160 m_height->currentValue()->isRelative(); | 160 m_height->currentValue()->isRelative(); |
161 } | 161 } |
162 | 162 |
163 } // namespace blink | 163 } // namespace blink |
OLD | NEW |