Changeset 142205 in webkit


Ignore:
Timestamp:
Feb 7, 2013 4:37:49 PM (11 years ago)
Author:
haraken@chromium.org
Message:

Implement FocusEvent constructor
https://bugs.webkit.org/show_bug.cgi?id=109170

Reviewed by Adam Barth.

Editor's draft: https://dvcs.w3.org/hg/d4e/raw-file/tip/source_respec.htm

FocusEvent constructor should be implemented under a DOM4_EVENTS_CONSTRUCTOR
flag, which is enabled on Chromium and Safari.

Source/WebCore:

Test: fast/events/constructors/focus-event-constructor.html

  • dom/FocusEvent.cpp:

(WebCore::FocusEventInit::FocusEventInit):
(WebCore):
(WebCore::FocusEvent::FocusEvent):

  • dom/FocusEvent.h:

(FocusEventInit):
(WebCore):
(WebCore::FocusEvent::create):
(FocusEvent):

  • dom/FocusEvent.idl:
  • page/DOMWindow.idl:

LayoutTests:

  • fast/dom/constructed-objects-prototypes-expected.txt:
  • fast/events/constructors/focus-event-constructor-expected.txt: Added.
  • fast/events/constructors/focus-event-constructor.html: Added.
  • platform/efl/TestExpectations:
  • platform/gtk/TestExpectations:
  • platform/qt/TestExpectations:
  • platform/win/TestExpectations:
  • platform/wincairo/TestExpectations:
