| 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 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 bool isXYAttribute = attrName == SVGNames::xAttr || attrName == SVGNames::yA
ttr; | 93 bool isXYAttribute = attrName == SVGNames::xAttr || attrName == SVGNames::yA
ttr; |
| 94 | 94 |
| 95 if (isXYAttribute || isWidthHeightAttribute) { | 95 if (isXYAttribute || isWidthHeightAttribute) { |
| 96 SVGElement::InvalidationGuard invalidationGuard(this); | 96 SVGElement::InvalidationGuard invalidationGuard(this); |
| 97 | 97 |
| 98 invalidateSVGPresentationAttributeStyle(); | 98 invalidateSVGPresentationAttributeStyle(); |
| 99 setNeedsStyleRecalc(LocalStyleChange, | 99 setNeedsStyleRecalc(LocalStyleChange, |
| 100 isWidthHeightAttribute ? StyleChangeReasonForTracing::create(StyleCh
angeReason::SVGContainerSizeChange) : StyleChangeReasonForTracing::fromAttribute
(attrName)); | 100 isWidthHeightAttribute ? StyleChangeReasonForTracing::create(StyleCh
angeReason::SVGContainerSizeChange) : StyleChangeReasonForTracing::fromAttribute
(attrName)); |
| 101 | 101 |
| 102 updateRelativeLengthsInformation(); | 102 updateRelativeLengthsInformation(); |
| 103 if (LayoutObject* renderer = this->layoutObject()) | 103 if (LayoutObject* layoutObject = this->layoutObject()) |
| 104 markForLayoutAndParentResourceInvalidation(renderer); | 104 markForLayoutAndParentResourceInvalidation(layoutObject); |
| 105 | 105 |
| 106 return; | 106 return; |
| 107 } | 107 } |
| 108 | 108 |
| 109 SVGGraphicsElement::svgAttributeChanged(attrName); | 109 SVGGraphicsElement::svgAttributeChanged(attrName); |
| 110 } | 110 } |
| 111 | 111 |
| 112 LayoutObject* SVGForeignObjectElement::createLayoutObject(const ComputedStyle&) | 112 LayoutObject* SVGForeignObjectElement::createLayoutObject(const ComputedStyle&) |
| 113 { | 113 { |
| 114 return new LayoutSVGForeignObject(this); | 114 return new LayoutSVGForeignObject(this); |
| 115 } | 115 } |
| 116 | 116 |
| 117 bool SVGForeignObjectElement::layoutObjectIsNeeded(const ComputedStyle& style) | 117 bool SVGForeignObjectElement::layoutObjectIsNeeded(const ComputedStyle& style) |
| 118 { | 118 { |
| 119 // Suppress foreignObject renderers in SVG hidden containers. | 119 // Suppress foreignObject layoutObjects in SVG hidden containers. |
| 120 // (https://bugs.webkit.org/show_bug.cgi?id=87297) | 120 // (https://bugs.webkit.org/show_bug.cgi?id=87297) |
| 121 // Note that we currently do not support foreignObject instantiation via <us
e>, hence it is safe | 121 // Note that we currently do not support foreignObject instantiation via <us
e>, hence it is safe |
| 122 // to use parentElement() here. If that changes, this method should be updat
ed to use | 122 // to use parentElement() here. If that changes, this method should be updat
ed to use |
| 123 // parentOrShadowHostElement() instead. | 123 // parentOrShadowHostElement() instead. |
| 124 Element* ancestor = parentElement(); | 124 Element* ancestor = parentElement(); |
| 125 while (ancestor && ancestor->isSVGElement()) { | 125 while (ancestor && ancestor->isSVGElement()) { |
| 126 if (ancestor->layoutObject() && ancestor->layoutObject()->isSVGHiddenCon
tainer()) | 126 if (ancestor->layoutObject() && ancestor->layoutObject()->isSVGHiddenCon
tainer()) |
| 127 return false; | 127 return false; |
| 128 | 128 |
| 129 ancestor = ancestor->parentElement(); | 129 ancestor = ancestor->parentElement(); |
| 130 } | 130 } |
| 131 | 131 |
| 132 return SVGGraphicsElement::layoutObjectIsNeeded(style); | 132 return SVGGraphicsElement::layoutObjectIsNeeded(style); |
| 133 } | 133 } |
| 134 | 134 |
| 135 bool SVGForeignObjectElement::selfHasRelativeLengths() const | 135 bool SVGForeignObjectElement::selfHasRelativeLengths() const |
| 136 { | 136 { |
| 137 return m_x->currentValue()->isRelative() | 137 return m_x->currentValue()->isRelative() |
| 138 || m_y->currentValue()->isRelative() | 138 || m_y->currentValue()->isRelative() |
| 139 || m_width->currentValue()->isRelative() | 139 || m_width->currentValue()->isRelative() |
| 140 || m_height->currentValue()->isRelative(); | 140 || m_height->currentValue()->isRelative(); |
| 141 } | 141 } |
| 142 | 142 |
| 143 } // namespace blink | 143 } // namespace blink |
| OLD | NEW |