Changeset 160920 in webkit


Ignore:
Timestamp:
Dec 20, 2013, 12:49:23 PM (11 years ago)
Author:
Antti Koivisto
Message:

http/tests/misc/object-image-error.html asserts
https://bugs.webkit.org/show_bug.cgi?id=126074

Reviewed by Andreas Kling.

  • html/HTMLPlugInImageElement.cpp:

(WebCore::HTMLPlugInImageElement::didAttachRenderers):
(WebCore::HTMLPlugInImageElement::updateWidgetCallback):
(WebCore::HTMLPlugInImageElement::startLoadingImage):
(WebCore::HTMLPlugInImageElement::startLoadingImageCallback):

  • html/HTMLPlugInImageElement.h:


Start image load from post-attach so we don't re-enter attach when image load fails synchronously.

Location:
trunk/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r160916 r160920  
     12013-12-20  Antti Koivisto  <antti@apple.com>
     2
     3        http/tests/misc/object-image-error.html asserts
     4        https://bugs.webkit.org/show_bug.cgi?id=126074
     5
     6        Reviewed by Andreas Kling.
     7
     8        * html/HTMLPlugInImageElement.cpp:
     9        (WebCore::HTMLPlugInImageElement::didAttachRenderers):
     10        (WebCore::HTMLPlugInImageElement::updateWidgetCallback):
     11        (WebCore::HTMLPlugInImageElement::startLoadingImage):
     12        (WebCore::HTMLPlugInImageElement::startLoadingImageCallback):
     13        * html/HTMLPlugInImageElement.h:
     14       
     15            Start image load from post-attach so we don't re-enter attach when image load fails synchronously.
     16
    1172013-12-20  Antti Koivisto  <antti@apple.com>
    218
  • trunk/Source/WebCore/html/HTMLPlugInImageElement.cpp

    r160733 r160920  
    253253    if (!renderer() || useFallbackContent())
    254254        return;
    255     if (!m_imageLoader)
    256         m_imageLoader = adoptPtr(new HTMLImageLoader(this));
    257     m_imageLoader->updateFromElement();
     255
     256    // Image load might complete synchronously and cause us to re-enter attach.
     257    queuePostAttachCallback(&HTMLPlugInImageElement::startLoadingImageCallback, this);
    258258}
    259259
     
    335335}
    336336
    337 void HTMLPlugInImageElement::updateWidgetCallback(Node* n, unsigned)
    338 {
    339     toHTMLPlugInImageElement(n)->updateWidgetIfNecessary();
     337void HTMLPlugInImageElement::updateWidgetCallback(Node* node, unsigned)
     338{
     339    toHTMLPlugInImageElement(node)->updateWidgetIfNecessary();
     340}
     341
     342void HTMLPlugInImageElement::startLoadingImage()
     343{
     344    if (!m_imageLoader)
     345        m_imageLoader = adoptPtr(new HTMLImageLoader(this));
     346    m_imageLoader->updateFromElement();
     347}
     348
     349void HTMLPlugInImageElement::startLoadingImageCallback(Node* node, unsigned)
     350{
     351    toHTMLPlugInImageElement(node)->startLoadingImage();
    340352}
    341353
  • trunk/Source/WebCore/html/HTMLPlugInImageElement.h

    r160733 r160920  
    114114    URL m_loadedUrl;
    115115
    116     static void updateWidgetCallback(Node*, unsigned = 0);
     116    static void updateWidgetCallback(Node*, unsigned);
     117    static void startLoadingImageCallback(Node*, unsigned);
     118
    117119    virtual void didAttachRenderers() OVERRIDE;
    118120    virtual void willDetachRenderers() OVERRIDE;
     
    140142
    141143    void updateWidgetIfNecessary();
     144    void startLoadingImage();
    142145
    143146    virtual void updateSnapshot(PassRefPtr<Image>) OVERRIDE;
Note: See TracChangeset for help on using the changeset viewer.