Location:
trunk
Files:
2 added
12 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r142204 r142205  
     12013-02-07  Kentaro Hara  <haraken@chromium.org>
     2
     3        Implement FocusEvent constructor
     4        https://bugs.webkit.org/show_bug.cgi?id=109170
     5
     6        Reviewed by Adam Barth.
     7
     8        Editor's draft: https://dvcs.w3.org/hg/d4e/raw-file/tip/source_respec.htm
     9
     10        FocusEvent constructor should be implemented under a DOM4_EVENTS_CONSTRUCTOR
     11        flag, which is enabled on Chromium and Safari.
     12
     13        * fast/dom/constructed-objects-prototypes-expected.txt:
     14        * fast/events/constructors/focus-event-constructor-expected.txt: Added.
     15        * fast/events/constructors/focus-event-constructor.html: Added.
     16        * platform/efl/TestExpectations:
     17        * platform/gtk/TestExpectations:
     18        * platform/qt/TestExpectations:
     19        * platform/win/TestExpectations:
     20        * platform/wincairo/TestExpectations:
     21
    1222013-02-07  Elliott Sprehn  <esprehn@chromium.org>
    223
  • trunk/LayoutTests/fast/dom/constructed-objects-prototypes-expected.txt

    r141346 r142205  
    2222PASS (new inner.Event()).isInner is true
    2323PASS (new inner.Event()).constructor.isInner is true
     24PASS (new inner.FocusEvent()).isInner is true
     25PASS (new inner.FocusEvent()).constructor.isInner is true
    2426PASS (new inner.FormData()).isInner is true
    2527PASS (new inner.FormData()).constructor.isInner is true
  • trunk/LayoutTests/platform/efl/TestExpectations

    r142167 r142205  
    12481248webkit.org/b/107428 fast/events/constructors/keyboard-event-constructor.html [ Skip ]
    12491249webkit.org/b/107428 fast/events/constructors/composition-event-constructor.html [ Skip ]
     1250webkit.org/b/107428 fast/events/constructors/focus-event-constructor.html [ Skip ]
    12501251
    12511252# Requires support for Web notifications
  • trunk/LayoutTests/platform/gtk/TestExpectations

    r142174 r142205  
    403403webkit.org/b/107428 fast/events/constructors/keyboard-event-constructor.html [ Skip ]
    404404webkit.org/b/107428 fast/events/constructors/composition-event-constructor.html [ Skip ]
     405webkit.org/b/107428 fast/events/constructors/focus-event-constructor.html [ Skip ]
    405406
    406407# No CORS support for media elements is implemented yet.
  • trunk/LayoutTests/platform/qt/TestExpectations

    r142167 r142205  
    116116fast/events/constructors/wheel-event-constructor.html
    117117fast/events/constructors/keyboard-event-constructor.html
     118fast/events/constructors/focus-event-constructor.html
    118119
    119120# ENABLE(INDEXED_DATABASE) is disabled.
  • trunk/LayoutTests/platform/win/TestExpectations

    r142084 r142205  
    12261226fast/events/constructors/wheel-event-constructor.html
    12271227fast/events/constructors/keyboard-event-constructor.html
     1228fast/events/constructors/focus-event-constructor.html
    12281229
    12291230# Disable until the windows WebKit API supports injecting in the top frame only.
  • trunk/LayoutTests/platform/wincairo/TestExpectations

    r141621 r142205  
    17491749fast/events/constructors/wheel-event-constructor.html
    17501750fast/events/constructors/keyboard-event-constructor.html
     1751fast/events/constructors/focus-event-constructor.html
    17511752
    17521753# Disable until the windows WebKit API supports injecting in the top frame only.
  • trunk/Source/WebCore/ChangeLog

    r142204 r142205  
     12013-02-07  Kentaro Hara  <haraken@chromium.org>
     2
     3        Implement FocusEvent constructor
     4        https://bugs.webkit.org/show_bug.cgi?id=109170
     5
     6        Reviewed by Adam Barth.
     7
     8        Editor's draft: https://dvcs.w3.org/hg/d4e/raw-file/tip/source_respec.htm
     9
     10        FocusEvent constructor should be implemented under a DOM4_EVENTS_CONSTRUCTOR
     11        flag, which is enabled on Chromium and Safari.
     12
     13        Test: fast/events/constructors/focus-event-constructor.html
     14
     15        * dom/FocusEvent.cpp:
     16        (WebCore::FocusEventInit::FocusEventInit):
     17        (WebCore):
     18        (WebCore::FocusEvent::FocusEvent):
     19        * dom/FocusEvent.h:
     20        (FocusEventInit):
     21        (WebCore):
     22        (WebCore::FocusEvent::create):
     23        (FocusEvent):
     24        * dom/FocusEvent.idl:
     25        * page/DOMWindow.idl:
     26
    1272013-02-07  Elliott Sprehn  <esprehn@chromium.org>
    228
  • trunk/Source/WebCore/dom/FocusEvent.cpp

    r142072 r142205  
    3232namespace WebCore {
    3333
     34FocusEventInit::FocusEventInit()
     35    : relatedTarget(0)
     36{
     37}
     38
    3439const AtomicString& FocusEvent::interfaceName() const
    3540{
     
    5257}
    5358
     59FocusEvent::FocusEvent(const AtomicString& type, const FocusEventInit& initializer)
     60    : UIEvent(type, initializer)
     61    , m_relatedTarget(initializer.relatedTarget)
     62{
     63}
     64
    5465} // namespace WebCore
  • trunk/Source/WebCore/dom/FocusEvent.h

    r142072 r142205  
    3232namespace WebCore {
    3333
     34struct FocusEventInit : public UIEventInit {
     35    FocusEventInit();
     36
     37    RefPtr<EventTarget> relatedTarget;
     38};
     39
    3440class FocusEvent : public UIEvent {
    3541public:
     
    4450    }
    4551
     52    static PassRefPtr<FocusEvent> create(const AtomicString& type, const FocusEventInit& initializer)
     53    {
     54        return adoptRef(new FocusEvent(type, initializer));
     55    }
     56
    4657    EventTarget* relatedTarget() const { return m_relatedTarget.get(); }
    4758    void setRelatedTarget(PassRefPtr<EventTarget> relatedTarget) { m_relatedTarget = relatedTarget; }
     
    5364    FocusEvent();
    5465    FocusEvent(const AtomicString& type, bool canBubble, bool cancelable, PassRefPtr<AbstractView>, int, PassRefPtr<EventTarget>);
     66    FocusEvent(const AtomicString& type, const FocusEventInit&);
    5567
    5668    RefPtr<EventTarget> m_relatedTarget;
  • trunk/Source/WebCore/dom/FocusEvent.idl

    r142072 r142205  
    2424 */
    2525
    26 interface FocusEvent : UIEvent
    27 {
    28     readonly attribute EventTarget relatedTarget;
     26[
     27    ConstructorConditional=DOM4_EVENTS_CONSTRUCTOR,
     28    ConstructorTemplate=Event
     29] interface FocusEvent : UIEvent {
     30    [InitializedByEventConstructor] readonly attribute EventTarget relatedTarget;
    2931};
  • trunk/Source/WebCore/page/DOMWindow.idl

    r142149 r142205  
    546546    attribute CustomEventConstructor CustomEvent;
    547547    attribute ErrorEventConstructor ErrorEvent;
     548    attribute FocusEventConstructor FocusEvent;
    548549    attribute HashChangeEventConstructor HashChangeEvent;
    549550    attribute KeyboardEventConstructor KeyboardEvent;
Note: See TracChangeset for help on using the changeset viewer.