<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>80795</bug_id>
          
          <creation_ts>2012-03-11 13:15:19 -0700</creation_ts>
          <short_desc>Remove vestigal abortEvent from image attribute.</short_desc>
          <delta_ts>2012-03-13 14:59:28 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>New Bugs</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Gavin Peters">gavinp</reporter>
          <assigned_to name="Gavin Peters">gavinp</assigned_to>
          <cc>abarth</cc>
    
    <cc>ap</cc>
    
    <cc>darin</cc>
    
    <cc>webkit.review.bot</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>575826</commentid>
    <comment_count>0</comment_count>
    <who name="Gavin Peters">gavinp</who>
    <bug_when>2012-03-11 13:15:19 -0700</bug_when>
    <thetext>Remove vestigal abortEvent from image attribute.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>575827</commentid>
    <comment_count>1</comment_count>
      <attachid>131256</attachid>
    <who name="Gavin Peters">gavinp</who>
    <bug_when>2012-03-11 13:22:56 -0700</bug_when>
    <thetext>Created attachment 131256
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>575828</commentid>
    <comment_count>2</comment_count>
      <attachid>131256</attachid>
    <who name="Adam Barth">abarth</who>
    <bug_when>2012-03-11 14:20:25 -0700</bug_when>
    <thetext>Comment on attachment 131256
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=131256&amp;action=review

&gt; Source/WebCore/ChangeLog:11
&gt; +        It seems we installed a listener for the abort event on images,
&gt; +        but never ever raised them.  So this patch removes it.  This could
&gt; +        cause different behaviour if the user sends abort events directly
&gt; +        at an image element, although addEventListener will still work.

Do we need to remove any onabort attributes from the HTMLImageElement.idl ?  Do we understand why this code was added to WebKit?  Do other browsers let you install &quot;abort&quot; handlers using the onabort attribute (e.g., to receive custom abort events)?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>575842</commentid>
    <comment_count>3</comment_count>
    <who name="Gavin Peters">gavinp</who>
    <bug_when>2012-03-11 15:26:22 -0700</bug_when>
    <thetext>(In reply to comment #2)
&gt; (From update of attachment 131256 [details])
&gt; View in context: https://bugs.webkit.org/attachment.cgi?id=131256&amp;action=review
&gt; 
&gt; &gt; Source/WebCore/ChangeLog:11
&gt; &gt; +        It seems we installed a listener for the abort event on images,
&gt; &gt; +        but never ever raised them.  So this patch removes it.  This could
&gt; &gt; +        cause different behaviour if the user sends abort events directly
&gt; &gt; +        at an image element, although addEventListener will still work.
&gt; 
&gt; Do we need to remove any onabort attributes from the HTMLImageElement.idl ?

No.  The onabort event handler comes from HTMLElement.idl; lots of other events don&apos;t set up an abortEvent listener without problem.  See HTMLScriptElement.

&gt; Do we understand why this code was added to WebKit?

No.  The line was last editted in 2009 by eseidel when reorganising the source tree, and carried this over.  I believe it to be completely vestigal, but I haven&apos;t rooted back farther than that.

&gt;  Do other browsers let you install &quot;abort&quot; handlers using the onabort attribute (e.g., to receive custom abort events)?

I believe my comment above was premature above.  I&apos;m having a lot of trouble even constructing an event exception, and throwing it at an element.  So now I&apos;m not so sure I&apos;ve changed behaviour.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>575854</commentid>
    <comment_count>4</comment_count>
    <who name="Adam Barth">abarth</who>
    <bug_when>2012-03-11 17:12:41 -0700</bug_when>
    <thetext>&gt; &gt; Do we understand why this code was added to WebKit?
&gt; 
&gt; No.  The line was last editted in 2009 by eseidel when reorganising the source tree, and carried this over.  I believe it to be completely vestigal, but I haven&apos;t rooted back farther than that.

It would probably be worth digging back further in the history to understand why it was added in the first place.

&gt; &gt;  Do other browsers let you install &quot;abort&quot; handlers using the onabort attribute (e.g., to receive custom abort events)?
&gt; 
&gt; I believe my comment above was premature above.  I&apos;m having a lot of trouble even constructing an event exception, and throwing it at an element.  So now I&apos;m not so sure I&apos;ve changed behaviour.

You should be able to test this by creating an event, initializing with an eventType of &quot;abort&quot; and calling dispatchEvent at the appropriate element.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>577628</commentid>
    <comment_count>5</comment_count>
    <who name="Gavin Peters">gavinp</who>
    <bug_when>2012-03-13 11:59:33 -0700</bug_when>
    <thetext>Indeed, I was able to create and dispatch events in Firefox and Chrome for comparison.

Firefox seems to install handlers on all elements.  I successfully sent an abort event to a &lt;script&gt; in Firefox, and it ran the onabort code.  Then I got silly, and tried it with a &lt;b&gt;, and that worked too.  The onabort attr was installed as an handler.

We only install onabort handlers from the attribute in HTMLImageElement, HTMLMediaElement and SVGSVGElement.

In Media &amp; SVG elements, we actually raise abort events sometimes.  In Image, we do not.

So either way, we&apos;re being inconsistant.  Either we should install them on everything ala Firefox, or only install them where we fire the event ourselves.  I&apos;m not sure which is better.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>577798</commentid>
    <comment_count>6</comment_count>
    <who name="Gavin Peters">gavinp</who>
    <bug_when>2012-03-13 14:09:27 -0700</bug_when>
    <thetext>As for the history, this handler goes back to the initial revision. Behold WebCore/khtml/html/html_imageimpl.cpp as of 2001-08-24.

166	    case ATTR_ONABORT: // ### add support for this
167	        setHTMLEventListener(EventImpl::ABORT_EVENT,
168	            ownerDocument()-&gt;createHTMLEventListener(attr-&gt;value().string()));
169	        break;
170	    case ATTR_ONERROR: // ### add support for this
171	        setHTMLEventListener(EventImpl::ERROR_EVENT,
172	            ownerDocument()-&gt;createHTMLEventListener(attr-&gt;value().string()));
173	        break;
174	    case ATTR_ONLOAD:
175	        setHTMLEventListener(EventImpl::LOAD_EVENT,
176	            ownerDocument()-&gt;createHTMLEventListener(attr-&gt;value().string()));
177	        break;

In revision @2855 (2002-11-24), onerror was implemented, and that comment was removed, as that changeset sent out the error event from the resource on notifyFinished().

In 9824 in 2005-07-18, a refactoring changed events from being an enumeration to having an attribute class, and the comment was removed:

@@ -227,51 +213,40 @@
         }
         m_isLink = !attr-&gt;isNull();
