From 5d7b4968cc181726b97848bda5684da99e6db312 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Tue, 1 Jun 2010 16:38:48 +0200 Subject: Updated WebKit to 9a83f22bc41a2016b6bbf495bfd32b3a659038c8 Integrated changes: || || [Qt] QtWebkit.pc is broken || || || Bring CanvasRenderingContext2D's createImageData() in line with HTML5 spec || || || Properly handle invalid arguments to CanvasRenderingContext2D's getImageData() and putImageData() || As well as fixes for the qt_webkit_version.pri module installation. --- src/3rdparty/webkit/.tag | 2 +- src/3rdparty/webkit/VERSION | 2 +- src/3rdparty/webkit/WebCore/ChangeLog | 50 ++++++++++++++++++++++ src/3rdparty/webkit/WebCore/WebCore.pro | 7 ++- .../js/JSCanvasRenderingContext2DCustom.cpp | 18 ++++++++ .../generated/JSCanvasRenderingContext2D.cpp | 12 +----- .../WebCore/generated/JSCanvasRenderingContext2D.h | 1 + .../html/canvas/CanvasRenderingContext2D.cpp | 30 +++++++++++-- .../WebCore/html/canvas/CanvasRenderingContext2D.h | 1 + .../html/canvas/CanvasRenderingContext2D.idl | 3 +- 10 files changed, 108 insertions(+), 18 deletions(-) diff --git a/src/3rdparty/webkit/.tag b/src/3rdparty/webkit/.tag index 14be658..cc67d1b 100644 --- a/src/3rdparty/webkit/.tag +++ b/src/3rdparty/webkit/.tag @@ -1 +1 @@ -9a83f22bc41a2016b6bbf495bfd32b3a659038c8 +de1e909b06cbc981d63e0fc0f6a3f84002dd1e80 diff --git a/src/3rdparty/webkit/VERSION b/src/3rdparty/webkit/VERSION index a63a9d1..f37c367 100644 --- a/src/3rdparty/webkit/VERSION +++ b/src/3rdparty/webkit/VERSION @@ -4,4 +4,4 @@ This is a snapshot of the Qt port of WebKit from and has the sha1 checksum - f59a934694947496cedecc5256a71bff60c43c4c + 9a83f22bc41a2016b6bbf495bfd32b3a659038c8 diff --git a/src/3rdparty/webkit/WebCore/ChangeLog b/src/3rdparty/webkit/WebCore/ChangeLog index 246504f..e907167 100644 --- a/src/3rdparty/webkit/WebCore/ChangeLog +++ b/src/3rdparty/webkit/WebCore/ChangeLog @@ -1,3 +1,11 @@ +2010-06-01 Simon Hausmann + + Reviewed by Laszlo Gombos. + + [Qt] Fix installation of the QtWebKit module .pri file when building inside of Qt + + * WebCore.pro: + 2010-06-01 Jocelyn Turcotte Reviewed by Simon Hausmann. @@ -21,6 +29,48 @@ * WebCore.pro: +2010-05-17 Andreas Kling + + Reviewed by Kenneth Rohde Christiansen. + + Bring CanvasRenderingContext2D's createImageData() in line with HTML5 spec + Added createImageData(ImageData) which returns a new ImageData with the same size as the one passed. + Changed createImageData(width, height) to use the absolute values of width and height. + + https://bugs.webkit.org/show_bug.cgi?id=39189 + + Spec link: + http://www.whatwg.org/specs/web-apps/current-work/#dom-context-2d-createimagedata + + Test: fast/canvas/canvas-createImageData.html + + * bindings/js/JSCanvasRenderingContext2DCustom.cpp: + (WebCore::JSCanvasRenderingContext2D::createImageData): + * html/canvas/CanvasRenderingContext2D.cpp: + (WebCore::CanvasRenderingContext2D::createImageData): + * html/canvas/CanvasRenderingContext2D.h: + * html/canvas/CanvasRenderingContext2D.idl: + +2010-05-16 Andreas Kling + + Reviewed by Kenneth Rohde Christiansen. + + Properly handle invalid arguments to CanvasRenderingContext2D's getImageData() and putImageData(). + Both should throw NOT_SUPPORTED_ERR when called with nonfinite arguments. + getImageData() should throw INDEX_SIZE_ERR if either width or height is 0. + + https://bugs.webkit.org/show_bug.cgi?id=39175 + + Spec link: + http://www.whatwg.org/specs/web-apps/current-work/#pixel-manipulation + + Test: fast/canvas/canvas-getImageData-invalid.html + + * html/canvas/CanvasRenderingContext2D.cpp: + (WebCore::CanvasRenderingContext2D::createImageData): + (WebCore::CanvasRenderingContext2D::getImageData): + (WebCore::CanvasRenderingContext2D::putImageData): + 2010-05-31 Oswald Buddenhagen Reviewed by Simon Hausmann. diff --git a/src/3rdparty/webkit/WebCore/WebCore.pro b/src/3rdparty/webkit/WebCore/WebCore.pro index f2671fb..2a1536c 100644 --- a/src/3rdparty/webkit/WebCore/WebCore.pro +++ b/src/3rdparty/webkit/WebCore/WebCore.pro @@ -2841,7 +2841,12 @@ contains(DEFINES, ENABLE_SYMBIAN_DIALOG_PROVIDERS) { include($$PWD/../WebKit/qt/Api/headers.pri) HEADERS += $$WEBKIT_API_HEADERS -!CONFIG(QTDIR_build) { +CONFIG(QTDIR_build) { + modfile.files = $$moduleFile + modfile.path = $$[QMAKE_MKSPECS]/modules + + INSTALLS += modfile +} else { exists($$OUTPUT_DIR/include/QtWebKit/classheaders.pri): include($$OUTPUT_DIR/include/QtWebKit/classheaders.pri) WEBKIT_INSTALL_HEADERS = $$WEBKIT_API_HEADERS $$WEBKIT_CLASS_HEADERS diff --git a/src/3rdparty/webkit/WebCore/bindings/js/JSCanvasRenderingContext2DCustom.cpp b/src/3rdparty/webkit/WebCore/bindings/js/JSCanvasRenderingContext2DCustom.cpp index a271923..0254d0f 100644 --- a/src/3rdparty/webkit/WebCore/bindings/js/JSCanvasRenderingContext2DCustom.cpp +++ b/src/3rdparty/webkit/WebCore/bindings/js/JSCanvasRenderingContext2DCustom.cpp @@ -361,6 +361,24 @@ JSValue JSCanvasRenderingContext2D::createPattern(ExecState* exec, const ArgList return jsUndefined(); } +JSValue JSCanvasRenderingContext2D::createImageData(ExecState* exec, const ArgList& args) +{ + // createImageData has two variants + // createImageData(ImageData) + // createImageData(width, height) + CanvasRenderingContext2D* context = static_cast(impl()); + RefPtr imageData = 0; + + ExceptionCode ec = 0; + if (args.size() == 1) + imageData = context->createImageData(toImageData(args.at(0)), ec); + else if (args.size() == 2) + imageData = context->createImageData(args.at(0).toFloat(exec), args.at(1).toFloat(exec), ec); + + setDOMException(exec, ec); + return toJS(exec, globalObject(), WTF::getPtr(imageData)); +} + JSValue JSCanvasRenderingContext2D::putImageData(ExecState* exec, const ArgList& args) { // putImageData has two variants diff --git a/src/3rdparty/webkit/WebCore/generated/JSCanvasRenderingContext2D.cpp b/src/3rdparty/webkit/WebCore/generated/JSCanvasRenderingContext2D.cpp index a991e8d..d97b54a 100644 --- a/src/3rdparty/webkit/WebCore/generated/JSCanvasRenderingContext2D.cpp +++ b/src/3rdparty/webkit/WebCore/generated/JSCanvasRenderingContext2D.cpp @@ -165,7 +165,7 @@ static const HashTableValue JSCanvasRenderingContext2DPrototypeTableValues[45] = { "drawImageFromRect", DontDelete|Function, (intptr_t)static_cast(jsCanvasRenderingContext2DPrototypeFunctionDrawImageFromRect), (intptr_t)0 }, { "setShadow", DontDelete|Function, (intptr_t)static_cast(jsCanvasRenderingContext2DPrototypeFunctionSetShadow), (intptr_t)0 }, { "createPattern", DontDelete|Function, (intptr_t)static_cast(jsCanvasRenderingContext2DPrototypeFunctionCreatePattern), (intptr_t)0 }, - { "createImageData", DontDelete|Function, (intptr_t)static_cast(jsCanvasRenderingContext2DPrototypeFunctionCreateImageData), (intptr_t)2 }, + { "createImageData", DontDelete|Function, (intptr_t)static_cast(jsCanvasRenderingContext2DPrototypeFunctionCreateImageData), (intptr_t)0 }, { "getImageData", DontDelete|Function, (intptr_t)static_cast(jsCanvasRenderingContext2DPrototypeFunctionGetImageData), (intptr_t)4 }, { "putImageData", DontDelete|Function, (intptr_t)static_cast(jsCanvasRenderingContext2DPrototypeFunctionPutImageData), (intptr_t)0 }, { 0, 0, 0, 0 } @@ -1018,15 +1018,7 @@ JSValue JSC_HOST_CALL jsCanvasRenderingContext2DPrototypeFunctionCreateImageData if (!thisValue.inherits(&JSCanvasRenderingContext2D::s_info)) return throwError(exec, TypeError); JSCanvasRenderingContext2D* castedThisObj = static_cast(asObject(thisValue)); - CanvasRenderingContext2D* imp = static_cast(castedThisObj->impl()); - ExceptionCode ec = 0; - float sw = args.at(0).toFloat(exec); - float sh = args.at(1).toFloat(exec); - - - JSC::JSValue result = toJS(exec, castedThisObj->globalObject(), WTF::getPtr(imp->createImageData(sw, sh, ec))); - setDOMException(exec, ec); - return result; + return castedThisObj->createImageData(exec, args); } JSValue JSC_HOST_CALL jsCanvasRenderingContext2DPrototypeFunctionGetImageData(ExecState* exec, JSObject*, JSValue thisValue, const ArgList& args) diff --git a/src/3rdparty/webkit/WebCore/generated/JSCanvasRenderingContext2D.h b/src/3rdparty/webkit/WebCore/generated/JSCanvasRenderingContext2D.h index 218e455..92fabb7 100644 --- a/src/3rdparty/webkit/WebCore/generated/JSCanvasRenderingContext2D.h +++ b/src/3rdparty/webkit/WebCore/generated/JSCanvasRenderingContext2D.h @@ -61,6 +61,7 @@ public: JSC::JSValue drawImageFromRect(JSC::ExecState*, const JSC::ArgList&); JSC::JSValue setShadow(JSC::ExecState*, const JSC::ArgList&); JSC::JSValue createPattern(JSC::ExecState*, const JSC::ArgList&); + JSC::JSValue createImageData(JSC::ExecState*, const JSC::ArgList&); JSC::JSValue putImageData(JSC::ExecState*, const JSC::ArgList&); protected: static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | Base::StructureFlags; diff --git a/src/3rdparty/webkit/WebCore/html/canvas/CanvasRenderingContext2D.cpp b/src/3rdparty/webkit/WebCore/html/canvas/CanvasRenderingContext2D.cpp index 398e4d8..9cec7a9 100644 --- a/src/3rdparty/webkit/WebCore/html/canvas/CanvasRenderingContext2D.cpp +++ b/src/3rdparty/webkit/WebCore/html/canvas/CanvasRenderingContext2D.cpp @@ -1278,14 +1278,30 @@ static PassRefPtr createEmptyImageData(const IntSize& size) return data.get(); } +PassRefPtr CanvasRenderingContext2D::createImageData(PassRefPtr imageData, ExceptionCode& ec) const +{ + if (!imageData) { + ec = NOT_SUPPORTED_ERR; + return 0; + } + + IntSize size(imageData->width(), imageData->height()); + return createEmptyImageData(size); +} + PassRefPtr CanvasRenderingContext2D::createImageData(float sw, float sh, ExceptionCode& ec) const { ec = 0; + if (!sw || !sh) { + ec = INDEX_SIZE_ERR; + return 0; + } if (!isfinite(sw) || !isfinite(sh)) { ec = NOT_SUPPORTED_ERR; return 0; } - FloatSize unscaledSize(sw, sh); + + FloatSize unscaledSize(fabs(sw), fabs(sh)); IntSize scaledSize = canvas()->convertLogicalToDevice(unscaledSize); if (scaledSize.width() < 1) scaledSize.setWidth(1); @@ -1301,7 +1317,15 @@ PassRefPtr CanvasRenderingContext2D::getImageData(float sx, float sy, ec = SECURITY_ERR; return 0; } - + if (!sw || !sh) { + ec = INDEX_SIZE_ERR; + return 0; + } + if (!isfinite(sx) || !isfinite(sy) || !isfinite(sw) || !isfinite(sh)) { + ec = NOT_SUPPORTED_ERR; + return 0; + } + FloatRect unscaledRect(sx, sy, sw, sh); IntRect scaledRect = canvas()->convertLogicalToDevice(unscaledRect); if (scaledRect.width() < 1) @@ -1332,7 +1356,7 @@ void CanvasRenderingContext2D::putImageData(ImageData* data, float dx, float dy, } if (!isfinite(dx) || !isfinite(dy) || !isfinite(dirtyX) || !isfinite(dirtyY) || !isfinite(dirtyWidth) || !isfinite(dirtyHeight)) { - ec = INDEX_SIZE_ERR; + ec = NOT_SUPPORTED_ERR; return; } diff --git a/src/3rdparty/webkit/WebCore/html/canvas/CanvasRenderingContext2D.h b/src/3rdparty/webkit/WebCore/html/canvas/CanvasRenderingContext2D.h index 553ffd2..2220f7e 100644 --- a/src/3rdparty/webkit/WebCore/html/canvas/CanvasRenderingContext2D.h +++ b/src/3rdparty/webkit/WebCore/html/canvas/CanvasRenderingContext2D.h @@ -178,6 +178,7 @@ namespace WebCore { PassRefPtr createPattern(HTMLImageElement*, const String& repetitionType, ExceptionCode&); PassRefPtr createPattern(HTMLCanvasElement*, const String& repetitionType, ExceptionCode&); + PassRefPtr createImageData(PassRefPtr imageData, ExceptionCode&) const; PassRefPtr createImageData(float width, float height, ExceptionCode&) const; PassRefPtr getImageData(float sx, float sy, float sw, float sh, ExceptionCode&) const; void putImageData(ImageData*, float dx, float dy, ExceptionCode&); diff --git a/src/3rdparty/webkit/WebCore/html/canvas/CanvasRenderingContext2D.idl b/src/3rdparty/webkit/WebCore/html/canvas/CanvasRenderingContext2D.idl index f93a752..3f7ead7 100644 --- a/src/3rdparty/webkit/WebCore/html/canvas/CanvasRenderingContext2D.idl +++ b/src/3rdparty/webkit/WebCore/html/canvas/CanvasRenderingContext2D.idl @@ -105,13 +105,12 @@ module html { [Custom] void drawImageFromRect(/* 10 */); [Custom] void setShadow(/* 3 */); [Custom] void createPattern(/* 2 */); + [Custom] ImageData createImageData(/* 3 */); attribute [Custom] custom strokeStyle; attribute [Custom] custom fillStyle; // pixel manipulation - ImageData createImageData(in float sw, in float sh) - raises (DOMException); ImageData getImageData(in float sx, in float sy, in float sw, in float sh) raises(DOMException); [Custom] void putImageData(/* in ImageData imagedata, in float dx, in float dy [, in float dirtyX, in float dirtyY, in float dirtyWidth, in float dirtyHeight] */); -- cgit v0.12