Diff
Modified: trunk/LayoutTests/ChangeLog (217465 => 217466)
--- trunk/LayoutTests/ChangeLog 2017-05-26 02:04:21 UTC (rev 217465)
+++ trunk/LayoutTests/ChangeLog 2017-05-26 02:10:33 UTC (rev 217466)
@@ -1,3 +1,83 @@
+2017-05-25 Alexey Proskuryakov <[email protected]>
+
+ Merge split script tests, part 2
+ https://bugs.webkit.org/show_bug.cgi?id=172423
+
+ Reviewed by Tim Horton.
+
+ Fix the few remaining special cases of split tests.
+
+ * editing/pasteboard/drop-text-events-sideeffect-crash.html:
+ * editing/pasteboard/script-tests/drop-text-events-sideeffect.js: Removed.
+ This JS file used to be shared between this test and editing/pasteboard/drop-text-events-sideeffect.html.
+ Now it's inlined in both.
+
+ * fast/canvas/canvas-ellipse-connecting-line-expected.html:
+ * fast/canvas/script-tests/js-ellipse-implementation.js: Removed.
+ This was really a resource, not a scrip test, and it was only only used in one test.
+
+ * fast/dom/HTMLElement/class-list-quirks.html:
+ * fast/dom/HTMLElement/script-tests/class-list.js: Removed.
+ Another JS that used to be shared (with fast/dom/HTMLElement/class-list.html).
+
+ * fast/dom/Window/resources/postmessage-test.js: Copied from LayoutTests/fast/dom/Window/script-tests/postmessage-test.js.
+ * fast/dom/Window/script-tests/postmessage-test.js: Removed.
+ Moved a shared resource to its proper location.
+
+ * fast/dom/Window/script-tests/postmessage-clone-deep-array.js: Removed.
+ * fast/dom/Window/script-tests/postmessage-clone-really-deep-array.js: Removed.
+ * fast/dom/Window/script-tests/postmessage-clone.js: Removed.
+ * fast/dom/Window/window-postmessage-clone-deep-array.html:
+ * fast/dom/Window/window-postmessage-clone-really-deep-array.html:
+ * fast/dom/Window/window-postmessage-clone.html:
+ Straightforward js-tests with file names that didn't match.
+
+ * fast/table/resources/min-width-helpers.js: Copied from LayoutTests/fast/table/script-tests/min-width-helpers.js.
+ * fast/table/script-tests/min-width-helpers.js: Removed.
+ Moved a shared resource to its proper location.
+
+ * fast/table/min-width-css-block-table.html:
+ * fast/table/min-width-css-inline-table.html:
+ * fast/table/min-width-html-block-table.html:
+ * fast/table/min-width-html-inline-table.html:
+ * fast/table/script-tests/min-width-css-block-table.js: Removed.
+ * fast/table/script-tests/min-width-css-inline-table.js: Removed.
+ * fast/table/script-tests/min-width-html-block-table.js: Removed.
+ * fast/table/script-tests/min-width-html-inline-table.js: Removed.
+ Straightforward JS tests, weren't moved previously because my script was confused by min-width-helpers.js.
+
+ * printing/break-after-avoid-expected.txt:
+ * printing/break-after-avoid-page-expected.txt:
+ * printing/break-after-avoid-page.html:
+ * printing/break-after-avoid.html:
+ * printing/script-tests/break-after-avoid-page.js: Removed.
+ * printing/script-tests/break-after-avoid.js: Removed.
+ * printing/script-tests/page-break-after-avoid.js: Removed.
+ * printing/script-tests/page-break-always-for-overflow.js: Removed.
+ These had a number of copy/paste mistakes, so the tests werent's actually testing what they said they did.
+
+ * svg/dom/SVGAnimatedEnumeration-SVGMaskElement-expected.txt:
+ * svg/dom/SVGAnimatedEnumeration-SVGMaskElement.html:
+ * svg/dom/SVGAnimatedEnumeration-SVGPatternElement-expected.txt:
+ * svg/dom/SVGAnimatedEnumeration-SVGPatternElement.html:
+ * svg/dom/script-tests/SVGAnimatedEnumeration-SVGMaskElement.js: Removed.
+ * svg/dom/script-tests/SVGAnimatedEnumeration-SVGPatternElement.js: Removed.
+ These tests were mixed up - pattern was being tested instead of mask, and vice versa.
+
+ * svg/dom/script-tests/SVGColor.js: Removed.
+ * svg/dom/script-tests/SVGPaint.js: Removed.
+ Removed unused files.
+
+ * svg/dynamic-updates/SVGFEFloodElement-inherit-flood-color.html:
+ * svg/dynamic-updates/SVGFEGaussianBlurElement-dom-stdDeviation-call.html:
+ * svg/dynamic-updates/SVGFESpecularLightingElement-dom-suraceScale-attr.html:
+ * svg/dynamic-updates/SVGFESpecularLightingElement-svgdom-suraceScale-prop.html:
+ * svg/dynamic-updates/script-tests/SVGFEFloodElement-inherit-flood-color-css-prop.js: Removed.
+ * svg/dynamic-updates/script-tests/SVGFEGaussianBlurElement-svgdom-stdDeviation-call.js: Removed.
+ * svg/dynamic-updates/script-tests/SVGFESpecularLightingElement-dom-surfaceScale-attr.js: Removed.
+ * svg/dynamic-updates/script-tests/SVGFESpecularLightingElement-svgdom-surfaceScale-prop.js: Removed.
+ Straightforward js-tests with mismatching names.
+
2017-05-25 Myles C. Maxfield <[email protected]>
[WK1] iframes in layer-backed NSViews are not cleared between successive draws
Modified: trunk/LayoutTests/editing/pasteboard/drop-text-events-sideeffect-crash.html (217465 => 217466)
--- trunk/LayoutTests/editing/pasteboard/drop-text-events-sideeffect-crash.html 2017-05-26 02:04:21 UTC (rev 217465)
+++ trunk/LayoutTests/editing/pasteboard/drop-text-events-sideeffect-crash.html 2017-05-26 02:10:33 UTC (rev 217466)
@@ -9,7 +9,99 @@
<script>
document.body.contentEditable = "true";
</script>
-<script src=""
+<script>
+description('Ensure safety on side-effect on drop-initiated TextEvent.');
+
+function toStringLiteral(str)
+{
+ return "'" + str + "'";
+}
+
+var testSourceRoot = document.createElement("div");
+document.body.appendChild(testSourceRoot);
+
+var testTargetRoot = document.createElement("div");
+testTargetRoot.innerHTML += "<div><span id='targetEditable' contentEditable>initialValue</span></div>";
+testTargetRoot.innerHTML += "<iframe id='targetIFrame' src=''></iframe>";
+document.body.appendChild(testTargetRoot);
+
+testTargetEditable = document.getElementById("targetEditable");
+testTargetIFrame = document.getElementById("targetIFrame");
+testTargetIFrameDocument = testTargetIFrame.contentDocument;
+testTargetIFrameDocument.body.innerHTML = "initialBody";
+testTargetIFrameDocument.designMode = "on";
+
+function handlerRemovingTarget(event)
+{
+ event.target.parentNode.removeChild(event.target);
+}
+
+function handlerRemovingIFrame(event)
+{
+ testTargetIFrame.parentNode.removeChild(testTargetIFrame);
+}
+
+function dragFrom(element)
+{
+ var x = element.offsetLeft + element.offsetWidth / 2;
+ var y = element.offsetTop + element.offsetHeight / 2;
+ eventSender.mouseMoveTo(x, y);
+ eventSender.mouseDown();
+
+ // Makes drag happen
+ var meaninglessDelta = 10;
+ eventSender.leapForward(500);
+ eventSender.mouseMoveTo(x + meaninglessDelta , y + meaninglessDelta);
+}
+
+function dropTo(element)
+{
+ var x = element.offsetLeft + element.offsetWidth / 2;
+ var y = element.offsetTop + element.offsetHeight / 2;
+
+ eventSender.mouseMoveTo(x, y);
+ eventSender.mouseUp();
+}
+
+function dragPlainText()
+{
+ var selection = window.getSelection();
+
+ testSourceRoot.innerHTML = "<input type='text' value='PlainHello' id='src' />";
+ var input = document.getElementById("src");
+ input.focus();
+ selection.modify("extend", "forward", "line");
+ dragFrom(input);
+}
+
+function dropToTargetEditable()
+{
+ dropTo(testTargetEditable);
+}
+
+function dropToTargetIFrame()
+{
+ dropTo(testTargetIFrame);
+}
+
+testTargetEditable.addEventListener("textInput", handlerRemovingTarget);
+dragPlainText();
+dropToTargetEditable();
+// detached node shouldn't get dropped value
+shouldBe("testTargetEditable.innerHTML", toStringLiteral("initialValue"));
+
+testTargetIFrameDocument.body.addEventListener("textInput", handlerRemovingIFrame);
+dragPlainText();
+dropToTargetIFrame();
+// detached frame shouldn't get dropped value
+shouldBe("testTargetIFrameDocument.body.innerHTML", toStringLiteral("initialBody"));
+
+// Hides dataset to make dump clean.
+testTargetRoot.style.display = "none";
+testSourceRoot.style.display = "none";
+
+var successfullyParsed = true;
+</script>
<script src=""
</body>
</html>
Modified: trunk/LayoutTests/fast/canvas/canvas-ellipse-connecting-line-expected.html (217465 => 217466)
--- trunk/LayoutTests/fast/canvas/canvas-ellipse-connecting-line-expected.html 2017-05-26 02:04:21 UTC (rev 217465)
+++ trunk/LayoutTests/fast/canvas/canvas-ellipse-connecting-line-expected.html 2017-05-26 02:10:33 UTC (rev 217466)
@@ -3,8 +3,31 @@
<head></head>
<body>
<canvas id="mycanvas" width="300" height="300"></canvas>
-<script src=""
<script>
+function rad2deg(x) {
+ return x * 180 / Math.PI;
+}
+
+function ellipseUsingArc(context, x, y, radiusX, radiusY, rotation, startAngle, endAngle, anticlockwise)
+{
+ var transform = new WebKitCSSMatrix();
+ transform = transform.translate(x, y);
+ transform = transform.rotate(rad2deg(rotation));
+ transform = transform.scale(radiusX, radiusY);
+
+ /*
+ Use WebKitCSSMatrix instead of as follows, because using WebKitCSSMatrix computes float values more precisely.
+ It is because we don't want to fail pixel comparison due to float precision.
+ context.translate(x, y);
+ context.rotate(rotation);
+ context.scale(radiusX, radiusY);
+ */
+ context.save();
+ context.transform(transform.a, transform.b, transform.c, transform.d, transform.e, transform.f);
+ context.arc(0, 0, 1, startAngle, endAngle, anticlockwise);
+ context.restore();
+}
+
var canvas = document.getElementById('mycanvas');
var ctx = canvas.getContext('2d');
Modified: trunk/LayoutTests/fast/dom/HTMLElement/class-list-quirks.html (217465 => 217466)
--- trunk/LayoutTests/fast/dom/HTMLElement/class-list-quirks.html 2017-05-26 02:04:21 UTC (rev 217465)
+++ trunk/LayoutTests/fast/dom/HTMLElement/class-list-quirks.html 2017-05-26 02:10:33 UTC (rev 217466)
@@ -4,7 +4,357 @@
<script src=""
</head>
<body>
-<script src=""
+<script>
+description('Tests the classList attribute and its properties.');
+
+var element;
+
+function createElement(className)
+{
+ element = document.createElement('p');
+ element.className = className;
+}
+
+debug('Tests from http://simon.html5.org/test/html/dom/reflecting/DOMTokenList/');
+
+// http://simon.html5.org/test/html/dom/reflecting/DOMTokenList/setting/001.htm
+createElement('x');
+element.classList = 'y';
+shouldBeEqualToString('String(element.classList)', 'y');
+
+// http://simon.html5.org/test/html/dom/reflecting/DOMTokenList/getting/001.htm
+createElement('');
+shouldEvaluateTo('element.classList.length', 0);
+
+// http://simon.html5.org/test/html/dom/reflecting/DOMTokenList/getting/002.htm
+createElement('x');
+shouldEvaluateTo('element.classList.length', 1);
+
+// http://simon.html5.org/test/html/dom/reflecting/DOMTokenList/getting/003.htm
+createElement('x x');
+shouldEvaluateTo('element.classList.length', 1);
+
+// http://simon.html5.org/test/html/dom/reflecting/DOMTokenList/getting/004.htm
+createElement('x y');
+shouldEvaluateTo('element.classList.length', 2);
+
+// http://simon.html5.org/test/html/dom/reflecting/DOMTokenList/getting/005.htm
+createElement('');
+element.classList.add('x');
+shouldBeEqualToString('element.className', 'x');
+
+// http://simon.html5.org/test/html/dom/reflecting/DOMTokenList/getting/006.htm
+createElement('x');
+element.classList.add('x');
+shouldBeEqualToString('element.className', 'x');
+
+// http://simon.html5.org/test/html/dom/reflecting/DOMTokenList/getting/007.htm
+createElement('x x');
+element.classList.add('x');
+shouldBeEqualToString('element.className', 'x');
+
+// http://simon.html5.org/test/html/dom/reflecting/DOMTokenList/getting/008.htm
+createElement('y');
+element.classList.add('x');
+shouldBeEqualToString('element.className', 'y x');
+
+// http://simon.html5.org/test/html/dom/reflecting/DOMTokenList/getting/009.htm
+createElement('');
+element.classList.remove('x');
+shouldBeEqualToString('element.className', '');
+
+// http://simon.html5.org/test/html/dom/reflecting/DOMTokenList/getting/010.htm
+createElement('x');
+element.classList.remove('x');
+shouldBeEqualToString('element.className', '');
+
+// http://simon.html5.org/test/html/dom/reflecting/DOMTokenList/getting/011.htm
+createElement(' y x y ');
+element.classList.remove('x');
+shouldBeEqualToString('element.className', 'y');
+
+// http://simon.html5.org/test/html/dom/reflecting/DOMTokenList/getting/012.htm
+createElement(' x y x ');
+element.classList.remove('x');
+shouldBeEqualToString('element.className', 'y');
+
+
+debug('Ensure that we can handle empty class name correctly');
+element = document.createElement('span');
+shouldBeTrue("element.classList.toggle('x')");
+shouldBeEqualToString('element.className', 'x');
+shouldBeFalse("element.classList.toggle('x')");
+shouldBeEqualToString('element.className', '');
+
+element = document.createElement('span');
+shouldBeFalse('element.classList.contains(\'x\')');
+shouldBeUndefined('element.classList[1]');
+element.classList.remove('x');
+element.classList.add('x')
+
+
+debug('Test toggle with force argument')
+
+createElement('');
+shouldBeTrue("element.classList.toggle('x', true)");
+shouldBeEqualToString('element.className', 'x');
+shouldBeTrue("element.classList.toggle('x', true)");
+shouldBeEqualToString('element.className', 'x');
+shouldBeFalse("element.classList.toggle('x', false)");
+shouldBeEqualToString('element.className', '');
+shouldBeFalse("element.classList.toggle('x', false)");
+shouldBeEqualToString('element.className', '');
+
+shouldThrowDOMException(function() {
+ element.classList.toggle('', true);
+}, DOMException.SYNTAX_ERR);
+
+shouldThrowDOMException(function() {
+ element.classList.toggle('x y', false);
+}, DOMException.INVALID_CHARACTER_ERR);
+
+
+debug('Testing add in presence of trailing white spaces.');
+
+createElement('x ');
+element.classList.add('y');
+shouldBeEqualToString('element.className', 'x y');
+
+createElement('x\t');
+element.classList.add('y');
+shouldBeEqualToString('element.className', 'x y');
+
+createElement(' ');
+element.classList.add('y');
+shouldBeEqualToString('element.className', 'y');
+
+
+debug('Test invalid tokens');
+
+// Testing exception due to invalid token
+
+// shouldThrow from js-test-pre.js is not sufficient.
+function shouldThrowDOMException(f, ec)
+{
+ try {
+ f();
+ testFailed('Expected an exception');
+ } catch (ex) {
+ if (!(ex instanceof DOMException)) {
+ testFailed('Exception is not an instance of DOMException, found: ' +
+ Object.toString.call(ex));
+ return;
+ }
+ if (ec !== ex.code) {
+ testFailed('Wrong exception code: ' + ex.code);
+ return;
+ }
+ }
+ var formattedFunction = String(f).replace(/^function.+\{\s*/m, '').
+ replace(/;?\s+\}/m, '');
+ testPassed(formattedFunction + ' threw expected DOMException with code ' + ec);
+}
+
+createElement('x');
+shouldBeFalse("element.classList.contains('')");
+
+createElement('x y');
+shouldBeFalse("element.classList.contains('x y')");
+
+createElement('');
+shouldThrowDOMException(function() {
+ element.classList.add('');
+}, DOMException.SYNTAX_ERR);
+
+createElement('');
+shouldThrowDOMException(function() {
+ element.classList.add('x y');
+}, DOMException.INVALID_CHARACTER_ERR);
+
+createElement('');
+shouldThrowDOMException(function() {
+ element.classList.remove('');
+}, DOMException.SYNTAX_ERR);
+
+createElement('');
+shouldThrowDOMException(function() {
+ element.classList.remove('x y');
+}, DOMException.INVALID_CHARACTER_ERR);
+
+
+
+createElement('');
+shouldThrowDOMException(function() {
+ element.classList.toggle('');
+}, DOMException.SYNTAX_ERR);
+
+createElement('x y');
+shouldThrowDOMException(function() {
+ element.classList.toggle('x y');
+}, DOMException.INVALID_CHARACTER_ERR);
+
+createElement('');
+shouldThrow("element.classList.toggle()");
+
+debug('Indexing');
+
+createElement('x');
+shouldBeEqualToString('element.classList[0]', 'x');
+shouldBeEqualToString('element.classList.item(0)', 'x');
+
+createElement('x x');
+shouldBeUndefined('element.classList[1]');
+shouldBeNull('element.classList.item(1)');
+
+createElement('x y');
+shouldBeEqualToString('element.classList[1]', 'y');
+shouldBeEqualToString('element.classList.item(1)', 'y');
+
+createElement('');
+shouldBeUndefined('element.classList[0]');
+shouldBeNull('element.classList.item(0)');
+
+createElement('x y z');
+shouldBeUndefined('element.classList[4]');
+shouldBeNull('element.classList.item(4)');
+shouldBeUndefined('element.classList[-1]'); // Not a valid index so should not trigger item().
+shouldBeNull('element.classList.item(-1)');
+shouldThrow('element.classList.item()');
+
+debug('Test case since DOMTokenList is case sensitive');
+
+createElement('x');
+shouldBeTrue('element.classList.contains(\'x\')');
+shouldBeFalse('element.classList.contains(\'X\')');
+shouldBeEqualToString('element.classList[0]', 'x');
+shouldThrow('element.classList.contains()');
+
+createElement('X');
+shouldBeTrue('element.classList.contains(\'X\')');
+shouldBeFalse('element.classList.contains(\'x\')');
+shouldBeEqualToString('element.classList[0]', 'X');
+
+
+debug('Testing whitespace');
+// U+0020 SPACE, U+0009 CHARACTER TABULATION (tab), U+000A LINE FEED (LF),
+// U+000C FORM FEED (FF), and U+000D CARRIAGE RETURN (CR)
+
+createElement('x\u0020y');
+shouldEvaluateTo('element.classList.length', 2);
+
+createElement('x\u0009y');
+shouldEvaluateTo('element.classList.length', 2);
+
+createElement('x\u000Ay');
+shouldEvaluateTo('element.classList.length', 2);
+
+createElement('x\u000Cy');
+shouldEvaluateTo('element.classList.length', 2);
+
+createElement('x\u000Dy');
+shouldEvaluateTo('element.classList.length', 2);
+
+
+debug('DOMTokenList presence and type');
+
+
+// Safari returns object
+// Firefox returns object
+// IE8 returns object
+// Chrome returns function
+// assertEquals('object', typeof DOMTokenList);
+shouldBeTrue('\'undefined\' != typeof DOMTokenList');
+
+shouldBeEqualToString('typeof DOMTokenList.prototype', 'object');
+
+createElement('x');
+shouldBeEqualToString('typeof element.classList', 'object');
+
+shouldEvaluateTo('element.classList.constructor', 'DOMTokenList');
+
+shouldBeTrue('element.classList === element.classList');
+
+// Bug 93628
+document.body.classList.add('FAIL');
+shouldBeTrue('document.body.classList.contains("FAIL")');
+document.body.classList.remove('FAIL');
+shouldBeEqualToString('document.body.className', '');
+
+// Variadic
+
+debug('Variadic calls');
+
+createElement('');
+element.classList.add('a', 'b');
+shouldBeEqualToString('element.className', 'a b');
+
+element.classList.add('a', 'b', 'c');
+shouldBeEqualToString('element.className', 'a b c');
+
+element.classList.add(null, {toString: function() { return 'd' }}, undefined, 0, false);
+shouldBeEqualToString('element.className', 'a b c null d undefined 0 false');
+
+createElement('');
+element.classList.add('a', 'b', 'a');
+shouldBeEqualToString('element.className', 'a b');
+
+createElement('');
+shouldThrowDOMException(function() {
+ element.classList.add('a', 'b', '');
+}, DOMException.SYNTAX_ERR);
+shouldBeEqualToString('element.className', '');
+
+shouldThrowDOMException(function() {
+ element.classList.add('a', 'b', 'c d');
+}, DOMException.INVALID_CHARACTER_ERR);
+shouldBeEqualToString('element.className', '');
+
+shouldThrow('element.classList.add("a", {toString: function() { throw new Error("user error"); }}, "b")', '"Error: user error"');
+shouldBeEqualToString('element.className', '');
+
+createElement('');
+shouldNotThrow('element.classList.add()');
+
+createElement('');
+var observer = new WebKitMutationObserver(function() {});
+observer.observe(element, {attributes: true});
+element.classList.add('a', 'c');
+shouldBe('observer.takeRecords().length', '1');
+
+
+createElement('a b c d ');
+element.classList.remove('a', 'c');
+shouldBeEqualToString('element.className', 'b d');
+
+element.classList.remove('b', 'b');
+shouldBeEqualToString('element.className', 'd');
+
+createElement('a b c null d undefined 0 false');
+element.classList.remove(null, {toString: function() { return 'd' }}, undefined, 0, false);
+shouldBeEqualToString('element.className', 'a b c');
+
+createElement('a b');
+shouldThrowDOMException(function() {
+ element.classList.remove('a', 'b', '');
+}, DOMException.SYNTAX_ERR);
+shouldBeEqualToString('element.className', 'a b');
+
+shouldThrow('element.classList.remove("a", {toString: function() { throw new Error("user error"); }}, "b")', '"Error: user error"');
+shouldBeEqualToString('element.className', 'a b');
+
+shouldThrowDOMException(function() {
+ element.classList.remove('a', 'b', 'c d');
+}, DOMException.INVALID_CHARACTER_ERR);
+shouldBeEqualToString('element.className', 'a b');
+
+shouldNotThrow('element.classList.remove()');
+
+createElement('a b c');
+observer = new WebKitMutationObserver(function() {});
+observer.observe(element, {attributes: true});
+element.classList.remove('a', 'c');
+shouldBe('observer.takeRecords().length', '1');
+</script>
<script src=""
</body>
</html>
Copied: trunk/LayoutTests/fast/dom/Window/resources/postmessage-test.js (from rev 217463, trunk/LayoutTests/fast/dom/Window/script-tests/postmessage-test.js) (0 => 217466)
--- trunk/LayoutTests/fast/dom/Window/resources/postmessage-test.js (rev 0)
+++ trunk/LayoutTests/fast/dom/Window/resources/postmessage-test.js 2017-05-26 02:10:33 UTC (rev 217466)
@@ -0,0 +1,181 @@
+if (window.testRunner) {
+ testRunner.dumpAsText();
+ testRunner.waitUntilDone();
+}
+
+var console = document.getElementById("console");
+
+var messages = [];
+var evalThunks = [];
+
+function equal(actual, expected)
+{
+ if (actual === expected)
+ return true;
+ if (typeof actual !== typeof expected)
+ return false;
+ if ((actual instanceof Date) || (expected instanceof Date)) {
+ if ((actual instanceof Date) && (expected instanceof Date))
+ return (expected instanceof Date) && actual.getTime() == expected.getTime();
+ return false;
+ }
+ if ((actual instanceof Number) || (expected instanceof Number)) {
+ return (actual instanceof Number) && (expected instanceof Number) &&
+ (expected.valueOf() == actual.valueOf());
+ }
+ if ((actual instanceof Boolean) || (expected instanceof Boolean)) {
+ return (actual instanceof Boolean) && (expected instanceof Boolean) &&
+ (expected.valueOf() == actual.valueOf());
+ }
+ if ((actual instanceof String) || (expected instanceof String)) {
+ return (actual instanceof String) && (expected instanceof String) &&
+ (expected.valueOf() == actual.valueOf());
+ }
+ if (Array.isArray(actual) || Array.isArray(expected)) {
+ if (!Array.isArray(actual) || !Array.isArray(expected))
+ return false;
+ if (actual.length != expected.length)
+ return false;
+ for (var i = 0; i < actual.length; i++) {
+ if ((i in actual) ^ (i in expected))
+ return false;
+ if (!equal(actual[i], expected[i]))
+ return false;
+ }
+ return true;
+ }
+ if (actual.constructor !== expected.constructor)
+ return false;
+ try {
+ var keys = Object.keys(actual);
+ } catch(e) {
+ return false;
+ }
+ try {
+ if (!equal(keys, Object.keys(expected)))
+ return false;
+ } catch(e) {
+ return false;
+ }
+ for (var i = 0; i < keys.length; i++) {
+ if (!equal(actual[keys[i]], expected[keys[i]]))
+ return false;
+ }
+ return true;
+}
+
+function safeToString(o) {
+ if (o instanceof Date)
+ return o.toISOString();
+ if (typeof o !== "object" || !o)
+ return o;
+ try {
+ return o.toString();
+ } catch (e) {
+ return Object.prototype.toString.call(o) + "(default toString threw "+e+")";
+ }
+}
+
+function shouldBe(actual, expected)
+{
+ var actualValue = eval(actual);
+ var expectedValue = eval(expected);
+ if (equal(actualValue, expectedValue))
+ console.innerHTML += "PASS: " + actual + " is " + safeToString(expectedValue) + " of type " + typeof actualValue + "<br>";
+ else
+ console.innerHTML += "FAIL: " + actual + " is " + actualValue + " should be " + expectedValue + " of type " + typeof expectedValue + "<br>";
+}
+
+function shouldBeIdentical(actual, expected)
+{
+ var actualValue = eval(actual);
+ var expectedValue = eval(expected);
+ if (actualValue === expectedValue)
+ console.innerHTML += "PASS: " + actual + " is === to " + expected + "<br>";
+ else
+ console.innerHTML += "FAIL: " + actual + " is not === to " + expected + "<br>";
+}
+
+function doPass(msg) {
+ console.innerHTML += "PASS: " + msg + "<br>";
+}
+
+function doFail(msg) {
+ console.innerHTML += "FAIL: " + msg + "<br>";
+}
+
+window.doPassFail = function(result, msg) {
+ console.innerHTML += (result ? "PASS: " : "FAIL: ") + msg + "<br>";
+}
+
+function onmessage(evt) {
+ eventData = evt.data;
+ if (evt.data !== evt.data)
+ console.innerHTML += "MessageEvent.data does not produce the same value on multiple queries. " + evt.data + ", " + evt.data + "<br>";
+ var message = messages.shift();
+ switch (message) {
+ case "cyclicObject":
+ shouldBeIdentical("eventData", "eventData.self");
+ break;
+ case "cyclicArray":
+ shouldBeIdentical("eventData", "eventData[0]");
+ break;
+ case "objectGraph":
+ shouldBeIdentical("eventData.graph1", "eventData.graph2");
+ break;
+ case "arrayGraph":
+ shouldBeIdentical("eventData[0]", "eventData[1]");
+ break;
+ case "evalThunk":
+ var thunk = evalThunks.shift();
+ try {
+ thunk(eventData);
+ } catch(e) {
+ doFail("threw exception: " + e);
+ throw e;
+ }
+ break;
+ default:
+ shouldBe("eventData", message);
+ }
+
+ if (safeToString(evt.data) == 'done' && window.testRunner)
+ testRunner.notifyDone();
+}
+
+window.addEventListener('message', onmessage, false);
+
+function ConstructorWithPrototype(s) {
+ this.field = s;
+}
+
+ConstructorWithPrototype.prototype = {
+ protoProperty: 2010
+};
+
+window.tryPostMessage = function(message, shouldThrow, expected, expectedExceptionOrEvalThunk) {
+ if (expected == "evalThunk") {
+ var evalThunk = expectedExceptionOrEvalThunk;
+ } else {
+ var expectedException = expectedExceptionOrEvalThunk;
+ }
+ try {
+ var value = eval(message);
+ postMessage(value, "*");
+ if (shouldThrow)
+ console.innerHTML += "FAIL: 'postMessage("+message+")' should throw but didn't<br>";
+ messages.push(expected || message);
+ if (expected == "evalThunk") {
+ evalThunks.push(evalThunk);
+ }
+ } catch(e) {
+ if (shouldThrow) {
+ if (expectedException === undefined || expectedException == e.code || expectedException == e) {
+ console.innerHTML += "PASS: 'postMessage("+message+")' threw " + e + "<br>";
+ } else {
+ console.innerHTML += "FAIL: 'postMessage("+message+")' threw " + e + ", was expecting " + expectedException + "<br>";
+ }
+ } else
+ console.innerHTML += "FAIL: 'postMessage("+message+")' should not throw but threw " + e + "<br>";
+ }
+}
Modified: trunk/LayoutTests/fast/dom/Window/window-postmessage-clone-deep-array.html (217465 => 217466)
--- trunk/LayoutTests/fast/dom/Window/window-postmessage-clone-deep-array.html 2017-05-26 02:04:21 UTC (rev 217465)
+++ trunk/LayoutTests/fast/dom/Window/window-postmessage-clone-deep-array.html 2017-05-26 02:10:33 UTC (rev 217466)
@@ -4,7 +4,14 @@
<div id="description"></div>
<input type="file" id="fileInput" multiple></input>
<div id="console"></div>
-<script src=""
-<script src=""
+<script src=""
+<script>
+document.getElementById("description").innerHTML = "Tests that we support cloning deep(ish) arrays.";
+deepArray=[];
+for (var i = 0; i < 10000; i++)
+ deepArray=[deepArray];
+tryPostMessage('deepArray');
+tryPostMessage('"done"');
+</script>
</body>
</html>
Modified: trunk/LayoutTests/fast/dom/Window/window-postmessage-clone-really-deep-array.html (217465 => 217466)
--- trunk/LayoutTests/fast/dom/Window/window-postmessage-clone-really-deep-array.html 2017-05-26 02:04:21 UTC (rev 217465)
+++ trunk/LayoutTests/fast/dom/Window/window-postmessage-clone-really-deep-array.html 2017-05-26 02:10:33 UTC (rev 217466)
@@ -4,7 +4,14 @@
<div id="description"></div>
<input type="file" id="fileInput" multiple></input>
<div id="console"></div>
-<script src=""
-<script src=""
+<script src=""
+<script>
+document.getElementById("description").innerHTML = "Tests that we abort cloning overdeep arrays.";
+reallyDeepArray=[];
+for (var i = 0; i < 100000; i++)
+ reallyDeepArray=[reallyDeepArray];
+tryPostMessage('reallyDeepArray', true, null, DOMException.DATA_CLONE_ERR);
+tryPostMessage('"done"');
+</script>
</body>
</html>
Modified: trunk/LayoutTests/fast/dom/Window/window-postmessage-clone.html (217465 => 217466)
--- trunk/LayoutTests/fast/dom/Window/window-postmessage-clone.html 2017-05-26 02:04:21 UTC (rev 217465)
+++ trunk/LayoutTests/fast/dom/Window/window-postmessage-clone.html 2017-05-26 02:10:33 UTC (rev 217466)
@@ -4,7 +4,364 @@
<div id="description"></div>
<input type="file" id="fileInput" multiple></input>
<div id="console"></div>
-<script src=""
-<script src=""
+<script src=""
+<script>
+document.getElementById("description").innerHTML = "Tests that we clone object hierarchies";
+
+tryPostMessage('null');
+tryPostMessage('undefined');
+tryPostMessage('1');
+tryPostMessage('true');
+tryPostMessage('"1"');
+tryPostMessage('({})');
+tryPostMessage('({a:1})');
+tryPostMessage('({a:"a"})');
+tryPostMessage('({b:"a", a:"b"})');
+tryPostMessage('({p0:"string0", p1:"string1", p2:"string2", p3:"string3", p4:"string4", p5:"string5", p6:"string6", p7:"string7", p8:"string8", p9:"string9", p10:"string10", p11:"string11", p12:"string12", p13:"string13", p14:"string14", p15:"string15", p16:"string16", p17:"string17", p18:"string18", p19:"string19"})');
+tryPostMessage('({p0:"string1", p1:"string1", p2:"string2", p3:"string3", p4:"string4", p5:"string5", p6:"string6", p7:"string7", p8:"string8", p9:"string9", p10:"string10", p11:"string11", p12:"string12", p13:"string13", p14:"string14", p15:"string15", p16:"string16", p17:"string17", p18:"string18", p19:"string19"})');
+tryPostMessage('({a:""})');
+tryPostMessage('({a:0})');
+tryPostMessage('({a:1})');
+tryPostMessage('[]');
+tryPostMessage('["a", "a", "b", "a", "b"]');
+tryPostMessage('["a", "a", "b", {a:"b", b:"a"}]');
+tryPostMessage('[1,2,3]');
+tryPostMessage('[,,1]');
+tryPostMessage('(function(){})', true, null, DOMException.DATA_CLONE_ERR);
+tryPostMessage('var x = 0; try { eval("badref"); } catch(e) { x = e; } x', true, null, DOMException.DATA_CLONE_ERR);
+tryPostMessage('new Date(1234567890000)');
+tryPostMessage('new ConstructorWithPrototype("foo")', false, '({field:"foo"})');
+tryPostMessage('new Boolean(true)');
+tryPostMessage('new Boolean(false)');
+tryPostMessage('new String("gnirts")');
+tryPostMessage('new Number(42.0)');
+cyclicObject={};
+cyclicObject.self = cyclicObject;
+tryPostMessage('cyclicObject', false, "cyclicObject");
+cyclicArray=[];
+cyclicArray[0] = cyclicArray;
+tryPostMessage('cyclicArray', false, "cyclicArray");
+objectGraph = {};
+object = {};
+objectGraph.graph1 = object;
+objectGraph.graph2 = object;
+tryPostMessage('objectGraph', false, "objectGraph");
+arrayGraph = [object, object];
+tryPostMessage('arrayGraph', false, "arrayGraph");
+tryPostMessage('window', true);
+tryPostMessage('({get a() { throw "x" }})', true);
+
+var map = new Map;
+var set = new Set;
+map.expando1 = {};
+map.expando2 = {};
+map.aSet = set;
+map.set(1, 2.5)
+map.set("entry", map.expando1);
+map.set(true, set);
+map.set(map.expando2, map);
+set.add(false)
+set.add(map)
+tryPostMessage("map", false, "evalThunk", function (v) {
+ newMap = v
+ doPassFail(newMap.get("entry") === newMap.expando1, "String keyed entry was cloned correctly");
+ doPassFail(newMap.get(newMap.expando2) === newMap, "Object key entry was cloned correctly");
+ shouldBe("newMap.get(true)", "newMap.aSet")
+ shouldBe("newMap.aSet.has(newMap)", "true")
+ newMap.forEach(function (value, key) {
+ console.innerHTML += "LOG: " + value + " => " + key + "<br>"
+ })
+})
+
+if (window.eventSender) {
+ var fileInput = document.getElementById("fileInput");
+ var fileRect = fileInput.getClientRects()[0];
+ var targetX = fileRect.left + fileRect.width / 2;
+ var targetY = fileRect.top + fileRect.height / 2;
+ eventSender.beginDragWithFiles(['resources/file1.txt', 'resources/file2.txt']);
+ eventSender.mouseMoveTo(targetX, targetY);
+ eventSender.mouseUp();
+}
+var imageData = document.createElement("canvas").getContext("2d").createImageData(10,10);
+for (var i = 0; i < imageData.data.length * 4; i++)
+ imageData.data[i] = i % 256;
+var mutatedImageData = document.createElement("canvas").getContext("2d").createImageData(10,10);
+for (var i = 0; i < imageData.data.length * 4; i++)
+ mutatedImageData.data[i] = i % 256;
+tryPostMessage('imageData', false, imageData);
+tryPostMessage('imageData.data', false, imageData.data)
+tryPostMessage('mutatedImageData', false, imageData);
+tryPostMessage('mutatedImageData.data', false, imageData.data)
+for (var i = 0; i < imageData.data.length * 4; i++)
+ mutatedImageData.data[i] = 0;
+
+function thunk(s) {
+ return "(function() {" + s + "})()";
+}
+tryPostMessage(thunk('return 42;'), false, '42');
+tryPostMessage(thunk('return 42;'), false, thunk('return 40 + 2;'));
+tryPostMessage(thunk('return 42;'), false, "evalThunk",
+ function(v) { doPassFail(v == 42, "evalThunk OK"); })
+
+// Only enumerable properties should be serialized.
+tryPostMessage(thunk('var o = {x:"hello"}; Object.defineProperty(o, "y", {value:"goodbye"}); return o;'), false, '({x:"hello"})');
+
+// It's unclear what we should do if an accessor modifies an object out from under us
+// while we're serializing it; the standard does mandate certain aspects about evaluation
+// order, though, including that properties must be processed in their enumeration order.
+tryPostMessage(thunk(
+ 'var a = [0, 1, 2]; ' +
+ 'var b = { get x() { a[0] = 40; a[2] = 42; a.push(43); return 41; }}; ' +
+ 'a[1] = b; ' +
+ 'return a;'
+ ), false, "evalThunk", function(v) {
+ doPassFail(v.length === 3, "length correct"); // undefined
+ doPassFail(v[0] === 0, "evaluation order OK"); // mandatory
+ doPassFail(v[1].x === 41, "evaluation order OK/accessor reached"); // mandatory
+ doPassFail(v[2] === 42, "evaluation order OK"); // mandatory
+ });
+
+tryPostMessage(thunk(
+ 'var a = [0, 1, 2]; ' +
+ 'var b = { get x() { a.pop(); return 41; } }; ' +
+ 'a[1] = b; ' +
+ 'return a;'
+ ), false, "evalThunk", function(v) {
+ doPassFail(v.length === 3 || v.length === 2, "length correct"); // undefined
+ doPassFail(v[0] === 0, "index 0 OK"); // mandatory
+ doPassFail(v[1].x === 41, "accessor reached"); // mandatory
+ doPassFail(v[2] === undefined, "index 2 undefined"); // undefined
+ });
+
+tryPostMessage(thunk(
+ 'var a = [0, 1, 2]; ' +
+ 'var b = { get x() { a.pop(); return 41; } }; ' +
+ 'a[2] = b; ' +
+ 'return a;'
+ ), false, "evalThunk", function(v) {
+ doPassFail(v.length === 3, "length correct"); // undefined
+ doPassFail(v[0] === 0, "index 0 OK"); // mandatory
+ doPassFail(v[1] === 1, "index 1 OK"); // mandatory
+ doPassFail(v[2].x === 41, "index 2 OK"); // undefined
+ });
+
+// Now with objects! This is a little more tricky because the standard does not
+// define an enumeration order.
+tryPostMessage(thunk(
+ 'var a = {p0: 0, p1: 1}; ' +
+ 'Object.defineProperty(a, "p2", {get:function() {delete a.p3; return 42; }, enumerable: true, configurable: true}); ' +
+ 'Object.defineProperty(a, "p3", {get:function() {delete a.p2; return 43; }, enumerable: true, configurable: true}); ' +
+ 'Object.defineProperty(a, "p4", {get:function() { a.p5 = 45; return 44; }, enumerable: true, configurable: true}); ' +
+ 'return a;'
+ ), false, "evalThunk", function(v) {
+ doPassFail(v.p0 === 0 && v.p1 === 1, "basic properties OK"); // mandatory
+ doPassFail(v.p2 === undefined && v.p3 !== undefined ||
+ v.p2 !== undefined && v.p3 === undefined, "one accessor was run"); // mandatory
+ doPassFail(v.p2 !== undefined || Object.getOwnPropertyDescriptor(v, "p2") === undefined, "property was removed"); // undefined
+ doPassFail(v.p3 !== undefined || Object.getOwnPropertyDescriptor(v, "p3") === undefined, "property was removed"); // undefined
+ doPassFail(v.p4 === 44, "accessor was run"); // mandatory
+ doPassFail(Object.getOwnPropertyDescriptor(v, "p5") === undefined, "dynamic property not sent"); // undefined
+ });
+
+// Objects returned from accessors should still be coalesced.
+tryPostMessage(thunk(
+ 'var obja = {get p() { return 42; }}; ' +
+ 'var msg = {get a() { return obja; }, b: obja}; ' +
+ 'return msg;'
+ ), false, "evalThunk", function(v) {
+ // Interestingly, the standard admits two answers here!
+ doPassFail(v.a === v.b, "reference equality preserved");
+ doPassFail((v.b.p === 42 && v.a.p === 42) ||
+ (v.b.p === null && v.a.p === null), "accessors used");
+ });
+tryPostMessage(thunk(
+ 'var obja = {get p() { return 42; }}; ' +
+ 'var msg = {a: obja, get b() { return obja; }}; ' +
+ 'return msg;'
+ ), false, "evalThunk", function(v) {
+ // Interestingly, the standard admits two answers here!
+ doPassFail(v.a === v.b, "reference equality preserved (opposite order)");
+ doPassFail((v.b.p === 42 && v.a.p === 42) ||
+ (v.b.p === null && v.a.p === null), "accessors used (opposite order)");
+ });
+// We should nullify the results from accessors more than one level deep,
+// but leave other fields untouched.
+tryPostMessage(thunk(
+ 'var obja = {get p() { return 42; }, q: 43}; ' +
+ 'return {get a() { return obja; }};'
+ ), false, "evalThunk", function(v) {
+ doPassFail(v.a.p === null, "accessor value was nullified");
+ doPassFail(v.a.q === 43, "non-accessor value was not nullified");
+ });
+tryPostMessage(thunk(
+ 'var objb = {get r() { return 44; }, t: 45}; ' +
+ 'var obja = {get p() { return 42; }, q: 43, s: objb}; ' +
+ 'return {get a() { return obja; }};'
+ ), false, "evalThunk", function(v) {
+ doPassFail(v.a.p === null, "accessor value was nullified");
+ doPassFail(v.a.q === 43, "non-accessor value was not nullified");
+ doPassFail(v.s !== null, "non-accessor value was not nullified");
+ doPassFail(v.a.s.r === null, "accessor value was nullified");
+ doPassFail(v.a.s.t === 45, "non-accessor value was not nullified");
+ });
+tryPostMessage(thunk(
+ 'var objb = {get r() { return 44; }, t: 45}; ' +
+ 'var obja = {get p() { return 42; }, q: 43, s: [objb]}; ' +
+ 'return {get c() { return 47; }, get a() { return obja; }, get b() { return 46; } };'
+ ), false, "evalThunk", function(v) {
+ doPassFail(v.b === 46, "accessor value was not nullified");
+ doPassFail(v.c === 47, "accessor value was not nullified");
+ doPassFail(v.a.p === null, "accessor value was nullified");
+ doPassFail(v.a.q === 43, "non-accessor value was not nullified");
+ doPassFail(v.a.s !== null, "non-accessor value was not nullified");
+ doPassFail(v.a.s !== undefined, "non-accessor value is defined");
+ doPassFail(v.a.s[0] !== null, "non-accessor value was not nullified");
+ doPassFail(v.a.s[0] !== undefined, "non-accessor value is defined");
+ doPassFail(v.a.s[0].r === null, "accessor value was nullified");
+ doPassFail(v.a.s[0].t === 45, "non-accessor value was not nullified");
+ });
+
+// We need to pass out the exception raised from internal accessors.
+tryPostMessage(thunk(
+ 'return {get a() { throw "accessor-exn"; }};'
+ ), true, null, 'accessor-exn');
+// We should still return the exception raised from nulled-out accessors.
+tryPostMessage(thunk(
+ 'var obja = {get p() { throw "accessor-exn"; }}; ' +
+ 'return {get a() { return obja; }};'
+ ), true, null, 'accessor-exn');
+// We should run the first nullified accessor, but no more.
+tryPostMessage(thunk(
+ 'window.bcalled = undefined; ' +
+ 'window.acalled = undefined; ' +
+ 'window.pcalled = undefined; ' +
+ 'var objb = {get b() { window.bcalled = true; return 42; }}; ' +
+ 'var obja = {get a() { window.acalled = true; return objb; }}; ' +
+ 'return { get p() { window.pcalled = true; return obja; }};'
+ ), false, "evalThunk", function(v) {
+ doPassFail(v.p.a === null, "accessor value was nullified");
+ doPassFail(window.pcalled === true, "window.pcalled === true");
+ doPassFail(window.acalled === true, "window.acalled === true");
+ doPassFail(window.bcalled === undefined, "window.bcalled === undefined");
+ });
+
+// Reference equality between Boolean objects must be maintained.
+tryPostMessage(thunk(
+ 'var t1 = new Boolean(true); ' +
+ 'var t2 = new Boolean(true); ' +
+ 'var f1 = new Boolean(false); ' +
+ 'var f2 = new Boolean(false); ' +
+ 'return [t1, t1, t2, f1, f1, f2];'
+ ), false, "evalThunk", function(v) {
+ doPassFail(equal(v[0], new Boolean(true)), "Boolean values correct (0)");
+ doPassFail(equal(v[3], new Boolean(false)), "Boolean values correct (3)");
+ doPassFail(equal(v[1], v[2]), "Boolean values correct (1,2)");
+ doPassFail(equal(v[4], v[5]), "Boolean values correct (4,5)");
+ doPassFail(v[0] === v[1], "References to Booleans correct (0,1)");
+ doPassFail(v[3] === v[4], "References to Booleans correct (3,4)");
+ doPassFail(v[0] !== v[2], "References to Booleans correct (0,2)");
+ doPassFail(v[3] !== v[5], "References to Booleans correct (3,5)");
+ });
+
+// Reference equality between Number objects must be maintained.
+tryPostMessage(thunk(
+ 'var n1 = new Number(42.0); ' +
+ 'var n2 = new Number(42.0); ' +
+ 'return [n1, n1, n2];'
+ ), false, "evalThunk", function(v) {
+ doPassFail(equal(v[0], new Number(42.0)), "Number values correct (0)");
+ doPassFail(equal(v[0], v[2]), "Number values correct (0,2)");
+ doPassFail(v[0] === v[1], "References to numbers correct (0,1)");
+ doPassFail(v[0] !== v[2], "References to numbers correct (0,2)");
+ });
+
+// Reference equality between String objects must be maintained.
+tryPostMessage(thunk(
+ 'var s1 = new String("gnirts"); ' +
+ 'var s2 = new String("gnirts"); ' +
+ 'return [s1, s1, s2];'
+ ), false, "evalThunk", function(v) {
+ doPassFail(equal(v[0], new String("gnirts")), "String values correct (0)");
+ doPassFail(equal(v[0], v[2]), "String values correct (0,2)");
+ doPassFail(v[0] === v[1], "References to strings correct (0,1)");
+ doPassFail(v[0] !== v[2], "References to strings correct (0,2)");
+ });
+
+// Properties added to String, Boolean and Number objects should not be serialized.
+tryPostMessage(thunk(
+ 'var s = new String("gnirts"); ' +
+ 'var n = new Number(42.0); ' +
+ 'var b = new Boolean(true); ' +
+ 's.foo = 1; n.foo = 2; b.foo = 3; ' +
+ 'return [s, n, b];'
+ ), false, "evalThunk", function(v) {
+ doPassFail(v[0].foo == undefined, "String object properties not serialized");
+ doPassFail(v[1].foo == undefined, "Number object properties not serialized");
+ doPassFail(v[2].foo == undefined, "Boolean object properties not serialized");
+ });
+
+// Reference equality between dates must be maintained.
+tryPostMessage(thunk(
+ 'var d1 = new Date(1,2,3); ' +
+ 'var d2 = new Date(1,2,3); ' +
+ 'return [d1,d1,d2];'
+ ), false, "evalThunk", function(v) {
+ doPassFail(equal(v[0], new Date(1,2,3)), "Date values correct (0)");
+ doPassFail(equal(v[0], v[2]), "Date values correct (1)");
+ doPassFail(v[0] === v[1], "References to dates correct (0)");
+ doPassFail(v[0] !== v[2], "References to dates correct (1)");
+ });
+
+// Reference equality between regexps must be preserved.
+tryPostMessage(thunk(
+ 'var rx1 = new RegExp("foo"); ' +
+ 'var rx2 = new RegExp("foo"); ' +
+ 'var rx3 = new RegExp("foo", "gim"); ' +
+ 'rx3.exec("foofoofoo"); ' +
+ 'doPassFail(rx3.lastIndex === 3, "lastIndex initially correct: was " + rx3.lastIndex); ' +
+ 'return [rx1,rx1,rx2,rx3];'
+ ), false, "evalThunk", function(v) {
+ doPassFail(v[0].source === "foo", "Regexp value correct (0)");
+ doPassFail(v[0] === v[1], "References to regexps correct (0)");
+ doPassFail(v[0] !== v[2], "References to regexps correct (1)");
+ doPassFail(v[0].global === false, "global set (0)");
+ doPassFail(v[3].global === true, "global set (1)");
+ doPassFail(v[0].ignoreCase === false, "ignoreCase set (0)");
+ doPassFail(v[3].ignoreCase === true, "ignoreCase set (1)");
+ doPassFail(v[0].multiline === false, "multiline set (0)");
+ doPassFail(v[3].multiline === true, "multiline set (1)");
+ doPassFail(v[0].lastIndex === 0, "lastIndex correct (0)");
+ doPassFail(v[3].lastIndex === 0, "lastIndex correct (1)");
+ });
+
+if (window.eventSender) {
+ tryPostMessage(thunk(
+ 'window.fileList = fileInput.files; ' +
+ 'window.file0 = fileList[0]; ' +
+ 'window.file1 = fileList[1]; ' +
+ 'return window.fileList.length'), false, 2);
+ doPassFail(window.fileList[0] === window.file0, "sanity on file reference equality")
+ // The standard mandates that we do _not_ maintain reference equality for files in a transferred FileList.
+ tryPostMessage(thunk('return [window.file0, window.file0];'
+ ), false, "evalThunk", function(v) { doPassFail(v[0] === v[1], "file references transfer")});
+ tryPostMessage(thunk('return [window.fileList, window.file0];'
+ ), false, "evalThunk", function(v) { doPassFail(v[0][0] !== v[1], "FileList should not respect reference equality")});
+ tryPostMessage(thunk('return [window.file0, window.fileList];'
+ ), false, "evalThunk", function(v) { doPassFail(v[1][0] !== v[0], "FileList should not respect reference equality")});
+ tryPostMessage(thunk('return [window.fileList, window.fileList];'
+ ), false, "evalThunk", function(v) { doPassFail(v[0] === v[1], "FileList respects self-reference equality")});
+ tryPostMessage(thunk('return [window.fileList, window.file0, window.file1]'
+ ), false, "evalThunk", function(v) {
+ doPassFail(v[0].length === window.fileList.length, "FileList length sent correctly");
+ doPassFail(v[0][0] !== v[1], "FileList should not respect reference equality (0)");
+ doPassFail(v[0][1] !== v[2], "FileList should not respect reference equality (1)");
+ doPassFail(v[0][0].name == window.file0.name, "FileList preserves order and data (name0)");
+ doPassFail(v[0][1].name == window.file1.name, "FileList preserves order and data (name1)");
+ doPassFail(equal(v[0][0].lastModifiedDate, window.file0.lastModifiedDate), "FileList preserves order and data (date0)");
+ doPassFail(equal(v[0][1].lastModifiedDate, window.file1.lastModifiedDate), "FileList preserves order and data (date1)");
+ });
+}
+tryPostMessage('"done"');
+</script>
</body>
</html>
Modified: trunk/LayoutTests/fast/table/min-width-css-block-table.html (217465 => 217466)
--- trunk/LayoutTests/fast/table/min-width-css-block-table.html 2017-05-26 02:04:21 UTC (rev 217465)
+++ trunk/LayoutTests/fast/table/min-width-css-block-table.html 2017-05-26 02:10:33 UTC (rev 217466)
@@ -3,10 +3,19 @@
<head>
<link href="" rel="stylesheet" type="text/css">
<script src=""
- <script src=""
+ <script src=""
</head>
<body>
- <script src=""
+ <script>
+ description("This test checks that the min-width style is applied to block CSS tables.");
+
+ function computeLogicalWidth(writingMode, direction, tableStyle)
+ {
+ return computeLogicalWidthHelper("css", "block", writingMode, direction, tableStyle);
+ }
+
+ runTests("css");
+ </script>
<script src=""
</body>
</html>
Modified: trunk/LayoutTests/fast/table/min-width-css-inline-table.html (217465 => 217466)
--- trunk/LayoutTests/fast/table/min-width-css-inline-table.html 2017-05-26 02:04:21 UTC (rev 217465)
+++ trunk/LayoutTests/fast/table/min-width-css-inline-table.html 2017-05-26 02:10:33 UTC (rev 217466)
@@ -3,10 +3,19 @@
<head>
<link href="" rel="stylesheet" type="text/css">
<script src=""
- <script src=""
+ <script src=""
</head>
<body>
- <script src=""
+ <script>
+ description("This test checks that the min-width style is applied to inline CSS tables.");
+
+ function computeLogicalWidth(writingMode, direction, tableStyle)
+ {
+ return computeLogicalWidthHelper("css", "inline", writingMode, direction, tableStyle);
+ }
+
+ runTests("css");
+ </script>
<script src=""
</body>
</html>
Modified: trunk/LayoutTests/fast/table/min-width-html-block-table.html (217465 => 217466)
--- trunk/LayoutTests/fast/table/min-width-html-block-table.html 2017-05-26 02:04:21 UTC (rev 217465)
+++ trunk/LayoutTests/fast/table/min-width-html-block-table.html 2017-05-26 02:10:33 UTC (rev 217466)
@@ -3,10 +3,19 @@
<head>
<link href="" rel="stylesheet" type="text/css">
<script src=""
- <script src=""
+ <script src=""
</head>
<body>
- <script src=""
+ <script>
+ description("This test checks that the min-width style is applied to block HTML tables.");
+
+ function computeLogicalWidth(writingMode, direction, tableStyle)
+ {
+ return computeLogicalWidthHelper("html", "block", writingMode, direction, tableStyle);
+ }
+
+ runTests("html");
+ </script>
<script src=""
</body>
</html>
Modified: trunk/LayoutTests/fast/table/min-width-html-inline-table.html (217465 => 217466)
--- trunk/LayoutTests/fast/table/min-width-html-inline-table.html 2017-05-26 02:04:21 UTC (rev 217465)
+++ trunk/LayoutTests/fast/table/min-width-html-inline-table.html 2017-05-26 02:10:33 UTC (rev 217466)
@@ -3,10 +3,19 @@
<head>
<link href="" rel="stylesheet" type="text/css">
<script src=""
- <script src=""
+ <script src=""
</head>
<body>
- <script src=""
+ <script>
+ description("This test checks that the min-width style is applied to inline HTML tables.");
+
+ function computeLogicalWidth(writingMode, direction, tableStyle)
+ {
+ return computeLogicalWidthHelper("html", "inline", writingMode, direction, tableStyle);
+ }
+
+ runTests("html");
+ </script>
<script src=""
</body>
</html>
Copied: trunk/LayoutTests/fast/table/resources/min-width-helpers.js (from rev 217463, trunk/LayoutTests/fast/table/script-tests/min-width-helpers.js) (0 => 217466)
--- trunk/LayoutTests/fast/table/resources/min-width-helpers.js (rev 0)
+++ trunk/LayoutTests/fast/table/resources/min-width-helpers.js 2017-05-26 02:10:33 UTC (rev 217466)
@@ -0,0 +1,145 @@
+var testNotes = "======== General notes ========\n\
+\n\
+The stylesheet used to style the table in each test is available at: <a href=""
+\n\
+Most importantly, note that each table has:\n\
+- minimum intrinsic width and height both equal to 100px based on the table content\n\
+- maximum intrinsic width and height both equal to 250px based on the table content\n\
+- borders and paddings that add up to 30px in both the horizontal and vertical directions\n\
+- a parent whose dimensions are 1000px by 1000px\n\
+\n\
+The function signature of computeLogicalWidth is:\n\
+function computeLogicalWidth(writingMode, direction, tableStyle)\n";
+
+/* All tables will be generated to have the following intrinsic widths. */
+var minIntrinsicLogicalWidth = 100;
+var maxIntrinsicLogicalWidth = 250;
+
+/* Tests will cover all permutations of the follow properties and settings. */
+var tableTypes = ["html", "css"];
+var displays = ["block", "inline"]
+var writingModes = ["horizontal", "vertical"];
+var directions = ["ltr", "rtl"];
+var logicalWidthsCombinations = [
+ /* fixed min-width, auto width */
+ {"min-width": "500px", "width": null, "computed-width": {"css": "500px", "html": "470px"}},
+ {"min-width": "150px", "width": null, "computed-width": {"css": "250px", "html": "250px"}},
+ {"min-width": "50px", "width": null, "computed-width": {"css": "250px", "html": "250px"}},
+ /* fixed min-width, fixed width */
+ {"min-width": "500px", "width": "600px", "computed-width": {"css": "600px", "html": "570px"}},
+ {"min-width": "500px", "width": "400px", "computed-width": {"css": "500px", "html": "470px"}},
+ /* fixed min-width, percent width */
+ {"min-width": "500px", "width": "60%", "computed-width": {"css": "600px", "html": "570px"}},
+ {"min-width": "500px", "width": "40%", "computed-width": {"css": "500px", "html": "470px"}},
+ /* percent min-width, auto width */
+ {"min-width": "50%", "width": null, "computed-width": {"css": "500px", "html": "470px"}},
+ {"min-width": "15%", "width": null, "computed-width": {"css": "250px", "html": "250px"}},
+ {"min-width": "5%", "width": null, "computed-width": {"css": "250px", "html": "250px"}},
+ /* percent min-width, fixed width */
+ {"min-width": "50%", "width": "600px", "computed-width": {"css": "600px", "html": "570px"}},
+ {"min-width": "50%", "width": "400px", "computed-width": {"css": "500px", "html": "470px"}},
+ /* percent min-width, percent width */
+ {"min-width": "50%", "width": "60%", "computed-width": {"css": "600px", "html": "570px"}},
+ {"min-width": "50%", "width": "40%", "computed-width": {"css": "500px", "html": "470px"}},
+ /* auto min-width (shouldn't affect anything), auto width */
+ {"min-width": "auto", "width": null, "computed-width": {"css": "250px", "html": "250px"}},
+];
+
+function runTests(tableType)
+{
+ debug(testNotes);
+
+ writingModes.forEach(function(writingMode) {
+ debug("======== Test " + writingMode + " writing mode ========\n");
+
+ directions.forEach(function(direction) {
+ debug("==== Test " + direction + " direction ====\n");
+
+ logicalWidthsCombinations.forEach(function(logicalWidthsCombination) {
+ var tableStyle = createTableStyle(writingMode, logicalWidthsCombination);
+ shouldEvaluateTo("computeLogicalWidth('" + writingMode + "', '" + direction + "', '" + tableStyle + "')", "'" + logicalWidthsCombination["computed-width"][tableType] + "'");
+ });
+
+ debug("");
+ });
+ });
+}
+
+function createTableStyle(writingMode, logicalWidthsCombination)
+{
+ var widthStyle = "";
+
+ var logicalWidthName = (writingMode == "vertical" ? "height" : "width");
+
+ if (logicalWidthsCombination["width"] != null)
+ widthStyle += logicalWidthName + ": " + logicalWidthsCombination["width"] + "; ";
+
+ if (logicalWidthsCombination["min-width"] != null)
+ widthStyle += "min-" + logicalWidthName + ": " + logicalWidthsCombination["min-width"] + ";";
+
+ return widthStyle;
+}
+
+function parsePixelValue(str)
+{
+ if (typeof str != "string" || str.length < 3 || str.substr(str.length - 2) != "px") {
+ testFailed(str + " is unparsable.");
+ return -1;
+ }
+ return parseFloat(str);
+}
+
+function computeLogicalWidthHelper(tableType, display, writingMode, direction, tableStyle)
+{
+ var isCSSTable = (tableType == "css");
+ var tableClass = display + " " + writingMode + " " + direction;
+
+ var tableParent = document.createElement("div");
+ tableParent.setAttribute("class", "table-parent");
+ document.body.appendChild(tableParent);
+
+ var table = document.createElement(isCSSTable ? "div" : "table");
+ table.setAttribute("class", tableClass);
+ table.setAttribute("style", tableStyle);
+ tableParent.appendChild(table);
+
+ var rowGroup = document.createElement(isCSSTable ? "div" : "tbody");
+ rowGroup.setAttribute("class", "row-group");
+ table.appendChild(rowGroup);
+
+ var row = document.createElement(isCSSTable ? "div" : "tr");
+ row.setAttribute("class", "row");
+ rowGroup.appendChild(row);
+
+ var cell = document.createElement(isCSSTable ? "div" : "td");
+ cell.setAttribute("class", "cell");
+ row.appendChild(cell);
+
+ // Create as many spans of width equal to minIntrinsicLogicalWidth without exceeding maxIntrinsicLogicalWidth.
+ var remainingLogicalWidth;
+ for (remainingLogicalWidth = maxIntrinsicLogicalWidth; remainingLogicalWidth >= minIntrinsicLogicalWidth; remainingLogicalWidth -= minIntrinsicLogicalWidth) {
+ span = createSpan(minIntrinsicLogicalWidth);
+ cell.appendChild(span);
+ }
+
+ // Create a span of width < minIntrinsicLogicalWidth for any remaining width.
+ if (remainingLogicalWidth > 0) {
+ span = createSpan(remainingLogicalWidth);
+ cell.appendChild(span);
+ }
+
+ var logicalWidthPropertyName = (writingMode == "vertical" ? "height" : "width");
+ var computedLogicalWidth = window.getComputedStyle(table, null).getPropertyValue(logicalWidthPropertyName);
+ computedLogicalWidth = Math.round(parsePixelValue(computedLogicalWidth)) + "px";
+
+ document.body.removeChild(tableParent);
+
+ return computedLogicalWidth;
+}
+
+function createSpan(logicalWidth)
+{
+ var span = document.createElement("span");
+ span.setAttribute("style", "display: inline-block; width: " + logicalWidth + "px; height: " + logicalWidth + "px; background-color: #f00;");
+ return span;
+}
Modified: trunk/LayoutTests/printing/break-after-avoid-expected.txt (217465 => 217466)
--- trunk/LayoutTests/printing/break-after-avoid-expected.txt 2017-05-26 02:04:21 UTC (rev 217465)
+++ trunk/LayoutTests/printing/break-after-avoid-expected.txt 2017-05-26 02:10:33 UTC (rev 217466)
@@ -1,4 +1,4 @@
-Test for page-break-after:avoid
+Test for break-after:avoid
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
Modified: trunk/LayoutTests/printing/break-after-avoid-page-expected.txt (217465 => 217466)
--- trunk/LayoutTests/printing/break-after-avoid-page-expected.txt 2017-05-26 02:04:21 UTC (rev 217465)
+++ trunk/LayoutTests/printing/break-after-avoid-page-expected.txt 2017-05-26 02:10:33 UTC (rev 217466)
@@ -1,4 +1,4 @@
-Test for page-break-after:avoid
+Test for break-after:avoid-page
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
Modified: trunk/LayoutTests/printing/break-after-avoid-page.html (217465 => 217466)
--- trunk/LayoutTests/printing/break-after-avoid-page.html 2017-05-26 02:04:21 UTC (rev 217465)
+++ trunk/LayoutTests/printing/break-after-avoid-page.html 2017-05-26 02:10:33 UTC (rev 217466)
@@ -8,7 +8,51 @@
<p id="description"></p>
<div id="console"></div>
<div id="sandbox"></div>
-<script src=""
+<script>
+description("Test for break-after:avoid-page");
+
+function test()
+{
+ createBlockWithRatioToPageHeight("page1", 0.5).style.breakBefore = "page";
+ // A block 'page2-1' must move to the next page because it has 'page-break-after:avoid'
+ // and both 'page2-1' and 'page2-2' cannot be placed in the current page at the same time.
+ createBlockWithRatioToPageHeight("page2-1", 0.3).style.breakAfter = "avoid-page";
+ createBlockWithRatioToPageHeight("page2-2", 0.3);
+
+ createBlockWithRatioToPageHeight("page3-1", 0.5).style.breakBefore = "page";
+ // A page break can occur inside of 'page3-3' block because it has child elements.
+ createBlockWithRatioToPageHeight("page3-2", 0.3).style.breakAfter = "avoid-page";
+ createBlockWithNumberOfLines("page3-3", 10);
+
+ createBlockWithRatioToPageHeight("page5", 0.5).style.breakBefore = "page";
+ // It seems unrealistic, but block 'page6-1' must move to the next page.
+ createBlockWithRatioToPageHeight("page6-1", 0.1).style.breakAfter = "avoid-page";
+ createBlockWithRatioToPageHeight("page6-2", 0.1).style.breakAfter = "avoid-page";
+ createBlockWithRatioToPageHeight("page6-3", 0.1).style.breakAfter = "avoid-page";
+ createBlockWithRatioToPageHeight("page6-4", 0.1).style.breakAfter = "avoid-page";
+ createBlockWithRatioToPageHeight("page6-5", 0.1).style.breakAfter = "avoid-page";
+ createBlockWithRatioToPageHeight("page6-6", 0.1).style.breakAfter = "avoid-page";
+ createBlockWithRatioToPageHeight("page6-7", 0.1);
+
+
+ pageNumberForElementShouldBe("page1", 1);
+ pageNumberForElementShouldBe("page2-1", 2);
+ pageNumberForElementShouldBe("page2-2", 2);
+
+ pageNumberForElementShouldBe("page3-1", 3);
+ pageNumberForElementShouldBe("page3-2", 3);
+ pageNumberForElementShouldBe("page3-3", 3);
+
+ pageNumberForElementShouldBe("page5", 5);
+ pageNumberForElementShouldBe("page6-1", 6);
+ // Omit tests for intermediate blocks.
+ pageNumberForElementShouldBe("page6-7", 6);
+
+ document.body.removeChild(document.getElementById("sandbox"));
+}
+
+var successfullyParsed = true;
+</script>
<script>runPrintingTest(test);</script>
<script src=""
</body>
Modified: trunk/LayoutTests/printing/break-after-avoid.html (217465 => 217466)
--- trunk/LayoutTests/printing/break-after-avoid.html 2017-05-26 02:04:21 UTC (rev 217465)
+++ trunk/LayoutTests/printing/break-after-avoid.html 2017-05-26 02:10:33 UTC (rev 217466)
@@ -8,7 +8,51 @@
<p id="description"></p>
<div id="console"></div>
<div id="sandbox"></div>
-<script src=""
+<script>
+description("Test for break-after:avoid");
+
+function test()
+{
+ createBlockWithRatioToPageHeight("page1", 0.5).style.breakBefore = "page";
+ // A block 'page2-1' must move to the next page because it has 'page-break-after:avoid'
+ // and both 'page2-1' and 'page2-2' cannot be placed in the current page at the same time.
+ createBlockWithRatioToPageHeight("page2-1", 0.3).style.breakAfter = "avoid";
+ createBlockWithRatioToPageHeight("page2-2", 0.3);
+
+ createBlockWithRatioToPageHeight("page3-1", 0.5).style.breakBefore = "page";
+ // A page break can occur inside of 'page3-3' block because it has child elements.
+ createBlockWithRatioToPageHeight("page3-2", 0.3).style.breakAfter = "avoid";
+ createBlockWithNumberOfLines("page3-3", 10);
+
+ createBlockWithRatioToPageHeight("page5", 0.5).style.breakBefore = "page";
+ // It seems unrealistic, but block 'page6-1' must move to the next page.
+ createBlockWithRatioToPageHeight("page6-1", 0.1).style.breakAfter = "avoid";
+ createBlockWithRatioToPageHeight("page6-2", 0.1).style.breakAfter = "avoid";
+ createBlockWithRatioToPageHeight("page6-3", 0.1).style.breakAfter = "avoid";
+ createBlockWithRatioToPageHeight("page6-4", 0.1).style.breakAfter = "avoid";
+ createBlockWithRatioToPageHeight("page6-5", 0.1).style.breakAfter = "avoid";
+ createBlockWithRatioToPageHeight("page6-6", 0.1).style.breakAfter = "avoid";
+ createBlockWithRatioToPageHeight("page6-7", 0.1);
+
+
+ pageNumberForElementShouldBe("page1", 1);
+ pageNumberForElementShouldBe("page2-1", 2);
+ pageNumberForElementShouldBe("page2-2", 2);
+
+ pageNumberForElementShouldBe("page3-1", 3);
+ pageNumberForElementShouldBe("page3-2", 3);
+ pageNumberForElementShouldBe("page3-3", 3);
+
+ pageNumberForElementShouldBe("page5", 5);
+ pageNumberForElementShouldBe("page6-1", 6);
+ // Omit tests for intermediate blocks.
+ pageNumberForElementShouldBe("page6-7", 6);
+
+ document.body.removeChild(document.getElementById("sandbox"));
+}
+
+var successfullyParsed = true;
+</script>
<script>runPrintingTest(test);</script>
<script src=""
</body>
Modified: trunk/LayoutTests/svg/dom/SVGAnimatedEnumeration-SVGMaskElement-expected.txt (217465 => 217466)
--- trunk/LayoutTests/svg/dom/SVGAnimatedEnumeration-SVGMaskElement-expected.txt 2017-05-26 02:04:21 UTC (rev 217465)
+++ trunk/LayoutTests/svg/dom/SVGAnimatedEnumeration-SVGMaskElement-expected.txt 2017-05-26 02:10:33 UTC (rev 217466)
@@ -1,60 +1,60 @@
-This test checks the use of SVGAnimatedEnumeration within SVGPatternElement
+This test checks the use of SVGAnimatedEnumeration within SVGMaskElement
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-Check initial 'patternUnits' value
-PASS patternElement.patternUnits.toString() is "[object SVGAnimatedEnumeration]"
-PASS typeof(patternElement.patternUnits.baseVal) is "number"
-PASS patternElement.patternUnits.baseVal is SVGUnitTypes.SVG_UNIT_TYPE_USERSPACEONUSE
+Check initial 'maskUnits' value
+PASS maskElement.maskUnits.toString() is "[object SVGAnimatedEnumeration]"
+PASS typeof(maskElement.maskUnits.baseVal) is "number"
+PASS maskElement.maskUnits.baseVal is SVGUnitTypes.SVG_UNIT_TYPE_USERSPACEONUSE
Switch to 'objectBoundingBox'
-PASS patternElement.patternUnits.baseVal = SVGUnitTypes.SVG_UNIT_TYPE_OBJECTBOUNDINGBOX is SVGUnitTypes.SVG_UNIT_TYPE_OBJECTBOUNDINGBOX
-PASS patternElement.patternUnits.baseVal is SVGUnitTypes.SVG_UNIT_TYPE_OBJECTBOUNDINGBOX
-PASS patternElement.getAttribute('patternUnits') is "objectBoundingBox"
+PASS maskElement.maskUnits.baseVal = SVGUnitTypes.SVG_UNIT_TYPE_OBJECTBOUNDINGBOX is SVGUnitTypes.SVG_UNIT_TYPE_OBJECTBOUNDINGBOX
+PASS maskElement.maskUnits.baseVal is SVGUnitTypes.SVG_UNIT_TYPE_OBJECTBOUNDINGBOX
+PASS maskElement.getAttribute('maskUnits') is "objectBoundingBox"
Try setting invalid values
-PASS patternElement.patternUnits.baseVal = 3 threw exception SVG_INVALID_VALUE_ERR (DOM SVG Exception 1): An invalid value was passed to an operation or assigned to an attribute..
-PASS patternElement.patternUnits.baseVal is SVGUnitTypes.SVG_UNIT_TYPE_OBJECTBOUNDINGBOX
-PASS patternElement.getAttribute('patternUnits') is "objectBoundingBox"
-PASS patternElement.patternUnits.baseVal = -1 threw exception SVG_INVALID_VALUE_ERR (DOM SVG Exception 1): An invalid value was passed to an operation or assigned to an attribute..
-PASS patternElement.patternUnits.baseVal is SVGUnitTypes.SVG_UNIT_TYPE_OBJECTBOUNDINGBOX
-PASS patternElement.getAttribute('patternUnits') is "objectBoundingBox"
-PASS patternElement.patternUnits.baseVal = 0 threw exception SVG_INVALID_VALUE_ERR (DOM SVG Exception 1): An invalid value was passed to an operation or assigned to an attribute..
-PASS patternElement.patternUnits.baseVal is SVGUnitTypes.SVG_UNIT_TYPE_OBJECTBOUNDINGBOX
-PASS patternElement.getAttribute('patternUnits') is "objectBoundingBox"
+PASS maskElement.maskUnits.baseVal = 3 threw exception SVG_INVALID_VALUE_ERR (DOM SVG Exception 1): An invalid value was passed to an operation or assigned to an attribute..
+PASS maskElement.maskUnits.baseVal is SVGUnitTypes.SVG_UNIT_TYPE_OBJECTBOUNDINGBOX
+PASS maskElement.getAttribute('maskUnits') is "objectBoundingBox"
+PASS maskElement.maskUnits.baseVal = -1 threw exception SVG_INVALID_VALUE_ERR (DOM SVG Exception 1): An invalid value was passed to an operation or assigned to an attribute..
+PASS maskElement.maskUnits.baseVal is SVGUnitTypes.SVG_UNIT_TYPE_OBJECTBOUNDINGBOX
+PASS maskElement.getAttribute('maskUnits') is "objectBoundingBox"
+PASS maskElement.maskUnits.baseVal = 0 threw exception SVG_INVALID_VALUE_ERR (DOM SVG Exception 1): An invalid value was passed to an operation or assigned to an attribute..
+PASS maskElement.maskUnits.baseVal is SVGUnitTypes.SVG_UNIT_TYPE_OBJECTBOUNDINGBOX
+PASS maskElement.getAttribute('maskUnits') is "objectBoundingBox"
Switch to 'userSpaceOnUse'
-PASS patternElement.patternUnits.baseVal = SVGUnitTypes.SVG_UNIT_TYPE_USERSPACEONUSE is SVGUnitTypes.SVG_UNIT_TYPE_USERSPACEONUSE
-PASS patternElement.patternUnits.baseVal is SVGUnitTypes.SVG_UNIT_TYPE_USERSPACEONUSE
-PASS patternElement.getAttribute('patternUnits') is "userSpaceOnUse"
+PASS maskElement.maskUnits.baseVal = SVGUnitTypes.SVG_UNIT_TYPE_USERSPACEONUSE is SVGUnitTypes.SVG_UNIT_TYPE_USERSPACEONUSE
+PASS maskElement.maskUnits.baseVal is SVGUnitTypes.SVG_UNIT_TYPE_USERSPACEONUSE
+PASS maskElement.getAttribute('maskUnits') is "userSpaceOnUse"
-Check initial 'patternContentUnits' value
-PASS patternElement.patternContentUnits.toString() is "[object SVGAnimatedEnumeration]"
-PASS typeof(patternElement.patternContentUnits.baseVal) is "number"
-PASS patternElement.patternContentUnits.baseVal is SVGUnitTypes.SVG_UNIT_TYPE_USERSPACEONUSE
+Check initial 'maskContentUnits' value
+PASS maskElement.maskContentUnits.toString() is "[object SVGAnimatedEnumeration]"
+PASS typeof(maskElement.maskContentUnits.baseVal) is "number"
+PASS maskElement.maskContentUnits.baseVal is SVGUnitTypes.SVG_UNIT_TYPE_USERSPACEONUSE
Switch to 'objectBoundingBox'
-PASS patternElement.patternContentUnits.baseVal = SVGUnitTypes.SVG_UNIT_TYPE_OBJECTBOUNDINGBOX is SVGUnitTypes.SVG_UNIT_TYPE_OBJECTBOUNDINGBOX
-PASS patternElement.patternContentUnits.baseVal is SVGUnitTypes.SVG_UNIT_TYPE_OBJECTBOUNDINGBOX
-PASS patternElement.getAttribute('patternContentUnits') is "objectBoundingBox"
+PASS maskElement.maskContentUnits.baseVal = SVGUnitTypes.SVG_UNIT_TYPE_OBJECTBOUNDINGBOX is SVGUnitTypes.SVG_UNIT_TYPE_OBJECTBOUNDINGBOX
+PASS maskElement.maskContentUnits.baseVal is SVGUnitTypes.SVG_UNIT_TYPE_OBJECTBOUNDINGBOX
+PASS maskElement.getAttribute('maskContentUnits') is "objectBoundingBox"
Try setting invalid values
-PASS patternElement.patternContentUnits.baseVal = 3 threw exception SVG_INVALID_VALUE_ERR (DOM SVG Exception 1): An invalid value was passed to an operation or assigned to an attribute..
-PASS patternElement.patternContentUnits.baseVal is SVGUnitTypes.SVG_UNIT_TYPE_OBJECTBOUNDINGBOX
-PASS patternElement.getAttribute('patternContentUnits') is "objectBoundingBox"
-PASS patternElement.patternContentUnits.baseVal = -1 threw exception SVG_INVALID_VALUE_ERR (DOM SVG Exception 1): An invalid value was passed to an operation or assigned to an attribute..
-PASS patternElement.patternContentUnits.baseVal is SVGUnitTypes.SVG_UNIT_TYPE_OBJECTBOUNDINGBOX
-PASS patternElement.getAttribute('patternContentUnits') is "objectBoundingBox"
-PASS patternElement.patternContentUnits.baseVal = 0 threw exception SVG_INVALID_VALUE_ERR (DOM SVG Exception 1): An invalid value was passed to an operation or assigned to an attribute..
-PASS patternElement.patternContentUnits.baseVal is SVGUnitTypes.SVG_UNIT_TYPE_OBJECTBOUNDINGBOX
-PASS patternElement.getAttribute('patternContentUnits') is "objectBoundingBox"
+PASS maskElement.maskContentUnits.baseVal = 3 threw exception SVG_INVALID_VALUE_ERR (DOM SVG Exception 1): An invalid value was passed to an operation or assigned to an attribute..
+PASS maskElement.maskContentUnits.baseVal is SVGUnitTypes.SVG_UNIT_TYPE_OBJECTBOUNDINGBOX
+PASS maskElement.getAttribute('maskContentUnits') is "objectBoundingBox"
+PASS maskElement.maskContentUnits.baseVal = -1 threw exception SVG_INVALID_VALUE_ERR (DOM SVG Exception 1): An invalid value was passed to an operation or assigned to an attribute..
+PASS maskElement.maskContentUnits.baseVal is SVGUnitTypes.SVG_UNIT_TYPE_OBJECTBOUNDINGBOX
+PASS maskElement.getAttribute('maskContentUnits') is "objectBoundingBox"
+PASS maskElement.maskContentUnits.baseVal = 0 threw exception SVG_INVALID_VALUE_ERR (DOM SVG Exception 1): An invalid value was passed to an operation or assigned to an attribute..
+PASS maskElement.maskContentUnits.baseVal is SVGUnitTypes.SVG_UNIT_TYPE_OBJECTBOUNDINGBOX
+PASS maskElement.getAttribute('maskContentUnits') is "objectBoundingBox"
Switch to 'userSpaceOnUse'
-PASS patternElement.patternContentUnits.baseVal = SVGUnitTypes.SVG_UNIT_TYPE_USERSPACEONUSE is SVGUnitTypes.SVG_UNIT_TYPE_USERSPACEONUSE
-PASS patternElement.patternContentUnits.baseVal is SVGUnitTypes.SVG_UNIT_TYPE_USERSPACEONUSE
-PASS patternElement.getAttribute('patternContentUnits') is "userSpaceOnUse"
+PASS maskElement.maskContentUnits.baseVal = SVGUnitTypes.SVG_UNIT_TYPE_USERSPACEONUSE is SVGUnitTypes.SVG_UNIT_TYPE_USERSPACEONUSE
+PASS maskElement.maskContentUnits.baseVal is SVGUnitTypes.SVG_UNIT_TYPE_USERSPACEONUSE
+PASS maskElement.getAttribute('maskContentUnits') is "userSpaceOnUse"
PASS successfullyParsed is true
TEST COMPLETE
Modified: trunk/LayoutTests/svg/dom/SVGAnimatedEnumeration-SVGMaskElement.html (217465 => 217466)
--- trunk/LayoutTests/svg/dom/SVGAnimatedEnumeration-SVGMaskElement.html 2017-05-26 02:04:21 UTC (rev 217465)
+++ trunk/LayoutTests/svg/dom/SVGAnimatedEnumeration-SVGMaskElement.html 2017-05-26 02:10:33 UTC (rev 217466)
@@ -6,7 +6,81 @@
<body>
<p id="description"></p>
<div id="console"></div>
-<script src=""
+<script>
+description("This test checks the use of SVGAnimatedEnumeration within SVGMaskElement");
+
+var maskElement = document.createElementNS("http://www.w3.org/2000/svg", "mask");
+maskElement.setAttribute("maskUnits", "userSpaceOnUse");
+maskElement.setAttribute("maskContentUnits", "userSpaceOnUse");
+
+// maskUnits
+debug("");
+debug("Check initial 'maskUnits' value");
+shouldBeEqualToString("maskElement.maskUnits.toString()", "[object SVGAnimatedEnumeration]");
+shouldBeEqualToString("typeof(maskElement.maskUnits.baseVal)", "number");
+shouldBe("maskElement.maskUnits.baseVal", "SVGUnitTypes.SVG_UNIT_TYPE_USERSPACEONUSE");
+
+debug("");
+debug("Switch to 'objectBoundingBox'");
+shouldBe("maskElement.maskUnits.baseVal = SVGUnitTypes.SVG_UNIT_TYPE_OBJECTBOUNDINGBOX", "SVGUnitTypes.SVG_UNIT_TYPE_OBJECTBOUNDINGBOX");
+shouldBe("maskElement.maskUnits.baseVal", "SVGUnitTypes.SVG_UNIT_TYPE_OBJECTBOUNDINGBOX");
+shouldBeEqualToString("maskElement.getAttribute('maskUnits')", "objectBoundingBox");
+
+debug("");
+debug("Try setting invalid values");
+shouldThrow("maskElement.maskUnits.baseVal = 3");
+shouldBe("maskElement.maskUnits.baseVal", "SVGUnitTypes.SVG_UNIT_TYPE_OBJECTBOUNDINGBOX");
+shouldBeEqualToString("maskElement.getAttribute('maskUnits')", "objectBoundingBox");
+
+shouldThrow("maskElement.maskUnits.baseVal = -1");
+shouldBe("maskElement.maskUnits.baseVal", "SVGUnitTypes.SVG_UNIT_TYPE_OBJECTBOUNDINGBOX");
+shouldBeEqualToString("maskElement.getAttribute('maskUnits')", "objectBoundingBox");
+
+shouldThrow("maskElement.maskUnits.baseVal = 0");
+shouldBe("maskElement.maskUnits.baseVal", "SVGUnitTypes.SVG_UNIT_TYPE_OBJECTBOUNDINGBOX");
+shouldBeEqualToString("maskElement.getAttribute('maskUnits')", "objectBoundingBox");
+
+debug("");
+debug("Switch to 'userSpaceOnUse'");
+shouldBe("maskElement.maskUnits.baseVal = SVGUnitTypes.SVG_UNIT_TYPE_USERSPACEONUSE", "SVGUnitTypes.SVG_UNIT_TYPE_USERSPACEONUSE");
+shouldBe("maskElement.maskUnits.baseVal", "SVGUnitTypes.SVG_UNIT_TYPE_USERSPACEONUSE");
+shouldBeEqualToString("maskElement.getAttribute('maskUnits')", "userSpaceOnUse");
+
+// maskContentUnits
+debug("");
+debug("Check initial 'maskContentUnits' value");
+shouldBeEqualToString("maskElement.maskContentUnits.toString()", "[object SVGAnimatedEnumeration]");
+shouldBeEqualToString("typeof(maskElement.maskContentUnits.baseVal)", "number");
+shouldBe("maskElement.maskContentUnits.baseVal", "SVGUnitTypes.SVG_UNIT_TYPE_USERSPACEONUSE");
+
+debug("");
+debug("Switch to 'objectBoundingBox'");
+shouldBe("maskElement.maskContentUnits.baseVal = SVGUnitTypes.SVG_UNIT_TYPE_OBJECTBOUNDINGBOX", "SVGUnitTypes.SVG_UNIT_TYPE_OBJECTBOUNDINGBOX");
+shouldBe("maskElement.maskContentUnits.baseVal", "SVGUnitTypes.SVG_UNIT_TYPE_OBJECTBOUNDINGBOX");
+shouldBeEqualToString("maskElement.getAttribute('maskContentUnits')", "objectBoundingBox");
+
+debug("");
+debug("Try setting invalid values");
+shouldThrow("maskElement.maskContentUnits.baseVal = 3");
+shouldBe("maskElement.maskContentUnits.baseVal", "SVGUnitTypes.SVG_UNIT_TYPE_OBJECTBOUNDINGBOX");
+shouldBeEqualToString("maskElement.getAttribute('maskContentUnits')", "objectBoundingBox");
+
+shouldThrow("maskElement.maskContentUnits.baseVal = -1");
+shouldBe("maskElement.maskContentUnits.baseVal", "SVGUnitTypes.SVG_UNIT_TYPE_OBJECTBOUNDINGBOX");
+shouldBeEqualToString("maskElement.getAttribute('maskContentUnits')", "objectBoundingBox");
+
+shouldThrow("maskElement.maskContentUnits.baseVal = 0");
+shouldBe("maskElement.maskContentUnits.baseVal", "SVGUnitTypes.SVG_UNIT_TYPE_OBJECTBOUNDINGBOX");
+shouldBeEqualToString("maskElement.getAttribute('maskContentUnits')", "objectBoundingBox");
+
+debug("");
+debug("Switch to 'userSpaceOnUse'");
+shouldBe("maskElement.maskContentUnits.baseVal = SVGUnitTypes.SVG_UNIT_TYPE_USERSPACEONUSE", "SVGUnitTypes.SVG_UNIT_TYPE_USERSPACEONUSE");
+shouldBe("maskElement.maskContentUnits.baseVal", "SVGUnitTypes.SVG_UNIT_TYPE_USERSPACEONUSE");
+shouldBeEqualToString("maskElement.getAttribute('maskContentUnits')", "userSpaceOnUse");
+
+successfullyParsed = true;
+</script>
<script src=""
</body>
</html>
Modified: trunk/LayoutTests/svg/dom/SVGAnimatedEnumeration-SVGPatternElement-expected.txt (217465 => 217466)
--- trunk/LayoutTests/svg/dom/SVGAnimatedEnumeration-SVGPatternElement-expected.txt 2017-05-26 02:04:21 UTC (rev 217465)
+++ trunk/LayoutTests/svg/dom/SVGAnimatedEnumeration-SVGPatternElement-expected.txt 2017-05-26 02:10:33 UTC (rev 217466)
@@ -1,60 +1,60 @@
-This test checks the use of SVGAnimatedEnumeration within SVGMaskElement
+This test checks the use of SVGAnimatedEnumeration within SVGPatternElement
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-Check initial 'maskUnits' value
-PASS maskElement.maskUnits.toString() is "[object SVGAnimatedEnumeration]"
-PASS typeof(maskElement.maskUnits.baseVal) is "number"
-PASS maskElement.maskUnits.baseVal is SVGUnitTypes.SVG_UNIT_TYPE_USERSPACEONUSE
+Check initial 'patternUnits' value
+PASS patternElement.patternUnits.toString() is "[object SVGAnimatedEnumeration]"
+PASS typeof(patternElement.patternUnits.baseVal) is "number"
+PASS patternElement.patternUnits.baseVal is SVGUnitTypes.SVG_UNIT_TYPE_USERSPACEONUSE
Switch to 'objectBoundingBox'
-PASS maskElement.maskUnits.baseVal = SVGUnitTypes.SVG_UNIT_TYPE_OBJECTBOUNDINGBOX is SVGUnitTypes.SVG_UNIT_TYPE_OBJECTBOUNDINGBOX
-PASS maskElement.maskUnits.baseVal is SVGUnitTypes.SVG_UNIT_TYPE_OBJECTBOUNDINGBOX
-PASS maskElement.getAttribute('maskUnits') is "objectBoundingBox"
+PASS patternElement.patternUnits.baseVal = SVGUnitTypes.SVG_UNIT_TYPE_OBJECTBOUNDINGBOX is SVGUnitTypes.SVG_UNIT_TYPE_OBJECTBOUNDINGBOX
+PASS patternElement.patternUnits.baseVal is SVGUnitTypes.SVG_UNIT_TYPE_OBJECTBOUNDINGBOX
+PASS patternElement.getAttribute('patternUnits') is "objectBoundingBox"
Try setting invalid values
-PASS maskElement.maskUnits.baseVal = 3 threw exception SVG_INVALID_VALUE_ERR (DOM SVG Exception 1): An invalid value was passed to an operation or assigned to an attribute..
-PASS maskElement.maskUnits.baseVal is SVGUnitTypes.SVG_UNIT_TYPE_OBJECTBOUNDINGBOX
-PASS maskElement.getAttribute('maskUnits') is "objectBoundingBox"
-PASS maskElement.maskUnits.baseVal = -1 threw exception SVG_INVALID_VALUE_ERR (DOM SVG Exception 1): An invalid value was passed to an operation or assigned to an attribute..
-PASS maskElement.maskUnits.baseVal is SVGUnitTypes.SVG_UNIT_TYPE_OBJECTBOUNDINGBOX
-PASS maskElement.getAttribute('maskUnits') is "objectBoundingBox"
-PASS maskElement.maskUnits.baseVal = 0 threw exception SVG_INVALID_VALUE_ERR (DOM SVG Exception 1): An invalid value was passed to an operation or assigned to an attribute..
-PASS maskElement.maskUnits.baseVal is SVGUnitTypes.SVG_UNIT_TYPE_OBJECTBOUNDINGBOX
-PASS maskElement.getAttribute('maskUnits') is "objectBoundingBox"
+PASS patternElement.patternUnits.baseVal = 3 threw exception SVG_INVALID_VALUE_ERR (DOM SVG Exception 1): An invalid value was passed to an operation or assigned to an attribute..
+PASS patternElement.patternUnits.baseVal is SVGUnitTypes.SVG_UNIT_TYPE_OBJECTBOUNDINGBOX
+PASS patternElement.getAttribute('patternUnits') is "objectBoundingBox"
+PASS patternElement.patternUnits.baseVal = -1 threw exception SVG_INVALID_VALUE_ERR (DOM SVG Exception 1): An invalid value was passed to an operation or assigned to an attribute..
+PASS patternElement.patternUnits.baseVal is SVGUnitTypes.SVG_UNIT_TYPE_OBJECTBOUNDINGBOX
+PASS patternElement.getAttribute('patternUnits') is "objectBoundingBox"
+PASS patternElement.patternUnits.baseVal = 0 threw exception SVG_INVALID_VALUE_ERR (DOM SVG Exception 1): An invalid value was passed to an operation or assigned to an attribute..
+PASS patternElement.patternUnits.baseVal is SVGUnitTypes.SVG_UNIT_TYPE_OBJECTBOUNDINGBOX
+PASS patternElement.getAttribute('patternUnits') is "objectBoundingBox"
Switch to 'userSpaceOnUse'
-PASS maskElement.maskUnits.baseVal = SVGUnitTypes.SVG_UNIT_TYPE_USERSPACEONUSE is SVGUnitTypes.SVG_UNIT_TYPE_USERSPACEONUSE
-PASS maskElement.maskUnits.baseVal is SVGUnitTypes.SVG_UNIT_TYPE_USERSPACEONUSE
-PASS maskElement.getAttribute('maskUnits') is "userSpaceOnUse"
+PASS patternElement.patternUnits.baseVal = SVGUnitTypes.SVG_UNIT_TYPE_USERSPACEONUSE is SVGUnitTypes.SVG_UNIT_TYPE_USERSPACEONUSE
+PASS patternElement.patternUnits.baseVal is SVGUnitTypes.SVG_UNIT_TYPE_USERSPACEONUSE
+PASS patternElement.getAttribute('patternUnits') is "userSpaceOnUse"
-Check initial 'maskContentUnits' value
-PASS maskElement.maskContentUnits.toString() is "[object SVGAnimatedEnumeration]"
-PASS typeof(maskElement.maskContentUnits.baseVal) is "number"
-PASS maskElement.maskContentUnits.baseVal is SVGUnitTypes.SVG_UNIT_TYPE_USERSPACEONUSE
+Check initial 'patternContentUnits' value
+PASS patternElement.patternContentUnits.toString() is "[object SVGAnimatedEnumeration]"
+PASS typeof(patternElement.patternContentUnits.baseVal) is "number"
+PASS patternElement.patternContentUnits.baseVal is SVGUnitTypes.SVG_UNIT_TYPE_USERSPACEONUSE
Switch to 'objectBoundingBox'
-PASS maskElement.maskContentUnits.baseVal = SVGUnitTypes.SVG_UNIT_TYPE_OBJECTBOUNDINGBOX is SVGUnitTypes.SVG_UNIT_TYPE_OBJECTBOUNDINGBOX
-PASS maskElement.maskContentUnits.baseVal is SVGUnitTypes.SVG_UNIT_TYPE_OBJECTBOUNDINGBOX
-PASS maskElement.getAttribute('maskContentUnits') is "objectBoundingBox"
+PASS patternElement.patternContentUnits.baseVal = SVGUnitTypes.SVG_UNIT_TYPE_OBJECTBOUNDINGBOX is SVGUnitTypes.SVG_UNIT_TYPE_OBJECTBOUNDINGBOX
+PASS patternElement.patternContentUnits.baseVal is SVGUnitTypes.SVG_UNIT_TYPE_OBJECTBOUNDINGBOX
+PASS patternElement.getAttribute('patternContentUnits') is "objectBoundingBox"
Try setting invalid values
-PASS maskElement.maskContentUnits.baseVal = 3 threw exception SVG_INVALID_VALUE_ERR (DOM SVG Exception 1): An invalid value was passed to an operation or assigned to an attribute..
-PASS maskElement.maskContentUnits.baseVal is SVGUnitTypes.SVG_UNIT_TYPE_OBJECTBOUNDINGBOX
-PASS maskElement.getAttribute('maskContentUnits') is "objectBoundingBox"
-PASS maskElement.maskContentUnits.baseVal = -1 threw exception SVG_INVALID_VALUE_ERR (DOM SVG Exception 1): An invalid value was passed to an operation or assigned to an attribute..
-PASS maskElement.maskContentUnits.baseVal is SVGUnitTypes.SVG_UNIT_TYPE_OBJECTBOUNDINGBOX
-PASS maskElement.getAttribute('maskContentUnits') is "objectBoundingBox"
-PASS maskElement.maskContentUnits.baseVal = 0 threw exception SVG_INVALID_VALUE_ERR (DOM SVG Exception 1): An invalid value was passed to an operation or assigned to an attribute..
-PASS maskElement.maskContentUnits.baseVal is SVGUnitTypes.SVG_UNIT_TYPE_OBJECTBOUNDINGBOX
-PASS maskElement.getAttribute('maskContentUnits') is "objectBoundingBox"
+PASS patternElement.patternContentUnits.baseVal = 3 threw exception SVG_INVALID_VALUE_ERR (DOM SVG Exception 1): An invalid value was passed to an operation or assigned to an attribute..
+PASS patternElement.patternContentUnits.baseVal is SVGUnitTypes.SVG_UNIT_TYPE_OBJECTBOUNDINGBOX
+PASS patternElement.getAttribute('patternContentUnits') is "objectBoundingBox"
+PASS patternElement.patternContentUnits.baseVal = -1 threw exception SVG_INVALID_VALUE_ERR (DOM SVG Exception 1): An invalid value was passed to an operation or assigned to an attribute..
+PASS patternElement.patternContentUnits.baseVal is SVGUnitTypes.SVG_UNIT_TYPE_OBJECTBOUNDINGBOX
+PASS patternElement.getAttribute('patternContentUnits') is "objectBoundingBox"
+PASS patternElement.patternContentUnits.baseVal = 0 threw exception SVG_INVALID_VALUE_ERR (DOM SVG Exception 1): An invalid value was passed to an operation or assigned to an attribute..
+PASS patternElement.patternContentUnits.baseVal is SVGUnitTypes.SVG_UNIT_TYPE_OBJECTBOUNDINGBOX
+PASS patternElement.getAttribute('patternContentUnits') is "objectBoundingBox"
Switch to 'userSpaceOnUse'
-PASS maskElement.maskContentUnits.baseVal = SVGUnitTypes.SVG_UNIT_TYPE_USERSPACEONUSE is SVGUnitTypes.SVG_UNIT_TYPE_USERSPACEONUSE
-PASS maskElement.maskContentUnits.baseVal is SVGUnitTypes.SVG_UNIT_TYPE_USERSPACEONUSE
-PASS maskElement.getAttribute('maskContentUnits') is "userSpaceOnUse"
+PASS patternElement.patternContentUnits.baseVal = SVGUnitTypes.SVG_UNIT_TYPE_USERSPACEONUSE is SVGUnitTypes.SVG_UNIT_TYPE_USERSPACEONUSE
+PASS patternElement.patternContentUnits.baseVal is SVGUnitTypes.SVG_UNIT_TYPE_USERSPACEONUSE
+PASS patternElement.getAttribute('patternContentUnits') is "userSpaceOnUse"
PASS successfullyParsed is true
TEST COMPLETE
Modified: trunk/LayoutTests/svg/dom/SVGAnimatedEnumeration-SVGPatternElement.html (217465 => 217466)
--- trunk/LayoutTests/svg/dom/SVGAnimatedEnumeration-SVGPatternElement.html 2017-05-26 02:04:21 UTC (rev 217465)
+++ trunk/LayoutTests/svg/dom/SVGAnimatedEnumeration-SVGPatternElement.html 2017-05-26 02:10:33 UTC (rev 217466)
@@ -6,7 +6,81 @@
<body>
<p id="description"></p>
<div id="console"></div>
-<script src=""
+<script>
+description("This test checks the use of SVGAnimatedEnumeration within SVGPatternElement");
+
+var patternElement = document.createElementNS("http://www.w3.org/2000/svg", "pattern");
+patternElement.setAttribute("patternUnits", "userSpaceOnUse");
+patternElement.setAttribute("patternContentUnits", "userSpaceOnUse");
+
+// patternUnits
+debug("");
+debug("Check initial 'patternUnits' value");
+shouldBeEqualToString("patternElement.patternUnits.toString()", "[object SVGAnimatedEnumeration]");
+shouldBeEqualToString("typeof(patternElement.patternUnits.baseVal)", "number");
+shouldBe("patternElement.patternUnits.baseVal", "SVGUnitTypes.SVG_UNIT_TYPE_USERSPACEONUSE");
+
+debug("");
+debug("Switch to 'objectBoundingBox'");
+shouldBe("patternElement.patternUnits.baseVal = SVGUnitTypes.SVG_UNIT_TYPE_OBJECTBOUNDINGBOX", "SVGUnitTypes.SVG_UNIT_TYPE_OBJECTBOUNDINGBOX");
+shouldBe("patternElement.patternUnits.baseVal", "SVGUnitTypes.SVG_UNIT_TYPE_OBJECTBOUNDINGBOX");
+shouldBeEqualToString("patternElement.getAttribute('patternUnits')", "objectBoundingBox");
+
+debug("");
+debug("Try setting invalid values");
+shouldThrow("patternElement.patternUnits.baseVal = 3");
+shouldBe("patternElement.patternUnits.baseVal", "SVGUnitTypes.SVG_UNIT_TYPE_OBJECTBOUNDINGBOX");
+shouldBeEqualToString("patternElement.getAttribute('patternUnits')", "objectBoundingBox");
+
+shouldThrow("patternElement.patternUnits.baseVal = -1");
+shouldBe("patternElement.patternUnits.baseVal", "SVGUnitTypes.SVG_UNIT_TYPE_OBJECTBOUNDINGBOX");
+shouldBeEqualToString("patternElement.getAttribute('patternUnits')", "objectBoundingBox");
+
+shouldThrow("patternElement.patternUnits.baseVal = 0");
+shouldBe("patternElement.patternUnits.baseVal", "SVGUnitTypes.SVG_UNIT_TYPE_OBJECTBOUNDINGBOX");
+shouldBeEqualToString("patternElement.getAttribute('patternUnits')", "objectBoundingBox");
+
+debug("");
+debug("Switch to 'userSpaceOnUse'");
+shouldBe("patternElement.patternUnits.baseVal = SVGUnitTypes.SVG_UNIT_TYPE_USERSPACEONUSE", "SVGUnitTypes.SVG_UNIT_TYPE_USERSPACEONUSE");
+shouldBe("patternElement.patternUnits.baseVal", "SVGUnitTypes.SVG_UNIT_TYPE_USERSPACEONUSE");
+shouldBeEqualToString("patternElement.getAttribute('patternUnits')", "userSpaceOnUse");
+
+// patternContentUnits
+debug("");
+debug("Check initial 'patternContentUnits' value");
+shouldBeEqualToString("patternElement.patternContentUnits.toString()", "[object SVGAnimatedEnumeration]");
+shouldBeEqualToString("typeof(patternElement.patternContentUnits.baseVal)", "number");
+shouldBe("patternElement.patternContentUnits.baseVal", "SVGUnitTypes.SVG_UNIT_TYPE_USERSPACEONUSE");
+
+debug("");
+debug("Switch to 'objectBoundingBox'");
+shouldBe("patternElement.patternContentUnits.baseVal = SVGUnitTypes.SVG_UNIT_TYPE_OBJECTBOUNDINGBOX", "SVGUnitTypes.SVG_UNIT_TYPE_OBJECTBOUNDINGBOX");
+shouldBe("patternElement.patternContentUnits.baseVal", "SVGUnitTypes.SVG_UNIT_TYPE_OBJECTBOUNDINGBOX");
+shouldBeEqualToString("patternElement.getAttribute('patternContentUnits')", "objectBoundingBox");
+
+debug("");
+debug("Try setting invalid values");
+shouldThrow("patternElement.patternContentUnits.baseVal = 3");
+shouldBe("patternElement.patternContentUnits.baseVal", "SVGUnitTypes.SVG_UNIT_TYPE_OBJECTBOUNDINGBOX");
+shouldBeEqualToString("patternElement.getAttribute('patternContentUnits')", "objectBoundingBox");
+
+shouldThrow("patternElement.patternContentUnits.baseVal = -1");
+shouldBe("patternElement.patternContentUnits.baseVal", "SVGUnitTypes.SVG_UNIT_TYPE_OBJECTBOUNDINGBOX");
+shouldBeEqualToString("patternElement.getAttribute('patternContentUnits')", "objectBoundingBox");
+
+shouldThrow("patternElement.patternContentUnits.baseVal = 0");
+shouldBe("patternElement.patternContentUnits.baseVal", "SVGUnitTypes.SVG_UNIT_TYPE_OBJECTBOUNDINGBOX");
+shouldBeEqualToString("patternElement.getAttribute('patternContentUnits')", "objectBoundingBox");
+
+debug("");
+debug("Switch to 'userSpaceOnUse'");
+shouldBe("patternElement.patternContentUnits.baseVal = SVGUnitTypes.SVG_UNIT_TYPE_USERSPACEONUSE", "SVGUnitTypes.SVG_UNIT_TYPE_USERSPACEONUSE");
+shouldBe("patternElement.patternContentUnits.baseVal", "SVGUnitTypes.SVG_UNIT_TYPE_USERSPACEONUSE");
+shouldBeEqualToString("patternElement.getAttribute('patternContentUnits')", "userSpaceOnUse");
+
+successfullyParsed = true;
+</script>
<script src=""
</body>
</html>
Modified: trunk/LayoutTests/svg/dynamic-updates/SVGFEFloodElement-inherit-flood-color.html (217465 => 217466)
--- trunk/LayoutTests/svg/dynamic-updates/SVGFEFloodElement-inherit-flood-color.html 2017-05-26 02:04:21 UTC (rev 217465)
+++ trunk/LayoutTests/svg/dynamic-updates/SVGFEFloodElement-inherit-flood-color.html 2017-05-26 02:10:33 UTC (rev 217466)
@@ -9,6 +9,53 @@
<h1>SVG 1.1 dynamic update tests</h1>
<p id="description"></p>
<div id="console"></div>
-<script src=""
+<script>
+// [Expected rendering result] A simple rect with feFlood filter - and a series of PASS messages
+
+description("Tests dynamic updates of the inherited 'flood-color' attribute of the SVGFEFloodElement object")
+createSVGTestCase();
+
+var floodElement = createSVGElement("feFlood");
+floodElement.setAttribute("flood-color", "inherit");
+floodElement.setAttribute("flood-opacity", ".8");
+
+var filterElement = createSVGElement("filter");
+filterElement.setAttribute("id", "myFilter");
+filterElement.setAttribute("filterUnits", "userSpaceOnUse");
+filterElement.setAttribute("x", "0");
+filterElement.setAttribute("y", "0");
+filterElement.setAttribute("width", "200");
+filterElement.setAttribute("height", "200");
+filterElement.setAttribute("style", "flood-color:rgb(145, 32, 103)");
+filterElement.appendChild(floodElement);
+
+var defsElement = createSVGElement("defs");
+defsElement.appendChild(filterElement);
+
+rootSVGElement.appendChild(defsElement);
+rootSVGElement.setAttribute("width", "700");
+rootSVGElement.setAttribute("height", "200");
+
+var rectElement = createSVGElement("rect");
+rectElement.setAttribute("x", 60);
+rectElement.setAttribute("y", 100);
+rectElement.setAttribute("width", 100);
+rectElement.setAttribute("height", 100);
+rectElement.setAttribute("stroke", "#AF1E9D");
+rectElement.setAttribute("stroke-width", "8");
+rectElement.setAttribute("filter", "url(#myFilter)");
+rootSVGElement.appendChild(rectElement);
+
+shouldBeEqualToString("document.defaultView.getComputedStyle(floodElement).getPropertyValue('flood-color')", "rgb(145, 32, 103)");
+
+function repaintTest() {
+ filterElement.setAttribute("style", "flood-color:rgb(64, 128, 103)");
+ shouldBeEqualToString("document.defaultView.getComputedStyle(floodElement).getPropertyValue('flood-color')", "rgb(64, 128, 103)");
+
+ completeTest();
+}
+
+var successfullyParsed = true;
+</script>
</body>
</html>
Modified: trunk/LayoutTests/svg/dynamic-updates/SVGFEGaussianBlurElement-dom-stdDeviation-call.html (217465 => 217466)
--- trunk/LayoutTests/svg/dynamic-updates/SVGFEGaussianBlurElement-dom-stdDeviation-call.html 2017-05-26 02:04:21 UTC (rev 217465)
+++ trunk/LayoutTests/svg/dynamic-updates/SVGFEGaussianBlurElement-dom-stdDeviation-call.html 2017-05-26 02:10:33 UTC (rev 217466)
@@ -9,6 +9,53 @@
<h1>SVG 1.1 dynamic update tests</h1>
<p id="description"></p>
<div id="console"></div>
-<script src=""
+<script>
+// [Expected rendering result] A simple rectangle with feGaussianBlur filter - and a series of PASS messages
+
+description("Tests dynamic updates of the 'stdDeviation' property of the SVGFEGaussianBlurElement object")
+createSVGTestCase();
+
+var blurElement = createSVGElement("feGaussianBlur");
+blurElement.setAttribute("stdDeviation", "5");
+
+var filterElement = createSVGElement("filter");
+filterElement.setAttribute("id", "myFilter");
+filterElement.setAttribute("filterUnits", "userSpaceOnUse");
+filterElement.setAttribute("x", "0");
+filterElement.setAttribute("y", "0");
+filterElement.setAttribute("width", "200");
+filterElement.setAttribute("height", "200");
+filterElement.appendChild(blurElement);
+
+var defsElement = createSVGElement("defs");
+defsElement.appendChild(filterElement);
+
+rootSVGElement.appendChild(defsElement);
+rootSVGElement.setAttribute("width", "700");
+rootSVGElement.setAttribute("height", "200");
+
+var rectElement = createSVGElement("rect");
+rectElement.setAttribute("x", 60);
+rectElement.setAttribute("y", 20);
+rectElement.setAttribute("width", 100);
+rectElement.setAttribute("height", 100);
+rectElement.setAttribute("stroke", "#AF1E9D");
+rectElement.setAttribute("stroke-width", "8");
+rectElement.setAttribute("filter", "url(#myFilter)");
+rootSVGElement.appendChild(rectElement);
+
+shouldBe("blurElement.stdDeviationX.baseVal", "5");
+shouldBe("blurElement.stdDeviationY.baseVal", "5");
+
+function repaintTest() {
+ blurElement.setStdDeviation(10, 10);
+ shouldBe("blurElement.stdDeviationX.baseVal", "10");
+ shouldBe("blurElement.stdDeviationY.baseVal", "10");
+
+ completeTest();
+}
+
+var successfullyParsed = true;
+</script>
</body>
</html>
Modified: trunk/LayoutTests/svg/dynamic-updates/SVGFESpecularLightingElement-dom-suraceScale-attr.html (217465 => 217466)
--- trunk/LayoutTests/svg/dynamic-updates/SVGFESpecularLightingElement-dom-suraceScale-attr.html 2017-05-26 02:04:21 UTC (rev 217465)
+++ trunk/LayoutTests/svg/dynamic-updates/SVGFESpecularLightingElement-dom-suraceScale-attr.html 2017-05-26 02:10:33 UTC (rev 217466)
@@ -9,6 +9,70 @@
<h1>SVG 1.1 dynamic update tests</h1>
<p id="description"></p>
<div id="console"></div>
-<script src=""
+<script>
+// [Expected rendering result] A shining circle - and a series of PASS messages
+
+description("Tests dynamic updates of the 'surfaceScale' attribute of the SVGFESpecularLightingElement object")
+createSVGTestCase();
+
+var distantElement = createSVGElement("feDistantLight");
+distantElement.setAttribute("azimuth", "45");
+distantElement.setAttribute("elevation", "45");
+
+var specularElement = createSVGElement("feSpecularLighting");
+specularElement.setAttribute("in", "SourceGraphic");
+specularElement.setAttribute("specularConstant", "1");
+specularElement.setAttribute("specularExponent", "1");
+specularElement.setAttribute("surfaceScale", "1");
+specularElement.setAttribute("lighting-color", "greenyellow");
+specularElement.appendChild(distantElement);
+
+var filterElement = createSVGElement("filter");
+filterElement.setAttribute("id", "myFilter");
+filterElement.setAttribute("filterUnits", "objectBoundingBox");
+filterElement.setAttribute("x", "0%");
+filterElement.setAttribute("y", "0%");
+filterElement.setAttribute("width", "100%");
+filterElement.setAttribute("height", "100%");
+filterElement.appendChild(specularElement);
+
+var defsElement = createSVGElement("defs");
+defsElement.appendChild(filterElement);
+
+rootSVGElement.appendChild(defsElement);
+rootSVGElement.setAttribute("width", "200");
+rootSVGElement.setAttribute("height", "200");
+
+var gElement = createSVGElement("g");
+gElement.setAttribute("fill", "black");
+
+var backgroundElement = createSVGElement("rect");
+backgroundElement.setAttribute("x", 60);
+backgroundElement.setAttribute("y", 20);
+backgroundElement.setAttribute("width", 100);
+backgroundElement.setAttribute("height", 60);
+gElement.appendChild(backgroundElement);
+rootSVGElement.appendChild(gElement);
+
+var rectElement = createSVGElement("image");
+rectElement.setAttribute("x", 60);
+rectElement.setAttribute("y", 20);
+rectElement.setAttribute("width", 100);
+rectElement.setAttribute("height", 60);
+rectElement.setAttributeNS(xlinkNS, "xlink:href", "../W3C-SVG-1.1/resources/bumpMap2.png");
+rectElement.setAttribute("filter", "url(#myFilter)");
+rootSVGElement.appendChild(rectElement);
+
+shouldBeEqualToString("specularElement.getAttribute('surfaceScale')", "1");
+
+function repaintTest() {
+ specularElement.setAttribute("surfaceScale", "10");
+ shouldBeEqualToString("specularElement.getAttribute('surfaceScale')", "10");
+
+ completeTest();
+}
+
+var successfullyParsed = true;
+</script>
</body>
</html>
Modified: trunk/LayoutTests/svg/dynamic-updates/SVGFESpecularLightingElement-svgdom-suraceScale-prop.html (217465 => 217466)
--- trunk/LayoutTests/svg/dynamic-updates/SVGFESpecularLightingElement-svgdom-suraceScale-prop.html 2017-05-26 02:04:21 UTC (rev 217465)
+++ trunk/LayoutTests/svg/dynamic-updates/SVGFESpecularLightingElement-svgdom-suraceScale-prop.html 2017-05-26 02:10:33 UTC (rev 217466)
@@ -9,6 +9,71 @@
<h1>SVG 1.1 dynamic update tests</h1>
<p id="description"></p>
<div id="console"></div>
-<script src=""
+<script>
+// [Expected rendering result] A shining circle - and a series of PASS messages
+
+description("Tests dynamic updates of the 'surfaceScale' property of the SVGFESpecularLightingElement object")
+createSVGTestCase();
+
+var distantElement = createSVGElement("feDistantLight");
+distantElement.setAttribute("azimuth", "45");
+distantElement.setAttribute("elevation", "45");
+
+var specularElement = createSVGElement("feSpecularLighting");
+specularElement.setAttribute("in", "SourceGraphic");
+specularElement.setAttribute("specularConstant", "1");
+specularElement.setAttribute("specularExponent", "1");
+specularElement.setAttribute("surfaceScale", "1");
+specularElement.setAttribute("lighting-color", "greenyellow");
+specularElement.appendChild(distantElement);
+
+var filterElement = createSVGElement("filter");
+filterElement.setAttribute("id", "myFilter");
+filterElement.setAttribute("filterUnits", "objectBoundingBox");
+filterElement.setAttribute("x", "0%");
+filterElement.setAttribute("y", "0%");
+filterElement.setAttribute("width", "100%");
+filterElement.setAttribute("height", "100%");
+filterElement.appendChild(specularElement);
+
+var defsElement = createSVGElement("defs");
+defsElement.appendChild(filterElement);
+
+rootSVGElement.appendChild(defsElement);
+rootSVGElement.setAttribute("width", "200");
+rootSVGElement.setAttribute("height", "150");
+
+var gElement = createSVGElement("g");
+gElement.setAttribute("fill", "black");
+
+var backgroundElement = createSVGElement("rect");
+backgroundElement.setAttribute("x", 60);
+backgroundElement.setAttribute("y", 20);
+backgroundElement.setAttribute("width", 100);
+backgroundElement.setAttribute("height", 60);
+gElement.appendChild(backgroundElement);
+rootSVGElement.appendChild(gElement);
+
+var rectElement = createSVGElement("image");
+rectElement.setAttribute("x", 60);
+rectElement.setAttribute("y", 20);
+rectElement.setAttribute("width", 100);
+rectElement.setAttribute("height", 60);
+rectElement.setAttributeNS(xlinkNS, "xlink:href", "../W3C-SVG-1.1/resources/bumpMap2.png");
+rectElement.setAttribute("filter", "url(#myFilter)");
+rootSVGElement.appendChild(rectElement);
+
+shouldBe("specularElement.surfaceScale.baseVal", "1");
+
+function repaintTest() {
+ specularElement.surfaceScale.baseVal = 10;
+ shouldBe("specularElement.surfaceScale.baseVal", "10");
+
+ completeTest();
+}
+
+
+var successfullyParsed = true;
+</script>
</body>
</html>