WebKit Bugzilla
Attachment 357343 Details for
Bug 192671
: CSS Typed OM should expose attributeStyleMap
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-192671-20181214141840.patch (text/plain), 74.46 KB, created by
Justin Michaud
on 2018-12-14 14:18:41 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Justin Michaud
Created:
2018-12-14 14:18:41 PST
Size:
74.46 KB
patch
obsolete
>Subversion Revision: 239171 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index c7c333bbc491e236532813334d0f41a531b75075..ba4f6fe3051aebaaec3d26b957dfcf0ba04a7bd1 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,50 @@ >+2018-12-14 Justin Michaud <justin_michaud@apple.com> >+ >+ CSS Typed OM should expose attributeStyleMap >+ https://bugs.webkit.org/show_bug.cgi?id=192671 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Exposes element.attributeStyleMap, adds a stub for the StylePropertyMap class, and updates the existing >+ TypedOMCSSImageValue to not require a RenderObject so that it can still work inside attributeStyleMap. >+ >+ Test: css-typedom/attributeStyleMap.html >+ >+ * CMakeLists.txt: >+ * DerivedSources.make: >+ * Sources.txt: >+ * WebCore.xcodeproj/project.pbxproj: >+ * bindings/js/WebCoreBuiltinNames.h: >+ * css/ElementCSSInlineStyle.idl: >+ * css/typedom/StylePropertyMap.h: Copied from Source/WebCore/css/typedom/StylePropertyMapReadOnly.h. >+ * css/typedom/StylePropertyMap.idl: Copied from Source/WebCore/css/typedom/StylePropertyMapReadOnly.idl. >+ * css/typedom/StylePropertyMapReadOnly.cpp: Added. >+ (WebCore::StylePropertyMapReadOnly::reifyValue): >+ * css/typedom/StylePropertyMapReadOnly.h: >+ (WebCore::StylePropertyMapReadOnly::create): Deleted. >+ (WebCore::StylePropertyMapReadOnly::get const): Deleted. >+ (WebCore::StylePropertyMapReadOnly::StylePropertyMapReadOnly): Deleted. >+ * css/typedom/StylePropertyMapReadOnly.idl: >+ * css/typedom/TypedOMCSSImageValue.h: >+ * dom/Element.cpp: >+ (WebCore::Element::attributeStyleMap): >+ (WebCore::Element::setAttributeStyleMap): >+ * dom/Element.h: >+ * dom/ElementRareData.cpp: >+ * dom/ElementRareData.h: >+ (WebCore::ElementRareData::attributeStyleMap): >+ (WebCore::ElementRareData::setAttributeStyleMap): >+ * dom/StyledElement.cpp: >+ (WebCore::extractInlineProperty): >+ (WebCore::StyledElement::ensureAttributeStyleMap): >+ * dom/StyledElement.h: >+ * html/canvas/CanvasRenderingContext2DBase.cpp: >+ (WebCore::size): >+ (WebCore::CanvasRenderingContext2DBase::drawImage): >+ * platform/graphics/CustomPaintImage.cpp: >+ (WebCore::extractComputedProperty): >+ (WebCore::CustomPaintImage::doCustomPaint): >+ > 2018-12-13 Eric Carlson <eric.carlson@apple.com> > > [MediaStream] Calculate width or height when constraints contain only the other >diff --git a/Source/WebCore/CMakeLists.txt b/Source/WebCore/CMakeLists.txt >index 0bdd29cde1808c25d5ce8a165455584786066fba..194cc68b9da56842f69d9eb8037631a1a7c7d7cb 100644 >--- a/Source/WebCore/CMakeLists.txt >+++ b/Source/WebCore/CMakeLists.txt >@@ -601,12 +601,13 @@ set(WebCore_NON_SVG_IDL_FILES > css/StyleSheet.idl > css/StyleSheetList.idl > >+ css/typedom/StylePropertyMap.idl >+ css/typedom/StylePropertyMapReadOnly.idl > css/typedom/TypedOMCSSImageValue.idl > css/typedom/TypedOMCSSNumericValue.idl > css/typedom/TypedOMCSSStyleValue.idl > css/typedom/TypedOMCSSUnitValue.idl > css/typedom/TypedOMCSSUnparsedValue.idl >- css/typedom/StylePropertyMapReadOnly.idl > > css/WebKitCSSMatrix.idl > css/WebKitCSSViewportRule.idl >diff --git a/Source/WebCore/DerivedSources.make b/Source/WebCore/DerivedSources.make >index f6f7e3516ae7465882cfbf30512754d9434637e6..9e7109830ecdceeea0925e83a9f1c09da151d7ce 100644 >--- a/Source/WebCore/DerivedSources.make >+++ b/Source/WebCore/DerivedSources.make >@@ -510,6 +510,7 @@ JS_BINDING_IDLS = \ > $(WebCore)/css/StyleMedia.idl \ > $(WebCore)/css/StyleSheet.idl \ > $(WebCore)/css/StyleSheetList.idl \ >+ $(WebCore)/css/typedom/StylePropertyMap.idl \ > $(WebCore)/css/typedom/StylePropertyMapReadOnly.idl \ > $(WebCore)/css/typedom/TypedOMCSSImageValue.idl \ > $(WebCore)/css/typedom/TypedOMCSSNumericValue.idl \ >diff --git a/Source/WebCore/Sources.txt b/Source/WebCore/Sources.txt >index b4bdb25b5170687440ba663f06a09bec401e0e2f..99220406529c1fe910d3c575691d02b52d2279c0 100644 >--- a/Source/WebCore/Sources.txt >+++ b/Source/WebCore/Sources.txt >@@ -721,6 +721,8 @@ css/parser/MediaQueryParser.cpp > css/parser/SizesAttributeParser.cpp > css/parser/SizesCalcParser.cpp > >+css/typedom/StylePropertyMapReadOnly.cpp >+ > cssjit/SelectorCompiler.cpp > > dom/AbortController.cpp >@@ -3184,6 +3186,7 @@ JSStorage.cpp > JSStorageEvent.cpp > JSStringCallback.cpp > JSStyleMedia.cpp >+JSStylePropertyMap.cpp > JSStylePropertyMapReadOnly.cpp > JSStyleSheet.cpp > JSStyleSheetList.cpp >diff --git a/Source/WebCore/WebCore.xcodeproj/project.pbxproj b/Source/WebCore/WebCore.xcodeproj/project.pbxproj >index edeb4a8e7d6ea6e694b80609e0974a092395da51..d4de76ad2e798fb7775ed90f10f5cfa3e90ff6d7 100644 >--- a/Source/WebCore/WebCore.xcodeproj/project.pbxproj >+++ b/Source/WebCore/WebCore.xcodeproj/project.pbxproj >@@ -1382,6 +1382,7 @@ > 4BAFD0D921921EA000C0AB64 /* TypedOMCSSUnparsedValue.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BAFD0D821921EA000C0AB64 /* TypedOMCSSUnparsedValue.h */; }; > 4BAFD0E0219220AB00C0AB64 /* TypedOMCSSNumericValue.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BAFD0DF219220AB00C0AB64 /* TypedOMCSSNumericValue.h */; }; > 4BAFD0E1219242A000C0AB64 /* TypedOMCSSUnitValue.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BAFD0DD2192209200C0AB64 /* TypedOMCSSUnitValue.h */; }; >+ 4BD781BF21C1965F00D9703E /* StylePropertyMap.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BD781BE21C1965F00D9703E /* StylePropertyMap.h */; }; > 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, ); }; }; >@@ -7919,6 +7920,9 @@ > 4BAFD0DD2192209200C0AB64 /* TypedOMCSSUnitValue.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.h; path = TypedOMCSSUnitValue.h; sourceTree = "<group>"; }; > 4BAFD0DF219220AB00C0AB64 /* TypedOMCSSNumericValue.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = TypedOMCSSNumericValue.h; sourceTree = "<group>"; }; > 4BAFD0E22192604D00C0AB64 /* JSTypedOMCSSStyleValueCustom.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = JSTypedOMCSSStyleValueCustom.cpp; sourceTree = "<group>"; }; >+ 4BD781BC21C1964800D9703E /* StylePropertyMap.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = StylePropertyMap.idl; sourceTree = "<group>"; }; >+ 4BD781BE21C1965F00D9703E /* StylePropertyMap.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = StylePropertyMap.h; sourceTree = "<group>"; }; >+ 4BD781C521C1D67700D9703E /* StylePropertyMapReadOnly.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = StylePropertyMapReadOnly.cpp; 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>"; }; >@@ -18142,6 +18146,9 @@ > 4BAFD0DA21921EAD00C0AB64 /* typedom */ = { > isa = PBXGroup; > children = ( >+ 4BD781BE21C1965F00D9703E /* StylePropertyMap.h */, >+ 4BD781BC21C1964800D9703E /* StylePropertyMap.idl */, >+ 4BD781C521C1D67700D9703E /* StylePropertyMapReadOnly.cpp */, > 4BAFD0CE2190F9B400C0AB64 /* StylePropertyMapReadOnly.h */, > 4BAFD0D02190F9C200C0AB64 /* StylePropertyMapReadOnly.idl */, > 4B43864F219CD56100F8D3C5 /* TypedOMCSSImageValue.h */, >@@ -31138,6 +31145,7 @@ > BC5EB74E0E81E06700B25965 /* StyleMultiColData.h in Headers */, > E4DACE6A1D12E10B0075980F /* StylePendingResources.h in Headers */, > A80E6DFC0A199067007FB8C5 /* StyleProperties.h in Headers */, >+ 4BD781BF21C1965F00D9703E /* StylePropertyMap.h in Headers */, > 4BAFD0CF2190F9B500C0AB64 /* StylePropertyMapReadOnly.h in Headers */, > E1B25107152A0BB00069B779 /* StylePropertyShorthand.h in Headers */, > 83C05A5B1A686212007E5DEA /* StylePropertyShorthandFunctions.h in Headers */, >diff --git a/Source/WebCore/bindings/js/WebCoreBuiltinNames.h b/Source/WebCore/bindings/js/WebCoreBuiltinNames.h >index e0b397f3ddd643e7e4e13fc9853e5e01d1b1fcf1..bef18c3325bc55781861579e772bb2859531e892 100644 >--- a/Source/WebCore/bindings/js/WebCoreBuiltinNames.h >+++ b/Source/WebCore/bindings/js/WebCoreBuiltinNames.h >@@ -177,6 +177,7 @@ namespace WebCore { > macro(SpectreGadget) \ > macro(StaticRange) \ > macro(StylePropertyMapReadOnly) \ >+ macro(StylePropertyMap) \ > macro(VRDisplay) \ > macro(VRDisplayCapabilities) \ > macro(VRDisplayEvent) \ >diff --git a/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm b/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm >index 4917c14a8e7d71c59e38591ae0867127fa263f32..c5382bd7ac2d0d58bce72bcf1d741048c19ebf6d 100644 >--- a/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm >+++ b/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm >@@ -4524,7 +4524,10 @@ sub GenerateImplementation > if ($numCachedAttributes > 0) { > foreach my $attribute (@{$interface->attributes}) { > if ($attribute->extendedAttributes->{CachedAttribute}) { >+ my $conditionalString = $codeGenerator->GenerateConditionalString($attribute); >+ push(@implContent, "#if ${conditionalString}\n") if $conditionalString; > push(@implContent, " visitor.append(thisObject->m_" . $attribute->name . ");\n"); >+ push(@implContent, "#endif\n") if $conditionalString; > } > } > } >diff --git a/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp b/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp >index 1bd2fa1e005c34c8b8d6e0fe1388a980bdc4140a..e2f48367eaec95daba1e6e1da0bad20951f69029 100644 >--- a/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp >+++ b/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp >@@ -1737,6 +1737,9 @@ bool setJSTestObjConditionalAttr6Constructor(JSC::ExecState*, JSC::EncodedJSValu > #endif > JSC::EncodedJSValue jsTestObjCachedAttribute1(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); > JSC::EncodedJSValue jsTestObjCachedAttribute2(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); >+#if ENABLE(CONDITION) >+JSC::EncodedJSValue jsTestObjCachedAttribute3(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); >+#endif > JSC::EncodedJSValue jsTestObjAnyAttribute(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); > bool setJSTestObjAnyAttribute(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); > JSC::EncodedJSValue jsTestObjObjectAttribute(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); >@@ -2072,6 +2075,11 @@ static const HashTableValue JSTestObjPrototypeTableValues[] = > #endif > { "cachedAttribute1", static_cast<unsigned>(JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCachedAttribute1), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } }, > { "cachedAttribute2", static_cast<unsigned>(JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCachedAttribute2), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } }, >+#if ENABLE(CONDITION) >+ { "cachedAttribute3", static_cast<unsigned>(JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCachedAttribute3), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } }, >+#else >+ { 0, 0, NoIntrinsic, { 0, 0 } }, >+#endif > { "anyAttribute", static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjAnyAttribute), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestObjAnyAttribute) } }, > { "objectAttribute", static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjObjectAttribute), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestObjObjectAttribute) } }, > { "contentDocument", static_cast<unsigned>(JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjContentDocument), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } }, >@@ -4543,6 +4551,26 @@ EncodedJSValue jsTestObjCachedAttribute2(ExecState* state, EncodedJSValue thisVa > return IDLAttribute<JSTestObj>::get<jsTestObjCachedAttribute2Getter, CastedThisErrorBehavior::Assert>(*state, thisValue, "cachedAttribute2"); > } > >+#if ENABLE(CONDITION) >+static inline JSValue jsTestObjCachedAttribute3Getter(ExecState& state, JSTestObj& thisObject, ThrowScope& throwScope) >+{ >+ UNUSED_PARAM(throwScope); >+ UNUSED_PARAM(state); >+ if (JSValue cachedValue = thisObject.m_cachedAttribute3.get()) >+ return cachedValue; >+ auto& impl = thisObject.wrapped(); >+ JSValue result = toJS<IDLAny>(state, throwScope, impl.cachedAttribute3()); >+ thisObject.m_cachedAttribute3.set(state.vm(), &thisObject, result); >+ return result; >+} >+ >+EncodedJSValue jsTestObjCachedAttribute3(ExecState* state, EncodedJSValue thisValue, PropertyName) >+{ >+ return IDLAttribute<JSTestObj>::get<jsTestObjCachedAttribute3Getter, CastedThisErrorBehavior::Assert>(*state, thisValue, "cachedAttribute3"); >+} >+ >+#endif >+ > static inline JSValue jsTestObjAnyAttributeGetter(ExecState& state, JSTestObj& thisObject, ThrowScope& throwScope) > { > UNUSED_PARAM(throwScope); >@@ -8494,6 +8522,9 @@ void JSTestObj::visitChildren(JSCell* cell, SlotVisitor& visitor) > Base::visitChildren(thisObject, visitor); > visitor.append(thisObject->m_cachedAttribute1); > visitor.append(thisObject->m_cachedAttribute2); >+#if ENABLE(CONDITION) >+ visitor.append(thisObject->m_cachedAttribute3); >+#endif > } > > void JSTestObj::heapSnapshot(JSCell* cell, HeapSnapshotBuilder& builder) >diff --git a/Source/WebCore/bindings/scripts/test/JS/JSTestObj.h b/Source/WebCore/bindings/scripts/test/JS/JSTestObj.h >index 1e1b467ffe17da906e8faf1d3942f88e1a15c1c8..0566b17d337d3a3bf1a6ba3c16f63f7b559924e5 100644 >--- a/Source/WebCore/bindings/scripts/test/JS/JSTestObj.h >+++ b/Source/WebCore/bindings/scripts/test/JS/JSTestObj.h >@@ -60,6 +60,9 @@ public: > static JSC::JSObject* serialize(JSC::ExecState&, JSTestObj& thisObject, JSDOMGlobalObject&, JSC::ThrowScope&); > mutable JSC::WriteBarrier<JSC::Unknown> m_cachedAttribute1; > mutable JSC::WriteBarrier<JSC::Unknown> m_cachedAttribute2; >+#if ENABLE(CONDITION) >+ mutable JSC::WriteBarrier<JSC::Unknown> m_cachedAttribute3; >+#endif > static void visitChildren(JSCell*, JSC::SlotVisitor&); > > static void heapSnapshot(JSCell*, JSC::HeapSnapshotBuilder&); >diff --git a/Source/WebCore/bindings/scripts/test/TestObj.idl b/Source/WebCore/bindings/scripts/test/TestObj.idl >index 6da48039be6169865de14c71d906a1434ce301a1..b77e953617a8ef2ccfb56aa2194baa7a2fb0da61 100644 >--- a/Source/WebCore/bindings/scripts/test/TestObj.idl >+++ b/Source/WebCore/bindings/scripts/test/TestObj.idl >@@ -276,6 +276,7 @@ enum TestConfidence { "high", "kinda-low" }; > > [CachedAttribute] readonly attribute any cachedAttribute1; > [CachedAttribute] readonly attribute any cachedAttribute2; >+ [CachedAttribute, Conditional=CONDITION] readonly attribute any cachedAttribute3; > > attribute any anyAttribute; > attribute object objectAttribute; >diff --git a/Source/WebCore/css/ElementCSSInlineStyle.idl b/Source/WebCore/css/ElementCSSInlineStyle.idl >index cfe72396f60381023c4b1da788d05d6725d36224..5ea98d87bbe2c45539266c3abbd4d684e9708fd9 100644 >--- a/Source/WebCore/css/ElementCSSInlineStyle.idl >+++ b/Source/WebCore/css/ElementCSSInlineStyle.idl >@@ -29,4 +29,5 @@ > NoInterfaceObject, > ] interface ElementCSSInlineStyle { > [ImplementedAs=cssomStyle, PutForwards=cssText] readonly attribute CSSStyleDeclaration style; // FIXME: Should be [SameObject]. >+ [ImplementedAs=ensureAttributeStyleMap, CachedAttribute, EnabledAtRuntime=CSSTypedOM, Conditional=CSS_TYPED_OM] readonly attribute StylePropertyMap attributeStyleMap; // FIXME: Should be [SameObject]. > }; >diff --git a/Source/WebCore/css/typedom/StylePropertyMap.h b/Source/WebCore/css/typedom/StylePropertyMap.h >new file mode 100644 >index 0000000000000000000000000000000000000000..33a5361735fcfb1f7f4b01a44115c1c40275187e >--- /dev/null >+++ b/Source/WebCore/css/typedom/StylePropertyMap.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. >+ * >+ * 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 >+ >+#if ENABLE(CSS_TYPED_OM) >+ >+#include "StylePropertyMapReadOnly.h" >+#include <wtf/HashMap.h> >+#include <wtf/RefCounted.h> >+#include <wtf/text/WTFString.h> >+ >+namespace WebCore { >+ >+class StylePropertyMap : public StylePropertyMapReadOnly { >+public: >+}; >+ >+} // namespace WebCore >+ >+#endif >diff --git a/Source/WebCore/css/typedom/StylePropertyMap.idl b/Source/WebCore/css/typedom/StylePropertyMap.idl >new file mode 100644 >index 0000000000000000000000000000000000000000..8692549a3dd4e9399d59f4a01ac908fcddc06fd3 >--- /dev/null >+++ b/Source/WebCore/css/typedom/StylePropertyMap.idl >@@ -0,0 +1,33 @@ >+/* >+* 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=CSSTypedOM, >+ Conditional=CSS_TYPED_OM, >+ Exposed=(Window), >+ SkipVTableValidation, >+ JSGenerateToJSObject >+] interface StylePropertyMap : StylePropertyMapReadOnly { >+}; >diff --git a/Source/WebCore/css/typedom/StylePropertyMapReadOnly.cpp b/Source/WebCore/css/typedom/StylePropertyMapReadOnly.cpp >new file mode 100644 >index 0000000000000000000000000000000000000000..b131a261e7eb6b0a6c86c0141c86c4143e5d32f2 >--- /dev/null >+++ b/Source/WebCore/css/typedom/StylePropertyMapReadOnly.cpp >@@ -0,0 +1,62 @@ >+/* >+ * 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 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. >+ */ >+ >+#include "config.h" >+#include "StylePropertyMapReadOnly.h" >+ >+#if ENABLE(CSS_TYPED_OM) >+ >+#include "CSSImageValue.h" >+#include "TypedOMCSSImageValue.h" >+#include "TypedOMCSSUnitValue.h" >+#include "TypedOMCSSUnparsedValue.h" >+#include <wtf/HashMap.h> >+ >+namespace WebCore { >+ >+ >+RefPtr<TypedOMCSSStyleValue> StylePropertyMapReadOnly::reifyValue(CSSValue* value, Document& document, Element*) >+{ >+ if (!value) >+ return nullptr; >+ >+ // FIXME: Properly reify all length values. >+ if (is<CSSPrimitiveValue>(*value) && downcast<CSSPrimitiveValue>(*value).primitiveType() == CSSPrimitiveValue::CSS_PX) >+ return TypedOMCSSUnitValue::create(downcast<CSSPrimitiveValue>(*value).doubleValue(), "px"); >+ >+ if (is<CSSImageValue>(*value)) >+ return TypedOMCSSImageValue::create(downcast<CSSImageValue>(*value), document); >+ >+ // FIXME: should use raw TypedOMCSSStyleValue >+ return TypedOMCSSUnparsedValue::create(value->cssText()); >+} >+ >+} // namespace WebCore >+ >+#endif >diff --git a/Source/WebCore/css/typedom/StylePropertyMapReadOnly.h b/Source/WebCore/css/typedom/StylePropertyMapReadOnly.h >index 1b15154230d743451362cbbceea6b6d9a83c6a9b..76473dbc4aefcd7f51dd6be1b145f1451a884051 100644 >--- a/Source/WebCore/css/typedom/StylePropertyMapReadOnly.h >+++ b/Source/WebCore/css/typedom/StylePropertyMapReadOnly.h >@@ -27,29 +27,23 @@ > > #if ENABLE(CSS_TYPED_OM) > >-#include "TypedOMCSSStyleValue.h" >-#include <wtf/HashMap.h> > #include <wtf/RefCounted.h> >+#include <wtf/UniqueRef.h> > #include <wtf/text/WTFString.h> > > namespace WebCore { >+class CSSValue; >+class Document; >+class Element; >+class StyledElement; >+class TypedOMCSSStyleValue; > > class StylePropertyMapReadOnly : public RefCounted<StylePropertyMapReadOnly> { > public: >- static Ref<StylePropertyMapReadOnly> create(HashMap<String, Ref<TypedOMCSSStyleValue>>&& map) >- { >- return adoptRef(*new StylePropertyMapReadOnly(WTFMove(map))); >- } >+ static RefPtr<TypedOMCSSStyleValue> reifyValue(CSSValue*, Document&, Element* = nullptr); > >- TypedOMCSSStyleValue* get(String property) const { return m_map.get(property); } >- >-private: >- explicit StylePropertyMapReadOnly(HashMap<String, Ref<TypedOMCSSStyleValue>>&& map) >- : m_map(WTFMove(map)) >- { >- } >- >- HashMap<String, Ref<TypedOMCSSStyleValue>> m_map; >+ virtual ~StylePropertyMapReadOnly() = default; >+ virtual RefPtr<TypedOMCSSStyleValue> get(const String& property) const = 0; > }; > > } // namespace WebCore >diff --git a/Source/WebCore/css/typedom/StylePropertyMapReadOnly.idl b/Source/WebCore/css/typedom/StylePropertyMapReadOnly.idl >index ce0b5123db3c8402d59fea37674f4202e04f4161..662a4adee55ae47413824fb74288ef67216d386c 100644 >--- a/Source/WebCore/css/typedom/StylePropertyMapReadOnly.idl >+++ b/Source/WebCore/css/typedom/StylePropertyMapReadOnly.idl >@@ -27,7 +27,8 @@ > EnabledAtRuntime=CSSTypedOM, > Conditional=CSS_TYPED_OM, > Exposed=(Window,Worker,PaintWorklet), >- ImplementationLacksVTable >+ SkipVTableValidation, >+ JSGenerateToJSObject, > ] interface StylePropertyMapReadOnly { > // FIXME: should be (undefined or TypedOMCSSStyleValue), not null > TypedOMCSSStyleValue? get(USVString property); >diff --git a/Source/WebCore/css/typedom/TypedOMCSSImageValue.h b/Source/WebCore/css/typedom/TypedOMCSSImageValue.h >index 892d2c6040af9415d93f485f1b162960090c1955..28c2b1ae6dc3c13b24f68171475a9fca0b8c91ee 100644 >--- a/Source/WebCore/css/typedom/TypedOMCSSImageValue.h >+++ b/Source/WebCore/css/typedom/TypedOMCSSImageValue.h >@@ -39,27 +39,27 @@ namespace WebCore { > > class TypedOMCSSImageValue final : public TypedOMCSSStyleValue { > public: >- static Ref<TypedOMCSSImageValue> create(CSSImageValue& cssValue, RenderElement& renderer) >+ static Ref<TypedOMCSSImageValue> create(CSSImageValue& cssValue, Document& document) > { >- return adoptRef(*new TypedOMCSSImageValue(cssValue, renderer)); >+ return adoptRef(*new TypedOMCSSImageValue(cssValue, document)); > } > > String toString() final { return m_cssValue->cssText(); } > > CachedImage* image() { return m_cssValue->cachedImage(); } >- const RenderElement* renderer() const { return m_renderer.get(); } >+ Document* document() const { return m_document.get(); } > > private: >- TypedOMCSSImageValue(CSSImageValue& cssValue, RenderElement& renderer) >+ TypedOMCSSImageValue(CSSImageValue& cssValue, Document& document) > : m_cssValue(makeRef(cssValue)) >- , m_renderer(makeWeakPtr(renderer)) >+ , m_document(makeWeakPtr(document)) > { > } > > bool isImageValue() final { return true; } > > Ref<CSSImageValue> m_cssValue; >- WeakPtr<RenderElement> m_renderer; >+ WeakPtr<Document> m_document; > }; > > } // namespace WebCore >diff --git a/Source/WebCore/dom/Element.cpp b/Source/WebCore/dom/Element.cpp >index 6468eabf340002285c4c542984ef77d9cda55894..5e98c3aec7d2747b4c5070a53bcfbbdeb2ee3f3b 100644 >--- a/Source/WebCore/dom/Element.cpp >+++ b/Source/WebCore/dom/Element.cpp >@@ -4053,4 +4053,16 @@ Vector<RefPtr<WebAnimation>> Element::getAnimations() > return animations; > } > >+StylePropertyMap* Element::attributeStyleMap() >+{ >+ if (!hasRareData()) >+ return nullptr; >+ return elementRareData()->attributeStyleMap(); >+} >+ >+void Element::setAttributeStyleMap(Ref<StylePropertyMap>&& map) >+{ >+ ensureElementRareData().setAttributeStyleMap(WTFMove(map)); >+} >+ > } // namespace WebCore >diff --git a/Source/WebCore/dom/Element.h b/Source/WebCore/dom/Element.h >index bc6eba852548670077f3888bb20bcc0ac9f6f5a0..95f089571adbe7e261fe387306d1acf9adb02189 100644 >--- a/Source/WebCore/dom/Element.h >+++ b/Source/WebCore/dom/Element.h >@@ -54,6 +54,7 @@ class PlatformMouseEvent; > class PlatformWheelEvent; > class PseudoElement; > class RenderTreePosition; >+class StylePropertyMap; > class WebAnimation; > struct ElementStyle; > struct ScrollIntoViewOptions; >@@ -606,6 +607,9 @@ protected: > > static ExceptionOr<void> mergeWithNextTextNode(Text&); > >+ StylePropertyMap* attributeStyleMap(); >+ void setAttributeStyleMap(Ref<StylePropertyMap>&&); >+ > private: > Frame* documentFrameWithNonNullView() const; > >diff --git a/Source/WebCore/dom/ElementRareData.cpp b/Source/WebCore/dom/ElementRareData.cpp >index 6cfa8096d3f58407dd0a86cc73f8f7e0c360e579..4dd60eb84f63d12fe814e36c35cc501224cc9711 100644 >--- a/Source/WebCore/dom/ElementRareData.cpp >+++ b/Source/WebCore/dom/ElementRareData.cpp >@@ -47,6 +47,9 @@ struct SameSizeAsElementRareData : NodeRareData { > #if ENABLE(INTERSECTION_OBSERVER) > void* intersectionObserverData; > #endif >+#if ENABLE(CSS_TYPED_OM) >+ void* typedOMData; >+#endif > > }; > >diff --git a/Source/WebCore/dom/ElementRareData.h b/Source/WebCore/dom/ElementRareData.h >index e9a03b93b475f1e1d73bb47fd02760425bfb5981..fe80e331d5cb210ba7b05d219278a037591b939f 100644 >--- a/Source/WebCore/dom/ElementRareData.h >+++ b/Source/WebCore/dom/ElementRareData.h >@@ -30,6 +30,7 @@ > #include "PseudoElement.h" > #include "RenderElement.h" > #include "ShadowRoot.h" >+#include "StylePropertyMap.h" > > namespace WebCore { > >@@ -127,6 +128,11 @@ public: > void setIntersectionObserverData(std::unique_ptr<IntersectionObserverData>&& data) { m_intersectionObserverData = WTFMove(data); } > #endif > >+#if ENABLE(CSS_TYPED_OM) >+ StylePropertyMap* attributeStyleMap() { return m_attributeStyleMap.get(); } >+ void setAttributeStyleMap(Ref<StylePropertyMap>&& map) { m_attributeStyleMap = WTFMove(map); } >+#endif >+ > #if DUMP_NODE_STATISTICS > OptionSet<UseType> useTypes() const > { >@@ -202,6 +208,10 @@ private: > RefPtr<PseudoElement> m_beforePseudoElement; > RefPtr<PseudoElement> m_afterPseudoElement; > >+#if ENABLE(CSS_TYPED_OM) >+ RefPtr<StylePropertyMap> m_attributeStyleMap; >+#endif >+ > void releasePseudoElement(PseudoElement*); > }; > >diff --git a/Source/WebCore/dom/StyledElement.cpp b/Source/WebCore/dom/StyledElement.cpp >index f52363625f264d246007bd1ae04b13c9cf198e9c..628e4b91d2da5bda4003bfe87eafe14dd59a0f9a 100644 >--- a/Source/WebCore/dom/StyledElement.cpp >+++ b/Source/WebCore/dom/StyledElement.cpp >@@ -25,20 +25,26 @@ > #include "StyledElement.h" > > #include "AttributeChangeInvalidation.h" >+#include "CSSComputedStyleDeclaration.h" > #include "CSSImageValue.h" > #include "CSSParser.h" >+#include "CSSPrimitiveValue.h" >+#include "CSSPropertyParser.h" > #include "CSSStyleSheet.h" > #include "CSSValuePool.h" > #include "CachedResource.h" > #include "ContentSecurityPolicy.h" > #include "DOMTokenList.h" >+#include "ElementRareData.h" > #include "HTMLElement.h" > #include "HTMLParserIdioms.h" > #include "InspectorInstrumentation.h" > #include "PropertySetCSSStyleDeclaration.h" > #include "ScriptableDocumentParser.h" > #include "StyleProperties.h" >+#include "StylePropertyMap.h" > #include "StyleResolver.h" >+#include "TypedOMCSSUnparsedValue.h" > #include <wtf/HashFunctions.h> > #include <wtf/IsoMallocInlines.h> > >@@ -70,6 +76,62 @@ CSSStyleDeclaration& StyledElement::cssomStyle() > return ensureMutableInlineStyle().ensureInlineCSSStyleDeclaration(*this); > } > >+#if ENABLE(CSS_TYPED_OM) >+ >+static RefPtr<TypedOMCSSStyleValue> extractInlineProperty(const String& name, StyledElement& element) >+{ >+ RefPtr<CSSValue> value; >+ >+ if (auto* style = element.inlineStyle()) { >+ if (isCustomPropertyName(name)) { >+ value = element.inlineStyle()->getCustomPropertyCSSValue(name); >+ if (!value) { >+ auto* registered = element.document().getCSSRegisteredCustomPropertySet().get(name); >+ if (registered && registered->initialValue()) >+ value = registered->initialValueCopy(); >+ else >+ return TypedOMCSSUnparsedValue::create(emptyString()); >+ } >+ } else { >+ CSSPropertyID propertyID = cssPropertyID(name); >+ if (!propertyID) >+ return nullptr; >+ value = element.inlineStyle()->getPropertyCSSValue(propertyID); >+ } >+ } >+ >+ return StylePropertyMapReadOnly::reifyValue(value.get(), element.document(), &element); >+} >+ >+class StyledElementInlineStylePropertyMap final : public StylePropertyMap { >+public: >+ static Ref<StylePropertyMap> create(StyledElement& element) >+ { >+ return adoptRef(*new StyledElementInlineStylePropertyMap(element)); >+ } >+ >+private: >+ RefPtr<TypedOMCSSStyleValue> get(const String& property) const final >+ { >+ return extractInlineProperty(property, m_element.get()); >+ } >+ >+ explicit StyledElementInlineStylePropertyMap(StyledElement& element) >+ : m_element(makeRef(element)) >+ { >+ } >+ >+ Ref<StyledElement> m_element; >+}; >+ >+StylePropertyMap& StyledElement::ensureAttributeStyleMap() >+{ >+ if (!attributeStyleMap()) >+ setAttributeStyleMap(StyledElementInlineStylePropertyMap::create(*this)); >+ return *attributeStyleMap(); >+} >+#endif >+ > MutableStyleProperties& StyledElement::ensureMutableInlineStyle() > { > RefPtr<StyleProperties>& inlineStyle = ensureUniqueElementData().m_inlineStyle; >diff --git a/Source/WebCore/dom/StyledElement.h b/Source/WebCore/dom/StyledElement.h >index 0349fd55c090f06940a5fc929c00437b798345c8..c53d8e6157aa9d2750b8f89d084561aab10a2738 100644 >--- a/Source/WebCore/dom/StyledElement.h >+++ b/Source/WebCore/dom/StyledElement.h >@@ -35,6 +35,7 @@ class Attribute; > class MutableStyleProperties; > class PropertySetCSSStyleDeclaration; > class StyleProperties; >+class StylePropertyMap; > > class StyledElement : public Element { > WTF_MAKE_ISO_ALLOCATED(StyledElement); >@@ -57,6 +58,9 @@ public: > void synchronizeStyleAttributeInternal() const { StyledElement::synchronizeStyleAttributeInternal(const_cast<StyledElement*>(this)); } > > WEBCORE_EXPORT CSSStyleDeclaration& cssomStyle(); >+#if ENABLE(CSS_TYPED_OM) >+ StylePropertyMap& ensureAttributeStyleMap(); >+#endif > > const StyleProperties* presentationAttributeStyle() const; > virtual void collectStyleForPresentationAttribute(const QualifiedName&, const AtomicString&, MutableStyleProperties&) { } >diff --git a/Source/WebCore/html/canvas/CanvasRenderingContext2DBase.cpp b/Source/WebCore/html/canvas/CanvasRenderingContext2DBase.cpp >index c139a026914d995de2a126f91167476806bdf6c2..8383b0d3499f2d411ab784ebe28b624d85e05377 100644 >--- a/Source/WebCore/html/canvas/CanvasRenderingContext2DBase.cpp >+++ b/Source/WebCore/html/canvas/CanvasRenderingContext2DBase.cpp >@@ -1442,10 +1442,11 @@ static inline FloatSize size(HTMLVideoElement& video) > #if ENABLE(CSS_TYPED_OM) > static inline FloatSize size(TypedOMCSSImageValue& image) > { >- LayoutSize size; >- if (auto* cachedImage = image.image()) >- size = cachedImage->imageSizeForRenderer(image.renderer(), 1.0f); // FIXME: Not sure about this, see fixme in size(HTMLImageElement&...) >- return size; >+ auto* cachedImage = image.image(); >+ if (!cachedImage) >+ return FloatSize(); >+ >+ return cachedImage->imageSizeForRenderer(nullptr, 1.0f); > } > #endif > >@@ -1512,13 +1513,12 @@ ExceptionOr<void> CanvasRenderingContext2DBase::drawImage(HTMLImageElement& imag > #if ENABLE(CSS_TYPED_OM) > ExceptionOr<void> CanvasRenderingContext2DBase::drawImage(TypedOMCSSImageValue& image, const FloatRect& srcRect, const FloatRect& dstRect) > { >- auto* renderer = image.renderer(); > auto* cachedImage = image.image(); >- if (!renderer || !cachedImage) >+ if (!cachedImage || !image.document()) > return { }; > FloatRect imageRect = FloatRect(FloatPoint(), size(image)); > >- auto result = drawImage(renderer->document(), cachedImage, renderer, imageRect, srcRect, dstRect, state().globalComposite, state().globalBlend); >+ auto result = drawImage(*image.document(), cachedImage, nullptr, imageRect, srcRect, dstRect, state().globalComposite, state().globalBlend); > > if (!result.hasException()) > checkOrigin(image); >diff --git a/Source/WebCore/platform/graphics/CustomPaintImage.cpp b/Source/WebCore/platform/graphics/CustomPaintImage.cpp >index b8f930c81a0a00bc427501a21de714017f66168a..9bfa23171db34fb212d03fb7089f952fa67e5316 100644 >--- a/Source/WebCore/platform/graphics/CustomPaintImage.cpp >+++ b/Source/WebCore/platform/graphics/CustomPaintImage.cpp >@@ -39,6 +39,7 @@ > #include "JSCSSPaintCallback.h" > #include "PaintRenderingContext2D.h" > #include "RenderElement.h" >+#include "StylePropertyMap.h" > #include "TypedOMCSSImageValue.h" > #include "TypedOMCSSUnitValue.h" > #include "TypedOMCSSUnparsedValue.h" >@@ -57,6 +58,49 @@ CustomPaintImage::CustomPaintImage(PaintWorkletGlobalScope::PaintDefinition& def > > CustomPaintImage::~CustomPaintImage() = default; > >+ >+static RefPtr<TypedOMCSSStyleValue> extractComputedProperty(const String& name, Element& element) >+{ >+ ComputedStyleExtractor extractor(&element); >+ >+ RefPtr<CSSValue> value; >+ if (isCustomPropertyName(name)) { >+ value = extractor.customPropertyValue(name); >+ if (!value) { >+ auto* registered = element.document().getCSSRegisteredCustomPropertySet().get(name); >+ if (registered && registered->initialValue()) >+ value = registered->initialValueCopy(); >+ else >+ return TypedOMCSSUnparsedValue::create(emptyString()); >+ } >+ } else { >+ CSSPropertyID propertyID = cssPropertyID(name); >+ if (!propertyID) >+ return nullptr; >+ value = extractor.propertyValue(propertyID, DoNotUpdateLayout); >+ } >+ >+ return StylePropertyMapReadOnly::reifyValue(value.get(), element.document(), &element); >+} >+ >+class HashMapStylePropertyMap final : public StylePropertyMap { >+public: >+ static Ref<StylePropertyMap> create(HashMap<String, RefPtr<TypedOMCSSStyleValue>>&& map) >+ { >+ return adoptRef(*new HashMapStylePropertyMap(WTFMove(map))); >+ } >+ >+private: >+ explicit HashMapStylePropertyMap(HashMap<String, RefPtr<TypedOMCSSStyleValue>>&& map) >+ : m_map(WTFMove(map)) >+ { >+ } >+ >+ RefPtr<TypedOMCSSStyleValue> get(const String& property) const final { return makeRefPtr(m_map.get(property)); } >+ >+ HashMap<String, RefPtr<TypedOMCSSStyleValue>> m_map; >+}; >+ > ImageDrawResult CustomPaintImage::doCustomPaint(GraphicsContext& destContext, const FloatSize& destSize) > { > if (!m_element || !m_element->element() || !m_paintDefinition) >@@ -82,36 +126,15 @@ ImageDrawResult CustomPaintImage::doCustomPaint(GraphicsContext& destContext, co > return ImageDrawResult::DidNothing; > auto context = contextOrException.releaseReturnValue(); > >- HashMap<String, Ref<TypedOMCSSStyleValue>> propertyValues; >- ComputedStyleExtractor extractor(m_element->element()); >- >- for (auto& name : m_inputProperties) { >- RefPtr<CSSValue> value; >- if (isCustomPropertyName(name)) >- value = extractor.customPropertyValue(name); >- else { >- CSSPropertyID propertyID = cssPropertyID(name); >- if (!propertyID) >- return ImageDrawResult::DidNothing; >- value = extractor.propertyValue(propertyID, DoNotUpdateLayout); >- } >- >- if (!value) { >- propertyValues.add(name, TypedOMCSSUnparsedValue::create(emptyString())); >- continue; >- } >+ HashMap<String, RefPtr<TypedOMCSSStyleValue>> propertyValues; > >- // FIXME: Properly reify all length values. >- if (is<CSSPrimitiveValue>(*value) && downcast<CSSPrimitiveValue>(*value).primitiveType() == CSSPrimitiveValue::CSS_PX) >- propertyValues.add(name, TypedOMCSSUnitValue::create(downcast<CSSPrimitiveValue>(*value).doubleValue(), "px")); >- else if (is<CSSImageValue>(*value)) >- propertyValues.add(name, TypedOMCSSImageValue::create(downcast<CSSImageValue>(*value), *m_element)); >- else >- propertyValues.add(name, TypedOMCSSUnparsedValue::create(value->cssText())); >+ if (auto* element = m_element->element()) { >+ for (auto& name : m_inputProperties) >+ propertyValues.add(name, extractComputedProperty(name, *element)); > } > > auto size = CSSPaintSize::create(destSize.width(), destSize.height()); >- auto propertyMap = StylePropertyMapReadOnly::create(WTFMove(propertyValues)); >+ Ref<StylePropertyMapReadOnly> propertyMap = HashMapStylePropertyMap::create(WTFMove(propertyValues)); > > auto& vm = *paintConstructor.getObject()->vm(); > JSC::JSLockHolder lock(vm); >diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog >index fc660cd3292734e120aa41ed9f5baa9dbf919b19..c80ed34ac5b44c40f4e80d659ecbb3783498ecbc 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,3 +1,19 @@ >+2018-12-14 Justin Michaud <justin_michaud@apple.com> >+ >+ CSS Typed OM should expose attributeStyleMap >+ https://bugs.webkit.org/show_bug.cgi?id=192671 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * css-typedom/attributeStyleMap-expected.txt: Added. >+ * css-typedom/attributeStyleMap.html: Added. >+ * css-typedom/sameobject-expected.txt: Added. >+ * css-typedom/sameobject.html: Added. >+ * fast/css-custom-paint/properties.html: >+ * js/dom/dom-static-property-for-in-iteration-expected.txt: >+ * platform/ios-wk1/TestExpectations: >+ * platform/mac-wk1/TestExpectations: >+ > 2018-12-13 Eric Carlson <eric.carlson@apple.com> > > [MediaStream] Calculate width or height when constraints contain only the other >diff --git a/LayoutTests/imported/w3c/ChangeLog b/LayoutTests/imported/w3c/ChangeLog >index 7ff7fd9b4674abb2c0397a1af773535fe0a7219d..06f537746e6157ea416f79494db67b88d75ed8d7 100644 >--- a/LayoutTests/imported/w3c/ChangeLog >+++ b/LayoutTests/imported/w3c/ChangeLog >@@ -1,3 +1,13 @@ >+2018-12-14 Justin Michaud <justin_michaud@apple.com> >+ >+ CSS Typed OM should expose attributeStyleMap >+ https://bugs.webkit.org/show_bug.cgi?id=192671 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * web-platform-tests/css/css-properties-values-api/typedom.tentative-expected.txt: >+ * web-platform-tests/css/css-properties-values-api/unit-cycles-expected.txt: >+ > 2018-12-10 Rob Buis <rbuis@igalia.com> > > XMLHttpRequest removes spaces from content-types before processing >diff --git a/LayoutTests/css-typedom/attributeStyleMap-expected.txt b/LayoutTests/css-typedom/attributeStyleMap-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..5063bde42e5c2dc74f6ae408646bc163922044a2 >--- /dev/null >+++ b/LayoutTests/css-typedom/attributeStyleMap-expected.txt >@@ -0,0 +1,4 @@ >+ >+PASS test that element.attributeStyleMap exists >+PASS test that element.attributeStyleMap has a valid width value >+ >diff --git a/LayoutTests/css-typedom/attributeStyleMap.html b/LayoutTests/css-typedom/attributeStyleMap.html >new file mode 100644 >index 0000000000000000000000000000000000000000..3b46592d4bff483f66ef3402ed6558ed395da98e >--- /dev/null >+++ b/LayoutTests/css-typedom/attributeStyleMap.html >@@ -0,0 +1,22 @@ >+<!DOCTYPE html><!-- webkit-test-runner [ experimental:CSSTypedOMEnabled=true ] --> >+<script src="../resources/testharness.js"></script> >+<script src="../resources/testharnessreport.js"></script> >+<meta name="author" title="Justin Michaud" href="mailto:justin_michaud@webkit.org"> >+<meta name="assert" content="Test element.attributeStyleMap basics"> >+<link rel="help" content="https://drafts.css-houdini.org/css-typed-om-1/"> >+ >+<div id="el" style = "width: 150px; height: 10em; --my-prop: hello;"></div> >+ >+<script> >+ test(function() { >+ assert_true(!!el.attributeStyleMap); >+ assert_true(el.attributeStyleMap instanceof StylePropertyMap); >+ }, 'test that element.attributeStyleMap exists'); >+ >+ test(function() { >+ assert_true(el.attributeStyleMap.get('width') instanceof CSSUnitValue); >+ assert_equals(el.attributeStyleMap.get('width').value, 150); >+ assert_equals(el.attributeStyleMap.get('width').unit, 'px'); >+ }, 'test that element.attributeStyleMap has a valid width value'); >+ >+</script> >diff --git a/LayoutTests/css-typedom/sameobject-expected.txt b/LayoutTests/css-typedom/sameobject-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..306b25b5f0c49e0b6182f17b08c2ab791e1323e1 >--- /dev/null >+++ b/LayoutTests/css-typedom/sameobject-expected.txt >@@ -0,0 +1,20 @@ >+Tests that idl [SameObject] is specified. >+ >+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". >+ >+ >+PASS element is still alive >+PASS element is still alive >+PASS element is still alive >+PASS element is still alive >+PASS element is still alive >+PASS element is still alive >+PASS element is still alive >+PASS element is still alive >+PASS element is still alive >+PASS element is still alive >+PASS element is still alive >+PASS successfullyParsed is true >+ >+TEST COMPLETE >+ >diff --git a/LayoutTests/css-typedom/sameobject.html b/LayoutTests/css-typedom/sameobject.html >new file mode 100644 >index 0000000000000000000000000000000000000000..2e30b04208ce059b1317da64d8ab5b2ba89af7d2 >--- /dev/null >+++ b/LayoutTests/css-typedom/sameobject.html >@@ -0,0 +1,59 @@ >+<!DOCTYPE html><!-- webkit-test-runner [ experimental:CSSTypedOMEnabled=true ] --> >+<meta name="author" title="Justin Michaud" href="mailto:justin_michaud@webkit.org"> >+<meta name="assert" content="Test that the [SameObject] idl attribute is respected"> >+<script src="../resources/js-test-pre.js"></script> >+ >+<div id="el" style = "width: 150px; height: 10em; --my-prop: hello;"></div> >+ >+<script> >+description("Tests that idl [SameObject] is specified."); >+window.jsTestIsAsync = true; >+ >+function promiseChain(body, times) { >+ let i = 0; >+ return new Promise(function(resolve, reject) { >+ handle = setInterval(function() { >+ if (i >= times) { >+ clearInterval(handle); >+ resolve(); >+ return; >+ } >+ >+ body(); >+ >+ ++i; >+ }, 10); >+ }); >+} >+ >+function makeAlive() { >+ el.attributeStyleMap.alive = true; >+} >+ >+function isAlive() { >+ return !!el.attributeStyleMap.alive; >+} >+ >+function testAlive() { >+ if (isAlive()) { >+ testPassed("element is still alive"); >+ } else { >+ testFailed("element is not alive"); >+ } >+} >+ >+window.onload = function() { >+ setTimeout(function() { >+ makeAlive(); >+ testAlive() >+ >+ promiseChain(function() { >+ gc(); >+ testAlive(); >+ }, 10).then(function () { >+ finishJSTest(); >+ }); >+ }, 10); >+} >+</script> >+<script src="../resources/js-test-post.js"></script> >diff --git a/LayoutTests/fast/css-custom-paint/properties.html b/LayoutTests/fast/css-custom-paint/properties.html >index d9a4655b1ffa458d4ffc8db9795748f29bb00209..679bcf50ec2535f6c4cc2c7cebf9e480f4eedd98 100644 >--- a/LayoutTests/fast/css-custom-paint/properties.html >+++ b/LayoutTests/fast/css-custom-paint/properties.html >@@ -12,10 +12,17 @@ > --my-prop:helloworld1; > --my-registered-prop:helloworld2; > } >+ >+ .paint2 { >+ background-image: paint(my-paint,150px,helloworld1,initialValueProp); >+ width: 150px; >+ height: 150px; >+ --my-prop:helloworld1; >+ } > </style> > > <div class="paint"></div> >-<div class="paint"></div> >+<div class="paint2"></div> > > <script id="code" type="text/worklet"> > class MyPaint { >@@ -27,6 +34,7 @@ class MyPaint { > testThis() { return this.myAttribute; } > > paint(ctx, geom, properties, args) { >+ assert_true(properties instanceof StylePropertyMapReadOnly); > assert_equals(properties.get('height').toString(), args[0].toString()); > assert_equals(properties.get('height').value, 150); > assert_equals(properties.get('height').unit, 'px'); >diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-properties-values-api/typedom.tentative-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/css/css-properties-values-api/typedom.tentative-expected.txt >index 1366c0adb361b1c0c042b449653499b0d276acda..fc9d4955ea4829f16e116084bdcbd0f8788ee2d6 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/css/css-properties-values-api/typedom.tentative-expected.txt >+++ b/LayoutTests/imported/w3c/web-platform-tests/css/css-properties-values-api/typedom.tentative-expected.txt >@@ -22,48 +22,48 @@ FAIL First computed value correctly reified in space-separated list The given in > FAIL First computed value correctly reified in comma-separated list The given initial value does not parse for the given syntax. > FAIL All computed values correctly reified in space-separated list The given initial value does not parse for the given syntax. > FAIL All computed values correctly reified in comma-separated list The given initial value does not parse for the given syntax. >-FAIL attributeStyleMap.get returns CSSUnparsedValue for value with var references undefined is not an object (evaluating 'target.attributeStyleMap.clear') >+FAIL attributeStyleMap.get returns CSSUnparsedValue for value with var references target.attributeStyleMap.clear is not a function. (In 'target.attributeStyleMap.clear()', 'target.attributeStyleMap.clear' is undefined) > FAIL styleMap.get returns CSSUnparsedValue for value with var references undefined is not an object (evaluating 'rule.styleMap.clear') >-FAIL attributeStyleMap.get returns CSSUnparsedValue for value with var references in list undefined is not an object (evaluating 'target.attributeStyleMap.clear') >+FAIL attributeStyleMap.get returns CSSUnparsedValue for value with var references in list target.attributeStyleMap.clear is not a function. (In 'target.attributeStyleMap.clear()', 'target.attributeStyleMap.clear' is undefined) > FAIL styleMap.get returns CSSUnparsedValue for value with var references in list undefined is not an object (evaluating 'rule.styleMap.clear') >-FAIL attributeStyleMap.get returns CSSUnparsedValue for * undefined is not an object (evaluating 'target.attributeStyleMap.clear') >+FAIL attributeStyleMap.get returns CSSUnparsedValue for * target.attributeStyleMap.clear is not a function. (In 'target.attributeStyleMap.clear()', 'target.attributeStyleMap.clear' is undefined) > FAIL styleMap.get returns CSSUnparsedValue for * undefined is not an object (evaluating 'rule.styleMap.clear') >-FAIL attributeStyleMap.get returns CSSUnitValue for <angle> undefined is not an object (evaluating 'target.attributeStyleMap.clear') >+FAIL attributeStyleMap.get returns CSSUnitValue for <angle> target.attributeStyleMap.clear is not a function. (In 'target.attributeStyleMap.clear()', 'target.attributeStyleMap.clear' is undefined) > FAIL styleMap.get returns CSSUnitValue for <angle> undefined is not an object (evaluating 'rule.styleMap.clear') >-FAIL attributeStyleMap.get returns CSSStyleValue for <color> undefined is not an object (evaluating 'target.attributeStyleMap.clear') >+FAIL attributeStyleMap.get returns CSSStyleValue for <color> target.attributeStyleMap.clear is not a function. (In 'target.attributeStyleMap.clear()', 'target.attributeStyleMap.clear' is undefined) > FAIL styleMap.get returns CSSStyleValue for <color> undefined is not an object (evaluating 'rule.styleMap.clear') >-FAIL attributeStyleMap.get returns CSSKeywordValue for <custom-ident> undefined is not an object (evaluating 'target.attributeStyleMap.clear') >+FAIL attributeStyleMap.get returns CSSKeywordValue for <custom-ident> target.attributeStyleMap.clear is not a function. (In 'target.attributeStyleMap.clear()', 'target.attributeStyleMap.clear' is undefined) > FAIL styleMap.get returns CSSKeywordValue for <custom-ident> undefined is not an object (evaluating 'rule.styleMap.clear') >-FAIL attributeStyleMap.get returns CSSImageValue for <image> undefined is not an object (evaluating 'target.attributeStyleMap.clear') >+FAIL attributeStyleMap.get returns CSSImageValue for <image> target.attributeStyleMap.clear is not a function. (In 'target.attributeStyleMap.clear()', 'target.attributeStyleMap.clear' is undefined) > FAIL styleMap.get returns CSSImageValue for <image> undefined is not an object (evaluating 'rule.styleMap.clear') >-FAIL attributeStyleMap.get returns CSSUnitValue for <integer> undefined is not an object (evaluating 'target.attributeStyleMap.clear') >+FAIL attributeStyleMap.get returns CSSUnitValue for <integer> target.attributeStyleMap.clear is not a function. (In 'target.attributeStyleMap.clear()', 'target.attributeStyleMap.clear' is undefined) > FAIL styleMap.get returns CSSUnitValue for <integer> undefined is not an object (evaluating 'rule.styleMap.clear') >-FAIL attributeStyleMap.get returns CSSUnitValue for <length-percentage> [10%] undefined is not an object (evaluating 'target.attributeStyleMap.clear') >+FAIL attributeStyleMap.get returns CSSUnitValue for <length-percentage> [10%] target.attributeStyleMap.clear is not a function. (In 'target.attributeStyleMap.clear()', 'target.attributeStyleMap.clear' is undefined) > FAIL styleMap.get returns CSSUnitValue for <length-percentage> [10%] undefined is not an object (evaluating 'rule.styleMap.clear') >-FAIL attributeStyleMap.get returns CSSUnitValue for <length-percentage> [10px] undefined is not an object (evaluating 'target.attributeStyleMap.clear') >+FAIL attributeStyleMap.get returns CSSUnitValue for <length-percentage> [10px] target.attributeStyleMap.clear is not a function. (In 'target.attributeStyleMap.clear()', 'target.attributeStyleMap.clear' is undefined) > FAIL styleMap.get returns CSSUnitValue for <length-percentage> [10px] undefined is not an object (evaluating 'rule.styleMap.clear') >-FAIL attributeStyleMap.get returns CSSMathSum for <length-percentage> [calc(10px + 10%)] undefined is not an object (evaluating 'target.attributeStyleMap.clear') >+FAIL attributeStyleMap.get returns CSSMathSum for <length-percentage> [calc(10px + 10%)] target.attributeStyleMap.clear is not a function. (In 'target.attributeStyleMap.clear()', 'target.attributeStyleMap.clear' is undefined) > FAIL styleMap.get returns CSSMathSum for <length-percentage> [calc(10px + 10%)] undefined is not an object (evaluating 'rule.styleMap.clear') >-FAIL attributeStyleMap.get returns CSSUnitValue for <length> undefined is not an object (evaluating 'target.attributeStyleMap.clear') >+FAIL attributeStyleMap.get returns CSSUnitValue for <length> target.attributeStyleMap.clear is not a function. (In 'target.attributeStyleMap.clear()', 'target.attributeStyleMap.clear' is undefined) > FAIL styleMap.get returns CSSUnitValue for <length> undefined is not an object (evaluating 'rule.styleMap.clear') >-FAIL attributeStyleMap.get returns CSSUnitValue for <number> undefined is not an object (evaluating 'target.attributeStyleMap.clear') >+FAIL attributeStyleMap.get returns CSSUnitValue for <number> target.attributeStyleMap.clear is not a function. (In 'target.attributeStyleMap.clear()', 'target.attributeStyleMap.clear' is undefined) > FAIL styleMap.get returns CSSUnitValue for <number> undefined is not an object (evaluating 'rule.styleMap.clear') >-FAIL attributeStyleMap.get returns CSSUnitValue for <percentage> undefined is not an object (evaluating 'target.attributeStyleMap.clear') >+FAIL attributeStyleMap.get returns CSSUnitValue for <percentage> target.attributeStyleMap.clear is not a function. (In 'target.attributeStyleMap.clear()', 'target.attributeStyleMap.clear' is undefined) > FAIL styleMap.get returns CSSUnitValue for <percentage> undefined is not an object (evaluating 'rule.styleMap.clear') >-FAIL attributeStyleMap.get returns CSSUnitValue for <resolution> undefined is not an object (evaluating 'target.attributeStyleMap.clear') >+FAIL attributeStyleMap.get returns CSSUnitValue for <resolution> target.attributeStyleMap.clear is not a function. (In 'target.attributeStyleMap.clear()', 'target.attributeStyleMap.clear' is undefined) > FAIL styleMap.get returns CSSUnitValue for <resolution> undefined is not an object (evaluating 'rule.styleMap.clear') >-FAIL attributeStyleMap.get returns CSSUnitValue for <time> undefined is not an object (evaluating 'target.attributeStyleMap.clear') >+FAIL attributeStyleMap.get returns CSSUnitValue for <time> target.attributeStyleMap.clear is not a function. (In 'target.attributeStyleMap.clear()', 'target.attributeStyleMap.clear' is undefined) > FAIL styleMap.get returns CSSUnitValue for <time> undefined is not an object (evaluating 'rule.styleMap.clear') >-FAIL attributeStyleMap.get returns CSSStyleValue for <url> undefined is not an object (evaluating 'target.attributeStyleMap.clear') >+FAIL attributeStyleMap.get returns CSSStyleValue for <url> target.attributeStyleMap.clear is not a function. (In 'target.attributeStyleMap.clear()', 'target.attributeStyleMap.clear' is undefined) > FAIL styleMap.get returns CSSStyleValue for <url> undefined is not an object (evaluating 'rule.styleMap.clear') >-FAIL attributeStyleMap.get returns CSSKeywordValue for thing1 | THING2 undefined is not an object (evaluating 'target.attributeStyleMap.clear') >+FAIL attributeStyleMap.get returns CSSKeywordValue for thing1 | THING2 target.attributeStyleMap.clear is not a function. (In 'target.attributeStyleMap.clear()', 'target.attributeStyleMap.clear' is undefined) > FAIL styleMap.get returns CSSKeywordValue for thing1 | THING2 undefined is not an object (evaluating 'rule.styleMap.clear') >-FAIL attributeStyleMap.get returns CSSUnitValue for <length>+ undefined is not an object (evaluating 'target.attributeStyleMap.clear') >+FAIL attributeStyleMap.get returns CSSUnitValue for <length>+ target.attributeStyleMap.clear is not a function. (In 'target.attributeStyleMap.clear()', 'target.attributeStyleMap.clear' is undefined) > FAIL styleMap.get returns CSSUnitValue for <length>+ undefined is not an object (evaluating 'rule.styleMap.clear') >-FAIL attributeStyleMap.get returns CSSUnitValue for <length># undefined is not an object (evaluating 'target.attributeStyleMap.clear') >+FAIL attributeStyleMap.get returns CSSUnitValue for <length># target.attributeStyleMap.clear is not a function. (In 'target.attributeStyleMap.clear()', 'target.attributeStyleMap.clear' is undefined) > FAIL styleMap.get returns CSSUnitValue for <length># undefined is not an object (evaluating 'rule.styleMap.clear') >-FAIL attributeStyleMap.getAll returns a list of CSSUnitValues for <length>+ undefined is not an object (evaluating 'target.attributeStyleMap.clear') >+FAIL attributeStyleMap.getAll returns a list of CSSUnitValues for <length>+ target.attributeStyleMap.clear is not a function. (In 'target.attributeStyleMap.clear()', 'target.attributeStyleMap.clear' is undefined) > FAIL styleMap.getAll returns a list of CSSUnitValues for <length>+ undefined is not an object (evaluating 'rule.styleMap.clear') >-FAIL attributeStyleMap.getAll returns a list of CSSUnitValues for <length># undefined is not an object (evaluating 'target.attributeStyleMap.clear') >+FAIL attributeStyleMap.getAll returns a list of CSSUnitValues for <length># target.attributeStyleMap.clear is not a function. (In 'target.attributeStyleMap.clear()', 'target.attributeStyleMap.clear' is undefined) > FAIL styleMap.getAll returns a list of CSSUnitValues for <length># undefined is not an object (evaluating 'rule.styleMap.clear') > >diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-properties-values-api/unit-cycles-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/css/css-properties-values-api/unit-cycles-expected.txt >index c06da9ba73d569b14e1710522cdcf33dda34cf10..b7208659a08196731f8f73c58a877ae4056b134c 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/css/css-properties-values-api/unit-cycles-expected.txt >+++ b/LayoutTests/imported/w3c/web-platform-tests/css/css-properties-values-api/unit-cycles-expected.txt >@@ -1,4 +1,4 @@ >-CONSOLE MESSAGE: line 63: TypeError: undefined is not an object (evaluating 'element.attributeStyleMap.clear') >+CONSOLE MESSAGE: line 63: TypeError: element.attributeStyleMap.clear is not a function. (In 'element.attributeStyleMap.clear()', 'element.attributeStyleMap.clear' is undefined) > >-FAIL Untitled TypeError: undefined is not an object (evaluating 'element.attributeStyleMap.clear') >+FAIL Untitled TypeError: element.attributeStyleMap.clear is not a function. (In 'element.attributeStyleMap.clear()', 'element.attributeStyleMap.clear' is undefined) > >diff --git a/LayoutTests/js/dom/dom-static-property-for-in-iteration-expected.txt b/LayoutTests/js/dom/dom-static-property-for-in-iteration-expected.txt >index 0c28206d85ad57997823c989aa6addccd6d708e9..245f7b7f5b10f0d2be248c220b581b5b17a259aa 100644 >--- a/LayoutTests/js/dom/dom-static-property-for-in-iteration-expected.txt >+++ b/LayoutTests/js/dom/dom-static-property-for-in-iteration-expected.txt >@@ -53,6 +53,7 @@ PASS a["outerText"] is nerget > PASS a["webkitdropzone"] is > PASS a["inputMode"] is > PASS a["style"] is [object CSSStyleDeclaration] >+PASS a["attributeStyleMap"] is [object StylePropertyMap] > PASS a["onabort"] is null > PASS a["onblur"] is null > PASS a["oncanplay"] is null >diff --git a/LayoutTests/platform/ios-wk1/TestExpectations b/LayoutTests/platform/ios-wk1/TestExpectations >index 8c6bc5df332c501683da1714157daf9433726a32..31dd1e304cd982c0da85e70aca30cca538b31887 100644 >--- a/LayoutTests/platform/ios-wk1/TestExpectations >+++ b/LayoutTests/platform/ios-wk1/TestExpectations >@@ -2000,5 +2000,6 @@ webkit.org/b/189594 imported/w3c/web-platform-tests/css/css-animations/pending-s > # Not supported on WK1 > css-custom-properties-api [ Skip ] > fast/css-custom-paint [ Skip ] >+css-typedom [ Skip ] > > webkit.org/b/188762 fast/writing-mode/english-rl-text-with-spelling-marker.html [ ImageOnlyFailure ] >diff --git a/LayoutTests/platform/ios-wk2/js/dom/dom-static-property-for-in-iteration-expected.txt b/LayoutTests/platform/ios-wk2/js/dom/dom-static-property-for-in-iteration-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..245f7b7f5b10f0d2be248c220b581b5b17a259aa >--- /dev/null >+++ b/LayoutTests/platform/ios-wk2/js/dom/dom-static-property-for-in-iteration-expected.txt >@@ -0,0 +1,196 @@ >+Checks that get_by_pname doesn't get confused about which properties go where when it comes to stacic properties. >+ >+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". >+ >+ >+PASS a["foo"] is 1 >+PASS a["bar"] is 2 >+PASS a["wibble"] is 3 >+PASS a["hick"] is 4 >+PASS a["hock"] is 5 >+PASS a["snood"] is 6 >+PASS a["charset"] is >+PASS a["coords"] is >+PASS a["download"] is >+PASS a["hreflang"] is >+PASS a["name"] is >+PASS a["ping"] is >+PASS a["rel"] is >+PASS a["rev"] is >+PASS a["shape"] is >+PASS a["target"] is >+PASS a["type"] is >+PASS a["text"] is nerget >+PASS a["relList"] is >+PASS a["origin"] is file:// >+PASS a["protocol"] is file: >+PASS a["username"] is >+PASS a["password"] is >+PASS a["host"] is >+PASS a["hostname"] is >+PASS a["port"] is >+PASS a["search"] is >+PASS a["hash"] is >+PASS a["title"] is >+PASS a["lang"] is >+PASS a["translate"] is true >+PASS a["dir"] is >+PASS a["dataset"] is [object DOMStringMap] >+PASS a["hidden"] is false >+PASS a["tabIndex"] is 0 >+PASS a["accessKey"] is >+PASS a["draggable"] is true >+PASS a["spellcheck"] is true >+PASS a["innerText"] is nerget >+PASS a["contentEditable"] is inherit >+PASS a["isContentEditable"] is false >+PASS a["offsetParent"] is [object HTMLBodyElement] >+PASS a["offsetTop"] is 714 >+PASS a["offsetLeft"] is 8 >+PASS a["offsetWidth"] is 40 >+PASS a["offsetHeight"] is 18 >+PASS a["outerText"] is nerget >+PASS a["webkitdropzone"] is >+PASS a["inputMode"] is >+PASS a["style"] is [object CSSStyleDeclaration] >+PASS a["attributeStyleMap"] is [object StylePropertyMap] >+PASS a["onabort"] is null >+PASS a["onblur"] is null >+PASS a["oncanplay"] is null >+PASS a["oncanplaythrough"] is null >+PASS a["onchange"] is null >+PASS a["onclick"] is null >+PASS a["oncontextmenu"] is null >+PASS a["oncuechange"] is null >+PASS a["ondblclick"] is null >+PASS a["ondrag"] is null >+PASS a["ondragend"] is null >+PASS a["ondragenter"] is null >+PASS a["ondragleave"] is null >+PASS a["ondragover"] is null >+PASS a["ondragstart"] is null >+PASS a["ondrop"] is null >+PASS a["ondurationchange"] is null >+PASS a["onemptied"] is null >+PASS a["onended"] is null >+PASS a["onerror"] is null >+PASS a["onfocus"] is null >+PASS a["oninput"] is null >+PASS a["oninvalid"] is null >+PASS a["onkeydown"] is null >+PASS a["onkeypress"] is null >+PASS a["onkeyup"] is null >+PASS a["onload"] is null >+PASS a["onloadeddata"] is null >+PASS a["onloadedmetadata"] is null >+PASS a["onloadstart"] is null >+PASS a["onmousedown"] is null >+PASS a["onmouseenter"] is null >+PASS a["onmouseleave"] is null >+PASS a["onmousemove"] is null >+PASS a["onmouseout"] is null >+PASS a["onmouseover"] is null >+PASS a["onmouseup"] is null >+PASS a["onmousewheel"] is null >+PASS a["onpause"] is null >+PASS a["onplay"] is null >+PASS a["onplaying"] is null >+PASS a["onprogress"] is null >+PASS a["onratechange"] is null >+PASS a["onrejectionhandled"] is null >+PASS a["onreset"] is null >+PASS a["onresize"] is null >+PASS a["onscroll"] is null >+PASS a["onseeked"] is null >+PASS a["onseeking"] is null >+PASS a["onselect"] is null >+PASS a["onstalled"] is null >+PASS a["onsubmit"] is null >+PASS a["onsuspend"] is null >+PASS a["ontimeupdate"] is null >+PASS a["ontoggle"] is null >+PASS a["onunhandledrejection"] is null >+PASS a["onvolumechange"] is null >+PASS a["onwaiting"] is null >+PASS a["ontransitionend"] is null >+PASS a["ontransitionrun"] is null >+PASS a["ontransitionstart"] is null >+PASS a["ontransitioncancel"] is null >+PASS a["onanimationend"] is null >+PASS a["onanimationiteration"] is null >+PASS a["onanimationstart"] is null >+PASS a["onanimationcancel"] is null >+PASS a["namespaceURI"] is http://www.w3.org/1999/xhtml >+PASS a["prefix"] is null >+PASS a["localName"] is a >+PASS a["tagName"] is A >+PASS a["id"] is foo >+PASS a["className"] is >+PASS a["classList"] is >+PASS a["slot"] is >+PASS a["attributes"] is [object NamedNodeMap] >+PASS a["shadowRoot"] is null >+PASS a["scrollTop"] is 0 >+PASS a["scrollLeft"] is 0 >+PASS a["scrollWidth"] is 0 >+PASS a["scrollHeight"] is 0 >+PASS a["clientTop"] is 0 >+PASS a["clientLeft"] is 0 >+PASS a["clientWidth"] is 0 >+PASS a["clientHeight"] is 0 >+PASS a["innerHTML"] is nerget >+PASS a["outerHTML"] is <a id="foo" href="bar">nerget</a> >+PASS a["onaccessiblecontextmenu"] is null >+PASS a["onaccessibleclick"] is null >+PASS a["onaccessibledecrement"] is null >+PASS a["onaccessibledismiss"] is null >+PASS a["onaccessiblefocus"] is null >+PASS a["onaccessibleincrement"] is null >+PASS a["onaccessiblescrollintoview"] is null >+PASS a["onaccessiblesetvalue"] is null >+PASS a["onaccessibleselect"] is null >+PASS a["oncopy"] is null >+PASS a["oncut"] is null >+PASS a["onpaste"] is null >+PASS a["previousElementSibling"] is [object HTMLDivElement] >+PASS a["nextElementSibling"] is [object HTMLScriptElement] >+PASS a["children"] is [object HTMLCollection] >+PASS a["firstElementChild"] is null >+PASS a["lastElementChild"] is null >+PASS a["childElementCount"] is 0 >+PASS a["assignedSlot"] is null >+PASS a["nodeType"] is 1 >+PASS a["nodeName"] is A >+PASS a["isConnected"] is true >+PASS a["ownerDocument"] is [object HTMLDocument] >+PASS a["parentNode"] is [object HTMLBodyElement] >+PASS a["parentElement"] is [object HTMLBodyElement] >+PASS a["childNodes"] is [object NodeList] >+PASS a["firstChild"] is [object Text] >+PASS a["lastChild"] is [object Text] >+PASS a["previousSibling"] is [object Text] >+PASS a["nextSibling"] is [object Text] >+PASS a["nodeValue"] is null >+PASS a["textContent"] is nerget >+PASS a["ELEMENT_NODE"] is 1 >+PASS a["ATTRIBUTE_NODE"] is 2 >+PASS a["TEXT_NODE"] is 3 >+PASS a["CDATA_SECTION_NODE"] is 4 >+PASS a["ENTITY_REFERENCE_NODE"] is 5 >+PASS a["ENTITY_NODE"] is 6 >+PASS a["PROCESSING_INSTRUCTION_NODE"] is 7 >+PASS a["COMMENT_NODE"] is 8 >+PASS a["DOCUMENT_NODE"] is 9 >+PASS a["DOCUMENT_TYPE_NODE"] is 10 >+PASS a["DOCUMENT_FRAGMENT_NODE"] is 11 >+PASS a["NOTATION_NODE"] is 12 >+PASS a["DOCUMENT_POSITION_DISCONNECTED"] is 1 >+PASS a["DOCUMENT_POSITION_PRECEDING"] is 2 >+PASS a["DOCUMENT_POSITION_FOLLOWING"] is 4 >+PASS a["DOCUMENT_POSITION_CONTAINS"] is 8 >+PASS a["DOCUMENT_POSITION_CONTAINED_BY"] is 16 >+PASS a["DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC"] is 32 >+PASS successfullyParsed is true >+ >+TEST COMPLETE >+nerget >diff --git a/LayoutTests/platform/mac-wk1/TestExpectations b/LayoutTests/platform/mac-wk1/TestExpectations >index d2dfd2800b466055ab4924e1193548a6542a7018..0dfb6d449819f880de6df586c73c68bf60fdc047 100644 >--- a/LayoutTests/platform/mac-wk1/TestExpectations >+++ b/LayoutTests/platform/mac-wk1/TestExpectations >@@ -640,6 +640,7 @@ webkit.org/b/188070 imported/w3c/web-platform-tests/streams/piping/error-propaga > fast/css-custom-paint [ Skip ] > imported/w3c/web-platform-tests/css/css-properties-values-api/ [ Skip ] > css-custom-properties-api [ Skip ] >+css-typedom [ Skip ] > css-dark-mode [ Skip ] > > webkit.org/b/189908 imported/w3c/web-platform-tests/resource-timing/resource_timing.worker.html [ Failure ] >diff --git a/LayoutTests/platform/mac-wk2/js/dom/dom-static-property-for-in-iteration-expected.txt b/LayoutTests/platform/mac-wk2/js/dom/dom-static-property-for-in-iteration-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..245f7b7f5b10f0d2be248c220b581b5b17a259aa >--- /dev/null >+++ b/LayoutTests/platform/mac-wk2/js/dom/dom-static-property-for-in-iteration-expected.txt >@@ -0,0 +1,196 @@ >+Checks that get_by_pname doesn't get confused about which properties go where when it comes to stacic properties. >+ >+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". >+ >+ >+PASS a["foo"] is 1 >+PASS a["bar"] is 2 >+PASS a["wibble"] is 3 >+PASS a["hick"] is 4 >+PASS a["hock"] is 5 >+PASS a["snood"] is 6 >+PASS a["charset"] is >+PASS a["coords"] is >+PASS a["download"] is >+PASS a["hreflang"] is >+PASS a["name"] is >+PASS a["ping"] is >+PASS a["rel"] is >+PASS a["rev"] is >+PASS a["shape"] is >+PASS a["target"] is >+PASS a["type"] is >+PASS a["text"] is nerget >+PASS a["relList"] is >+PASS a["origin"] is file:// >+PASS a["protocol"] is file: >+PASS a["username"] is >+PASS a["password"] is >+PASS a["host"] is >+PASS a["hostname"] is >+PASS a["port"] is >+PASS a["search"] is >+PASS a["hash"] is >+PASS a["title"] is >+PASS a["lang"] is >+PASS a["translate"] is true >+PASS a["dir"] is >+PASS a["dataset"] is [object DOMStringMap] >+PASS a["hidden"] is false >+PASS a["tabIndex"] is 0 >+PASS a["accessKey"] is >+PASS a["draggable"] is true >+PASS a["spellcheck"] is true >+PASS a["innerText"] is nerget >+PASS a["contentEditable"] is inherit >+PASS a["isContentEditable"] is false >+PASS a["offsetParent"] is [object HTMLBodyElement] >+PASS a["offsetTop"] is 714 >+PASS a["offsetLeft"] is 8 >+PASS a["offsetWidth"] is 40 >+PASS a["offsetHeight"] is 18 >+PASS a["outerText"] is nerget >+PASS a["webkitdropzone"] is >+PASS a["inputMode"] is >+PASS a["style"] is [object CSSStyleDeclaration] >+PASS a["attributeStyleMap"] is [object StylePropertyMap] >+PASS a["onabort"] is null >+PASS a["onblur"] is null >+PASS a["oncanplay"] is null >+PASS a["oncanplaythrough"] is null >+PASS a["onchange"] is null >+PASS a["onclick"] is null >+PASS a["oncontextmenu"] is null >+PASS a["oncuechange"] is null >+PASS a["ondblclick"] is null >+PASS a["ondrag"] is null >+PASS a["ondragend"] is null >+PASS a["ondragenter"] is null >+PASS a["ondragleave"] is null >+PASS a["ondragover"] is null >+PASS a["ondragstart"] is null >+PASS a["ondrop"] is null >+PASS a["ondurationchange"] is null >+PASS a["onemptied"] is null >+PASS a["onended"] is null >+PASS a["onerror"] is null >+PASS a["onfocus"] is null >+PASS a["oninput"] is null >+PASS a["oninvalid"] is null >+PASS a["onkeydown"] is null >+PASS a["onkeypress"] is null >+PASS a["onkeyup"] is null >+PASS a["onload"] is null >+PASS a["onloadeddata"] is null >+PASS a["onloadedmetadata"] is null >+PASS a["onloadstart"] is null >+PASS a["onmousedown"] is null >+PASS a["onmouseenter"] is null >+PASS a["onmouseleave"] is null >+PASS a["onmousemove"] is null >+PASS a["onmouseout"] is null >+PASS a["onmouseover"] is null >+PASS a["onmouseup"] is null >+PASS a["onmousewheel"] is null >+PASS a["onpause"] is null >+PASS a["onplay"] is null >+PASS a["onplaying"] is null >+PASS a["onprogress"] is null >+PASS a["onratechange"] is null >+PASS a["onrejectionhandled"] is null >+PASS a["onreset"] is null >+PASS a["onresize"] is null >+PASS a["onscroll"] is null >+PASS a["onseeked"] is null >+PASS a["onseeking"] is null >+PASS a["onselect"] is null >+PASS a["onstalled"] is null >+PASS a["onsubmit"] is null >+PASS a["onsuspend"] is null >+PASS a["ontimeupdate"] is null >+PASS a["ontoggle"] is null >+PASS a["onunhandledrejection"] is null >+PASS a["onvolumechange"] is null >+PASS a["onwaiting"] is null >+PASS a["ontransitionend"] is null >+PASS a["ontransitionrun"] is null >+PASS a["ontransitionstart"] is null >+PASS a["ontransitioncancel"] is null >+PASS a["onanimationend"] is null >+PASS a["onanimationiteration"] is null >+PASS a["onanimationstart"] is null >+PASS a["onanimationcancel"] is null >+PASS a["namespaceURI"] is http://www.w3.org/1999/xhtml >+PASS a["prefix"] is null >+PASS a["localName"] is a >+PASS a["tagName"] is A >+PASS a["id"] is foo >+PASS a["className"] is >+PASS a["classList"] is >+PASS a["slot"] is >+PASS a["attributes"] is [object NamedNodeMap] >+PASS a["shadowRoot"] is null >+PASS a["scrollTop"] is 0 >+PASS a["scrollLeft"] is 0 >+PASS a["scrollWidth"] is 0 >+PASS a["scrollHeight"] is 0 >+PASS a["clientTop"] is 0 >+PASS a["clientLeft"] is 0 >+PASS a["clientWidth"] is 0 >+PASS a["clientHeight"] is 0 >+PASS a["innerHTML"] is nerget >+PASS a["outerHTML"] is <a id="foo" href="bar">nerget</a> >+PASS a["onaccessiblecontextmenu"] is null >+PASS a["onaccessibleclick"] is null >+PASS a["onaccessibledecrement"] is null >+PASS a["onaccessibledismiss"] is null >+PASS a["onaccessiblefocus"] is null >+PASS a["onaccessibleincrement"] is null >+PASS a["onaccessiblescrollintoview"] is null >+PASS a["onaccessiblesetvalue"] is null >+PASS a["onaccessibleselect"] is null >+PASS a["oncopy"] is null >+PASS a["oncut"] is null >+PASS a["onpaste"] is null >+PASS a["previousElementSibling"] is [object HTMLDivElement] >+PASS a["nextElementSibling"] is [object HTMLScriptElement] >+PASS a["children"] is [object HTMLCollection] >+PASS a["firstElementChild"] is null >+PASS a["lastElementChild"] is null >+PASS a["childElementCount"] is 0 >+PASS a["assignedSlot"] is null >+PASS a["nodeType"] is 1 >+PASS a["nodeName"] is A >+PASS a["isConnected"] is true >+PASS a["ownerDocument"] is [object HTMLDocument] >+PASS a["parentNode"] is [object HTMLBodyElement] >+PASS a["parentElement"] is [object HTMLBodyElement] >+PASS a["childNodes"] is [object NodeList] >+PASS a["firstChild"] is [object Text] >+PASS a["lastChild"] is [object Text] >+PASS a["previousSibling"] is [object Text] >+PASS a["nextSibling"] is [object Text] >+PASS a["nodeValue"] is null >+PASS a["textContent"] is nerget >+PASS a["ELEMENT_NODE"] is 1 >+PASS a["ATTRIBUTE_NODE"] is 2 >+PASS a["TEXT_NODE"] is 3 >+PASS a["CDATA_SECTION_NODE"] is 4 >+PASS a["ENTITY_REFERENCE_NODE"] is 5 >+PASS a["ENTITY_NODE"] is 6 >+PASS a["PROCESSING_INSTRUCTION_NODE"] is 7 >+PASS a["COMMENT_NODE"] is 8 >+PASS a["DOCUMENT_NODE"] is 9 >+PASS a["DOCUMENT_TYPE_NODE"] is 10 >+PASS a["DOCUMENT_FRAGMENT_NODE"] is 11 >+PASS a["NOTATION_NODE"] is 12 >+PASS a["DOCUMENT_POSITION_DISCONNECTED"] is 1 >+PASS a["DOCUMENT_POSITION_PRECEDING"] is 2 >+PASS a["DOCUMENT_POSITION_FOLLOWING"] is 4 >+PASS a["DOCUMENT_POSITION_CONTAINS"] is 8 >+PASS a["DOCUMENT_POSITION_CONTAINED_BY"] is 16 >+PASS a["DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC"] is 32 >+PASS successfullyParsed is true >+ >+TEST COMPLETE >+nerget
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 192671
:
357241
|
357243
|
357272
|
357280
|
357282
|
357286
|
357287
|
357289
|
357296
|
357298
|
357343
|
357345
|
357347
|
357368
|
357538
|
357539
|
357574