[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc

simon.fraser at apple.com simon.fraser at apple.com
Wed Dec 22 12:20:28 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 64487f9c5b5edafb51e432f4ba9950d110a74963
Author: simon.fraser at apple.com <simon.fraser at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Thu Aug 19 17:19:40 2010 +0000

    2010-08-19  Simon Fraser  <simon.fraser at apple.com>
    
            Reviewed by Nikolas Zimmermann.
    
            HTMLElement::isContentEditable() can cause an updateStyleIfNeeded() to happen in the middle of layout
            https://bugs.webkit.org/show_bug.cgi?id=21834
            <rdar://problem/8093653&8261394>
    
            If we're in the middle of layout, or painting, and something causes updateStyleIfNeeded() to
            get called, then we can end up entering recalcStyle() during layout or painting. This is bad
            because it can create/destry the renderers and RenderLayers which are in use by layout/painting.
            This is the cause of a number of random crashers, some of which show up more frequently
            in content which uses accelerated compositing.
    
            The changes here:
            1. Add an assertion in Document::updateStyleIfNeeded() that we are not laying out or painting.
            2. Remove calls to updateStyleIfNeeded() in editing and caret painting code
            3. Pass along information to CTM and BBox-related SVG methods to indicate whether it's safe
               to update style.
    
            Tested by new assertions and existing tests.
    
            * dom/Document.cpp:
            (WebCore::Document::updateStyleIfNeeded): New assertion that we are not mid-layout or painting.
            (WebCore::command): Call updateStyleIfNeeded() to ensure that subsequent calls to isContentEditable()
            return the correct result.
    
            * dom/Element.cpp:
            (WebCore::Element::focus): Move the supportsFocus() call to after style has been updated.
    
            * editing/SelectionController.cpp:
            (WebCore::SelectionController::localCaretRect):
            (WebCore::SelectionController::caretRepaintRect):
            (WebCore::SelectionController::paintCaret):
            * editing/SelectionController.h:
            (WebCore::SelectionController::localCaretRectForPainting): When painting, use localCaretRectForPainting()
            which does not update style. Make localCaretRect() non-const so allowing it to update style without ugly casts.
    
            * html/HTMLElement.cpp:
            (WebCore::HTMLElement::isContentEditable): Don't call updateStyleIfNeeded() here.
            (WebCore::HTMLElement::isContentRichlyEditable): Ditto.
            (WebCore::HTMLElement::contentEditable): Ditto.
    
            * page/FrameView.h:
            (WebCore::FrameView::isMidLayout): New accessor, used for asserting.
    
            * rendering/RenderPath.cpp:
            (WebCore::fillAndStrokePath): Pass DisallowStyleUpdate to getScreenCTM since we are painting.
            * rendering/RenderSVGResourceContainer.cpp:
            (WebCore::RenderSVGResourceContainer::transformOnNonScalingStroke): This is only called when
            painting, so use DisallowStyleUpdate.
    
            * svg/SVGElement.cpp:
            (WebCore::SVGElement::attributeChanged): Changes to the style attribute should not have
            side effects, since a call to Element::getAttribute() is allowed to result in a call to
            setAttribute() for the style attribute. To avoid updateStyleIfNeeded() during painting,
            this must not cause SVG to do extra work.
    
            * svg/SVGLocatable.cpp: Pass StyleUpdateStrategy down to these methods to indicate
            whether it's OK to update style.
            (WebCore::SVGLocatable::getBBox):
            (WebCore::SVGLocatable::computeCTM):
            (WebCore::SVGLocatable::getTransformToElement):
            * svg/SVGLocatable.h:
            (WebCore::SVGLocatable::):
            * svg/SVGStyledLocatableElement.cpp:
            (WebCore::SVGStyledLocatableElement::getBBox):
            (WebCore::SVGStyledLocatableElement::getCTM):
            (WebCore::SVGStyledLocatableElement::getScreenCTM):
            * svg/SVGStyledLocatableElement.h:
            * svg/SVGStyledTransformableElement.cpp:
            (WebCore::SVGStyledTransformableElement::getCTM):
            (WebCore::SVGStyledTransformableElement::getScreenCTM):
            (WebCore::SVGStyledTransformableElement::getBBox):
            * svg/SVGStyledTransformableElement.h:
            * svg/SVGTextElement.cpp:
            (WebCore::SVGTextElement::getBBox):
            (WebCore::SVGTextElement::getCTM):
            (WebCore::SVGTextElement::getScreenCTM):
            * svg/SVGTextElement.h:
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@65681 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index ec8fcdd..d9c2002 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,84 @@
+2010-08-19  Simon Fraser  <simon.fraser at apple.com>
+
+        Reviewed by Nikolas Zimmermann.
+
+        HTMLElement::isContentEditable() can cause an updateStyleIfNeeded() to happen in the middle of layout
+        https://bugs.webkit.org/show_bug.cgi?id=21834
+        <rdar://problem/8093653&8261394>
+        
+        If we're in the middle of layout, or painting, and something causes updateStyleIfNeeded() to
+        get called, then we can end up entering recalcStyle() during layout or painting. This is bad
+        because it can create/destry the renderers and RenderLayers which are in use by layout/painting.
+        This is the cause of a number of random crashers, some of which show up more frequently
+        in content which uses accelerated compositing.
+        
+        The changes here:
+        1. Add an assertion in Document::updateStyleIfNeeded() that we are not laying out or painting.
+        2. Remove calls to updateStyleIfNeeded() in editing and caret painting code
+        3. Pass along information to CTM and BBox-related SVG methods to indicate whether it's safe
+           to update style.
+
+        Tested by new assertions and existing tests.
+
+        * dom/Document.cpp:
+        (WebCore::Document::updateStyleIfNeeded): New assertion that we are not mid-layout or painting.
+        (WebCore::command): Call updateStyleIfNeeded() to ensure that subsequent calls to isContentEditable()
+        return the correct result.
+
+        * dom/Element.cpp:
+        (WebCore::Element::focus): Move the supportsFocus() call to after style has been updated.
+
+        * editing/SelectionController.cpp:
+        (WebCore::SelectionController::localCaretRect):
+        (WebCore::SelectionController::caretRepaintRect):
+        (WebCore::SelectionController::paintCaret):
+        * editing/SelectionController.h:
+        (WebCore::SelectionController::localCaretRectForPainting): When painting, use localCaretRectForPainting()
+        which does not update style. Make localCaretRect() non-const so allowing it to update style without ugly casts.
+
+        * html/HTMLElement.cpp:
+        (WebCore::HTMLElement::isContentEditable): Don't call updateStyleIfNeeded() here.
+        (WebCore::HTMLElement::isContentRichlyEditable): Ditto.
+        (WebCore::HTMLElement::contentEditable): Ditto.
+
+        * page/FrameView.h:
+        (WebCore::FrameView::isMidLayout): New accessor, used for asserting.
+
+        * rendering/RenderPath.cpp:
+        (WebCore::fillAndStrokePath): Pass DisallowStyleUpdate to getScreenCTM since we are painting.
+        * rendering/RenderSVGResourceContainer.cpp:
+        (WebCore::RenderSVGResourceContainer::transformOnNonScalingStroke): This is only called when
+        painting, so use DisallowStyleUpdate.
+
+        * svg/SVGElement.cpp:
+        (WebCore::SVGElement::attributeChanged): Changes to the style attribute should not have
+        side effects, since a call to Element::getAttribute() is allowed to result in a call to
+        setAttribute() for the style attribute. To avoid updateStyleIfNeeded() during painting,
+        this must not cause SVG to do extra work.
+
+        * svg/SVGLocatable.cpp: Pass StyleUpdateStrategy down to these methods to indicate
+        whether it's OK to update style.
+        (WebCore::SVGLocatable::getBBox):
+        (WebCore::SVGLocatable::computeCTM):
+        (WebCore::SVGLocatable::getTransformToElement):
+        * svg/SVGLocatable.h:
+        (WebCore::SVGLocatable::):
+        * svg/SVGStyledLocatableElement.cpp:
+        (WebCore::SVGStyledLocatableElement::getBBox):
+        (WebCore::SVGStyledLocatableElement::getCTM):
+        (WebCore::SVGStyledLocatableElement::getScreenCTM):
+        * svg/SVGStyledLocatableElement.h:
+        * svg/SVGStyledTransformableElement.cpp:
+        (WebCore::SVGStyledTransformableElement::getCTM):
+        (WebCore::SVGStyledTransformableElement::getScreenCTM):
+        (WebCore::SVGStyledTransformableElement::getBBox):
+        * svg/SVGStyledTransformableElement.h:
+        * svg/SVGTextElement.cpp:
+        (WebCore::SVGTextElement::getBBox):
+        (WebCore::SVGTextElement::getCTM):
+        (WebCore::SVGTextElement::getScreenCTM):
+        * svg/SVGTextElement.h:
+
 2010-08-19  Ryosuke Niwa  <rniwa at webkit.org>
 
         Reviewed by Darin Adler.
diff --git a/WebCore/dom/Document.cpp b/WebCore/dom/Document.cpp
index b86db5b..b6adc95 100644
--- a/WebCore/dom/Document.cpp
+++ b/WebCore/dom/Document.cpp
@@ -1476,6 +1476,8 @@ bail_out:
 
 void Document::updateStyleIfNeeded()
 {
+    ASSERT(!view() || (!view()->isInLayout() && !view()->isPainting()));
+    
     if (!childNeedsStyleRecalc() || inPageCache())
         return;
         
@@ -3763,6 +3765,9 @@ static Editor::Command command(Document* document, const String& commandName, bo
     Frame* frame = document->frame();
     if (!frame || frame->document() != document)
         return Editor::Command();
+
+    document->updateStyleIfNeeded();
+
     return frame->editor()->command(commandName,
         userInterface ? CommandFromDOMWithUserInterface : CommandFromDOM);
 }
diff --git a/WebCore/dom/Element.cpp b/WebCore/dom/Element.cpp
index 849b900..a469a42 100644
--- a/WebCore/dom/Element.cpp
+++ b/WebCore/dom/Element.cpp
@@ -1293,9 +1293,6 @@ void Element::focus(bool restorePreviousSelection)
     if (doc->focusedNode() == this)
         return;
 
-    if (!supportsFocus())
-        return;
-
     // If the stylesheets have already been loaded we can reliably check isFocusable.
     // If not, we continue and set the focused node on the focus controller below so
     // that it can be updated soon after attach. 
@@ -1305,6 +1302,9 @@ void Element::focus(bool restorePreviousSelection)
             return;
     }
 
+    if (!supportsFocus())
+        return;
+
     RefPtr<Node> protect;
     if (Page* page = doc->page()) {
         // Focus and change event handlers can cause us to lose our last ref.
diff --git a/WebCore/editing/SelectionController.cpp b/WebCore/editing/SelectionController.cpp
index 9ca375b..063783e 100644
--- a/WebCore/editing/SelectionController.cpp
+++ b/WebCore/editing/SelectionController.cpp
@@ -952,10 +952,10 @@ RenderObject* SelectionController::caretRenderer() const
     return paintedByBlock ? renderer : renderer->containingBlock();
 }
 
-IntRect SelectionController::localCaretRect() const
+IntRect SelectionController::localCaretRect()
 {
     if (m_needsLayout)
-        const_cast<SelectionController*>(this)->layout();
+        layout();
     
     return m_caretRect;
 }
@@ -987,7 +987,7 @@ static IntRect repaintRectForCaret(IntRect caret)
 
 IntRect SelectionController::caretRepaintRect() const
 {
-    return absoluteBoundsForLocalRect(repaintRectForCaret(localCaretRect()));
+    return absoluteBoundsForLocalRect(repaintRectForCaret(localCaretRectForPainting()));
 }
 
 bool SelectionController::recomputeCaretRect()
@@ -1079,7 +1079,7 @@ void SelectionController::paintCaret(GraphicsContext* context, int tx, int ty, c
     if (!m_selection.isCaret())
         return;
 
-    IntRect drawingRect = localCaretRect();
+    IntRect drawingRect = localCaretRectForPainting();
     drawingRect.move(tx, ty);
     IntRect caret = intersection(drawingRect, clipRect);
     if (caret.isEmpty())
diff --git a/WebCore/editing/SelectionController.h b/WebCore/editing/SelectionController.h
index 5d2ee9f..d5d6849 100644
--- a/WebCore/editing/SelectionController.h
+++ b/WebCore/editing/SelectionController.h
@@ -100,7 +100,9 @@ public:
     RenderObject* caretRenderer() const;
 
     // Caret rect local to the caret's renderer
-    IntRect localCaretRect() const;
+    IntRect localCaretRect();
+    IntRect localCaretRectForPainting() const { return m_caretRect; }
+
     // Bounds of (possibly transformed) caret in absolute coords
     IntRect absoluteCaretBounds();
     void setNeedsLayout(bool flag = true);
diff --git a/WebCore/html/HTMLElement.cpp b/WebCore/html/HTMLElement.cpp
index ff25e62..2f9c075 100644
--- a/WebCore/html/HTMLElement.cpp
+++ b/WebCore/html/HTMLElement.cpp
@@ -666,9 +666,9 @@ bool HTMLElement::isContentEditable() const
     if (document()->frame() && document()->frame()->isContentEditable())
         return true;
 
-    // FIXME: this is a terrible thing to do here:
-    // https://bugs.webkit.org/show_bug.cgi?id=21834
-    document()->updateStyleIfNeeded();
+    // Ideally we'd call ASSERT!needsStyleRecalc()) here, but
+    // ContainerNode::setFocus() calls setNeedsStyleRecalc(), so the assertion
+    // would fire in the middle of Document::setFocusedNode().
 
     if (!renderer()) {
         if (parentNode())
@@ -685,8 +685,6 @@ bool HTMLElement::isContentRichlyEditable() const
     if (document()->frame() && document()->frame()->isContentEditable())
         return true;
 
-    document()->updateStyleIfNeeded();
-
     if (!renderer()) {
         if (parentNode())
             return parentNode()->isContentEditable();
@@ -699,8 +697,6 @@ bool HTMLElement::isContentRichlyEditable() const
 
 String HTMLElement::contentEditable() const 
 {
-    document()->updateStyleIfNeeded();
-
     if (!renderer())
         return "false";
     
diff --git a/WebCore/page/FrameView.cpp b/WebCore/page/FrameView.cpp
index 70210a4..58a7ba7 100644
--- a/WebCore/page/FrameView.cpp
+++ b/WebCore/page/FrameView.cpp
@@ -203,7 +203,7 @@ void FrameView::reset()
     m_delayedLayout = false;
     m_doFullRepaint = true;
     m_layoutSchedulingEnabled = true;
-    m_midLayout = false;
+    m_inLayout = false;
     m_layoutCount = 0;
     m_nestedLayoutCount = 0;
     m_postLayoutTasksTimer.stop();
@@ -600,7 +600,7 @@ RenderObject* FrameView::layoutRoot(bool onlyDuringLayout) const
 
 void FrameView::layout(bool allowSubtree)
 {
-    if (m_midLayout)
+    if (m_inLayout)
         return;
 
     m_layoutTimer.stop();
@@ -772,11 +772,11 @@ void FrameView::layout(bool allowSubtree)
             view->disableLayoutState();
     }
         
-    m_midLayout = true;
+    m_inLayout = true;
     beginDeferredRepaints();
     root->layout();
     endDeferredRepaints();
-    m_midLayout = false;
+    m_inLayout = false;
 
     if (subtree) {
         RenderView* view = root->view();
diff --git a/WebCore/page/FrameView.h b/WebCore/page/FrameView.h
index cc32404..47dff43 100644
--- a/WebCore/page/FrameView.h
+++ b/WebCore/page/FrameView.h
@@ -88,6 +88,7 @@ public:
     void scheduleRelayoutOfSubtree(RenderObject*);
     void unscheduleRelayout();
     bool layoutPending() const;
+    bool isInLayout() const { return m_inLayout; }
 
     RenderObject* layoutRoot(bool onlyDuringLayout = false) const;
     int layoutCount() const { return m_layoutCount; }
@@ -317,7 +318,7 @@ private:
     RenderObject* m_layoutRoot;
     
     bool m_layoutSchedulingEnabled;
-    bool m_midLayout;
+    bool m_inLayout;
     int m_layoutCount;
     unsigned m_nestedLayoutCount;
     Timer<FrameView> m_postLayoutTasksTimer;
diff --git a/WebCore/rendering/RenderPath.cpp b/WebCore/rendering/RenderPath.cpp
index ddc2c45..b9ae6b0 100644
--- a/WebCore/rendering/RenderPath.cpp
+++ b/WebCore/rendering/RenderPath.cpp
@@ -141,7 +141,7 @@ static inline void fillAndStrokePath(const Path& path, GraphicsContext* context,
     if (RenderSVGResource* strokePaintingResource = RenderSVGResource::strokePaintingResource(object, style)) {
         if (style->svgStyle()->vectorEffect() == VE_NON_SCALING_STROKE) {
             SVGStyledTransformableElement* element = static_cast<SVGStyledTransformableElement*>(object->node());
-            AffineTransform transform = element->getScreenCTM();
+            AffineTransform transform = element->getScreenCTM(SVGLocatable::DisallowStyleUpdate);
             if (!transform.isInvertible())
                 return;
 
diff --git a/WebCore/rendering/RenderSVGResourceContainer.cpp b/WebCore/rendering/RenderSVGResourceContainer.cpp
index 5652dcc..f33eb85 100644
--- a/WebCore/rendering/RenderSVGResourceContainer.cpp
+++ b/WebCore/rendering/RenderSVGResourceContainer.cpp
@@ -184,7 +184,7 @@ AffineTransform RenderSVGResourceContainer::transformOnNonScalingStroke(RenderOb
 
     SVGStyledTransformableElement* element = static_cast<SVGStyledTransformableElement*>(object->node());
     AffineTransform transform = resourceTransform;
-    transform.multiply(element->getScreenCTM());
+    transform.multiply(element->getScreenCTM(SVGLocatable::DisallowStyleUpdate));
     return transform;
 }
 
diff --git a/WebCore/svg/SVGElement.cpp b/WebCore/svg/SVGElement.cpp
index 055efcc..1f99f24 100644
--- a/WebCore/svg/SVGElement.cpp
+++ b/WebCore/svg/SVGElement.cpp
@@ -312,7 +312,10 @@ void SVGElement::attributeChanged(Attribute* attr, bool preserveDecls)
     if (isSynchronizingSVGAttributes())
         return;
 
-    svgAttributeChanged(attr->name());
+    // Changes to the style attribute are processed lazily (see Element::getAttribute() and related methods),
+    // so we don't want changes to the style attribute to result in extra work here.
+    if (attr->name() != styleAttr)
+        svgAttributeChanged(attr->name());
 }
 
 void SVGElement::updateAnimatedSVGAttribute(const QualifiedName& name) const
diff --git a/WebCore/svg/SVGLocatable.cpp b/WebCore/svg/SVGLocatable.cpp
index 8147a88..b7b4440 100644
--- a/WebCore/svg/SVGLocatable.cpp
+++ b/WebCore/svg/SVGLocatable.cpp
@@ -71,10 +71,11 @@ SVGElement* SVGLocatable::farthestViewportElement(const SVGElement* element)
     return farthest;
 }
 
-FloatRect SVGLocatable::getBBox(const SVGElement* element)
+FloatRect SVGLocatable::getBBox(const SVGElement* element, StyleUpdateStrategy styleUpdateStrategy)
 {
     ASSERT(element);
-    element->document()->updateLayoutIgnorePendingStylesheets();
+    if (styleUpdateStrategy == AllowStyleUpdate)
+        element->document()->updateLayoutIgnorePendingStylesheets();
 
     // FIXME: Eventually we should support getBBox for detached elements.
     if (!element->renderer())
@@ -83,10 +84,11 @@ FloatRect SVGLocatable::getBBox(const SVGElement* element)
     return element->renderer()->objectBoundingBox();
 }
 
-AffineTransform SVGLocatable::computeCTM(const SVGElement* element, CTMScope mode)
+AffineTransform SVGLocatable::computeCTM(const SVGElement* element, CTMScope mode, StyleUpdateStrategy styleUpdateStrategy)
 {
     ASSERT(element);
-    element->document()->updateLayoutIgnorePendingStylesheets();
+    if (styleUpdateStrategy == AllowStyleUpdate)
+        element->document()->updateLayoutIgnorePendingStylesheets();
 
     AffineTransform ctm;
 
@@ -108,12 +110,12 @@ AffineTransform SVGLocatable::computeCTM(const SVGElement* element, CTMScope mod
     return ctm;
 }
 
-AffineTransform SVGLocatable::getTransformToElement(SVGElement* target, ExceptionCode& ec) const
+AffineTransform SVGLocatable::getTransformToElement(SVGElement* target, ExceptionCode& ec, StyleUpdateStrategy styleUpdateStrategy) const
 {
-    AffineTransform ctm = getCTM();
+    AffineTransform ctm = getCTM(styleUpdateStrategy);
 
     if (target && target->isStyledLocatable()) {
-        AffineTransform targetCTM = static_cast<SVGStyledLocatableElement*>(target)->getCTM();
+        AffineTransform targetCTM = static_cast<SVGStyledLocatableElement*>(target)->getCTM(styleUpdateStrategy);
         if (!targetCTM.isInvertible()) {
             ec = SVGException::SVG_MATRIX_NOT_INVERTABLE;
             return ctm;
diff --git a/WebCore/svg/SVGLocatable.h b/WebCore/svg/SVGLocatable.h
index 28df512..2e51dc5 100644
--- a/WebCore/svg/SVGLocatable.h
+++ b/WebCore/svg/SVGLocatable.h
@@ -40,10 +40,12 @@ public:
     virtual SVGElement* nearestViewportElement() const = 0;
     virtual SVGElement* farthestViewportElement() const = 0;
 
-    virtual FloatRect getBBox() const = 0;
-    virtual AffineTransform getCTM() const = 0;
-    virtual AffineTransform getScreenCTM() const = 0;
-    AffineTransform getTransformToElement(SVGElement*, ExceptionCode&) const;
+    enum StyleUpdateStrategy { AllowStyleUpdate, DisallowStyleUpdate };
+    
+    virtual FloatRect getBBox(StyleUpdateStrategy) const = 0;
+    virtual AffineTransform getCTM(StyleUpdateStrategy) const = 0;
+    virtual AffineTransform getScreenCTM(StyleUpdateStrategy) const = 0;
+    AffineTransform getTransformToElement(SVGElement*, ExceptionCode&, StyleUpdateStrategy = AllowStyleUpdate) const;
 
     static SVGElement* nearestViewportElement(const SVGElement*);
     static SVGElement* farthestViewportElement(const SVGElement*);
@@ -56,8 +58,8 @@ public:
 protected:
     virtual AffineTransform localCoordinateSpaceTransform(SVGLocatable::CTMScope) const { return AffineTransform(); }
 
-    static FloatRect getBBox(const SVGElement*);
-    static AffineTransform computeCTM(const SVGElement*, CTMScope);
+    static FloatRect getBBox(const SVGElement*, StyleUpdateStrategy);
+    static AffineTransform computeCTM(const SVGElement*, CTMScope, StyleUpdateStrategy);
 };
 
 } // namespace WebCore
diff --git a/WebCore/svg/SVGStyledLocatableElement.cpp b/WebCore/svg/SVGStyledLocatableElement.cpp
index 3d87da4..6b49542 100644
--- a/WebCore/svg/SVGStyledLocatableElement.cpp
+++ b/WebCore/svg/SVGStyledLocatableElement.cpp
@@ -50,19 +50,19 @@ SVGElement* SVGStyledLocatableElement::farthestViewportElement() const
     return SVGLocatable::farthestViewportElement(this);
 }
 
-FloatRect SVGStyledLocatableElement::getBBox() const
+FloatRect SVGStyledLocatableElement::getBBox(StyleUpdateStrategy styleUpdateStrategy) const
 {
-    return SVGLocatable::getBBox(this);
+    return SVGLocatable::getBBox(this, styleUpdateStrategy);
 }
 
-AffineTransform SVGStyledLocatableElement::getCTM() const
+AffineTransform SVGStyledLocatableElement::getCTM(StyleUpdateStrategy styleUpdateStrategy) const
 {
-    return SVGLocatable::computeCTM(this, SVGLocatable::NearestViewportScope);
+    return SVGLocatable::computeCTM(this, SVGLocatable::NearestViewportScope, styleUpdateStrategy);
 }
 
-AffineTransform SVGStyledLocatableElement::getScreenCTM() const
+AffineTransform SVGStyledLocatableElement::getScreenCTM(StyleUpdateStrategy styleUpdateStrategy) const
 {
-    return SVGLocatable::computeCTM(this, SVGLocatable::ScreenScope);
+    return SVGLocatable::computeCTM(this, SVGLocatable::ScreenScope, styleUpdateStrategy);
 }
 
 }
diff --git a/WebCore/svg/SVGStyledLocatableElement.h b/WebCore/svg/SVGStyledLocatableElement.h
index ef1c454..6eab7b0 100644
--- a/WebCore/svg/SVGStyledLocatableElement.h
+++ b/WebCore/svg/SVGStyledLocatableElement.h
@@ -40,9 +40,9 @@ namespace WebCore {
         virtual SVGElement* nearestViewportElement() const;
         virtual SVGElement* farthestViewportElement() const;
 
-        virtual FloatRect getBBox() const;
-        virtual AffineTransform getCTM() const;
-        virtual AffineTransform getScreenCTM() const;
+        virtual FloatRect getBBox(StyleUpdateStrategy = AllowStyleUpdate) const;
+        virtual AffineTransform getCTM(StyleUpdateStrategy = AllowStyleUpdate) const;
+        virtual AffineTransform getScreenCTM(StyleUpdateStrategy = AllowStyleUpdate) const;
 
         virtual AffineTransform localCoordinateSpaceTransform(SVGLocatable::CTMScope mode) const { return SVGLocatable::localCoordinateSpaceTransform(mode); }
     };
diff --git a/WebCore/svg/SVGStyledTransformableElement.cpp b/WebCore/svg/SVGStyledTransformableElement.cpp
index 84af351..279f437 100644
--- a/WebCore/svg/SVGStyledTransformableElement.cpp
+++ b/WebCore/svg/SVGStyledTransformableElement.cpp
@@ -43,14 +43,14 @@ SVGStyledTransformableElement::~SVGStyledTransformableElement()
 {
 }
 
-AffineTransform SVGStyledTransformableElement::getCTM() const
+AffineTransform SVGStyledTransformableElement::getCTM(StyleUpdateStrategy styleUpdateStrategy) const
 {
-    return SVGLocatable::computeCTM(this, SVGLocatable::NearestViewportScope);
+    return SVGLocatable::computeCTM(this, SVGLocatable::NearestViewportScope, styleUpdateStrategy);
 }
 
-AffineTransform SVGStyledTransformableElement::getScreenCTM() const
+AffineTransform SVGStyledTransformableElement::getScreenCTM(StyleUpdateStrategy styleUpdateStrategy) const
 {
-    return SVGLocatable::computeCTM(this, SVGLocatable::ScreenScope);
+    return SVGLocatable::computeCTM(this, SVGLocatable::ScreenScope, styleUpdateStrategy);
 }
 
 AffineTransform SVGStyledTransformableElement::animatedLocalTransform() const
@@ -101,9 +101,9 @@ SVGElement* SVGStyledTransformableElement::farthestViewportElement() const
     return SVGTransformable::farthestViewportElement(this);
 }
 
-FloatRect SVGStyledTransformableElement::getBBox() const
+FloatRect SVGStyledTransformableElement::getBBox(StyleUpdateStrategy styleUpdateStrategy) const
 {
-    return SVGTransformable::getBBox(this);
+    return SVGTransformable::getBBox(this, styleUpdateStrategy);
 }
 
 RenderObject* SVGStyledTransformableElement::createRenderer(RenderArena* arena, RenderStyle*)
diff --git a/WebCore/svg/SVGStyledTransformableElement.h b/WebCore/svg/SVGStyledTransformableElement.h
index f020c89..1d7b197 100644
--- a/WebCore/svg/SVGStyledTransformableElement.h
+++ b/WebCore/svg/SVGStyledTransformableElement.h
@@ -38,8 +38,8 @@ public:
     
     virtual bool isStyledTransformable() const { return true; }
 
-    virtual AffineTransform getCTM() const;
-    virtual AffineTransform getScreenCTM() const;
+    virtual AffineTransform getCTM(StyleUpdateStrategy = AllowStyleUpdate) const;
+    virtual AffineTransform getScreenCTM(StyleUpdateStrategy = AllowStyleUpdate) const;
     virtual SVGElement* nearestViewportElement() const;
     virtual SVGElement* farthestViewportElement() const;
 
@@ -47,7 +47,7 @@ public:
     virtual AffineTransform animatedLocalTransform() const;
     virtual AffineTransform* supplementalTransform();
 
-    virtual FloatRect getBBox() const;
+    virtual FloatRect getBBox(StyleUpdateStrategy = AllowStyleUpdate) const;
 
     virtual void parseMappedAttribute(Attribute*);
     virtual void synchronizeProperty(const QualifiedName&);
diff --git a/WebCore/svg/SVGTextElement.cpp b/WebCore/svg/SVGTextElement.cpp
index 57774cd..e13e611 100644
--- a/WebCore/svg/SVGTextElement.cpp
+++ b/WebCore/svg/SVGTextElement.cpp
@@ -68,19 +68,19 @@ SVGElement* SVGTextElement::farthestViewportElement() const
     return SVGTransformable::farthestViewportElement(this);
 }
 
-FloatRect SVGTextElement::getBBox() const
+FloatRect SVGTextElement::getBBox(StyleUpdateStrategy styleUpdateStrategy) const
 {
-    return SVGTransformable::getBBox(this);
+    return SVGTransformable::getBBox(this, styleUpdateStrategy);
 }
 
-AffineTransform SVGTextElement::getCTM() const
+AffineTransform SVGTextElement::getCTM(StyleUpdateStrategy styleUpdateStrategy) const
 {
-    return SVGLocatable::computeCTM(this, SVGLocatable::NearestViewportScope);
+    return SVGLocatable::computeCTM(this, SVGLocatable::NearestViewportScope, styleUpdateStrategy);
 }
 
-AffineTransform SVGTextElement::getScreenCTM() const
+AffineTransform SVGTextElement::getScreenCTM(StyleUpdateStrategy styleUpdateStrategy) const
 {
-    return SVGLocatable::computeCTM(this, SVGLocatable::ScreenScope);
+    return SVGLocatable::computeCTM(this, SVGLocatable::ScreenScope, styleUpdateStrategy);
 }
 
 AffineTransform SVGTextElement::animatedLocalTransform() const
diff --git a/WebCore/svg/SVGTextElement.h b/WebCore/svg/SVGTextElement.h
index b954835..1788ea9 100644
--- a/WebCore/svg/SVGTextElement.h
+++ b/WebCore/svg/SVGTextElement.h
@@ -38,9 +38,9 @@ namespace WebCore {
         virtual SVGElement* nearestViewportElement() const;
         virtual SVGElement* farthestViewportElement() const;
 
-        virtual FloatRect getBBox() const;
-        virtual AffineTransform getCTM() const;
-        virtual AffineTransform getScreenCTM() const;
+        virtual FloatRect getBBox(StyleUpdateStrategy = AllowStyleUpdate) const;
+        virtual AffineTransform getCTM(StyleUpdateStrategy = AllowStyleUpdate) const;
+        virtual AffineTransform getScreenCTM(StyleUpdateStrategy = AllowStyleUpdate) const;
         virtual AffineTransform animatedLocalTransform() const;
         virtual AffineTransform* supplementalTransform();
         virtual AffineTransform localCoordinateSpaceTransform(SVGLocatable::CTMScope mode) const { return SVGTransformable::localCoordinateSpaceTransform(mode); }

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list