https://bugs.webkit.org/show_bug.cgi?id=28720
Reviewed by David Levin.
The previous fix r47757 does not handle the V8 object conversion correctly.
* bindings/v8/custom/V8DocumentCustom.cpp:
(WebCore::CALLBACK_FUNC_DECL):
* bindings/v8/custom/V8HTMLCanvasElementCustom.cpp:
(WebCore::CALLBACK_FUNC_DECL):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@47758
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
Reviewed by David Levin.
+ [V8] Fix Canvas layout test failures in Chromium build.
+ https://bugs.webkit.org/show_bug.cgi?id=28720
+
+ The previous fix r47757 does not handle the V8 object conversion correctly.
+
+ * bindings/v8/custom/V8DocumentCustom.cpp:
+ (WebCore::CALLBACK_FUNC_DECL):
+ * bindings/v8/custom/V8HTMLCanvasElementCustom.cpp:
+ (WebCore::CALLBACK_FUNC_DECL):
+
+2009-08-25 Jian Li <jianli@chromium.org>
+
+ Reviewed by David Levin.
+
[V8] Fix compiling errors in Chromium build caused by Canvas3D changes from r47752.
https://bugs.webkit.org/show_bug.cgi?id=28717
#include "config.h"
#include "Document.h"
+#include "CanvasRenderingContext.h"
#include "ExceptionCode.h"
#include "Node.h"
#include "XPathNSResolver.h"
int width = toInt32(args[2]);
int height = toInt32(args[3]);
CanvasRenderingContext* result = imp->getCSSCanvasContext(contextId, name, width, height);
- return V8DOMWrapper::convertToV8Object(V8ClassIndex::CANVASRENDERINGCONTEXT, result);
+ if (result->is2d())
+ return V8DOMWrapper::convertToV8Object(V8ClassIndex::CANVASRENDERINGCONTEXT2D, result);
+ else {
+ // FIXME: Add the conversion to CanvasRenderingContext3D when it is hooked up.
+ ASSERT_NOT_REACHED();
+ return v8::Handle<v8::Value>();
+ }
}
} // namespace WebCore
#include "config.h"
#include "HTMLCanvasElement.h"
+#include "CanvasRenderingContext.h"
#include "V8Binding.h"
#include "V8CustomBinding.h"
#include "V8Node.h"
HTMLCanvasElement* imp = V8DOMWrapper::convertDOMWrapperToNode<HTMLCanvasElement>(holder);
String contextId = toWebCoreString(args[0]);
CanvasRenderingContext* result = imp->getContext(contextId);
- return V8DOMWrapper::convertToV8Object(V8ClassIndex::CANVASRENDERINGCONTEXT, result);
+ if (result->is2d())
+ return V8DOMWrapper::convertToV8Object(V8ClassIndex::CANVASRENDERINGCONTEXT2D, result);
+ else {
+ // FIXME: Add the conversion to CanvasRenderingContext3D when it is hooked up.
+ ASSERT_NOT_REACHED();
+ return v8::Handle<v8::Value>();
+ }
}
} // namespace WebCore