Diff
Modified: trunk/LayoutTests/ChangeLog (239340 => 239341)
--- trunk/LayoutTests/ChangeLog 2018-12-18 18:40:28 UTC (rev 239340)
+++ trunk/LayoutTests/ChangeLog 2018-12-18 18:51:05 UTC (rev 239341)
@@ -1,3 +1,21 @@
+2018-12-18 Justin Michaud <[email protected]>
+
+ CSS Typed OM should expose attributeStyleMap
+ https://bugs.webkit.org/show_bug.cgi?id=192671
+
+ Reviewed by Ryosuke Niwa.
+
+ * 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:
+ * platform/ios-wk1/TestExpectations:
+ * platform/ios-wk2/js/dom/dom-static-property-for-in-iteration-expected.txt: Added.
+ * platform/mac-wk1/TestExpectations:
+ * platform/mac-wk2/js/dom/dom-static-property-for-in-iteration-expected.txt: Added.
+ * platform/win/TestExpectations:
+
2018-12-18 Simon Fraser <[email protected]>
Fix test failure after r239306.
Added: trunk/LayoutTests/css-typedom/attributeStyleMap-expected.txt (0 => 239341)
--- trunk/LayoutTests/css-typedom/attributeStyleMap-expected.txt (rev 0)
+++ trunk/LayoutTests/css-typedom/attributeStyleMap-expected.txt 2018-12-18 18:51:05 UTC (rev 239341)
@@ -0,0 +1,4 @@
+
+PASS test that element.attributeStyleMap exists
+PASS test that element.attributeStyleMap has a valid width value
+
Added: trunk/LayoutTests/css-typedom/attributeStyleMap.html (0 => 239341)
--- trunk/LayoutTests/css-typedom/attributeStyleMap.html (rev 0)
+++ trunk/LayoutTests/css-typedom/attributeStyleMap.html 2018-12-18 18:51:05 UTC (rev 239341)
@@ -0,0 +1,22 @@
+<!DOCTYPE html><!-- webkit-test-runner [ experimental:CSSTypedOMEnabled=true ] -->
+<script src=""
+<script src=""
+<meta name="author" title="Justin Michaud" href=""
+<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>
Added: trunk/LayoutTests/css-typedom/sameobject-expected.txt (0 => 239341)
--- trunk/LayoutTests/css-typedom/sameobject-expected.txt (rev 0)
+++ trunk/LayoutTests/css-typedom/sameobject-expected.txt 2018-12-18 18:51:05 UTC (rev 239341)
@@ -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
+
Added: trunk/LayoutTests/css-typedom/sameobject.html (0 => 239341)
--- trunk/LayoutTests/css-typedom/sameobject.html (rev 0)
+++ trunk/LayoutTests/css-typedom/sameobject.html 2018-12-18 18:51:05 UTC (rev 239341)
@@ -0,0 +1,59 @@
+<!DOCTYPE html><!-- webkit-test-runner [ experimental:CSSTypedOMEnabled=true ] -->
+<meta name="author" title="Justin Michaud" href=""
+<meta name="assert" content="Test that the [SameObject] idl attribute is respected">
+<script src=""
+
+<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=""
Modified: trunk/LayoutTests/fast/css-custom-paint/properties.html (239340 => 239341)
--- trunk/LayoutTests/fast/css-custom-paint/properties.html 2018-12-18 18:40:28 UTC (rev 239340)
+++ trunk/LayoutTests/fast/css-custom-paint/properties.html 2018-12-18 18:51:05 UTC (rev 239341)
@@ -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 @@
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');
Modified: trunk/LayoutTests/imported/w3c/ChangeLog (239340 => 239341)
--- trunk/LayoutTests/imported/w3c/ChangeLog 2018-12-18 18:40:28 UTC (rev 239340)
+++ trunk/LayoutTests/imported/w3c/ChangeLog 2018-12-18 18:51:05 UTC (rev 239341)
@@ -1,3 +1,13 @@
+2018-12-18 Justin Michaud <[email protected]>
+
+ CSS Typed OM should expose attributeStyleMap
+ https://bugs.webkit.org/show_bug.cgi?id=192671
+
+ Reviewed by Ryosuke Niwa.
+
+ * 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-14 Youenn Fablet <[email protected]>
getSenders/getReceivers() should not return closed transceiver senders/receivers
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-properties-values-api/typedom.tentative-expected.txt (239340 => 239341)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-properties-values-api/typedom.tentative-expected.txt 2018-12-18 18:40:28 UTC (rev 239340)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-properties-values-api/typedom.tentative-expected.txt 2018-12-18 18:51:05 UTC (rev 239341)
@@ -22,48 +22,48 @@
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')
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-properties-values-api/unit-cycles-expected.txt (239340 => 239341)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-properties-values-api/unit-cycles-expected.txt 2018-12-18 18:40:28 UTC (rev 239340)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-properties-values-api/unit-cycles-expected.txt 2018-12-18 18:51:05 UTC (rev 239341)
@@ -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)
Modified: trunk/LayoutTests/platform/ios-wk1/TestExpectations (239340 => 239341)
--- trunk/LayoutTests/platform/ios-wk1/TestExpectations 2018-12-18 18:40:28 UTC (rev 239340)
+++ trunk/LayoutTests/platform/ios-wk1/TestExpectations 2018-12-18 18:51:05 UTC (rev 239341)
@@ -2000,5 +2000,6 @@
# 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 ]
Added: trunk/LayoutTests/platform/ios-wk2/js/dom/dom-static-property-for-in-iteration-expected.txt (0 => 239341)
--- trunk/LayoutTests/platform/ios-wk2/js/dom/dom-static-property-for-in-iteration-expected.txt (rev 0)
+++ trunk/LayoutTests/platform/ios-wk2/js/dom/dom-static-property-for-in-iteration-expected.txt 2018-12-18 18:51:05 UTC (rev 239341)
@@ -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=""
+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
Modified: trunk/LayoutTests/platform/mac-wk1/TestExpectations (239340 => 239341)
--- trunk/LayoutTests/platform/mac-wk1/TestExpectations 2018-12-18 18:40:28 UTC (rev 239340)
+++ trunk/LayoutTests/platform/mac-wk1/TestExpectations 2018-12-18 18:51:05 UTC (rev 239341)
@@ -640,6 +640,7 @@
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 ]
Added: trunk/LayoutTests/platform/mac-wk2/js/dom/dom-static-property-for-in-iteration-expected.txt (0 => 239341)
--- trunk/LayoutTests/platform/mac-wk2/js/dom/dom-static-property-for-in-iteration-expected.txt (rev 0)
+++ trunk/LayoutTests/platform/mac-wk2/js/dom/dom-static-property-for-in-iteration-expected.txt 2018-12-18 18:51:05 UTC (rev 239341)
@@ -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=""
+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
Modified: trunk/LayoutTests/platform/win/TestExpectations (239340 => 239341)
--- trunk/LayoutTests/platform/win/TestExpectations 2018-12-18 18:40:28 UTC (rev 239340)
+++ trunk/LayoutTests/platform/win/TestExpectations 2018-12-18 18:51:05 UTC (rev 239341)
@@ -4133,6 +4133,7 @@
# Feature flag only enabled for wk2
css-custom-properties-api [ Skip ]
fast/css-custom-paint [ Skip ]
+css-typedom [ Skip ]
editing/pasteboard/drag-and-drop-color-input-events.html [ Skip ]
Modified: trunk/Source/WebCore/CMakeLists.txt (239340 => 239341)
--- trunk/Source/WebCore/CMakeLists.txt 2018-12-18 18:40:28 UTC (rev 239340)
+++ trunk/Source/WebCore/CMakeLists.txt 2018-12-18 18:51:05 UTC (rev 239341)
@@ -604,12 +604,13 @@
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
Modified: trunk/Source/WebCore/ChangeLog (239340 => 239341)
--- trunk/Source/WebCore/ChangeLog 2018-12-18 18:40:28 UTC (rev 239340)
+++ trunk/Source/WebCore/ChangeLog 2018-12-18 18:51:05 UTC (rev 239341)
@@ -1,3 +1,50 @@
+2018-12-18 Justin Michaud <[email protected]>
+
+ CSS Typed OM should expose attributeStyleMap
+ https://bugs.webkit.org/show_bug.cgi?id=192671
+
+ Reviewed by Ryosuke Niwa.
+
+ 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):
+ (WebCore::StylePropertyMapReadOnly::customPropertyValueOrDefault):
+ * 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::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-18 Wenson Hsieh <[email protected]>
Calling setValue() while typing should invoke -textDidChangeInTextField in the injected bundle
Modified: trunk/Source/WebCore/DerivedSources.make (239340 => 239341)
--- trunk/Source/WebCore/DerivedSources.make 2018-12-18 18:40:28 UTC (rev 239340)
+++ trunk/Source/WebCore/DerivedSources.make 2018-12-18 18:51:05 UTC (rev 239341)
@@ -513,6 +513,7 @@
$(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 \
Modified: trunk/Source/WebCore/Sources.txt (239340 => 239341)
--- trunk/Source/WebCore/Sources.txt 2018-12-18 18:40:28 UTC (rev 239340)
+++ trunk/Source/WebCore/Sources.txt 2018-12-18 18:51:05 UTC (rev 239341)
@@ -721,6 +721,8 @@
css/parser/SizesAttributeParser.cpp
css/parser/SizesCalcParser.cpp
+css/typedom/StylePropertyMapReadOnly.cpp
+
cssjit/SelectorCompiler.cpp
dom/AbortController.cpp
@@ -3184,6 +3186,7 @@
JSStorageEvent.cpp
JSStringCallback.cpp
JSStyleMedia.cpp
+JSStylePropertyMap.cpp
JSStylePropertyMapReadOnly.cpp
JSStyleSheet.cpp
JSStyleSheetList.cpp
Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (239340 => 239341)
--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj 2018-12-18 18:40:28 UTC (rev 239340)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj 2018-12-18 18:51:05 UTC (rev 239341)
@@ -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>"; };
@@ -18154,6 +18158,9 @@
4BAFD0DA21921EAD00C0AB64 /* typedom */ = {
isa = PBXGroup;
children = (
+ 4BD781BE21C1965F00D9703E /* StylePropertyMap.h */,
+ 4BD781BC21C1964800D9703E /* StylePropertyMap.idl */,
+ 4BD781C521C1D67700D9703E /* StylePropertyMapReadOnly.cpp */,
4BAFD0CE2190F9B400C0AB64 /* StylePropertyMapReadOnly.h */,
4BAFD0D02190F9C200C0AB64 /* StylePropertyMapReadOnly.idl */,
4B43864F219CD56100F8D3C5 /* TypedOMCSSImageValue.h */,
@@ -31154,6 +31161,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 */,
Modified: trunk/Source/WebCore/bindings/js/WebCoreBuiltinNames.h (239340 => 239341)
--- trunk/Source/WebCore/bindings/js/WebCoreBuiltinNames.h 2018-12-18 18:40:28 UTC (rev 239340)
+++ trunk/Source/WebCore/bindings/js/WebCoreBuiltinNames.h 2018-12-18 18:51:05 UTC (rev 239341)
@@ -177,6 +177,7 @@
macro(SpectreGadget) \
macro(StaticRange) \
macro(StylePropertyMapReadOnly) \
+ macro(StylePropertyMap) \
macro(VRDisplay) \
macro(VRDisplayCapabilities) \
macro(VRDisplayEvent) \
Modified: trunk/Source/WebCore/css/ElementCSSInlineStyle.idl (239340 => 239341)
--- trunk/Source/WebCore/css/ElementCSSInlineStyle.idl 2018-12-18 18:40:28 UTC (rev 239340)
+++ trunk/Source/WebCore/css/ElementCSSInlineStyle.idl 2018-12-18 18:51:05 UTC (rev 239341)
@@ -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].
};
Copied: trunk/Source/WebCore/css/typedom/StylePropertyMap.h (from rev 239340, trunk/Source/WebCore/css/typedom/StylePropertyMapReadOnly.h) (0 => 239341)
--- trunk/Source/WebCore/css/typedom/StylePropertyMap.h (rev 0)
+++ trunk/Source/WebCore/css/typedom/StylePropertyMap.h 2018-12-18 18:51:05 UTC (rev 239341)
@@ -0,0 +1,42 @@
+/*
+ * 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 {
+};
+
+} // namespace WebCore
+
+#endif
Copied: trunk/Source/WebCore/css/typedom/StylePropertyMap.idl (from rev 239340, trunk/Source/WebCore/css/typedom/StylePropertyMapReadOnly.idl) (0 => 239341)
--- trunk/Source/WebCore/css/typedom/StylePropertyMap.idl (rev 0)
+++ trunk/Source/WebCore/css/typedom/StylePropertyMap.idl 2018-12-18 18:51:05 UTC (rev 239341)
@@ -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 {
+};
Added: trunk/Source/WebCore/css/typedom/StylePropertyMapReadOnly.cpp (0 => 239341)
--- trunk/Source/WebCore/css/typedom/StylePropertyMapReadOnly.cpp (rev 0)
+++ trunk/Source/WebCore/css/typedom/StylePropertyMapReadOnly.cpp 2018-12-18 18:51:05 UTC (rev 239341)
@@ -0,0 +1,78 @@
+/*
+ * 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());
+}
+
+RefPtr<TypedOMCSSStyleValue> StylePropertyMapReadOnly::customPropertyValueOrDefault(const String& name, Document& document, CSSValue* inputValue, Element* element)
+{
+ if (!inputValue) {
+ auto* registered = document.getCSSRegisteredCustomPropertySet().get(name);
+
+ if (registered && registered->initialValue()) {
+ auto value = registered->initialValueCopy();
+ return StylePropertyMapReadOnly::reifyValue(value.get(), document, element);
+ }
+
+ return TypedOMCSSUnparsedValue::create(emptyString());
+ }
+
+ return StylePropertyMapReadOnly::reifyValue(inputValue, document, element);
+}
+
+} // namespace WebCore
+
+#endif
Modified: trunk/Source/WebCore/css/typedom/StylePropertyMapReadOnly.h (239340 => 239341)
--- trunk/Source/WebCore/css/typedom/StylePropertyMapReadOnly.h 2018-12-18 18:40:28 UTC (rev 239340)
+++ trunk/Source/WebCore/css/typedom/StylePropertyMapReadOnly.h 2018-12-18 18:51:05 UTC (rev 239341)
@@ -27,29 +27,24 @@
#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)));
- }
+ virtual ~StylePropertyMapReadOnly() = default;
+ virtual RefPtr<TypedOMCSSStyleValue> get(const String& property) const = 0;
- 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;
+ static RefPtr<TypedOMCSSStyleValue> reifyValue(CSSValue*, Document&, Element* = nullptr);
+ static RefPtr<TypedOMCSSStyleValue> customPropertyValueOrDefault(const String& name, Document&, CSSValue*, Element* = nullptr);
};
} // namespace WebCore
Modified: trunk/Source/WebCore/css/typedom/StylePropertyMapReadOnly.idl (239340 => 239341)
--- trunk/Source/WebCore/css/typedom/StylePropertyMapReadOnly.idl 2018-12-18 18:40:28 UTC (rev 239340)
+++ trunk/Source/WebCore/css/typedom/StylePropertyMapReadOnly.idl 2018-12-18 18:51:05 UTC (rev 239341)
@@ -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);
Modified: trunk/Source/WebCore/css/typedom/TypedOMCSSImageValue.h (239340 => 239341)
--- trunk/Source/WebCore/css/typedom/TypedOMCSSImageValue.h 2018-12-18 18:40:28 UTC (rev 239340)
+++ trunk/Source/WebCore/css/typedom/TypedOMCSSImageValue.h 2018-12-18 18:51:05 UTC (rev 239341)
@@ -39,20 +39,20 @@
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))
{
}
@@ -59,7 +59,7 @@
bool isImageValue() final { return true; }
Ref<CSSImageValue> m_cssValue;
- WeakPtr<RenderElement> m_renderer;
+ WeakPtr<Document> m_document;
};
} // namespace WebCore
Modified: trunk/Source/WebCore/dom/Element.cpp (239340 => 239341)
--- trunk/Source/WebCore/dom/Element.cpp 2018-12-18 18:40:28 UTC (rev 239340)
+++ trunk/Source/WebCore/dom/Element.cpp 2018-12-18 18:51:05 UTC (rev 239341)
@@ -4105,4 +4105,18 @@
return animations;
}
+#if ENABLE(CSS_TYPED_OM)
+StylePropertyMap* Element::attributeStyleMap()
+{
+ if (!hasRareData())
+ return nullptr;
+ return elementRareData()->attributeStyleMap();
+}
+
+void Element::setAttributeStyleMap(Ref<StylePropertyMap>&& map)
+{
+ ensureElementRareData().setAttributeStyleMap(WTFMove(map));
+}
+#endif
+
} // namespace WebCore
Modified: trunk/Source/WebCore/dom/Element.h (239340 => 239341)
--- trunk/Source/WebCore/dom/Element.h 2018-12-18 18:40:28 UTC (rev 239340)
+++ trunk/Source/WebCore/dom/Element.h 2018-12-18 18:51:05 UTC (rev 239341)
@@ -54,6 +54,7 @@
class PlatformWheelEvent;
class PseudoElement;
class RenderTreePosition;
+class StylePropertyMap;
class WebAnimation;
struct ElementStyle;
struct ScrollIntoViewOptions;
@@ -608,6 +609,11 @@
static ExceptionOr<void> mergeWithNextTextNode(Text&);
+#if ENABLE(CSS_TYPED_OM)
+ StylePropertyMap* attributeStyleMap();
+ void setAttributeStyleMap(Ref<StylePropertyMap>&&);
+#endif
+
private:
Frame* documentFrameWithNonNullView() const;
Modified: trunk/Source/WebCore/dom/ElementRareData.cpp (239340 => 239341)
--- trunk/Source/WebCore/dom/ElementRareData.cpp 2018-12-18 18:40:28 UTC (rev 239340)
+++ trunk/Source/WebCore/dom/ElementRareData.cpp 2018-12-18 18:51:05 UTC (rev 239341)
@@ -47,6 +47,9 @@
#if ENABLE(INTERSECTION_OBSERVER)
void* intersectionObserverData;
#endif
+#if ENABLE(CSS_TYPED_OM)
+ void* typedOMData;
+#endif
};
Modified: trunk/Source/WebCore/dom/ElementRareData.h (239340 => 239341)
--- trunk/Source/WebCore/dom/ElementRareData.h 2018-12-18 18:40:28 UTC (rev 239340)
+++ trunk/Source/WebCore/dom/ElementRareData.h 2018-12-18 18:51:05 UTC (rev 239341)
@@ -30,6 +30,7 @@
#include "PseudoElement.h"
#include "RenderElement.h"
#include "ShadowRoot.h"
+#include "StylePropertyMap.h"
namespace WebCore {
@@ -127,6 +128,11 @@
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 @@
RefPtr<PseudoElement> m_beforePseudoElement;
RefPtr<PseudoElement> m_afterPseudoElement;
+#if ENABLE(CSS_TYPED_OM)
+ RefPtr<StylePropertyMap> m_attributeStyleMap;
+#endif
+
void releasePseudoElement(PseudoElement*);
};
Modified: trunk/Source/WebCore/dom/StyledElement.cpp (239340 => 239341)
--- trunk/Source/WebCore/dom/StyledElement.cpp 2018-12-18 18:40:28 UTC (rev 239340)
+++ trunk/Source/WebCore/dom/StyledElement.cpp 2018-12-18 18:51:05 UTC (rev 239341)
@@ -25,13 +25,17 @@
#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"
@@ -38,7 +42,9 @@
#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,55 @@
return ensureMutableInlineStyle().ensureInlineCSSStyleDeclaration(*this);
}
+#if ENABLE(CSS_TYPED_OM)
+
+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))
+ {
+ }
+
+ static RefPtr<TypedOMCSSStyleValue> extractInlineProperty(const String& name, StyledElement& element)
+ {
+ if (!element.inlineStyle())
+ return nullptr;
+
+ if (isCustomPropertyName(name)) {
+ auto value = element.inlineStyle()->getCustomPropertyCSSValue(name);
+ return StylePropertyMapReadOnly::customPropertyValueOrDefault(name, element.document(), value.get(), &element);
+ }
+
+ CSSPropertyID propertyID = cssPropertyID(name);
+ if (!propertyID)
+ return nullptr;
+
+ auto value = element.inlineStyle()->getPropertyCSSValue(propertyID);
+ return StylePropertyMapReadOnly::reifyValue(value.get(), element.document(), &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;
Modified: trunk/Source/WebCore/dom/StyledElement.h (239340 => 239341)
--- trunk/Source/WebCore/dom/StyledElement.h 2018-12-18 18:40:28 UTC (rev 239340)
+++ trunk/Source/WebCore/dom/StyledElement.h 2018-12-18 18:51:05 UTC (rev 239341)
@@ -35,6 +35,7 @@
class MutableStyleProperties;
class PropertySetCSSStyleDeclaration;
class StyleProperties;
+class StylePropertyMap;
class StyledElement : public Element {
WTF_MAKE_ISO_ALLOCATED(StyledElement);
@@ -57,6 +58,9 @@
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&) { }
Modified: trunk/Source/WebCore/html/canvas/CanvasRenderingContext2DBase.cpp (239340 => 239341)
--- trunk/Source/WebCore/html/canvas/CanvasRenderingContext2DBase.cpp 2018-12-18 18:40:28 UTC (rev 239340)
+++ trunk/Source/WebCore/html/canvas/CanvasRenderingContext2DBase.cpp 2018-12-18 18:51:05 UTC (rev 239341)
@@ -1442,10 +1442,11 @@
#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 @@
#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);
Modified: trunk/Source/WebCore/platform/graphics/CustomPaintImage.cpp (239340 => 239341)
--- trunk/Source/WebCore/platform/graphics/CustomPaintImage.cpp 2018-12-18 18:40:28 UTC (rev 239340)
+++ trunk/Source/WebCore/platform/graphics/CustomPaintImage.cpp 2018-12-18 18:51:05 UTC (rev 239341)
@@ -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,58 @@
CustomPaintImage::~CustomPaintImage() = default;
+static RefPtr<TypedOMCSSStyleValue> extractComputedProperty(const String& name, Element& element)
+{
+ ComputedStyleExtractor extractor(&element);
+
+ if (isCustomPropertyName(name)) {
+ auto value = extractor.customPropertyValue(name);
+ return StylePropertyMapReadOnly::customPropertyValueOrDefault(name, element.document(), value.get(), &element);
+ }
+
+ CSSPropertyID propertyID = cssPropertyID(name);
+ if (!propertyID)
+ return nullptr;
+
+ auto 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)));
+ }
+
+ static RefPtr<TypedOMCSSStyleValue> extractComputedProperty(const String& name, Element& element)
+ {
+ ComputedStyleExtractor extractor(&element);
+
+ if (isCustomPropertyName(name)) {
+ auto value = extractor.customPropertyValue(name);
+ return StylePropertyMapReadOnly::customPropertyValueOrDefault(name, element.document(), value.get(), &element);
+ }
+
+ CSSPropertyID propertyID = cssPropertyID(name);
+ if (!propertyID)
+ return nullptr;
+
+ auto value = extractor.propertyValue(propertyID, DoNotUpdateLayout);
+ return StylePropertyMapReadOnly::reifyValue(value.get(), element.document(), &element);
+ }
+
+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 +135,15 @@
return ImageDrawResult::DidNothing;
auto context = contextOrException.releaseReturnValue();
- HashMap<String, Ref<TypedOMCSSStyleValue>> propertyValues;
- ComputedStyleExtractor extractor(m_element->element());
+ HashMap<String, RefPtr<TypedOMCSSStyleValue>> propertyValues;
- 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;
- }
-
- // 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);