Bug 40550

Summary: XMLHttpRequest constructor object should expose the constants from the IDL.
Product: WebKit Reporter: Sam Weinig <sam>
Component: WebCore JavaScriptAssignee: Sam Weinig <sam>
Status: RESOLVED FIXED    
Severity: Normal CC: abarth, ap, eric, webkit.review.bot
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: PC   
OS: OS X 10.5   
Attachments:
Description Flags
patch
none
Updated patch with new test andersca: review+

Sam Weinig
Reported 2010-06-13 17:02:42 PDT
The XMLHttpRequest constructor object should expose the constants from the IDL. For example, XMLHttpRequest.DONE should equal 4. This matches what we do for all other constructors and WebIDL.
Attachments
patch (30.82 KB, patch)
2010-06-13 17:05 PDT, Sam Weinig
no flags
Updated patch with new test (34.39 KB, patch)
2010-06-13 17:32 PDT, Sam Weinig
andersca: review+
Sam Weinig
Comment 1 2010-06-13 17:05:21 PDT
Adam Barth
Comment 2 2010-06-13 17:12:31 PDT
Comment on attachment 58604 [details] patch Should we test that the constants have the right values?
Sam Weinig
Comment 3 2010-06-13 17:19:49 PDT
(In reply to comment #2) > (From update of attachment 58604 [details]) > Should we test that the constants have the right values? That seems reasonable. I'll add a test.
Sam Weinig
Comment 4 2010-06-13 17:32:46 PDT
Created attachment 58608 [details] Updated patch with new test
Anders Carlsson
Comment 5 2010-06-13 19:23:59 PDT
Comment on attachment 58608 [details] Updated patch with new test r=me
Sam Weinig
Comment 6 2010-06-13 19:27:30 PDT
Landed in r61100.
WebKit Review Bot
Comment 7 2010-06-13 19:34:47 PDT
http://trac.webkit.org/changeset/61100 might have broken Chromium Linux Release
Alexey Proskuryakov
Comment 8 2010-06-14 10:00:30 PDT
> This matches what we do for all other constructors and WebIDL. However, this doesn't match Firefox - even though it supports e.g. XPathResult.ANY_TYPE, it doesn't support XMLHttpRequest.DONE. Firefox doesn't expose those constants under their old names either.
Sam Weinig
Comment 9 2010-06-14 10:04:34 PDT
(In reply to comment #8) > > This matches what we do for all other constructors and WebIDL. > > However, this doesn't match Firefox - even though it supports e.g. XPathResult.ANY_TYPE, it doesn't support XMLHttpRequest.DONE. Firefox doesn't expose those constants under their old names either. I don't think this will be a compat issue, do you?
Alexey Proskuryakov
Comment 10 2010-06-14 10:38:33 PDT
This is unlikely to be a Web compatibility issue, but it may become a standards compatibility issue if we disagree with all other browsers, and some future spec codifies their behavior. I think it's a good change, I just wanted to do the due diligence. See also: bug 13148.
Note You need to log in before you can comment on or make changes to this bug.