BeforeUnloadEvent,CloseEvent,PopStateEvent should not have default .type values |
||
Issue descriptionChrome Version: 58.0.2991.0 OS: macOS 10.12.2 What steps will reproduce the problem? (1) Open http://w3c-test.org/dom/events/EventTarget-dispatchEvent.html in Chrome. (2) Observe the test results. What is the expected result? All the tests should pass. What happens instead? Three tests fail: Fail If the event's initialized flag is not set, an InvalidStateError must be thrown (BeforeUnloadEvent). assert_equals: Event type should be empty string before initialization expected "" but got "beforeunload" Fail If the event's initialized flag is not set, an InvalidStateError must be thrown (CloseEvent). assert_equals: Event type should be empty string before initialization expected "" but got "close" Fail If the event's initialized flag is not set, an InvalidStateError must be thrown (PopStateEvent). assert_equals: Event type should be empty string before initialization expected "" but got "popstate" Further details: These tests contain the equivalent of: assertEquals(document.createEvent(someEventInterfaceName).type, "") where someEventInterfaceName is one of: "BeforeUnloadEvent", "CloseEvent", "PopStateEvent" And they fail since the .type property's actual value in Chrome is, respectively: BeforeUnloadEvent: "beforeunload" CloseEvent: "close" PopStateEvent: "popstate" However, per step 6 of https://dom.spec.whatwg.org/#dom-document-createevent , the event returned from createEvent() should have its .type property set to the empty string.
,
Feb 7 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/39d843f8a5df7d463c3a14b4fe493e19db91c87e commit 39d843f8a5df7d463c3a14b4fe493e19db91c87e Author: ratsunny <ratsunny@gmail.com> Date: Tue Feb 07 02:19:03 2017 Don't initialize event when calling create() with no argument "BeforeUnloadEvent", "CloseEvent" and "PopStateEvent" initialized too early when created with document.createEvent, cause they have default "type" attribute unexpectedly. Tests were changed accordingly BUG= 684851 Review-Url: https://codereview.chromium.org/2677793003 Cr-Commit-Position: refs/heads/master@{#448515} [modify] https://crrev.com/39d843f8a5df7d463c3a14b4fe493e19db91c87e/third_party/WebKit/LayoutTests/external/wpt/dom/events/EventTarget-dispatchEvent-expected.txt [modify] https://crrev.com/39d843f8a5df7d463c3a14b4fe493e19db91c87e/third_party/WebKit/LayoutTests/external/wpt/dom/nodes/Document-createEvent-expected.txt [modify] https://crrev.com/39d843f8a5df7d463c3a14b4fe493e19db91c87e/third_party/WebKit/Source/core/dom/Document.cpp [modify] https://crrev.com/39d843f8a5df7d463c3a14b4fe493e19db91c87e/third_party/WebKit/Source/core/events/BeforeUnloadEvent.cpp [modify] https://crrev.com/39d843f8a5df7d463c3a14b4fe493e19db91c87e/third_party/WebKit/Source/core/events/PopStateEvent.cpp [modify] https://crrev.com/39d843f8a5df7d463c3a14b4fe493e19db91c87e/third_party/WebKit/Source/modules/websockets/CloseEvent.h
,
Feb 7 2017
|
||
►
Sign in to add a comment |
||
Comment 1 by tkent@chromium.org
, Jan 25 2017Labels: Hotlist-Interop Hotlist-GoodFirstBug
Status: Available (was: Untriaged)