Changeset 96208 in webkit


Ignore:
Timestamp:
Sep 28, 2011 2:27:55 AM (13 years ago)
Author:
commit-queue@webkit.org
Message:

Implement an ErrorEvent constructor for V8
https://bugs.webkit.org/show_bug.cgi?id=68336

Patch by Kentaro Hara <haraken@chromium.org> on 2011-09-28
Reviewed by Adam Barth.

Source/WebCore:

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

  • bindings/v8/OptionsObject.cpp:

(WebCore::OptionsObject::getKeyValue): Returns an unsigned value corresponding to a given key.

  • bindings/v8/OptionsObject.h:
  • bindings/v8/custom/V8EventConstructors.cpp: Added the ErrorEvent constructor.
  • dom/ErrorEvent.idl: Added a 'V8CustomConstructor' attribute.

LayoutTests:

Enabled fast/events/constructors/error-event-constructor.html,
since V8 now has the constructor for ErrorEvent.

  • platform/chromium/test_expectations.txt:
Location:
trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r96206 r96208  
     12011-09-28  Kentaro Hara  <haraken@chromium.org>
     2
     3        Implement an ErrorEvent constructor for V8
     4        https://bugs.webkit.org/show_bug.cgi?id=68336
     5
     6        Reviewed by Adam Barth.
     7
     8        Enabled fast/events/constructors/error-event-constructor.html,
     9        since V8 now has the constructor for ErrorEvent.
     10
     11        * platform/chromium/test_expectations.txt:
     12
    1132011-09-28  Gabor Rapcsanyi  <rgabor@webkit.org>
    214
  • trunk/LayoutTests/platform/chromium/test_expectations.txt

    r96200 r96208  
    6262// Implement java testing harness.
    6363BUGCR36681 SKIP : java = TEXT
    64 
    65 // This will soon be fixed after implementing an ErrorEvent constructor for V8.
    66 BUGWK68148 : fast/events/constructors/error-event-constructor.html = FAIL
    6764
    6865// Quota API is not supported in DRT yet.
  • trunk/Source/WebCore/ChangeLog

    r96205 r96208  
     12011-09-28  Kentaro Hara  <haraken@chromium.org>
     2
     3        Implement an ErrorEvent constructor for V8
     4        https://bugs.webkit.org/show_bug.cgi?id=68336
     5
     6        Reviewed by Adam Barth.
     7
     8        Test: fast/events/constructors/error-event-constructor.html
     9
     10        * bindings/v8/OptionsObject.cpp:
     11        (WebCore::OptionsObject::getKeyValue): Returns an unsigned value corresponding to a given key.
     12        * bindings/v8/OptionsObject.h:
     13        * bindings/v8/custom/V8EventConstructors.cpp: Added the ErrorEvent constructor.
     14        * dom/ErrorEvent.idl: Added a 'V8CustomConstructor' attribute.
     15
    1162011-09-27  Andy Estes  <aestes@apple.com>
    217
  • trunk/Source/WebCore/bindings/v8/OptionsObject.cpp

    r96061 r96208  
    194194}
    195195
     196bool OptionsObject::getKeyValue(const String& key, unsigned& value) const
     197{
     198    v8::Local<v8::Value> v8Value;
     199    if (!getKey(key, v8Value))
     200        return false;
     201
     202    v8::Local<v8::Int32> v8Int32 = v8Value->ToInt32();
     203    if (v8Int32.IsEmpty())
     204        return false;
     205    value = static_cast<unsigned>(v8Int32->Value());
     206    return true;
     207}
     208
    196209bool OptionsObject::getKeyValue(const String& key, unsigned long long& value) const
    197210{
  • trunk/Source/WebCore/bindings/v8/OptionsObject.h

    r96061 r96208  
    7878        return true;
    7979    }
    80     bool getKeyValue(const String& key, unsigned short& value) const;
    81     bool getKeyValue(const String& key, unsigned long long& value) const;
     80    bool getKeyValue(const String&, unsigned short&) const;
     81    bool getKeyValue(const String&, unsigned&) const;
     82    bool getKeyValue(const String&, unsigned long long&) const;
    8283
    8384private:
  • trunk/Source/WebCore/bindings/v8/custom/V8EventConstructors.cpp

    r96180 r96208  
    3636#include "Document.h"
    3737#include "DocumentFragment.h"
     38#include "ErrorEvent.h"
    3839#include "HashChangeEvent.h"
    3940#include "Node.h"
     
    4849#include "V8CustomEvent.h"
    4950#include "V8Document.h"
     51#include "V8ErrorEvent.h"
    5052#include "V8Event.h"
    5153#include "V8HashChangeEvent.h"
     
    115117INSTANTIATE_INITIALIZING_CONSTRUCTOR_FOR_CLOSE_EVENT(DICTIONARY_START, DICTIONARY_END, FILL_PARENT_PROPERTIES, FILL_PROPERTY)
    116118INSTANTIATE_INITIALIZING_CONSTRUCTOR_FOR_PAGE_TRANSITION_EVENT(DICTIONARY_START, DICTIONARY_END, FILL_PARENT_PROPERTIES, FILL_PROPERTY)
     119INSTANTIATE_INITIALIZING_CONSTRUCTOR_FOR_ERROR_EVENT(DICTIONARY_START, DICTIONARY_END, FILL_PARENT_PROPERTIES, FILL_PROPERTY)
    117120
    118121
  • trunk/Source/WebCore/dom/ErrorEvent.idl

    r95352 r96208  
    3434        NoStaticTables,
    3535        CanBeConstructed,
    36         CustomConstructFunction
     36        CustomConstructFunction,
     37        V8CustomConstructor
    3738    ] ErrorEvent : Event {
    3839
Note: See TracChangeset for help on using the changeset viewer.