| Differences between
and this patch
- a/LayoutTests/ChangeLog +13 lines
Lines 1-3 a/LayoutTests/ChangeLog_sec1
1
2011-04-11  Steve Block  <steveblock@google.com>
2
3
        Reviewed by NOBODY (OOPS!).
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
1
2011-04-11  Ryosuke Niwa  <rniwa@webkit.org>
14
2011-04-11  Ryosuke Niwa  <rniwa@webkit.org>
2
15
3
        Reviewed by Antti Koivisto.
16
        Reviewed by Antti Koivisto.
- a/LayoutTests/fast/dom/Geolocation/argument-types-expected.txt +4 lines
Lines 9-14 PASS navigator.geolocation.getCurrentPosition(null) threw exception Error: TYPE_ a/LayoutTests/fast/dom/Geolocation/argument-types-expected.txt_sec1
9
PASS navigator.geolocation.getCurrentPosition({}) threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17.
9
PASS navigator.geolocation.getCurrentPosition({}) threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17.
10
PASS navigator.geolocation.getCurrentPosition(objectThrowingException) threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17.
10
PASS navigator.geolocation.getCurrentPosition(objectThrowingException) threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17.
11
PASS navigator.geolocation.getCurrentPosition(emptyFunction) did not throw exception.
11
PASS navigator.geolocation.getCurrentPosition(emptyFunction) did not throw exception.
12
PASS navigator.geolocation.getCurrentPosition(Math.abs) did not throw exception.
13
PASS navigator.geolocation.getCurrentPosition(layoutTestController.setGeolocationPermission) did not throw exception.
12
PASS navigator.geolocation.getCurrentPosition(true) threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17.
14
PASS navigator.geolocation.getCurrentPosition(true) threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17.
13
PASS navigator.geolocation.getCurrentPosition(42) threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17.
15
PASS navigator.geolocation.getCurrentPosition(42) threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17.
14
PASS navigator.geolocation.getCurrentPosition(Infinity) threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17.
16
PASS navigator.geolocation.getCurrentPosition(Infinity) threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17.
Lines 19-24 PASS navigator.geolocation.getCurrentPosition(emptyFunction, null) did not throw a/LayoutTests/fast/dom/Geolocation/argument-types-expected.txt_sec2
19
PASS navigator.geolocation.getCurrentPosition(emptyFunction, {}) threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17.
21
PASS navigator.geolocation.getCurrentPosition(emptyFunction, {}) threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17.
20
PASS navigator.geolocation.getCurrentPosition(emptyFunction, objectThrowingException) threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17.
22
PASS navigator.geolocation.getCurrentPosition(emptyFunction, objectThrowingException) threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17.
21
PASS navigator.geolocation.getCurrentPosition(emptyFunction, emptyFunction) did not throw exception.
23
PASS navigator.geolocation.getCurrentPosition(emptyFunction, emptyFunction) did not throw exception.
24
PASS navigator.geolocation.getCurrentPosition(emptyFunction, Math.abs) did not throw exception.
25
PASS navigator.geolocation.getCurrentPosition(emptyFunction, layoutTestController.setGeolocationPermission) did not throw exception.
22
PASS navigator.geolocation.getCurrentPosition(emptyFunction, true) threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17.
26
PASS navigator.geolocation.getCurrentPosition(emptyFunction, true) threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17.
23
PASS navigator.geolocation.getCurrentPosition(emptyFunction, 42) threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17.
27
PASS navigator.geolocation.getCurrentPosition(emptyFunction, 42) threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17.
24
PASS navigator.geolocation.getCurrentPosition(emptyFunction, Infinity) threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17.
28
PASS navigator.geolocation.getCurrentPosition(emptyFunction, Infinity) threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17.
- a/LayoutTests/fast/dom/Geolocation/script-tests/argument-types.js -2 / +4 lines
Lines 40-46 test('navigator.geolocation.getCurrentPosition(null)', true); a/LayoutTests/fast/dom/Geolocation/script-tests/argument-types.js_sec1
40
test('navigator.geolocation.getCurrentPosition({})', true);
40
test('navigator.geolocation.getCurrentPosition({})', true);
41
test('navigator.geolocation.getCurrentPosition(objectThrowingException)', true);
41
test('navigator.geolocation.getCurrentPosition(objectThrowingException)', true);
42
test('navigator.geolocation.getCurrentPosition(emptyFunction)', false);
42
test('navigator.geolocation.getCurrentPosition(emptyFunction)', false);
43
//test('navigator.geolocation.getCurrentPosition(Math.abs)', false);
43
test('navigator.geolocation.getCurrentPosition(Math.abs)', false);
44
test('navigator.geolocation.getCurrentPosition(layoutTestController.setGeolocationPermission)', false);
44
test('navigator.geolocation.getCurrentPosition(true)', true);
45
test('navigator.geolocation.getCurrentPosition(true)', true);
45
test('navigator.geolocation.getCurrentPosition(42)', true);
46
test('navigator.geolocation.getCurrentPosition(42)', true);
46
test('navigator.geolocation.getCurrentPosition(Infinity)', true);
47
test('navigator.geolocation.getCurrentPosition(Infinity)', true);
Lines 52-58 test('navigator.geolocation.getCurrentPosition(emptyFunction, null)', false); a/LayoutTests/fast/dom/Geolocation/script-tests/argument-types.js_sec2
52
test('navigator.geolocation.getCurrentPosition(emptyFunction, {})', true);
53
test('navigator.geolocation.getCurrentPosition(emptyFunction, {})', true);
53
test('navigator.geolocation.getCurrentPosition(emptyFunction, objectThrowingException)', true);
54
test('navigator.geolocation.getCurrentPosition(emptyFunction, objectThrowingException)', true);
54
test('navigator.geolocation.getCurrentPosition(emptyFunction, emptyFunction)', false);
55
test('navigator.geolocation.getCurrentPosition(emptyFunction, emptyFunction)', false);
55
//test('navigator.geolocation.getCurrentPosition(emptyFunction, Math.abs)', false);
56
test('navigator.geolocation.getCurrentPosition(emptyFunction, Math.abs)', false);
57
test('navigator.geolocation.getCurrentPosition(emptyFunction, layoutTestController.setGeolocationPermission)', false);
56
test('navigator.geolocation.getCurrentPosition(emptyFunction, true)', true);
58
test('navigator.geolocation.getCurrentPosition(emptyFunction, true)', true);
57
test('navigator.geolocation.getCurrentPosition(emptyFunction, 42)', true);
59
test('navigator.geolocation.getCurrentPosition(emptyFunction, 42)', true);
58
test('navigator.geolocation.getCurrentPosition(emptyFunction, Infinity)', true);
60
test('navigator.geolocation.getCurrentPosition(emptyFunction, Infinity)', true);
- a/Source/WebCore/ChangeLog +12 lines
Lines 1-3 a/Source/WebCore/ChangeLog_sec1
1
2011-04-11  Steve Block  <steveblock@google.com>
2
3
        Reviewed by NOBODY (OOPS!).
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
1
2011-04-06  Xiaomei Ji  <xji@chromium.org>
13
2011-04-06  Xiaomei Ji  <xji@chromium.org>
2
14
3
        Reviewed by Ryosuke Niwa.
