haikuwebkit/Source/WebCore/css/CSSConditionRule.idl

37 lines
1.5 KiB
Plaintext
Raw Permalink Normal View History

Add CSSConditionRule and CSSGroupingRule https://bugs.webkit.org/show_bug.cgi?id=216855 Reviewed by Sam Weinig. LayoutTests/imported/w3c: * web-platform-tests/css/conditional/idlharness-expected.txt: * web-platform-tests/css/cssom/MediaList-expected.txt: * web-platform-tests/css/cssom/cssimportrule-expected.txt: * web-platform-tests/css/cssom/idlharness-expected.txt: Updated expectations to expect more tests to pass. Source/WebCore: * CMakeLists.txt: Added CSSConditionRule.idl and CSSGroupingRule.idl. * DerivedSources-input.xcfilelist: Updated. * DerivedSources-output.xcfilelist: Updated. * DerivedSources.make: Added CSSConditionRule.idl and CSSGroupingRule.idl. * Headers.cmake: Added CSSConditionRule.h. * Sources.txt: Add CSSConditionRule.cpp, JSCSSConditioRule.cpp, and JSCSSGroupingRule.cpp. * WebCore.xcodeproj/project.pbxproj: Added all the files. * css/CSSConditionRule.cpp: Added. * css/CSSConditionRule.h: Added. * css/CSSConditionRule.idl: Added. * css/CSSGroupingRule.cpp: (WebCore::CSSGroupingRule::~CSSGroupingRule): Use a range-based for loop and nullptr. (WebCore::CSSGroupingRule::appendCSSTextForItems const): Use variadic append to clean this up a bit. (WebCore::CSSGroupingRule::item const): Use auto. * css/CSSGroupingRule.h: Made m_groupRule private instead of protected. Did some other tweaks. * css/CSSGroupingRule.idl: Added. * css/CSSImportRule.idl: Added [Exposed=Window], changed href to be a USVString, added [SameObject, PutForwards=mediaText] to media and [SameObject] to styleSheet. * css/CSSMediaRule.cpp: (WebCore::CSSMediaRule::CSSMediaRule): Derive from CSSConditionRule. (WebCore::CSSMediaRule::mediaQueries const): Return a reference. (WebCore::CSSMediaRule::cssText const): Streamline since we don't need a null check. (WebCore::CSSMediaRule::conditionText const): Added. (WebCore::CSSMediaRule::setConditionText): Added. (WebCore::CSSMediaRule::media const): Streamline since we don't need a null check. (WebCore::CSSMediaRule::reattach): Ditto. * css/CSSMediaRule.h: Derive from CSSConditionRule. * css/CSSMediaRule.idl: Derive from CSSConditionRule. Added [Exposed=Window]. Added [SameObject, PutForwards=mediaText] to media. Removed insertRule and deleteRule since they are now inherited from CSSGroupingRule. * css/CSSRule.h: Added MARGIN_RULE constant even though we don't have that rule type. Moved inline functions out of the class body to help clarity a bit. * css/CSSRule.idl: Added [Exposed=Window], changed a few things to match the specification. * css/CSSStyleRule.idl: Added [Exposed=Window]. Added [SameObject] to style. * css/CSSStyleSheet.idl: Added [Exposed=Window]. * css/CSSSupportsRule.cpp: (WebCore::CSSSupportsRule::CSSSupportsRule): Derive from CSSConditionRule. (WebCore::CSSSupportsRule::create): Added. (WebCore::CSSSupportsRule::cssText const): Use variadic append. (WebCore::CSSSupportsRule::conditionText const): Updated to use groupRule. (WebCore::CSSSupportsRule::setConditionText): Added. Not implemented yet. * css/CSSSupportsRule.h: Derive from CSSConditionRule. * css/CSSSupportsRule.idl: Derive from CSSConditionRule. Added [Exposed=Window]. * css/MediaList.cpp: (WebCore::MediaQuerySet::set): Use move instead of swap. * css/MediaList.idl: Added [Exposed=Window] and marked mediaText as the stringifier. * css/StyleRule.cpp: (WebCore::StyleRule::create): Moved here from the header. (WebCore::StyleRule::copy const): Ditto. (WebCore::StyleRulePage::create): Ditto. (WebCore::StyleRuleGroup::StyleRuleGroup): Use move instead of swap. (WebCore::StyleRuleMedia::create): Use move instead of swap. (WebCore::StyleRuleMedia::copy const): Moved out of the header. (WebCore::StyleRuleSupports::StyleRuleSupports): Ditto. (WebCore::StyleRuleSupports::create): Ditto. (WebCore::StyleRuleNamespace::StyleRuleNamespace): Ditto. (WebCore::StyleRuleNamespace::create): Ditto. * css/StyleRule.h: Moved function bodies out of the class defintiion for clarity. * css/StyleSheet.idl: Added [Exposed=Window] and [SameObject, PutForwards=mediaText] for media. * css/StyleSheetContents.cpp: (WebCore::StyleSheetContents::parserAppendRule): Updated since mediaQueries returns a reference. * css/StyleSheetList.idl: Added [Exposed=Window]. * css/parser/CSSParserImpl.cpp: (WebCore::CSSParserImpl::consumeMediaRule): Use WTFMove since the create function now takes an rvalue reference. (WebCore::CSSParserImpl::consumeSupportsRule): Ditto. * style/RuleSet.cpp: (WebCore::Style::RuleSet::addChildRules): Updated since mediaQueries returns a reference. * style/UserAgentStyle.cpp: (WebCore::Style::UserAgentStyle::addToDefaultStyle): Ditto. Source/WebKitLegacy/mac: * DOM/DOMCSS.mm: (kitClass): Added a default case since we don't intend to list every single rule type here. LayoutTests: * fast/dom/domListEnumeration-expected.txt: * fast/dom/domListEnumeration.html: Updated since toString is now implemented and enumerable. * fast/dom/non-numeric-values-numeric-parameters-expected.txt: * fast/dom/non-numeric-values-numeric-parameters.html: Updated test and expectations since CSSMediaRule's deleteRule no longer allows omitting the index to delete rule 0 (both non-standard and inconsistent with CSSStyleSheet). Canonical link: https://commits.webkit.org/229755@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@267576 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-09-25 17:19:48 +00:00
/*
* Copyright (C) 2020 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 THE COPYRIGHT HOLDER "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 THE COPYRIGHT HOLDER 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.
*/
typedef USVString CSSOMString;
[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
[
Exposed=Window
] interface CSSConditionRule : CSSGroupingRule {
Add CSSConditionRule and CSSGroupingRule https://bugs.webkit.org/show_bug.cgi?id=216855 Reviewed by Sam Weinig. LayoutTests/imported/w3c: * web-platform-tests/css/conditional/idlharness-expected.txt: * web-platform-tests/css/cssom/MediaList-expected.txt: * web-platform-tests/css/cssom/cssimportrule-expected.txt: * web-platform-tests/css/cssom/idlharness-expected.txt: Updated expectations to expect more tests to pass. Source/WebCore: * CMakeLists.txt: Added CSSConditionRule.idl and CSSGroupingRule.idl. * DerivedSources-input.xcfilelist: Updated. * DerivedSources-output.xcfilelist: Updated. * DerivedSources.make: Added CSSConditionRule.idl and CSSGroupingRule.idl. * Headers.cmake: Added CSSConditionRule.h. * Sources.txt: Add CSSConditionRule.cpp, JSCSSConditioRule.cpp, and JSCSSGroupingRule.cpp. * WebCore.xcodeproj/project.pbxproj: Added all the files. * css/CSSConditionRule.cpp: Added. * css/CSSConditionRule.h: Added. * css/CSSConditionRule.idl: Added. * css/CSSGroupingRule.cpp: (WebCore::CSSGroupingRule::~CSSGroupingRule): Use a range-based for loop and nullptr. (WebCore::CSSGroupingRule::appendCSSTextForItems const): Use variadic append to clean this up a bit. (WebCore::CSSGroupingRule::item const): Use auto. * css/CSSGroupingRule.h: Made m_groupRule private instead of protected. Did some other tweaks. * css/CSSGroupingRule.idl: Added. * css/CSSImportRule.idl: Added [Exposed=Window], changed href to be a USVString, added [SameObject, PutForwards=mediaText] to media and [SameObject] to styleSheet. * css/CSSMediaRule.cpp: (WebCore::CSSMediaRule::CSSMediaRule): Derive from CSSConditionRule. (WebCore::CSSMediaRule::mediaQueries const): Return a reference. (WebCore::CSSMediaRule::cssText const): Streamline since we don't need a null check. (WebCore::CSSMediaRule::conditionText const): Added. (WebCore::CSSMediaRule::setConditionText): Added. (WebCore::CSSMediaRule::media const): Streamline since we don't need a null check. (WebCore::CSSMediaRule::reattach): Ditto. * css/CSSMediaRule.h: Derive from CSSConditionRule. * css/CSSMediaRule.idl: Derive from CSSConditionRule. Added [Exposed=Window]. Added [SameObject, PutForwards=mediaText] to media. Removed insertRule and deleteRule since they are now inherited from CSSGroupingRule. * css/CSSRule.h: Added MARGIN_RULE constant even though we don't have that rule type. Moved inline functions out of the class body to help clarity a bit. * css/CSSRule.idl: Added [Exposed=Window], changed a few things to match the specification. * css/CSSStyleRule.idl: Added [Exposed=Window]. Added [SameObject] to style. * css/CSSStyleSheet.idl: Added [Exposed=Window]. * css/CSSSupportsRule.cpp: (WebCore::CSSSupportsRule::CSSSupportsRule): Derive from CSSConditionRule. (WebCore::CSSSupportsRule::create): Added. (WebCore::CSSSupportsRule::cssText const): Use variadic append. (WebCore::CSSSupportsRule::conditionText const): Updated to use groupRule. (WebCore::CSSSupportsRule::setConditionText): Added. Not implemented yet. * css/CSSSupportsRule.h: Derive from CSSConditionRule. * css/CSSSupportsRule.idl: Derive from CSSConditionRule. Added [Exposed=Window]. * css/MediaList.cpp: (WebCore::MediaQuerySet::set): Use move instead of swap. * css/MediaList.idl: Added [Exposed=Window] and marked mediaText as the stringifier. * css/StyleRule.cpp: (WebCore::StyleRule::create): Moved here from the header. (WebCore::StyleRule::copy const): Ditto. (WebCore::StyleRulePage::create): Ditto. (WebCore::StyleRuleGroup::StyleRuleGroup): Use move instead of swap. (WebCore::StyleRuleMedia::create): Use move instead of swap. (WebCore::StyleRuleMedia::copy const): Moved out of the header. (WebCore::StyleRuleSupports::StyleRuleSupports): Ditto. (WebCore::StyleRuleSupports::create): Ditto. (WebCore::StyleRuleNamespace::StyleRuleNamespace): Ditto. (WebCore::StyleRuleNamespace::create): Ditto. * css/StyleRule.h: Moved function bodies out of the class defintiion for clarity. * css/StyleSheet.idl: Added [Exposed=Window] and [SameObject, PutForwards=mediaText] for media. * css/StyleSheetContents.cpp: (WebCore::StyleSheetContents::parserAppendRule): Updated since mediaQueries returns a reference. * css/StyleSheetList.idl: Added [Exposed=Window]. * css/parser/CSSParserImpl.cpp: (WebCore::CSSParserImpl::consumeMediaRule): Use WTFMove since the create function now takes an rvalue reference. (WebCore::CSSParserImpl::consumeSupportsRule): Ditto. * style/RuleSet.cpp: (WebCore::Style::RuleSet::addChildRules): Updated since mediaQueries returns a reference. * style/UserAgentStyle.cpp: (WebCore::Style::UserAgentStyle::addToDefaultStyle): Ditto. Source/WebKitLegacy/mac: * DOM/DOMCSS.mm: (kitClass): Added a default case since we don't intend to list every single rule type here. LayoutTests: * fast/dom/domListEnumeration-expected.txt: * fast/dom/domListEnumeration.html: Updated since toString is now implemented and enumerable. * fast/dom/non-numeric-values-numeric-parameters-expected.txt: * fast/dom/non-numeric-values-numeric-parameters.html: Updated test and expectations since CSSMediaRule's deleteRule no longer allows omitting the index to delete rule 0 (both non-standard and inconsistent with CSSStyleSheet). Canonical link: https://commits.webkit.org/229755@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@267576 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-09-25 17:19:48 +00:00
attribute CSSOMString conditionText;
};