Changeset 207215 in webkit


Ignore:
Timestamp:
Oct 12, 2016 9:23:00 AM (8 years ago)
Author:
Chris Dumez
Message:

Update remaining DOM events to stop using legacy [ConstructorTemplate=Event]
https://bugs.webkit.org/show_bug.cgi?id=163319

Reviewed by Darin Adler.

Source/WebCore:

Update remaining DOM events to stop using legacy [ConstructorTemplate=Event]
and use regular constructors instead.

No new tests, updated existing tests.

  • dom/AutocompleteErrorEvent.h:
  • dom/AutocompleteErrorEvent.idl:
  • dom/BeforeLoadEvent.h:
  • dom/BeforeLoadEvent.idl:
  • dom/CompositionEvent.cpp:

(WebCore::CompositionEvent::CompositionEvent):

  • dom/CompositionEvent.h:
  • dom/CompositionEvent.idl:
  • dom/ErrorEvent.cpp:

(WebCore::ErrorEvent::ErrorEvent):

  • dom/ErrorEvent.h:
  • dom/ErrorEvent.idl:
  • dom/FocusEvent.cpp:

(WebCore::FocusEvent::FocusEvent):

  • dom/FocusEvent.h:
  • dom/FocusEvent.idl:
  • dom/HashChangeEvent.h:
  • dom/HashChangeEvent.idl:
  • dom/OverflowEvent.cpp:

(WebCore::OverflowEvent::OverflowEvent):

  • dom/OverflowEvent.h:
  • dom/OverflowEvent.idl:
  • dom/PageTransitionEvent.cpp:

(WebCore::PageTransitionEvent::PageTransitionEvent):

  • dom/PageTransitionEvent.h:
  • dom/PageTransitionEvent.idl:
  • dom/PopStateEvent.cpp:

(WebCore::PopStateEvent::PopStateEvent):
(WebCore::PopStateEvent::create):

  • dom/PopStateEvent.h:
  • dom/PopStateEvent.idl:
  • dom/SecurityPolicyViolationEvent.h:
  • dom/SecurityPolicyViolationEvent.idl:
  • dom/TouchEvent.cpp:

(WebCore::TouchEvent::TouchEvent):

  • dom/TouchEvent.h:
  • dom/TouchEvent.idl:
  • dom/TransitionEvent.cpp:

(WebCore::TransitionEvent::TransitionEvent):

  • dom/TransitionEvent.h:
  • dom/TransitionEvent.idl:
  • dom/WebKitAnimationEvent.cpp:

(WebCore::WebKitAnimationEvent::WebKitAnimationEvent):

  • dom/WebKitAnimationEvent.h:
  • dom/WebKitAnimationEvent.idl:
  • dom/WebKitTransitionEvent.cpp:

(WebCore::WebKitTransitionEvent::WebKitTransitionEvent):

  • dom/WebKitTransitionEvent.h:
  • dom/WebKitTransitionEvent.idl:

LayoutTests:

Rebaseline several existing tests to reflect minor behavior changes:

  • We now properly use the default member value when an explicit undefined is passed.
  • We throw more exceptions when bad input is passed.
  • Exception messages are sometimes slightly different.
  • fast/events/constructors/before-load-event-constructor-expected.txt:
  • fast/events/constructors/before-load-event-constructor.html:
  • fast/events/constructors/composition-event-constructor-expected.txt:
  • fast/events/constructors/composition-event-constructor.html:
  • fast/events/constructors/error-event-constructor-expected.txt:
  • fast/events/constructors/error-event-constructor.html:
  • fast/events/constructors/focus-event-constructor-expected.txt:
  • fast/events/constructors/focus-event-constructor.html:
  • fast/events/constructors/hash-change-event-constructor-expected.txt:
  • fast/events/constructors/hash-change-event-constructor.html:
  • fast/events/constructors/pop-state-event-constructor-expected.txt:
  • fast/events/constructors/pop-state-event-constructor.html:
  • fast/events/constructors/transition-event-constructor-expected.txt:
  • fast/events/constructors/transition-event-constructor.html:
  • fast/events/constructors/webkit-animation-event-constructor-expected.txt:
  • fast/events/constructors/webkit-animation-event-constructor.html:
  • fast/events/constructors/webkit-transition-event-constructor-expected.txt:
  • fast/events/constructors/webkit-transition-event-constructor.html:
