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 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 invalidateSVGPresentationAttributeStyle(); | 115 invalidateSVGPresentationAttributeStyle(); |
116 setNeedsStyleRecalc(LocalStyleChange, | 116 setNeedsStyleRecalc(LocalStyleChange, |
117 isWidthHeightAttribute ? StyleChangeReasonForTracing::create(StyleCh
angeReason::SVGContainerSizeChange) : StyleChangeReasonForTracing::fromAttribute
(attrName)); | 117 isWidthHeightAttribute ? StyleChangeReasonForTracing::create(StyleCh
angeReason::SVGContainerSizeChange) : StyleChangeReasonForTracing::fromAttribute
(attrName)); |
118 | 118 |
119 updateRelativeLengthsInformation(); | 119 updateRelativeLengthsInformation(); |
120 if (LayoutObject* renderer = this->layoutObject()) | 120 if (LayoutObject* renderer = this->layoutObject()) |
121 markForLayoutAndParentResourceInvalidation(renderer); | 121 markForLayoutAndParentResourceInvalidation(renderer); |
122 } | 122 } |
123 } | 123 } |
124 | 124 |
125 LayoutObject* SVGForeignObjectElement::createLayoutObject(const LayoutStyle&) | 125 LayoutObject* SVGForeignObjectElement::createLayoutObject(const ComputedStyle&) |
126 { | 126 { |
127 return new LayoutSVGForeignObject(this); | 127 return new LayoutSVGForeignObject(this); |
128 } | 128 } |
129 | 129 |
130 bool SVGForeignObjectElement::layoutObjectIsNeeded(const LayoutStyle& style) | 130 bool SVGForeignObjectElement::layoutObjectIsNeeded(const ComputedStyle& style) |
131 { | 131 { |
132 // Suppress foreignObject renderers in SVG hidden containers. | 132 // Suppress foreignObject renderers in SVG hidden containers. |
133 // (https://bugs.webkit.org/show_bug.cgi?id=87297) | 133 // (https://bugs.webkit.org/show_bug.cgi?id=87297) |
134 // Note that we currently do not support foreignObject instantiation via <us
e>, hence it is safe | 134 // Note that we currently do not support foreignObject instantiation via <us
e>, hence it is safe |
135 // to use parentElement() here. If that changes, this method should be updat
ed to use | 135 // to use parentElement() here. If that changes, this method should be updat
ed to use |
136 // parentOrShadowHostElement() instead. | 136 // parentOrShadowHostElement() instead. |
137 Element* ancestor = parentElement(); | 137 Element* ancestor = parentElement(); |
138 while (ancestor && ancestor->isSVGElement()) { | 138 while (ancestor && ancestor->isSVGElement()) { |
139 if (ancestor->layoutObject() && ancestor->layoutObject()->isSVGHiddenCon
tainer()) | 139 if (ancestor->layoutObject() && ancestor->layoutObject()->isSVGHiddenCon
tainer()) |
140 return false; | 140 return false; |
141 | 141 |
142 ancestor = ancestor->parentElement(); | 142 ancestor = ancestor->parentElement(); |
143 } | 143 } |
144 | 144 |
145 return SVGGraphicsElement::layoutObjectIsNeeded(style); | 145 return SVGGraphicsElement::layoutObjectIsNeeded(style); |
146 } | 146 } |
147 | 147 |
148 bool SVGForeignObjectElement::selfHasRelativeLengths() const | 148 bool SVGForeignObjectElement::selfHasRelativeLengths() const |
149 { | 149 { |
150 return m_x->currentValue()->isRelative() | 150 return m_x->currentValue()->isRelative() |
151 || m_y->currentValue()->isRelative() | 151 || m_y->currentValue()->isRelative() |
152 || m_width->currentValue()->isRelative() | 152 || m_width->currentValue()->isRelative() |
153 || m_height->currentValue()->isRelative(); | 153 || m_height->currentValue()->isRelative(); |
154 } | 154 } |
155 | 155 |
156 } // namespace blink | 156 } // namespace blink |
OLD | NEW |