haikuwebkit/Source/WebCore/html/ImageBitmapOptions.idl

39 lines
1.9 KiB
Plaintext
Raw Permalink Normal View History

ImageBitmap API stubs https://bugs.webkit.org/show_bug.cgi?id=177984 <rdar://problem/34848023> Patch by Sam and Dean. Reviewed by Dean and Sam. Source/WebCore: Add the IDL for ImageBitmap and ImageBitmapOptions, plus some stub implementations (complete with all the algorithms from the HTML specification as comments). * CMakeLists.txt: Add the new files. * DerivedSources.make: Create the JS bindings for ImageBitmap and ImageBitmapOptions. * WebCore.xcodeproj/project.pbxproj: * bindings/js/CallTracerTypes.h: * html/ImageBitmap.cpp: Added. (WebCore::ImageBitmap::create): (WebCore::ImageBitmap::createPromise): (WebCore::ImageBitmap::ImageBitmap): (WebCore::ImageBitmap::~ImageBitmap): (WebCore::ImageBitmap::width const): (WebCore::ImageBitmap::height const): (WebCore::ImageBitmap::close): * html/ImageBitmap.h: Added. (WebCore::ImageBitmap::isDetached const): * html/ImageBitmap.idl: Copied from Source/WebCore/html/canvas/CanvasDrawImage.idl. * html/ImageBitmapOptions.h: Copied from Source/WebCore/html/canvas/CanvasDrawImage.idl. * html/ImageBitmapOptions.idl: Copied from Source/WebCore/html/canvas/CanvasDrawImage.idl. * html/canvas/CanvasDrawImage.idl: * html/canvas/CanvasFillStrokeStyles.idl: * html/canvas/CanvasRenderingContext2D.cpp: (WebCore::size): (WebCore::CanvasRenderingContext2D::drawImage): (WebCore::CanvasRenderingContext2D::createPattern): * html/canvas/CanvasRenderingContext2D.h: * inspector/InspectorCanvas.cpp: (WebCore::InspectorCanvas::indexForData): (WebCore::InspectorCanvas::buildAction): (WebCore::InspectorCanvas::buildArrayForImageBitmap): * inspector/InspectorCanvas.h: * inspector/RecordingSwizzleTypes.h: LayoutTests: New global constructors, so go through the pain of updating all the platform results :( * js/dom/global-constructors-attributes-expected.txt: * platform/gtk/js/dom/global-constructors-attributes-expected.txt: * platform/mac-elcapitan-wk2/js/dom/global-constructors-attributes-expected.txt: * platform/mac-elcapitan/js/dom/global-constructors-attributes-expected.txt: * platform/mac-sierra-wk2/js/dom/global-constructors-attributes-expected.txt: * platform/mac-sierra/js/dom/global-constructors-attributes-expected.txt: * platform/mac-wk1/js/dom/global-constructors-attributes-expected.txt: * platform/mac-wk2/js/dom/global-constructors-attributes-expected.txt: * platform/mac-yosemite/js/dom/global-constructors-attributes-expected.txt: * platform/mac/js/dom/global-constructors-attributes-expected.txt: * platform/win/js/dom/global-constructors-attributes-expected.txt: * platform/wpe/js/dom/global-constructors-attributes-expected.txt: Canonical link: https://commits.webkit.org/194258@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@222986 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-10-06 16:51:47 +00:00
/*
* Copyright (C) 2017 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*/
enum ImageOrientation { "none", "flipY" };
enum PremultiplyAlpha { "none", "premultiply", "default" };
enum ColorSpaceConversion { "none", "default" };
enum ResizeQuality { "pixelated", "low", "medium", "high" };
dictionary ImageBitmapOptions {
ImageOrientation imageOrientation = "none";
PremultiplyAlpha premultiplyAlpha = "default";
ColorSpaceConversion colorSpaceConversion = "default";
[EnforceRange] unsigned long resizeWidth;
[EnforceRange] unsigned long resizeHeight;
ResizeQuality resizeQuality = "low";
};