[webkit-dev] why js script" var a = new XMLHttpRequest; ", it's ok; but "var a = new StyleSheet; ", it'll throw an exception?
sukmaillist at gmail.com
Fri Jun 5 01:28:58 PDT 2009
We're trying to extend WebKit dom js binding.We have some questions.
in DOMWindow.idl having the following code:
attribute StyleSheetConstructor StyleSheet;
attribute [JSCCustomGetter] XMLHttpRequestConstructor XMLHttpRequest;
and we find class JSXMLHttpRequestConstructor has function
getConstructData, while JSStyleSheetConstructor doesn't have function
if test the following js script:"var a = new XMLHttpRequest;", it's
ok;but "var a = new StyleSheet;", it'll throw an exception.
and we trac this problem to Interpreter::privateExecute() and
inline ConstructType JSValuePtr::getConstructData(ConstructData&
return JSImmediate::isImmediate(asValue()) ? ConstructTypeNone :
and we know this function returns ConstructTypeNone for
JSStyleSheetConstructor object, ConstructTypeHost for
JSStyleSheetConstructor object and JSXMLHttpRequestConstructor object are
returned by the same template function getDOMConstructor.
our questions are:
1.why it has this return?
2.which codes make the two object have different immediate value?
3.some people can explain the whole role of class JSImmediate?
4.our trac maybe be not correct,who can explain why newing StyleSheet has
exception and newing XMLHttpRequest is OK?
Thanks and Best Regards
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the webkit-dev