Changeset 26075 in webkit
- Timestamp:
- Oct 5, 2007 5:56:52 PM (17 years ago)
- Location:
- branches/feature-branch/WebCore
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/feature-branch/WebCore/ChangeLog
r26073 r26075 1 2007-10-05 Eric Seidel <eric@webkit.org> 2 3 Reviewed by Oliver Hunt. 4 5 SVG invalidates way too much during layout() 6 http://bugs.webkit.org/show_bug.cgi?id=14003 7 8 * ksvg2/svg/SVGElement.cpp: 9 (WebCore::SVGElement::ownerSVGElement): simplify if 10 (WebCore::SVGElement::viewportElement): simplify if 11 * rendering/RenderSVGContainer.cpp: 12 (WebCore::RenderSVGContainer::layout): only layout children if parent changed 13 * rendering/RenderSVGRoot.cpp: 14 (WebCore::RenderSVGRoot::layout): only layout children when size changes 15 * rendering/RenderSVGText.cpp: 16 (WebCore::RenderSVGText::layout): hack to avoid bad RenderBlock::layout code 17 * rendering/RenderSVGViewportContainer.cpp: 18 (WebCore::RenderSVGViewportContainer::layout): don't use RenderSVGContainer::layout() 19 1 20 2007-10-05 Oliver Hunt <oliver@apple.com> 2 21 -
branches/feature-branch/WebCore/ksvg2/svg/SVGElement.cpp
r25754 r26075 89 89 Node* n = parentNode(); 90 90 while (n) { 91 if (n-> nodeType() == ELEMENT_NODE && n->hasTagName(SVGNames::svgTag))91 if (n->hasTagName(SVGNames::svgTag)) 92 92 return static_cast<SVGSVGElement*>(n); 93 93 … … 104 104 Node* n = isShadowNode() ? const_cast<SVGElement*>(this)->shadowParentNode() : parentNode(); 105 105 while (n) { 106 if (n->isElementNode() && 107 (n->hasTagName(SVGNames::svgTag) || n->hasTagName(SVGNames::imageTag) || n->hasTagName(SVGNames::symbolTag))) 106 if (n->hasTagName(SVGNames::svgTag) || n->hasTagName(SVGNames::imageTag) || n->hasTagName(SVGNames::symbolTag)) 108 107 return static_cast<SVGElement*>(n); 109 108 -
branches/feature-branch/WebCore/rendering/RenderSVGContainer.cpp
r25880 r26075 235 235 IntRect oldOutlineBox; 236 236 bool checkForRepaint = checkForRepaintDuringLayout(); 237 if ( selfNeedsLayout() &&checkForRepaint) {237 if (checkForRepaint) { 238 238 oldBounds = m_absoluteBounds; 239 239 oldOutlineBox = absoluteOutlineBox(); … … 242 242 RenderObject* child = firstChild(); 243 243 while (child) { 244 // FIXME: This check is bogus, see http://bugs.webkit.org/show_bug.cgi?id=14003245 if ( !child->isRenderPath() || static_cast<RenderPath*>(child)->hasRelativeValues())244 // Only force our kids to layout if we're being asked to relayout as a result of a parent changing 245 if (selfNeedsLayout() && (!child->isRenderPath() || static_cast<RenderPath*>(child)->hasRelativeValues())) 246 246 child->setNeedsLayout(true); 247 247 … … 256 256 m_absoluteBounds = absoluteClippedOverflowRect(); 257 257 258 if ( selfNeedsLayout() &&checkForRepaint)258 if (checkForRepaint) 259 259 repaintAfterLayoutIfNeeded(oldBounds, oldOutlineBox); 260 260 -
branches/feature-branch/WebCore/rendering/RenderSVGRoot.cpp
r25957 r26075 71 71 view()->disableLayoutState(); 72 72 73 IntRect oldBounds ;73 IntRect oldBounds = m_absoluteBounds; 74 74 IntRect oldOutlineBox; 75 75 bool checkForRepaint = checkForRepaintDuringLayout(); 76 if (selfNeedsLayout() && checkForRepaint) { 77 oldBounds = m_absoluteBounds; 76 if (selfNeedsLayout() && checkForRepaint) 78 77 oldOutlineBox = absoluteOutlineBox(); 79 }80 81 RenderObject* child = firstChild();82 while (child) {83 // FIXME: This check is bogus, see http://bugs.webkit.org/show_bug.cgi?id=1400384 if (!child->isRenderPath() || static_cast<RenderPath*>(child)->hasRelativeValues())85 child->setNeedsLayout(true);86 87 child->layoutIfNeeded();88 ASSERT(!child->needsLayout());89 child = child->nextSibling();90 }91 78 92 79 calcWidth(); … … 97 84 m_width = m_width * svg->currentScale(); 98 85 m_height = m_height * svg->currentScale(); 86 87 bool boundsChanged = m_absoluteBounds != oldBounds; 88 89 if (boundsChanged || normalChildNeedsLayout() || posChildNeedsLayout()) { 90 for (RenderObject* child = firstChild(); child; child = child->nextSibling()) { 91 if (boundsChanged && (!child->isRenderPath() || static_cast<RenderPath*>(child)->hasRelativeValues())) 92 child->setNeedsLayout(true); 93 94 child->layoutIfNeeded(); 95 ASSERT(!child->needsLayout()); 96 } 97 } 99 98 100 99 if (selfNeedsLayout() && checkForRepaint) -
branches/feature-branch/WebCore/rendering/RenderSVGText.cpp
r25888 r26075 71 71 { 72 72 ASSERT(needsLayout()); 73 74 // FIXME: This is a hack to avoid the RenderBlock::layout() partial repainting code which is not (yet) SVG aware 75 setNeedsLayout(true); 73 76 74 77 IntRect oldBounds; -
branches/feature-branch/WebCore/rendering/RenderSVGViewportContainer.cpp
r25880 r26075 28 28 29 29 #include "GraphicsContext.h" 30 31 #include "RenderView.h" 30 32 #include "SVGMarkerElement.h" 31 33 #include "SVGSVGElement.h" … … 45 47 void RenderSVGViewportContainer::layout() 46 48 { 49 ASSERT(needsLayout()); 50 47 51 calcViewport(); 48 RenderSVGContainer::layout(); 52 53 // Arbitrary affine transforms are incompatible with LayoutState. 54 view()->disableLayoutState(); 55 56 IntRect oldBounds = m_absoluteBounds; 57 IntRect oldOutlineBox; 58 bool checkForRepaint = checkForRepaintDuringLayout(); 59 if (selfNeedsLayout() && checkForRepaint) 60 oldOutlineBox = absoluteOutlineBox(); 61 62 calcWidth(); 63 64 m_absoluteBounds = absoluteClippedOverflowRect(); 65 bool boundsChanged = m_absoluteBounds != oldBounds; 66 67 if (boundsChanged || normalChildNeedsLayout() || posChildNeedsLayout()) { 68 for (RenderObject* child = firstChild(); child; child = child->nextSibling()) { 69 if (boundsChanged && (!child->isRenderPath() || static_cast<RenderPath*>(child)->hasRelativeValues())) 70 child->setNeedsLayout(true); 71 72 child->layoutIfNeeded(); 73 ASSERT(!child->needsLayout()); 74 } 75 } 76 77 if (selfNeedsLayout() && checkForRepaint) 78 repaintAfterLayoutIfNeeded(oldBounds, oldOutlineBox); 79 80 view()->enableLayoutState(); 81 setNeedsLayout(false); 49 82 } 50 83
Note: See TracChangeset
for help on using the changeset viewer.