Skip to content

Commit

Permalink
[WebIDL] Add support for default parameter values
Browse files Browse the repository at this point in the history
https://bugs.webkit.org/show_bug.cgi?id=149263
<rdar://problem/22545600>

Reviewed by Ryosuke Niwa.

LayoutTests/imported/w3c:

Rebaseline several W3C tests now that more NodeIterator / TreeWalker
checks are passing.

* web-platform-tests/dom/traversal/NodeIterator-expected.txt:
* web-platform-tests/dom/traversal/TreeWalker-basic-expected.txt:

Source/WebCore:

Add support for default parameter values to our Web IDL parser and JS
bindings generator. This allows the bindings to convert undefined to
the parameter's default value for optional parameters:
https://heycam.github.io/webidl/#dfn-optional-argument-default-value

Previously, our bindings generator would just convert undefined to
0 / false / "undefined" for optional parameters, depending on the
parameter type.

This patch uses the new default parameter support to fix a bug in
document.createNodeIterator() / document.createTreeWalker()'s handling
of the whatToShow parameter:
https://dom.spec.whatwg.org/#document

WebKit currently was undefined to 0 in this case, even though it should
use the parameter's default value: OxFFFFFFFF.

I am planning to go through other optional parameters in a follow-up
patch and add default values where needed.

No new tests, already covered by existing layout tests and
added bindings tests coverage.

* bindings/scripts/CodeGeneratorJS.pm:
(GenerateParametersCheck):
* bindings/scripts/IDLParser.pm:
(parseOptionalOrRequiredArgument):
* bindings/scripts/test/GObject/WebKitDOMTestObj.cpp:
(webkit_dom_test_obj_method_with_optional_arg_and_default_value):
(webkit_dom_test_obj_method_with_optional_string_and_default_value):
* bindings/scripts/test/GObject/WebKitDOMTestObj.h:
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::jsTestObjPrototypeFunctionMethodWithOptionalArgAndDefaultValue):
(WebCore::jsTestObjPrototypeFunctionMethodWithOptionalStringAndDefaultValue):
* bindings/scripts/test/ObjC/DOMTestObj.h:
* bindings/scripts/test/ObjC/DOMTestObj.mm:
(-[DOMTestObj methodWithOptionalArgAndDefaultValue:]):
(-[DOMTestObj methodWithOptionalStringAndDefaultValue:]):
* bindings/scripts/test/TestObj.idl:
* dom/Document.idl:

LayoutTests:

Rebaseline several NodeIterator / TreeWalker tests now that more checks
are passing.

* fast/dom/createNodeIterator-parameters-expected.txt:
* fast/dom/createTreeWalker-parameters-expected.txt:


Canonical link: https://commits.webkit.org/167401@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@189957 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
cdumez committed Sep 18, 2015
1 parent 310b662 commit 1d068a4
Show file tree
Hide file tree
Showing 16 changed files with 191 additions and 8 deletions.
14 changes: 14 additions & 0 deletions LayoutTests/ChangeLog
@@ -1,3 +1,17 @@
2015-09-17 Chris Dumez <cdumez@apple.com>

[WebIDL] Add support for default parameter values
https://bugs.webkit.org/show_bug.cgi?id=149263
<rdar://problem/22545600>

Reviewed by Ryosuke Niwa.

Rebaseline several NodeIterator / TreeWalker tests now that more checks
are passing.

* fast/dom/createNodeIterator-parameters-expected.txt:
* fast/dom/createTreeWalker-parameters-expected.txt:

2015-09-17 Saam barati <sbarati@apple.com>

add a regress test for richards with try/catch.
Expand Down
Expand Up @@ -29,7 +29,7 @@ Passing undefined for optional parameters
iterator = document.createNodeIterator(document, undefined, undefined)
PASS iterator.root is document
PASS iterator.referenceNode is document
FAIL iterator.whatToShow should be 4294967295. Was 0.
PASS iterator.whatToShow is 0xFFFFFFFF
PASS iterator.filter is null
PASS iterator.pointerBeforeReferenceNode is true
PASS successfullyParsed is true
Expand Down
Expand Up @@ -27,7 +27,7 @@ Passing undefined for optional parameters
walker = document.createTreeWalker(document, undefined, undefined)
PASS walker.root is document
PASS walker.currentNode is document
FAIL walker.whatToShow should be 4294967295. Was 0.
PASS walker.whatToShow is 0xFFFFFFFF
PASS walker.filter is null
PASS successfullyParsed is true

Expand Down
14 changes: 14 additions & 0 deletions LayoutTests/imported/w3c/ChangeLog
@@ -1,3 +1,17 @@
2015-09-17 Chris Dumez <cdumez@apple.com>

