[Webkit-unassigned] [Bug 67458] Generate a WebKitCSSMatrix constructor of V8 using the IDL 'Constructor' extended attribute

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Sep 2 11:22:04 PDT 2011


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





--- Comment #11 from anton muhin <antonm at chromium.org>  2011-09-02 11:22:03 PST ---
(In reply to comment #8)
> (In reply to comment #6)
> > (From update of attachment 106074 [details] [details])
> > View in context: https://bugs.webkit.org/attachment.cgi?id=106074&action=review
> > 
> > Overall, won't WithUndefinedOrNullCheck attribute do what you are looking for?
> > 
> > In general I am not sure (but I didn't check) that the current implementation correctly processes null, but if your policy regarding null is different, 
> 
> No.
> 
> First of all, as far as I see the current implementation of V8WebKitCSSMatrixConstructor.cpp, the IDL of the WebKitCSSMatrix constructor should be Constructor(optional DOMString string), although there is no spec for the IDL since WebKitCSSMatrix is WebKit-specific. 
> 
> Given that we assume the IDL, the expected behavior is as follows (The spec is here: http://www.w3.org/TR/WebIDL/#es-DOMString):
> 
> - WebKitCSSMatrix() -> a null string is passed to WebKitCSSMatrix::create().
> - WebKitCSSMatrix(null) -> a string "null" is passed to WebKitCSSMatrix::create().
> - WebKitCSSMatrix(undefined) -> a string "undefined" is passed to WebKitCSSMatrix::create().
> 
> On the other hand, WithUndefinedOrNullCheck behaves as follows:
> 
> - WebKitCSSMatrix() -> a string "undefined" is passed to WebKitCSSMatrix::create().
> - WebKitCSSMatrix(null) -> a null string is passed to WebKitCSSMatrix::create().
> - WebKitCSSMatrix(undefined) -> a null string is passed to WebKitCSSMatrix::create().

This strikes me as very un-JSy: in JS foo() and foo(undefined) is almost indistingishable and it appears sketchy to me distingish between those in DOM.

> 
> > I would still suggest adding another policy to V8Parameter instead of brand-new attribute.
> 
> I guess that adding another policy would not solve this problem. The essence is that in the current implementation there is no way to create a V8Parameter object that expresses a null String (or AtomicString). This patch enables to create the V8Parameter object that expresses a null String.

If by null string you mean result of String() (or isNull()), then apparently V8Parameter<WithNullCheck> and V8Parameter<WithUndefinedOrNullCheck> provide exactly null strings in the proper conditions.  If you really like (but I honestly find it pretty much unJSy), you can implement <WithEmptyCheck> which will give you exactly your semantics.

> 
> 
> > And probably add a test to see what happens with new WebKitCSSMatrix(null)
> 
> Added it to custom-constructors.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