RESOLVED FIXED 86363
Add the event handler content attributes that are defined in the spec to HTMLElement
https://bugs.webkit.org/show_bug.cgi?id=86363
Summary Add the event handler content attributes that are defined in the spec to HTML...
Keishi Hattori
Reported 2012-05-14 05:55:43 PDT
Attachments
Patch (33.79 KB, patch)
2012-05-14 20:27 PDT, Keishi Hattori
no flags
Patch (34.74 KB, patch)
2012-05-20 21:38 PDT, Keishi Hattori
no flags
Patch (34.74 KB, patch)
2012-07-24 03:56 PDT, Keishi Hattori
no flags
Patch (47.08 KB, patch)
2012-07-24 23:40 PDT, Keishi Hattori
no flags
Patch (47.74 KB, patch)
2012-08-08 21:21 PDT, Keishi Hattori
no flags
Patch (47.54 KB, patch)
2013-03-29 00:22 PDT, Keishi Hattori
no flags
Archive of layout-test-results from gce-cq-01 for chromium-linux-x86_64 (753.27 KB, application/zip)
2013-03-29 01:28 PDT, WebKit Review Bot
no flags
Patch (47.65 KB, patch)
2013-03-29 02:22 PDT, Keishi Hattori
no flags
Keishi Hattori
Comment 1 2012-05-14 20:27:06 PDT
WebKit Review Bot
Comment 2 2012-05-14 20:30:11 PDT
Attachment 141848 [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 Source/WebCore/html/HTMLSelectElement.cpp:315: One line control clauses should not use braces. [whitespace/braces] [4] Total errors found: 1 in 12 files If any of these errors are false positives, please file a bug against check-webkit-style.
Ryosuke Niwa
Comment 3 2012-05-18 11:58:17 PDT
Comment on attachment 141848 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=141848&action=review > Source/WebCore/ChangeLog:7 > + Please add a description as to *why* you're making this change, and refer to the spec you're following.
Keishi Hattori
Comment 4 2012-05-20 21:38:45 PDT
WebKit Review Bot
Comment 5 2012-05-20 21:41:11 PDT
Attachment 142943 [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 Source/WebCore/html/HTMLSelectElement.cpp:315: One line control clauses should not use braces. [whitespace/braces] [4] Total errors found: 1 in 12 files If any of these errors are false positives, please file a bug against check-webkit-style.
Keishi Hattori
Comment 6 2012-07-24 03:56:56 PDT
Alexey Proskuryakov
Comment 7 2012-07-24 09:32:05 PDT
Comment on attachment 154011 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=154011&action=review > Source/WebCore/html/HTMLElement.cpp:335 > + } else if (attribute.name() == onabortAttr) { > + setAttributeEventListener(eventNames().abortEvent, createAttributeEventListener(this, attribute)); > + } else if (attribute.name() == oncanplayAttr) { > + setAttributeEventListener(eventNames().canplayEvent, createAttributeEventListener(this, attribute)); How does this horrible long list of elseif's affect performance? From the look of it, the answer should be "negatively".
Adam Barth
Comment 8 2012-07-24 10:50:07 PDT
Comment on attachment 154011 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=154011&action=review >> Source/WebCore/html/HTMLElement.cpp:335 >> + setAttributeEventListener(eventNames().canplayEvent, createAttributeEventListener(this, attribute)); > > How does this horrible long list of elseif's affect performance? From the look of it, the answer should be "negatively". This strings should be atomic already. We might want to replace this with a HashMap keyed by StringImpl*
Keishi Hattori
Comment 9 2012-07-24 23:40:46 PDT
Keishi Hattori
Comment 10 2012-07-25 13:09:05 PDT
(In reply to comment #8) > (From update of attachment 154011 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=154011&action=review > > >> Source/WebCore/html/HTMLElement.cpp:335 > >> + setAttributeEventListener(eventNames().canplayEvent, createAttributeEventListener(this, attribute)); > > > > How does this horrible long list of elseif's affect performance? From the look of it, the answer should be "negatively". > > This strings should be atomic already. We might want to replace this with a HashMap keyed by StringImpl* Created a HashMap, attributeNameToEventNameMap.
Ryosuke Niwa
Comment 11 2012-08-07 23:01:30 PDT
Comment on attachment 154273 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=154273&action=review > Source/WebCore/html/HTMLElement.cpp:220 > + static HashMap<AtomicStringImpl*, AtomicString>* attributeNameToEventNameMap = 0; We don't have to use AtomicStringImpl any more. AtomicString's hash traits will automatically take care of it for you. > Source/WebCore/html/HTMLElement.cpp:222 > + if (!attributeNameToEventNameMap) { > + attributeNameToEventNameMap = new HashMap<AtomicStringImpl*, AtomicString>; Instead of dynamically allocating the hash map, you could have just checked the size. Also, if we're dynamically allocating this object, then we must use OwnPtr. r- because of this. > LayoutTests/fast/events/event-attribute.html:27 > + var el = document.createElement(elementTags[i]); Please don't use abbreviations like el.
Keishi Hattori
Comment 12 2012-08-08 21:21:16 PDT
Keishi Hattori
Comment 13 2012-08-08 21:21:34 PDT
(In reply to comment #11) > (From update of attachment 154273 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=154273&action=review > > > Source/WebCore/html/HTMLElement.cpp:220 > > + static HashMap<AtomicStringImpl*, AtomicString>* attributeNameToEventNameMap = 0; > > We don't have to use AtomicStringImpl any more. AtomicString's hash traits will automatically take care of it for you. Done. > > Source/WebCore/html/HTMLElement.cpp:222 > > + if (!attributeNameToEventNameMap) { > > + attributeNameToEventNameMap = new HashMap<AtomicStringImpl*, AtomicString>; > > Instead of dynamically allocating the hash map, you could have just checked the size. > Also, if we're dynamically allocating this object, then we must use OwnPtr. r- because of this. Done. > > LayoutTests/fast/events/event-attribute.html:27 > > + var el = document.createElement(elementTags[i]); > > Please don't use abbreviations like el. Done.
Ryosuke Niwa
Comment 14 2012-09-13 15:17:02 PDT
Comment on attachment 157380 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=157380&action=review > Source/WebCore/html/HTMLElement.cpp:294 > + attributeNameToEventNameMap.set(onwaitingAttr.localName(), eventNames().waitingEvent); > + attributeNameToEventNameMap.set(onwaitingAttr.localName(), eventNames().waitingEvent); Waiting is repeated twice. Please fix it. > LayoutTests/fast/events/event-attribute.html:16 > +var eventNames = ["onclick", "oncontextmenu", "ondblclick", "onmousedown", Shouldn't we test all event handlers?
Keishi Hattori
Comment 15 2013-03-29 00:22:02 PDT
Keishi Hattori
Comment 16 2013-03-29 00:26:59 PDT
(In reply to comment #14) > (From update of attachment 157380 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=157380&action=review > > > Source/WebCore/html/HTMLElement.cpp:294 > > + attributeNameToEventNameMap.set(onwaitingAttr.localName(), eventNames().waitingEvent); > > + attributeNameToEventNameMap.set(onwaitingAttr.localName(), eventNames().waitingEvent); > > Waiting is repeated twice. Please fix it. Fixed. > > LayoutTests/fast/events/event-attribute.html:16 > > +var eventNames = ["onclick", "oncontextmenu", "ondblclick", "onmousedown", > > Shouldn't we test all event handlers? The rest don't have element.on* properties to access from JS.
WebKit Review Bot
Comment 17 2013-03-29 01:28:23 PDT
Comment on attachment 195703 [details] Patch Rejecting attachment 195703 [details] from commit-queue. New failing tests: transitions/transition-end-event-unprefixed-04.html Full output: http://webkit-commit-queue.appspot.com/results/17231844
WebKit Review Bot
Comment 18 2013-03-29 01:28:26 PDT
Created attachment 195707 [details] Archive of layout-test-results from gce-cq-01 for chromium-linux-x86_64 The attached test failures were seen while running run-webkit-tests on the commit-queue. Bot: gce-cq-01 Port: chromium-linux-x86_64 Platform: Linux-3.3.8-gcg-201212281604-x86_64-with-GCEL-10.04-gcel_10.04
Keishi Hattori
Comment 19 2013-03-29 02:22:15 PDT
WebKit Review Bot
Comment 20 2013-03-29 02:57:27 PDT
Comment on attachment 195709 [details] Patch Clearing flags on attachment: 195709 Committed r147205: <http://trac.webkit.org/changeset/147205>
WebKit Review Bot
Comment 21 2013-03-29 02:57:31 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.