15
        Reviewed by Ryosuke Niwa.
- a/Source/WebCore/bindings/js/CallbackFunction.cpp -4 / +3 lines
Lines 27-33 a/Source/WebCore/bindings/js/CallbackFunction.cpp_sec1
27
27
28
#include "ExceptionCode.h"
28
#include "ExceptionCode.h"
29
#include "JSDOMBinding.h"
29
#include "JSDOMBinding.h"
30
#include <runtime/JSFunction.h>
30
#include <runtime/CallData.h>
31
31
32
namespace WebCore {
32
namespace WebCore {
33
33
Lines 39-47 bool checkFunctionOnlyCallback(JSC::ExecState* exec, JSC::JSValue value, Callbac a/Source/WebCore/bindings/js/CallbackFunction.cpp_sec2
39
    if (value.isNull() && (acceptedValues & CallbackAllowNull))
39
    if (value.isNull() && (acceptedValues & CallbackAllowNull))
40
        return false;
40
        return false;
41
41
42
    // FIXME: disallows callable objects created via JSC API. It's not clear what exactly the specification intends to allow.
42
    JSC::CallData callData;
43
    // https://bugs.webkit.org/show_bug.cgi?id=40012
43
    if (getCallData(value, callData) == JSC::CallTypeNone) {
44
    if (!value.inherits(&JSC::JSFunction::s_info)) {
45
        setDOMException(exec, TYPE_MISMATCH_ERR);
44
        setDOMException(exec, TYPE_MISMATCH_ERR);
46
        return false;
45
        return false;
47
    }
46
    }

Return to Bug 40012