⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 125727 in webkit


Ignore:
Timestamp:
Aug 15, 2012, 5:43:01 PM (14 years ago)
Author:
hayato@chromium.org
Message:

A 'load' event should be fired on the shadow host directly, not on an inner image element of shadow dom subtree.
https://bugs.webkit.org/show_bug.cgi?id=93920

Reviewed by Dimitri Glazkov.

Source/WebCore:

A 'load' event is a must-stoppable event at shadow boundary. So we
should fire a 'load' event on a shadow host directly, not on an
inner image element.

Test: fast/dom/shadow/shadowdom-for-image-event.html

  • html/HTMLImageLoader.cpp:

(WebCore::HTMLImageLoader::dispatchLoadEvent):

  • loader/ImageLoaderClient.h:

(WebCore::ImageLoaderClient::eventTarget):

LayoutTests:

  • fast/dom/shadow/shadowdom-for-image-event-expected.txt: Added.
  • fast/dom/shadow/shadowdom-for-image-event.html: Added.
Location:
trunk
Files:
2 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r125724 r125727  
     12012-08-15  Hayato Ito  <hayato@chromium.org>
     2
     3        A 'load' event should be fired on the shadow host directly, not on an inner image element of shadow dom subtree.
     4        https://bugs.webkit.org/show_bug.cgi?id=93920
     5
     6        Reviewed by Dimitri Glazkov.
     7
     8        * fast/dom/shadow/shadowdom-for-image-event-expected.txt: Added.
     9        * fast/dom/shadow/shadowdom-for-image-event.html: Added.
     10
    1112012-08-15  Lauro Neto  <lauro.neto@openbossa.org>
    212
  • trunk/Source/WebCore/ChangeLog

    r125718 r125727  
     12012-08-15  Hayato Ito  <hayato@chromium.org>
     2
     3        A 'load' event should be fired on the shadow host directly, not on an inner image element of shadow dom subtree.
     4        https://bugs.webkit.org/show_bug.cgi?id=93920
     5
     6        Reviewed by Dimitri Glazkov.
     7
     8        A 'load' event is a must-stoppable event at shadow boundary. So we
     9        should fire a 'load' event on a shadow host directly, not on an
     10        inner image element.
     11
     12        Test: fast/dom/shadow/shadowdom-for-image-event.html
     13
     14        * html/HTMLImageLoader.cpp:
     15        (WebCore::HTMLImageLoader::dispatchLoadEvent):
     16        * loader/ImageLoaderClient.h:
     17        (WebCore::ImageLoaderClient::eventTarget):
     18
    1192012-08-15  Otto Derek Cheung  <otcheung@rim.com>
    220
  • trunk/Source/WebCore/html/HTMLImageLoader.cpp

    r123121 r125727  
    5757    if (!errorOccurred && image()->response().httpStatusCode() >= 400)
    5858        errorOccurred = client()->sourceElement()->hasTagName(HTMLNames::objectTag); // An <object> considers a 404 to be an error and should fire onerror.
    59     client()->imageElement()->dispatchEvent(Event::create(errorOccurred ? eventNames().errorEvent : eventNames().loadEvent, false, false));
     59    client()->eventTarget()->dispatchEvent(Event::create(errorOccurred ? eventNames().errorEvent : eventNames().loadEvent, false, false));
    6060}
    6161
  • trunk/Source/WebCore/loader/ImageLoaderClient.h

    r122824 r125727  
    4343    virtual Element* sourceElement() = 0;
    4444    virtual Element* imageElement() = 0;
     45    Element* eventTarget() { return sourceElement(); }
    4546
    4647    virtual void refSourceElement() = 0;
Note: See TracChangeset for help on using the changeset viewer.