Changeset 285384 in webkit


Ignore:
Timestamp:
Nov 6, 2021 4:17:47 PM (9 months ago)
Author:
mmaxfield@apple.com
Message:

font-synthesis inline/computed style should be in canonical order.
https://bugs.webkit.org/show_bug.cgi?id=186344

Patch by Joonghun Park <jh718.park@samsung.com> on 2021-11-06
Reviewed by Myles C. Maxfield.

Per the spec, https://drafts.csswg.org/css-fonts/#font-synthesis.

  • css/CSSComputedStyleDeclaration.cpp:

(WebCore::fontSynthesisFromStyle):

  • css/parser/CSSPropertyParser.cpp:

(WebCore::consumeFontSynthesis):

Location:
trunk/Source/WebCore
Files:
11 edited
28 copied

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/CMakeLists.txt

    r285382 r285384  
    14881488    Modules/WebGPU/GPUBufferDescriptor.idl
    14891489    Modules/WebGPU/GPUBufferUsage.idl
     1490    Modules/WebGPU/GPUCanvasCompositingAlphaMode.idl
     1491    Modules/WebGPU/GPUCanvasConfiguration.idl
     1492    Modules/WebGPU/GPUCanvasContext.idl
    14901493    Modules/WebGPU/GPUColorDict.idl
    14911494    Modules/WebGPU/GPUColorTargetState.idl
     
    15091512    Modules/WebGPU/GPUDevice.idl
    15101513    Modules/WebGPU/GPUDeviceDescriptor.idl
     1514    Modules/WebGPU/GPUDeviceError.idl
     1515    Modules/WebGPU/GPUDeviceLost.idl
     1516    Modules/WebGPU/GPUDeviceLostInfo.idl
     1517    Modules/WebGPU/GPUDeviceLostReason.idl
     1518    Modules/WebGPU/GPUDeviceUncapturedError.idl
     1519    Modules/WebGPU/GPUErrorFilter.idl
    15111520    Modules/WebGPU/GPUExtent3DDict.idl
    15121521    Modules/WebGPU/GPUExternalTexture.idl
     
    15301539    Modules/WebGPU/GPUOrigin2DDict.idl
    15311540    Modules/WebGPU/GPUOrigin3DDict.idl
     1541    Modules/WebGPU/GPUOutOfMemoryError.idl
    15321542    Modules/WebGPU/GPUPipelineBase.idl
    15331543    Modules/WebGPU/GPUPipelineDescriptorBase.idl
     
    15851595    Modules/WebGPU/GPUTextureViewDescriptor.idl
    15861596    Modules/WebGPU/GPUTextureViewDimension.idl
     1597    Modules/WebGPU/GPUUncapturedErrorEvent.idl
     1598    Modules/WebGPU/GPUUncapturedErrorEventInit.idl
     1599    Modules/WebGPU/GPUValidationError.idl
    15871600    Modules/WebGPU/GPUVertexAttribute.idl
    15881601    Modules/WebGPU/GPUVertexBufferLayout.idl
  • trunk/Source/WebCore/ChangeLog

    r285383 r285384  
    1212        * css/parser/CSSPropertyParser.cpp:
    1313        (WebCore::consumeFontSynthesis):
     14
     152021-11-05  Myles C. Maxfield  <mmaxfield@apple.com>
     16
     17        [WebGPU] Bindings Part 8: Bring back the remaining bindings code
     18        https://bugs.webkit.org/show_bug.cgi?id=232700
     19
     20        Reviewed by Dean Jackson.
     21
     22        This is the last chunk of the bindings code, brought back from r280467.
     23        This chunk includes all of the remaining pieces.
     24        The objects have no methods in them - those will come later.
     25
     26        No new tests because there is no behavior change yet.
     27
     28        * CMakeLists.txt:
     29        * DerivedSources-input.xcfilelist:
     30        * DerivedSources-output.xcfilelist:
     31        * DerivedSources.make:
     32        * Modules/WebGPU/GPUCanvasCompositingAlphaMode.h: Copied from Source/WebCore/Modules/WebGPU/GPUCommandBuffer.h.
     33        * Modules/WebGPU/GPUCanvasCompositingAlphaMode.idl: Copied from Source/WebCore/Modules/WebGPU/GPUCommandBuffer.h.
     34        * Modules/WebGPU/GPUCanvasConfiguration.h: Copied from Source/WebCore/Modules/WebGPU/GPUCommandBuffer.h.
     35        * Modules/WebGPU/GPUCanvasConfiguration.idl: Copied from Source/WebCore/Modules/WebGPU/GPUCommandBuffer.h.
     36        * Modules/WebGPU/GPUCanvasContext.cpp: Copied from Source/WebCore/Modules/WebGPU/GPUCommandBuffer.h.
     37        (WebCore::GPUCanvasContext::canvas):
     38        (WebCore::GPUCanvasContext::configure):
     39        (WebCore::GPUCanvasContext::unconfigure):
     40        (WebCore::GPUCanvasContext::getPreferredFormat):
     41        (WebCore::GPUCanvasContext::getCurrentTexture):
     42        * Modules/WebGPU/GPUCanvasContext.h: Copied from Source/WebCore/Modules/WebGPU/GPUCommandBuffer.h.
     43        (WebCore::GPUCanvasContext::create):
     44        * Modules/WebGPU/GPUCanvasContext.idl: Copied from Source/WebCore/Modules/WebGPU/GPUCommandBuffer.h.
     45        * Modules/WebGPU/GPUCommandBuffer.h:
     46        (WebCore::GPUCommandBuffer::GPUCommandBuffer): Deleted.
     47        * Modules/WebGPU/GPUDevice.cpp:
     48        (WebCore::GPUDevice::pushErrorScope):
     49        (WebCore::GPUDevice::popErrorScope):
     50        * Modules/WebGPU/GPUDevice.h:
     51        (WebCore::GPUDevice::lost):
     52        * Modules/WebGPU/GPUDeviceError.idl: Copied from Source/WebCore/Modules/WebGPU/GPUCommandBuffer.h.
     53        * Modules/WebGPU/GPUDeviceLost.idl: Copied from Source/WebCore/Modules/WebGPU/GPUCommandBuffer.h.
     54        * Modules/WebGPU/GPUDeviceLostInfo.cpp: Copied from Source/WebCore/Modules/WebGPU/GPUCommandBuffer.h.
     55        (WebCore::GPUDeviceLostInfo::GPUDeviceLostInfo):
     56        (WebCore::GPUDeviceLostInfo::reason const):
     57        (WebCore::GPUDeviceLostInfo::message const):
     58        * Modules/WebGPU/GPUDeviceLostInfo.h: Copied from Source/WebCore/Modules/WebGPU/GPUCommandBuffer.h.
     59        (WebCore::GPUDeviceLostInfo::create):
     60        * Modules/WebGPU/GPUDeviceLostInfo.idl: Copied from Source/WebCore/Modules/WebGPU/GPUCommandBuffer.h.
     61        * Modules/WebGPU/GPUDeviceLostReason.h: Copied from Source/WebCore/Modules/WebGPU/GPUCommandBuffer.h.
     62        * Modules/WebGPU/GPUDeviceLostReason.idl: Copied from Source/WebCore/Modules/WebGPU/GPUCommandBuffer.h.
     63        * Modules/WebGPU/GPUDeviceUncapturedError.idl: Copied from Source/WebCore/Modules/WebGPU/GPUCommandBuffer.h.
     64        * Modules/WebGPU/GPUError.h: Copied from Source/WebCore/Modules/WebGPU/GPUCommandBuffer.h.
     65        * Modules/WebGPU/GPUErrorFilter.h: Copied from Source/WebCore/Modules/WebGPU/GPUCommandBuffer.h.
     66        * Modules/WebGPU/GPUErrorFilter.idl: Copied from Source/WebCore/Modules/WebGPU/GPUCommandBuffer.h.
     67        * Modules/WebGPU/GPUOutOfMemoryError.h: Copied from Source/WebCore/Modules/WebGPU/GPUCommandBuffer.h.
     68        (WebCore::GPUOutOfMemoryError::create):
     69        * Modules/WebGPU/GPUOutOfMemoryError.idl: Copied from Source/WebCore/Modules/WebGPU/GPUCommandBuffer.h.
     70        * Modules/WebGPU/GPUUncapturedErrorEvent.cpp: Copied from Source/WebCore/Modules/WebGPU/GPUCommandBuffer.h.
     71        (WebCore::GPUUncapturedErrorEvent::GPUUncapturedErrorEvent):
     72        (WebCore::GPUUncapturedErrorEvent::error const):
     73        * Modules/WebGPU/GPUUncapturedErrorEvent.h: Copied from Source/WebCore/Modules/WebGPU/GPUCommandBuffer.h.
     74        (WebCore::GPUUncapturedErrorEvent::create):
     75        * Modules/WebGPU/GPUUncapturedErrorEvent.idl: Copied from Source/WebCore/Modules/WebGPU/GPUCommandBuffer.h.
     76        * Modules/WebGPU/GPUUncapturedErrorEventInit.h: Copied from Source/WebCore/Modules/WebGPU/GPUCommandBuffer.h.
     77        * Modules/WebGPU/GPUUncapturedErrorEventInit.idl: Copied from Source/WebCore/Modules/WebGPU/GPUCommandBuffer.h.
     78        * Modules/WebGPU/GPUValidationError.cpp: Copied from Source/WebCore/Modules/WebGPU/GPUCommandBuffer.h.
     79        (WebCore::GPUValidationError::GPUValidationError):
     80        (WebCore::GPUValidationError::message const):
     81        * Modules/WebGPU/GPUValidationError.h: Copied from Source/WebCore/Modules/WebGPU/GPUCommandBuffer.h.
     82        (WebCore::GPUValidationError::create):
     83        * Modules/WebGPU/GPUValidationError.idl: Copied from Source/WebCore/Modules/WebGPU/GPUCommandBuffer.h.
     84        * Sources.txt:
     85        * WebCore.xcodeproj/project.pbxproj:
     86        * bindings/js/WebCoreBuiltinNames.h:
    1487
    15882021-11-05  Myles C. Maxfield  <mmaxfield@apple.com>
  • trunk/Source/WebCore/DerivedSources-input.xcfilelist

    r285382 r285384  
    4141$(PROJECT_DIR)/Modules/WebGPU/GPUBufferDescriptor.idl
    4242$(PROJECT_DIR)/Modules/WebGPU/GPUBufferUsage.idl
     43$(PROJECT_DIR)/Modules/WebGPU/GPUCanvasCompositingAlphaMode.idl
     44$(PROJECT_DIR)/Modules/WebGPU/GPUCanvasConfiguration.idl
     45$(PROJECT_DIR)/Modules/WebGPU/GPUCanvasContext.idl
    4346$(PROJECT_DIR)/Modules/WebGPU/GPUColorDict.idl
    4447$(PROJECT_DIR)/Modules/WebGPU/GPUColorTargetState.idl
     
    6265$(PROJECT_DIR)/Modules/WebGPU/GPUDevice.idl
    6366$(PROJECT_DIR)/Modules/WebGPU/GPUDeviceDescriptor.idl
     67$(PROJECT_DIR)/Modules/WebGPU/GPUDeviceError.idl
     68$(PROJECT_DIR)/Modules/WebGPU/GPUDeviceLost.idl
     69$(PROJECT_DIR)/Modules/WebGPU/GPUDeviceLostInfo.idl
     70$(PROJECT_DIR)/Modules/WebGPU/GPUDeviceLostReason.idl
     71$(PROJECT_DIR)/Modules/WebGPU/GPUDeviceUncapturedError.idl
     72$(PROJECT_DIR)/Modules/WebGPU/GPUErrorFilter.idl
    6473$(PROJECT_DIR)/Modules/WebGPU/GPUExtent3DDict.idl
    6574$(PROJECT_DIR)/Modules/WebGPU/GPUExternalTexture.idl
     
    8392$(PROJECT_DIR)/Modules/WebGPU/GPUOrigin2DDict.idl
    8493$(PROJECT_DIR)/Modules/WebGPU/GPUOrigin3DDict.idl
     94$(PROJECT_DIR)/Modules/WebGPU/GPUOutOfMemoryError.idl
    8595$(PROJECT_DIR)/Modules/WebGPU/GPUPipelineBase.idl
    8696$(PROJECT_DIR)/Modules/WebGPU/GPUPipelineDescriptorBase.idl
     
    139149$(PROJECT_DIR)/Modules/WebGPU/GPUTextureViewDescriptor.idl
    140150$(PROJECT_DIR)/Modules/WebGPU/GPUTextureViewDimension.idl
     151$(PROJECT_DIR)/Modules/WebGPU/GPUUncapturedErrorEvent.idl
     152$(PROJECT_DIR)/Modules/WebGPU/GPUUncapturedErrorEventInit.idl
     153$(PROJECT_DIR)/Modules/WebGPU/GPUValidationError.idl
    141154$(PROJECT_DIR)/Modules/WebGPU/GPUVertexAttribute.idl
    142155$(PROJECT_DIR)/Modules/WebGPU/GPUVertexBufferLayout.idl
  • trunk/Source/WebCore/DerivedSources-output.xcfilelist

    r285382 r285384  
    906906$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSGPUBufferUsage.cpp
    907907$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSGPUBufferUsage.h
     908$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSGPUCanvasCompositingAlphaMode.cpp
     909$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSGPUCanvasCompositingAlphaMode.h
     910$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSGPUCanvasConfiguration.cpp
     911$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSGPUCanvasConfiguration.h
     912$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSGPUCanvasContext.cpp
     913$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSGPUCanvasContext.h
    908914$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSGPUColorDict.cpp
    909915$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSGPUColorDict.h
     
    948954$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSGPUDeviceDescriptor.cpp
    949955$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSGPUDeviceDescriptor.h
     956$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSGPUDeviceError.cpp
     957$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSGPUDeviceError.h
     958$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSGPUDeviceLost.cpp
     959$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSGPUDeviceLost.h
     960$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSGPUDeviceLostInfo.cpp
     961$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSGPUDeviceLostInfo.h
     962$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSGPUDeviceLostReason.cpp
     963$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSGPUDeviceLostReason.h
     964$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSGPUDeviceUncapturedError.cpp
     965$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSGPUDeviceUncapturedError.h
     966$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSGPUErrorFilter.cpp
     967$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSGPUErrorFilter.h
    950968$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSGPUExtent3DDict.cpp
    951969$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSGPUExtent3DDict.h
     
    9901008$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSGPUOrigin3DDict.cpp
    9911009$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSGPUOrigin3DDict.h
     1010$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSGPUOutOfMemoryError.cpp
     1011$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSGPUOutOfMemoryError.h
    9921012$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSGPUPipelineBase.cpp
    9931013$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSGPUPipelineBase.h
     
    11021122$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSGPUTextureViewDimension.cpp
    11031123$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSGPUTextureViewDimension.h
     1124$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSGPUUncapturedErrorEvent.cpp
     1125$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSGPUUncapturedErrorEvent.h
     1126$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSGPUUncapturedErrorEventInit.cpp
     1127$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSGPUUncapturedErrorEventInit.h
     1128$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSGPUValidationError.cpp
     1129$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSGPUValidationError.h
    11041130$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSGPUVertexAttribute.cpp
    11051131$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSGPUVertexAttribute.h
  • trunk/Source/WebCore/DerivedSources.make

    r285382 r285384  
    7373    $(WebCore)/Modules/WebGPU/GPUBufferDescriptor.idl \
    7474    $(WebCore)/Modules/WebGPU/GPUBufferUsage.idl \
     75    $(WebCore)/Modules/WebGPU/GPUCanvasCompositingAlphaMode.idl \
     76    $(WebCore)/Modules/WebGPU/GPUCanvasConfiguration.idl \
     77    $(WebCore)/Modules/WebGPU/GPUCanvasContext.idl \
    7578    $(WebCore)/Modules/WebGPU/GPUColorDict.idl \
    7679    $(WebCore)/Modules/WebGPU/GPUColorTargetState.idl \
     
    9497    $(WebCore)/Modules/WebGPU/GPUDevice.idl \
    9598    $(WebCore)/Modules/WebGPU/GPUDeviceDescriptor.idl \
     99    $(WebCore)/Modules/WebGPU/GPUDeviceError.idl \
     100    $(WebCore)/Modules/WebGPU/GPUDeviceLost.idl \
     101    $(WebCore)/Modules/WebGPU/GPUDeviceLostInfo.idl \
     102    $(WebCore)/Modules/WebGPU/GPUDeviceLostReason.idl \
     103    $(WebCore)/Modules/WebGPU/GPUDeviceUncapturedError.idl \
     104    $(WebCore)/Modules/WebGPU/GPUErrorFilter.idl \
    96105    $(WebCore)/Modules/WebGPU/GPUExtent3DDict.idl \
    97106    $(WebCore)/Modules/WebGPU/GPUExternalTexture.idl \
     
    115124    $(WebCore)/Modules/WebGPU/GPUOrigin2DDict.idl \
    116125    $(WebCore)/Modules/WebGPU/GPUOrigin3DDict.idl \
     126    $(WebCore)/Modules/WebGPU/GPUOutOfMemoryError.idl \
    117127    $(WebCore)/Modules/WebGPU/GPUPipelineBase.idl \
    118128    $(WebCore)/Modules/WebGPU/GPUPipelineDescriptorBase.idl \
     
    170180    $(WebCore)/Modules/WebGPU/GPUTextureViewDescriptor.idl \
    171181    $(WebCore)/Modules/WebGPU/GPUTextureViewDimension.idl \
     182    $(WebCore)/Modules/WebGPU/GPUUncapturedErrorEvent.idl \
     183    $(WebCore)/Modules/WebGPU/GPUUncapturedErrorEventInit.idl \
     184    $(WebCore)/Modules/WebGPU/GPUValidationError.idl \
    172185    $(WebCore)/Modules/WebGPU/GPUVertexAttribute.idl \
    173186    $(WebCore)/Modules/WebGPU/GPUVertexBufferLayout.idl \
  • trunk/Source/WebCore/Modules/WebGPU/GPUCanvasCompositingAlphaMode.h

    r285383 r285384  
    2626#pragma once
    2727
    28 #include <wtf/Ref.h>
    29 #include <wtf/RefCounted.h>
    30 #include <wtf/text/WTFString.h>
     28#include <cstdint>
    3129
    3230namespace WebCore {
    3331
    34 class GPUCommandBuffer : public RefCounted<GPUCommandBuffer> {
    35 public:
    36     static Ref<GPUCommandBuffer> create()
    37     {
    38         return adoptRef(*new GPUCommandBuffer());
    39     }
    40 
    41     String label() const;
    42     void setLabel(String&&);
    43 
    44 private:
    45     GPUCommandBuffer()
    46     {
    47     }
     32enum class GPUCanvasCompositingAlphaMode : uint8_t {
     33    Opaque,
     34    Premultiplied
    4835};
    4936
  • trunk/Source/WebCore/Modules/WebGPU/GPUCanvasCompositingAlphaMode.idl

    r285383 r285384  
    2424 */
    2525
    26 #pragma once
     26// https://gpuweb.github.io/gpuweb/#enumdef-gpucanvascompositingalphamode
    2727
    28 #include <wtf/Ref.h>
    29 #include <wtf/RefCounted.h>
    30 #include <wtf/text/WTFString.h>
    31 
    32 namespace WebCore {
    33 
    34 class GPUCommandBuffer : public RefCounted<GPUCommandBuffer> {
    35 public:
    36     static Ref<GPUCommandBuffer> create()
    37     {
    38         return adoptRef(*new GPUCommandBuffer());
    39     }
    40 
    41     String label() const;
    42     void setLabel(String&&);
    43 
    44 private:
    45     GPUCommandBuffer()
    46     {
    47     }
     28[
     29    EnabledBySetting=WebGPU
     30]
     31enum GPUCanvasCompositingAlphaMode {
     32    "opaque",
     33    "premultiplied"
    4834};
    49 
    50 }
  • trunk/Source/WebCore/Modules/WebGPU/GPUCanvasConfiguration.h

    r285383 r285384  
    2626#pragma once
    2727
    28 #include <wtf/Ref.h>
    29 #include <wtf/RefCounted.h>
    30 #include <wtf/text/WTFString.h>
     28#include "GPUCanvasCompositingAlphaMode.h"
     29#include "GPUDevice.h"
     30#include "GPUExtent3DDict.h"
     31#include "GPUPredefinedColorSpace.h"
     32#include "GPUTextureFormat.h"
     33#include <cstdint>
     34#include <optional>
     35#include <wtf/RefPtr.h>
    3136
    3237namespace WebCore {
    3338
    34 class GPUCommandBuffer : public RefCounted<GPUCommandBuffer> {
    35 public:
    36     static Ref<GPUCommandBuffer> create()
    37     {
    38         return adoptRef(*new GPUCommandBuffer());
    39     }
     39using GPUTextureUsageFlags = uint32_t; // FIXME: This doesn't need to be here.
    4040
    41     String label() const;
    42     void setLabel(String&&);
    43 
    44 private:
    45     GPUCommandBuffer()
    46     {
    47     }
     41struct GPUCanvasConfiguration {
     42    RefPtr<GPUDevice> device;
     43    GPUTextureFormat format;
     44    GPUTextureUsageFlags usage; // GPUTextureUsage.RENDER_ATTACHMENT
     45    GPUPredefinedColorSpace colorSpace;
     46    GPUCanvasCompositingAlphaMode compositingAlphaMode;
     47    std::optional<GPUExtent3D> size;
    4848};
    4949
  • trunk/Source/WebCore/Modules/WebGPU/GPUCanvasConfiguration.idl

    r285383 r285384  
    2424 */
    2525
    26 #pragma once
     26// https://gpuweb.github.io/gpuweb/#dictdef-gpucanvasconfiguration
    2727
    28 #include <wtf/Ref.h>
    29 #include <wtf/RefCounted.h>
    30 #include <wtf/text/WTFString.h>
     28// https://bugs.webkit.org/show_bug.cgi?id=232548 These shouldn't need to be here.
     29typedef [EnforceRange] unsigned long GPUTextureUsageFlags;
     30typedef [EnforceRange] unsigned long GPUIntegerCoordinate;
     31typedef (sequence<GPUIntegerCoordinate> or GPUExtent3DDict) GPUExtent3D;
    3132
    32 namespace WebCore {
    33 
    34 class GPUCommandBuffer : public RefCounted<GPUCommandBuffer> {
    35 public:
    36     static Ref<GPUCommandBuffer> create()
    37     {
    38         return adoptRef(*new GPUCommandBuffer());
    39     }
    40 
    41     String label() const;
    42     void setLabel(String&&);
    43 
    44 private:
    45     GPUCommandBuffer()
    46     {
    47     }
     33[
     34    EnabledBySetting=WebGPU
     35]
     36dictionary GPUCanvasConfiguration {
     37    required GPUDevice device;
     38    required GPUTextureFormat format;
     39    GPUTextureUsageFlags usage = 0x10;  // GPUTextureUsage.RENDER_ATTACHMENT
     40    GPUPredefinedColorSpace colorSpace = "srgb";
     41    GPUCanvasCompositingAlphaMode compositingAlphaMode = "opaque";
     42    GPUExtent3D size;
    4843};
    49 
    50 }
  • trunk/Source/WebCore/Modules/WebGPU/GPUCanvasContext.cpp

    r285383 r285384  
    2424 */
    2525
    26 #pragma once
     26#include "config.h"
     27#include "GPUCanvasContext.h"
    2728
    28 #include <wtf/Ref.h>
    29 #include <wtf/RefCounted.h>
    30 #include <wtf/text/WTFString.h>
     29#include "GPUAdapter.h"
     30#include "GPUCanvasConfiguration.h"
    3131
    3232namespace WebCore {
    3333
    34 class GPUCommandBuffer : public RefCounted<GPUCommandBuffer> {
    35 public:
    36     static Ref<GPUCommandBuffer> create()
    37     {
    38         return adoptRef(*new GPUCommandBuffer());
    39     }
     34RefPtr<HTMLCanvasElement> GPUCanvasContext::canvas()
     35{
     36    return { };
     37}
    4038
    41     String label() const;
    42     void setLabel(String&&);
    43 
    44 private:
    45     GPUCommandBuffer()
    46     {
    47     }
    48 };
     39void GPUCanvasContext::configure(const GPUCanvasConfiguration&)
     40{
    4941
    5042}
     43
     44void GPUCanvasContext::unconfigure()
     45{
     46}
     47
     48GPUTextureFormat GPUCanvasContext::getPreferredFormat(const GPUAdapter&)
     49{
     50    return GPUTextureFormat::Rgba8unorm;
     51}
     52
     53RefPtr<GPUTexture> GPUCanvasContext::getCurrentTexture()
     54{
     55    return nullptr;
     56}
     57
     58}
  • trunk/Source/WebCore/Modules/WebGPU/GPUCanvasContext.h

    r285383 r285384  
    2626#pragma once
    2727
     28#include "GPUTexture.h"
     29#include "GPUTextureFormat.h"
     30#include "HTMLCanvasElement.h"
     31#include "OffscreenCanvas.h"
     32#include <variant>
    2833#include <wtf/Ref.h>
    2934#include <wtf/RefCounted.h>
    30 #include <wtf/text/WTFString.h>
     35#include <wtf/RefPtr.h>
    3136
    3237namespace WebCore {
    3338
    34 class GPUCommandBuffer : public RefCounted<GPUCommandBuffer> {
     39class GPUAdapter;
     40struct GPUCanvasConfiguration;
     41
     42class GPUCanvasContext : public RefCounted<GPUCanvasContext> {
    3543public:
    36     static Ref<GPUCommandBuffer> create()
     44    static Ref<GPUCanvasContext> create()
    3745    {
    38         return adoptRef(*new GPUCommandBuffer());
     46        return adoptRef(*new GPUCanvasContext());
    3947    }
    4048
    41     String label() const;
    42     void setLabel(String&&);
     49    RefPtr<HTMLCanvasElement> canvas();
     50
     51    void configure(const GPUCanvasConfiguration&);
     52    void unconfigure();
     53
     54    GPUTextureFormat getPreferredFormat(const GPUAdapter&);
     55    RefPtr<GPUTexture> getCurrentTexture();
    4356
    4457private:
    45     GPUCommandBuffer()
    46     {
    47     }
     58    GPUCanvasContext() = default;
    4859};
    4960
  • trunk/Source/WebCore/Modules/WebGPU/GPUCanvasContext.idl

    r285383 r285384  
    2424 */
    2525
    26 #pragma once
     26// https://gpuweb.github.io/gpuweb/#gpucanvascontext
    2727
    28 #include <wtf/Ref.h>
    29 #include <wtf/RefCounted.h>
    30 #include <wtf/text/WTFString.h>
     28[
     29    EnabledBySetting=WebGPU,
     30    ImplementationLacksVTable,
     31    Exposed=(Window), /* https://bugs.webkit.org/show_bug.cgi?id=232542: DedicatedWorker */
     32    SecureContext
     33]
     34interface GPUCanvasContext {
     35    readonly attribute HTMLCanvasElement canvas; // FIXME: OffscreenCanvas doesn't seem to work with our bindings here.
    3136
    32 namespace WebCore {
     37    undefined configure(GPUCanvasConfiguration configuration);
     38    undefined unconfigure();
    3339
    34 class GPUCommandBuffer : public RefCounted<GPUCommandBuffer> {
    35 public:
    36     static Ref<GPUCommandBuffer> create()
    37     {
    38         return adoptRef(*new GPUCommandBuffer());
    39     }
    40 
    41     String label() const;
    42     void setLabel(String&&);
    43 
    44 private:
    45     GPUCommandBuffer()
    46     {
    47     }
     40    GPUTextureFormat getPreferredFormat(GPUAdapter adapter);
     41    GPUTexture getCurrentTexture();
    4842};
    49 
    50 }
  • trunk/Source/WebCore/Modules/WebGPU/GPUCommandBuffer.h

    r285382 r285384  
    4343
    4444private:
    45     GPUCommandBuffer()
    46     {
    47     }
     45    GPUCommandBuffer() = default;
    4846};
    4947
  • trunk/Source/WebCore/Modules/WebGPU/GPUDevice.cpp

    r285382 r285384  
    156156}
    157157
     158void GPUDevice::pushErrorScope(GPUErrorFilter)
     159{
    158160}
     161
     162void GPUDevice::popErrorScope(ErrorScopePromise&&)
     163{
     164}
     165
     166}
  • trunk/Source/WebCore/Modules/WebGPU/GPUDevice.h

    r285382 r285384  
    2727
    2828#include "ActiveDOMObject.h"
     29#include "DOMPromiseProxy.h"
    2930#include "EventTarget.h"
    3031#include "GPUComputePipeline.h"
     32#include "GPUDeviceLostInfo.h"
     33#include "GPUError.h"
     34#include "GPUErrorFilter.h"
    3135#include "GPURenderPipeline.h"
    3236#include "JSDOMPromiseDeferred.h"
     
    108112    Ref<GPUQuerySet> createQuerySet(const GPUQuerySetDescriptor&);
    109113
     114    void pushErrorScope(GPUErrorFilter);
     115    using ErrorScopePromise = DOMPromiseDeferred<IDLNullable<IDLInterface<GPUError>>>;
     116    void popErrorScope(ErrorScopePromise&&);
     117
     118    using LostPromise = DOMPromiseProxy<IDLInterface<GPUDeviceLostInfo>>;
     119    LostPromise& lost() { return m_lostPromise; }
     120 
    110121private:
    111122    GPUDevice(ScriptExecutionContext* scriptExecutionContext)
     
    123134    void refEventTarget() final { ref(); }
    124135    void derefEventTarget() final { deref(); }
     136
     137    LostPromise m_lostPromise;
    125138};
    126139
  • trunk/Source/WebCore/Modules/WebGPU/GPUDeviceError.idl

    r285383 r285384  
    2424 */
    2525
    26 #pragma once
     26// https://gpuweb.github.io/gpuweb/#ref-for-gpudevice⑤⓪
    2727
    28 #include <wtf/Ref.h>
    29 #include <wtf/RefCounted.h>
    30 #include <wtf/text/WTFString.h>
     28// https://bugs.webkit.org/show_bug.cgi?id=232548 This shouldn't need to be here.
     29typedef (GPUOutOfMemoryError or GPUValidationError) GPUError;
    3130
    32 namespace WebCore {
    33 
    34 class GPUCommandBuffer : public RefCounted<GPUCommandBuffer> {
    35 public:
    36     static Ref<GPUCommandBuffer> create()
    37     {
    38         return adoptRef(*new GPUCommandBuffer());
    39     }
    40 
    41     String label() const;
    42     void setLabel(String&&);
    43 
    44 private:
    45     GPUCommandBuffer()
    46     {
    47     }
     31partial interface GPUDevice {
     32    undefined pushErrorScope(GPUErrorFilter filter);
     33    Promise<GPUError?> popErrorScope();
    4834};
    49 
    50 }
  • trunk/Source/WebCore/Modules/WebGPU/GPUDeviceLost.idl

    r285383 r285384  
    2424 */
    2525
    26 #pragma once
     26// https://gpuweb.github.io/gpuweb/#ref-for-gpudevice④⑨
    2727
    28 #include <wtf/Ref.h>
    29 #include <wtf/RefCounted.h>
    30 #include <wtf/text/WTFString.h>
    31 
    32 namespace WebCore {
    33 
    34 class GPUCommandBuffer : public RefCounted<GPUCommandBuffer> {
    35 public:
    36     static Ref<GPUCommandBuffer> create()
    37     {
    38         return adoptRef(*new GPUCommandBuffer());
    39     }
    40 
    41     String label() const;
    42     void setLabel(String&&);
    43 
    44 private:
    45     GPUCommandBuffer()
    46     {
    47     }
     28partial interface GPUDevice {
     29    readonly attribute Promise<GPUDeviceLostInfo> lost;
    4830};
    49 
    50 }
  • trunk/Source/WebCore/Modules/WebGPU/GPUDeviceLostInfo.cpp

    r285383 r285384  
    2424 */
    2525
    26 #pragma once
    27 
    28 #include <wtf/Ref.h>
    29 #include <wtf/RefCounted.h>
    30 #include <wtf/text/WTFString.h>
     26#include "config.h"
     27#include "GPUDeviceLostInfo.h"
    3128
    3229namespace WebCore {
    3330
    34 class GPUCommandBuffer : public RefCounted<GPUCommandBuffer> {
    35 public:
    36     static Ref<GPUCommandBuffer> create()
    37     {
    38         return adoptRef(*new GPUCommandBuffer());
    39     }
     31GPUDeviceLostInfo::GPUDeviceLostInfo(Reason&&, String&& message)
     32{
     33    UNUSED_PARAM(message);
     34}
    4035
    41     String label() const;
    42     void setLabel(String&&);
     36auto GPUDeviceLostInfo::reason() const -> Reason
     37{
     38    return std::nullopt;
     39}
    4340
    44 private:
    45     GPUCommandBuffer()
    46     {
    47     }
    48 };
     41String GPUDeviceLostInfo::message() const
     42{
     43    return StringImpl::empty();
     44}
    4945
    5046}
     47
     48
  • trunk/Source/WebCore/Modules/WebGPU/GPUDeviceLostInfo.h

    r285383 r285384  
    2626#pragma once
    2727
     28#include "GPUDeviceLostReason.h"
     29#include <optional>
    2830#include <wtf/Ref.h>
    2931#include <wtf/RefCounted.h>
     
    3234namespace WebCore {
    3335
    34 class GPUCommandBuffer : public RefCounted<GPUCommandBuffer> {
     36class GPUDeviceLostInfo : public RefCounted<GPUDeviceLostInfo> {
    3537public:
    36     static Ref<GPUCommandBuffer> create()
     38    using Reason = std::optional<GPUDeviceLostReason>;
     39
     40    static Ref<GPUDeviceLostInfo> create(Reason&& reason, String&& message)
    3741    {
    38         return adoptRef(*new GPUCommandBuffer());
     42        return adoptRef(*new GPUDeviceLostInfo(WTFMove(reason), WTFMove(message)));
    3943    }
    4044
    41     String label() const;
    42     void setLabel(String&&);
     45    Reason reason() const;
     46    String message() const;
    4347
    4448private:
    45     GPUCommandBuffer()
    46     {
    47     }
     49    GPUDeviceLostInfo(Reason&&, String&& message);
    4850};
    4951
  • trunk/Source/WebCore/Modules/WebGPU/GPUDeviceLostInfo.idl

    r285383 r285384  
    2424 */
    2525
    26 #pragma once
     26// https://gpuweb.github.io/gpuweb/#gpudevicelostinfo
    2727
    28 #include <wtf/Ref.h>
    29 #include <wtf/RefCounted.h>
    30 #include <wtf/text/WTFString.h>
    31 
    32 namespace WebCore {
    33 
    34 class GPUCommandBuffer : public RefCounted<GPUCommandBuffer> {
    35 public:
    36     static Ref<GPUCommandBuffer> create()
    37     {
    38         return adoptRef(*new GPUCommandBuffer());
    39     }
    40 
    41     String label() const;
    42     void setLabel(String&&);
    43 
    44 private:
    45     GPUCommandBuffer()
    46     {
    47     }
     28[
     29    EnabledBySetting=WebGPU,
     30    ImplementationLacksVTable,
     31    Exposed=(Window), /* https://bugs.webkit.org/show_bug.cgi?id=232542: DedicatedWorker */
     32    SecureContext
     33]
     34interface GPUDeviceLostInfo {
     35    readonly attribute GPUDeviceLostReason? reason; // FIXME: This is supposed to be (GPUDeviceLostReason or undefined)
     36    readonly attribute DOMString message;
    4837};
    49 
    50 }
  • trunk/Source/WebCore/Modules/WebGPU/GPUDeviceLostReason.h

    r285383 r285384  
    2626#pragma once
    2727
    28 #include <wtf/Ref.h>
    29 #include <wtf/RefCounted.h>
    30 #include <wtf/text/WTFString.h>
     28#include <cstdint>
    3129
    3230namespace WebCore {
    3331
    34 class GPUCommandBuffer : public RefCounted<GPUCommandBuffer> {
    35 public:
    36     static Ref<GPUCommandBuffer> create()
    37     {
    38         return adoptRef(*new GPUCommandBuffer());
    39     }
    40 
    41     String label() const;
    42     void setLabel(String&&);
    43 
    44 private:
    45     GPUCommandBuffer()
    46     {
    47     }
     32enum class GPUDeviceLostReason : uint8_t {
     33    Destroyed
    4834};
    4935
  • trunk/Source/WebCore/Modules/WebGPU/GPUDeviceLostReason.idl

    r285383 r285384  
    2424 */
    2525
    26 #pragma once
     26// https://gpuweb.github.io/gpuweb/#enumdef-gpudevicelostreason
    2727
    28 #include <wtf/Ref.h>
    29 #include <wtf/RefCounted.h>
    30 #include <wtf/text/WTFString.h>
    31 
    32 namespace WebCore {
    33 
    34 class GPUCommandBuffer : public RefCounted<GPUCommandBuffer> {
    35 public:
    36     static Ref<GPUCommandBuffer> create()
    37     {
    38         return adoptRef(*new GPUCommandBuffer());
    39     }
    40 
    41     String label() const;
    42     void setLabel(String&&);
    43 
    44 private:
    45     GPUCommandBuffer()
    46     {
    47     }
     28[
     29    EnabledBySetting=WebGPU
     30]
     31enum GPUDeviceLostReason {
     32    "destroyed"
    4833};
    49 
    50 }
  • trunk/Source/WebCore/Modules/WebGPU/GPUDeviceUncapturedError.idl

    r285383 r285384  
    2424 */
    2525
    26 #pragma once
    27 
    28 #include <wtf/Ref.h>
    29 #include <wtf/RefCounted.h>
    30 #include <wtf/text/WTFString.h>
    31 
    32 namespace WebCore {
    33 
    34 class GPUCommandBuffer : public RefCounted<GPUCommandBuffer> {
    35 public:
    36     static Ref<GPUCommandBuffer> create()
    37     {
    38         return adoptRef(*new GPUCommandBuffer());
    39     }
    40 
    41     String label() const;
    42     void setLabel(String&&);
    43 
    44 private:
    45     GPUCommandBuffer()
    46     {
    47     }
     26partial interface GPUDevice {
     27    [Exposed=(Window, DedicatedWorker)]
     28    attribute EventHandler onuncapturederror;
    4829};
    49 
    50 }
  • trunk/Source/WebCore/Modules/WebGPU/GPUError.h

    r285383 r285384  
    2626#pragma once
    2727
    28 #include <wtf/Ref.h>
    29 #include <wtf/RefCounted.h>
    30 #include <wtf/text/WTFString.h>
     28#include "GPUOutOfMemoryError.h"
     29#include "GPUValidationError.h"
     30#include <variant>
     31#include <wtf/RefPtr.h>
    3132
    3233namespace WebCore {
    3334
    34 class GPUCommandBuffer : public RefCounted<GPUCommandBuffer> {
    35 public:
    36     static Ref<GPUCommandBuffer> create()
    37     {
    38         return adoptRef(*new GPUCommandBuffer());
    39     }
    40 
    41     String label() const;
    42     void setLabel(String&&);
    43 
    44 private:
    45     GPUCommandBuffer()
    46     {
    47     }
    48 };
     35using GPUError = std::variant<RefPtr<GPUOutOfMemoryError>, RefPtr<GPUValidationError>>;
    4936
    5037}
  • trunk/Source/WebCore/Modules/WebGPU/GPUErrorFilter.h

    r285383 r285384  
    2626#pragma once
    2727
    28 #include <wtf/Ref.h>
    29 #include <wtf/RefCounted.h>
    30 #include <wtf/text/WTFString.h>
     28#include <cstdint>
    3129
    3230namespace WebCore {
    3331
    34 class GPUCommandBuffer : public RefCounted<GPUCommandBuffer> {
    35 public:
    36     static Ref<GPUCommandBuffer> create()
    37     {
    38         return adoptRef(*new GPUCommandBuffer());
    39     }
    40 
    41     String label() const;
    42     void setLabel(String&&);
    43 
    44 private:
    45     GPUCommandBuffer()
    46     {
    47     }
     32enum class GPUErrorFilter : uint8_t {
     33    OutOfMemory,
     34    Validation
    4835};
    4936
  • trunk/Source/WebCore/Modules/WebGPU/GPUErrorFilter.idl

    r285383 r285384  
    2424 */
    2525
    26 #pragma once
     26// https://gpuweb.github.io/gpuweb/#enumdef-gpuerrorfilter
    2727
    28 #include <wtf/Ref.h>
    29 #include <wtf/RefCounted.h>
    30 #include <wtf/text/WTFString.h>
    31 
    32 namespace WebCore {
    33 
    34 class GPUCommandBuffer : public RefCounted<GPUCommandBuffer> {
    35 public:
    36     static Ref<GPUCommandBuffer> create()
    37     {
    38         return adoptRef(*new GPUCommandBuffer());
    39     }
    40 
    41     String label() const;
    42     void setLabel(String&&);
    43 
    44 private:
    45     GPUCommandBuffer()
    46     {
    47     }
     28[
     29    EnabledBySetting=WebGPU
     30]
     31enum GPUErrorFilter {
     32    "out-of-memory",
     33    "validation"
    4834};
    49 
    50 }
  • trunk/Source/WebCore/Modules/WebGPU/GPUOutOfMemoryError.h

    r285383 r285384  
    2828#include <wtf/Ref.h>
    2929#include <wtf/RefCounted.h>
    30 #include <wtf/text/WTFString.h>
    3130
    3231namespace WebCore {
    3332
    34 class GPUCommandBuffer : public RefCounted<GPUCommandBuffer> {
     33class GPUOutOfMemoryError : public RefCounted<GPUOutOfMemoryError> {
    3534public:
    36     static Ref<GPUCommandBuffer> create()
     35    static Ref<GPUOutOfMemoryError> create()
    3736    {
    38         return adoptRef(*new GPUCommandBuffer());
     37        return adoptRef(*new GPUOutOfMemoryError());
    3938    }
    4039
    41     String label() const;
    42     void setLabel(String&&);
    43 
    4440private:
    45     GPUCommandBuffer()
    46     {
    47     }
     41    GPUOutOfMemoryError() = default;
    4842};
    4943
  • trunk/Source/WebCore/Modules/WebGPU/GPUOutOfMemoryError.idl

    r285383 r285384  
    2424 */
    2525
    26 #pragma once
     26// https://gpuweb.github.io/gpuweb/#gpuoutofmemoryerror
    2727
    28 #include <wtf/Ref.h>
    29 #include <wtf/RefCounted.h>
    30 #include <wtf/text/WTFString.h>
    31 
    32 namespace WebCore {
    33 
    34 class GPUCommandBuffer : public RefCounted<GPUCommandBuffer> {
    35 public:
    36     static Ref<GPUCommandBuffer> create()
    37     {
    38         return adoptRef(*new GPUCommandBuffer());
    39     }
    40 
    41     String label() const;
    42     void setLabel(String&&);
    43 
    44 private:
    45     GPUCommandBuffer()
    46     {
    47     }
     28[
     29    EnabledBySetting=WebGPU,
     30    ImplementationLacksVTable,
     31    Exposed=(Window), /* https://bugs.webkit.org/show_bug.cgi?id=232542: DedicatedWorker */
     32    SecureContext
     33]
     34interface GPUOutOfMemoryError {
     35    constructor();
    4836};
    49 
    50 }
  • trunk/Source/WebCore/Modules/WebGPU/GPUUncapturedErrorEvent.cpp

    r285383 r285384  
    2424 */
    2525
    26 #pragma once
    27 
    28 #include <wtf/Ref.h>
    29 #include <wtf/RefCounted.h>
    30 #include <wtf/text/WTFString.h>
     26#include "config.h"
     27#include "GPUUncapturedErrorEvent.h"
    3128
    3229namespace WebCore {
    3330
    34 class GPUCommandBuffer : public RefCounted<GPUCommandBuffer> {
    35 public:
    36     static Ref<GPUCommandBuffer> create()
    37     {
    38         return adoptRef(*new GPUCommandBuffer());
    39     }
     31GPUUncapturedErrorEvent::GPUUncapturedErrorEvent(String&& type, const GPUUncapturedErrorEventInit&)
     32{
     33    UNUSED_PARAM(type);
     34}
    4035
    41     String label() const;
    42     void setLabel(String&&);
    43 
    44 private:
    45     GPUCommandBuffer()
    46     {
    47     }
    48 };
     36GPUError GPUUncapturedErrorEvent::error() const
     37{
     38    return RefPtr<GPUOutOfMemoryError>(GPUOutOfMemoryError::create());
     39}
    4940
    5041}
     42
     43
  • trunk/Source/WebCore/Modules/WebGPU/GPUUncapturedErrorEvent.h

    r285383 r285384  
    2626#pragma once
    2727
     28#include "Event.h"
     29#include "GPUError.h"
     30#include "GPUUncapturedErrorEventInit.h"
    2831#include <wtf/Ref.h>
    2932#include <wtf/RefCounted.h>
     
    3235namespace WebCore {
    3336
    34 class GPUCommandBuffer : public RefCounted<GPUCommandBuffer> {
     37class GPUUncapturedErrorEvent : public Event {
    3538public:
    36     static Ref<GPUCommandBuffer> create()
     39    static Ref<GPUUncapturedErrorEvent> create(String&& type, const GPUUncapturedErrorEventInit& gpuUncapturedErrorEventInitDict)
    3740    {
    38         return adoptRef(*new GPUCommandBuffer());
     41        return adoptRef(*new GPUUncapturedErrorEvent(WTFMove(type), gpuUncapturedErrorEventInitDict));
    3942    }
    4043
    41     String label() const;
    42     void setLabel(String&&);
     44    GPUError error() const;
    4345
    4446private:
    45     GPUCommandBuffer()
    46     {
    47     }
     47    GPUUncapturedErrorEvent(String&& type, const GPUUncapturedErrorEventInit&);
    4848};
    4949
  • trunk/Source/WebCore/Modules/WebGPU/GPUUncapturedErrorEvent.idl

    r285383 r285384  
    2424 */
    2525
    26 #pragma once
     26// https://gpuweb.github.io/gpuweb/#gpuuncapturederrorevent
    2727
    28 #include <wtf/Ref.h>
    29 #include <wtf/RefCounted.h>
    30 #include <wtf/text/WTFString.h>
     28// https://bugs.webkit.org/show_bug.cgi?id=232548 This shouldn't need to be here.
     29typedef (GPUOutOfMemoryError or GPUValidationError) GPUError;
    3130
    32 namespace WebCore {
    33 
    34 class GPUCommandBuffer : public RefCounted<GPUCommandBuffer> {
    35 public:
    36     static Ref<GPUCommandBuffer> create()
    37     {
    38         return adoptRef(*new GPUCommandBuffer());
    39     }
    40 
    41     String label() const;
    42     void setLabel(String&&);
    43 
    44 private:
    45     GPUCommandBuffer()
    46     {
    47     }
     31[
     32    EnabledBySetting=WebGPU,
     33    Exposed=(Window), /* https://bugs.webkit.org/show_bug.cgi?id=232542: DedicatedWorker */
     34    SecureContext
     35]
     36interface GPUUncapturedErrorEvent : Event {
     37    constructor(
     38        DOMString type,
     39        GPUUncapturedErrorEventInit gpuUncapturedErrorEventInitDict
     40    );
     41    [SameObject] readonly attribute GPUError error;
    4842};
    49 
    50 }
  • trunk/Source/WebCore/Modules/WebGPU/GPUUncapturedErrorEventInit.h

    r285383 r285384  
    2626#pragma once
    2727
    28 #include <wtf/Ref.h>
    29 #include <wtf/RefCounted.h>
    30 #include <wtf/text/WTFString.h>
     28#include "EventInit.h"
     29#include "GPUError.h"
    3130
    3231namespace WebCore {
    3332
    34 class GPUCommandBuffer : public RefCounted<GPUCommandBuffer> {
    35 public:
    36     static Ref<GPUCommandBuffer> create()
    37     {
    38         return adoptRef(*new GPUCommandBuffer());
    39     }
    40 
    41     String label() const;
    42     void setLabel(String&&);
    43 
    44 private:
    45     GPUCommandBuffer()
    46     {
    47     }
     33struct GPUUncapturedErrorEventInit : public EventInit {
     34    GPUError error;
    4835};
    4936
  • trunk/Source/WebCore/Modules/WebGPU/GPUUncapturedErrorEventInit.idl

    r285383 r285384  
    2424 */
    2525
    26 #pragma once
     26// https://gpuweb.github.io/gpuweb/#dictdef-gpuuncapturederroreventinit
    2727
    28 #include <wtf/Ref.h>
    29 #include <wtf/RefCounted.h>
    30 #include <wtf/text/WTFString.h>
     28// https://bugs.webkit.org/show_bug.cgi?id=232548 This shouldn't need to be here.
     29typedef (GPUOutOfMemoryError or GPUValidationError) GPUError;
    3130
    32 namespace WebCore {
    33 
    34 class GPUCommandBuffer : public RefCounted<GPUCommandBuffer> {
    35 public:
    36     static Ref<GPUCommandBuffer> create()
    37     {
    38         return adoptRef(*new GPUCommandBuffer());
    39     }
    40 
    41     String label() const;
    42     void setLabel(String&&);
    43 
    44 private:
    45     GPUCommandBuffer()
    46     {
    47     }
     31[
     32    EnabledBySetting=WebGPU
     33]
     34dictionary GPUUncapturedErrorEventInit : EventInit {
     35    required GPUError error;
    4836};
    49 
    50 }
  • trunk/Source/WebCore/Modules/WebGPU/GPUValidationError.cpp

    r285383 r285384  
    2424 */
    2525
    26 #pragma once
    27 
    28 #include <wtf/Ref.h>
    29 #include <wtf/RefCounted.h>
    30 #include <wtf/text/WTFString.h>
     26#include "config.h"
     27#include "GPUValidationError.h"
    3128
    3229namespace WebCore {
    3330
    34 class GPUCommandBuffer : public RefCounted<GPUCommandBuffer> {
    35 public:
    36     static Ref<GPUCommandBuffer> create()
    37     {
    38         return adoptRef(*new GPUCommandBuffer());
    39     }
     31GPUValidationError::GPUValidationError(String&& message)
     32{
     33    UNUSED_PARAM(message);
     34}
    4035
    41     String label() const;
    42     void setLabel(String&&);
    43 
    44 private:
    45     GPUCommandBuffer()
    46     {
    47     }
    48 };
     36String GPUValidationError::message() const
     37{
     38    return StringImpl::empty();
     39}
    4940
    5041}
     42
     43
  • trunk/Source/WebCore/Modules/WebGPU/GPUValidationError.h

    r285383 r285384  
    2828#include <wtf/Ref.h>
    2929#include <wtf/RefCounted.h>
    30 #include <wtf/text/WTFString.h>
    3130
    3231namespace WebCore {
    3332
    34 class GPUCommandBuffer : public RefCounted<GPUCommandBuffer> {
     33class GPUValidationError : public RefCounted<GPUValidationError> {
    3534public:
    36     static Ref<GPUCommandBuffer> create()
     35    static Ref<GPUValidationError> create(String&& message)
    3736    {
    38         return adoptRef(*new GPUCommandBuffer());
     37        return adoptRef(*new GPUValidationError(WTFMove(message)));
    3938    }
    4039
    41     String label() const;
    42     void setLabel(String&&);
     40    String message() const;
    4341
    4442private:
    45     GPUCommandBuffer()
    46     {
    47     }
     43    GPUValidationError(String&& message);
     44
     45    String m_message;
    4846};
    4947
  • trunk/Source/WebCore/Modules/WebGPU/GPUValidationError.idl

    r285383 r285384  
    2424 */
    2525
    26 #pragma once
    27 
    28 #include <wtf/Ref.h>
    29 #include <wtf/RefCounted.h>
    30 #include <wtf/text/WTFString.h>
    31 
    32 namespace WebCore {
    33 
    34 class GPUCommandBuffer : public RefCounted<GPUCommandBuffer> {
    35 public:
    36     static Ref<GPUCommandBuffer> create()
    37     {
    38         return adoptRef(*new GPUCommandBuffer());
    39     }
    40 
    41     String label() const;
    42     void setLabel(String&&);
    43 
    44 private:
    45     GPUCommandBuffer()
    46     {
    47     }
     26[
     27    EnabledBySetting=WebGPU,
     28    ImplementationLacksVTable,
     29    Exposed=(Window), /* https://bugs.webkit.org/show_bug.cgi?id=232542: DedicatedWorker */
     30    SecureContext
     31]
     32interface GPUValidationError {
     33    constructor(DOMString message);
     34    readonly attribute DOMString message;
    4835};
    49 
    50 }
  • trunk/Source/WebCore/Sources.txt

    r285382 r285384  
    2727Modules/WebGPU/GPUBindGroupLayout.cpp
    2828Modules/WebGPU/GPUBuffer.cpp
     29Modules/WebGPU/GPUCanvasContext.cpp
    2930Modules/WebGPU/GPUCommandBuffer.cpp
    3031Modules/WebGPU/GPUCommandEncoder.cpp
     
    3435Modules/WebGPU/GPUComputePipeline.cpp
    3536Modules/WebGPU/GPUDevice.cpp
     37Modules/WebGPU/GPUDeviceLostInfo.cpp
    3638Modules/WebGPU/GPUExternalTexture.cpp
    3739Modules/WebGPU/GPUPipelineLayout.cpp
     
    4850Modules/WebGPU/GPUTexture.cpp
    4951Modules/WebGPU/GPUTextureView.cpp
     52Modules/WebGPU/GPUUncapturedErrorEvent.cpp
     53Modules/WebGPU/GPUValidationError.cpp
    5054Modules/airplay/WebKitPlaybackTargetAvailabilityEvent.cpp
    5155Modules/applicationmanifest/ApplicationManifestParser.cpp
     
    31113115JSGPUBufferDescriptor.cpp
    31123116JSGPUBufferUsage.cpp
     3117JSGPUCanvasCompositingAlphaMode.cpp
     3118JSGPUCanvasConfiguration.cpp
     3119JSGPUCanvasContext.cpp
    31133120JSGPUColorDict.cpp
    31143121JSGPUColorTargetState.cpp
     
    31323139JSGPUDevice.cpp
    31333140JSGPUDeviceDescriptor.cpp
     3141JSGPUDeviceError.cpp
     3142JSGPUDeviceLost.cpp
     3143JSGPUDeviceLostInfo.cpp
     3144JSGPUDeviceLostReason.cpp
     3145JSGPUDeviceUncapturedError.cpp
     3146JSGPUErrorFilter.cpp
    31343147JSGPUExtent3DDict.cpp
    31353148JSGPUExternalTexture.cpp
     
    31533166JSGPUOrigin2DDict.cpp
    31543167JSGPUOrigin3DDict.cpp
     3168JSGPUOutOfMemoryError.cpp
    31553169JSGPUPipelineBase.cpp
    31563170JSGPUPipelineDescriptorBase.cpp
     
    32083222JSGPUTextureViewDescriptor.cpp
    32093223JSGPUTextureViewDimension.cpp
     3224JSGPUUncapturedErrorEvent.cpp
     3225JSGPUUncapturedErrorEventInit.cpp
     3226JSGPUValidationError.cpp
    32103227JSGPUVertexAttribute.cpp
    32113228JSGPUVertexBufferLayout.cpp
  • trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj

    r285382 r285384  
    70577057                1C289589272F5AC700B3E2B4 /* GPUObjectDescriptorBase.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GPUObjectDescriptorBase.h; sourceTree = "<group>"; };
    70587058                1C28958B272F5AF500B3E2B4 /* GPUPredefinedColorSpace.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GPUPredefinedColorSpace.h; sourceTree = "<group>"; };
     7059                1C2C218527353584009ECA32 /* GPUUncapturedErrorEventInit.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = GPUUncapturedErrorEventInit.idl; sourceTree = "<group>"; };
     7060                1C2C218727353584009ECA32 /* GPUCanvasConfiguration.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GPUCanvasConfiguration.h; sourceTree = "<group>"; };
     7061                1C2C218827353584009ECA32 /* GPUErrorFilter.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GPUErrorFilter.h; sourceTree = "<group>"; };
     7062                1C2C218A27353585009ECA32 /* GPUCanvasContext.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = GPUCanvasContext.idl; sourceTree = "<group>"; };
     7063                1C2C218B27353586009ECA32 /* GPUDeviceLostInfo.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = GPUDeviceLostInfo.idl; sourceTree = "<group>"; };
     7064                1C2C218D27353586009ECA32 /* GPUDeviceLostInfo.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GPUDeviceLostInfo.h; sourceTree = "<group>"; };
     7065                1C2C218E27353587009ECA32 /* GPUValidationError.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = GPUValidationError.idl; sourceTree = "<group>"; };
     7066                1C2C218F27353587009ECA32 /* GPUCanvasContext.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GPUCanvasContext.h; sourceTree = "<group>"; };
     7067                1C2C219027353588009ECA32 /* GPUErrorFilter.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = GPUErrorFilter.idl; sourceTree = "<group>"; };
     7068                1C2C219127353588009ECA32 /* GPUCanvasCompositingAlphaMode.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = GPUCanvasCompositingAlphaMode.idl; sourceTree = "<group>"; };
     7069                1C2C219227353588009ECA32 /* GPUOutOfMemoryError.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GPUOutOfMemoryError.h; sourceTree = "<group>"; };
     7070                1C2C219327353589009ECA32 /* GPUDeviceLostReason.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = GPUDeviceLostReason.idl; sourceTree = "<group>"; };
     7071                1C2C219427353589009ECA32 /* GPUCanvasConfiguration.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = GPUCanvasConfiguration.idl; sourceTree = "<group>"; };
     7072                1C2C219527353589009ECA32 /* GPUCanvasCompositingAlphaMode.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GPUCanvasCompositingAlphaMode.h; sourceTree = "<group>"; };
     7073                1C2C21962735358A009ECA32 /* GPUCanvasContext.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = GPUCanvasContext.cpp; sourceTree = "<group>"; };
     7074                1C2C21972735358A009ECA32 /* GPUUncapturedErrorEvent.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GPUUncapturedErrorEvent.h; sourceTree = "<group>"; };
     7075                1C2C21982735358B009ECA32 /* GPUValidationError.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GPUValidationError.h; sourceTree = "<group>"; };
     7076                1C2C21992735358B009ECA32 /* GPUError.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GPUError.h; sourceTree = "<group>"; };
     7077                1C2C219A2735358B009ECA32 /* GPUDeviceLostReason.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GPUDeviceLostReason.h; sourceTree = "<group>"; };
     7078                1C2C219B2735358C009ECA32 /* GPUDeviceUncapturedError.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = GPUDeviceUncapturedError.idl; sourceTree = "<group>"; };
     7079                1C2C219C2735358C009ECA32 /* GPUOutOfMemoryError.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = GPUOutOfMemoryError.idl; sourceTree = "<group>"; };
     7080                1C2C219D2735358D009ECA32 /* GPUUncapturedErrorEventInit.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GPUUncapturedErrorEventInit.h; sourceTree = "<group>"; };
     7081                1C2C219E2735358D009ECA32 /* GPUUncapturedErrorEvent.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = GPUUncapturedErrorEvent.idl; sourceTree = "<group>"; };
     7082                1C2C21A02735377D009ECA32 /* GPUDeviceLostInfo.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = GPUDeviceLostInfo.cpp; sourceTree = "<group>"; };
     7083                1C2C21A2273537E9009ECA32 /* GPUUncapturedErrorEvent.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = GPUUncapturedErrorEvent.cpp; sourceTree = "<group>"; };
     7084                1C2C21A32735386C009ECA32 /* GPUValidationError.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = GPUValidationError.cpp; sourceTree = "<group>"; };
     7085                1C2C21A527353D1F009ECA32 /* GPUDeviceError.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = GPUDeviceError.idl; sourceTree = "<group>"; };
     7086                1C2C21A727353D2C009ECA32 /* GPUDeviceLost.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = GPUDeviceLost.idl; sourceTree = "<group>"; };
    70597087                1C3249101C6D6A3B007EDB32 /* FontVariantBuilder.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FontVariantBuilder.cpp; sourceTree = "<group>"; };
    70607088                1C3969CF1B74211E002BCFA7 /* FontCacheCoreText.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FontCacheCoreText.cpp; sourceTree = "<group>"; };
     
    1938019408                                1C8127832734C5F50068864F /* GPUBufferUsage.h */,
    1938119409                                1C8127862734C5F60068864F /* GPUBufferUsage.idl */,
     19410                                1C2C219527353589009ECA32 /* GPUCanvasCompositingAlphaMode.h */,
     19411                                1C2C219127353588009ECA32 /* GPUCanvasCompositingAlphaMode.idl */,
     19412                                1C2C218727353584009ECA32 /* GPUCanvasConfiguration.h */,
     19413                                1C2C219427353589009ECA32 /* GPUCanvasConfiguration.idl */,
     19414                                1C2C21962735358A009ECA32 /* GPUCanvasContext.cpp */,
     19415                                1C2C218F27353587009ECA32 /* GPUCanvasContext.h */,
     19416                                1C2C218A27353585009ECA32 /* GPUCanvasContext.idl */,
    1938219417                                1CA4FD1427351FC10027FD5A /* GPUColorDict.h */,
    1938319418                                1CA4FCF027351FB30027FD5A /* GPUColorDict.idl */,
     
    1942919464                                1C28957C272F407800B3E2B4 /* GPUDeviceDescriptor.h */,
    1943019465                                1C28956C272F27DA00B3E2B4 /* GPUDeviceDescriptor.idl */,
     19466                                1C2C21A527353D1F009ECA32 /* GPUDeviceError.idl */,
     19467                                1C2C21A727353D2C009ECA32 /* GPUDeviceLost.idl */,
     19468                                1C2C21A02735377D009ECA32 /* GPUDeviceLostInfo.cpp */,
     19469                                1C2C218D27353586009ECA32 /* GPUDeviceLostInfo.h */,
     19470                                1C2C218B27353586009ECA32 /* GPUDeviceLostInfo.idl */,
     19471                                1C2C219A2735358B009ECA32 /* GPUDeviceLostReason.h */,
     19472                                1C2C219327353589009ECA32 /* GPUDeviceLostReason.idl */,
     19473                                1C2C219B2735358C009ECA32 /* GPUDeviceUncapturedError.idl */,
     19474                                1C2C21992735358B009ECA32 /* GPUError.h */,
     19475                                1C2C218827353584009ECA32 /* GPUErrorFilter.h */,
     19476                                1C2C219027353588009ECA32 /* GPUErrorFilter.idl */,
    1943119477                                1C81279B2734D8970068864F /* GPUExtent3DDict.h */,
    1943219478                                1C8127B02734D8A00068864F /* GPUExtent3DDict.idl */,
     
    1947219518                                1CA4FD1227351FC00027FD5A /* GPUOrigin3DDict.h */,
    1947319519                                1CA4FD3227351FCD0027FD5A /* GPUOrigin3DDict.idl */,
     19520                                1C2C219227353588009ECA32 /* GPUOutOfMemoryError.h */,
     19521                                1C2C219C2735358C009ECA32 /* GPUOutOfMemoryError.idl */,
    1947419522                                1CA4FCB627350CEC0027FD5A /* GPUPipelineBase.idl */,
    1947519523                                1CA4FCC427350CF10027FD5A /* GPUPipelineDescriptorBase.h */,
     
    1959219640                                1C8127A62734D89C0068864F /* GPUTextureViewDimension.h */,
    1959319641                                1C8127AB2734D89E0068864F /* GPUTextureViewDimension.idl */,
     19642                                1C2C21A2273537E9009ECA32 /* GPUUncapturedErrorEvent.cpp */,
     19643                                1C2C21972735358A009ECA32 /* GPUUncapturedErrorEvent.h */,
     19644                                1C2C219E2735358D009ECA32 /* GPUUncapturedErrorEvent.idl */,
     19645                                1C2C219D2735358D009ECA32 /* GPUUncapturedErrorEventInit.h */,
     19646                                1C2C218527353584009ECA32 /* GPUUncapturedErrorEventInit.idl */,
     19647                                1C2C21A32735386C009ECA32 /* GPUValidationError.cpp */,
     19648                                1C2C21982735358B009ECA32 /* GPUValidationError.h */,
     19649                                1C2C218E27353587009ECA32 /* GPUValidationError.idl */,
    1959419650                                1CA4FCBC27350CEE0027FD5A /* GPUVertexAttribute.h */,
    1959519651                                1CA4FCAB27350CE80027FD5A /* GPUVertexAttribute.idl */,
  • trunk/Source/WebCore/bindings/js/WebCoreBuiltinNames.h

    r285382 r285384  
    133133    macro(GPUBuffer) \
    134134    macro(GPUBufferUsage) \
     135    macro(GPUCanvasContext) \
    135136    macro(GPUColorWrite) \
    136137    macro(GPUCommandBuffer) \
     
    141142    macro(GPUComputePipeline) \
    142143    macro(GPUDevice) \
     144    macro(GPUDeviceLostInfo) \
    143145    macro(GPUExternalTexture) \
    144146    macro(GPUMapMode) \
     147    macro(GPUOutOfMemoryError) \
    145148    macro(GPUPipelineLayout) \
    146149    macro(GPUQuerySet) \
     
    158161    macro(GPUTextureUsage) \
    159162    macro(GPUTextureView) \
     163    macro(GPUUncapturedErrorEvent) \
     164    macro(GPUValidationError) \
    160165    macro(Gamepad) \
    161166    macro(GamepadButton) \
Note: See TracChangeset for help on using the changeset viewer.