+2012-06-28 Hayato Ito <hayato@chromium.org>
+
+ Add a test for a 'user-modify' css property of distributed nodes.
+ https://bugs.webkit.org/show_bug.cgi?id=90197
+
+ Reviewed by Ryosuke Niwa.
+
+ * fast/dom/shadow/user-modify-inheritance-expected.txt:
+ * fast/dom/shadow/user-modify-inheritance.html:
+
2012-06-28 Elliott Sprehn <esprehn@gmail.com>
frameborder="no" on frameset is ignored if border attribute set
PASS computedStyle(prepareNodeInShadowRoot(document.getElementById("non-contenteditable-host1"), null), userModifyPropertyName) is "read-only"
PASS computedStyle(prepareNodeInShadowRoot(document.getElementById("non-contenteditable-host2"), "false"), userModifyPropertyName) is "read-only"
PASS computedStyle(prepareNodeInShadowRoot(document.getElementById("non-contenteditable-host3"), "true"), userModifyPropertyName) is "read-write"
+PASS getUserModifyProperty("child-a") is "read-write"
+PASS getUserModifyProperty("child-b") is "read-write"
PASS successfullyParsed is true
TEST COMPLETE
<html>
<head>
<script src="../../js/resources/js-test-pre.js"></script>
+<script src="resources/shadow-dom.js"></script>
</head>
<body>
<p id="description"></p>
<div id="non-contenteditable-host1"></div>
<div id="non-contenteditable-host2"></div>
<div id="non-contenteditable-host3"></div>
+<div id="sandbox"></div>
<pre id="console"></pre>
<script>
description("Tests to ensure that a '-webkit-user-modify' CSS porperty is not inherited across shadow boundaries.");
return undefined;
}
+function getUserModifyProperty(id) {
+ return computedStyle(document.getElementById("child-a"), userModifyPropertyName);
+}
+
function prepareNodeInShadowRoot(host, contentEditableAttributeValueForNode) {
var shadowRoot = new WebKitShadowRoot(host);
var nodeInShadow = document.createElement('div');
shouldBeEqualToString('computedStyle(prepareNodeInShadowRoot(document.getElementById("non-contenteditable-host1"), null), userModifyPropertyName)', 'read-only');
shouldBeEqualToString('computedStyle(prepareNodeInShadowRoot(document.getElementById("non-contenteditable-host2"), "false"), userModifyPropertyName)', 'read-only');
shouldBeEqualToString('computedStyle(prepareNodeInShadowRoot(document.getElementById("non-contenteditable-host3"), "true"), userModifyPropertyName)', 'read-write');
+
+document.getElementById('sandbox').appendChild(
+ createDOM('div', {'id': 'host', 'contenteditable': 'true'},
+ createShadowRoot(createDOM('content', {'select': '#child-a'}),
+ createDOM('div', {},
+ createDOM('content', {'select': '#child-b'}))),
+ createDOM('div', {'id': 'child-a'}),
+ createDOM('div', {'id': 'child-b'})));
+
+document.body.offsetLeft;
+
+shouldBeEqualToString('getUserModifyProperty("child-a")', 'read-write');
+shouldBeEqualToString('getUserModifyProperty("child-b")', 'read-write');
+
</script>
<script src="../../js/resources/js-test-post.js"></script>
</body>