Changeset 83562 in webkit


Ignore:
Timestamp:
Apr 12, 2011 1:13:34 AM (13 years ago)
Author:
steveblock@google.com
Message:

2011-04-12 Steve Block <steveblock@google.com>

Reviewed by Oliver Hunt.

Callable objects created via JavaScriptCore API cannot be used as Geolocation callbacks
https://bugs.webkit.org/show_bug.cgi?id=40012

Covered by fast/dom/Geolocation/argument-types.html
This is a revert of http://trac.webkit.org/changeset/60522

  • fast/dom/Geolocation/argument-types-expected.txt:
  • fast/dom/Geolocation/script-tests/argument-types.js:

2011-04-12 Steve Block <steveblock@google.com>

Reviewed by Oliver Hunt.

Callable objects created via JavaScriptCore API cannot be used as Geolocation callbacks
https://bugs.webkit.org/show_bug.cgi?id=40012

Covered by fast/dom/Geolocation/argument-types.html

  • bindings/js/CallbackFunction.cpp: (WebCore::checkFunctionOnlyCallback):
Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r83559 r83562  
     12011-04-12  Steve Block  <steveblock@google.com>
     2
     3        Reviewed by Oliver Hunt.
     4
     5        Callable objects created via JavaScriptCore API cannot be used as Geolocation callbacks
     6        https://bugs.webkit.org/show_bug.cgi?id=40012
     7
     8        Covered by fast/dom/Geolocation/argument-types.html
     9        This is a revert of http://trac.webkit.org/changeset/60522
     10
     11        * fast/dom/Geolocation/argument-types-expected.txt:
     12        * fast/dom/Geolocation/script-tests/argument-types.js:
     13
    1142011-04-12  Andrey Kosyakov  <caseq@chromium.org>
    215
  • trunk/LayoutTests/fast/dom/Geolocation/argument-types-expected.txt

    r60522 r83562  
    1010PASS navigator.geolocation.getCurrentPosition(objectThrowingException) threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17.
    1111PASS navigator.geolocation.getCurrentPosition(emptyFunction) did not throw exception.
     12PASS navigator.geolocation.getCurrentPosition(Math.abs) did not throw exception.
     13PASS navigator.geolocation.getCurrentPosition(layoutTestController.setGeolocationPermission) did not throw exception.
    1214PASS navigator.geolocation.getCurrentPosition(true) threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17.
    1315PASS navigator.geolocation.getCurrentPosition(42) threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17.
     
    2022PASS navigator.geolocation.getCurrentPosition(emptyFunction, objectThrowingException) threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17.
    2123PASS navigator.geolocation.getCurrentPosition(emptyFunction, emptyFunction) did not throw exception.
     24PASS navigator.geolocation.getCurrentPosition(emptyFunction, Math.abs) did not throw exception.
     25PASS navigator.geolocation.getCurrentPosition(emptyFunction, layoutTestController.setGeolocationPermission) did not throw exception.
    2226PASS navigator.geolocation.getCurrentPosition(emptyFunction, true) threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17.
    2327PASS navigator.geolocation.getCurrentPosition(emptyFunction, 42) threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17.
  • trunk/LayoutTests/fast/dom/Geolocation/script-tests/argument-types.js

    r60522 r83562  
    4141test('navigator.geolocation.getCurrentPosition(objectThrowingException)', true);
    4242test('navigator.geolocation.getCurrentPosition(emptyFunction)', false);
    43 //test('navigator.geolocation.getCurrentPosition(Math.abs)', false);
     43test('navigator.geolocation.getCurrentPosition(Math.abs)', false);
     44test('navigator.geolocation.getCurrentPosition(layoutTestController.setGeolocationPermission)', false);
    4445test('navigator.geolocation.getCurrentPosition(true)', true);
    4546test('navigator.geolocation.getCurrentPosition(42)', true);
     
    5354test('navigator.geolocation.getCurrentPosition(emptyFunction, objectThrowingException)', true);
    5455test('navigator.geolocation.getCurrentPosition(emptyFunction, emptyFunction)', false);
    55 //test('navigator.geolocation.getCurrentPosition(emptyFunction, Math.abs)', false);
     56test('navigator.geolocation.getCurrentPosition(emptyFunction, Math.abs)', false);
     57test('navigator.geolocation.getCurrentPosition(emptyFunction, layoutTestController.setGeolocationPermission)', false);
    5658test('navigator.geolocation.getCurrentPosition(emptyFunction, true)', true);
    5759test('navigator.geolocation.getCurrentPosition(emptyFunction, 42)', true);
  • trunk/Source/WebCore/ChangeLog

    r83561 r83562  
     12011-04-12  Steve Block  <steveblock@google.com>
     2
     3        Reviewed by Oliver Hunt.
     4
     5        Callable objects created via JavaScriptCore API cannot be used as Geolocation callbacks
     6        https://bugs.webkit.org/show_bug.cgi?id=40012
     7
     8        Covered by fast/dom/Geolocation/argument-types.html
     9
     10        * bindings/js/CallbackFunction.cpp:
     11        (WebCore::checkFunctionOnlyCallback):
     12
    1132011-04-07  Philippe Normand  <pnormand@igalia.com>
    214
  • trunk/Source/WebCore/bindings/js/CallbackFunction.cpp

    r83079 r83562  
    2828#include "ExceptionCode.h"
    2929#include "JSDOMBinding.h"
    30 #include <runtime/JSFunction.h>
     30#include <runtime/CallData.h>
    3131
    3232namespace WebCore {
     
    4040        return false;
    4141
    42     // FIXME: disallows callable objects created via JSC API. It's not clear what exactly the specification intends to allow.
    43     // https://bugs.webkit.org/show_bug.cgi?id=40012
    44     if (!value.inherits(&JSC::JSFunction::s_info)) {
     42    JSC::CallData callData;
     43    if (getCallData(value, callData) == JSC::CallTypeNone) {
    4544        setDOMException(exec, TYPE_MISMATCH_ERR);
    4645        return false;
Note: See TracChangeset for help on using the changeset viewer.