[WebIDL] Add support for default parameter values
https://bugs.webkit.org/show_bug.cgi?id=149263
<rdar://problem/22545600>

Reviewed by Ryosuke Niwa.

Rebaseline several W3C tests now that more NodeIterator / TreeWalker
checks are passing.

* web-platform-tests/dom/traversal/NodeIterator-expected.txt:
* web-platform-tests/dom/traversal/TreeWalker-basic-expected.txt:

2015-09-17 Zalan Bujtas <zalan@apple.com>

CSS WG multicol-1 tests failures with 1px differences due to baseline difference.
Expand Down
Expand Up @@ -2,7 +2,7 @@
PASS detach() should be a no-op
PASS createNodeIterator() parameter defaults
PASS createNodeIterator() with null as arguments
FAIL createNodeIterator() with undefined as arguments assert_equals: whatToShow expected 4294967295 but got 0
PASS createNodeIterator() with undefined as arguments
PASS Propagate exception from filter function
PASS document.createNodeIterator(paras[0], 0, null)
PASS document.createNodeIterator(paras[0], 0, (function(node) { return true }))
Expand Down
Expand Up @@ -3,7 +3,7 @@ This test checks the basic functionality of TreeWalker.

PASS Construct a TreeWalker by document.createTreeWalker(root).
PASS Construct a TreeWalker by document.createTreeWalker(root, null, null).
FAIL Construct a TreeWalker by document.createTreeWalker(root, undefined, undefined). assert_equals: whatToShow expected 4294967295 but got 0
PASS Construct a TreeWalker by document.createTreeWalker(root, undefined, undefined).
PASS Give an invalid root node to document.createTreeWalker().
PASS Walk over nodes.
PASS Optional arguments to createTreeWalker should be optional (3 passed, null).
Expand Down
49 changes: 49 additions & 0 deletions Source/WebCore/ChangeLog
@@ -1,3 +1,52 @@
2015-09-17 Chris Dumez <cdumez@apple.com>

[WebIDL] Add support for default parameter values
https://bugs.webkit.org/show_bug.cgi?id=149263
<rdar://problem/22545600>

Reviewed by Ryosuke Niwa.

Add support for default parameter values to our Web IDL parser and JS
bindings generator. This allows the bindings to convert undefined to
the parameter's default value for optional parameters:
https://heycam.github.io/webidl/#dfn-optional-argument-default-value

Previously, our bindings generator would just convert undefined to
0 / false / "undefined" for optional parameters, depending on the
parameter type.

This patch uses the new default parameter support to fix a bug in
document.createNodeIterator() / document.createTreeWalker()'s handling
of the whatToShow parameter:
https://dom.spec.whatwg.org/#document

WebKit currently was undefined to 0 in this case, even though it should
use the parameter's default value: OxFFFFFFFF.

I am planning to go through other optional parameters in a follow-up
patch and add default values where needed.

No new tests, already covered by existing layout tests and
added bindings tests coverage.

* bindings/scripts/CodeGeneratorJS.pm:
(GenerateParametersCheck):
* bindings/scripts/IDLParser.pm:
(parseOptionalOrRequiredArgument):
* bindings/scripts/test/GObject/WebKitDOMTestObj.cpp:
(webkit_dom_test_obj_method_with_optional_arg_and_default_value):
(webkit_dom_test_obj_method_with_optional_string_and_default_value):
* bindings/scripts/test/GObject/WebKitDOMTestObj.h:
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::jsTestObjPrototypeFunctionMethodWithOptionalArgAndDefaultValue):
(WebCore::jsTestObjPrototypeFunctionMethodWithOptionalStringAndDefaultValue):
* bindings/scripts/test/ObjC/DOMTestObj.h:
* bindings/scripts/test/ObjC/DOMTestObj.mm:
(-[DOMTestObj methodWithOptionalArgAndDefaultValue:]):
(-[DOMTestObj methodWithOptionalStringAndDefaultValue:]):
* bindings/scripts/test/TestObj.idl:
* dom/Document.idl:

2015-09-17 Dean Jackson <dino@apple.com>

