Changeset 207384 in webkit


Ignore:
Timestamp:
Oct 15, 2016 4:23:33 PM (8 years ago)
Author:
Darin Adler
Message:

Move Web SQL database and WebSockets off legacy exceptions
https://bugs.webkit.org/show_bug.cgi?id=163284

Reviewed by Chris Dumez.

  • Modules/webdatabase/DOMWindowWebDatabase.cpp:

(WebCore::DOMWindowWebDatabase::openDatabase): Use ExceptionOr.

  • Modules/webdatabase/DOMWindowWebDatabase.h: Update for above.
  • Modules/webdatabase/DOMWindowWebDatabase.idl: Ditto.
  • Modules/webdatabase/SQLResultSet.cpp:

(WebCore::SQLResultSet::SQLResultSet): Move initialization of
many data members into the class definition.
(WebCore::SQLResultSet::insertId): Use ExceptionOr.
(WebCore::SQLResultSet::rowsAffected): Moved into class definition.
(WebCore::SQLResultSet::rows): Ditto.
(WebCore::SQLResultSet::setInsertId): Ditto.
(WebCore::SQLResultSet::setRowsAffected): Ditto.

  • Modules/webdatabase/SQLResultSet.h: Updated for above.
  • Modules/webdatabase/SQLResultSet.idl: Use non-legacy exceptions.

Added a FIXME about the mismatch between long and int64_t.

  • Modules/webdatabase/SQLStatement.cpp:

(WebCore::SQLStatement::execute): Use reference instead of pointer.

  • Modules/websockets/WebSocket.cpp:

(WebCore::isValidProtocolString): Use StringView.
(WebCore::WebSocket::subprotocolSeparator): Fixed capitalization and
spelling error in the name of this function.
(WebCore::WebSocket::WebSocket): Move initialization of many data
members into the class definition.
(WebCore::WebSocket::create): Use ExceptionOr.
(WebCore::WebSocket::connect): Ditto.
(WebCore::WebSocket::send): Ditto.
(WebCore::WebSocket::close): Ditto.
(WebCore::WebSocket::binaryType): Update to use enum class.
(WebCore::WebSocket::setBinaryType): Use ExecptionOr and update to
use enum class.
(WebCore::WebSocket::didReceiveBinaryData): Ditto.

  • Modules/websockets/WebSocket.h: Updated for above. Changed the

BinaryType enum into an enum class.

  • Modules/websockets/WebSocket.idl: Use non-legacy exceptions.
  • Modules/websockets/WebSocketHandshake.cpp:

(WebCore::WebSocketHandshake::checkResponseHeaders):
Updated for name change to subprotocolSeparator.

  • dom/ExceptionOr.h: Added a constructor for scalar types that does not

require an rvalue reference. We can refine this more later, but for now
this is sufficient to obviate the need for WTFMove where it otherwise would
have been needed in the code above.

  • inspector/InspectorDatabaseAgent.cpp: Use reference instead of pointer.
  • page/DOMWindow.idl: Touched this file to work around bugs in the dependency

analysis of the current CMake build system, since otherwise it doesn't process the
change to the partial interface WebSocket. Edited lots of comments, removed many
others, and tweaked formatting.

