+2018-09-20 Justin Michaud <justin_michaud@apple.com>
+
+ Implement CSS Custom Properties and Values Skeleton
+ https://bugs.webkit.org/show_bug.cgi?id=189694
+
+ Reviewed by Simon Fraser.
+
+ Add test to check that the CSS.registerProperty method exists.
+
+ * css-custom-properties-api/registerProperty-expected.txt: Added.
+ * css-custom-properties-api/registerProperty.html: Added.
+ * platform/ios-wk1/TestExpectations:
+ * platform/mac-wk1/TestExpectations:
+
2018-09-20 Dawei Fenton <realdawei@apple.com>
WebGL conformance: Failures and Timeouts in suite 2.0.0/conformance
--- /dev/null
+
+PASS registerProperty requires a Dictionary type
+PASS registerProperty requires a name matching <custom-property-name>
+PASS registerProperty only allows omitting initialValue is syntax is '*'
+
--- /dev/null
+<!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>
imported/w3c/web-platform-tests/credential-management/ [ Skip ]
webkit.org/b/189594 imported/w3c/web-platform-tests/css/css-animations/pending-style-changes-001.html [ Pass Failure ]
+
+# Not supported on WK1
+css-custom-properties-api [ Skip ]
webkit.org/b/189594 imported/w3c/web-platform-tests/css/css-animations/pending-style-changes-001.html [ Pass Failure ]
webkit.org/b/188070 imported/w3c/web-platform-tests/streams/piping/error-propagation-backward.html [ Pass Failure ]
+
+# Not supported on WK1
+css-custom-properties-api [ Skip ]
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
css/DeprecatedCSSOMRect.idl
css/DeprecatedCSSOMValue.idl
css/DeprecatedCSSOMValueList.idl
- css/DOMCSSNamespace.idl
css/ElementCSSInlineStyle.idl
css/FontFace.idl
css/FontFaceSet.idl
2018-09-20 Justin Michaud <justin_michaud@apple.com>
+ Implement CSS Custom Properties and Values Skeleton
+ https://bugs.webkit.org/show_bug.cgi?id=189694
+
+ Reviewed by Simon Fraser.
+
+ Add feature flag, CSS.registerProperty binding and registered property set in Document.h
+ for the css custom properties and values api.
+
+ Test: css-properties-values-api/registerProperty.html
+
+ * CMakeLists.txt:
+ * DerivedSources.make:
+ * Sources.txt:
+ * WebCore.xcodeproj/project.pbxproj:
+ * css/CSSRegisteredCustomProperty.h: Added.
+ * css/DOMCSSCustomPropertyDescriptor.h: Added.
+ * css/DOMCSSCustomPropertyDescriptor.idl: Added.
+ * css/DOMCSSNamespace.h:
+ * css/DOMCSSRegisterCustomProperty.cpp: Added.
+ (WebCore::DOMCSSRegisterCustomProperty::registerProperty):
+ (WebCore::DOMCSSRegisterCustomProperty::from):
+ (WebCore::DOMCSSRegisterCustomProperty::supplementName):
+ * css/DOMCSSRegisterCustomProperty.h: Added.
+ * css/DOMCSSRegisterCustomProperty.idl: Added.
+ * css/parser/CSSParserContext.cpp:
+ * dom/Document.cpp:
+ (WebCore::Document::registerCSSProperty):
+ * dom/Document.h:
+ * features.json:
+ * page/RuntimeEnabledFeatures.h:
+ (WebCore::RuntimeEnabledFeatures::setCSSCustomPropertiesAndValuesEnabled):
+ (WebCore::RuntimeEnabledFeatures::cssCustomPropertiesAndValuesEnabled const):
+
+2018-09-20 Justin Michaud <justin_michaud@apple.com>
+
JS bindings generator should support EnabledAtRuntime for static methods
https://bugs.webkit.org/show_bug.cgi?id=189729
$(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 \
css/CSSVariableData.cpp
css/CSSVariableReferenceValue.cpp
css/DOMCSSNamespace.cpp
+css/DOMCSSRegisterCustomProperty.cpp
css/DOMMatrix.cpp
css/DOMMatrixReadOnly.cpp
css/DeprecatedCSSOMPrimitiveValue.cpp
JSDocumentTimelineOptions.cpp
JSDOMApplicationCache.cpp
JSDOMCSSNamespace.cpp
+JSDOMCSSRegisterCustomProperty.cpp
+JSDOMCSSCustomPropertyDescriptor.cpp
JSDOMCache.cpp
JSDOMCacheStorage.cpp
JSDOMException.cpp
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, ); }; };
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>"; };
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 */,
CD669D651D232DF4004D1866 /* cocoa */ = {
isa = PBXGroup;
children = (
- 417F7AEA2139BF6400FBA7EC /* MediaSessionManagerCocoa.mm */,
417F7AED2139BF6500FBA7EC /* MediaSessionManagerCocoa.h */,
+ 417F7AEA2139BF6400FBA7EC /* MediaSessionManagerCocoa.mm */,
417F7AEB2139BF6400FBA7EC /* WebAudioBufferList.cpp */,
417F7AEC2139BF6500FBA7EC /* WebAudioBufferList.h */,
);
9362640A0DE1137D009D5A00 /* CSSReflectionDirection.h */,
BC5A12DD0DC0414800C9AFAD /* CSSReflectValue.cpp */,
BC5A12DE0DC0414800C9AFAD /* CSSReflectValue.h */,
+ 4BDA3FFB2151B6F400FD6604 /* CSSRegisteredCustomProperty.h */,
BC7D8FF11BD1A47900FFE540 /* CSSRevertValue.cpp */,
BC7D8FF21BD1A47900FFE540 /* CSSRevertValue.h */,
A80E6CDC0A1989CA007FB8C5 /* CSSRule.cpp */,
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 */,
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 */,
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 */,
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 */,
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 */,
--- /dev/null
+/*
+ * 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``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
+ * 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 {
+ const String name;
+ /* TODO syntax, inherits, initialValue */
+};
+
+}
--- /dev/null
+/*
+ * 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``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
+ * 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;
+};
+
+}
--- /dev/null
+/*
+* 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.
+*
+* THIS SOFTWARE IS PROVIDED BY APPLE INC. ``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
+* 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;
+};
#pragma once
+#include "Supplementable.h"
+
#include <wtf/Forward.h>
#include <wtf/RefCounted.h>
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);
--- /dev/null
+/*
+ * 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``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
+ * 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(WTFMove(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";
+}
+
+}
--- /dev/null
+/*
+ * 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``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
+ * 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();
+};
+
+}
--- /dev/null
+/*
+* 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.
+*
+* THIS SOFTWARE IS PROVIDED BY APPLE INC. ``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
+* 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);
+};
#include "config.h"
#include "CSSParserContext.h"
+#include "Document.h"
+#include "Page.h"
+#include "Settings.h"
#include <wtf/NeverDestroyed.h>
namespace WebCore {
return page->chrome().client().signedPublicKeyAndChallengeString(keySizeIndex, challengeString, url);
}
+bool Document::registerCSSProperty(CSSRegisteredCustomProperty&& prop)
+{
+ return m_CSSRegisteredPropertySet.add(prop.name, std::make_unique<CSSRegisteredCustomProperty>(WTFMove(prop))).isNewEntry;
+}
+
} // namespace WebCore
#pragma once
+#include "CSSRegisteredCustomProperty.h"
#include "Color.h"
#include "ContainerNode.h"
#include "DisabledAdaptations.h"
void updateMainArticleElementAfterLayout();
bool hasMainArticleElement() const { return !!m_mainArticleElement; }
+ bool registerCSSProperty(CSSRegisteredCustomProperty&&);
+
void setAsRunningUserScripts() { m_isRunningUserScripts = true; }
bool isRunningUserScripts() const { return m_isRunningUserScripts; }
std::unique_ptr<UserGestureIndicator> m_temporaryUserGesture;
+ HashMap<String, std::unique_ptr<CSSRegisteredCustomProperty>> m_CSSRegisteredPropertySet;
+
bool m_isRunningUserScripts { false };
};
"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": {
"status": "In Development",
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:
bool m_webAPIStatisticsEnabled { false };
+ bool m_CSSCustomPropertiesAndValuesEnabled { false };
+
friend class WTF::NeverDestroyed<RuntimeEnabledFeatures>;
};
+2018-09-20 Justin Michaud <justin_michaud@apple.com>
+
+ Implement CSS Custom Properties and Values Skeleton
+ https://bugs.webkit.org/show_bug.cgi?id=189694
+
+ Reviewed by Simon Fraser.
+
+ Add feature flag for CSS custom properties and values api
+
+ * Shared/WebPreferences.yaml:
+ * WebProcess/InjectedBundle/InjectedBundle.cpp:
+ (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
+
2018-09-19 Dean Jackson <dino@apple.com>
Temporarily move fullscreen back to experimental features
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
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) \