Multi-hop reference cycles not detected.
Expand Down
3 changes: 3 additions & 0 deletions Source/WebCore/bindings/scripts/CodeGeneratorJS.pm
Expand Up @@ -3404,6 +3404,9 @@ sub GenerateParametersCheck
if ($optional && $defaultAttribute && $defaultAttribute eq "NullString") {
$outer = "exec->argument($argsIndex).isUndefined() ? String() : ";
$inner = "exec->uncheckedArgument($argsIndex)";
} elsif ($optional && $parameter->default) {
$outer = "exec->argument($argsIndex).isUndefined() ? " . $parameter->default . " : ";
$inner = "exec->uncheckedArgument($argsIndex)";
} else {
$outer = "";
$inner = "exec->argument($argsIndex)";
Expand Down
3 changes: 2 additions & 1 deletion Source/WebCore/bindings/scripts/IDLParser.pm
Expand Up @@ -82,6 +82,7 @@ struct( domSignature => {
isNullable => '$', # Is variable type Nullable (T?)
isVariadic => '$', # Is variable variadic (long... numbers)
isOptional => '$', # Is variable optional (optional T)
default => '$', # Default value for parameters
});

# Used to represent string constants
Expand Down Expand Up @@ -1433,7 +1434,7 @@ sub parseOptionalOrRequiredArgument
$paramDataNode->type(identifierRemoveNullablePrefix(typeRemoveNullableSuffix($type)));
$paramDataNode->isOptional(1);
$paramDataNode->name($self->parseArgumentName());
$self->parseDefault();
$paramDataNode->default($self->parseDefault());
return $paramDataNode;
}
if ($next->type() == IdentifierToken || $next->value() =~ /$nextExceptionField_1/) {
Expand Down
18 changes: 18 additions & 0 deletions Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.cpp
Expand Up @@ -1283,6 +1283,14 @@ void webkit_dom_test_obj_method_with_optional_arg(WebKitDOMTestObj* self, glong
item->methodWithOptionalArg(opt);
}

void webkit_dom_test_obj_method_with_optional_arg_and_default_value(WebKitDOMTestObj* self, glong opt)
{
WebCore::JSMainThreadNullState state;
g_return_if_fail(WEBKIT_DOM_IS_TEST_OBJ(self));
WebCore::TestObj* item = WebKit::core(self);
item->methodWithOptionalArgAndDefaultValue(opt);
}

void webkit_dom_test_obj_method_with_non_optional_arg_and_optional_arg(WebKitDOMTestObj* self, glong nonOpt, glong opt)
{
WebCore::JSMainThreadNullState state;
Expand All @@ -1309,6 +1317,16 @@ void webkit_dom_test_obj_method_with_optional_string(WebKitDOMTestObj* self, con
item->methodWithOptionalString(convertedStr);
}

void webkit_dom_test_obj_method_with_optional_string_and_default_value(WebKitDOMTestObj* self, const gchar* str)
{
WebCore::JSMainThreadNullState state;
g_return_if_fail(WEBKIT_DOM_IS_TEST_OBJ(self));
g_return_if_fail(str);
WebCore::TestObj* item = WebKit::core(self);
WTF::String convertedStr = WTF::String::fromUTF8(str);
item->methodWithOptionalStringAndDefaultValue(convertedStr);
}

void webkit_dom_test_obj_method_with_optional_string_is_undefined(WebKitDOMTestObj* self, const gchar* str)
{
WebCore::JSMainThreadNullState state;
Expand Down
20 changes: 20 additions & 0 deletions Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.h
Expand Up @@ -383,6 +383,16 @@ webkit_dom_test_obj_with_script_execution_context_and_script_state_with_spaces(W
WEBKIT_API void
webkit_dom_test_obj_method_with_optional_arg(WebKitDOMTestObj* self, glong opt);

/**
* webkit_dom_test_obj_method_with_optional_arg_and_default_value:
* @self: A #WebKitDOMTestObj
* @opt: A #glong
*
* Stability: Unstable
**/
WEBKIT_API void
webkit_dom_test_obj_method_with_optional_arg_and_default_value(WebKitDOMTestObj* self, glong opt);

/**
* webkit_dom_test_obj_method_with_non_optional_arg_and_optional_arg:
* @self: A #WebKitDOMTestObj
Expand Down Expand Up @@ -416,6 +426,16 @@ webkit_dom_test_obj_method_with_non_optional_arg_and_two_optional_args(WebKitDOM
WEBKIT_API void
webkit_dom_test_obj_method_with_optional_string(WebKitDOMTestObj* self, const gchar* str);

/**
* webkit_dom_test_obj_method_with_optional_string_and_default_value:
* @self: A #WebKitDOMTestObj
* @str: A #gchar
*
* Stability: Unstable
**/
WEBKIT_API void
webkit_dom_test_obj_method_with_optional_string_and_default_value(WebKitDOMTestObj* self, const gchar* str);

/**
* webkit_dom_test_obj_method_with_optional_string_is_undefined:
* @self: A #WebKitDOMTestObj
Expand Down
48 changes: 48 additions & 0 deletions Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp
Expand Up @@ -109,9 +109,11 @@ JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionWithScriptExecutionC
JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionWithScriptExecutionContextAndScriptStateWithSpaces(JSC::ExecState*);
JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionWithScriptArgumentsAndCallStack(JSC::ExecState*);
JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodWithOptionalArg(JSC::ExecState*);
JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodWithOptionalArgAndDefaultValue(JSC::ExecState*);
JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodWithNonOptionalArgAndOptionalArg(JSC::ExecState*);
JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodWithNonOptionalArgAndTwoOptionalArgs(JSC::ExecState*);
JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodWithOptionalString(JSC::ExecState*);
JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodWithOptionalStringAndDefaultValue(JSC::ExecState*);
JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodWithOptionalStringIsUndefined(JSC::ExecState*);
JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodWithOptionalStringIsNullString(JSC::ExecState*);
JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodWithCallbackArg(JSC::ExecState*);
Expand Down Expand Up @@ -620,9 +622,11 @@ static const HashTableValue JSTestObjPrototypeTableValues[] =
{ "withScriptExecutionContextAndScriptStateWithSpaces", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionWithScriptExecutionContextAndScriptStateWithSpaces), (intptr_t) (0) } },
{ "withScriptArgumentsAndCallStack", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionWithScriptArgumentsAndCallStack), (intptr_t) (0) } },
{ "methodWithOptionalArg", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionMethodWithOptionalArg), (intptr_t) (0) } },
{ "methodWithOptionalArgAndDefaultValue", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionMethodWithOptionalArgAndDefaultValue), (intptr_t) (0) } },
{ "methodWithNonOptionalArgAndOptionalArg", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionMethodWithNonOptionalArgAndOptionalArg), (intptr_t) (1) } },
{ "methodWithNonOptionalArgAndTwoOptionalArgs", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionMethodWithNonOptionalArgAndTwoOptionalArgs), (intptr_t) (1) } },
{ "methodWithOptionalString", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionMethodWithOptionalString), (intptr_t) (0) } },
{ "methodWithOptionalStringAndDefaultValue", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionMethodWithOptionalStringAndDefaultValue), (intptr_t) (0) } },
{ "methodWithOptionalStringIsUndefined", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionMethodWithOptionalStringIsUndefined), (intptr_t) (0) } },
{ "methodWithOptionalStringIsNullString", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionMethodWithOptionalStringIsNullString), (intptr_t) (0) } },
{ "methodWithCallbackArg", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionMethodWithCallbackArg), (intptr_t) (1) } },
Expand Down Expand Up @@ -3529,6 +3533,28 @@ EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodWithOptionalArg(Exe
return JSValue::encode(jsUndefined());
}

EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodWithOptionalArgAndDefaultValue(ExecState* exec)
{
JSValue thisValue = exec->thisValue();
JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(thisValue);
if (UNLIKELY(!castedThis))
return throwThisTypeError(*exec, "TestObj", "methodWithOptionalArgAndDefaultValue");
ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info());
auto& impl = castedThis->impl();

size_t argsCount = exec->argumentCount();
if (argsCount <= 0) {
impl.methodWithOptionalArgAndDefaultValue();
return JSValue::encode(jsUndefined());
}

int opt = exec->argument(0).isUndefined() ? 666 : toInt32(exec, exec->uncheckedArgument(0), NormalConversion);
if (UNLIKELY(exec->hadException()))
return JSValue::encode(jsUndefined());
impl.methodWithOptionalArgAndDefaultValue(opt);
return JSValue::encode(jsUndefined());
}

EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodWithNonOptionalArgAndOptionalArg(ExecState* exec)
{
JSValue thisValue = exec->thisValue();
Expand Down Expand Up @@ -3613,6 +3639,28 @@ EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodWithOptionalString(
return JSValue::encode(jsUndefined());
}

EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodWithOptionalStringAndDefaultValue(ExecState* exec)
{
JSValue thisValue = exec->thisValue();
JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(thisValue);
if (UNLIKELY(!castedThis))
return throwThisTypeError(*exec, "TestObj", "methodWithOptionalStringAndDefaultValue");
ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info());
auto& impl = castedThis->impl();

size_t argsCount = exec->argumentCount();
if (argsCount <= 0) {
impl.methodWithOptionalStringAndDefaultValue();
return JSValue::encode(jsUndefined());
}

String str = exec->argument(0).isUndefined() ? "foo" : exec->uncheckedArgument(0).toString(exec)->value(exec);
if (UNLIKELY(exec->hadException()))
return JSValue::encode(jsUndefined());
impl.methodWithOptionalStringAndDefaultValue(str);
return JSValue::encode(jsUndefined());
}

EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodWithOptionalStringIsUndefined(ExecState* exec)
{
JSValue thisValue = exec->thisValue();
Expand Down
2 changes: 2 additions & 0 deletions Source/WebCore/bindings/scripts/test/ObjC/DOMTestObj.h
Expand Up @@ -151,9 +151,11 @@ WEBCORE_EXPORT @interface DOMTestObj : DOMObject
- (DOMTestObj *)withScriptExecutionContextAndScriptStateWithSpaces;
- (void)withScriptArgumentsAndCallStack;
- (void)methodWithOptionalArg:(int)opt;
- (void)methodWithOptionalArgAndDefaultValue:(int)opt;
- (void)methodWithNonOptionalArgAndOptionalArg:(int)nonOpt opt:(int)opt;
- (void)methodWithNonOptionalArgAndTwoOptionalArgs:(int)nonOpt opt1:(int)opt1 opt2:(int)opt2;
- (void)methodWithOptionalString:(NSString *)str;
- (void)methodWithOptionalStringAndDefaultValue:(NSString *)str;
- (void)methodWithOptionalStringIsUndefined:(NSString *)str;
- (void)methodWithOptionalStringIsNullString:(NSString *)str;
- (void)classMethod;
Expand Down
12 changes: 12 additions & 0 deletions Source/WebCore/bindings/scripts/test/ObjC/DOMTestObj.mm
Expand Up @@ -1007,6 +1007,12 @@ - (void)methodWithOptionalArg:(int)opt
IMPL->methodWithOptionalArg(opt);
}

- (void)methodWithOptionalArgAndDefaultValue:(int)opt
{
WebCore::JSMainThreadNullState state;
IMPL->methodWithOptionalArgAndDefaultValue(opt);
}

- (void)methodWithNonOptionalArgAndOptionalArg:(int)nonOpt opt:(int)opt
{
WebCore::JSMainThreadNullState state;
Expand All @@ -1025,6 +1031,12 @@ - (void)methodWithOptionalString:(NSString *)str
IMPL->methodWithOptionalString(str);
}

- (void)methodWithOptionalStringAndDefaultValue:(NSString *)str
{
WebCore::JSMainThreadNullState state;
IMPL->methodWithOptionalStringAndDefaultValue(str);
}

- (void)methodWithOptionalStringIsUndefined:(NSString *)str
{
WebCore::JSMainThreadNullState state;
Expand Down
4 changes: 3 additions & 1 deletion Source/WebCore/bindings/scripts/test/TestObj.idl
Expand Up @@ -140,11 +140,13 @@ enum _optional { "", "OptionalValue1", "OptionalValue2", "OptionalValue3" };
[CallWith= ScriptExecutionContext & ScriptState ] attribute TestObj withScriptExecutionContextAndScriptStateWithSpacesAttribute;
[CallWith=ScriptArguments&CallStack] attribute TestObj withScriptArgumentsAndCallStackAttribute;

// 'Optional' extended attribute
// Optional parameters.
void methodWithOptionalArg(optional long opt);
void methodWithOptionalArgAndDefaultValue(optional long opt = 666);
void methodWithNonOptionalArgAndOptionalArg(long nonOpt, optional long opt);
void methodWithNonOptionalArgAndTwoOptionalArgs(long nonOpt, optional long opt1, optional long opt2);
void methodWithOptionalString(optional DOMString str);
void methodWithOptionalStringAndDefaultValue(optional DOMString str = "foo");
void methodWithOptionalStringIsUndefined([Default=Undefined] optional DOMString str);
void methodWithOptionalStringIsNullString([Default=NullString] optional DOMString str);

Expand Down
4 changes: 2 additions & 2 deletions Source/WebCore/dom/Document.idl
Expand Up @@ -93,11 +93,11 @@
// DOM Level 2 Tranversal and Range (DocumentTraversal interface)

[ObjCLegacyUnnamedParameters, RaisesException, NewObject] NodeIterator createNodeIterator(Node root,
optional unsigned long whatToShow,
optional unsigned long whatToShow = 0xFFFFFFFF,
optional NodeFilter? filter,
optional boolean expandEntityReferences);
[ObjCLegacyUnnamedParameters, RaisesException, NewObject] TreeWalker createTreeWalker(Node root,
optional unsigned long whatToShow,
optional unsigned long whatToShow = 0xFFFFFFFF,
optional NodeFilter? filter,
optional boolean expandEntityReferences);

Expand Down

0 comments on commit 1d068a4

Please sign in to comment.