WebKit Bugzilla
Attachment 350120 Details for
Bug 189694
: Implement CSS Custom Properties and Values Skeleton
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-189694-20180919084522.patch (text/plain), 38.05 KB, created by
Justin Michaud
on 2018-09-19 08:45:22 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Justin Michaud
Created:
2018-09-19 08:45:22 PDT
Size:
38.05 KB
patch
obsolete
>Subversion Revision: 236161 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index a54aa17bf287fe7ac5d6e69d503d77d4a658e452..6d351355db52efea119b67d7e8b62245c2090d2d 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,36 @@ >+2018-09-18 Justin Michaud <justin_michaud@apple.com> >+ >+ Implement CSS Custom Properties and Values Skeleton >+ https://bugs.webkit.org/show_bug.cgi?id=189694 >+ >+ Add feature flag, CSS.registerProperty binding and registered property set in Document.h >+ for the css custom properties and values api. >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Test: css-properties-values-api/registerProperty.html >+ >+ * CMakeLists.txt: >+ * DerivedSources.make: >+ * Sources.txt: >+ * WebCore.xcodeproj/project.pbxproj: >+ * css/CSSRegisteredCustomProperty.h: Copied from Source/WebCore/css/DOMCSSNamespace.h. >+ * css/DOMCSSCustomPropertyDescriptor.h: Copied from Source/WebCore/css/DOMCSSNamespace.h. >+ * css/DOMCSSCustomPropertyDescriptor.idl: Added. >+ * css/DOMCSSNamespace.h: >+ * css/DOMCSSRegisterCustomProperty.cpp: Copied from Source/WebCore/css/DOMCSSNamespace.h. >+ (WebCore::DOMCSSRegisterCustomProperty::registerProperty): >+ (WebCore::DOMCSSRegisterCustomProperty::from): >+ (WebCore::DOMCSSRegisterCustomProperty::supplementName): >+ * css/DOMCSSRegisterCustomProperty.h: Copied from Source/WebCore/css/DOMCSSNamespace.h. >+ * css/DOMCSSRegisterCustomProperty.idl: Copied from Source/WebCore/css/DOMCSSNamespace.h. >+ * dom/Document.cpp: >+ (WebCore::Document::registerCSSProperty): >+ * dom/Document.h: >+ * page/RuntimeEnabledFeatures.h: >+ (WebCore::RuntimeEnabledFeatures::setCSSCustomPropertiesAndValuesEnabled): >+ (WebCore::RuntimeEnabledFeatures::cssCustomPropertiesAndValuesEnabled const): >+ > 2018-09-18 Basuke Suzuki <Basuke.Suzuki@sony.com> > > [Curl] Limit capturing extra metrics for Web Inspector when not required. >diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog >index b58444249c044ca9dcbef2f0f4634dad583c2c24..484c302397216682ca53bd280417140b2bfaa6db 100644 >--- a/Source/WebKit/ChangeLog >+++ b/Source/WebKit/ChangeLog >@@ -1,3 +1,16 @@ >+2018-09-18 Justin Michaud <justin_michaud@apple.com> >+ >+ Implement CSS Custom Properties and Values Skeleton >+ https://bugs.webkit.org/show_bug.cgi?id=189694 >+ >+ Add feature flag for CSS custom properties and values api >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * Shared/WebPreferences.yaml: >+ * WebProcess/InjectedBundle/InjectedBundle.cpp: >+ (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner): >+ > 2018-09-18 Brent Fulgham <bfulgham@apple.com> > > [iOS] Allow WebContent process to check the "Protocol Characteristics" of files to which it has access >diff --git a/Source/WebCore/CMakeLists.txt b/Source/WebCore/CMakeLists.txt >index f7853e162bddc32630e0fc7d152d8aa34f91cf16..546fb78790b209ca39b5441e5443108dbaf757c9 100644 >--- a/Source/WebCore/CMakeLists.txt >+++ b/Source/WebCore/CMakeLists.txt >@@ -525,6 +525,9 @@ set(WebCore_NON_SVG_IDL_FILES > css/CSSStyleSheet.idl > css/CSSSupportsRule.idl > css/CSSUnknownRule.idl >+ css/DOMCSSCustomPropertyDescriptor.idl >+ css/DOMCSSNamespace.idl >+ css/DOMCSSRegisterCustomProperty.idl > css/DOMMatrix.idl > css/DOMMatrix2DInit.idl > css/DOMMatrixInit.idl >@@ -535,7 +538,6 @@ set(WebCore_NON_SVG_IDL_FILES > css/DeprecatedCSSOMRect.idl > css/DeprecatedCSSOMValue.idl > css/DeprecatedCSSOMValueList.idl >- css/DOMCSSNamespace.idl > css/ElementCSSInlineStyle.idl > css/FontFace.idl > css/FontFaceSet.idl >diff --git a/Source/WebCore/DerivedSources.make b/Source/WebCore/DerivedSources.make >index bb25ff9022da49845fcdc51098fd427b9bb13e6c..d420d46e48c0e6cf74cdfa0ba64d98dcf9a50e67 100644 >--- a/Source/WebCore/DerivedSources.make >+++ b/Source/WebCore/DerivedSources.make >@@ -451,7 +451,9 @@ JS_BINDING_IDLS = \ > $(WebCore)/css/DeprecatedCSSOMRect.idl \ > $(WebCore)/css/DeprecatedCSSOMValue.idl \ > $(WebCore)/css/DeprecatedCSSOMValueList.idl \ >+ $(WebCore)/css/DOMCSSCustomPropertyDescriptor.idl \ > $(WebCore)/css/DOMCSSNamespace.idl \ >+ $(WebCore)/css/DOMCSSRegisterCustomProperty.idl \ > $(WebCore)/css/ElementCSSInlineStyle.idl \ > $(WebCore)/css/FontFace.idl \ > $(WebCore)/css/FontFaceSet.idl \ >diff --git a/Source/WebCore/Sources.txt b/Source/WebCore/Sources.txt >index 30623545c80822ddeafb403ce2930c4dc805b76f..e2bcdf1998cb4d31bdc37d275dfb301b373e2e00 100644 >--- a/Source/WebCore/Sources.txt >+++ b/Source/WebCore/Sources.txt >@@ -620,6 +620,7 @@ css/CSSValuePool.cpp > css/CSSVariableData.cpp > css/CSSVariableReferenceValue.cpp > css/DOMCSSNamespace.cpp >+css/DOMCSSRegisterCustomProperty.cpp > css/DOMMatrix.cpp > css/DOMMatrixReadOnly.cpp > css/DeprecatedCSSOMPrimitiveValue.cpp >@@ -2513,6 +2514,8 @@ JSDocumentTimeline.cpp > JSDocumentTimelineOptions.cpp > JSDOMApplicationCache.cpp > JSDOMCSSNamespace.cpp >+JSDOMCSSRegisterCustomProperty.cpp >+JSDOMCSSCustomPropertyDescriptor.cpp > JSDOMCache.cpp > JSDOMCacheStorage.cpp > JSDOMException.cpp >diff --git a/Source/WebCore/WebCore.xcodeproj/project.pbxproj b/Source/WebCore/WebCore.xcodeproj/project.pbxproj >index 4e66e92712b4808faf29430e3cb8017a5b478980..1563d22991131591495c951d0ab6281e0f94421a 100644 >--- a/Source/WebCore/WebCore.xcodeproj/project.pbxproj >+++ b/Source/WebCore/WebCore.xcodeproj/project.pbxproj >@@ -1344,6 +1344,9 @@ > 4B3480940EEF50D400AC1B41 /* ImageSourceCG.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B3480920EEF50D400AC1B41 /* ImageSourceCG.h */; }; > 4B6FA6F40C39E48C00087011 /* SmartReplace.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B6FA6F20C39E48C00087011 /* SmartReplace.h */; settings = {ATTRIBUTES = (Private, ); }; }; > 4BAE95B10B2FA9CE00AED8A0 /* EditorDeleteAction.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BAE95B00B2FA9CE00AED8A0 /* EditorDeleteAction.h */; settings = {ATTRIBUTES = (Private, ); }; }; >+ 4BDA3FFE2151B6F500FD6604 /* DOMCSSCustomPropertyDescriptor.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BDA3FF82151B6F200FD6604 /* DOMCSSCustomPropertyDescriptor.h */; }; >+ 4BDA3FFF2151B6F500FD6604 /* DOMCSSRegisterCustomProperty.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BDA3FF92151B6F300FD6604 /* DOMCSSRegisterCustomProperty.h */; }; >+ 4BDA40012151B6F500FD6604 /* CSSRegisteredCustomProperty.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BDA3FFB2151B6F400FD6604 /* CSSRegisteredCustomProperty.h */; settings = {ATTRIBUTES = (Private, ); }; }; > 4E1959220A39DABA00220FE5 /* MediaFeatureNames.h in Headers */ = {isa = PBXBuildFile; fileRef = 4E1959200A39DABA00220FE5 /* MediaFeatureNames.h */; settings = {ATTRIBUTES = (Private, ); }; }; > 4E19592A0A39DACC00220FE5 /* MediaQuery.h in Headers */ = {isa = PBXBuildFile; fileRef = 4E1959240A39DACC00220FE5 /* MediaQuery.h */; settings = {ATTRIBUTES = (Private, ); }; }; > 4E19592C0A39DACC00220FE5 /* MediaQueryEvaluator.h in Headers */ = {isa = PBXBuildFile; fileRef = 4E1959260A39DACC00220FE5 /* MediaQueryEvaluator.h */; settings = {ATTRIBUTES = (Private, ); }; }; >@@ -7840,6 +7843,12 @@ > 4B6FA6F20C39E48C00087011 /* SmartReplace.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SmartReplace.h; sourceTree = "<group>"; }; > 4B6FA6F60C39E4A100087011 /* SmartReplaceCF.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SmartReplaceCF.cpp; sourceTree = "<group>"; }; > 4BAE95B00B2FA9CE00AED8A0 /* EditorDeleteAction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EditorDeleteAction.h; sourceTree = "<group>"; }; >+ 4BDA3FF52151B6F000FD6604 /* DOMCSSRegisterCustomProperty.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = DOMCSSRegisterCustomProperty.idl; sourceTree = "<group>"; }; >+ 4BDA3FF72151B6F100FD6604 /* DOMCSSRegisterCustomProperty.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DOMCSSRegisterCustomProperty.cpp; sourceTree = "<group>"; }; >+ 4BDA3FF82151B6F200FD6604 /* DOMCSSCustomPropertyDescriptor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DOMCSSCustomPropertyDescriptor.h; sourceTree = "<group>"; }; >+ 4BDA3FF92151B6F300FD6604 /* DOMCSSRegisterCustomProperty.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DOMCSSRegisterCustomProperty.h; sourceTree = "<group>"; }; >+ 4BDA3FFA2151B6F300FD6604 /* DOMCSSCustomPropertyDescriptor.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = DOMCSSCustomPropertyDescriptor.idl; sourceTree = "<group>"; }; >+ 4BDA3FFB2151B6F400FD6604 /* CSSRegisteredCustomProperty.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CSSRegisteredCustomProperty.h; sourceTree = "<group>"; }; > 4E19591F0A39DABA00220FE5 /* MediaFeatureNames.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = MediaFeatureNames.cpp; sourceTree = "<group>"; }; > 4E1959200A39DABA00220FE5 /* MediaFeatureNames.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = MediaFeatureNames.h; sourceTree = "<group>"; }; > 4E1959230A39DACC00220FE5 /* MediaQuery.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = MediaQuery.cpp; sourceTree = "<group>"; }; >@@ -23951,8 +23960,8 @@ > 2D0B4AA918DA1CCD00434DE1 /* IOSurface.h */, > 2D0B4AAA18DA1CCD00434DE1 /* IOSurface.mm */, > AD9FF6E01908391D003B61E0 /* IOSurfacePoolCocoa.mm */, >- CDC48AC72149CF2A0024FD59 /* MediaEngineConfigurationFactoryCocoa.h */, > CDC48AC82149CF2A0024FD59 /* MediaEngineConfigurationFactoryCocoa.cpp */, >+ CDC48AC72149CF2A0024FD59 /* MediaEngineConfigurationFactoryCocoa.h */, > 526724F21CB2FDF60075974D /* TextTrackRepresentationCocoa.h */, > 526724F11CB2FDF60075974D /* TextTrackRepresentationCocoa.mm */, > 2D3EF4441917915C00034184 /* WebActionDisablingCALayerDelegate.h */, >@@ -24730,8 +24739,8 @@ > CD669D651D232DF4004D1866 /* cocoa */ = { > isa = PBXGroup; > children = ( >- 417F7AEA2139BF6400FBA7EC /* MediaSessionManagerCocoa.mm */, > 417F7AED2139BF6500FBA7EC /* MediaSessionManagerCocoa.h */, >+ 417F7AEA2139BF6400FBA7EC /* MediaSessionManagerCocoa.mm */, > 417F7AEB2139BF6400FBA7EC /* WebAudioBufferList.cpp */, > 417F7AEC2139BF6500FBA7EC /* WebAudioBufferList.h */, > ); >@@ -25677,6 +25686,7 @@ > 9362640A0DE1137D009D5A00 /* CSSReflectionDirection.h */, > BC5A12DD0DC0414800C9AFAD /* CSSReflectValue.cpp */, > BC5A12DE0DC0414800C9AFAD /* CSSReflectValue.h */, >+ 4BDA3FFB2151B6F400FD6604 /* CSSRegisteredCustomProperty.h */, > BC7D8FF11BD1A47900FFE540 /* CSSRevertValue.cpp */, > BC7D8FF21BD1A47900FFE540 /* CSSRevertValue.h */, > A80E6CDC0A1989CA007FB8C5 /* CSSRule.cpp */, >@@ -25746,9 +25756,14 @@ > A8D0651C0A23C1FE005E7203 /* DeprecatedCSSOMValueList.idl */, > 4A4F48A716B0DFC000EDBB29 /* DocumentRuleSets.cpp */, > 4A4F48A816B0DFC000EDBB29 /* DocumentRuleSets.h */, >+ 4BDA3FF82151B6F200FD6604 /* DOMCSSCustomPropertyDescriptor.h */, >+ 4BDA3FFA2151B6F300FD6604 /* DOMCSSCustomPropertyDescriptor.idl */, > FD677735195CAB200072E0D3 /* DOMCSSNamespace.cpp */, > FC9A0F72164094CF003D6B8D /* DOMCSSNamespace.h */, > FC9A0F73164094CF003D6B8D /* DOMCSSNamespace.idl */, >+ 4BDA3FF72151B6F100FD6604 /* DOMCSSRegisterCustomProperty.cpp */, >+ 4BDA3FF92151B6F300FD6604 /* DOMCSSRegisterCustomProperty.h */, >+ 4BDA3FF52151B6F000FD6604 /* DOMCSSRegisterCustomProperty.idl */, > 836ACEC41ECA6654004BD012 /* DOMMatrix.cpp */, > 836ACEC51ECA6654004BD012 /* DOMMatrix.h */, > 836ACEC61ECA6654004BD012 /* DOMMatrix.idl */, >@@ -27671,6 +27686,7 @@ > FE271F672082DBE500A952D4 /* CSSPtrTag.h in Headers */, > 9362640B0DE1137D009D5A00 /* CSSReflectionDirection.h in Headers */, > BC5A12E00DC0414800C9AFAD /* CSSReflectValue.h in Headers */, >+ 4BDA40012151B6F500FD6604 /* CSSRegisteredCustomProperty.h in Headers */, > BC7D8FF41BD1A47900FFE540 /* CSSRevertValue.h in Headers */, > A80E6D0D0A1989CA007FB8C5 /* CSSRule.h in Headers */, > A80E6CF20A1989CA007FB8C5 /* CSSRuleList.h in Headers */, >@@ -27830,7 +27846,9 @@ > 41380C271F3436AC00155FDA /* DOMCache.h in Headers */, > 41FABD2D1F4DFE4A006A6C97 /* DOMCacheEngine.h in Headers */, > 41380C291F3436AC00155FDA /* DOMCacheStorage.h in Headers */, >+ 4BDA3FFE2151B6F500FD6604 /* DOMCSSCustomPropertyDescriptor.h in Headers */, > FC9A0F75164094CF003D6B8D /* DOMCSSNamespace.h in Headers */, >+ 4BDA3FFF2151B6F500FD6604 /* DOMCSSRegisterCustomProperty.h in Headers */, > 7AABA25A14BC613300AA9A11 /* DOMEditor.h in Headers */, > BC60D6E90D28D83400B9918F /* DOMException.h in Headers */, > 8399470C1F50B63E00E9D86B /* DOMFileSystem.h in Headers */, >@@ -29472,6 +29490,7 @@ > 2D9BF7061DBFBB24007A7D99 /* MediaEncryptedEvent.h in Headers */, > 2D9BF7081DBFBB24007A7D99 /* MediaEncryptedEventInit.h in Headers */, > 41B28B151F8501D300FB52AC /* MediaEndpointConfiguration.h in Headers */, >+ CDC48AC92149CF2A0024FD59 /* MediaEngineConfigurationFactoryCocoa.h in Headers */, > E44613AD0CD6331000FADA75 /* MediaError.h in Headers */, > 4E1959220A39DABA00220FE5 /* MediaFeatureNames.h in Headers */, > 07A6D1EC1491137700051D0C /* MediaFragmentURIParser.h in Headers */, >@@ -30286,7 +30305,6 @@ > 517A534F1F54A8BA00DCDC0A /* ServiceWorkerRegistrationData.h in Headers */, > 517A53291F4B90B900DCDC0A /* ServiceWorkerRegistrationKey.h in Headers */, > 51F175691F3EBC8300C74950 /* ServiceWorkerRegistrationOptions.h in Headers */, >- CDC48AC92149CF2A0024FD59 /* MediaEngineConfigurationFactoryCocoa.h in Headers */, > 51BCCE301F8F179E006BA0ED /* ServiceWorkerThread.h in Headers */, > 4112B5431F9F9CA000E67875 /* ServiceWorkerThreadProxy.h in Headers */, > 515E37F61FAA940200D7F22A /* ServiceWorkerTypes.h in Headers */, >diff --git a/Source/WebCore/css/CSSRegisteredCustomProperty.h b/Source/WebCore/css/CSSRegisteredCustomProperty.h >new file mode 100644 >index 0000000000000000000000000000000000000000..83a3a842ac3abf0b3695e7f1208485f1c5b91176 >--- /dev/null >+++ b/Source/WebCore/css/CSSRegisteredCustomProperty.h >@@ -0,0 +1,41 @@ >+/* >+ * Copyright (C) 2018 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. >+ * 3. Neither the name of Motorola Mobility Inc. nor the names of its >+ * contributors may be used to endorse or promote products derived from this >+ * software without specific prior written permission. >+ * >+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 THE COPYRIGHT >+ * OWNER OR 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. >+ */ >+ >+#pragma once >+ >+#include <wtf/text/WTFString.h> >+ >+namespace WebCore { >+ >+struct CSSRegisteredCustomProperty { >+ String name; >+ /* TODO syntax, inherits, initialValue */ >+}; >+ >+} >diff --git a/Source/WebCore/css/DOMCSSCustomPropertyDescriptor.h b/Source/WebCore/css/DOMCSSCustomPropertyDescriptor.h >new file mode 100644 >index 0000000000000000000000000000000000000000..897177d86066b009554e7cf1b6e8fcbd0264e55f >--- /dev/null >+++ b/Source/WebCore/css/DOMCSSCustomPropertyDescriptor.h >@@ -0,0 +1,43 @@ >+/* >+ * Copyright (C) 2018 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. >+ * 3. Neither the name of Motorola Mobility Inc. nor the names of its >+ * contributors may be used to endorse or promote products derived from this >+ * software without specific prior written permission. >+ * >+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 THE COPYRIGHT >+ * OWNER OR 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. >+ */ >+ >+#pragma once >+ >+#include <wtf/text/WTFString.h> >+ >+namespace WebCore { >+ >+struct DOMCSSCustomPropertyDescriptor { >+ String name; >+ String syntax { "*" }; >+ bool inherits; >+ String initialValue; >+}; >+ >+} >diff --git a/Source/WebCore/css/DOMCSSCustomPropertyDescriptor.idl b/Source/WebCore/css/DOMCSSCustomPropertyDescriptor.idl >new file mode 100644 >index 0000000000000000000000000000000000000000..d834193f97693b368929dd1dff048d5a59fc7524 >--- /dev/null >+++ b/Source/WebCore/css/DOMCSSCustomPropertyDescriptor.idl >@@ -0,0 +1,38 @@ >+/* >+* Copyright (C) 2018 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. >+* 3. Neither the name of Motorola Mobility Inc. nor the names of its >+* contributors may be used to endorse or promote products derived from this >+* software without specific prior written permission. >+* >+* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 THE COPYRIGHT >+* OWNER OR 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. >+*/ >+ >+[ >+ JSGenerateToJSObject, >+ EnabledAtRuntime=CSSCustomPropertiesAndValues >+] dictionary DOMCSSCustomPropertyDescriptor { >+ required DOMString name; >+ DOMString syntax = "*"; >+ required boolean inherits; >+ DOMString initialValue; >+}; >diff --git a/Source/WebCore/css/DOMCSSNamespace.h b/Source/WebCore/css/DOMCSSNamespace.h >index 3b2e3870d25f811018c426ce6f80435e93db01ac..8cd28a20bc56f3cd485dd9affcbf2e2ab1d561f2 100644 >--- a/Source/WebCore/css/DOMCSSNamespace.h >+++ b/Source/WebCore/css/DOMCSSNamespace.h >@@ -29,6 +29,8 @@ > > #pragma once > >+#include "Supplementable.h" >+ > #include <wtf/Forward.h> > #include <wtf/RefCounted.h> > >@@ -36,7 +38,7 @@ namespace WebCore { > > class Document; > >-class DOMCSSNamespace final : public RefCounted<DOMCSSNamespace> { >+class DOMCSSNamespace final : public RefCounted<DOMCSSNamespace>, public Supplementable<DOMCSSNamespace> { > public: > static bool supports(Document&, const String& property, const String& value); > static bool supports(Document&, const String& conditionText); >diff --git a/Source/WebCore/css/DOMCSSRegisterCustomProperty.cpp b/Source/WebCore/css/DOMCSSRegisterCustomProperty.cpp >new file mode 100644 >index 0000000000000000000000000000000000000000..a0d887279078411f44117d8c84bc29c565b2b3d6 >--- /dev/null >+++ b/Source/WebCore/css/DOMCSSRegisterCustomProperty.cpp >@@ -0,0 +1,65 @@ >+/* >+ * Copyright (C) 2018 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. >+ * 3. Neither the name of Motorola Mobility Inc. nor the names of its >+ * contributors may be used to endorse or promote products derived from this >+ * software without specific prior written permission. >+ * >+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 THE COPYRIGHT >+ * OWNER OR 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. >+ */ >+ >+#include "config.h" >+#include "DOMCSSRegisterCustomProperty.h" >+ >+#include "CSSRegisteredCustomProperty.h" >+#include "DOMCSSNamespace.h" >+#include "Document.h" >+#include <wtf/text/WTFString.h> >+ >+namespace WebCore { >+ >+void DOMCSSRegisterCustomProperty::registerProperty(Document& document, const DOMCSSCustomPropertyDescriptor& descriptor) >+{ >+ CSSRegisteredCustomProperty property { descriptor.name }; >+ if (!document.registerCSSProperty(property)) { >+ /* TODO throw JS exception */ >+ return; >+ } >+} >+ >+DOMCSSRegisterCustomProperty* DOMCSSRegisterCustomProperty::from(DOMCSSNamespace& css) >+{ >+ auto* supplement = static_cast<DOMCSSRegisterCustomProperty*>(Supplement<DOMCSSNamespace>::from(&css, supplementName())); >+ if (!supplement) { >+ auto newSupplement = std::make_unique<DOMCSSRegisterCustomProperty>(css); >+ supplement = newSupplement.get(); >+ provideTo(&css, supplementName(), WTFMove(newSupplement)); >+ } >+ return supplement; >+} >+ >+const char* DOMCSSRegisterCustomProperty::supplementName() >+{ >+ return "DOMCSSRegisterCustomProperty"; >+} >+ >+} >diff --git a/Source/WebCore/css/DOMCSSRegisterCustomProperty.h b/Source/WebCore/css/DOMCSSRegisterCustomProperty.h >new file mode 100644 >index 0000000000000000000000000000000000000000..0929b0cd778c8096c6a9ff32a650cecb1cae2f41 >--- /dev/null >+++ b/Source/WebCore/css/DOMCSSRegisterCustomProperty.h >@@ -0,0 +1,51 @@ >+/* >+ * Copyright (C) 2012 Motorola Mobility 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. >+ * 3. Neither the name of Motorola Mobility Inc. nor the names of its >+ * contributors may be used to endorse or promote products derived from this >+ * software without specific prior written permission. >+ * >+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 THE COPYRIGHT >+ * OWNER OR 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. >+ */ >+ >+#pragma once >+ >+#include "DOMCSSCustomPropertyDescriptor.h" >+#include "Supplementable.h" >+ >+namespace WebCore { >+ >+class Document; >+class DOMCSSNamespace; >+ >+class DOMCSSRegisterCustomProperty final : public Supplement<DOMCSSNamespace> { >+public: >+ explicit DOMCSSRegisterCustomProperty(DOMCSSNamespace&) { } >+ >+ static void registerProperty(Document&, const DOMCSSCustomPropertyDescriptor&); >+ >+private: >+ static DOMCSSRegisterCustomProperty* from(DOMCSSNamespace&); >+ static const char* supplementName(); >+}; >+ >+} >diff --git a/Source/WebCore/css/DOMCSSRegisterCustomProperty.idl b/Source/WebCore/css/DOMCSSRegisterCustomProperty.idl >new file mode 100644 >index 0000000000000000000000000000000000000000..3dbe082e5efb4321e8fcb830bb7cfc69f2e4ad1b >--- /dev/null >+++ b/Source/WebCore/css/DOMCSSRegisterCustomProperty.idl >@@ -0,0 +1,34 @@ >+/* >+ * Copyright (C) 2012 Motorola Mobility 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. >+ * 3. Neither the name of Motorola Mobility Inc. nor the names of its >+ * contributors may be used to endorse or promote products derived from this >+ * software without specific prior written permission. >+ * >+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 THE COPYRIGHT >+ * OWNER OR 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. >+ */ >+ >+[ >+ EnabledAtRuntime=CSSCustomPropertiesAndValues >+] partial interface DOMCSSNamespace { >+ [CallWith=Document] static void registerProperty(DOMCSSCustomPropertyDescriptor descriptor); >+}; >diff --git a/Source/WebCore/css/parser/CSSParserContext.cpp b/Source/WebCore/css/parser/CSSParserContext.cpp >index 2bb34a9c01a476eea3087a5a5c2e5fab3b830564..e3e7f9cb7975ca0f72d0de80fbd16b34b83a35c9 100644 >--- a/Source/WebCore/css/parser/CSSParserContext.cpp >+++ b/Source/WebCore/css/parser/CSSParserContext.cpp >@@ -26,6 +26,9 @@ > #include "config.h" > #include "CSSParserContext.h" > >+#include "Document.h" >+#include "Page.h" >+#include "Settings.h" > #include <wtf/NeverDestroyed.h> > > namespace WebCore { >diff --git a/Source/WebCore/dom/Document.cpp b/Source/WebCore/dom/Document.cpp >index 51f660e21666cb72cb9914aad9385da2d9afbc61..cf2cd3337bacdaf4fce9cd3812869b8f074c8467 100644 >--- a/Source/WebCore/dom/Document.cpp >+++ b/Source/WebCore/dom/Document.cpp >@@ -8216,4 +8216,9 @@ String Document::signedPublicKeyAndChallengeString(unsigned keySizeIndex, const > return page->chrome().client().signedPublicKeyAndChallengeString(keySizeIndex, challengeString, url); > } > >+bool Document::registerCSSProperty(const CSSRegisteredCustomProperty& prop) >+{ >+ return m_CSSRegisteredPropertySet.add(prop.name, prop).isNewEntry; >+} >+ > } // namespace WebCore >diff --git a/Source/WebCore/dom/Document.h b/Source/WebCore/dom/Document.h >index cd1a9630fc494d1c44423e238d8ebe687dacf15a..3d6bb9809405a2f7a2439096dfd569bcfb95c069 100644 >--- a/Source/WebCore/dom/Document.h >+++ b/Source/WebCore/dom/Document.h >@@ -27,6 +27,7 @@ > > #pragma once > >+#include "CSSRegisteredCustomProperty.h" > #include "Color.h" > #include "ContainerNode.h" > #include "DisabledAdaptations.h" >@@ -1491,6 +1492,8 @@ public: > void updateMainArticleElementAfterLayout(); > bool hasMainArticleElement() const { return !!m_mainArticleElement; } > >+ bool registerCSSProperty(const CSSRegisteredCustomProperty&); >+ > void setAsRunningUserScripts() { m_isRunningUserScripts = true; } > bool isRunningUserScripts() const { return m_isRunningUserScripts; } > >@@ -2023,6 +2026,8 @@ private: > > std::unique_ptr<UserGestureIndicator> m_temporaryUserGesture; > >+ HashMap<String, CSSRegisteredCustomProperty> m_CSSRegisteredPropertySet; >+ > bool m_isRunningUserScripts { false }; > }; > >diff --git a/Source/WebCore/features.json b/Source/WebCore/features.json >index 2ece761d1bb4411000b1bc32135949bd2d172b1a..c2ea39da8562101eec90b6fad4da1c4bd45a5c36 100644 >--- a/Source/WebCore/features.json >+++ b/Source/WebCore/features.json >@@ -49,6 +49,16 @@ > "category": "css", > "description": "Allows content to specify colors outside of the sRGB Color Space." > }, >+ { >+ "name": "CSS Custom Properties And Values", >+ "status": { >+ "status": "Under Development" >+ }, >+ "url": "https://drafts.css-houdini.org/css-properties-values-api/", >+ "webkit-url": "https://bugs.webkit.org/show_bug.cgi?id=189692", >+ "keywords": ["CSSCustomPropertiesAndValues", "custom properties", "css"], >+ "description": "An API for registering new CSS properties. Properties registered using this API are provided with a parse syntax that defines a type, inheritance behaviour, and an initial value." >+ }, > { > "name": "CSS Font Display", > "status": { >diff --git a/Source/WebCore/page/RuntimeEnabledFeatures.h b/Source/WebCore/page/RuntimeEnabledFeatures.h >index 47705649d8596d345e4540ab816a82e12447b1b0..e163678afeb0a9010fe55c19e1c26161c057ff15 100644 >--- a/Source/WebCore/page/RuntimeEnabledFeatures.h >+++ b/Source/WebCore/page/RuntimeEnabledFeatures.h >@@ -285,6 +285,9 @@ public: > void setWebAPIStatisticsEnabled(bool isEnabled) { m_webAPIStatisticsEnabled = isEnabled; } > bool webAPIStatisticsEnabled() const { return m_webAPIStatisticsEnabled; } > >+ void setCSSCustomPropertiesAndValuesEnabled(bool isEnabled) { m_CSSCustomPropertiesAndValuesEnabled = isEnabled; } >+ bool cssCustomPropertiesAndValuesEnabled() const { return m_CSSCustomPropertiesAndValuesEnabled; } >+ > WEBCORE_EXPORT static RuntimeEnabledFeatures& sharedFeatures(); > > private: >@@ -430,6 +433,8 @@ private: > > bool m_webAPIStatisticsEnabled { false }; > >+ bool m_CSSCustomPropertiesAndValuesEnabled { false }; >+ > friend class WTF::NeverDestroyed<RuntimeEnabledFeatures>; > }; > >diff --git a/Source/WebKit/Shared/WebPreferences.yaml b/Source/WebKit/Shared/WebPreferences.yaml >index 66f61586a9157f6d99461502a9a0ec4d48eb00ea..d3a861876bda98d761dceedffc8b6bdfef69cfe7 100644 >--- a/Source/WebKit/Shared/WebPreferences.yaml >+++ b/Source/WebKit/Shared/WebPreferences.yaml >@@ -1350,3 +1350,11 @@ WebAPIStatisticsEnabled: > humanReadableDescription: "Enable Web API Statistics" > webcoreBinding: RuntimeEnabledFeatures > category: internal >+ >+CSSCustomPropertiesAndValuesEnabled: >+ type: bool >+ defaultValue: false >+ humanReadableName: "CSS Custom Properties and Values API" >+ humanReadableDescription: "Enable CSS Custom Properties and Values API" >+ webcoreBinding: RuntimeEnabledFeatures >+ category: experimental >diff --git a/Source/WebKit/WebProcess/InjectedBundle/InjectedBundle.cpp b/Source/WebKit/WebProcess/InjectedBundle/InjectedBundle.cpp >index 8d681fe478513abef8609d03f27b5736ab4a38e0..625ec12ec8987021a49f6bff0220634df0048c07 100644 >--- a/Source/WebKit/WebProcess/InjectedBundle/InjectedBundle.cpp >+++ b/Source/WebKit/WebProcess/InjectedBundle/InjectedBundle.cpp >@@ -253,6 +253,9 @@ void InjectedBundle::overrideBoolPreferenceForTestRunner(WebPageGroupProxy* page > if (preference == "WebKitWebAPIStatisticsEnabled") > RuntimeEnabledFeatures::sharedFeatures().setWebAPIStatisticsEnabled(enabled); > >+ if (preference == "CSSCustomPropertiesAndValuesEnabled") >+ RuntimeEnabledFeatures::sharedFeatures().setCSSCustomPropertiesAndValuesEnabled(enabled); >+ > // Map the names used in LayoutTests with the names used in WebCore::Settings and WebPreferencesStore. > #define FOR_EACH_OVERRIDE_BOOL_PREFERENCE(macro) \ > macro(WebKitJavaEnabled, JavaEnabled, javaEnabled) \ >diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog >index 6ee9df2477ff7d0e6ca538cb0c7c322baf46d0fb..9f4c8df48f4f4fcb0077ef4334b9ec8a27313889 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,3 +1,15 @@ >+2018-09-18 Justin Michaud <justin_michaud@apple.com> >+ >+ Implement CSS Custom Properties and Values Skeleton >+ https://bugs.webkit.org/show_bug.cgi?id=189694 >+ >+ Add test to check that the CSS.registerProperty method exists >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * css-custom-properties-api/registerProperty-expected.txt: Added. >+ * css-custom-properties-api/registerProperty.html: Added. >+ > 2018-09-18 Ryan Haddad <ryanhaddad@apple.com> > > [iOS] Layout Test imported/w3c/web-platform-tests/service-workers/service-worker/fetch-cors-xhr.https.html is a flaky failure >diff --git a/LayoutTests/css-custom-properties-api/registerProperty-expected.txt b/LayoutTests/css-custom-properties-api/registerProperty-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..cfcfecec4f370e63e83cf3a9e429798ce1b566b2 >--- /dev/null >+++ b/LayoutTests/css-custom-properties-api/registerProperty-expected.txt >@@ -0,0 +1,5 @@ >+ >+PASS registerProperty requires a Dictionary type >+PASS registerProperty requires a name matching <custom-property-name> >+PASS registerProperty only allows omitting initialValue is syntax is '*' >+ >diff --git a/LayoutTests/css-custom-properties-api/registerProperty.html b/LayoutTests/css-custom-properties-api/registerProperty.html >new file mode 100644 >index 0000000000000000000000000000000000000000..d6e4e5c2d5a210d8749d2fc25581fe1bc163bbb4 >--- /dev/null >+++ b/LayoutTests/css-custom-properties-api/registerProperty.html >@@ -0,0 +1,33 @@ >+<!DOCTYPE html><!-- webkit-test-runner [ experimental:CSSCustomPropertiesAndValuesEnabled=true ] --> >+<!-- https://chromium.googlesource.com/chromium/src/+/01ce431409e3a019858677626a983c55168da6dc/third_party/WebKit/LayoutTests/custom-properties/register-property.html --> >+<script src="../resources/testharness.js"></script> >+<script src="../resources/testharnessreport.js"></script> >+<script> >+// Tests for error checking during property registration >+test(function() { >+ assert_throws(new TypeError(), () => CSS.registerProperty()); >+ assert_throws(new TypeError(), () => CSS.registerProperty(undefined)); >+ assert_throws(new TypeError(), () => CSS.registerProperty(true)); >+ assert_throws(new TypeError(), () => CSS.registerProperty(2)); >+ assert_throws(new TypeError(), () => CSS.registerProperty("css")); >+ assert_throws(new TypeError(), () => CSS.registerProperty(null)); >+}, "registerProperty requires a Dictionary type"); >+test(function() { >+ // Valid property names, shouldn't throw >+ CSS.registerProperty({name: '--name1', inherits: false}); >+ CSS.registerProperty({name: '--name2, no need for escapes', inherits: false}); >+ CSS.registerProperty({name: ['--name', 3], inherits: false}); >+ // Invalid property names >+ assert_throws(new TypeError(), () => CSS.registerProperty({})); >+ assert_throws(new TypeError(), () => CSS.registerProperty({name: '--no-inherits'})); >+ //assert_throws(new SyntaxError(), () => CSS.registerProperty({name: 'no-leading-dash', inherits: false})); >+ //assert_throws(new SyntaxError(), () => CSS.registerProperty({name: '', inherits: false})); >+ //assert_throws(new SyntaxError(), () => CSS.registerProperty({name: '\\--name', inherits: false})); >+}, "registerProperty requires a name matching <custom-property-name>"); >+test(function() { >+ CSS.registerProperty({name: '--syntax-test-1', inherits: false, syntax: '*'}); >+ CSS.registerProperty({name: '--syntax-test-2', inherits: false, syntax: ' * '}); >+ /*assert_throws(new SyntaxError(), >+ () => CSS.registerProperty({name: '--syntax-test-3', syntax: 'length'}));*/ >+}, "registerProperty only allows omitting initialValue is syntax is '*'"); >+</script>
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 189694
:
350009
|
350011
|
350085
|
350089
|
350118
|
350120
|
350141
|
350153
|
350231