Bug 67568 - Document.createEvent should support all the interfaces of Event we got
Summary: Document.createEvent should support all the interfaces of Event we got
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Sam Weinig
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-09-03 13:33 PDT by Sam Weinig
Modified: 2011-09-04 14:03 PDT (History)
2 users (show)

See Also:


Attachments
Patch (32.66 KB, patch)
2011-09-03 13:47 PDT, Sam Weinig
no flags Details | Formatted Diff | Diff
Patch (35.36 KB, patch)
2011-09-04 13:38 PDT, Sam Weinig
andersca: review+
webkit.review.bot: commit-queue-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Sam Weinig 2011-09-03 13:33:43 PDT
Document.createEvent should support all the interfaces of Event we got
Comment 1 Sam Weinig 2011-09-03 13:47:48 PDT
Created attachment 106267 [details]
Patch
Comment 2 WebKit Review Bot 2011-09-03 13:48:51 PDT
Attachment 106267 [details] did not pass style-queue:

Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'LayoutTests/ChangeLog', u'LayoutTests/fast..." exit_code: 1

LayoutTests/ChangeLog:9:  Need whitespace between colon and description  [changelog/filechangedescriptionwhitespace] [5]
Source/WebCore/dom/Document.cpp:98:  "HashChangeEvent.h" already included at Source/WebCore/dom/Document.cpp:97  [build/include] [4]
Total errors found: 2 in 7 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 3 Sam Weinig 2011-09-03 13:51:30 PDT
Throwing this patch up to run it on the bots.  There are few things I don't like about it:
1) It doesn't make it any harder for people to make this mistake in the future. One idea I had about that was replacing all the isFooEvent() virtual functions with a virtual function that returns an enum EventType, and then somehow switching on that event type in Document.createEvent() (sans-default), thus making it a compile error to not add a case.

2) The test contains commented out code to test the interfaces that are not on in the main builds.  I should really move it, but it makes me sad.
Comment 4 WebKit Review Bot 2011-09-03 14:08:44 PDT
Comment on attachment 106267 [details]
Patch

Attachment 106267 [details] did not pass chromium-ews (chromium-xvfb):
Output: http://queues.webkit.org/results/9586858
Comment 5 WebKit Review Bot 2011-09-03 14:28:31 PDT
Comment on attachment 106267 [details]
Patch

Attachment 106267 [details] did not pass cr-mac-ews (chromium):
Output: http://queues.webkit.org/results/9590208
Comment 6 Sam Weinig 2011-09-04 13:38:26 PDT
Created attachment 106294 [details]
Patch
Comment 7 Sam Weinig 2011-09-04 13:39:32 PDT
I like this version a bit more, and I think this is as far down the rabbit hole as I want to go.  If I think of better ways to prevent this mistake in the future, I will file follow ups.
Comment 8 WebKit Review Bot 2011-09-04 13:42:30 PDT
Comment on attachment 106294 [details]
Patch

Attachment 106294 [details] did not pass chromium-ews (chromium-xvfb):
Output: http://queues.webkit.org/results/9595081
Comment 9 Sam Weinig 2011-09-04 14:03:11 PDT
Committed r94505: <http://trac.webkit.org/changeset/94505>