Bug 25257 - event handlers are undefined in v8 binding of XMLHttpRequest.
Summary: event handlers are undefined in v8 binding of XMLHttpRequest.
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Fumitoshi Ukai
URL:
Keywords:
: 25258 (view as bug list)
Depends on:
Blocks:
 
Reported: 2009-04-16 18:04 PDT by Fumitoshi Ukai
Modified: 2014-04-24 16:45 PDT (History)
1 user (show)

See Also:


Attachments
use null for default event handlers in XMLHttpRequest and XMLHttpRequestUpload of v8 binding (7.79 KB, patch)
2009-04-16 20:14 PDT, Fumitoshi Ukai
dglazkov: review+
Details | Formatted Diff | Diff
use null for default event handlers in XMLHttpRequest and XMLHttpRequestUpload of v8 binding - ChangeLog entries fixed (7.85 KB, patch)
2009-04-17 11:14 PDT, Fumitoshi Ukai
dglazkov: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Fumitoshi Ukai 2009-04-16 18:04:41 PDT
XMLHttpRequest of v8 doesn't have correct event handlers by default.

For example, blogger.com uses the following snippet to detect whether the browser supports XMLHttpRequest.

function createXmlHttp() {
  if (window.XMLHttpRequest) {
    var r = new XMLHttpRequest();

    // some older version of mozilla had xmlhttprequest, but not
    // readystate. no reason to waste effort on them.
    if (r.readyState != null && typeof(r.onreadystatechange) != 'undefined') {
      return r;
    }
  } else {
    try {
      return new ActiveXObject("Microsoft.XMLHTTP");
    }
    catch (e) { 
      // do nothing because we just fall thorough to bottom...
    }
  }

  return null;
}

With v8 binding, r.onreadystatechange is undefined, so it is considered that the browser(chromium) doesn't support XMLHttpRequest.
v8 binding should return null if its event handler is not specified yet.
Comment 1 Mark Rowe (bdash) 2009-04-16 18:19:22 PDT
*** Bug 25258 has been marked as a duplicate of this bug. ***
Comment 2 Fumitoshi Ukai 2009-04-16 20:14:11 PDT
Created attachment 29570 [details]
use null for default event handlers in XMLHttpRequest and XMLHttpRequestUpload of v8 binding
Comment 3 Dimitri Glazkov (Google) 2009-04-17 10:57:48 PDT
Comment on attachment 29570 [details]
use null for default event handlers in XMLHttpRequest and XMLHttpRequestUpload of v8 binding

Great! Just two nits:

> +2009-04-16  Fumitoshi Ukai  <ukai@google.com>
> +
> +        Reviewed by NOBODY (OOPS!).
> +
> +	Use null for unspecified event listener attributes of XMLHttpRequest and XMLHttpRequestUpload in v8 binding.
> +	https://bugs.webkit.org/show_bug.cgi?id=25257
> +	cf.http://www.whatwg.org/specs/web-apps/current-work/#event-handler-attributes
> +	 An event handler attribute, unless otherwise specified, can either have the value null or be set to a Function object.
> +	 Initially, an event handler attribute must be set to null.

Indentation is off here as well as a line break missing?

> +2009-04-16  Fumitoshi Ukai  <ukai@google.com>
> +
> +        Reviewed by NOBODY (OOPS!).
> +
> +	Verify XMLHttpRequest has correct attribute value by default.
> +	https://bugs.webkit.org/show_bug.cgi?id=25257
> +

Ditto.
Comment 4 Fumitoshi Ukai 2009-04-17 11:14:08 PDT
Created attachment 29584 [details]
use null for default event handlers in XMLHttpRequest and XMLHttpRequestUpload of v8 binding - ChangeLog entries fixed

Thanks for reviewing.
Fixed ChangeLog entries.
Comment 5 Fumitoshi Ukai 2009-04-20 10:44:00 PDT
ping?

(In reply to comment #4)
> Created an attachment (id=29584) [review]
> use null for default event handlers in XMLHttpRequest and XMLHttpRequestUpload
> of v8 binding - ChangeLog entries fixed
> 
> Thanks for reviewing.
> Fixed ChangeLog entries.
> 

Comment 6 Dimitri Glazkov (Google) 2009-04-24 11:33:14 PDT
Landed as http://trac.webkit.org/changeset/42828.
Comment 7 Darin Adler 2014-04-24 16:45:00 PDT
Moving all JavaScriptGlue bugs to JavaScriptCore. The JavaScriptGlue framework itself is long gone. And most of the more recent bugs put in this component were put there by people who thought this was for some other aspect of “JavaScript glue” and have nothing to do with the actual original reason for the existence of this component, which was an OS-X-only framework named JavaScriptGlue.