Changeset 222986 in webkit


Ignore:
Timestamp:
Oct 6, 2017, 9:51:47 AM (8 years ago)
Author:
dino@apple.com
Message:

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:
Location:
trunk
Files:
2 added
26 edited
3 copied

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r222980 r222986  
     12017-10-05  Dean Jackson  <dino@apple.com>
     2
     3        ImageBitmap API stubs
     4        https://bugs.webkit.org/show_bug.cgi?id=177984
     5        <rdar://problem/34848023>
     6
     7        Patch by Sam and Dean.
     8        Reviewed by Dean and Sam.
     9
     10        New global constructors, so go through the pain of updating all
     11        the platform results :(
     12
     13        * js/dom/global-constructors-attributes-expected.txt:
     14        * platform/gtk/js/dom/global-constructors-attributes-expected.txt:
     15        * platform/mac-elcapitan-wk2/js/dom/global-constructors-attributes-expected.txt:
     16        * platform/mac-elcapitan/js/dom/global-constructors-attributes-expected.txt:
     17        * platform/mac-sierra-wk2/js/dom/global-constructors-attributes-expected.txt:
     18        * platform/mac-sierra/js/dom/global-constructors-attributes-expected.txt:
     19        * platform/mac-wk1/js/dom/global-constructors-attributes-expected.txt:
     20        * platform/mac-wk2/js/dom/global-constructors-attributes-expected.txt:
     21        * platform/mac-yosemite/js/dom/global-constructors-attributes-expected.txt:
     22        * platform/mac/js/dom/global-constructors-attributes-expected.txt:
     23        * platform/win/js/dom/global-constructors-attributes-expected.txt:
     24        * platform/wpe/js/dom/global-constructors-attributes-expected.txt:
     25
    1262017-10-06  Brady Eidson  <beidson@apple.com>
    227
  • trunk/LayoutTests/js/dom/global-constructors-attributes-dedicated-worker-expected.txt

    r222692 r222986  
    190190PASS [Worker] Object.getOwnPropertyDescriptor(global, 'Headers').enumerable is false
    191191PASS [Worker] Object.getOwnPropertyDescriptor(global, 'Headers').configurable is true
     192PASS [Worker] Object.getOwnPropertyDescriptor(global, 'ImageBitmap').value is ImageBitmap
     193PASS [Worker] Object.getOwnPropertyDescriptor(global, 'ImageBitmap').hasOwnProperty('get') is false
     194PASS [Worker] Object.getOwnPropertyDescriptor(global, 'ImageBitmap').hasOwnProperty('set') is false
     195PASS [Worker] Object.getOwnPropertyDescriptor(global, 'ImageBitmap').enumerable is false
     196PASS [Worker] Object.getOwnPropertyDescriptor(global, 'ImageBitmap').configurable is true
    192197PASS [Worker] Object.getOwnPropertyDescriptor(global, 'ImageData').value is ImageData
    193198PASS [Worker] Object.getOwnPropertyDescriptor(global, 'ImageData').hasOwnProperty('get') is false
  • trunk/LayoutTests/js/dom/global-constructors-attributes-expected.txt

    r219729 r222986  
    824824PASS Object.getOwnPropertyDescriptor(global, 'Image').enumerable is false
    825825PASS Object.getOwnPropertyDescriptor(global, 'Image').configurable is true
     826PASS Object.getOwnPropertyDescriptor(global, 'ImageBitmap').value is ImageBitmap
     827PASS Object.getOwnPropertyDescriptor(global, 'ImageBitmap').hasOwnProperty('get') is false
     828PASS Object.getOwnPropertyDescriptor(global, 'ImageBitmap').hasOwnProperty('set') is false
     829PASS Object.getOwnPropertyDescriptor(global, 'ImageBitmap').enumerable is false
     830PASS Object.getOwnPropertyDescriptor(global, 'ImageBitmap').configurable is true
    826831PASS Object.getOwnPropertyDescriptor(global, 'ImageData').value is ImageData
    827832PASS Object.getOwnPropertyDescriptor(global, 'ImageData').hasOwnProperty('get') is false
  • trunk/LayoutTests/platform/gtk/js/dom/global-constructors-attributes-expected.txt

    r222909 r222986  
    984984PASS Object.getOwnPropertyDescriptor(global, 'Image').enumerable is false
    985985PASS Object.getOwnPropertyDescriptor(global, 'Image').configurable is true
     986PASS Object.getOwnPropertyDescriptor(global, 'ImageBitmap').value is ImageBitmap
     987PASS Object.getOwnPropertyDescriptor(global, 'ImageBitmap').hasOwnProperty('get') is false
     988PASS Object.getOwnPropertyDescriptor(global, 'ImageBitmap').hasOwnProperty('set') is false
     989PASS Object.getOwnPropertyDescriptor(global, 'ImageBitmap').enumerable is false
     990PASS Object.getOwnPropertyDescriptor(global, 'ImageBitmap').configurable is true
    986991PASS Object.getOwnPropertyDescriptor(global, 'ImageData').value is ImageData
    987992PASS Object.getOwnPropertyDescriptor(global, 'ImageData').hasOwnProperty('get') is false
  • trunk/LayoutTests/platform/mac-elcapitan-wk2/js/dom/global-constructors-attributes-expected.txt

    r222979 r222986  
    999999PASS Object.getOwnPropertyDescriptor(global, 'Image').enumerable is false
    10001000PASS Object.getOwnPropertyDescriptor(global, 'Image').configurable is true
     1001PASS Object.getOwnPropertyDescriptor(global, 'ImageBitmap').value is ImageBitmap
     1002PASS Object.getOwnPropertyDescriptor(global, 'ImageBitmap').hasOwnProperty('get') is false
     1003PASS Object.getOwnPropertyDescriptor(global, 'ImageBitmap').hasOwnProperty('set') is false
     1004PASS Object.getOwnPropertyDescriptor(global, 'ImageBitmap').enumerable is false
     1005PASS Object.getOwnPropertyDescriptor(global, 'ImageBitmap').configurable is true
    10011006PASS Object.getOwnPropertyDescriptor(global, 'ImageData').value is ImageData
    10021007PASS Object.getOwnPropertyDescriptor(global, 'ImageData').hasOwnProperty('get') is false
  • trunk/LayoutTests/platform/mac-elcapitan/js/dom/global-constructors-attributes-expected.txt

    r220782 r222986  
    959959PASS Object.getOwnPropertyDescriptor(global, 'Image').enumerable is false
    960960PASS Object.getOwnPropertyDescriptor(global, 'Image').configurable is true
     961PASS Object.getOwnPropertyDescriptor(global, 'ImageBitmap').value is ImageBitmap
     962PASS Object.getOwnPropertyDescriptor(global, 'ImageBitmap').hasOwnProperty('get') is false
     963PASS Object.getOwnPropertyDescriptor(global, 'ImageBitmap').hasOwnProperty('set') is false
     964PASS Object.getOwnPropertyDescriptor(global, 'ImageBitmap').enumerable is false
     965PASS Object.getOwnPropertyDescriptor(global, 'ImageBitmap').configurable is true
    961966PASS Object.getOwnPropertyDescriptor(global, 'ImageData').value is ImageData
    962967PASS Object.getOwnPropertyDescriptor(global, 'ImageData').hasOwnProperty('get') is false
  • trunk/LayoutTests/platform/mac-sierra-wk1/js/dom/global-constructors-attributes-expected.txt

    r222753 r222986  
    989989PASS Object.getOwnPropertyDescriptor(global, 'Image').enumerable is false
    990990PASS Object.getOwnPropertyDescriptor(global, 'Image').configurable is true
     991PASS Object.getOwnPropertyDescriptor(global, 'ImageBitmap').value is ImageBitmap
     992PASS Object.getOwnPropertyDescriptor(global, 'ImageBitmap').hasOwnProperty('get') is false
     993PASS Object.getOwnPropertyDescriptor(global, 'ImageBitmap').hasOwnProperty('set') is false
     994PASS Object.getOwnPropertyDescriptor(global, 'ImageBitmap').enumerable is false
     995PASS Object.getOwnPropertyDescriptor(global, 'ImageBitmap').configurable is true
    991996PASS Object.getOwnPropertyDescriptor(global, 'ImageData').value is ImageData
    992997PASS Object.getOwnPropertyDescriptor(global, 'ImageData').hasOwnProperty('get') is false
  • trunk/LayoutTests/platform/mac-sierra/js/dom/global-constructors-attributes-expected.txt

    r222979 r222986  
    10041004PASS Object.getOwnPropertyDescriptor(global, 'Image').enumerable is false
    10051005PASS Object.getOwnPropertyDescriptor(global, 'Image').configurable is true
     1006PASS Object.getOwnPropertyDescriptor(global, 'ImageBitmap').value is ImageBitmap
     1007PASS Object.getOwnPropertyDescriptor(global, 'ImageBitmap').hasOwnProperty('get') is false
     1008PASS Object.getOwnPropertyDescriptor(global, 'ImageBitmap').hasOwnProperty('set') is false
     1009PASS Object.getOwnPropertyDescriptor(global, 'ImageBitmap').enumerable is false
     1010PASS Object.getOwnPropertyDescriptor(global, 'ImageBitmap').configurable is true
    10061011PASS Object.getOwnPropertyDescriptor(global, 'ImageData').value is ImageData
    10071012PASS Object.getOwnPropertyDescriptor(global, 'ImageData').hasOwnProperty('get') is false
  • trunk/LayoutTests/platform/mac-wk1/js/dom/global-constructors-attributes-dedicated-worker-expected.txt

    r222722 r222986  
    180180PASS [Worker] Object.getOwnPropertyDescriptor(global, 'Headers').enumerable is false
    181181PASS [Worker] Object.getOwnPropertyDescriptor(global, 'Headers').configurable is true
     182PASS [Worker] Object.getOwnPropertyDescriptor(global, 'ImageBitmap').value is ImageBitmap
     183PASS [Worker] Object.getOwnPropertyDescriptor(global, 'ImageBitmap').hasOwnProperty('get') is false
     184PASS [Worker] Object.getOwnPropertyDescriptor(global, 'ImageBitmap').hasOwnProperty('set') is false
     185PASS [Worker] Object.getOwnPropertyDescriptor(global, 'ImageBitmap').enumerable is false
     186PASS [Worker] Object.getOwnPropertyDescriptor(global, 'ImageBitmap').configurable is true
    182187PASS [Worker] Object.getOwnPropertyDescriptor(global, 'ImageData').value is ImageData
    183188PASS [Worker] Object.getOwnPropertyDescriptor(global, 'ImageData').hasOwnProperty('get') is false
  • trunk/LayoutTests/platform/mac-wk1/js/dom/global-constructors-attributes-expected.txt

    r222753 r222986  
    994994PASS Object.getOwnPropertyDescriptor(global, 'Image').enumerable is false
    995995PASS Object.getOwnPropertyDescriptor(global, 'Image').configurable is true
     996PASS Object.getOwnPropertyDescriptor(global, 'ImageBitmap').value is ImageBitmap
     997PASS Object.getOwnPropertyDescriptor(global, 'ImageBitmap').hasOwnProperty('get') is false
     998PASS Object.getOwnPropertyDescriptor(global, 'ImageBitmap').hasOwnProperty('set') is false
     999PASS Object.getOwnPropertyDescriptor(global, 'ImageBitmap').enumerable is false
     1000PASS Object.getOwnPropertyDescriptor(global, 'ImageBitmap').configurable is true
    9961001PASS Object.getOwnPropertyDescriptor(global, 'ImageData').value is ImageData
    9971002PASS Object.getOwnPropertyDescriptor(global, 'ImageData').hasOwnProperty('get') is false
  • trunk/LayoutTests/platform/mac-yosemite/js/dom/global-constructors-attributes-expected.txt

    r219729 r222986  
    944944PASS Object.getOwnPropertyDescriptor(global, 'Image').enumerable is false
    945945PASS Object.getOwnPropertyDescriptor(global, 'Image').configurable is true
     946PASS Object.getOwnPropertyDescriptor(global, 'ImageBitmap').value is ImageBitmap
     947PASS Object.getOwnPropertyDescriptor(global, 'ImageBitmap').hasOwnProperty('get') is false
     948PASS Object.getOwnPropertyDescriptor(global, 'ImageBitmap').hasOwnProperty('set') is false
     949PASS Object.getOwnPropertyDescriptor(global, 'ImageBitmap').enumerable is false
     950PASS Object.getOwnPropertyDescriptor(global, 'ImageBitmap').configurable is true
    946951PASS Object.getOwnPropertyDescriptor(global, 'ImageData').value is ImageData
    947952PASS Object.getOwnPropertyDescriptor(global, 'ImageData').hasOwnProperty('get') is false
  • trunk/LayoutTests/platform/mac/js/dom/global-constructors-attributes-expected.txt

    r222979 r222986  
    10091009PASS Object.getOwnPropertyDescriptor(global, 'Image').enumerable is false
    10101010PASS Object.getOwnPropertyDescriptor(global, 'Image').configurable is true
     1011PASS Object.getOwnPropertyDescriptor(global, 'ImageBitmap').value is ImageBitmap
     1012PASS Object.getOwnPropertyDescriptor(global, 'ImageBitmap').hasOwnProperty('get') is false
     1013PASS Object.getOwnPropertyDescriptor(global, 'ImageBitmap').hasOwnProperty('set') is false
     1014PASS Object.getOwnPropertyDescriptor(global, 'ImageBitmap').enumerable is false
     1015PASS Object.getOwnPropertyDescriptor(global, 'ImageBitmap').configurable is true
    10111016PASS Object.getOwnPropertyDescriptor(global, 'ImageData').value is ImageData
    10121017PASS Object.getOwnPropertyDescriptor(global, 'ImageData').hasOwnProperty('get') is false
  • trunk/LayoutTests/platform/win/js/dom/global-constructors-attributes-expected.txt

    r219729 r222986  
    749749PASS Object.getOwnPropertyDescriptor(global, 'Image').enumerable is false
    750750PASS Object.getOwnPropertyDescriptor(global, 'Image').configurable is true
     751PASS Object.getOwnPropertyDescriptor(global, 'ImageBitmap').value is ImageBitmap
     752PASS Object.getOwnPropertyDescriptor(global, 'ImageBitmap').hasOwnProperty('get') is false
     753PASS Object.getOwnPropertyDescriptor(global, 'ImageBitmap').hasOwnProperty('set') is false
     754PASS Object.getOwnPropertyDescriptor(global, 'ImageBitmap').enumerable is false
     755PASS Object.getOwnPropertyDescriptor(global, 'ImageBitmap').configurable is true
    751756PASS Object.getOwnPropertyDescriptor(global, 'ImageData').value is ImageData
    752757PASS Object.getOwnPropertyDescriptor(global, 'ImageData').hasOwnProperty('get') is false
  • trunk/LayoutTests/platform/wpe/js/dom/global-constructors-attributes-expected.txt

    r222087 r222986  
    979979PASS Object.getOwnPropertyDescriptor(global, 'Image').enumerable is false
    980980PASS Object.getOwnPropertyDescriptor(global, 'Image').configurable is true
     981PASS Object.getOwnPropertyDescriptor(global, 'ImageBitmap').value is ImageBitmap
     982PASS Object.getOwnPropertyDescriptor(global, 'ImageBitmap').hasOwnProperty('get') is false
     983PASS Object.getOwnPropertyDescriptor(global, 'ImageBitmap').hasOwnProperty('set') is false
     984PASS Object.getOwnPropertyDescriptor(global, 'ImageBitmap').enumerable is false
     985PASS Object.getOwnPropertyDescriptor(global, 'ImageBitmap').configurable is true
    981986PASS Object.getOwnPropertyDescriptor(global, 'ImageData').value is ImageData
    982987PASS Object.getOwnPropertyDescriptor(global, 'ImageData').hasOwnProperty('get') is false
  • trunk/Source/WebCore/CMakeLists.txt

    r222960 r222986  
    680680    html/HTMLUnknownElement.idl
    681681    html/HTMLVideoElement.idl
     682    html/ImageBitmap.idl
     683    html/ImageBitmapOptions.idl
    682684    html/ImageData.idl
    683685    html/MediaController.idl
     
    19391941    html/HTMLWBRElement.cpp
    19401942    html/HiddenInputType.cpp
     1943    html/ImageBitmap.cpp
    19411944    html/ImageData.cpp
    19421945    html/ImageDocument.cpp
  • trunk/Source/WebCore/ChangeLog

    r222985 r222986  
     12017-10-05  Dean Jackson  <dino@apple.com>
     2
     3        ImageBitmap API stubs
     4        https://bugs.webkit.org/show_bug.cgi?id=177984
     5        <rdar://problem/34848023>
     6
     7        Patch by Sam and Dean.
     8        Reviewed by Dean and Sam.
     9
     10        Add the IDL for ImageBitmap and ImageBitmapOptions, plus some
     11        stub implementations (complete with all the algorithms from
     12        the HTML specification as comments).
     13
     14        * CMakeLists.txt: Add the new files.
     15        * DerivedSources.make: Create the JS bindings for ImageBitmap and ImageBitmapOptions.
     16        * WebCore.xcodeproj/project.pbxproj:
     17        * bindings/js/CallTracerTypes.h:
     18        * html/ImageBitmap.cpp: Added.
     19        (WebCore::ImageBitmap::create):
     20        (WebCore::ImageBitmap::createPromise):
     21        (WebCore::ImageBitmap::ImageBitmap):
     22        (WebCore::ImageBitmap::~ImageBitmap):
     23        (WebCore::ImageBitmap::width const):
     24        (WebCore::ImageBitmap::height const):
     25        (WebCore::ImageBitmap::close):
     26        * html/ImageBitmap.h: Added.
     27        (WebCore::ImageBitmap::isDetached const):
     28        * html/ImageBitmap.idl: Copied from Source/WebCore/html/canvas/CanvasDrawImage.idl.
     29        * html/ImageBitmapOptions.h: Copied from Source/WebCore/html/canvas/CanvasDrawImage.idl.
     30        * html/ImageBitmapOptions.idl: Copied from Source/WebCore/html/canvas/CanvasDrawImage.idl.
     31        * html/canvas/CanvasDrawImage.idl:
     32        * html/canvas/CanvasFillStrokeStyles.idl:
     33        * html/canvas/CanvasRenderingContext2D.cpp:
     34        (WebCore::size):
     35        (WebCore::CanvasRenderingContext2D::drawImage):
     36        (WebCore::CanvasRenderingContext2D::createPattern):
     37        * html/canvas/CanvasRenderingContext2D.h:
     38        * inspector/InspectorCanvas.cpp:
     39        (WebCore::InspectorCanvas::indexForData):
     40        (WebCore::InspectorCanvas::buildAction):
     41        (WebCore::InspectorCanvas::buildArrayForImageBitmap):
     42        * inspector/InspectorCanvas.h:
     43        * inspector/RecordingSwizzleTypes.h:
     44
    1452017-10-06  Ms2ger  <Ms2ger@igalia.com>
    246
  • trunk/Source/WebCore/DerivedSources.make

    r222921 r222986  
    597597    $(WebCore)/html/HTMLUnknownElement.idl \
    598598    $(WebCore)/html/HTMLVideoElement.idl \
     599    $(WebCore)/html/ImageBitmap.idl \
     600    $(WebCore)/html/ImageBitmapOptions.idl \
    599601    $(WebCore)/html/ImageData.idl \
    600602    $(WebCore)/html/MediaController.idl \
  • trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj

    r222980 r222986  
    15621562                31C0FF3F0E4CEFAC007D6FE5 /* JSWebKitTransitionEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 31C0FF3B0E4CEFAC007D6FE5 /* JSWebKitTransitionEvent.cpp */; };
    15631563                31C0FF400E4CEFAC007D6FE5 /* JSWebKitTransitionEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 31C0FF3C0E4CEFAC007D6FE5 /* JSWebKitTransitionEvent.h */; };
     1564                31D26BC81F87063D008FF255 /* JSImageBitmap.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 31D26BC61F86D269008FF255 /* JSImageBitmap.cpp */; };
     1565                31D26BCA1F870645008FF255 /* JSImageBitmapOptions.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 31D26BC41F86D266008FF255 /* JSImageBitmapOptions.cpp */; };
     1566                31D26BCB1F87065B008FF255 /* ImageBitmap.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 31D26BC21F86D18C008FF255 /* ImageBitmap.cpp */; };
    15641567                31D591B316697A6C00E6BF02 /* PlugInClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 31D591B116697A6C00E6BF02 /* PlugInClient.h */; settings = {ATTRIBUTES = (Private, ); }; };
    15651568                31DCD29D1AB4FBDE0072E817 /* AnimationTrigger.h in Headers */ = {isa = PBXBuildFile; fileRef = 31DCD29C1AB4FBDE0072E817 /* AnimationTrigger.h */; settings = {ATTRIBUTES = (Private, ); }; };
     
    93699372                31C0FF3B0E4CEFAC007D6FE5 /* JSWebKitTransitionEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSWebKitTransitionEvent.cpp; sourceTree = "<group>"; };
    93709373                31C0FF3C0E4CEFAC007D6FE5 /* JSWebKitTransitionEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSWebKitTransitionEvent.h; sourceTree = "<group>"; };
     9374                31D26BBD1F86D187008FF255 /* ImageBitmapOptions.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = ImageBitmapOptions.idl; sourceTree = "<group>"; };
     9375                31D26BBF1F86D189008FF255 /* ImageBitmap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ImageBitmap.h; sourceTree = "<group>"; };
     9376                31D26BC01F86D18A008FF255 /* ImageBitmapOptions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ImageBitmapOptions.h; sourceTree = "<group>"; };
     9377                31D26BC11F86D18B008FF255 /* ImageBitmap.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = ImageBitmap.idl; sourceTree = "<group>"; };
     9378                31D26BC21F86D18C008FF255 /* ImageBitmap.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ImageBitmap.cpp; sourceTree = "<group>"; };
     9379                31D26BC31F86D265008FF255 /* JSImageBitmap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSImageBitmap.h; sourceTree = "<group>"; };
     9380                31D26BC41F86D266008FF255 /* JSImageBitmapOptions.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSImageBitmapOptions.cpp; sourceTree = "<group>"; };
     9381                31D26BC51F86D268008FF255 /* JSImageBitmapOptions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSImageBitmapOptions.h; sourceTree = "<group>"; };
     9382                31D26BC61F86D269008FF255 /* JSImageBitmap.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSImageBitmap.cpp; sourceTree = "<group>"; };
    93719383                31D591B116697A6C00E6BF02 /* PlugInClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PlugInClient.h; sourceTree = "<group>"; };
    93729384                31DCD29C1AB4FBDE0072E817 /* AnimationTrigger.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AnimationTrigger.h; sourceTree = "<group>"; };
     
    2106221074                                839AAFEA1A0C0C8D00605F99 /* HTMLWBRElement.cpp */,
    2106321075                                839AAFEB1A0C0C8D00605F99 /* HTMLWBRElement.h */,
     21076                                31D26BC21F86D18C008FF255 /* ImageBitmap.cpp */,
     21077                                31D26BBF1F86D189008FF255 /* ImageBitmap.h */,
     21078                                31D26BC11F86D18B008FF255 /* ImageBitmap.idl */,
     21079                                31D26BC01F86D18A008FF255 /* ImageBitmapOptions.h */,
     21080                                31D26BBD1F86D187008FF255 /* ImageBitmapOptions.idl */,
    2106421081                                A77979130D6B9D0C003851B9 /* ImageData.cpp */,
    2106521082                                A77979140D6B9D0C003851B9 /* ImageData.h */,
     
    2213922156                                E446140E0CD6826900FADA75 /* JSHTMLVideoElement.cpp */,
    2214022157                                E446140F0CD6826900FADA75 /* JSHTMLVideoElement.h */,
     22158                                31D26BC61F86D269008FF255 /* JSImageBitmap.cpp */,
     22159                                31D26BC31F86D265008FF255 /* JSImageBitmap.h */,
     22160                                31D26BC41F86D266008FF255 /* JSImageBitmapOptions.cpp */,
     22161                                31D26BC51F86D268008FF255 /* JSImageBitmapOptions.h */,
    2214122162                                A77979240D6B9E64003851B9 /* JSImageData.cpp */,
    2214222163                                A77979250D6B9E64003851B9 /* JSImageData.h */,
     
    3235132372                                C3CF17A615B0063F00276D39 /* IdTargetObserverRegistry.cpp in Sources */,
    3235232373                                B275356F0B053814002CE64F /* Image.cpp in Sources */,
     32374                                31D26BCB1F87065B008FF255 /* ImageBitmap.cpp in Sources */,
    3235332375                                43D2597713C816F400608559 /* ImageBuffer.cpp in Sources */,
    3235432376                                B2A10B940B3818D700099AA4 /* ImageBufferCG.cpp in Sources */,
     
    3282032842                                838EF53B1DC14A7C008F0C39 /* JSIDBTransactionMode.cpp in Sources */,
    3282132843                                511EF2CB17F0FD3500E4FA16 /* JSIDBVersionChangeEvent.cpp in Sources */,
     32844                                31D26BC81F87063D008FF255 /* JSImageBitmap.cpp in Sources */,
     32845                                31D26BCA1F870645008FF255 /* JSImageBitmapOptions.cpp in Sources */,
    3282232846                                A77979280D6B9E64003851B9 /* JSImageData.cpp in Sources */,
    3282332847                                A7D0318E0E93540300E24ACD /* JSImageDataCustom.cpp in Sources */,
  • trunk/Source/WebCore/bindings/js/CallTracerTypes.h

    r221695 r222986  
    3434#include "HTMLImageElement.h"
    3535#include "HTMLVideoElement.h"
     36#include "ImageBitmap.h"
    3637#include "ImageData.h"
    3738#include "Path2D.h"
     
    8990    RefPtr<HTMLVideoElement>,
    9091#endif
     92    RefPtr<ImageBitmap>,
    9193    RefPtr<ImageData>,
    9294    RefPtr<Int32Array>,
  • trunk/Source/WebCore/html/ImageBitmap.idl

    r222985 r222986  
    2424 */
    2525
    26 // FIXME: This should include SVGImageElement and ImageBitmap.
    27 #if defined(ENABLE_VIDEO) && ENABLE_VIDEO
    28 typedef (HTMLImageElement or HTMLVideoElement or HTMLCanvasElement) CanvasImageSource;
    29 #else
    30 typedef (HTMLImageElement or HTMLCanvasElement) CanvasImageSource;
    31 #endif
     26[
     27    Exposed=(Window,Worker),
     28    ImplementationLacksVTable
     29] interface ImageBitmap {
     30    readonly attribute unsigned long width;
     31    readonly attribute unsigned long height;
     32    void close();
     33};
    3234
    33 [
    34     NoInterfaceObject,
    35     Exposed=(Window,Worker)
    36 ] interface CanvasDrawImage {
    37     // FIXME: All the unrestricted float arguments below should be unrestricted doubles.
    38 
    39     // drawing images
    40     [MayThrowException] void drawImage(CanvasImageSource image, unrestricted double dx, unrestricted double dy);
    41     [MayThrowException] void drawImage(CanvasImageSource image, unrestricted double dx, unrestricted double dy, unrestricted double dw, unrestricted double dh);
    42     [MayThrowException] void drawImage(CanvasImageSource image, unrestricted double sx, unrestricted double sy, unrestricted double sw, unrestricted double sh, unrestricted double dx, unrestricted double dy, unrestricted double dw, unrestricted double dh);
    43 };
  • trunk/Source/WebCore/html/ImageBitmapOptions.h

    r222985 r222986  
    2424 */
    2525
    26 // FIXME: This should include SVGImageElement and ImageBitmap.
    27 #if defined(ENABLE_VIDEO) && ENABLE_VIDEO
    28 typedef (HTMLImageElement or HTMLVideoElement or HTMLCanvasElement) CanvasImageSource;
    29 #else
    30 typedef (HTMLImageElement or HTMLCanvasElement) CanvasImageSource;
    31 #endif
     26#pragma once
    3227
    33 [
    34     NoInterfaceObject,
    35     Exposed=(Window,Worker)
    36 ] interface CanvasDrawImage {
    37     // FIXME: All the unrestricted float arguments below should be unrestricted doubles.
     28#include <wtf/Optional.h>
    3829
    39     // drawing images
    40     [MayThrowException] void drawImage(CanvasImageSource image, unrestricted double dx, unrestricted double dy);
    41     [MayThrowException] void drawImage(CanvasImageSource image, unrestricted double dx, unrestricted double dy, unrestricted double dw, unrestricted double dh);
    42     [MayThrowException] void drawImage(CanvasImageSource image, unrestricted double sx, unrestricted double sy, unrestricted double sw, unrestricted double sh, unrestricted double dx, unrestricted double dy, unrestricted double dw, unrestricted double dh);
     30namespace WebCore {
     31
     32struct ImageBitmapOptions {
     33    enum class Orientation { None, FlipY };
     34    enum class PremultiplyAlpha { None, Premultiply, Default };
     35    enum class ColorSpaceConversion { None, Default };
     36    enum class ResizeQuality { Pixelated, Low, Medium, High };
     37
     38    Orientation imageOrientation { Orientation::None };
     39    PremultiplyAlpha premultiplyAlpha { PremultiplyAlpha::Default };
     40    ColorSpaceConversion colorSpaceConversion { ColorSpaceConversion::Default };
     41    std::optional<unsigned> resizeWidth;
     42    std::optional<unsigned> resizeHeight;
     43    ResizeQuality resizeQuality { ResizeQuality::Low };
    4344};
     45
     46}
  • trunk/Source/WebCore/html/ImageBitmapOptions.idl

    r222985 r222986  
    2424 */
    2525
    26 // FIXME: This should include SVGImageElement and ImageBitmap.
    27 #if defined(ENABLE_VIDEO) && ENABLE_VIDEO
    28 typedef (HTMLImageElement or HTMLVideoElement or HTMLCanvasElement) CanvasImageSource;
    29 #else
    30 typedef (HTMLImageElement or HTMLCanvasElement) CanvasImageSource;
    31 #endif
     26enum ImageOrientation { "none", "flipY" };
     27enum PremultiplyAlpha { "none", "premultiply", "default" };
     28enum ColorSpaceConversion { "none", "default" };
     29enum ResizeQuality { "pixelated", "low", "medium", "high" };
    3230
    33 [
    34     NoInterfaceObject,
    35     Exposed=(Window,Worker)
    36 ] interface CanvasDrawImage {
    37     // FIXME: All the unrestricted float arguments below should be unrestricted doubles.
    38 
    39     // drawing images
    40     [MayThrowException] void drawImage(CanvasImageSource image, unrestricted double dx, unrestricted double dy);
    41     [MayThrowException] void drawImage(CanvasImageSource image, unrestricted double dx, unrestricted double dy, unrestricted double dw, unrestricted double dh);
    42     [MayThrowException] void drawImage(CanvasImageSource image, unrestricted double sx, unrestricted double sy, unrestricted double sw, unrestricted double sh, unrestricted double dx, unrestricted double dy, unrestricted double dw, unrestricted double dh);
     31dictionary ImageBitmapOptions {
     32    ImageOrientation imageOrientation = "none";
     33    PremultiplyAlpha premultiplyAlpha = "default";
     34    ColorSpaceConversion colorSpaceConversion = "default";
     35    [EnforceRange] unsigned long resizeWidth;
     36    [EnforceRange] unsigned long resizeHeight;
     37    ResizeQuality resizeQuality = "low";
    4338};
  • trunk/Source/WebCore/html/canvas/CanvasDrawImage.idl

    r221605 r222986  
    2626// FIXME: This should include SVGImageElement and ImageBitmap.
    2727#if defined(ENABLE_VIDEO) && ENABLE_VIDEO
    28 typedef (HTMLImageElement or HTMLVideoElement or HTMLCanvasElement) CanvasImageSource;
     28typedef (HTMLImageElement or HTMLVideoElement or HTMLCanvasElement or ImageBitmap) CanvasImageSource;
    2929#else
    30 typedef (HTMLImageElement or HTMLCanvasElement) CanvasImageSource;
     30typedef (HTMLImageElement or HTMLCanvasElement or ImageBitmap) CanvasImageSource;
    3131#endif
    3232
  • trunk/Source/WebCore/html/canvas/CanvasFillStrokeStyles.idl

    r221605 r222986  
    2626// FIXME: This should include SVGImageElement and ImageBitmap.
    2727#if defined(ENABLE_VIDEO) && ENABLE_VIDEO
    28 typedef (HTMLImageElement or HTMLVideoElement or HTMLCanvasElement) CanvasImageSource;
     28typedef (HTMLImageElement or HTMLVideoElement or HTMLCanvasElement or ImageBitmap) CanvasImageSource;
    2929#else
    30 typedef (HTMLImageElement or HTMLCanvasElement) CanvasImageSource;
     30typedef (HTMLImageElement or HTMLCanvasElement or ImageBitmap) CanvasImageSource;
    3131#endif
    3232
  • trunk/Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp

    r222253 r222986  
    4848#include "HTMLImageElement.h"
    4949#include "HTMLVideoElement.h"
     50#include "ImageBitmap.h"
    5051#include "ImageBuffer.h"
    5152#include "ImageData.h"
     
    14221423}
    14231424
     1425static inline FloatSize size(ImageBitmap& imageBitmap)
     1426{
     1427    return FloatSize { static_cast<float>(imageBitmap.width()), static_cast<float>(imageBitmap.height()) };
     1428}
     1429
    14241430#if ENABLE(VIDEO)
    14251431
     
    16641670#endif
    16651671
     1672ExceptionOr<void> CanvasRenderingContext2D::drawImage(ImageBitmap&, const FloatRect&, const FloatRect&)
     1673{
     1674    // FIXME: Implement.
     1675    return Exception { TypeError };
     1676}
     1677
    16661678void CanvasRenderingContext2D::drawImageFromRect(HTMLImageElement& imageElement, float sx, float sy, float sw, float sh, float dx, float dy, float dw, float dh, const String& compositeOperation)
    16671679{
     
    19231935
    19241936#endif
     1937
     1938ExceptionOr<RefPtr<CanvasPattern>> CanvasRenderingContext2D::createPattern(ImageBitmap&, bool, bool)
     1939{
     1940    // FIXME: Implement.
     1941    return Exception { TypeError };
     1942}
    19251943
    19261944void CanvasRenderingContext2D::didDrawEntireCanvas()
  • trunk/Source/WebCore/html/canvas/CanvasRenderingContext2D.h

    r221969 r222986  
    5959class HTMLImageElement;
    6060class HTMLVideoElement;
     61class ImageBitmap;
    6162class ImageData;
    6263class Path2D;
     
    6667
    6768#if ENABLE(VIDEO)
    68 using CanvasImageSource = Variant<RefPtr<HTMLImageElement>, RefPtr<HTMLVideoElement>, RefPtr<HTMLCanvasElement>>;
     69using CanvasImageSource = Variant<RefPtr<HTMLImageElement>, RefPtr<HTMLVideoElement>, RefPtr<HTMLCanvasElement>, RefPtr<ImageBitmap>>;
    6970#else
    70 using CanvasImageSource = Variant<RefPtr<HTMLImageElement>, RefPtr<HTMLCanvasElement>>;
     71using CanvasImageSource = Variant<RefPtr<HTMLImageElement>, RefPtr<HTMLCanvasElement>, RefPtr<ImageBitmap>>;
    7172#endif
    7273
     
    334335    ExceptionOr<RefPtr<CanvasPattern>> createPattern(HTMLVideoElement&, bool repeatX, bool repeatY);
    335336#endif
     337    ExceptionOr<RefPtr<CanvasPattern>> createPattern(ImageBitmap&, bool repeatX, bool repeatY);
    336338
    337339    ExceptionOr<void> drawImage(HTMLImageElement&, const FloatRect& srcRect, const FloatRect& dstRect);
     
    341343    ExceptionOr<void> drawImage(HTMLVideoElement&, const FloatRect& srcRect, const FloatRect& dstRect);
    342344#endif
     345    ExceptionOr<void> drawImage(ImageBitmap&, const FloatRect& srcRect, const FloatRect& dstRect);
    343346
    344347    void drawTextInternal(const String& text, float x, float y, bool fill, std::optional<float> maxWidth = std::nullopt);
  • trunk/Source/WebCore/inspector/InspectorCanvas.cpp

    r222057 r222986  
    4040#include "HTMLVideoElement.h"
    4141#include "Image.h"
     42#include "ImageBitmap.h"
    4243#include "ImageBuffer.h"
    4344#include "ImageData.h"
     
    345346        [&] (const CanvasPattern* canvasPattern) { item = buildArrayForCanvasPattern(*canvasPattern); },
    346347        [&] (const ImageData* imageData) { item = buildArrayForImageData(*imageData); },
     348        [&] (const ImageBitmap* imageBitmap) { item = buildArrayForImageBitmap(*imageBitmap); },
    347349        [&] (const ScriptCallFrame& scriptCallFrame) {
    348350            auto array = Inspector::Protocol::Array<double>::create();
     
    539541            [&] (RefPtr<HTMLVideoElement>& value) { addParameter(indexForData(value.get()), RecordingSwizzleTypes::Image); },
    540542#endif
     543            [&] (const RefPtr<ImageBitmap>& value) { addParameter(indexForData(value.get()), RecordingSwizzleTypes::ImageBitmap); },
    541544            [&] (const RefPtr<ImageData>& value) { addParameter(indexForData(value.get()), RecordingSwizzleTypes::ImageData); },
    542545            [&] (const RefPtr<Int32Array>&) { addParameter(0, RecordingSwizzleTypes::TypedArray); },
     
    648651}
    649652
     653RefPtr<Inspector::Protocol::Array<InspectorValue>> InspectorCanvas::buildArrayForImageBitmap(const ImageBitmap& imageBitmap)
     654{
     655    // FIXME: Needs to include the data somehow.
     656    RefPtr<Inspector::Protocol::Array<Inspector::InspectorValue>> array = Inspector::Protocol::Array<Inspector::InspectorValue>::create();
     657    array->addItem(static_cast<int>(imageBitmap.width()));
     658    array->addItem(static_cast<int>(imageBitmap.height()));
     659    return array;
     660}
     661
    650662} // namespace WebCore
    651663
  • trunk/Source/WebCore/inspector/InspectorCanvas.h

    r221232 r222986  
    4444class HTMLImageElement;
    4545class HTMLVideoElement;
     46class ImageBitmap;
    4647class ImageData;
    4748class InstrumentingAgents;
     
    9293#endif
    9394        ImageData*,
     95        ImageBitmap*,
    9496        Inspector::ScriptCallFrame,
    9597        String
     
    102104    RefPtr<Inspector::Protocol::Array<Inspector::InspectorValue>> buildArrayForCanvasPattern(const CanvasPattern&);
    103105    RefPtr<Inspector::Protocol::Array<Inspector::InspectorValue>> buildArrayForImageData(const ImageData&);
     106    RefPtr<Inspector::Protocol::Array<Inspector::InspectorValue>> buildArrayForImageBitmap(const ImageBitmap&);
    104107
    105108    String m_identifier;
  • trunk/Source/WebCore/inspector/RecordingSwizzleTypes.h

    r221695 r222986  
    4949    WebGLProgram = 17,
    5050    WebGLUniformLocation = 18,
     51    ImageBitmap = 19,
    5152};
    5253
Note: See TracChangeset for help on using the changeset viewer.