Location:
trunk
Files:
58 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r207189 r207215  
     12016-10-12  Chris Dumez  <cdumez@apple.com>
     2
     3        Update remaining DOM events to stop using legacy [ConstructorTemplate=Event]
     4        https://bugs.webkit.org/show_bug.cgi?id=163319
     5
     6        Reviewed by Darin Adler.
     7
     8        Rebaseline several existing tests to reflect minor behavior changes:
     9        - We now properly use the default member value when an explicit undefined
     10          is passed.
     11        - We throw more exceptions when bad input is passed.
     12        - Exception messages are sometimes slightly different.
     13
     14        * fast/events/constructors/before-load-event-constructor-expected.txt:
     15        * fast/events/constructors/before-load-event-constructor.html:
     16        * fast/events/constructors/composition-event-constructor-expected.txt:
     17        * fast/events/constructors/composition-event-constructor.html:
     18        * fast/events/constructors/error-event-constructor-expected.txt:
     19        * fast/events/constructors/error-event-constructor.html:
     20        * fast/events/constructors/focus-event-constructor-expected.txt:
     21        * fast/events/constructors/focus-event-constructor.html:
     22        * fast/events/constructors/hash-change-event-constructor-expected.txt:
     23        * fast/events/constructors/hash-change-event-constructor.html:
     24        * fast/events/constructors/pop-state-event-constructor-expected.txt:
     25        * fast/events/constructors/pop-state-event-constructor.html:
     26        * fast/events/constructors/transition-event-constructor-expected.txt:
     27        * fast/events/constructors/transition-event-constructor.html:
     28        * fast/events/constructors/webkit-animation-event-constructor-expected.txt:
     29        * fast/events/constructors/webkit-animation-event-constructor.html:
     30        * fast/events/constructors/webkit-transition-event-constructor-expected.txt:
     31        * fast/events/constructors/webkit-transition-event-constructor.html:
     32
    1332016-10-11  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
    234
  • trunk/LayoutTests/fast/events/constructors/before-load-event-constructor-expected.txt

    r97324 r207215  
    1313PASS new BeforeLoadEvent('eventType', { url: 'doremi' }).url is "doremi"
    1414PASS new BeforeLoadEvent('eventType', { url: '' }).url is ""
    15 PASS new BeforeLoadEvent('eventType', { url: undefined }).url is "undefined"
     15PASS new BeforeLoadEvent('eventType', { url: undefined }).url is ""
    1616PASS new BeforeLoadEvent('eventType', { url: null }).url is "null"
    1717PASS new BeforeLoadEvent('eventType', { url: false }).url is "false"
  • trunk/LayoutTests/fast/events/constructors/before-load-event-constructor.html

    r155267 r207215  
    3030
    3131// Non-strings.
    32 shouldBeEqualToString("new BeforeLoadEvent('eventType', { url: undefined }).url", "undefined");
     32shouldBeEqualToString("new BeforeLoadEvent('eventType', { url: undefined }).url", "");
    3333shouldBeEqualToString("new BeforeLoadEvent('eventType', { url: null }).url", "null");
    3434shouldBeEqualToString("new BeforeLoadEvent('eventType', { url: false }).url", "false");
  • trunk/LayoutTests/fast/events/constructors/composition-event-constructor-expected.txt

    r203950 r207215  
    1515PASS new CompositionEvent('eventType', { view: window }).view is window
    1616PASS new CompositionEvent('eventType', { view: this }).view is this
    17 PASS new CompositionEvent('eventType', { view: testObject }).view threw exception TypeError: Dictionary member is not of type Window.
    18 PASS new CompositionEvent('eventType', { view: document }).view threw exception TypeError: Dictionary member is not of type Window.
     17PASS new CompositionEvent('eventType', { view: testObject }).view threw exception TypeError: Type error.
     18PASS new CompositionEvent('eventType', { view: document }).view threw exception TypeError: Type error.
    1919PASS new CompositionEvent('eventType', { view: undefined }).view is null
    2020PASS new CompositionEvent('eventType', { view: null }).view is null
    21 PASS new CompositionEvent('eventType', { view: false }).view threw exception TypeError: Dictionary member is not of type Window.
    22 PASS new CompositionEvent('eventType', { view: true }).view threw exception TypeError: Dictionary member is not of type Window.
    23 PASS new CompositionEvent('eventType', { view: '' }).view threw exception TypeError: Dictionary member is not of type Window.
    24 PASS new CompositionEvent('eventType', { view: 'chocolate' }).view threw exception TypeError: Dictionary member is not of type Window.
    25 PASS new CompositionEvent('eventType', { view: 12345 }).view threw exception TypeError: Dictionary member is not of type Window.
    26 PASS new CompositionEvent('eventType', { view: 18446744073709551615 }).view threw exception TypeError: Dictionary member is not of type Window.
    27 PASS new CompositionEvent('eventType', { view: NaN }).view threw exception TypeError: Dictionary member is not of type Window.
    28 PASS new CompositionEvent('eventType', { view: {valueOf: function () { return window; } } }).view threw exception TypeError: Dictionary member is not of type Window.
    29 PASS new CompositionEvent('eventType', { get view() { return 123; } }).view threw exception TypeError: Dictionary member is not of type Window.
     21PASS new CompositionEvent('eventType', { view: false }).view threw exception TypeError: Type error.
     22PASS new CompositionEvent('eventType', { view: true }).view threw exception TypeError: Type error.
     23PASS new CompositionEvent('eventType', { view: '' }).view threw exception TypeError: Type error.
     24PASS new CompositionEvent('eventType', { view: 'chocolate' }).view threw exception TypeError: Type error.
     25PASS new CompositionEvent('eventType', { view: 12345 }).view threw exception TypeError: Type error.
     26PASS new CompositionEvent('eventType', { view: 18446744073709551615 }).view threw exception TypeError: Type error.
     27PASS new CompositionEvent('eventType', { view: NaN }).view threw exception TypeError: Type error.
     28PASS new CompositionEvent('eventType', { view: {valueOf: function () { return window; } } }).view threw exception TypeError: Type error.
     29PASS new CompositionEvent('eventType', { get view() { return 123; } }).view threw exception TypeError: Type error.
    3030PASS new CompositionEvent('eventType', { get view() { throw 'CompositionEvent Error'; } }) threw exception CompositionEvent Error.
    3131PASS new CompositionEvent('eventType', { data: 'koakuma' }).data is "koakuma"
    3232PASS new CompositionEvent('eventType', { data: '' }).data is ""
    33 PASS new CompositionEvent('eventType', { data: undefined }).data is "undefined"
     33PASS new CompositionEvent('eventType', { data: undefined }).data is ""
    3434PASS new CompositionEvent('eventType', { data: null }).data is "null"
    3535PASS new CompositionEvent('eventType', { data: false }).data is "false"
  • trunk/LayoutTests/fast/events/constructors/composition-event-constructor.html

    r203950 r207215  
    5454
    5555// Non-strings.
    56 shouldBeEqualToString("new CompositionEvent('eventType', { data: undefined }).data", "undefined");
     56shouldBeEqualToString("new CompositionEvent('eventType', { data: undefined }).data", "");
    5757shouldBeEqualToString("new CompositionEvent('eventType', { data: null }).data", "null");
    5858shouldBeEqualToString("new CompositionEvent('eventType', { data: false }).data", "false");
  • trunk/LayoutTests/fast/events/constructors/error-event-constructor-expected.txt

    r202023 r207215  
    1515PASS new ErrorEvent('eventType', { message: 'melancholy' }).message is "melancholy"
    1616PASS new ErrorEvent('eventType', { message: '' }).message is ""
    17 PASS new ErrorEvent('eventType', { message: undefined }).message is "undefined"
     17PASS new ErrorEvent('eventType', { message: undefined }).message is ""
    1818PASS new ErrorEvent('eventType', { message: null }).message is "null"
    1919PASS new ErrorEvent('eventType', { message: false }).message is "false"
     
    2828PASS new ErrorEvent('eventType', { filename: 'melancholy' }).filename is "melancholy"
    2929PASS new ErrorEvent('eventType', { filename: '' }).filename is ""
    30 PASS new ErrorEvent('eventType', { filename: undefined }).filename is "undefined"
     30PASS new ErrorEvent('eventType', { filename: undefined }).filename is ""
    3131PASS new ErrorEvent('eventType', { filename: null }).filename is "null"
    3232PASS new ErrorEvent('eventType', { filename: false }).filename is "false"
     
    6565PASS new ErrorEvent('eventType', { colno: 4294967294 }).colno is 4294967294
    6666PASS new ErrorEvent('eventType', { colno: 4294967295 }).colno is 4294967295
    67 PASS new ErrorEvent('eventType', { error: undefined }).error is undefined
     67PASS new ErrorEvent('eventType', { error: undefined }).error is null
    6868PASS new ErrorEvent('eventType', { error: null }).error is null
    6969PASS new ErrorEvent('eventType', { error: '' }).error is ''
  • trunk/LayoutTests/fast/events/constructors/error-event-constructor.html

    r202023 r207215  
    3131
    3232    // Non-strings.
    33     shouldBeEqualToString("new ErrorEvent('eventType', { " + attr + ": undefined })." + attr, "undefined");
     33    shouldBeEqualToString("new ErrorEvent('eventType', { " + attr + ": undefined })." + attr, "");
    3434    shouldBeEqualToString("new ErrorEvent('eventType', { " + attr + ": null })." + attr, "null");
    3535    shouldBeEqualToString("new ErrorEvent('eventType', { " + attr + ": false })." + attr, "false");
     
    8383
    8484// error is passed.
    85 shouldBe("new ErrorEvent('eventType', { error: undefined }).error", "undefined");
     85shouldBe("new ErrorEvent('eventType', { error: undefined }).error", "null");
    8686shouldBe("new ErrorEvent('eventType', { error: null }).error", "null");
    8787shouldBe("new ErrorEvent('eventType', { error: '' }).error", "''");
  • trunk/LayoutTests/fast/events/constructors/focus-event-constructor-expected.txt

    r203950 r207215  
    1515PASS new FocusEvent('eventType', { view: window }).view is window
    1616PASS new FocusEvent('eventType', { view: this }).view is this
    17 PASS new FocusEvent('eventType', { view: testObject }).view threw exception TypeError: Dictionary member is not of type Window.
    18 PASS new FocusEvent('eventType', { view: document }).view threw exception TypeError: Dictionary member is not of type Window.
     17PASS new FocusEvent('eventType', { view: testObject }).view threw exception TypeError: Type error.
     18PASS new FocusEvent('eventType', { view: document }).view threw exception TypeError: Type error.
    1919PASS new FocusEvent('eventType', { view: undefined }).view is null
    2020PASS new FocusEvent('eventType', { view: null }).view is null
    21 PASS new FocusEvent('eventType', { view: false }).view threw exception TypeError: Dictionary member is not of type Window.
    22 PASS new FocusEvent('eventType', { view: true }).view threw exception TypeError: Dictionary member is not of type Window.
    23 PASS new FocusEvent('eventType', { view: '' }).view threw exception TypeError: Dictionary member is not of type Window.
    24 PASS new FocusEvent('eventType', { view: 'chocolate' }).view threw exception TypeError: Dictionary member is not of type Window.
    25 PASS new FocusEvent('eventType', { view: 12345 }).view threw exception TypeError: Dictionary member is not of type Window.
    26 PASS new FocusEvent('eventType', { view: 18446744073709551615 }).view threw exception TypeError: Dictionary member is not of type Window.
    27 PASS new FocusEvent('eventType', { view: NaN }).view threw exception TypeError: Dictionary member is not of type Window.
    28 PASS new FocusEvent('eventType', { view: {valueOf: function () { return window; } } }).view threw exception TypeError: Dictionary member is not of type Window.
    29 PASS new FocusEvent('eventType', { get view() { return 123; } }).view threw exception TypeError: Dictionary member is not of type Window.
     21PASS new FocusEvent('eventType', { view: false }).view threw exception TypeError: Type error.
     22PASS new FocusEvent('eventType', { view: true }).view threw exception TypeError: Type error.
     23PASS new FocusEvent('eventType', { view: '' }).view threw exception TypeError: Type error.
     24PASS new FocusEvent('eventType', { view: 'chocolate' }).view threw exception TypeError: Type error.
     25PASS new FocusEvent('eventType', { view: 12345 }).view threw exception TypeError: Type error.
     26PASS new FocusEvent('eventType', { view: 18446744073709551615 }).view threw exception TypeError: Type error.
     27PASS new FocusEvent('eventType', { view: NaN }).view threw exception TypeError: Type error.
     28PASS new FocusEvent('eventType', { view: {valueOf: function () { return window; } } }).view threw exception TypeError: Type error.
     29PASS new FocusEvent('eventType', { get view() { return 123; } }).view threw exception TypeError: Type error.
    3030PASS new FocusEvent('eventType', { get view() { throw 'FocusEvent Error'; } }) threw exception FocusEvent Error.
    3131PASS new FocusEvent('eventType', { relatedTarget: testDiv }).relatedTarget is testDiv
     
    3333PASS new FocusEvent('eventType', { relatedTarget: xhr }).relatedTarget is xhr
    3434PASS new FocusEvent('eventType', { relatedTarget: window }).relatedTarget is window
    35 PASS new FocusEvent('eventType', { relatedTarget: testObject }).relatedTarget is null
     35PASS new FocusEvent('eventType', { relatedTarget: testObject }) threw exception TypeError: Type error.
    3636PASS new FocusEvent('eventType', { relatedTarget: undefined }).relatedTarget is null
    3737PASS new FocusEvent('eventType', { relatedTarget: null }).relatedTarget is null
    38 PASS new FocusEvent('eventType', { relatedTarget: false }).relatedTarget is null
    39 PASS new FocusEvent('eventType', { relatedTarget: true }).relatedTarget is null
    40 PASS new FocusEvent('eventType', { relatedTarget: '' }).relatedTarget is null
    41 PASS new FocusEvent('eventType', { relatedTarget: 'chocolate' }).relatedTarget is null
    42 PASS new FocusEvent('eventType', { relatedTarget: 12345 }).relatedTarget is null
    43 PASS new FocusEvent('eventType', { relatedTarget: 18446744073709551615 }).relatedTarget is null
    44 PASS new FocusEvent('eventType', { relatedTarget: NaN }).relatedTarget is null
    45 PASS new FocusEvent('eventType', { relatedTarget: {valueOf: function () { return testDiv; } } }).relatedTarget == testDiv is false
    46 PASS new FocusEvent('eventType', { get relatedTarget() { return 123; } }).relatedTarget is null
     38PASS new FocusEvent('eventType', { relatedTarget: false }) threw exception TypeError: Type error.
     39PASS new FocusEvent('eventType', { relatedTarget: true }) threw exception TypeError: Type error.
     40PASS new FocusEvent('eventType', { relatedTarget: '' }) threw exception TypeError: Type error.
     41PASS new FocusEvent('eventType', { relatedTarget: 'chocolate' }) threw exception TypeError: Type error.
     42PASS new FocusEvent('eventType', { relatedTarget: 12345 }) threw exception TypeError: Type error.
     43PASS new FocusEvent('eventType', { relatedTarget: 18446744073709551615 }) threw exception TypeError: Type error.
     44PASS new FocusEvent('eventType', { relatedTarget: NaN }) threw exception TypeError: Type error.
     45PASS new FocusEvent('eventType', { relatedTarget: {valueOf: function () { return testDiv; } } }) threw exception TypeError: Type error.
     46PASS new FocusEvent('eventType', { get relatedTarget() { return 123; } }) threw exception TypeError: Type error.
    4747PASS new FocusEvent('eventType', { get relatedTarget() { throw 'FocusEvent Error'; } }) threw exception FocusEvent Error.
    4848PASS new FocusEvent('eventType', { bubbles: true, cancelable: true, view: window, detail: 111, relatedTarget: testDiv }).bubbles is true
  • trunk/LayoutTests/fast/events/constructors/focus-event-constructor.html

    r203950 r207215  
    5858
    5959// Invalid objects.
    60 shouldBe("new FocusEvent('eventType', { relatedTarget: testObject }).relatedTarget", "null");
     60shouldThrowErrorName("new FocusEvent('eventType', { relatedTarget: testObject })", "TypeError");
    6161shouldBe("new FocusEvent('eventType', { relatedTarget: undefined }).relatedTarget", "null");
    6262shouldBe("new FocusEvent('eventType', { relatedTarget: null }).relatedTarget", "null");
    63 shouldBe("new FocusEvent('eventType', { relatedTarget: false }).relatedTarget", "null");
    64 shouldBe("new FocusEvent('eventType', { relatedTarget: true }).relatedTarget", "null");
    65 shouldBe("new FocusEvent('eventType', { relatedTarget: '' }).relatedTarget", "null");
    66 shouldBe("new FocusEvent('eventType', { relatedTarget: 'chocolate' }).relatedTarget", "null");
    67 shouldBe("new FocusEvent('eventType', { relatedTarget: 12345 }).relatedTarget", "null");
    68 shouldBe("new FocusEvent('eventType', { relatedTarget: 18446744073709551615 }).relatedTarget", "null");
    69 shouldBe("new FocusEvent('eventType', { relatedTarget: NaN }).relatedTarget", "null");
     63shouldThrowErrorName("new FocusEvent('eventType', { relatedTarget: false })", "TypeError");
     64shouldThrowErrorName("new FocusEvent('eventType', { relatedTarget: true })", "TypeError");
     65shouldThrowErrorName("new FocusEvent('eventType', { relatedTarget: '' })", "TypeError");
     66shouldThrowErrorName("new FocusEvent('eventType', { relatedTarget: 'chocolate' })", "TypeError");
     67shouldThrowErrorName("new FocusEvent('eventType', { relatedTarget: 12345 })", "TypeError");
     68shouldThrowErrorName("new FocusEvent('eventType', { relatedTarget: 18446744073709551615 })", "TypeError");
     69shouldThrowErrorName("new FocusEvent('eventType', { relatedTarget: NaN })", "TypeError");
    7070// Note that valueOf() is not called, when the left hand side is evaluated.
    71 shouldBeFalse("new FocusEvent('eventType', { relatedTarget: {valueOf: function () { return testDiv; } } }).relatedTarget == testDiv");
    72 shouldBe("new FocusEvent('eventType', { get relatedTarget() { return 123; } }).relatedTarget", "null");
     71shouldThrowErrorName("new FocusEvent('eventType', { relatedTarget: {valueOf: function () { return testDiv; } } })", "TypeError");
     72shouldThrowErrorName("new FocusEvent('eventType', { get relatedTarget() { return 123; } })", "TypeError");
    7373shouldThrow("new FocusEvent('eventType', { get relatedTarget() { throw 'FocusEvent Error'; } })");
    7474
  • trunk/LayoutTests/fast/events/constructors/hash-change-event-constructor-expected.txt

    r94962 r207215  
    1414PASS new HashChangeEvent('eventType', { oldURL: 'doremi' }).oldURL is "doremi"
    1515PASS new HashChangeEvent('eventType', { oldURL: '' }).oldURL is ""
    16 PASS new HashChangeEvent('eventType', { oldURL: undefined }).oldURL is "undefined"
     16PASS new HashChangeEvent('eventType', { oldURL: undefined }).oldURL is ""
    1717PASS new HashChangeEvent('eventType', { oldURL: null }).oldURL is "null"
    1818PASS new HashChangeEvent('eventType', { oldURL: false }).oldURL is "false"
     
    2727PASS new HashChangeEvent('eventType', { newURL: 'doremi' }).newURL is "doremi"
    2828PASS new HashChangeEvent('eventType', { newURL: '' }).newURL is ""
    29 PASS new HashChangeEvent('eventType', { newURL: undefined }).newURL is "undefined"
     29PASS new HashChangeEvent('eventType', { newURL: undefined }).newURL is ""
    3030PASS new HashChangeEvent('eventType', { newURL: null }).newURL is "null"
    3131PASS new HashChangeEvent('eventType', { newURL: false }).newURL is "false"
  • trunk/LayoutTests/fast/events/constructors/hash-change-event-constructor.html

    r155267 r207215  
    3030
    3131    // Non-strings.
    32     shouldBeEqualToString("new HashChangeEvent('eventType', { " + attr + ": undefined })." + attr, "undefined");
     32    shouldBeEqualToString("new HashChangeEvent('eventType', { " + attr + ": undefined })." + attr, "");
    3333    shouldBeEqualToString("new HashChangeEvent('eventType', { " + attr + ": null })." + attr, "null");
    3434    shouldBeEqualToString("new HashChangeEvent('eventType', { " + attr + ": false })." + attr, "false");
  • trunk/LayoutTests/fast/events/constructors/pop-state-event-constructor-expected.txt

    r96073 r207215  
    1313PASS new PopStateEvent('eventType', { state: object1 }).state is object1
    1414PASS new PopStateEvent('eventType', { state: document }).state is document
    15 PASS new PopStateEvent('eventType', { state: undefined }).state is undefined
     15PASS new PopStateEvent('eventType', { state: undefined }).state is null
    1616PASS new PopStateEvent('eventType', { state: null }).state is null
    1717PASS new PopStateEvent('eventType', { state: false }).state is false
  • trunk/LayoutTests/fast/events/constructors/pop-state-event-constructor.html

    r155267 r207215  
    2626shouldBe("new PopStateEvent('eventType', { state: object1 }).state", "object1");
    2727shouldBe("new PopStateEvent('eventType', { state: document }).state", "document");
    28 shouldBe("new PopStateEvent('eventType', { state: undefined }).state", "undefined");
     28shouldBe("new PopStateEvent('eventType', { state: undefined }).state", "null");
    2929shouldBe("new PopStateEvent('eventType', { state: null }).state", "null");
    3030shouldBe("new PopStateEvent('eventType', { state: false }).state", "false");
  • trunk/LayoutTests/fast/events/constructors/transition-event-constructor-expected.txt

    r141119 r207215  
    1515PASS new TransitionEvent('eventType', { propertyName: 'doremi' }).propertyName is "doremi"
    1616PASS new TransitionEvent('eventType', { propertyName: '' }).propertyName is ""
    17 PASS new TransitionEvent('eventType', { propertyName: undefined }).propertyName is "undefined"
     17PASS new TransitionEvent('eventType', { propertyName: undefined }).propertyName is ""
    1818PASS new TransitionEvent('eventType', { propertyName: null }).propertyName is "null"
    1919PASS new TransitionEvent('eventType', { propertyName: false }).propertyName is "false"
     
    3030PASS new TransitionEvent('eventType', { elapsedTime: -123.45 }).elapsedTime is -123.45
    3131PASS new TransitionEvent('eventType', { elapsedTime: 18446744073709551615 }).elapsedTime is 18446744073709551615
    32 PASS new TransitionEvent('eventType', { elapsedTime: NaN }).elapsedTime is NaN
    33 PASS new TransitionEvent('eventType', { elapsedTime: Infinity }).elapsedTime is Infinity
    34 PASS new TransitionEvent('eventType', { elapsedTime: -Infinity }).elapsedTime is -Infinity
     32PASS new TransitionEvent('eventType', { elapsedTime: NaN }).elapsedTime threw exception TypeError: The provided value is non-finite.
     33PASS new TransitionEvent('eventType', { elapsedTime: Infinity }).elapsedTime threw exception TypeError: The provided value is non-finite.
     34PASS new TransitionEvent('eventType', { elapsedTime: -Infinity }).elapsedTime threw exception TypeError: The provided value is non-finite.
    3535PASS new TransitionEvent('eventType', { pseudoElement: '::before' }).pseudoElement is "::before"
    3636PASS new TransitionEvent('eventType', { pseudoElement: '' }).pseudoElement is ""
    37 PASS new TransitionEvent('eventType', { elapsedTime: undefined }).elapsedTime is NaN
     37PASS new TransitionEvent('eventType', { elapsedTime: undefined }).elapsedTime is 0
    3838PASS new TransitionEvent('eventType', { elapsedTime: null }).elapsedTime is 0
    3939PASS new TransitionEvent('eventType', { elapsedTime: false }).elapsedTime is 0
    4040PASS new TransitionEvent('eventType', { elapsedTime: true }).elapsedTime is 1
    4141PASS new TransitionEvent('eventType', { elapsedTime: '' }).elapsedTime is 0
    42 PASS new TransitionEvent('eventType', { elapsedTime: 'doremi' }).elapsedTime is NaN
     42PASS new TransitionEvent('eventType', { elapsedTime: 'doremi' }).elapsedTime threw exception TypeError: The provided value is non-finite.
    4343PASS new TransitionEvent('eventType', { elapsedTime: [] }).elapsedTime is 0
    4444PASS new TransitionEvent('eventType', { elapsedTime: [123.45] }).elapsedTime is 123.45
    45 PASS new TransitionEvent('eventType', { elapsedTime: [123.45, 678.90] }).elapsedTime is NaN
    46 PASS new TransitionEvent('eventType', { elapsedTime: {doremi: 123.45} }).elapsedTime is NaN
     45PASS new TransitionEvent('eventType', { elapsedTime: [123.45, 678.90] }).elapsedTime threw exception TypeError: The provided value is non-finite.
     46PASS new TransitionEvent('eventType', { elapsedTime: {doremi: 123.45} }).elapsedTime threw exception TypeError: The provided value is non-finite.
    4747PASS new TransitionEvent('eventType', { elapsedTime: {valueOf: function () { return 123.45 } } }).elapsedTime is 123.45
    4848PASS new TransitionEvent('eventType', { bubbles: true, cancelable: true, propertyName: 'doremi', elapsedTime: 123.45, pseudoElement: '::after' }).bubbles is true
  • trunk/LayoutTests/fast/events/constructors/transition-event-constructor.html

    r155267 r207215  
    3030
    3131// Non-strings.
    32 shouldBeEqualToString("new TransitionEvent('eventType', { propertyName: undefined }).propertyName", "undefined");
     32shouldBeEqualToString("new TransitionEvent('eventType', { propertyName: undefined }).propertyName", "");
    3333shouldBeEqualToString("new TransitionEvent('eventType', { propertyName: null }).propertyName", "null");
    3434shouldBeEqualToString("new TransitionEvent('eventType', { propertyName: false }).propertyName", "false");
     
    4848shouldBe("new TransitionEvent('eventType', { elapsedTime: -123.45 }).elapsedTime", "-123.45");
    4949shouldBe("new TransitionEvent('eventType', { elapsedTime: 18446744073709551615 }).elapsedTime", "18446744073709551615");
    50 shouldBe("new TransitionEvent('eventType', { elapsedTime: NaN }).elapsedTime", "NaN");
    51 shouldBe("new TransitionEvent('eventType', { elapsedTime: Infinity }).elapsedTime", "Infinity");
    52 shouldBe("new TransitionEvent('eventType', { elapsedTime: -Infinity }).elapsedTime", "-Infinity");
     50shouldThrowErrorName("new TransitionEvent('eventType', { elapsedTime: NaN }).elapsedTime", "TypeError");
     51shouldThrowErrorName("new TransitionEvent('eventType', { elapsedTime: Infinity }).elapsedTime", "TypeError");
     52shouldThrowErrorName("new TransitionEvent('eventType', { elapsedTime: -Infinity }).elapsedTime", "TypeError");
    5353
    5454// pseudoElement is passed.
     
    5858
    5959// Non-numeric values.
    60 shouldBe("new TransitionEvent('eventType', { elapsedTime: undefined }).elapsedTime", "NaN");
     60shouldBe("new TransitionEvent('eventType', { elapsedTime: undefined }).elapsedTime", "0");
    6161shouldBe("new TransitionEvent('eventType', { elapsedTime: null }).elapsedTime", "0");
    6262shouldBe("new TransitionEvent('eventType', { elapsedTime: false }).elapsedTime", "0");
    6363shouldBe("new TransitionEvent('eventType', { elapsedTime: true }).elapsedTime", "1");
    6464shouldBe("new TransitionEvent('eventType', { elapsedTime: '' }).elapsedTime", "0");
    65 shouldBe("new TransitionEvent('eventType', { elapsedTime: 'doremi' }).elapsedTime", "NaN");
     65shouldThrowErrorName("new TransitionEvent('eventType', { elapsedTime: 'doremi' }).elapsedTime", "TypeError");
    6666shouldBe("new TransitionEvent('eventType', { elapsedTime: [] }).elapsedTime", "0");
    6767shouldBe("new TransitionEvent('eventType', { elapsedTime: [123.45] }).elapsedTime", "123.45");
    68 shouldBe("new TransitionEvent('eventType', { elapsedTime: [123.45, 678.90] }).elapsedTime", "NaN");
    69 shouldBe("new TransitionEvent('eventType', { elapsedTime: {doremi: 123.45} }).elapsedTime", "NaN");
     68shouldThrowErrorName("new TransitionEvent('eventType', { elapsedTime: [123.45, 678.90] }).elapsedTime", "TypeError");
     69shouldThrowErrorName("new TransitionEvent('eventType', { elapsedTime: {doremi: 123.45} }).elapsedTime", "TypeError");
    7070shouldBe("new TransitionEvent('eventType', { elapsedTime: {valueOf: function () { return 123.45 } } }).elapsedTime", "123.45");
    7171
  • trunk/LayoutTests/fast/events/constructors/webkit-animation-event-constructor-expected.txt

    r94861 r207215  
    1414PASS new WebKitAnimationEvent('eventType', { animationName: 'doremi' }).animationName is "doremi"
    1515PASS new WebKitAnimationEvent('eventType', { animationName: '' }).animationName is ""
    16 PASS new WebKitAnimationEvent('eventType', { animationName: undefined }).animationName is "undefined"
     16PASS new WebKitAnimationEvent('eventType', { animationName: undefined }).animationName is ""
    1717PASS new WebKitAnimationEvent('eventType', { animationName: null }).animationName is "null"
    1818PASS new WebKitAnimationEvent('eventType', { animationName: false }).animationName is "false"
     
    2929PASS new WebKitAnimationEvent('eventType', { elapsedTime: -123.45 }).elapsedTime is -123.45
    3030PASS new WebKitAnimationEvent('eventType', { elapsedTime: 18446744073709551615 }).elapsedTime is 18446744073709551615
    31 PASS new WebKitAnimationEvent('eventType', { elapsedTime: NaN }).elapsedTime is NaN
    32 PASS new WebKitAnimationEvent('eventType', { elapsedTime: Infinity }).elapsedTime is Infinity
    33 PASS new WebKitAnimationEvent('eventType', { elapsedTime: -Infinity }).elapsedTime is -Infinity
    34 PASS new WebKitAnimationEvent('eventType', { elapsedTime: undefined }).elapsedTime is NaN
     31PASS new WebKitAnimationEvent('eventType', { elapsedTime: NaN }).elapsedTime threw exception TypeError: The provided value is non-finite.
     32PASS new WebKitAnimationEvent('eventType', { elapsedTime: Infinity }).elapsedTime threw exception TypeError: The provided value is non-finite.
     33PASS new WebKitAnimationEvent('eventType', { elapsedTime: -Infinity }).elapsedTime threw exception TypeError: The provided value is non-finite.
     34PASS new WebKitAnimationEvent('eventType', { elapsedTime: undefined }).elapsedTime is 0
    3535PASS new WebKitAnimationEvent('eventType', { elapsedTime: null }).elapsedTime is 0
    3636PASS new WebKitAnimationEvent('eventType', { elapsedTime: false }).elapsedTime is 0
    3737PASS new WebKitAnimationEvent('eventType', { elapsedTime: true }).elapsedTime is 1
    3838PASS new WebKitAnimationEvent('eventType', { elapsedTime: '' }).elapsedTime is 0
    39 PASS new WebKitAnimationEvent('eventType', { elapsedTime: 'doremi' }).elapsedTime is NaN
     39PASS new WebKitAnimationEvent('eventType', { elapsedTime: 'doremi' }).elapsedTime threw exception TypeError: The provided value is non-finite.
    4040PASS new WebKitAnimationEvent('eventType', { elapsedTime: [] }).elapsedTime is 0
    4141PASS new WebKitAnimationEvent('eventType', { elapsedTime: [123.45] }).elapsedTime is 123.45
    42 PASS new WebKitAnimationEvent('eventType', { elapsedTime: [123.45, 678.90] }).elapsedTime is NaN
    43 PASS new WebKitAnimationEvent('eventType', { elapsedTime: {doremi: 123.45} }).elapsedTime is NaN
     42PASS new WebKitAnimationEvent('eventType', { elapsedTime: [123.45, 678.90] }).elapsedTime threw exception TypeError: The provided value is non-finite.
     43PASS new WebKitAnimationEvent('eventType', { elapsedTime: {doremi: 123.45} }).elapsedTime threw exception TypeError: The provided value is non-finite.
    4444PASS new WebKitAnimationEvent('eventType', { elapsedTime: {valueOf: function () { return 123.45 } } }).elapsedTime is 123.45
    4545PASS new WebKitAnimationEvent('eventType', { bubbles: true, cancelable: true, animationName: 'doremi', elapsedTime: 123.45 }).bubbles is true
  • trunk/LayoutTests/fast/events/constructors/webkit-animation-event-constructor.html

    r155267 r207215  
    2929
    3030// Non-strings.
    31 shouldBeEqualToString("new WebKitAnimationEvent('eventType', { animationName: undefined }).animationName", "undefined");
     31shouldBeEqualToString("new WebKitAnimationEvent('eventType', { animationName: undefined }).animationName", "");
    3232shouldBeEqualToString("new WebKitAnimationEvent('eventType', { animationName: null }).animationName", "null");
    3333shouldBeEqualToString("new WebKitAnimationEvent('eventType', { animationName: false }).animationName", "false");
     
    4747shouldBe("new WebKitAnimationEvent('eventType', { elapsedTime: -123.45 }).elapsedTime", "-123.45");
    4848shouldBe("new WebKitAnimationEvent('eventType', { elapsedTime: 18446744073709551615 }).elapsedTime", "18446744073709551615");
    49 shouldBe("new WebKitAnimationEvent('eventType', { elapsedTime: NaN }).elapsedTime", "NaN");
    50 shouldBe("new WebKitAnimationEvent('eventType', { elapsedTime: Infinity }).elapsedTime", "Infinity");
    51 shouldBe("new WebKitAnimationEvent('eventType', { elapsedTime: -Infinity }).elapsedTime", "-Infinity");
     49shouldThrowErrorName("new WebKitAnimationEvent('eventType', { elapsedTime: NaN }).elapsedTime", "TypeError");
     50shouldThrowErrorName("new WebKitAnimationEvent('eventType', { elapsedTime: Infinity }).elapsedTime", "TypeError");
     51shouldThrowErrorName("new WebKitAnimationEvent('eventType', { elapsedTime: -Infinity }).elapsedTime", "TypeError");
    5252
    5353// Non-numeric values.
    54 shouldBe("new WebKitAnimationEvent('eventType', { elapsedTime: undefined }).elapsedTime", "NaN");
     54shouldBe("new WebKitAnimationEvent('eventType', { elapsedTime: undefined }).elapsedTime", "0");
    5555shouldBe("new WebKitAnimationEvent('eventType', { elapsedTime: null }).elapsedTime", "0");
    5656shouldBe("new WebKitAnimationEvent('eventType', { elapsedTime: false }).elapsedTime", "0");
    5757shouldBe("new WebKitAnimationEvent('eventType', { elapsedTime: true }).elapsedTime", "1");
    5858shouldBe("new WebKitAnimationEvent('eventType', { elapsedTime: '' }).elapsedTime", "0");
    59 shouldBe("new WebKitAnimationEvent('eventType', { elapsedTime: 'doremi' }).elapsedTime", "NaN");
     59shouldThrowErrorName("new WebKitAnimationEvent('eventType', { elapsedTime: 'doremi' }).elapsedTime", "TypeError");
    6060shouldBe("new WebKitAnimationEvent('eventType', { elapsedTime: [] }).elapsedTime", "0");
    6161shouldBe("new WebKitAnimationEvent('eventType', { elapsedTime: [123.45] }).elapsedTime", "123.45");
    62 shouldBe("new WebKitAnimationEvent('eventType', { elapsedTime: [123.45, 678.90] }).elapsedTime", "NaN");
    63 shouldBe("new WebKitAnimationEvent('eventType', { elapsedTime: {doremi: 123.45} }).elapsedTime", "NaN");
     62shouldThrowErrorName("new WebKitAnimationEvent('eventType', { elapsedTime: [123.45, 678.90] }).elapsedTime", "TypeError");
     63shouldThrowErrorName("new WebKitAnimationEvent('eventType', { elapsedTime: {doremi: 123.45} }).elapsedTime", "TypeError");
    6464shouldBe("new WebKitAnimationEvent('eventType', { elapsedTime: {valueOf: function () { return 123.45 } } }).elapsedTime", "123.45");
    6565
  • trunk/LayoutTests/fast/events/constructors/webkit-transition-event-constructor-expected.txt

    r141119 r207215  
    1515PASS new WebKitTransitionEvent('eventType', { propertyName: 'doremi' }).propertyName is "doremi"
    1616PASS new WebKitTransitionEvent('eventType', { propertyName: '' }).propertyName is ""
    17 PASS new WebKitTransitionEvent('eventType', { propertyName: undefined }).propertyName is "undefined"
     17PASS new WebKitTransitionEvent('eventType', { propertyName: undefined }).propertyName is ""
    1818PASS new WebKitTransitionEvent('eventType', { propertyName: null }).propertyName is "null"
    1919PASS new WebKitTransitionEvent('eventType', { propertyName: false }).propertyName is "false"
     
    3030PASS new WebKitTransitionEvent('eventType', { elapsedTime: -123.45 }).elapsedTime is -123.45
    3131PASS new WebKitTransitionEvent('eventType', { elapsedTime: 18446744073709551615 }).elapsedTime is 18446744073709551615
    32 PASS new WebKitTransitionEvent('eventType', { elapsedTime: NaN }).elapsedTime is NaN
    33 PASS new WebKitTransitionEvent('eventType', { elapsedTime: Infinity }).elapsedTime is Infinity
    34 PASS new WebKitTransitionEvent('eventType', { elapsedTime: -Infinity }).elapsedTime is -Infinity
     32PASS new WebKitTransitionEvent('eventType', { elapsedTime: NaN }).elapsedTime threw exception TypeError: The provided value is non-finite.
     33PASS new WebKitTransitionEvent('eventType', { elapsedTime: Infinity }).elapsedTime threw exception TypeError: The provided value is non-finite.
     34PASS new WebKitTransitionEvent('eventType', { elapsedTime: -Infinity }).elapsedTime threw exception TypeError: The provided value is non-finite.
    3535PASS new WebKitTransitionEvent('eventType', { pseudoElement: '::before' }).pseudoElement is "::before"
    3636PASS new WebKitTransitionEvent('eventType', { pseudoElement: '' }).pseudoElement is ""
    37 PASS new WebKitTransitionEvent('eventType', { elapsedTime: undefined }).elapsedTime is NaN
     37PASS new WebKitTransitionEvent('eventType', { elapsedTime: undefined }).elapsedTime is 0
    3838PASS new WebKitTransitionEvent('eventType', { elapsedTime: null }).elapsedTime is 0
    3939PASS new WebKitTransitionEvent('eventType', { elapsedTime: false }).elapsedTime is 0
    4040PASS new WebKitTransitionEvent('eventType', { elapsedTime: true }).elapsedTime is 1
    4141PASS new WebKitTransitionEvent('eventType', { elapsedTime: '' }).elapsedTime is 0
    42 PASS new WebKitTransitionEvent('eventType', { elapsedTime: 'doremi' }).elapsedTime is NaN
     42PASS new WebKitTransitionEvent('eventType', { elapsedTime: 'doremi' }).elapsedTime threw exception TypeError: The provided value is non-finite.
    4343PASS new WebKitTransitionEvent('eventType', { elapsedTime: [] }).elapsedTime is 0
    4444PASS new WebKitTransitionEvent('eventType', { elapsedTime: [123.45] }).elapsedTime is 123.45
    45 PASS new WebKitTransitionEvent('eventType', { elapsedTime: [123.45, 678.90] }).elapsedTime is NaN
    46 PASS new WebKitTransitionEvent('eventType', { elapsedTime: {doremi: 123.45} }).elapsedTime is NaN
     45PASS new WebKitTransitionEvent('eventType', { elapsedTime: [123.45, 678.90] }).elapsedTime threw exception TypeError: The provided value is non-finite.
     46PASS new WebKitTransitionEvent('eventType', { elapsedTime: {doremi: 123.45} }).elapsedTime threw exception TypeError: The provided value is non-finite.
    4747PASS new WebKitTransitionEvent('eventType', { elapsedTime: {valueOf: function () { return 123.45 } } }).elapsedTime is 123.45
    4848PASS new WebKitTransitionEvent('eventType', { bubbles: true, cancelable: true, propertyName: 'doremi', elapsedTime: 123.45, pseudoElement: '::after' }).bubbles is true
  • trunk/LayoutTests/fast/events/constructors/webkit-transition-event-constructor.html

    r155267 r207215  
    3030
    3131// Non-strings.
    32 shouldBeEqualToString("new WebKitTransitionEvent('eventType', { propertyName: undefined }).propertyName", "undefined");
     32shouldBeEqualToString("new WebKitTransitionEvent('eventType', { propertyName: undefined }).propertyName", "");
    3333shouldBeEqualToString("new WebKitTransitionEvent('eventType', { propertyName: null }).propertyName", "null");
    3434shouldBeEqualToString("new WebKitTransitionEvent('eventType', { propertyName: false }).propertyName", "false");
     
    4848shouldBe("new WebKitTransitionEvent('eventType', { elapsedTime: -123.45 }).elapsedTime", "-123.45");
    4949shouldBe("new WebKitTransitionEvent('eventType', { elapsedTime: 18446744073709551615 }).elapsedTime", "18446744073709551615");
    50 shouldBe("new WebKitTransitionEvent('eventType', { elapsedTime: NaN }).elapsedTime", "NaN");
    51 shouldBe("new WebKitTransitionEvent('eventType', { elapsedTime: Infinity }).elapsedTime", "Infinity");
    52 shouldBe("new WebKitTransitionEvent('eventType', { elapsedTime: -Infinity }).elapsedTime", "-Infinity");
     50shouldThrowErrorName("new WebKitTransitionEvent('eventType', { elapsedTime: NaN }).elapsedTime", "TypeError");
     51shouldThrowErrorName("new WebKitTransitionEvent('eventType', { elapsedTime: Infinity }).elapsedTime", "TypeError");
     52shouldThrowErrorName("new WebKitTransitionEvent('eventType', { elapsedTime: -Infinity }).elapsedTime", "TypeError");
    5353
    5454// pseudoElement is passed.
     
    5858
    5959// Non-numeric values.
    60 shouldBe("new WebKitTransitionEvent('eventType', { elapsedTime: undefined }).elapsedTime", "NaN");
     60shouldBe("new WebKitTransitionEvent('eventType', { elapsedTime: undefined }).elapsedTime", "0");
    6161shouldBe("new WebKitTransitionEvent('eventType', { elapsedTime: null }).elapsedTime", "0");
    6262shouldBe("new WebKitTransitionEvent('eventType', { elapsedTime: false }).elapsedTime", "0");
    6363shouldBe("new WebKitTransitionEvent('eventType', { elapsedTime: true }).elapsedTime", "1");
    6464shouldBe("new WebKitTransitionEvent('eventType', { elapsedTime: '' }).elapsedTime", "0");
    65 shouldBe("new WebKitTransitionEvent('eventType', { elapsedTime: 'doremi' }).elapsedTime", "NaN");
     65shouldThrowErrorName("new WebKitTransitionEvent('eventType', { elapsedTime: 'doremi' }).elapsedTime", "TypeError");
    6666shouldBe("new WebKitTransitionEvent('eventType', { elapsedTime: [] }).elapsedTime", "0");
    6767shouldBe("new WebKitTransitionEvent('eventType', { elapsedTime: [123.45] }).elapsedTime", "123.45");
    68 shouldBe("new WebKitTransitionEvent('eventType', { elapsedTime: [123.45, 678.90] }).elapsedTime", "NaN");
    69 shouldBe("new WebKitTransitionEvent('eventType', { elapsedTime: {doremi: 123.45} }).elapsedTime", "NaN");
     68shouldThrowErrorName("new WebKitTransitionEvent('eventType', { elapsedTime: [123.45, 678.90] }).elapsedTime", "TypeError");
     69shouldThrowErrorName("new WebKitTransitionEvent('eventType', { elapsedTime: {doremi: 123.45} }).elapsedTime", "TypeError");
    7070shouldBe("new WebKitTransitionEvent('eventType', { elapsedTime: {valueOf: function () { return 123.45 } } }).elapsedTime", "123.45");
    7171
  • trunk/Source/WebCore/ChangeLog

    r207214 r207215  
     12016-10-12  Chris Dumez  <cdumez@apple.com>
     2
     3        Update remaining DOM events to stop using legacy [ConstructorTemplate=Event]
     4        https://bugs.webkit.org/show_bug.cgi?id=163319
     5
     6        Reviewed by Darin Adler.
     7
     8        Update remaining DOM events to stop using legacy [ConstructorTemplate=Event]
     9        and use regular constructors instead.
     10
     11        No new tests, updated existing tests.
     12
     13        * dom/AutocompleteErrorEvent.h:
     14        * dom/AutocompleteErrorEvent.idl:
     15        * dom/BeforeLoadEvent.h:
     16        * dom/BeforeLoadEvent.idl:
     17        * dom/CompositionEvent.cpp:
     18        (WebCore::CompositionEvent::CompositionEvent):
     19        * dom/CompositionEvent.h:
     20        * dom/CompositionEvent.idl:
     21        * dom/ErrorEvent.cpp:
     22        (WebCore::ErrorEvent::ErrorEvent):
     23        * dom/ErrorEvent.h:
     24        * dom/ErrorEvent.idl:
     25        * dom/FocusEvent.cpp:
     26        (WebCore::FocusEvent::FocusEvent):
     27        * dom/FocusEvent.h:
     28        * dom/FocusEvent.idl:
     29        * dom/HashChangeEvent.h:
     30        * dom/HashChangeEvent.idl:
     31        * dom/OverflowEvent.cpp:
     32        (WebCore::OverflowEvent::OverflowEvent):
     33        * dom/OverflowEvent.h:
     34        * dom/OverflowEvent.idl:
     35        * dom/PageTransitionEvent.cpp:
     36        (WebCore::PageTransitionEvent::PageTransitionEvent):
     37        * dom/PageTransitionEvent.h:
     38        * dom/PageTransitionEvent.idl:
     39        * dom/PopStateEvent.cpp:
     40        (WebCore::PopStateEvent::PopStateEvent):
     41        (WebCore::PopStateEvent::create):
     42        * dom/PopStateEvent.h:
     43        * dom/PopStateEvent.idl:
     44        * dom/SecurityPolicyViolationEvent.h:
     45        * dom/SecurityPolicyViolationEvent.idl:
     46        * dom/TouchEvent.cpp:
     47        (WebCore::TouchEvent::TouchEvent):
     48        * dom/TouchEvent.h:
     49        * dom/TouchEvent.idl:
     50        * dom/TransitionEvent.cpp:
     51        (WebCore::TransitionEvent::TransitionEvent):
     52        * dom/TransitionEvent.h:
     53        * dom/TransitionEvent.idl:
     54        * dom/WebKitAnimationEvent.cpp:
     55        (WebCore::WebKitAnimationEvent::WebKitAnimationEvent):
     56        * dom/WebKitAnimationEvent.h:
     57        * dom/WebKitAnimationEvent.idl:
     58        * dom/WebKitTransitionEvent.cpp:
     59        (WebCore::WebKitTransitionEvent::WebKitTransitionEvent):
     60        * dom/WebKitTransitionEvent.h:
     61        * dom/WebKitTransitionEvent.idl:
     62
    1632016-10-12  Chris Dumez  <cdumez@apple.com>
    264
  • trunk/Source/WebCore/dom/AutocompleteErrorEvent.h

    r184225 r207215  
    3333namespace WebCore {
    3434
    35 struct AutocompleteErrorEventInit : public EventInit {
    36     String reason;
    37 };
    38 
    3935class AutocompleteErrorEvent final : public Event {
    4036public:
     
    4945    }
    5046
    51     static Ref<AutocompleteErrorEvent> create(const AtomicString& eventType, const AutocompleteErrorEventInit& initializer)
     47    struct Init : EventInit {
     48        String reason;
     49    };
     50
     51    static Ref<AutocompleteErrorEvent> create(const AtomicString& eventType, const Init& initializer, IsTrusted isTrusted = IsTrusted::No)
    5252    {
    53         return adoptRef(*new AutocompleteErrorEvent(eventType, initializer));
     53        return adoptRef(*new AutocompleteErrorEvent(eventType, initializer, isTrusted));
    5454    }
    5555
     
    6767    }
    6868
    69     AutocompleteErrorEvent(const AtomicString& eventType, const AutocompleteErrorEventInit& initializer)
    70         : Event(eventType, initializer)
     69    AutocompleteErrorEvent(const AtomicString& eventType, const Init& initializer, IsTrusted isTrusted)
     70        : Event(eventType, initializer, isTrusted)
    7171        , m_reason(initializer.reason)
    7272    {
  • trunk/Source/WebCore/dom/AutocompleteErrorEvent.idl

    r173596 r207215  
    2525[
    2626    Conditional=REQUEST_AUTOCOMPLETE,
    27     ConstructorTemplate=Event,
     27    Constructor(DOMString type, optional AutocompleteErrorEventInit eventInitDict),
    2828    JSGenerateToJSObject
    2929] interface AutocompleteErrorEvent : Event {
    30     [InitializedByEventConstructor] readonly attribute DOMString reason;
     30    readonly attribute DOMString reason;
    3131};
    3232
     33dictionary AutocompleteErrorEventInit : EventInit {
     34    DOMString reason = "";
     35};
  • trunk/Source/WebCore/dom/BeforeLoadEvent.h

    r197563 r207215  
    3333namespace WebCore {
    3434
    35 struct BeforeLoadEventInit : public EventInit {
    36     String url;
    37 };
    38 
    3935class BeforeLoadEvent final : public Event {
    4036public:
     
    4440    }
    4541
    46     static Ref<BeforeLoadEvent> createForBindings(const AtomicString& type, const BeforeLoadEventInit& initializer)
     42    struct Init : EventInit {
     43        String url;
     44    };
     45
     46    static Ref<BeforeLoadEvent> create(const AtomicString& type, const Init& initializer, IsTrusted isTrusted = IsTrusted::No)
    4747    {
    48         return adoptRef(*new BeforeLoadEvent(type, initializer));
     48        return adoptRef(*new BeforeLoadEvent(type, initializer, isTrusted));
    4949    }
    5050
     
    6060    }
    6161
    62     BeforeLoadEvent(const AtomicString& type, const BeforeLoadEventInit& initializer)
    63         : Event(type, initializer)
     62    BeforeLoadEvent(const AtomicString& type, const Init& initializer, IsTrusted isTrusted)
     63        : Event(type, initializer, isTrusted)
    6464        , m_url(initializer.url)
    6565    {
  • trunk/Source/WebCore/dom/BeforeLoadEvent.idl

    r165676 r207215  
    2626
    2727[
    28     ConstructorTemplate=Event
     28    Constructor(DOMString type, optional BeforeLoadEventInit eventInitDict)
    2929] interface BeforeLoadEvent : Event {
    30     [InitializedByEventConstructor] readonly attribute DOMString url;
     30    readonly attribute DOMString url;
    3131};
    3232
     33dictionary BeforeLoadEventInit : EventInit {
     34    DOMString url = "";
     35};
  • trunk/Source/WebCore/dom/CompositionEvent.cpp

    r204681 r207215  
    4242}
    4343
    44 CompositionEvent::CompositionEvent(const AtomicString& type, const CompositionEventInit& initializer)
    45     : UIEvent(type, initializer)
     44CompositionEvent::CompositionEvent(const AtomicString& type, const Init& initializer, IsTrusted isTrusted)
     45    : UIEvent(type, initializer, isTrusted)
    4646    , m_data(initializer.data)
    4747{
  • trunk/Source/WebCore/dom/CompositionEvent.h

    r204681 r207215  
    3232namespace WebCore {
    3333
    34 struct CompositionEventInit : UIEventInit {
    35     String data;
    36 };
    37 
    3834class CompositionEvent final : public UIEvent {
    3935public:
     
    4844    }
    4945
    50     static Ref<CompositionEvent> createForBindings(const AtomicString& type, const CompositionEventInit& initializer)
     46    struct Init : UIEventInit {
     47        String data;
     48    };
     49
     50    static Ref<CompositionEvent> create(const AtomicString& type, const Init& initializer, IsTrusted isTrusted = IsTrusted::No)
    5151    {
    52         return adoptRef(*new CompositionEvent(type, initializer));
     52        return adoptRef(*new CompositionEvent(type, initializer, isTrusted));
    5353    }
    5454
     
    6464    CompositionEvent();
    6565    CompositionEvent(const AtomicString& type, DOMWindow*, const String&);
    66     CompositionEvent(const AtomicString& type, const CompositionEventInit&);
     66    CompositionEvent(const AtomicString& type, const Init&, IsTrusted);
    6767
    6868    bool isCompositionEvent() const override;
  • trunk/Source/WebCore/dom/CompositionEvent.idl

    r199969 r207215  
    2525
    2626[
    27     ConstructorConditional=DOM4_EVENTS_CONSTRUCTOR,
    28     ConstructorTemplate=Event,
     27    Constructor(DOMString type, optional CompositionEventInit eventInitDict),
    2928] interface CompositionEvent : UIEvent {
    3029
    31     [InitializedByEventConstructor] readonly attribute DOMString data;
     30    readonly attribute DOMString data;
    3231
    3332    // FIXME: Using "undefined" as default parameter value is wrong.
     
    4039};
    4140
     41dictionary CompositionEventInit : UIEventInit {
     42    DOMString data = "";
     43};
  • trunk/Source/WebCore/dom/ErrorEvent.cpp

    r205462 r207215  
    4141namespace WebCore {
    4242
    43 ErrorEvent::ErrorEvent(const AtomicString& type, const ErrorEventInit& initializer)
    44     : Event(type, initializer)
     43ErrorEvent::ErrorEvent(ExecState& state, const AtomicString& type, const Init& initializer, IsTrusted isTrusted)
     44    : Event(type, initializer, isTrusted)
    4545    , m_message(initializer.message)
    4646    , m_fileName(initializer.filename)
    4747    , m_lineNumber(initializer.lineno)
    4848    , m_columnNumber(initializer.colno)
    49     , m_error(initializer.error)
     49    , m_error(state.vm(), initializer.error)
    5050{
    5151}
  • trunk/Source/WebCore/dom/ErrorEvent.h

    r202023 r207215  
    4040namespace WebCore {
    4141
    42 struct ErrorEventInit : public EventInit {
    43     String message;
    44     String filename;
    45     unsigned lineno { 0 };
    46     unsigned colno { 0 };
    47     Deprecated::ScriptValue error;
    48 };
    49 
    5042class ErrorEvent final : public Event {
    5143public:
     
    5547    }
    5648
    57     static Ref<ErrorEvent> createForBindings(const AtomicString& type, const ErrorEventInit& initializer)
     49    struct Init : EventInit {
     50        String message;
     51        String filename;
     52        unsigned lineno { 0 };
     53        unsigned colno { 0 };
     54        JSC::JSValue error;
     55    };
     56
     57    static Ref<ErrorEvent> create(JSC::ExecState& state, const AtomicString& type, const Init& initializer, IsTrusted isTrusted = IsTrusted::No)
    5858    {
    59         return adoptRef(*new ErrorEvent(type, initializer));
     59        return adoptRef(*new ErrorEvent(state, type, initializer, isTrusted));
    6060    }
    6161
     
    7373private:
    7474    ErrorEvent(const String& message, const String& fileName, unsigned lineNumber, unsigned columnNumber, const Deprecated::ScriptValue& error);
    75     ErrorEvent(const AtomicString&, const ErrorEventInit&);
     75    ErrorEvent(JSC::ExecState&, const AtomicString&, const Init&, IsTrusted);
    7676
    7777    RefPtr<SerializedScriptValue> trySerializeError(JSC::ExecState&);
  • trunk/Source/WebCore/dom/ErrorEvent.idl

    r204215 r207215  
    3131
    3232[
    33     ConstructorTemplate=Event,
     33    Constructor(DOMString type, optional ErrorEventInit eventInitDict),
     34    ConstructorCallWith=ScriptState,
    3435    Exposed=(Window,Worker),
    3536] interface ErrorEvent : Event {
    36     [InitializedByEventConstructor] readonly attribute DOMString message;
    37     [InitializedByEventConstructor] readonly attribute USVString filename;
    38     [InitializedByEventConstructor] readonly attribute unsigned long lineno;
    39     [InitializedByEventConstructor] readonly attribute unsigned long colno;
    40     [InitializedByEventConstructor, CustomGetter] readonly attribute any error;
     37    readonly attribute DOMString message;
     38    readonly attribute USVString filename;
     39    readonly attribute unsigned long lineno;
     40    readonly attribute unsigned long colno;
     41    [CustomGetter] readonly attribute any error;
    4142};
    4243
     44dictionary ErrorEventInit : EventInit {
     45    DOMString message = "";
     46    USVString filename = "";
     47    unsigned long lineno = 0;
     48    unsigned long colno = 0;
     49    any error = null;
     50};
  • trunk/Source/WebCore/dom/FocusEvent.cpp

    r204681 r207215  
    4747}
    4848
    49 FocusEvent::FocusEvent(const AtomicString& type, const FocusEventInit& initializer)
    50     : UIEvent(type, initializer)
     49FocusEvent::FocusEvent(const AtomicString& type, const Init& initializer, IsTrusted isTrusted)
     50    : UIEvent(type, initializer, isTrusted)
    5151    , m_relatedTarget(initializer.relatedTarget)
    5252{
  • trunk/Source/WebCore/dom/FocusEvent.h

    r204681 r207215  
    3434class Node;
    3535
    36 struct FocusEventInit : public UIEventInit {
    37     RefPtr<EventTarget> relatedTarget;
    38 };
    39 
    4036class FocusEvent final : public UIEvent {
    4137public:
     
    4541    }
    4642
    47     static Ref<FocusEvent> createForBindings(const AtomicString& type, const FocusEventInit& initializer)
     43    struct Init : UIEventInit {
     44        RefPtr<EventTarget> relatedTarget;
     45    };
     46
     47    static Ref<FocusEvent> create(const AtomicString& type, const Init& initializer, IsTrusted isTrusted = IsTrusted::No)
    4848    {
    49         return adoptRef(*new FocusEvent(type, initializer));
     49        return adoptRef(*new FocusEvent(type, initializer, isTrusted));
    5050    }
    5151
     
    5757private:
    5858    FocusEvent(const AtomicString& type, bool canBubble, bool cancelable, DOMWindow*, int, RefPtr<EventTarget>&&);
    59     FocusEvent(const AtomicString& type, const FocusEventInit&);
     59    FocusEvent(const AtomicString& type, const Init&, IsTrusted);
    6060
    6161    bool isFocusEvent() const override;
  • trunk/Source/WebCore/dom/FocusEvent.idl

    r142205 r207215  
    2525
    2626[
    27     ConstructorConditional=DOM4_EVENTS_CONSTRUCTOR,
    28     ConstructorTemplate=Event
     27    Constructor(DOMString type, optional FocusEventInit eventInitDict),
    2928] interface FocusEvent : UIEvent {
    30     [InitializedByEventConstructor] readonly attribute EventTarget relatedTarget;
     29    readonly attribute EventTarget? relatedTarget;
    3130};
     31
     32dictionary FocusEventInit : UIEventInit {
     33    EventTarget? relatedTarget = null;
     34};
  • trunk/Source/WebCore/dom/HashChangeEvent.h

    r197563 r207215  
    2727namespace WebCore {
    2828
    29 struct HashChangeEventInit : public EventInit {
    30     String oldURL;
    31     String newURL;
    32 };
    33 
    3429class HashChangeEvent final : public Event {
    3530public:
     
    4439    }
    4540
    46     static Ref<HashChangeEvent> createForBindings(const AtomicString& type, const HashChangeEventInit& initializer)
     41    struct Init : EventInit {
     42        String oldURL;
     43        String newURL;
     44    };
     45
     46    static Ref<HashChangeEvent> create(const AtomicString& type, const Init& initializer, IsTrusted isTrusted = IsTrusted::No)
    4747    {
    48         return adoptRef(*new HashChangeEvent(type, initializer));
     48        return adoptRef(*new HashChangeEvent(type, initializer, isTrusted));
    4949    }
    5050
     
    7777    }
    7878
    79     HashChangeEvent(const AtomicString& type, const HashChangeEventInit& initializer)
    80         : Event(type, initializer)
     79    HashChangeEvent(const AtomicString& type, const Init& initializer, IsTrusted isTrusted)
     80        : Event(type, initializer, isTrusted)
    8181        , m_oldURL(initializer.oldURL)
    8282        , m_newURL(initializer.newURL)
  • trunk/Source/WebCore/dom/HashChangeEvent.idl

    r204215 r207215  
    2020// Introduced in http://www.whatwg.org/specs/web-apps/current-work/multipage/history.html#event-hashchange
    2121[
    22     ConstructorTemplate=Event,
     22    Constructor(DOMString type, optional HashChangeEventInit eventInitDict),
    2323] interface HashChangeEvent : Event {
    2424    // FIXME: Using "undefined" as default parameter value is wrong.
     
    2828                             optional USVString oldURL = "undefined",
    2929                             optional USVString newURL = "undefined");
    30     [InitializedByEventConstructor] readonly attribute USVString oldURL;
    31     [InitializedByEventConstructor] readonly attribute USVString newURL;
     30
     31    readonly attribute USVString oldURL;
     32    readonly attribute USVString newURL;
    3233};
    3334
     35dictionary HashChangeEventInit : EventInit {
     36    USVString oldURL = "";
     37    USVString newURL = "";
     38};
  • trunk/Source/WebCore/dom/OverflowEvent.cpp

    r196400 r207215  
    5353}
    5454
    55 OverflowEvent::OverflowEvent(const AtomicString& type, const OverflowEventInit& initializer)
    56     : Event(type, initializer)
     55OverflowEvent::OverflowEvent(const AtomicString& type, const Init& initializer, IsTrusted isTrusted)
     56    : Event(type, initializer, isTrusted)
    5757    , m_orient(initializer.orient)
    5858    , m_horizontalOverflow(initializer.horizontalOverflow)
  • trunk/Source/WebCore/dom/OverflowEvent.h

    r204717 r207215  
    3131namespace WebCore {
    3232
    33 struct OverflowEventInit : public EventInit {
    34     unsigned short orient { 0 };
    35     bool horizontalOverflow { false };
    36     bool verticalOverflow { false };
    37 };
    38 
    3933class OverflowEvent final : public Event {
    4034public:
     
    4943        return adoptRef(*new OverflowEvent(horizontalOverflowChanged, horizontalOverflow, verticalOverflowChanged, verticalOverflow));
    5044    }
     45
    5146    static Ref<OverflowEvent> createForBindings()
    5247    {
    5348        return adoptRef(*new OverflowEvent);
    5449    }
    55     static Ref<OverflowEvent> createForBindings(const AtomicString& type, const OverflowEventInit& initializer)
     50
     51    struct Init : EventInit {
     52        unsigned short orient { 0 };
     53        bool horizontalOverflow { false };
     54        bool verticalOverflow { false };
     55    };
     56
     57    static Ref<OverflowEvent> create(const AtomicString& type, const Init& initializer, IsTrusted isTrusted = IsTrusted::No)
    5658    {
    57         return adoptRef(*new OverflowEvent(type, initializer));
     59        return adoptRef(*new OverflowEvent(type, initializer, isTrusted));
    5860    }
    5961
     
    6971    OverflowEvent();
    7072    OverflowEvent(bool horizontalOverflowChanged, bool horizontalOverflow, bool verticalOverflowChanged, bool verticalOverflow);
    71     OverflowEvent(const AtomicString&, const OverflowEventInit&);
     73    OverflowEvent(const AtomicString&, const Init&, IsTrusted);
    7274
    7375    unsigned short m_orient;
  • trunk/Source/WebCore/dom/OverflowEvent.idl

    r204259 r207215  
    2525
    2626[
    27     ConstructorTemplate=Event
     27    Constructor(DOMString type, optional OverflowEventInit eventInitDict),
    2828] interface OverflowEvent : Event {
    2929    const unsigned short HORIZONTAL = 0;
     
    3131    const unsigned short BOTH       = 2;
    3232   
    33     [InitializedByEventConstructor] readonly attribute unsigned short orient;
    34     [InitializedByEventConstructor] readonly attribute boolean horizontalOverflow;
    35     [InitializedByEventConstructor] readonly attribute boolean verticalOverflow;
     33    readonly attribute unsigned short orient;
     34    readonly attribute boolean horizontalOverflow;
     35    readonly attribute boolean verticalOverflow;
    3636};
    3737
     38dictionary OverflowEventInit : EventInit {
     39    unsigned short orient = 0;
     40    boolean horizontalOverflow = false;
     41    boolean verticalOverflow = false;
     42};
  • trunk/Source/WebCore/dom/PageTransitionEvent.cpp

    r196400 r207215  
    3737}
    3838
    39 PageTransitionEvent::PageTransitionEvent(const AtomicString& type, const PageTransitionEventInit& initializer)
    40     : Event(type, initializer)
     39PageTransitionEvent::PageTransitionEvent(const AtomicString& type, const Init& initializer, IsTrusted isTrusted)
     40    : Event(type, initializer, isTrusted)
    4141    , m_persisted(initializer.persisted)
    4242{
  • trunk/Source/WebCore/dom/PageTransitionEvent.h

    r197563 r207215  
    3131namespace WebCore {
    3232
    33 struct PageTransitionEventInit : public EventInit {
    34     bool persisted { false };
    35 };
    36 
    3733class PageTransitionEvent final : public Event {
    3834public:
     
    4137        return adoptRef(*new PageTransitionEvent(type, persisted));
    4238    }
    43     static Ref<PageTransitionEvent> createForBindings(const AtomicString& type, const PageTransitionEventInit& initializer)
     39
     40    struct Init : EventInit {
     41        bool persisted { false };
     42    };
     43
     44    static Ref<PageTransitionEvent> create(const AtomicString& type, const Init& initializer, IsTrusted isTrusted = IsTrusted::No)
    4445    {
    45         return adoptRef(*new PageTransitionEvent(type, initializer));
     46        return adoptRef(*new PageTransitionEvent(type, initializer, isTrusted));
    4647    }
    4748
     
    5455private:
    5556    PageTransitionEvent(const AtomicString& type, bool persisted);
    56     PageTransitionEvent(const AtomicString&, const PageTransitionEventInit&);
     57    PageTransitionEvent(const AtomicString&, const Init&, IsTrusted);
    5758
    5859    bool m_persisted;
  • trunk/Source/WebCore/dom/PageTransitionEvent.idl

    r131172 r207215  
    2525
    2626[
    27     ConstructorTemplate=Event
     27    Constructor(DOMString type, optional PageTransitionEventInit eventInitDict),
    2828] interface PageTransitionEvent : Event {
    29     [InitializedByEventConstructor] readonly attribute boolean persisted;
     29    readonly attribute boolean persisted;
    3030};
    3131
     32dictionary PageTransitionEventInit : EventInit {
     33    boolean persisted = false;
     34};
  • trunk/Source/WebCore/dom/PopStateEvent.cpp

    r205138 r207215  
    3434namespace WebCore {
    3535
    36 PopStateEvent::PopStateEvent(const AtomicString& type, const PopStateEventInit& initializer)
    37     : Event(type, initializer)
    38     , m_state(initializer.state)
     36PopStateEvent::PopStateEvent(JSC::ExecState& state, const AtomicString& type, const Init& initializer, IsTrusted isTrusted)
     37    : Event(type, initializer, isTrusted)
     38    , m_state(state.vm(), initializer.state)
    3939{
    4040}
     
    5656}
    5757
    58 Ref<PopStateEvent> PopStateEvent::createForBindings(const AtomicString& type, const PopStateEventInit& initializer)
     58Ref<PopStateEvent> PopStateEvent::create(JSC::ExecState& state, const AtomicString& type, const Init& initializer, IsTrusted isTrusted)
    5959{
    60     return adoptRef(*new PopStateEvent(type, initializer));
     60    return adoptRef(*new PopStateEvent(state, type, initializer, isTrusted));
    6161}
    6262
  • trunk/Source/WebCore/dom/PopStateEvent.h

    r205138 r207215  
    3535class SerializedScriptValue;
    3636
    37 struct PopStateEventInit : public EventInit {
    38     Deprecated::ScriptValue state;
    39 };
    40 
    4137class PopStateEvent final : public Event {
    4238public:
    4339    virtual ~PopStateEvent();
    4440    static Ref<PopStateEvent> create(RefPtr<SerializedScriptValue>&&, PassRefPtr<History>);
    45     static Ref<PopStateEvent> createForBindings(const AtomicString&, const PopStateEventInit&);
     41
     42    struct Init : EventInit {
     43        JSC::JSValue state;
     44    };
     45
     46    static Ref<PopStateEvent> create(JSC::ExecState&, const AtomicString&, const Init&, IsTrusted = IsTrusted::No);
    4647    static Ref<PopStateEvent> createForBindings();
    4748
     
    5758private:
    5859    PopStateEvent() = default;
    59     PopStateEvent(const AtomicString&, const PopStateEventInit&);
     60    PopStateEvent(JSC::ExecState&, const AtomicString&, const Init&, IsTrusted);
    6061    explicit PopStateEvent(PassRefPtr<SerializedScriptValue>, PassRefPtr<History>);
    6162
  • trunk/Source/WebCore/dom/PopStateEvent.idl

    r165676 r207215  
    2626
    2727[
    28     ConstructorTemplate=Event
     28    Constructor(DOMString type, optional PopStateEventInit eventInitDict),
     29    ConstructorCallWith=ScriptState,
    2930] interface PopStateEvent : Event {
    30     [InitializedByEventConstructor, CachedAttribute, CustomGetter] readonly attribute any state;
     31    [CachedAttribute, CustomGetter] readonly attribute any state;
    3132};
    3233
     34dictionary PopStateEventInit : EventInit {
     35    any state = null;
     36};
     37
  • trunk/Source/WebCore/dom/SecurityPolicyViolationEvent.h

    r197118 r207215  
    3131namespace WebCore {
    3232
    33 struct SecurityPolicyViolationEventInit : public EventInit {
    34     String documentURI;
    35     String referrer;
    36     String blockedURI;
    37     String violatedDirective;
    38     String effectiveDirective;
    39     String originalPolicy;
    40     String sourceFile;
    41     unsigned short statusCode { 0 };
    42     int lineNumber { 0 };
    43     int columnNumber { 0 };
    44 };
    45 
    4633class SecurityPolicyViolationEvent final : public Event {
    4734public:
     
    5643    }
    5744
    58     static Ref<SecurityPolicyViolationEvent> createForBindings(const AtomicString& type, const SecurityPolicyViolationEventInit& initializer)
     45    struct Init : EventInit {
     46        String documentURI;
     47        String referrer;
     48        String blockedURI;
     49        String violatedDirective;
     50        String effectiveDirective;
     51        String originalPolicy;
     52        String sourceFile;
     53        unsigned short statusCode { 0 };
     54        int lineNumber { 0 };
     55        int columnNumber { 0 };
     56    };
     57
     58    static Ref<SecurityPolicyViolationEvent> create(const AtomicString& type, const Init& initializer, IsTrusted isTrusted = IsTrusted::No)
    5959    {
    60         return adoptRef(*new SecurityPolicyViolationEvent(type, initializer));
     60        return adoptRef(*new SecurityPolicyViolationEvent(type, initializer, isTrusted));
    6161    }
    6262
     
    9494    }
    9595
    96     SecurityPolicyViolationEvent(const AtomicString& type, const SecurityPolicyViolationEventInit& initializer)
    97         : Event(type, initializer)
     96    SecurityPolicyViolationEvent(const AtomicString& type, const Init& initializer, IsTrusted isTrusted)
     97        : Event(type, initializer, isTrusted)
    9898        , m_documentURI(initializer.documentURI)
    9999        , m_referrer(initializer.referrer)
  • trunk/Source/WebCore/dom/SecurityPolicyViolationEvent.idl

    r197118 r207215  
    2525
    2626[
    27     ConstructorTemplate=Event,
     27    Constructor(DOMString type, optional SecurityPolicyViolationEventInit eventInitDict),
    2828] interface SecurityPolicyViolationEvent : Event {
    29     [InitializedByEventConstructor] readonly attribute DOMString documentURI;
    30     [InitializedByEventConstructor] readonly attribute DOMString referrer;
    31     [InitializedByEventConstructor] readonly attribute DOMString blockedURI;
    32     [InitializedByEventConstructor] readonly attribute DOMString violatedDirective;
    33     [InitializedByEventConstructor] readonly attribute DOMString effectiveDirective;
    34     [InitializedByEventConstructor] readonly attribute DOMString originalPolicy;
    35     [InitializedByEventConstructor] readonly attribute DOMString sourceFile;
    36     [InitializedByEventConstructor] readonly attribute unsigned short statusCode;
    37     [InitializedByEventConstructor] readonly attribute long lineNumber;
    38     [InitializedByEventConstructor] readonly attribute long columnNumber;
     29    readonly attribute USVString documentURI;
     30    readonly attribute DOMString referrer;
     31    readonly attribute USVString blockedURI;
     32    readonly attribute DOMString violatedDirective;
     33    readonly attribute DOMString effectiveDirective;
     34    readonly attribute DOMString originalPolicy;
     35    readonly attribute USVString sourceFile;
     36    readonly attribute unsigned short statusCode;
     37    readonly attribute long lineNumber;
     38    readonly attribute long columnNumber;
    3939};
     40
     41dictionary SecurityPolicyViolationEventInit : EventInit {
     42    USVString documentURI = "";
     43    DOMString referrer = "";
     44    USVString blockedURI = "";
     45    DOMString violatedDirective = "";
     46    DOMString effectiveDirective = "";
     47    DOMString originalPolicy = "";
     48    USVString sourceFile = "";
     49    unsigned short statusCode = 0;
     50    long lineNumber = 0;
     51    long columnNumber = 0;
     52};
  • trunk/Source/WebCore/dom/TouchEvent.cpp

    r204681 r207215  
    5656}
    5757
    58 TouchEvent::TouchEvent(const AtomicString& type, const TouchEventInit& initializer)
    59     : MouseRelatedEvent(type, initializer)
     58TouchEvent::TouchEvent(const AtomicString& type, const Init& initializer, IsTrusted isTrusted)
     59    : MouseRelatedEvent(type, initializer, isTrusted)
    6060    , m_touches(initializer.touches ? initializer.touches : TouchList::create())
    6161    , m_targetTouches(initializer.targetTouches ? initializer.targetTouches : TouchList::create())
  • trunk/Source/WebCore/dom/TouchEvent.h

    r204681 r207215  
    3737namespace WebCore {
    3838
    39 struct TouchEventInit : public MouseRelatedEventInit {
    40     RefPtr<TouchList> touches;
    41     RefPtr<TouchList> targetTouches;
    42     RefPtr<TouchList> changedTouches;
    43 };
    44 
    4539class TouchEvent final : public MouseRelatedEvent {
    4640public:
     
    6155        return adoptRef(*new TouchEvent);
    6256    }
    63     static Ref<TouchEvent> createForBindings(const AtomicString& type, const TouchEventInit& initializer)
     57
     58    struct Init : MouseRelatedEventInit {
     59        RefPtr<TouchList> touches;
     60        RefPtr<TouchList> targetTouches;
     61        RefPtr<TouchList> changedTouches;
     62    };
     63
     64    static Ref<TouchEvent> create(const AtomicString& type, const Init& initializer, IsTrusted isTrusted = IsTrusted::No)
    6465    {
    65         return adoptRef(*new TouchEvent(type, initializer));
     66        return adoptRef(*new TouchEvent(type, initializer, isTrusted));
    6667    }
    6768
     
    9192            int pageY,
    9293            bool ctrlKey, bool altKey, bool shiftKey, bool metaKey);
    93     TouchEvent(const AtomicString&, const TouchEventInit&);
     94    TouchEvent(const AtomicString&, const Init&, IsTrusted);
    9495
    9596    RefPtr<TouchList> m_touches;
  • trunk/Source/WebCore/dom/TouchEvent.idl

    r202178 r207215  
    2626[
    2727    Conditional=TOUCH_EVENTS,
    28     ConstructorTemplate=Event,
     28    Constructor(DOMString type, optional TouchEventInit eventInitDict),
    2929] interface TouchEvent : UIEvent {
    30     [InitializedByEventConstructor] readonly attribute TouchList touches;
    31     [InitializedByEventConstructor] readonly attribute TouchList targetTouches;
    32     [InitializedByEventConstructor] readonly attribute TouchList changedTouches;
     30    readonly attribute TouchList touches;
     31    readonly attribute TouchList targetTouches;
     32    readonly attribute TouchList changedTouches;
    3333    readonly attribute boolean ctrlKey;
    3434    readonly attribute boolean shiftKey;
     
    5151                        optional boolean metaKey = false);
    5252};
     53
     54dictionary TouchEventInit : UIEventInit {
     55    TouchList? touches = null;
     56    TouchList? targetTouches = null;
     57    TouchList? changedTouches = null;
     58};
  • trunk/Source/WebCore/dom/TransitionEvent.cpp

    r196400 r207215  
    4040}
    4141
    42 TransitionEvent::TransitionEvent(const AtomicString& type, const TransitionEventInit& initializer)
    43     : Event(type, initializer)
     42TransitionEvent::TransitionEvent(const AtomicString& type, const Init& initializer, IsTrusted isTrusted)
     43    : Event(type, initializer, isTrusted)
    4444    , m_propertyName(initializer.propertyName)
    4545    , m_elapsedTime(initializer.elapsedTime)
  • trunk/Source/WebCore/dom/TransitionEvent.h

    r197563 r207215  
    3232namespace WebCore {
    3333
    34 struct TransitionEventInit : public EventInit {
    35     String propertyName;
    36     double elapsedTime { 0 };
    37     String pseudoElement;
    38 };
    39 
    4034class TransitionEvent final : public Event {
    4135public:
     
    4438        return adoptRef(*new TransitionEvent(type, propertyName, elapsedTime, pseudoElement));
    4539    }
    46     static Ref<TransitionEvent> createForBindings(const AtomicString& type, const TransitionEventInit& initializer)
     40
     41    struct Init : EventInit {
     42        String propertyName;
     43        double elapsedTime { 0 };
     44        String pseudoElement;
     45    };
     46
     47    static Ref<TransitionEvent> create(const AtomicString& type, const Init& initializer, IsTrusted isTrusted = IsTrusted::No)
    4748    {
    48         return adoptRef(*new TransitionEvent(type, initializer));
     49        return adoptRef(*new TransitionEvent(type, initializer, isTrusted));
    4950    }
    5051
     
    5960private:
    6061    TransitionEvent(const AtomicString& type, const String& propertyName, double elapsedTime, const String& pseudoElement);
    61     TransitionEvent(const AtomicString& type, const TransitionEventInit& initializer);
     62    TransitionEvent(const AtomicString& type, const Init& initializer, IsTrusted);
    6263
    6364    String m_propertyName;
  • trunk/Source/WebCore/dom/TransitionEvent.idl

    r168302 r207215  
    2626
    2727[
    28     ConstructorTemplate=Event
     28    Constructor(DOMString type, optional TransitionEventInit transitionEventInitDict),
    2929] interface TransitionEvent : Event {
    30     [InitializedByEventConstructor] readonly attribute DOMString propertyName;
    31     [InitializedByEventConstructor] readonly attribute unrestricted double elapsedTime;
    32     [InitializedByEventConstructor] readonly attribute DOMString pseudoElement;
     30    readonly attribute DOMString propertyName;
     31    readonly attribute double elapsedTime;
     32    readonly attribute DOMString pseudoElement;
    3333};
    3434
     35dictionary TransitionEventInit : EventInit {
     36    DOMString propertyName = "";
     37    double elapsedTime = 0.0;
     38    DOMString pseudoElement = "";
     39};
  • trunk/Source/WebCore/dom/WebKitAnimationEvent.cpp

    r196400 r207215  
    3131namespace WebCore {
    3232
    33 WebKitAnimationEvent::WebKitAnimationEvent(const AtomicString& type, const WebKitAnimationEventInit& initializer)
    34     : Event(type, initializer)
     33WebKitAnimationEvent::WebKitAnimationEvent(const AtomicString& type, const Init& initializer, IsTrusted isTrusted)
     34    : Event(type, initializer, isTrusted)
    3535    , m_animationName(initializer.animationName)
    3636    , m_elapsedTime(initializer.elapsedTime)
  • trunk/Source/WebCore/dom/WebKitAnimationEvent.h

    r197563 r207215  
    3131namespace WebCore {
    3232
    33 struct WebKitAnimationEventInit : public EventInit {
    34     String animationName;
    35     double elapsedTime { 0.0 };
    36 };
    37 
    3833class WebKitAnimationEvent final : public Event {
    3934public:
     
    4237        return adoptRef(*new WebKitAnimationEvent(type, animationName, elapsedTime));
    4338    }
    44     static Ref<WebKitAnimationEvent> createForBindings(const AtomicString& type, const WebKitAnimationEventInit& initializer)
     39
     40    struct Init : EventInit {
     41        String animationName;
     42        double elapsedTime { 0.0 };
     43    };
     44
     45    static Ref<WebKitAnimationEvent> create(const AtomicString& type, const Init& initializer, IsTrusted isTrusted = IsTrusted::No)
    4546    {
    46         return adoptRef(*new WebKitAnimationEvent(type, initializer));
     47        return adoptRef(*new WebKitAnimationEvent(type, initializer, isTrusted));
    4748    }
    4849
     
    5657private:
    5758    WebKitAnimationEvent(const AtomicString& type, const String& animationName, double elapsedTime);
    58     WebKitAnimationEvent(const AtomicString&, const WebKitAnimationEventInit&);
     59    WebKitAnimationEvent(const AtomicString&, const Init&, IsTrusted);
    5960
    6061    String m_animationName;
  • trunk/Source/WebCore/dom/WebKitAnimationEvent.idl

    r168302 r207215  
    2525
    2626[
    27     ConstructorTemplate=Event
     27    Constructor(DOMString type, optional WebKitAnimationEventInit eventInitDict),
    2828] interface WebKitAnimationEvent : Event {
    29     [InitializedByEventConstructor] readonly attribute DOMString animationName;
    30     [InitializedByEventConstructor] readonly attribute unrestricted double elapsedTime;
     29    readonly attribute DOMString animationName;
     30    readonly attribute double elapsedTime;
    3131};
    3232
     33dictionary WebKitAnimationEventInit : EventInit {
     34    DOMString animationName = "";
     35    double elapsedTime = 0;
     36};
  • trunk/Source/WebCore/dom/WebKitTransitionEvent.cpp

    r196400 r207215  
    3939}
    4040
    41 WebKitTransitionEvent::WebKitTransitionEvent(const AtomicString& type, const WebKitTransitionEventInit& initializer)
    42     : Event(type, initializer)
     41WebKitTransitionEvent::WebKitTransitionEvent(const AtomicString& type, const Init& initializer, IsTrusted isTrusted)
     42    : Event(type, initializer, isTrusted)
    4343    , m_propertyName(initializer.propertyName)
    4444    , m_elapsedTime(initializer.elapsedTime)
  • trunk/Source/WebCore/dom/WebKitTransitionEvent.h

    r197563 r207215  
    3131namespace WebCore {
    3232
    33 struct WebKitTransitionEventInit : public EventInit {
    34     String propertyName;
    35     double elapsedTime { 0 };
    36     String pseudoElement;
    37 };
    38 
    3933class WebKitTransitionEvent final : public Event {
    4034public:
     
    4337        return adoptRef(*new WebKitTransitionEvent(type, propertyName, elapsedTime, pseudoElement));
    4438    }
    45     static Ref<WebKitTransitionEvent> createForBindings(const AtomicString& type, const WebKitTransitionEventInit& initializer)
     39
     40    struct Init : EventInit {
     41        String propertyName;
     42        double elapsedTime { 0 };
     43        String pseudoElement;
     44    };
     45
     46    static Ref<WebKitTransitionEvent> create(const AtomicString& type, const Init& initializer, IsTrusted isTrusted = IsTrusted::No)
    4647    {
    47         return adoptRef(*new WebKitTransitionEvent(type, initializer));
     48        return adoptRef(*new WebKitTransitionEvent(type, initializer, isTrusted));
    4849    }
    4950
     
    5859private:
    5960    WebKitTransitionEvent(const AtomicString& type, const String& propertyName, double elapsedTime, const String& pseudoElement);
    60     WebKitTransitionEvent(const AtomicString& type, const WebKitTransitionEventInit& initializer);
     61    WebKitTransitionEvent(const AtomicString& type, const Init& initializer, IsTrusted);
    6162
    6263    String m_propertyName;
  • trunk/Source/WebCore/dom/WebKitTransitionEvent.idl

    r168302 r207215  
    2525
    2626[
    27     ConstructorTemplate=Event
     27    Constructor(DOMString type, optional WebKitTransitionEventInit eventInitDict),
    2828] interface WebKitTransitionEvent : Event {
    29     [InitializedByEventConstructor] readonly attribute DOMString propertyName;
    30     [InitializedByEventConstructor] readonly attribute unrestricted double elapsedTime;
    31     [InitializedByEventConstructor] readonly attribute DOMString pseudoElement;
     29    readonly attribute DOMString propertyName;
     30    readonly attribute double elapsedTime;
     31    readonly attribute DOMString pseudoElement;
    3232};
    3333
     34dictionary WebKitTransitionEventInit : EventInit {
     35    DOMString propertyName = "";
     36    double elapsedTime = 0;
     37    DOMString pseudoElement = "";
     38};
Note: See TracChangeset for help on using the changeset viewer.