haikuwebkit/Source/WebCore/html/canvas/CanvasTextDrawingStyles.idl

34 lines
1.7 KiB
Plaintext
Raw Permalink Normal View History

[Canvas] Split CanvasRenderingContext2D.idl into separate IDLs to match current HTML spec https://bugs.webkit.org/show_bug.cgi?id=176276 Reviewed by Dean Jackson. Source/WebCore: - Splits CanvasRenderingContext2D.idl out into: CanvasState CanvasTransform CanvasCompositing CanvasImageSmoothing CanvasFillStrokeStyles CanvasShadowStyles CanvasFilters CanvasRect CanvasDrawPath CanvasUserInterface CanvasText CanvasDrawImage CanvasImageData CanvasPathDrawingStyles CanvasTextDrawingStyles - Renames CanvasWindingRule enum to CanvasFillRule, and moves it to its own file so it can be reused by multiple IDLs. - Renames DOMPath to Path2D, which is what it is supposed to be called, and doesn't conflict with any WebCore names. - Converts lineCap, lineJoin, textAlign, textBaseline, direction to use enums, rather than DOMStrings, allowing us to remove a bunch of custom parsing. - Non-standard canvas API was grouped with related functionality in the broken out IDLs and clearly marked as non-standard. - Comments were added for places where we break with the standard, mostly around use of float where we should be using double. * CMakeLists.txt: * DerivedSources.cpp: * DerivedSources.make: * WebCore.xcodeproj/project.pbxproj: Add new files. * bindings/js/CallTracerTypes.h: * inspector/InspectorCanvas.cpp: (WebCore::InspectorCanvas::buildInitialState): (WebCore::InspectorCanvas::buildAction): Update for renames, and use new convertEnumerationToString to serialize enumerations. * bindings/scripts/CodeGeneratorJS.pm: (GenerateEnumerationImplementationContent): (GenerateEnumerationHeaderContent): Split string conversion out of convertEnumerationToJS, and into its own function, convertEnumerationToString, to allow serialization to string outside of the bindings context, in this case, for the InspectorCanvas. (GenerateParametersCheck): Improve error message to make it clear which operation has the issue in order to make debugging easier. * html/ImageData.idl: Re-order constructors to match specification, and add FIXME for incorrect default argument. * html/TextMetrics.idl: Add spec'd exposure and spec comments, as well a FIXME to convert the unrestricted float parameters should be doubles. * html/canvas/CanvasCompositing.idl: Added. * html/canvas/CanvasDirection.h: Added. * html/canvas/CanvasDirection.idl: Added. * html/canvas/CanvasDrawImage.idl: Added. * html/canvas/CanvasDrawPath.idl: Added. * html/canvas/CanvasFillRule.h: Added. * html/canvas/CanvasFillRule.idl: Added. * html/canvas/CanvasFillStrokeStyles.idl: Added. * html/canvas/CanvasFilters.idl: Added. * html/canvas/CanvasImageData.idl: Added. * html/canvas/CanvasImageSmoothing.idl: Added. * html/canvas/CanvasLineCap.h: Added. * html/canvas/CanvasLineCap.idl: Added. * html/canvas/CanvasLineJoin.h: Added. * html/canvas/CanvasLineJoin.idl: Added. * html/canvas/CanvasPathDrawingStyles.idl: Added. * html/canvas/CanvasRect.idl: Added. * html/canvas/CanvasShadowStyles.idl: Added. * html/canvas/CanvasState.idl: Added. * html/canvas/CanvasText.idl: Added. * html/canvas/CanvasTextAlign.h: Added. * html/canvas/CanvasTextAlign.idl: Added. * html/canvas/CanvasTextBaseline.h: Added. * html/canvas/CanvasTextBaseline.idl: Added. * html/canvas/CanvasTextDrawingStyles.idl: Added. * html/canvas/CanvasTransform.idl: Added. * html/canvas/CanvasUserInterface.idl: Added. * html/canvas/ImageSmoothingQuality.h: Added. * html/canvas/ImageSmoothingQuality.idl: Added. Move CanvasRenderingContext2D.idl content into separate files to match the specification. * html/canvas/CanvasGradient.idl: * html/canvas/CanvasPath.idl: * html/canvas/CanvasPattern.idl: Add exposure and FIXMEs on changes need to match the spec. * html/canvas/CanvasRenderingContext2D.cpp: * html/canvas/CanvasRenderingContext2D.h: Switch to using enums for lineCap, lineJoin, textAlign, textBaseline, and direction. Rather than using the parsing / stringifying functions from GraphicsTypes, add simple switch based to/from converters to convert to/from the canvas type to the platform type. Also update for rename of DOMPath -> Path2D and WindingRule -> CanvasFillRule. Unfortunately, not all custom parsing could be removed. To support the legacy functions setLineCap and setLineJoin, which take Strings, two simply parse paths had to be brought back. They can't use the enums, because the rules for enums as parameters is stricter that what was implemented in the custom code (e.g. the bindings would have thrown for strings not in the enum set). * html/canvas/CanvasRenderingContext2D.idl: Move most of the functions into the new files, which are then 'implemented' by this. * html/canvas/DOMPath.cpp: Removed. * html/canvas/DOMPath.h: Removed. * html/canvas/DOMPath.idl: Removed. * html/canvas/Path2D.cpp: Copied from Source/WebCore/html/canvas/DOMPath.cpp. * html/canvas/Path2D.h: Copied from Source/WebCore/html/canvas/DOMPath.h. * html/canvas/Path2D.idl: Copied from Source/WebCore/html/canvas/DOMPath.idl. Rename DOMPath to Path2D to match the spec.. * platform/graphics/GraphicsTypes.cpp: (WebCore::parseLineCap): Deleted. (WebCore::lineCapName): Deleted. (WebCore::parseLineJoin): Deleted. (WebCore::lineJoinName): Deleted. (WebCore::textAlignName): Deleted. (WebCore::parseTextAlign): Deleted. (WebCore::textBaselineName): Deleted. (WebCore::parseTextBaseline): Deleted. * platform/graphics/GraphicsTypes.h: Remove now unused parsing / stringifying functions. * testing/Internals.cpp: Remove unused #include. * bindings/scripts/test/JS/JSTestCallbackInterface.cpp: * bindings/scripts/test/JS/JSTestCallbackInterface.h: * bindings/scripts/test/JS/JSTestObj.cpp: * bindings/scripts/test/JS/JSTestObj.h: * bindings/scripts/test/JS/JSTestStandaloneDictionary.cpp: * bindings/scripts/test/JS/JSTestStandaloneDictionary.h: * bindings/scripts/test/JS/JSTestStandaloneEnumeration.cpp: * bindings/scripts/test/JS/JSTestStandaloneEnumeration.h: Update test results to add convertEnumerationToString. LayoutTests: * fast/canvas/canvas-clip-path-expected.txt: * fast/canvas/canvas-fill-path-expected.txt: * fast/canvas/canvas-path-addPath-expected.txt: * fast/canvas/canvas-path-isPointInPath-expected.txt: * fast/canvas/canvas-path-isPointInStroke-expected.txt: * fast/canvas/canvas-stroke-path-expected.txt: * fast/canvas/winding-enumeration-expected.txt: * inspector/canvas/recording-2d-expected.txt: * js/dom/global-constructors-attributes-dedicated-worker-expected.txt: Update results. Canonical link: https://commits.webkit.org/192969@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@221598 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-09-05 00:23:03 +00:00
/*
* Copyright (C) 2017 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*/
[WebIDL] Add support for interface mixins https://bugs.webkit.org/show_bug.cgi?id=216217 Reviewed by Darin Adler. Implement support for WebIDL interface mixins, which are interface fragments that can be included into other interfaces (using an 'includes' statement), but do not create new types themselves. Prior to this, we have been emulating the behavior by allowing any interface to be included in another interface, and marking some interfaces with the [LegacyNoInterfaceObject] extended attribute. This change codifies that with in the spec approved way. - Updates IDL parser to parse mixin interfaces (and fixes the parsing of callback interfaces to be a bit more strict while I was there). - Updates IDL pre-processor to avoid creating global variables and IsoSubspaces for mixins. - Updates IDL code generator to only support including mixin interfaces during supplemental inclusion. - Updates IDL files to use interface mixin where appropriately specified. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * CMakeLists.txt: * DerivedSources-output.xcfilelist: * DerivedSources.make: * dom/DeviceOrientationOrMotionEvent.idl: Removed. Remove DeviceOrientationOrMotionEvent.idl and corresponding generated files, inlining it into DeviceMotionEvent.idl and DeviceOrientationEvent.idl as specified. This is needed as mixin interfaces do not support static operations or attributes. * bindings/scripts/CodeGenerator.pm: (IsValidSupplementalInterface): (IsValidSupplementalDictionary): (ProcessSupplementalDependencies): (GetInterfaceExtendedAttributesFromName): Update IDL code generator to only support including mixin interfaces during supplemental inclusion. Also removes some left of remnents of exception interface support. * bindings/scripts/IDLParser.pm: (parseCallbackRestOrInterface): (parseCallbackInterface): (parseCallbackInterfaceMembers): (parseCallbackInterfaceMember): (parseMixin): (parseMixinMembers): (parseMixinMember): (parseNamespace): (parsePartialInterfaceMember): (parseAttributeOrOperationForStringifierOrStatic): Update IDL parser to parse mixin interfaces and fix the parsing of callback interfaces to match the spec by restricting its members to constants and regular functions. * bindings/scripts/preprocess-idls.pl: (isMixinInterfaceFromIDL): (containsInterfaceFromIDL): (getInterfaceExtendedAttributesFromIDL): (containsInterfaceOrExceptionFromIDL): Deleted. Ensure mixin interfaces don't get exposed on any global objects and remove some left of remnents of exception interface support. * bindings/scripts/test/JS/JSTestInterface.cpp: * bindings/scripts/test/JS/JSTestLegacyNoInterfaceObject.cpp: Added. * bindings/scripts/test/JS/JSTestLegacyNoInterfaceObject.h: Added. * bindings/scripts/test/SupplementalDependencies.dep: * bindings/scripts/test/TestIncludes.idl: * bindings/scripts/test/TestLegacyNoInterfaceObject.idl: Added. * bindings/scripts/test/TestOperationBase.idl: Update bindings tests to use mixins for includes. Add new dedicated [LegacyNoInterfaceObject] since it was no longer being tested. * Modules/fetch/FetchBody.idl: * Modules/mediasource/VideoPlaybackQuality.idl: * Modules/speech/SpeechSynthesis.idl: * Modules/speech/SpeechSynthesisVoice.idl: * Modules/streams/ReadableStreamSink.idl: * accessibility/AccessibilityRole.idl: * accessibility/AriaAttributes.idl: * animation/Animatable.idl: * css/ElementCSSInlineStyle.idl: * css/StyleMedia.idl: * dom/ChildNode.idl: * dom/DeviceMotionEvent.idl: * dom/DeviceOrientationEvent.idl: * dom/Document.idl: * dom/DocumentAndElementEventHandlers.idl: * dom/DocumentOrShadowRoot.idl: * dom/EventListener.idl: * dom/GlobalEventHandlers.idl: * dom/NavigatorMaxTouchPoints.idl: * dom/NonDocumentTypeChildNode.idl: * dom/NonElementParentNode.idl: * dom/ParentNode.idl: * dom/Slotable.idl: * html/HTMLHyperlinkElementUtils.idl: * html/HTMLOrForeignElement.idl: * html/canvas/CanvasCompositing.idl: * html/canvas/CanvasDrawImage.idl: * html/canvas/CanvasDrawPath.idl: * html/canvas/CanvasFillStrokeStyles.idl: * html/canvas/CanvasFilters.idl: * html/canvas/CanvasGradient.idl: * html/canvas/CanvasImageData.idl: * html/canvas/CanvasImageSmoothing.idl: * html/canvas/CanvasPath.idl: * html/canvas/CanvasPathDrawingStyles.idl: * html/canvas/CanvasRect.idl: * html/canvas/CanvasShadowStyles.idl: * html/canvas/CanvasState.idl: * html/canvas/CanvasText.idl: * html/canvas/CanvasTextDrawingStyles.idl: * html/canvas/CanvasTransform.idl: * html/canvas/CanvasUserInterface.idl: * html/canvas/WebGLRenderingContextBase.idl: * page/GlobalCrypto.idl: * page/GlobalPerformance.idl: * page/Navigator.idl: * page/NavigatorID.idl: * page/NavigatorLanguage.idl: * page/NavigatorOnLine.idl: * page/NavigatorPlugins.idl: * page/NavigatorServiceWorker.idl: * page/NavigatorShare.idl: * page/WindowEventHandlers.idl: * page/WindowOrWorkerGlobalScope.idl: * svg/SVGFilterPrimitiveStandardAttributes.idl: * svg/SVGFitToViewBox.idl: * svg/SVGTests.idl: * svg/SVGURIReference.idl: * svg/SVGZoomAndPan.idl: * workers/AbstractWorker.idl: * xml/XPathEvaluator.idl: * xml/XPathNSResolver.idl: Update IDLs. Canonical link: https://commits.webkit.org/229047@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@266678 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-09-06 02:49:22 +00:00
// https://html.spec.whatwg.org/multipage/canvas.html#canvastextdrawingstyles
[WebIDL] Make Exposed mandatory for IDL interfaces https://bugs.webkit.org/show_bug.cgi?id=217101 Reviewed by Darin Adler. Add [Exposed] to all IDL interfaces that were missing it and enforce its requirement. * bindings/scripts/CodeGeneratorJS.pm: * bindings/scripts/preprocess-idls.pl: Remove default "Window" exposed behavior and require it on all interfaces and callback interfaces with constants that don't specify LegacyNoInterfaceObject. * Modules/airplay/WebKitPlaybackTargetAvailabilityEvent.idl: * Modules/applepay/ApplePayError.idl: * Modules/applepay/ApplePaySession.idl: * Modules/applepay/ApplePaySetup.idl: * Modules/applepay/ApplePaySetupFeature.idl: * Modules/encryptedmedia/MediaKeyEncryptionScheme.idl: * Modules/encryptedmedia/MediaKeyMessageEvent.idl: * Modules/encryptedmedia/MediaKeySession.idl: * Modules/encryptedmedia/MediaKeySessionType.idl: * Modules/encryptedmedia/MediaKeyStatusMap.idl: * Modules/encryptedmedia/MediaKeySystemAccess.idl: * Modules/encryptedmedia/MediaKeys.idl: * Modules/encryptedmedia/MediaKeysRequirement.idl: * Modules/encryptedmedia/legacy/WebKitMediaKeyMessageEvent.idl: * Modules/encryptedmedia/legacy/WebKitMediaKeyNeededEvent.idl: * Modules/encryptedmedia/legacy/WebKitMediaKeySession.idl: * Modules/encryptedmedia/legacy/WebKitMediaKeys.idl: * Modules/entriesapi/DOMFileSystem.idl: * Modules/entriesapi/FileSystemDirectoryEntry.idl: * Modules/entriesapi/FileSystemDirectoryReader.idl: * Modules/entriesapi/FileSystemEntry.idl: * Modules/entriesapi/FileSystemFileEntry.idl: * Modules/gamepad/Gamepad.idl: * Modules/gamepad/GamepadButton.idl: * Modules/gamepad/GamepadEvent.idl: * Modules/geolocation/Geolocation.idl: * Modules/geolocation/GeolocationCoordinates.idl: * Modules/geolocation/GeolocationPosition.idl: * Modules/geolocation/GeolocationPositionError.idl: * Modules/geolocation/PositionOptions.idl: * Modules/highlight/HighlightMap.idl: * Modules/highlight/HighlightRangeGroup.idl: * Modules/mediacapabilities/AudioConfiguration.idl: * Modules/mediacapabilities/MediaCapabilities.idl: * Modules/mediacapabilities/MediaCapabilitiesDecodingInfo.idl: * Modules/mediacapabilities/MediaCapabilitiesEncodingInfo.idl: * Modules/mediacapabilities/MediaCapabilitiesInfo.idl: * Modules/mediacapabilities/MediaDecodingConfiguration.idl: * Modules/mediacapabilities/MediaEncodingConfiguration.idl: * Modules/mediacapabilities/VideoConfiguration.idl: * Modules/mediasource/MediaSource.idl: * Modules/mediasource/SourceBuffer.idl: * Modules/mediasource/SourceBufferList.idl: * Modules/mediastream/CanvasCaptureMediaStreamTrack.idl: * Modules/mediastream/MediaDeviceInfo.idl: * Modules/mediastream/MediaDevices.idl: * Modules/mediastream/MediaStream.idl: * Modules/mediastream/MediaStreamTrack.idl: * Modules/mediastream/MediaStreamTrackEvent.idl: * Modules/mediastream/OverconstrainedError.idl: * Modules/mediastream/OverconstrainedErrorEvent.idl: * Modules/mediastream/RTCCertificate.idl: * Modules/mediastream/RTCConfiguration.idl: * Modules/mediastream/RTCDTMFSender.idl: * Modules/mediastream/RTCDTMFToneChangeEvent.idl: * Modules/mediastream/RTCDataChannel.idl: * Modules/mediastream/RTCDataChannelEvent.idl: * Modules/mediastream/RTCIceCandidate.idl: * Modules/mediastream/RTCIceTransport.idl: * Modules/mediastream/RTCPeerConnection.idl: * Modules/mediastream/RTCPeerConnectionIceEvent.idl: * Modules/mediastream/RTCRtpReceiver.idl: * Modules/mediastream/RTCRtpSender.idl: * Modules/mediastream/RTCRtpTransceiver.idl: * Modules/mediastream/RTCSessionDescription.idl: * Modules/mediastream/RTCStatsReport.idl: * Modules/mediastream/RTCTrackEvent.idl: * Modules/notifications/Notification.idl: * Modules/paymentrequest/PaymentRequest.idl: * Modules/remoteplayback/RemotePlayback.idl: * Modules/speech/SpeechSynthesis.idl: * Modules/speech/SpeechSynthesisEvent.idl: * Modules/speech/SpeechSynthesisUtterance.idl: * Modules/speech/SpeechSynthesisVoice.idl: * Modules/webaudio/AnalyserNode.idl: * Modules/webaudio/AudioBuffer.idl: * Modules/webaudio/AudioBufferSourceNode.idl: * Modules/webaudio/AudioContext.idl: * Modules/webaudio/AudioDestinationNode.idl: * Modules/webaudio/AudioListener.idl: * Modules/webaudio/AudioNode.idl: * Modules/webaudio/AudioParam.idl: * Modules/webaudio/AudioParamMap.idl: * Modules/webaudio/AudioProcessingEvent.idl: * Modules/webaudio/AudioScheduledSourceNode.idl: * Modules/webaudio/BaseAudioContext.idl: * Modules/webaudio/BiquadFilterNode.idl: * Modules/webaudio/ChannelMergerNode.idl: * Modules/webaudio/ChannelSplitterNode.idl: * Modules/webaudio/ConstantSourceNode.idl: * Modules/webaudio/ConvolverNode.idl: * Modules/webaudio/DelayNode.idl: * Modules/webaudio/DynamicsCompressorNode.idl: * Modules/webaudio/GainNode.idl: * Modules/webaudio/IIRFilterNode.idl: * Modules/webaudio/MediaElementAudioSourceNode.idl: * Modules/webaudio/MediaStreamAudioDestinationNode.idl: * Modules/webaudio/MediaStreamAudioSourceNode.idl: * Modules/webaudio/OfflineAudioCompletionEvent.idl: * Modules/webaudio/OfflineAudioContext.idl: * Modules/webaudio/OscillatorNode.idl: * Modules/webaudio/PannerNode.idl: * Modules/webaudio/PeriodicWave.idl: * Modules/webaudio/ScriptProcessorNode.idl: * Modules/webaudio/StereoPannerNode.idl: * Modules/webaudio/WaveShaperNode.idl: * Modules/webaudio/WebKitAudioContext.idl: * Modules/webaudio/WebKitAudioPannerNode.idl: * Modules/webaudio/WebKitOfflineAudioContext.idl: * Modules/webdatabase/Database.idl: * Modules/webdatabase/SQLError.idl: * Modules/webdatabase/SQLResultSet.idl: * Modules/webdatabase/SQLResultSetRowList.idl: * Modules/webdatabase/SQLTransaction.idl: * Modules/webgpu/GPUBufferUsage.idl: * Modules/webgpu/GPUCanvasContext.idl: * Modules/webgpu/GPUColorWrite.idl: * Modules/webgpu/GPUOutOfMemoryError.idl: * Modules/webgpu/GPUShaderStage.idl: * Modules/webgpu/GPUTextureUsage.idl: * Modules/webgpu/GPUValidationError.idl: * Modules/webgpu/Navigator+GPU.idl: * Modules/webgpu/WebGPU.idl: * Modules/webgpu/WebGPUAdapter.idl: * Modules/webgpu/WebGPUBindGroup.idl: * Modules/webgpu/WebGPUBindGroupLayout.idl: * Modules/webgpu/WebGPUBuffer.idl: * Modules/webgpu/WebGPUCommandBuffer.idl: * Modules/webgpu/WebGPUCommandEncoder.idl: * Modules/webgpu/WebGPUComputePassEncoder.idl: * Modules/webgpu/WebGPUComputePipeline.idl: * Modules/webgpu/WebGPUDevice.idl: * Modules/webgpu/WebGPUPipelineLayout.idl: * Modules/webgpu/WebGPUProgrammablePassEncoder.idl: * Modules/webgpu/WebGPUQueue.idl: * Modules/webgpu/WebGPURenderPassEncoder.idl: * Modules/webgpu/WebGPURenderPipeline.idl: * Modules/webgpu/WebGPUSampler.idl: * Modules/webgpu/WebGPUShaderModule.idl: * Modules/webgpu/WebGPUSwapChain.idl: * Modules/webgpu/WebGPUTexture.idl: * Modules/webgpu/WebGPUTextureView.idl: * Modules/webxr/XRInputSourceEvent.idl: * Modules/webxr/XRInputSourcesChangeEvent.idl: * Modules/webxr/XRReferenceSpaceEvent.idl: * Modules/webxr/XRSessionEvent.idl: * WebCore.xcodeproj/project.pbxproj: * animation/AnimationPlaybackEvent.idl: * animation/AnimationTimeline.idl: * animation/DocumentTimeline.idl: * animation/WebAnimation.idl: * css/CSSConditionRule.idl: * css/CSSFontFaceRule.idl: * css/CSSGroupingRule.idl: * css/CSSImportRule.idl: * css/CSSKeyframeRule.idl: * css/CSSKeyframesRule.idl: * css/CSSMediaRule.idl: * css/CSSNamespaceRule.idl: * css/CSSPageRule.idl: * css/CSSRuleList.idl: * css/CSSStyleDeclaration.idl: * css/CSSStyleRule.idl: * css/CSSStyleSheet.idl: * css/CSSSupportsRule.idl: * css/DOMCSSNamespace.idl: * css/DeprecatedCSSOMCounter.idl: * css/DeprecatedCSSOMPrimitiveValue.idl: * css/DeprecatedCSSOMRGBColor.idl: * css/DeprecatedCSSOMRect.idl: * css/DeprecatedCSSOMValue.idl: * css/DeprecatedCSSOMValueList.idl: * css/FontFace.idl: * css/FontFaceSet.idl: * css/MediaQueryListEvent.idl: * css/typedom/StylePropertyMap.idl: * dom/AbortAlgorithm.idl: * dom/AnimationEvent.idl: * dom/Attr.idl: * dom/BeforeLoadEvent.idl: * dom/BeforeUnloadEvent.idl: * dom/CDATASection.idl: * dom/CharacterData.idl: * dom/ClipboardEvent.idl: * dom/Comment.idl: * dom/CompositionEvent.idl: * dom/CustomElementRegistry.idl: * dom/DOMImplementation.idl: * dom/DOMRectList.idl: * dom/DOMStringList.idl: * dom/DOMStringMap.idl: * dom/DataTransfer.idl: * dom/DataTransferItem.idl: * dom/DataTransferItemList.idl: * dom/DeviceMotionEvent.idl: * dom/DeviceOrientationEvent.idl: * dom/Document.idl: * dom/DocumentFragment.idl: * dom/DocumentType.idl: * dom/DragEvent.idl: * dom/Element.idl: * dom/FocusEvent.idl: * dom/HashChangeEvent.idl: * dom/IdleDeadline.idl: * dom/InputEvent.idl: * dom/KeyboardEvent.idl: * dom/MouseEvent.idl: * dom/MutationEvent.idl: * dom/MutationObserver.idl: * dom/MutationRecord.idl: * dom/NamedNodeMap.idl: * dom/Node.idl: * dom/NodeFilter.idl: * dom/NodeIterator.idl: * dom/NodeList.idl: * dom/OverflowEvent.idl: * dom/PageTransitionEvent.idl: * dom/PopStateEvent.idl: * dom/ProcessingInstruction.idl: * dom/Range.idl: * dom/SecurityPolicyViolationEvent.idl: * dom/ShadowRoot.idl: * dom/StaticRange.idl: * dom/Text.idl: * dom/TextEvent.idl: * dom/Touch.idl: * dom/TouchEvent.idl: * dom/TouchList.idl: * dom/TransitionEvent.idl: * dom/TreeWalker.idl: * dom/UIEvent.idl: * dom/WebKitAnimationEvent.idl: * dom/WebKitTransitionEvent.idl: * dom/WheelEvent.idl: * dom/XMLDocument.idl: * html/DOMTokenList.idl: * html/HTMLAllCollection.idl: * html/HTMLAnchorElement.idl: * html/HTMLAppletElement.idl: * html/HTMLAreaElement.idl: * html/HTMLAttachmentElement.idl: * html/HTMLAudioElement.idl: * html/HTMLBRElement.idl: * html/HTMLBaseElement.idl: * html/HTMLBodyElement.idl: * html/HTMLButtonElement.idl: * html/HTMLCanvasElement.idl: * html/HTMLCollection.idl: * html/HTMLDListElement.idl: * html/HTMLDataElement.idl: * html/HTMLDataListElement.idl: * html/HTMLDetailsElement.idl: * html/HTMLDirectoryElement.idl: * html/HTMLDivElement.idl: * html/HTMLDocument.idl: * html/HTMLElement.idl: * html/HTMLEmbedElement.idl: * html/HTMLFieldSetElement.idl: * html/HTMLFontElement.idl: * html/HTMLFormControlsCollection.idl: * html/HTMLFormElement.idl: * html/HTMLFrameElement.idl: * html/HTMLFrameSetElement.idl: * html/HTMLHRElement.idl: * html/HTMLHeadElement.idl: * html/HTMLHeadingElement.idl: * html/HTMLHtmlElement.idl: * html/HTMLIFrameElement.idl: * html/HTMLImageElement.idl: * html/HTMLInputElement.idl: * html/HTMLKeygenElement.idl: * html/HTMLLIElement.idl: * html/HTMLLabelElement.idl: * html/HTMLLegendElement.idl: * html/HTMLLinkElement.idl: * html/HTMLMapElement.idl: * html/HTMLMarqueeElement.idl: * html/HTMLMediaElement.idl: * html/HTMLMenuElement.idl: * html/HTMLMenuItemElement.idl: * html/HTMLMetaElement.idl: * html/HTMLMeterElement.idl: * html/HTMLModElement.idl: * html/HTMLOListElement.idl: * html/HTMLObjectElement.idl: * html/HTMLOptGroupElement.idl: * html/HTMLOptionElement.idl: * html/HTMLOptionsCollection.idl: * html/HTMLOutputElement.idl: * html/HTMLParagraphElement.idl: * html/HTMLParamElement.idl: * html/HTMLPictureElement.idl: * html/HTMLPreElement.idl: * html/HTMLProgressElement.idl: * html/HTMLQuoteElement.idl: * html/HTMLScriptElement.idl: * html/HTMLSelectElement.idl: * html/HTMLSlotElement.idl: * html/HTMLSourceElement.idl: * html/HTMLSpanElement.idl: * html/HTMLStyleElement.idl: * html/HTMLTableCaptionElement.idl: * html/HTMLTableCellElement.idl: * html/HTMLTableColElement.idl: * html/HTMLTableElement.idl: * html/HTMLTableRowElement.idl: * html/HTMLTableSectionElement.idl: * html/HTMLTemplateElement.idl: * html/HTMLTextAreaElement.idl: * html/HTMLTimeElement.idl: * html/HTMLTitleElement.idl: * html/HTMLTrackElement.idl: * html/HTMLUListElement.idl: * html/HTMLUnknownElement.idl: * html/HTMLVideoElement.idl: * html/MediaController.idl: * html/MediaEncryptedEvent.idl: * html/MediaError.idl: * html/RadioNodeList.idl: * html/TimeRanges.idl: * html/ValidityState.idl: * html/WebKitMediaKeyError.idl: * html/canvas/CanvasCompositing.idl: * html/canvas/CanvasDrawImage.idl: * html/canvas/CanvasDrawPath.idl: * html/canvas/CanvasFillStrokeStyles.idl: * html/canvas/CanvasFilters.idl: * html/canvas/CanvasImageData.idl: * html/canvas/CanvasImageSmoothing.idl: * html/canvas/CanvasPath.idl: * html/canvas/CanvasPathDrawingStyles.idl: * html/canvas/CanvasRect.idl: * html/canvas/CanvasRenderingContext2D.idl: * html/canvas/CanvasShadowStyles.idl: * html/canvas/CanvasState.idl: * html/canvas/CanvasText.idl: * html/canvas/CanvasTextDrawingStyles.idl: * html/canvas/CanvasTransform.idl: * html/canvas/CanvasUserInterface.idl: * html/canvas/PaintRenderingContext2D.idl: * html/canvas/WebGLActiveInfo.idl: * html/canvas/WebGLBuffer.idl: * html/canvas/WebGLContextEvent.idl: * html/canvas/WebGLFramebuffer.idl: * html/canvas/WebGLProgram.idl: * html/canvas/WebGLQuery.idl: * html/canvas/WebGLRenderbuffer.idl: * html/canvas/WebGLSampler.idl: * html/canvas/WebGLShader.idl: * html/canvas/WebGLShaderPrecisionFormat.idl: * html/canvas/WebGLSync.idl: * html/canvas/WebGLTexture.idl: * html/canvas/WebGLTransformFeedback.idl: * html/canvas/WebGLUniformLocation.idl: * html/canvas/WebGLVertexArrayObject.idl: * html/track/AudioTrack.idl: * html/track/AudioTrackList.idl: * html/track/DataCue.idl: * html/track/TextTrack.idl: * html/track/TextTrackCue.idl: * html/track/TextTrackCueGeneric.idl: * html/track/TextTrackCueList.idl: * html/track/TextTrackList.idl: * html/track/TrackEvent.idl: * html/track/VTTCue.idl: * html/track/VTTRegion.idl: * html/track/VTTRegionList.idl: * html/track/VideoTrack.idl: * html/track/VideoTrackList.idl: * loader/appcache/DOMApplicationCache.idl: * mathml/MathMLElement.idl: * mathml/MathMLMathElement.idl: * page/BarProp.idl: * page/Crypto.idl: * page/DOMSelection.idl: * page/DOMWindow.idl: * page/GlobalCrypto.idl: * page/GlobalPerformance.idl: * page/History.idl: * page/IntersectionObserver.idl: * page/IntersectionObserverEntry.idl: * page/Location.idl: * page/Navigator+IsLoggedIn.idl: * page/Navigator.idl: * page/PerformanceNavigation.idl: * page/PerformancePaintTiming.idl: * page/PerformanceTiming.idl: * page/RemoteDOMWindow.idl: * page/ResizeObserver.idl: * page/ResizeObserverEntry.idl: * page/Screen.idl: * page/UndoItem.idl: * page/UndoManager.idl: * page/UserMessageHandler.idl: * page/UserMessageHandlersNamespace.idl: * page/VisualViewport.idl: * page/WebKitNamespace.idl: * page/WebKitPoint.idl: * plugins/DOMMimeType.idl: * plugins/DOMMimeTypeArray.idl: * plugins/DOMPlugin.idl: * plugins/DOMPluginArray.idl: * storage/Storage.idl: * storage/StorageEvent.idl: * svg/SVGAElement.idl: * svg/SVGAltGlyphDefElement.idl: * svg/SVGAltGlyphElement.idl: * svg/SVGAltGlyphItemElement.idl: * svg/SVGAngle.idl: * svg/SVGAnimateColorElement.idl: * svg/SVGAnimateElement.idl: * svg/SVGAnimateMotionElement.idl: * svg/SVGAnimateTransformElement.idl: * svg/SVGAnimatedAngle.idl: * svg/SVGAnimatedBoolean.idl: * svg/SVGAnimatedEnumeration.idl: * svg/SVGAnimatedInteger.idl: * svg/SVGAnimatedLength.idl: * svg/SVGAnimatedLengthList.idl: * svg/SVGAnimatedNumber.idl: * svg/SVGAnimatedNumberList.idl: * svg/SVGAnimatedPreserveAspectRatio.idl: * svg/SVGAnimatedRect.idl: * svg/SVGAnimatedString.idl: * svg/SVGAnimatedTransformList.idl: * svg/SVGAnimationElement.idl: * svg/SVGCircleElement.idl: * svg/SVGClipPathElement.idl: * svg/SVGComponentTransferFunctionElement.idl: * svg/SVGCursorElement.idl: * svg/SVGDefsElement.idl: * svg/SVGDescElement.idl: * svg/SVGElement.idl: * svg/SVGEllipseElement.idl: * svg/SVGFEBlendElement.idl: * svg/SVGFEColorMatrixElement.idl: * svg/SVGFEComponentTransferElement.idl: * svg/SVGFECompositeElement.idl: * svg/SVGFEConvolveMatrixElement.idl: * svg/SVGFEDiffuseLightingElement.idl: * svg/SVGFEDisplacementMapElement.idl: * svg/SVGFEDistantLightElement.idl: * svg/SVGFEDropShadowElement.idl: * svg/SVGFEFloodElement.idl: * svg/SVGFEFuncAElement.idl: * svg/SVGFEFuncBElement.idl: * svg/SVGFEFuncGElement.idl: * svg/SVGFEFuncRElement.idl: * svg/SVGFEGaussianBlurElement.idl: * svg/SVGFEImageElement.idl: * svg/SVGFEMergeElement.idl: * svg/SVGFEMergeNodeElement.idl: * svg/SVGFEMorphologyElement.idl: * svg/SVGFEOffsetElement.idl: * svg/SVGFEPointLightElement.idl: * svg/SVGFESpecularLightingElement.idl: * svg/SVGFESpotLightElement.idl: * svg/SVGFETileElement.idl: * svg/SVGFETurbulenceElement.idl: * svg/SVGFilterElement.idl: * svg/SVGFontElement.idl: * svg/SVGFontFaceElement.idl: * svg/SVGFontFaceFormatElement.idl: * svg/SVGFontFaceNameElement.idl: * svg/SVGFontFaceSrcElement.idl: * svg/SVGFontFaceUriElement.idl: * svg/SVGForeignObjectElement.idl: * svg/SVGGElement.idl: * svg/SVGGeometryElement.idl: * svg/SVGGlyphElement.idl: * svg/SVGGlyphRefElement.idl: * svg/SVGGradientElement.idl: * svg/SVGGraphicsElement.idl: * svg/SVGHKernElement.idl: * svg/SVGImageElement.idl: * svg/SVGLength.idl: * svg/SVGLengthList.idl: * svg/SVGLineElement.idl: * svg/SVGLinearGradientElement.idl: * svg/SVGMPathElement.idl: * svg/SVGMarkerElement.idl: * svg/SVGMaskElement.idl: * svg/SVGMatrix.idl: * svg/SVGMetadataElement.idl: * svg/SVGMissingGlyphElement.idl: * svg/SVGNumber.idl: * svg/SVGNumberList.idl: * svg/SVGPathElement.idl: * svg/SVGPathSeg.idl: * svg/SVGPathSegArcAbs.idl: * svg/SVGPathSegArcRel.idl: * svg/SVGPathSegClosePath.idl: * svg/SVGPathSegCurvetoCubicAbs.idl: * svg/SVGPathSegCurvetoCubicRel.idl: * svg/SVGPathSegCurvetoCubicSmoothAbs.idl: * svg/SVGPathSegCurvetoCubicSmoothRel.idl: * svg/SVGPathSegCurvetoQuadraticAbs.idl: * svg/SVGPathSegCurvetoQuadraticRel.idl: * svg/SVGPathSegCurvetoQuadraticSmoothAbs.idl: * svg/SVGPathSegCurvetoQuadraticSmoothRel.idl: * svg/SVGPathSegLinetoAbs.idl: * svg/SVGPathSegLinetoHorizontalAbs.idl: * svg/SVGPathSegLinetoHorizontalRel.idl: * svg/SVGPathSegLinetoRel.idl: * svg/SVGPathSegLinetoVerticalAbs.idl: * svg/SVGPathSegLinetoVerticalRel.idl: * svg/SVGPathSegList.idl: * svg/SVGPathSegMovetoAbs.idl: * svg/SVGPathSegMovetoRel.idl: * svg/SVGPatternElement.idl: * svg/SVGPoint.idl: * svg/SVGPointList.idl: * svg/SVGPolygonElement.idl: * svg/SVGPolylineElement.idl: * svg/SVGPreserveAspectRatio.idl: * svg/SVGRadialGradientElement.idl: * svg/SVGRect.idl: * svg/SVGRectElement.idl: * svg/SVGRenderingIntent.idl: * svg/SVGSVGElement.idl: * svg/SVGScriptElement.idl: * svg/SVGSetElement.idl: * svg/SVGStopElement.idl: * svg/SVGStringList.idl: * svg/SVGStyleElement.idl: * svg/SVGSwitchElement.idl: * svg/SVGSymbolElement.idl: * svg/SVGTRefElement.idl: * svg/SVGTSpanElement.idl: * svg/SVGTextContentElement.idl: * svg/SVGTextElement.idl: * svg/SVGTextPathElement.idl: * svg/SVGTextPositioningElement.idl: * svg/SVGTitleElement.idl: * svg/SVGTransform.idl: * svg/SVGTransformList.idl: * svg/SVGUnitTypes.idl: * svg/SVGUseElement.idl: * svg/SVGVKernElement.idl: * svg/SVGViewElement.idl: * svg/SVGViewSpec.idl: * svg/SVGZoomEvent.idl: * workers/Worker.idl: * workers/service/ExtendableEvent.idl: * workers/service/ExtendableEventInit.idl: * workers/service/FetchEvent.idl: * worklets/Worklet.idl: * xml/DOMParser.idl: * xml/XMLHttpRequestProgressEvent.idl: * xml/XMLSerializer.idl: * xml/XPathEvaluator.idl: * xml/XPathExpression.idl: * xml/XPathResult.idl: * xml/XSLTProcessor.idl: Canonical link: https://commits.webkit.org/229932@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@267813 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-10-01 00:15:51 +00:00
interface mixin CanvasTextDrawingStyles {
[Canvas] Split CanvasRenderingContext2D.idl into separate IDLs to match current HTML spec https://bugs.webkit.org/show_bug.cgi?id=176276 Reviewed by Dean Jackson. Source/WebCore: - Splits CanvasRenderingContext2D.idl out into: CanvasState CanvasTransform CanvasCompositing CanvasImageSmoothing CanvasFillStrokeStyles CanvasShadowStyles CanvasFilters CanvasRect CanvasDrawPath CanvasUserInterface CanvasText CanvasDrawImage CanvasImageData CanvasPathDrawingStyles CanvasTextDrawingStyles - Renames CanvasWindingRule enum to CanvasFillRule, and moves it to its own file so it can be reused by multiple IDLs. - Renames DOMPath to Path2D, which is what it is supposed to be called, and doesn't conflict with any WebCore names. - Converts lineCap, lineJoin, textAlign, textBaseline, direction to use enums, rather than DOMStrings, allowing us to remove a bunch of custom parsing. - Non-standard canvas API was grouped with related functionality in the broken out IDLs and clearly marked as non-standard. - Comments were added for places where we break with the standard, mostly around use of float where we should be using double. * CMakeLists.txt: * DerivedSources.cpp: * DerivedSources.make: * WebCore.xcodeproj/project.pbxproj: Add new files. * bindings/js/CallTracerTypes.h: * inspector/InspectorCanvas.cpp: (WebCore::InspectorCanvas::buildInitialState): (WebCore::InspectorCanvas::buildAction): Update for renames, and use new convertEnumerationToString to serialize enumerations. * bindings/scripts/CodeGeneratorJS.pm: (GenerateEnumerationImplementationContent): (GenerateEnumerationHeaderContent): Split string conversion out of convertEnumerationToJS, and into its own function, convertEnumerationToString, to allow serialization to string outside of the bindings context, in this case, for the InspectorCanvas. (GenerateParametersCheck): Improve error message to make it clear which operation has the issue in order to make debugging easier. * html/ImageData.idl: Re-order constructors to match specification, and add FIXME for incorrect default argument. * html/TextMetrics.idl: Add spec'd exposure and spec comments, as well a FIXME to convert the unrestricted float parameters should be doubles. * html/canvas/CanvasCompositing.idl: Added. * html/canvas/CanvasDirection.h: Added. * html/canvas/CanvasDirection.idl: Added. * html/canvas/CanvasDrawImage.idl: Added. * html/canvas/CanvasDrawPath.idl: Added. * html/canvas/CanvasFillRule.h: Added. * html/canvas/CanvasFillRule.idl: Added. * html/canvas/CanvasFillStrokeStyles.idl: Added. * html/canvas/CanvasFilters.idl: Added. * html/canvas/CanvasImageData.idl: Added. * html/canvas/CanvasImageSmoothing.idl: Added. * html/canvas/CanvasLineCap.h: Added. * html/canvas/CanvasLineCap.idl: Added. * html/canvas/CanvasLineJoin.h: Added. * html/canvas/CanvasLineJoin.idl: Added. * html/canvas/CanvasPathDrawingStyles.idl: Added. * html/canvas/CanvasRect.idl: Added. * html/canvas/CanvasShadowStyles.idl: Added. * html/canvas/CanvasState.idl: Added. * html/canvas/CanvasText.idl: Added. * html/canvas/CanvasTextAlign.h: Added. * html/canvas/CanvasTextAlign.idl: Added. * html/canvas/CanvasTextBaseline.h: Added. * html/canvas/CanvasTextBaseline.idl: Added. * html/canvas/CanvasTextDrawingStyles.idl: Added. * html/canvas/CanvasTransform.idl: Added. * html/canvas/CanvasUserInterface.idl: Added. * html/canvas/ImageSmoothingQuality.h: Added. * html/canvas/ImageSmoothingQuality.idl: Added. Move CanvasRenderingContext2D.idl content into separate files to match the specification. * html/canvas/CanvasGradient.idl: * html/canvas/CanvasPath.idl: * html/canvas/CanvasPattern.idl: Add exposure and FIXMEs on changes need to match the spec. * html/canvas/CanvasRenderingContext2D.cpp: * html/canvas/CanvasRenderingContext2D.h: Switch to using enums for lineCap, lineJoin, textAlign, textBaseline, and direction. Rather than using the parsing / stringifying functions from GraphicsTypes, add simple switch based to/from converters to convert to/from the canvas type to the platform type. Also update for rename of DOMPath -> Path2D and WindingRule -> CanvasFillRule. Unfortunately, not all custom parsing could be removed. To support the legacy functions setLineCap and setLineJoin, which take Strings, two simply parse paths had to be brought back. They can't use the enums, because the rules for enums as parameters is stricter that what was implemented in the custom code (e.g. the bindings would have thrown for strings not in the enum set). * html/canvas/CanvasRenderingContext2D.idl: Move most of the functions into the new files, which are then 'implemented' by this. * html/canvas/DOMPath.cpp: Removed. * html/canvas/DOMPath.h: Removed. * html/canvas/DOMPath.idl: Removed. * html/canvas/Path2D.cpp: Copied from Source/WebCore/html/canvas/DOMPath.cpp. * html/canvas/Path2D.h: Copied from Source/WebCore/html/canvas/DOMPath.h. * html/canvas/Path2D.idl: Copied from Source/WebCore/html/canvas/DOMPath.idl. Rename DOMPath to Path2D to match the spec.. * platform/graphics/GraphicsTypes.cpp: (WebCore::parseLineCap): Deleted. (WebCore::lineCapName): Deleted. (WebCore::parseLineJoin): Deleted. (WebCore::lineJoinName): Deleted. (WebCore::textAlignName): Deleted. (WebCore::parseTextAlign): Deleted. (WebCore::textBaselineName): Deleted. (WebCore::parseTextBaseline): Deleted. * platform/graphics/GraphicsTypes.h: Remove now unused parsing / stringifying functions. * testing/Internals.cpp: Remove unused #include. * bindings/scripts/test/JS/JSTestCallbackInterface.cpp: * bindings/scripts/test/JS/JSTestCallbackInterface.h: * bindings/scripts/test/JS/JSTestObj.cpp: * bindings/scripts/test/JS/JSTestObj.h: * bindings/scripts/test/JS/JSTestStandaloneDictionary.cpp: * bindings/scripts/test/JS/JSTestStandaloneDictionary.h: * bindings/scripts/test/JS/JSTestStandaloneEnumeration.cpp: * bindings/scripts/test/JS/JSTestStandaloneEnumeration.h: Update test results to add convertEnumerationToString. LayoutTests: * fast/canvas/canvas-clip-path-expected.txt: * fast/canvas/canvas-fill-path-expected.txt: * fast/canvas/canvas-path-addPath-expected.txt: * fast/canvas/canvas-path-isPointInPath-expected.txt: * fast/canvas/canvas-path-isPointInStroke-expected.txt: * fast/canvas/canvas-stroke-path-expected.txt: * fast/canvas/winding-enumeration-expected.txt: * inspector/canvas/recording-2d-expected.txt: * js/dom/global-constructors-attributes-dedicated-worker-expected.txt: Update results. Canonical link: https://commits.webkit.org/192969@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@221598 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-09-05 00:23:03 +00:00
// text
attribute DOMString font; // (default 10px sans-serif)
attribute CanvasTextAlign textAlign; // (default: "start")
attribute CanvasTextBaseline textBaseline; // (default: "alphabetic")
attribute CanvasDirection direction; // (default: "inherit")
};