Location:
trunk/Source/WebCore
Files:
15 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r207381 r207384  
     12016-10-15  Darin Adler  <darin@apple.com>
     2
     3        Move Web SQL database and WebSockets off legacy exceptions
     4        https://bugs.webkit.org/show_bug.cgi?id=163284
     5
     6        Reviewed by Chris Dumez.
     7
     8        * Modules/webdatabase/DOMWindowWebDatabase.cpp:
     9        (WebCore::DOMWindowWebDatabase::openDatabase): Use ExceptionOr.
     10        * Modules/webdatabase/DOMWindowWebDatabase.h: Update for above.
     11        * Modules/webdatabase/DOMWindowWebDatabase.idl: Ditto.
     12
     13        * Modules/webdatabase/SQLResultSet.cpp:
     14        (WebCore::SQLResultSet::SQLResultSet): Move initialization of
     15        many data members into the class definition.
     16        (WebCore::SQLResultSet::insertId): Use ExceptionOr.
     17        (WebCore::SQLResultSet::rowsAffected): Moved into class definition.
     18        (WebCore::SQLResultSet::rows): Ditto.
     19        (WebCore::SQLResultSet::setInsertId): Ditto.
     20        (WebCore::SQLResultSet::setRowsAffected): Ditto.
     21
     22        * Modules/webdatabase/SQLResultSet.h: Updated for above.
     23
     24        * Modules/webdatabase/SQLResultSet.idl: Use non-legacy exceptions.
     25        Added a FIXME about the mismatch between long and int64_t.
     26
     27        * Modules/webdatabase/SQLStatement.cpp:
     28        (WebCore::SQLStatement::execute): Use reference instead of pointer.
     29
     30        * Modules/websockets/WebSocket.cpp:
     31        (WebCore::isValidProtocolString): Use StringView.
     32        (WebCore::WebSocket::subprotocolSeparator): Fixed capitalization and
     33        spelling error in the name of this function.
     34        (WebCore::WebSocket::WebSocket): Move initialization of many data
     35        members into the class definition.
     36        (WebCore::WebSocket::create): Use ExceptionOr.
     37        (WebCore::WebSocket::connect): Ditto.
     38        (WebCore::WebSocket::send): Ditto.
     39        (WebCore::WebSocket::close): Ditto.
     40        (WebCore::WebSocket::binaryType): Update to use enum class.
     41        (WebCore::WebSocket::setBinaryType): Use ExecptionOr and update to
     42        use enum class.
     43        (WebCore::WebSocket::didReceiveBinaryData): Ditto.
     44
     45        * Modules/websockets/WebSocket.h: Updated for above. Changed the
     46        BinaryType enum into an enum class.
     47
     48        * Modules/websockets/WebSocket.idl: Use non-legacy exceptions.
     49
     50        * Modules/websockets/WebSocketHandshake.cpp:
     51        (WebCore::WebSocketHandshake::checkResponseHeaders):
     52        Updated for name change to subprotocolSeparator.
     53
     54        * dom/ExceptionOr.h: Added a constructor for scalar types that does not
     55        require an rvalue reference. We can refine this more later, but for now
     56        this is sufficient to obviate the need for WTFMove where it otherwise would
     57        have been needed in the code above.
     58
     59        * inspector/InspectorDatabaseAgent.cpp: Use reference instead of pointer.
     60
     61        * page/DOMWindow.idl: Touched this file to work around bugs in the dependency
     62        analysis of the current CMake build system, since otherwise it doesn't process the
     63        change to the partial interface WebSocket. Edited lots of comments, removed many
     64        others, and tweaked formatting.
     65
    1662016-10-14  Sam Weinig  <sam@webkit.org>
    267
  • trunk/Source/WebCore/Modules/webdatabase/DOMWindowWebDatabase.cpp

    r200289 r207384  
    3030#include "DOMWindow.h"
    3131#include "Database.h"
    32 #include "DatabaseCallback.h"
    3332#include "DatabaseManager.h"
    3433#include "Document.h"
    35 #include "Frame.h"
    3634#include "SecurityOrigin.h"
    3735
    3836namespace WebCore {
    3937
    40 RefPtr<Database> DOMWindowWebDatabase::openDatabase(DOMWindow& window, const String& name, const String& version, const String& displayName, unsigned long estimatedSize, RefPtr<DatabaseCallback>&& creationCallback, ExceptionCode& ec)
     38ExceptionOr<RefPtr<Database>> DOMWindowWebDatabase::openDatabase(DOMWindow& window, const String& name, const String& version, const String& displayName, unsigned estimatedSize, RefPtr<DatabaseCallback>&& creationCallback)
    4139{
    4240    if (!window.isCurrentlyDisplayedInFrame())
    43         return nullptr;
    44 
    45     RefPtr<Database> database;
    46     DatabaseManager& dbManager = DatabaseManager::singleton();
    47     DatabaseError error = DatabaseError::None;
    48     if (dbManager.isAvailable() && window.document()->securityOrigin()->canAccessDatabase(window.document()->topOrigin())) {
    49         database = dbManager.openDatabase(window.document(), name, version, displayName, estimatedSize, WTFMove(creationCallback), error);
    50         ASSERT(database || error != DatabaseError::None);
    51         ec = DatabaseManager::exceptionCodeForDatabaseError(error);
    52     } else
    53         ec = SECURITY_ERR;
    54 
    55     return database;
     41        return RefPtr<Database> { nullptr };
     42    auto& manager = DatabaseManager::singleton();
     43    if (!manager.isAvailable())
     44        return Exception { SECURITY_ERR };
     45    auto* document = window.document();
     46    if (!document)
     47        return Exception { SECURITY_ERR };
     48    auto* securityOrigin = document->securityOrigin();
     49    if (!securityOrigin)
     50        return Exception { SECURITY_ERR };
     51    if (!securityOrigin->canAccessDatabase(document->topOrigin()))
     52        return Exception { SECURITY_ERR };
     53    auto error = DatabaseError::None;
     54    auto database = manager.openDatabase(window.document(), name, version, displayName, estimatedSize, WTFMove(creationCallback), error);
     55    if (error != DatabaseError::None)
     56        return Exception { DatabaseManager::exceptionCodeForDatabaseError(error) };
     57    ASSERT(database);
     58    return WTFMove(database);
    5659}
    5760
  • trunk/Source/WebCore/Modules/webdatabase/DOMWindowWebDatabase.h

    r203146 r207384  
    2525 */
    2626
    27 #ifndef DOMWindowWebDatabase_h
    28 #define DOMWindowWebDatabase_h
     27#pragma once
    2928
    30 #include "ExceptionCode.h"
    31 #include <wtf/RefCounted.h>
    32 #include <wtf/RefPtr.h>
    33 #include <wtf/text/WTFString.h>
     29#include "ExceptionOr.h"
    3430
    3531namespace WebCore {
     
    3834class Database;
    3935class DatabaseCallback;
    40 class Frame;
    4136
    4237class DOMWindowWebDatabase {
    4338public:
    44     static RefPtr<Database> openDatabase(DOMWindow&, const String& name, const String& version, const String& displayName, unsigned long estimatedSize, RefPtr<DatabaseCallback>&& creationCallback, ExceptionCode&);
     39    static ExceptionOr<RefPtr<Database>> openDatabase(DOMWindow&, const String& name, const String& version, const String& displayName, unsigned estimatedSize, RefPtr<DatabaseCallback>&& creationCallback);
    4540
    4641    DOMWindowWebDatabase() = delete;
     
    4944
    5045} // namespace WebCore
    51 
    52 #endif // DOMWindowWebDatabase_h
  • trunk/Source/WebCore/Modules/webdatabase/DOMWindowWebDatabase.idl

    r206723 r207384  
    2525 */
    2626
    27 [
    28 ] partial interface DOMWindow {
    29     [MayThrowLegacyException] Database openDatabase(DOMString name, DOMString version, DOMString displayName, unsigned long estimatedSize, optional DatabaseCallback? creationCallback);
     27partial interface DOMWindow {
     28    [MayThrowException] Database? openDatabase(DOMString name, DOMString version, DOMString displayName, unsigned long estimatedSize, optional DatabaseCallback? creationCallback);
    3029};
    31 
  • trunk/Source/WebCore/Modules/webdatabase/SQLResultSet.cpp

    r178575 r207384  
    3636SQLResultSet::SQLResultSet()
    3737    : m_rows(SQLResultSetRowList::create())
    38     , m_insertId(0)
    39     , m_insertIdSet(false)
    40     , m_rowsAffected(0)
    4138{
    4239}
    4340
    44 int64_t SQLResultSet::insertId(ExceptionCode& e) const
     41ExceptionOr<int64_t> SQLResultSet::insertId() const
    4542{
    4643    // 4.11.4 - Return the id of the last row inserted as a result of the query
    4744    // If the query didn't result in any rows being added, raise an INVALID_ACCESS_ERR exception
    48     if (m_insertIdSet)
    49         return m_insertId;
    50 
    51     e = INVALID_ACCESS_ERR;
    52     return -1;
    53 }
    54 
    55 int SQLResultSet::rowsAffected() const
    56 {
    57     return m_rowsAffected;
    58 }
    59 
    60 SQLResultSetRowList* SQLResultSet::rows() const
    61 {
    62     return m_rows.get();
    63 }
    64 
    65 void SQLResultSet::setInsertId(int64_t id)
    66 {
    67     ASSERT(!m_insertIdSet);
    68 
    69     m_insertId = id;
    70     m_insertIdSet = true;
    71 }
    72 
    73 void SQLResultSet::setRowsAffected(int count)
    74 {
    75     m_rowsAffected = count;
     45    if (!m_insertId)
     46        return Exception { INVALID_ACCESS_ERR };
     47    return m_insertId.value();
    7648}
    7749
  • trunk/Source/WebCore/Modules/webdatabase/SQLResultSet.h

    r184709 r207384  
    2727 */
    2828
    29 #ifndef SQLResultSet_h
    30 #define SQLResultSet_h
     29#pragma once
    3130
    32 #include "DatabaseBasicTypes.h"
     31#include "ExceptionOr.h"
    3332#include "SQLResultSetRowList.h"
    3433#include <wtf/ThreadSafeRefCounted.h>
     
    4039    static Ref<SQLResultSet> create() { return adoptRef(*new SQLResultSet); }
    4140
    42     SQLResultSetRowList* rows() const;
     41    SQLResultSetRowList& rows() { return m_rows.get(); }
    4342
    44     int64_t insertId(ExceptionCode&) const;
    45     int rowsAffected() const;
     43    ExceptionOr<int64_t> insertId() const;
     44    int rowsAffected() const { return m_rowsAffected; }
    4645
    47 // For internal (non-JS) use
    4846    void setInsertId(int64_t);
    4947    void setRowsAffected(int);
     
    5250    SQLResultSet();
    5351
    54     RefPtr<SQLResultSetRowList> m_rows;
    55     int64_t m_insertId;
    56     bool m_insertIdSet;
    57     int m_rowsAffected;
     52    Ref<SQLResultSetRowList> m_rows;
     53    Optional<int64_t> m_insertId;
     54    int m_rowsAffected { 0 };
    5855};
    5956
     57inline void SQLResultSet::setInsertId(int64_t id)
     58{
     59    ASSERT(!m_insertId);
     60    m_insertId = id;
     61}
     62
     63inline void SQLResultSet::setRowsAffected(int count)
     64{
     65    m_rowsAffected = count;
     66}
     67
    6068} // namespace WebCore
    61 
    62 #endif // SQLResultSet_h
  • trunk/Source/WebCore/Modules/webdatabase/SQLResultSet.idl

    r206723 r207384  
    3131] interface SQLResultSet {
    3232    readonly attribute SQLResultSetRowList rows;
    33     [GetterMayThrowLegacyException] readonly attribute long insertId;
     33    [GetterMayThrowException] readonly attribute long insertId;
    3434    readonly attribute long rowsAffected;
    3535};
  • trunk/Source/WebCore/Modules/webdatabase/SQLStatement.cpp

    r203146 r207384  
    155155    case SQLITE_ROW: {
    156156        int columnCount = statement.columnCount();
    157         SQLResultSetRowList* rows = resultSet->rows();
     157        auto& rows = resultSet->rows();
    158158
    159159        for (int i = 0; i < columnCount; i++)
    160             rows->addColumn(statement.getColumnName(i));
     160            rows.addColumn(statement.getColumnName(i));
    161161
    162162        do {
    163163            for (int i = 0; i < columnCount; i++)
    164                 rows->addResult(statement.getColumnValue(i));
     164                rows.addResult(statement.getColumnValue(i));
    165165
    166166            result = statement.step();
  • trunk/Source/WebCore/Modules/websockets/WebSocket.cpp

    r206869 r207384  
    8686}
    8787
    88 static bool isValidProtocolString(const String& protocol)
     88static bool isValidProtocolString(StringView protocol)
    8989{
    9090    if (protocol.isEmpty())
    9191        return false;
    92     for (size_t i = 0; i < protocol.length(); ++i) {
    93         if (!isValidProtocolCharacter(protocol[i]))
     92    for (auto codeUnit : protocol.codeUnits()) {
     93        if (!isValidProtocolCharacter(codeUnit))
    9494            return false;
    9595    }
     
    141141}
    142142
    143 const char* WebSocket::subProtocolSeperator()
     143const char* WebSocket::subprotocolSeparator()
    144144{
    145145    return ", ";
     
    148148WebSocket::WebSocket(ScriptExecutionContext& context)
    149149    : ActiveDOMObject(&context)
    150     , m_state(CONNECTING)
    151     , m_bufferedAmount(0)
    152     , m_bufferedAmountAfterClose(0)
    153     , m_binaryType(BinaryTypeBlob)
    154150    , m_subprotocol(emptyString())
    155151    , m_extensions(emptyString())
     
    164160}
    165161
    166 Ref<WebSocket> WebSocket::create(ScriptExecutionContext& context)
    167 {
    168     Ref<WebSocket> webSocket(adoptRef(*new WebSocket(context)));
    169     webSocket->suspendIfNeeded();
    170     return webSocket;
    171 }
    172 
    173 RefPtr<WebSocket> WebSocket::create(ScriptExecutionContext& context, const String& url, ExceptionCode& ec)
    174 {
    175     Vector<String> protocols;
    176     return WebSocket::create(context, url, protocols, ec);
    177 }
    178 
    179 RefPtr<WebSocket> WebSocket::create(ScriptExecutionContext& context, const String& url, const Vector<String>& protocols, ExceptionCode& ec)
    180 {
    181     if (url.isNull()) {
    182         ec = SYNTAX_ERR;
    183         return nullptr;
    184     }
    185 
    186     RefPtr<WebSocket> webSocket(adoptRef(*new WebSocket(context)));
    187     webSocket->suspendIfNeeded();
    188 
    189     webSocket->connect(context.completeURL(url), protocols, ec);
    190     if (ec)
    191         return nullptr;
    192 
    193     return webSocket;
    194 }
    195 
    196 RefPtr<WebSocket> WebSocket::create(ScriptExecutionContext& context, const String& url, const String& protocol, ExceptionCode& ec)
    197 {
    198     Vector<String> protocols;
    199     protocols.append(protocol);
    200     return WebSocket::create(context, url, protocols, ec);
    201 }
    202 
    203 void WebSocket::connect(const String& url, ExceptionCode& ec)
    204 {
    205     Vector<String> protocols;
    206     connect(url, protocols, ec);
    207 }
    208 
    209 void WebSocket::connect(const String& url, const String& protocol, ExceptionCode& ec)
    210 {
    211     Vector<String> protocols;
    212     protocols.append(protocol);
    213     connect(url, protocols, ec);
    214 }
    215 
    216 void WebSocket::connect(const String& url, const Vector<String>& protocols, ExceptionCode& ec)
     162ExceptionOr<Ref<WebSocket>> WebSocket::create(ScriptExecutionContext& context, const String& url)
     163{
     164    return create(context, url, Vector<String> { });
     165}
     166
     167ExceptionOr<Ref<WebSocket>> WebSocket::create(ScriptExecutionContext& context, const String& url, const Vector<String>& protocols)
     168{
     169    if (url.isNull())
     170        return Exception { SYNTAX_ERR };
     171
     172    auto socket = adoptRef(*new WebSocket(context));
     173    socket->suspendIfNeeded();
     174
     175    auto result = socket->connect(context.completeURL(url), protocols);
     176    if (result.hasException())
     177        return result.releaseException();
     178
     179    return WTFMove(socket);
     180}
     181
     182ExceptionOr<Ref<WebSocket>> WebSocket::create(ScriptExecutionContext& context, const String& url, const String& protocol)
     183{
     184    return create(context, url, Vector<String> { 1, protocol });
     185}
     186
     187ExceptionOr<void> WebSocket::connect(const String& url)
     188{
     189    return connect(url, Vector<String> { });
     190}
     191
     192ExceptionOr<void> WebSocket::connect(const String& url, const String& protocol)
     193{
     194    return connect(url, Vector<String> { 1, protocol });
     195}
     196
     197ExceptionOr<void> WebSocket::connect(const String& url, const Vector<String>& protocols)
    217198{
    218199    LOG(Network, "WebSocket %p connect() url='%s'", this, url.utf8().data());
     
    225206        context.addConsoleMessage(MessageSource::JS, MessageLevel::Error, "Invalid url for WebSocket " + m_url.stringCenterEllipsizedToLength());
    226207        m_state = CLOSED;
    227         ec = SYNTAX_ERR;
    228         return;
     208        return Exception { SYNTAX_ERR };
    229209    }
    230210
     
    232212        context.addConsoleMessage(MessageSource::JS, MessageLevel::Error, "Wrong url scheme for WebSocket " + m_url.stringCenterEllipsizedToLength());
    233213        m_state = CLOSED;
    234         ec = SYNTAX_ERR;
    235         return;
     214        return Exception { SYNTAX_ERR };
    236215    }
    237216    if (m_url.hasFragmentIdentifier()) {
    238217        context.addConsoleMessage(MessageSource::JS, MessageLevel::Error, "URL has fragment component " + m_url.stringCenterEllipsizedToLength());
    239218        m_state = CLOSED;
    240         ec = SYNTAX_ERR;
    241         return;
     219        return Exception { SYNTAX_ERR };
    242220    }
    243221
     
    250228        context.addConsoleMessage(MessageSource::JS, MessageLevel::Error, "WebSocket port " + String::number(m_url.port()) + " blocked");
    251229        m_state = CLOSED;
    252         ec = SECURITY_ERR;
    253         return;
     230        return Exception { SECURITY_ERR };
    254231    }
    255232
     
    259236
    260237        // FIXME: Should this be throwing an exception?
    261         ec = SECURITY_ERR;
    262         return;
     238        return Exception { SECURITY_ERR };
    263239    }
    264240
     
    280256            context.addConsoleMessage(MessageSource::JS, MessageLevel::Error, "Wrong protocol for WebSocket '" + encodeProtocolString(protocol) + "'");
    281257            m_state = CLOSED;
    282             ec = SYNTAX_ERR;
    283             return;
     258            return Exception { SYNTAX_ERR };
    284259        }
    285260    }
     
    289264            context.addConsoleMessage(MessageSource::JS, MessageLevel::Error, "WebSocket protocols contain duplicates: '" + encodeProtocolString(protocol) + "'");
    290265            m_state = CLOSED;
    291             ec = SYNTAX_ERR;
    292             return;
     266            return Exception { SYNTAX_ERR };
    293267        }
    294268    }
     
    319293            });
    320294#endif
    321             return;
     295            return { };
    322296        } else
    323297            ResourceLoadObserver::sharedObserver().logWebSocketLoading(document.frame(), m_url);
     
    326300    String protocolString;
    327301    if (!protocols.isEmpty())
    328         protocolString = joinStrings(protocols, subProtocolSeperator());
     302        protocolString = joinStrings(protocols, subprotocolSeparator());
    329303
    330304    m_channel->connect(m_url, protocolString);
    331305    ActiveDOMObject::setPendingActivity(this);
    332 }
    333 
    334 void WebSocket::send(const String& message, ExceptionCode& ec)
     306
     307    return { };
     308}
     309
     310ExceptionOr<void> WebSocket::send(const String& message)
    335311{
    336312    LOG(Network, "WebSocket %p send() Sending String '%s'", this, message.utf8().data());
    337     if (m_state == CONNECTING) {
    338         ec = INVALID_STATE_ERR;
    339         return;
    340     }
     313    if (m_state == CONNECTING)
     314        return Exception { INVALID_STATE_ERR };
    341315    // No exception is raised if the connection was once established but has subsequently been closed.
    342316    if (m_state == CLOSING || m_state == CLOSED) {
     
    344318        m_bufferedAmountAfterClose = saturateAdd(m_bufferedAmountAfterClose, payloadSize);
    345319        m_bufferedAmountAfterClose = saturateAdd(m_bufferedAmountAfterClose, getFramingOverhead(payloadSize));
    346         return;
     320        return { };
    347321    }
    348322    ASSERT(m_channel);
    349323    m_channel->send(message);
    350 }
    351 
    352 void WebSocket::send(ArrayBuffer& binaryData, ExceptionCode& ec)
     324    return { };
     325}
     326
     327ExceptionOr<void> WebSocket::send(ArrayBuffer& binaryData)
    353328{
    354329    LOG(Network, "WebSocket %p send() Sending ArrayBuffer %p", this, &binaryData);
    355     if (m_state == CONNECTING) {
    356         ec = INVALID_STATE_ERR;
    357         return;
    358     }
     330    if (m_state == CONNECTING)
     331        return Exception { INVALID_STATE_ERR };
    359332    if (m_state == CLOSING || m_state == CLOSED) {
    360333        unsigned payloadSize = binaryData.byteLength();
    361334        m_bufferedAmountAfterClose = saturateAdd(m_bufferedAmountAfterClose, payloadSize);
    362335        m_bufferedAmountAfterClose = saturateAdd(m_bufferedAmountAfterClose, getFramingOverhead(payloadSize));
    363         return;
     336        return { };
    364337    }
    365338    ASSERT(m_channel);
    366339    m_channel->send(binaryData, 0, binaryData.byteLength());
    367 }
    368 
    369 void WebSocket::send(ArrayBufferView& arrayBufferView, ExceptionCode& ec)
     340    return { };
     341}
     342
     343ExceptionOr<void> WebSocket::send(ArrayBufferView& arrayBufferView)
    370344{
    371345    LOG(Network, "WebSocket %p send() Sending ArrayBufferView %p", this, &arrayBufferView);
    372346
    373     if (m_state == CONNECTING) {
    374         ec = INVALID_STATE_ERR;
    375         return;
    376     }
     347    if (m_state == CONNECTING)
     348        return Exception { INVALID_STATE_ERR };
    377349    if (m_state == CLOSING || m_state == CLOSED) {
    378350        unsigned payloadSize = arrayBufferView.byteLength();
    379351        m_bufferedAmountAfterClose = saturateAdd(m_bufferedAmountAfterClose, payloadSize);
    380352        m_bufferedAmountAfterClose = saturateAdd(m_bufferedAmountAfterClose, getFramingOverhead(payloadSize));
    381         return;
     353        return { };
    382354    }
    383355    ASSERT(m_channel);
    384356    m_channel->send(*arrayBufferView.buffer(), arrayBufferView.byteOffset(), arrayBufferView.byteLength());
    385 }
    386 
    387 void WebSocket::send(Blob& binaryData, ExceptionCode& ec)
     357    return { };
     358}
     359
     360ExceptionOr<void> WebSocket::send(Blob& binaryData)
    388361{
    389362    LOG(Network, "WebSocket %p send() Sending Blob '%s'", this, binaryData.url().stringCenterEllipsizedToLength().utf8().data());
    390     if (m_state == CONNECTING) {
    391         ec = INVALID_STATE_ERR;
    392         return;
    393     }
     363    if (m_state == CONNECTING)
     364        return Exception { INVALID_STATE_ERR };
    394365    if (m_state == CLOSING || m_state == CLOSED) {
    395366        unsigned payloadSize = static_cast<unsigned>(binaryData.size());
    396367        m_bufferedAmountAfterClose = saturateAdd(m_bufferedAmountAfterClose, payloadSize);
    397368        m_bufferedAmountAfterClose = saturateAdd(m_bufferedAmountAfterClose, getFramingOverhead(payloadSize));
    398         return;
     369        return { };
    399370    }
    400371    ASSERT(m_channel);
    401372    m_channel->send(binaryData);
    402 }
    403 
    404 void WebSocket::close(Optional<unsigned short> optionalCode, const String& reason, ExceptionCode& ec)
     373    return { };
     374}
     375
     376ExceptionOr<void> WebSocket::close(Optional<unsigned short> optionalCode, const String& reason)
    405377{
    406378    int code = optionalCode ? optionalCode.value() : static_cast<int>(WebSocketChannel::CloseEventCodeNotSpecified);
     
    409381    else {
    410382        LOG(Network, "WebSocket %p close() code=%d reason='%s'", this, code, reason.utf8().data());
    411         if (!(code == WebSocketChannel::CloseEventCodeNormalClosure || (WebSocketChannel::CloseEventCodeMinimumUserDefined <= code && code <= WebSocketChannel::CloseEventCodeMaximumUserDefined))) {
    412             ec = INVALID_ACCESS_ERR;
    413             return;
    414         }
     383        if (!(code == WebSocketChannel::CloseEventCodeNormalClosure || (WebSocketChannel::CloseEventCodeMinimumUserDefined <= code && code <= WebSocketChannel::CloseEventCodeMaximumUserDefined)))
     384            return Exception { INVALID_ACCESS_ERR };
    415385        CString utf8 = reason.utf8(StrictConversionReplacingUnpairedSurrogatesWithFFFD);
    416386        if (utf8.length() > maxReasonSizeInBytes) {
    417387            scriptExecutionContext()->addConsoleMessage(MessageSource::JS, MessageLevel::Error, ASCIILiteral("WebSocket close message is too long."));
    418             ec = SYNTAX_ERR;
    419             return;
     388            return Exception { SYNTAX_ERR };
    420389        }
    421390    }
    422391
    423392    if (m_state == CLOSING || m_state == CLOSED)
    424         return;
     393        return { };
    425394    if (m_state == CONNECTING) {
    426395        m_state = CLOSING;
    427396        m_channel->fail("WebSocket is closed before the connection is established.");
    428         return;
     397        return { };
    429398    }
    430399    m_state = CLOSING;
    431400    if (m_channel)
    432401        m_channel->close(code, reason);
     402    return { };
    433403}
    434404
     
    461431{
    462432    switch (m_binaryType) {
    463     case BinaryTypeBlob:
     433    case BinaryType::Blob:
    464434        return ASCIILiteral("blob");
    465     case BinaryTypeArrayBuffer:
     435    case BinaryType::ArrayBuffer:
    466436        return ASCIILiteral("arraybuffer");
    467437    }
     
    470440}
    471441
    472 void WebSocket::setBinaryType(const String& binaryType, ExceptionCode& ec)
     442ExceptionOr<void> WebSocket::setBinaryType(const String& binaryType)
    473443{
    474444    if (binaryType == "blob") {
    475         m_binaryType = BinaryTypeBlob;
    476         return;
     445        m_binaryType = BinaryType::Blob;
     446        return { };
    477447    }
    478448    if (binaryType == "arraybuffer") {
    479         m_binaryType = BinaryTypeArrayBuffer;
    480         return;
    481     }
    482     ec = SYNTAX_ERR;
     449        m_binaryType = BinaryType::ArrayBuffer;
     450        return { };
     451    }
    483452    scriptExecutionContext()->addConsoleMessage(MessageSource::JS, MessageLevel::Error, "'" + binaryType + "' is not a valid value for binaryType; binaryType remains unchanged.");
     453    return Exception { SYNTAX_ERR };
    484454}
    485455
     
    592562    LOG(Network, "WebSocket %p didReceiveBinaryData() %u byte binary message", this, static_cast<unsigned>(binaryData.size()));
    593563    switch (m_binaryType) {
    594     case BinaryTypeBlob:
     564    case BinaryType::Blob:
    595565        // FIXME: We just received the data from NetworkProcess, and are sending it back. This is inefficient.
    596566        dispatchEvent(MessageEvent::create(Blob::create(WTFMove(binaryData), emptyString()), SecurityOrigin::create(m_url)->toString()));
    597567        break;
    598     case BinaryTypeArrayBuffer:
     568    case BinaryType::ArrayBuffer:
    599569        dispatchEvent(MessageEvent::create(ArrayBuffer::create(binaryData.data(), binaryData.size()), SecurityOrigin::create(m_url)->toString()));
    600570        break;
  • trunk/Source/WebCore/Modules/websockets/WebSocket.h

    r204127 r207384  
    2929 */
    3030
    31 #ifndef WebSocket_h
    32 #define WebSocket_h
     31#pragma once
    3332
    3433#if ENABLE(WEB_SOCKETS)
    3534
    3635#include "ActiveDOMObject.h"
    37 #include "EventListener.h"
    3836#include "EventTarget.h"
     37#include "ExceptionOr.h"
     38#include "Timer.h"
    3939#include "URL.h"
    40 #include "WebSocketChannel.h"
    4140#include "WebSocketChannelClient.h"
    42 #include <wtf/Forward.h>
    43 #include <wtf/RefCounted.h>
    44 #include <wtf/text/AtomicStringHash.h>
     41#include <wtf/Deque.h>
     42
     43namespace JSC {
     44class ArrayBuffer;
     45class ArrayBufferView;
     46}
    4547
    4648namespace WebCore {
    4749
    4850class Blob;
    49 class CloseEvent;
    5051class ThreadableWebSocketChannel;
    5152
    52 class WebSocket final : public RefCounted<WebSocket>, public EventTargetWithInlineData, public ActiveDOMObject, public WebSocketChannelClient {
     53class WebSocket final : public RefCounted<WebSocket>, public EventTargetWithInlineData, public ActiveDOMObject, private WebSocketChannelClient {
    5354public:
    5455    static void setIsAvailable(bool);
    5556    static bool isAvailable();
    56     static const char* subProtocolSeperator();
    57     static Ref<WebSocket> create(ScriptExecutionContext&);
    58     static RefPtr<WebSocket> create(ScriptExecutionContext&, const String& url, ExceptionCode&);
    59     static RefPtr<WebSocket> create(ScriptExecutionContext&, const String& url, const String& protocol, ExceptionCode&);
    60     static RefPtr<WebSocket> create(ScriptExecutionContext&, const String& url, const Vector<String>& protocols, ExceptionCode&);
     57
     58    static const char* subprotocolSeparator();
     59
     60    static ExceptionOr<Ref<WebSocket>> create(ScriptExecutionContext&, const String& url);
     61    static ExceptionOr<Ref<WebSocket>> create(ScriptExecutionContext&, const String& url, const String& protocol);
     62    static ExceptionOr<Ref<WebSocket>> create(ScriptExecutionContext&, const String& url, const Vector<String>& protocols);
    6163    virtual ~WebSocket();
    6264
     
    6870    };
    6971
    70     void connect(const String& url, ExceptionCode&);
    71     void connect(const String& url, const String& protocol, ExceptionCode&);
    72     void connect(const String& url, const Vector<String>& protocols, ExceptionCode&);
     72    ExceptionOr<void> connect(const String& url);
     73    ExceptionOr<void> connect(const String& url, const String& protocol);
     74    ExceptionOr<void> connect(const String& url, const Vector<String>& protocols);
    7375
    74     void send(const String& message, ExceptionCode&);
    75     void send(JSC::ArrayBuffer&, ExceptionCode&);
    76     void send(JSC::ArrayBufferView&, ExceptionCode&);
    77     void send(Blob&, ExceptionCode&);
     76    ExceptionOr<void> send(const String& message);
     77    ExceptionOr<void> send(JSC::ArrayBuffer&);
     78    ExceptionOr<void> send(JSC::ArrayBufferView&);
     79    ExceptionOr<void> send(Blob&);
    7880
    79     void close(Optional<unsigned short> code, const String& reason, ExceptionCode&);
     81    ExceptionOr<void> close(Optional<unsigned short> code, const String& reason);
    8082
    8183    const URL& url() const;
     
    8789
    8890    String binaryType() const;
    89     void setBinaryType(const String&, ExceptionCode&);
     91    ExceptionOr<void> setBinaryType(const String&);
    9092
    91     // EventTarget functions.
    92     EventTargetInterface eventTargetInterface() const override;
    93     ScriptExecutionContext* scriptExecutionContext() const override;
     93    using RefCounted::ref;
     94    using RefCounted::deref;
    9495
    95     using RefCounted<WebSocket>::ref;
    96     using RefCounted<WebSocket>::deref;
     96private:
     97    explicit WebSocket(ScriptExecutionContext&);
    9798
    98     // WebSocketChannelClient functions.
     99    void resumeTimerFired();
     100    void dispatchOrQueueErrorEvent();
     101    void dispatchOrQueueEvent(Ref<Event>&&);
     102
     103    void contextDestroyed() final;
     104    bool canSuspendForDocumentSuspension() const final;
     105    void suspend(ReasonForSuspension) final;
     106    void resume() final;
     107    void stop() final;
     108    const char* activeDOMObjectName() const final;
     109
     110    EventTargetInterface eventTargetInterface() const final;
     111    ScriptExecutionContext* scriptExecutionContext() const final;
     112
     113    void refEventTarget() final { ref(); }
     114    void derefEventTarget() final { deref(); }
     115
    99116    void didConnect() final;
    100117    void didReceiveMessage(const String& message) final;
     
    106123    void didUpgradeURL() final;
    107124
    108 private:
    109     explicit WebSocket(ScriptExecutionContext&);
    110 
    111     void resumeTimerFired();
    112     void dispatchOrQueueErrorEvent();
    113     void dispatchOrQueueEvent(Ref<Event>&&);
    114 
    115     // ActiveDOMObject API.
    116     void contextDestroyed() override;
    117     bool canSuspendForDocumentSuspension() const override;
    118     void suspend(ReasonForSuspension) override;
    119     void resume() override;
    120     void stop() override;
    121     const char* activeDOMObjectName() const override;
    122 
    123     void refEventTarget() override { ref(); }
    124     void derefEventTarget() override { deref(); }
    125 
    126125    size_t getFramingOverhead(size_t payloadSize);
    127126
    128     enum BinaryType {
    129         BinaryTypeBlob,
    130         BinaryTypeArrayBuffer
    131     };
     127    enum class BinaryType { Blob, ArrayBuffer };
    132128
    133129    RefPtr<ThreadableWebSocketChannel> m_channel;
    134130
    135     State m_state;
     131    State m_state { CONNECTING };
    136132    URL m_url;
    137     unsigned m_bufferedAmount;
    138     unsigned m_bufferedAmountAfterClose;
    139     BinaryType m_binaryType;
     133    unsigned m_bufferedAmount { 0 };
     134    unsigned m_bufferedAmountAfterClose { 0 };
     135    BinaryType m_binaryType { BinaryType::Blob };
    140136    String m_subprotocol;
    141137    String m_extensions;
     
    150146
    151147#endif // ENABLE(WEB_SOCKETS)
    152 
    153 #endif // WebSocket_h
  • trunk/Source/WebCore/Modules/websockets/WebSocket.idl

    r206723 r207384  
    3535    Constructor(USVString url, optional sequence<DOMString> protocols = []),
    3636    Constructor(USVString url, DOMString protocol),
    37     ConstructorMayThrowLegacyException,
     37    ConstructorMayThrowException,
    3838    ConstructorCallWith=ScriptExecutionContext,
    3939    EnabledAtRuntime,
     
    4343    readonly attribute USVString url;
    4444
    45     // ready state
    4645    const unsigned short CONNECTING = 0;
    4746    const unsigned short OPEN = 1;
     
    5251    readonly attribute unsigned long bufferedAmount;
    5352
    54     // networking
    5553    attribute EventHandler onopen;
    5654    attribute EventHandler onmessage;
     
    6159    readonly attribute DOMString? extensions;
    6260
    63     [SetterMayThrowLegacyException] attribute DOMString binaryType;
     61    [SetterMayThrowException] attribute DOMString binaryType;
    6462
    65     [MayThrowLegacyException] void send(ArrayBuffer data);
    66     [MayThrowLegacyException] void send(ArrayBufferView data);
    67     [MayThrowLegacyException] void send(Blob data);
    68     [MayThrowLegacyException] void send(USVString data);
     63    [MayThrowException] void send(ArrayBuffer data);
     64    [MayThrowException] void send(ArrayBufferView data);
     65    [MayThrowException] void send(Blob data);
     66    [MayThrowException] void send(USVString data);
    6967
    70     [MayThrowLegacyException] void close([Clamp] optional unsigned short code, optional DOMString reason);
     68    [MayThrowException] void close([Clamp] optional unsigned short code, optional DOMString reason);
    7169};
  • trunk/Source/WebCore/Modules/websockets/WebSocketHandshake.cpp

    r204702 r207384  
    606606        }
    607607        Vector<String> result;
    608         m_clientProtocol.split(String(WebSocket::subProtocolSeperator()), result);
     608        m_clientProtocol.split(WebSocket::subprotocolSeparator(), result);
    609609        if (!result.contains(serverWebSocketProtocol)) {
    610610            m_failureReason = ASCIILiteral("Error during WebSocket handshake: Sec-WebSocket-Protocol mismatch");
  • trunk/Source/WebCore/dom/ExceptionOr.h

    r206960 r207384  
    3737    ExceptionOr(Exception&&);
    3838    ExceptionOr(ReturnType&&);
     39    template<typename OtherType> ExceptionOr(const OtherType&, typename std::enable_if<std::is_scalar<OtherType>::value && std::is_convertible<OtherType, ReturnType>::value>::type* = nullptr);
    3940
    4041    bool hasException() const;
     
    6566template<typename ReturnType> inline ExceptionOr<ReturnType>::ExceptionOr(ReturnType&& returnValue)
    6667    : m_value(WTFMove(returnValue))
     68{
     69}
     70
     71template<typename ReturnType> template<typename OtherType> inline ExceptionOr<ReturnType>::ExceptionOr(const OtherType& returnValue, typename std::enable_if<std::is_scalar<OtherType>::value && std::is_convertible<OtherType, ReturnType>::value>::type*)
     72    : m_value(static_cast<ReturnType>(returnValue))
    6773{
    6874}
  • trunk/Source/WebCore/inspector/InspectorDatabaseAgent.cpp

    r199320 r207384  
    7878    bool handleEvent(SQLTransaction*, SQLResultSet* resultSet) override
    7979    {
    80         SQLResultSetRowList* rowList = resultSet->rows();
     80        auto& rowList = resultSet->rows();
    8181
    8282        auto columnNames = Inspector::Protocol::Array<String>::create();
    83         for (auto& column : rowList->columnNames())
     83        for (auto& column : rowList.columnNames())
    8484            columnNames->addItem(column);
    8585
    8686        auto values = Inspector::Protocol::Array<InspectorValue>::create();
    87         for (auto& value : rowList->values()) {
     87        for (auto& value : rowList.values()) {
    8888            RefPtr<InspectorValue> inspectorValue;
    8989            switch (value.type()) {
  • trunk/Source/WebCore/page/DOMWindow.idl

    r206877 r207384  
    11/*
    2  * Copyright (C) 2006, 2007, 2008, 2009, 2013 Apple Inc. All rights reserved.
     2 * Copyright (C) 2006-2016 Apple Inc. All rights reserved.
    33 * Copyright (C) 2011 Google Inc. All rights reserved.
    44 *
     
    4242    JSLegacyParent=JSDOMWindowBase,
    4343] interface DOMWindow : EventTarget {
    44     // DOM Level 0
    4544    [Replaceable] readonly attribute Screen screen;
    4645    readonly attribute History history;
     
    7776
    7877    // FIXME: Using "undefined" as default parameter value is wrong.
    79     boolean find(optional DOMString string = "undefined",
    80                  optional boolean caseSensitive = false,
    81                  optional boolean backwards = false,
    82                  optional boolean wrap = false,
    83                  optional boolean wholeWord = false,
    84                  optional boolean searchInFrames = false,
    85                  optional boolean showDialog = false);
     78    boolean find(optional DOMString string = "undefined", optional boolean caseSensitive = false, optional boolean backwards = false, optional boolean wrap = false, optional boolean wholeWord = false, optional boolean searchInFrames = false, optional boolean showDialog = false);
    8679
    8780    [Replaceable] readonly attribute  boolean offscreenBuffering;
     
    109102    [ImplementedAs=scrollTo] void scroll(optional ScrollToOptions options);
    110103
    111     void moveBy(optional unrestricted float x = NaN, optional unrestricted float y = NaN); // FIXME: this should take longs not floats.
    112     void moveTo(optional unrestricted float x = NaN, optional unrestricted float y = NaN); // FIXME: this should take longs not floats.
    113     void resizeBy(optional unrestricted float x = NaN, optional unrestricted float y = NaN); // FIXME: this should take longs not floats.
    114     void resizeTo(optional unrestricted float width = NaN, optional unrestricted float height = NaN); // FIXME: this should take longs not floats.
     104    void moveBy(optional unrestricted float x = NaN, optional unrestricted float y = NaN); // FIXME: This should take longs, not floats.
     105    void moveTo(optional unrestricted float x = NaN, optional unrestricted float y = NaN); // FIXME: This should take longs, not floats.
     106    void resizeBy(optional unrestricted float x = NaN, optional unrestricted float y = NaN); // FIXME: This should take longs, not floats.
     107    void resizeTo(optional unrestricted float width = NaN, optional unrestricted float height = NaN); // FIXME: This should take longs, not floats.
    115108
    116109    [DoNotCheckSecurity, ForwardDeclareInHeader] readonly attribute boolean closed;
     
    122115    attribute DOMString status;
    123116    attribute DOMString defaultStatus;
    124     // This attribute is an alias of defaultStatus and is necessary for legacy uses.
    125     [ImplementedAs=defaultStatus] attribute DOMString defaultstatus;
     117    [ImplementedAs=defaultStatus] attribute DOMString defaultstatus; // For compatibility with legacy content.
    126118
    127     // Self referential attributes
    128119    [Replaceable, DoNotCheckSecurityOnGetter] readonly attribute DOMWindow self;
    129120    [DoNotCheckSecurity, Unforgeable] readonly attribute DOMWindow window;
     
    134125    [DoNotCheckSecurityOnGetter, Unforgeable] readonly attribute DOMWindow top;
    135126
    136     // DOM Level 2 AbstractView Interface
    137127    [Unforgeable] readonly attribute Document document;
    138128
    139     // CSSOM View Module
    140129    MediaQueryList matchMedia(DOMString query);
    141130
    142     // styleMedia has been removed from the CSSOM View specification.
    143     readonly attribute StyleMedia styleMedia;
     131    readonly attribute StyleMedia styleMedia; // Keeping for now, but styleMedia has been removed from the CSSOM View specification.
    144132
    145     // DOM Level 2 Style Interface
    146133    [NewObject] CSSStyleDeclaration getComputedStyle(Element element, optional DOMString? pseudoElement = null);
    147     // FIXME: Drop this overload once <rdar://problem/28016778> has been fixed.
     134
     135    // FIXME: Drop the following overload of getComputedStyle once <rdar://problem/28020681> has been fixed.
    148136    [NewObject, MayThrowLegacyException] CSSStyleDeclaration getComputedStyle(Document document, optional DOMString? pseudoElement = null);
    149137
    150     // WebKit extensions
    151138    CSSRuleList getMatchedCSSRules(optional Element? element = null, optional DOMString? pseudoElement = null);
    152139
    153140    [Replaceable] readonly attribute unrestricted double devicePixelRatio;
    154141   
    155     WebKitPoint webkitConvertPointFromPageToNode(optional Node? node = null,
    156                                                  optional WebKitPoint? p = null);
    157     WebKitPoint webkitConvertPointFromNodeToPage(optional Node? node = null,
    158                                                  optional WebKitPoint? p = null);
     142    WebKitPoint webkitConvertPointFromPageToNode(optional Node? node = null, optional WebKitPoint? p = null);
     143    WebKitPoint webkitConvertPointFromNodeToPage(optional Node? node = null, optional WebKitPoint? p = null);
    159144
    160145    readonly attribute DOMApplicationCache applicationCache;
     
    163148    [GetterMayThrowLegacyException] readonly attribute Storage localStorage;
    164149
    165     // This is the interface orientation in degrees. Some examples are:
    166     //  0 is straight up; -90 is when the device is rotated 90 clockwise;
    167     //  90 is when rotated counter clockwise.
     150    // This is the interface orientation in degrees. Some examples:
     151    // 0 when straight up; -90 when rotated 90 degrees clockwise; 90 counter clockwise.
    168152    [Conditional=ORIENTATION_EVENTS] readonly attribute long orientation;
    169153
    170     // cross-document messaging
    171154    [DoNotCheckSecurity, Custom, MayThrowLegacyException, ForwardDeclareInHeader] void postMessage(SerializedScriptValue message, USVString targetOrigin, optional Array messagePorts);
    172155
     
    179162    [Conditional=REQUEST_ANIMATION_FRAME, ImplementedAs=cancelAnimationFrame] void webkitCancelRequestAnimationFrame(long id); // This is a deprecated alias for webkitCancelAnimationFrame(). Remove this when removing vendor prefix.
    180163
    181     void captureEvents(/*in long eventFlags*/);
    182     void releaseEvents(/*in long eventFlags*/);
     164    void captureEvents(); // Not implemented. Also not in modern standards. Empty function may help compatibility with legacy content.
     165    void releaseEvents(); // Not implemented. Also not in modern standards. Empty function may help compatibility with legacy content.
    183166
    184     [CustomGetter, CustomConstructor] attribute HTMLImageElementNamedConstructor Image; // Usable with new operator
     167    [CustomGetter, CustomConstructor] attribute HTMLImageElementNamedConstructor Image;
    185168    attribute XMLDocumentConstructor SVGDocument;
    186169
    187     attribute DOMURLConstructor webkitURL; // FIXME: deprecate this.
    188     attribute MutationObserverConstructor WebKitMutationObserver; // FIXME: Add metrics to determine when we can remove this.
     170    attribute DOMURLConstructor webkitURL; // FIXME: Deprecate this.
     171    attribute MutationObserverConstructor WebKitMutationObserver; // FIXME: Remove once we prove it is not needed for compatibility with legacy content.
    189172
    190173    [Conditional=CUSTOM_ELEMENTS, EnabledAtRuntime=CustomElements, ImplementedAs=ensureCustomElementRegistry] readonly attribute CustomElementRegistry customElements;
    191174
    192     // Event Handlers
    193 
    194     // Unique to Element and DOMWindow
     175    // Event handlers unique to Element and DOMWindow.
    195176    // FIXME: Should these be exposed on Document as well (and therefore moved to GlobalEventHandlers.idl)?
    196177    [NotEnumerable] attribute EventHandler onanimationend;
     
    206187    [NotEnumerable, Conditional=IOS_GESTURE_EVENTS] attribute EventHandler ongesturestart;
    207188
    208     // Unique to DOMWindow
     189    // Event handlers unique to DOMWindow.
    209190    [NotEnumerable, Conditional=DEVICE_ORIENTATION] attribute EventHandler ondevicemotion;
    210191    [NotEnumerable, Conditional=DEVICE_ORIENTATION] attribute EventHandler ondeviceorientation;
Note: See TracChangeset for help on using the changeset viewer.