[Webkit-unassigned] [Bug 71190] Document.importNode's 'deep' argument should default to true

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Nov 2 02:18:20 PDT 2011


https://bugs.webkit.org/show_bug.cgi?id=71190





--- Comment #5 from Ms2ger <Ms2ger at gmail.com>  2011-11-02 02:18:20 PST ---
(In reply to comment #3)
> (In reply to comment #2)
> > Currently importNode() is defined in Document.idl as,
> > 
> > [OldStyleObjC, ReturnsNew] Node importNode(in [Optional=CallWithDefaultValue] Node importedNode,
> >                                                    in [Optional=CallWithDefaultValue] boolean deep)
> >             raises (DOMException);
> > 
> > Which generates code in JSDocument.cpp as,
> > 
> > bool deep(MAYBE_MISSING_PARAMETER(exec, 1, MissingIsUndefined).toBoolean(exec));
> > 
> > So I thought Document.idl is the correct place to fix this issue but,
> > 
> > on debugging it is found that if there is method in idl with boolean argument as "Optional=CallWithDefaultValue",
> > CodeGeneratorJS.pm creates code with policy "MissingIsUndefined" and for boolean jsUndefined() means "false". 
> > So for all booleans args with "Optional=CallWithDefaultValue" default value is set to false.
> > 
> > This contradicts with this bug's requirement "Document.importNode's 'deep' argument should default to true".
> > 
> > Should we have policy like "MissingIsTrue" or extended attribute like "CallWithTrueValue"..?
> > 
> > Please guide me If I am looking in wrong direction.
> 
> According to the spec (http://www.w3.org/TR/DOM-Level-3-Core/core.html#i-Document), the IDL should be
> 
>     Node importNode(in Node importedNode, in boolean deep)
> 
> This means that both "importedNode" and "deep" must not be optional, in the first place. So I think that the right fix to this issue is just to make "deep" a mandatory argument. Are there any concerns about backward compatibility for doing it?

Please look at the current DOM standard (also in $URL):

http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list