Changeset 157010 in webkit


Ignore:
Timestamp:
Oct 6, 2013 3:28:35 PM (11 years ago)
Author:
Antti Koivisto
Message:

Don't try to dispatch resize events for SVG images
https://bugs.webkit.org/show_bug.cgi?id=122410

Reviewed by Darin Adler.

Tested by avoiding assertion in svg/custom/large-image-pattern-crash.html

  • page/FrameView.cpp:

(WebCore::FrameView::sendResizeEventIfNeeded):

Bail out for SVG images. They have scripting disabled so the event wouldn't do anything anyway.
Use of FrameView mechanisms is just an implementation detail for SVG images, they are not
meant to act like real frames.

  • rendering/svg/RenderSVGResourcePattern.cpp:

(WebCore::RenderSVGResourcePattern::createTileImage):

Switch to Element iterator. This will take NoEventDispatchAssertion verifying the change.

Location:
trunk/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r157008 r157010  
     12013-10-06  Antti Koivisto  <antti@apple.com>
     2
     3        Don't try to dispatch resize events for SVG images
     4        https://bugs.webkit.org/show_bug.cgi?id=122410
     5
     6        Reviewed by Darin Adler.
     7
     8        Tested by avoiding assertion in svg/custom/large-image-pattern-crash.html
     9
     10        * page/FrameView.cpp:
     11        (WebCore::FrameView::sendResizeEventIfNeeded):
     12       
     13            Bail out for SVG images. They have scripting disabled so the event wouldn't do anything anyway.
     14            Use of FrameView mechanisms is just an implementation detail for SVG images, they are not
     15            meant to act like real frames.
     16
     17        * rendering/svg/RenderSVGResourcePattern.cpp:
     18        (WebCore::RenderSVGResourcePattern::createTileImage):
     19       
     20            Switch to Element iterator. This will take NoEventDispatchAssertion verifying the change.
     21
    1222013-10-06  Andreas Kling  <akling@apple.com>
    223
  • trunk/Source/WebCore/page/FrameView.cpp

    r156977 r157010  
    27702770    if (!renderView || renderView->printing())
    27712771        return;
     2772    if (frame().page() && frame().page()->chrome().client().isSVGImageChromeClient())
     2773        return;
    27722774
    27732775    IntSize currentSize;
  • trunk/Source/WebCore/rendering/svg/RenderSVGResourcePattern.cpp

    r156954 r157010  
    2424#include "RenderSVGResourcePattern.h"
    2525
     26#include "ElementIterator.h"
    2627#include "FrameView.h"
    2728#include "GraphicsContext.h"
     
    272273
    273274    // Draw the content into the ImageBuffer.
    274     for (Node* node = attributes.patternContentElement()->firstChild(); node; node = node->nextSibling()) {
    275         if (!node->isSVGElement() || !node->renderer())
     275    auto children = childrenOfType<SVGElement>(attributes.patternContentElement());
     276    for (auto it = children.begin(), end = children.end(); it != end; ++it) {
     277        const SVGElement& child = *it;
     278        if (!child.renderer())
    276279            continue;
    277         if (node->renderer()->needsLayout())
     280        if (child.renderer()->needsLayout())
    278281            return nullptr;
    279         SVGRenderingContext::renderSubtreeToImageBuffer(tileImage.get(), node->renderer(), contentTransformation);
     282        SVGRenderingContext::renderSubtreeToImageBuffer(tileImage.get(), child.renderer(), contentTransformation);
    280283    }
    281284
Note: See TracChangeset for help on using the changeset viewer.