-    case ATTR_ISMAP:
+    } else if (attr-&gt;name() == HTMLAttributes::ismap()) {
         ismap = true;
-        break;
-    case ATTR_ONABORT: // ### add support for this
+    } else if (attr-&gt;name() == HTMLAttributes::onabort()) {
         setHTMLEventListener(EventImpl::ABORT_EVENT,
-            getDocument()-&gt;createHTMLEventListener(attr-&gt;value().string(), this));
-        break;
-    case ATTR_ONERROR:
+                             getDocument()-&gt;createHTMLEventListener(attr-&gt;value().string(), this));
+    } else if (attr-&gt;name() == HTMLAttributes::onerror()) {
         setHTMLEventListener(EventImpl::ERROR_EVENT,
-            getDocument()-&gt;createHTMLEventListener(attr-&gt;value().string(), this));
-        break;

9824 didn&apos;t add any causes of abort, and it was a pretty big change (patch is ~35,000 lines).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>577805</commentid>
    <comment_count>7</comment_count>
      <attachid>131256</attachid>
    <who name="Adam Barth">abarth</who>
    <bug_when>2012-03-13 14:15:38 -0700</bug_when>
    <thetext>Comment on attachment 131256
Patch

Sounds like this is just vestigial.  In principle, we could add a test showing that it&apos;s not there, but I don&apos;t should add that test so we don&apos;t bias future developers against adding the event (if they want to use it for something).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>577844</commentid>
    <comment_count>8</comment_count>
      <attachid>131256</attachid>
    <who name="WebKit Review Bot">webkit.review.bot</who>
    <bug_when>2012-03-13 14:59:23 -0700</bug_when>
    <thetext>Comment on attachment 131256
Patch

Clearing flags on attachment: 131256

Committed r110618: &lt;http://trac.webkit.org/changeset/110618&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>577845</commentid>
    <comment_count>9</comment_count>
    <who name="WebKit Review Bot">webkit.review.bot</who>
    <bug_when>2012-03-13 14:59:28 -0700</bug_when>
    <thetext>All reviewed patches have been landed.  Closing bug.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>131256</attachid>
            <date>2012-03-11 13:22:56 -0700</date>
            <delta_ts>2012-03-13 14:59:23 -0700</delta_ts>
            <desc>Patch</desc>
            <filename>bug-80795-20120311162255.patch</filename>
            <type>text/plain</type>
            <size>1793</size>
            <attacher name="Gavin Peters">gavinp</attacher>
            
              <data encoding="base64">U3VidmVyc2lvbiBSZXZpc2lvbjogMTEwMzc4CmRpZmYgLS1naXQgYS9Tb3VyY2UvV2ViQ29yZS9D
aGFuZ2VMb2cgYi9Tb3VyY2UvV2ViQ29yZS9DaGFuZ2VMb2cKaW5kZXggNWVmNGM1ZTZmYTM2ZGE1
ZGQ0NGQwZTEyNjAwNzk1N2Y4YWJiNzgzMC4uZDE2NmI4ZDk5MTJkMzQ1OWYzMDJkNDlhMGRjOWVm
NDJiYjE4MTdlNSAxMDA2NDQKLS0tIGEvU291cmNlL1dlYkNvcmUvQ2hhbmdlTG9nCisrKyBiL1Nv
dXJjZS9XZWJDb3JlL0NoYW5nZUxvZwpAQCAtMSwzICsxLDE4IEBACisyMDEyLTAzLTExICBHYXZp
biBQZXRlcnMgIDxnYXZpbnBAY2hyb21pdW0ub3JnPgorCisgICAgICAgIFJlbW92ZSB2ZXN0aWdh
bCBhYm9ydEV2ZW50IGZyb20gaW1hZ2UgYXR0cmlidXRlLgorICAgICAgICBodHRwczovL2J1Z3Mu
d2Via2l0Lm9yZy9zaG93X2J1Zy5jZ2k/a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