[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 02:27:35 PDT 2011
https://bugs.webkit.org/show_bug.cgi?id=67458
--- Comment #5 from Kentaro Hara <haraken at google.com> 2011-09-02 02:27:35 PST ---
Adam and Antonm: The motivation for the change is as follows.
As you can see in V8WebKitCSSMatrixConstructor.cpp, constructorCallback() expects that...
- If the first argument is a DOMString, the corresponding WTF::String is passed to the first argument of WebKitCSSMatrix::create().
- If the first argument is omitted, a null WTF::String (i.e. String()) is passed to the first argument of WebKitCSSMatrix::create().
I first thought that describing 'Constructor(in [Optional=CallWithDefaultValue] DOMString cssValue)' in IDL will generate the code that behaves as above, but it does not. In fact, the generated code behaves...
- If the first argument is a DOMString, the corresponding WTF::String is passed to the first argument of WebKitCSSMatrix::create().
- If the first argument is omitted, a string "undefined" is passed to the first argument of WebKitCSSMatrix::create(). This is because when we execute 'V8Parameter cssValue(args[0])' in the situation where args[0] is omitted, args[0] becomes v8::Undefined(), which will make cssValue.toString() "undefined".
Thus, we need a way to express a null string in V8Parameter (note: V8Parameter is something like an abstraction class for String and AtomicString). The change in V8Binding.h is just doing this.
The same scenario happens in other constructors, such as V8SharedWorker::constructorCallback().
--
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