Revision 64da316928b38f3dbd2231dbfb0f7f776170a106 authored by Brad Werth on 11 April 2018, 09:35:18 UTC, committed by moz-wptsync-bot on 11 April 2018, 09:35:18 UTC
This test is designed to check that the float area is calculated from the first frame of an animated GIF. The reference rendering is a solid green square with the lower-left of the square supplied by the pixels in the GIF. Frame 2 of the GIF has white pixels in that quadrant. If layout is completed and onload is fired while frame 2 is showing, the test will fail even though the float area has been correctly calculated. This change puts green in the lower-left quadrant of all frames of the GIF so that the test is only testing the float area and not also testing that onload fires while a certain frame is showing. Note that this change doesn't impact the thoroughness of how we're testing shape-outside because it changes only the color of the pixels and not their opacity, and the float area is calculated from the alpha of the pixels. bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1404222 gecko-commit: 491be7851cfc3e4959af6e22a1adf70d5f7bb168 gecko-integration-branch: central
1 parent a4e013a
002.html
<!doctype html>
<meta charset="utf8">
<title>XPath in text/html: attributes</title>
<link rel="help" href="http://www.w3.org/TR/DOM-Level-3-XPath/xpath.html#Interfaces">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<body>
<div id="log" nonÄsciiAttribute><span></span></div>
<svg xmlns="http://www.w3.org/2000/svg", xmlns:xlink="http://www.w3.org/1999/xlink">
<path id="a" refx />
<path id="b" nonÄscii xlink:href />
</svg>
<script>
function test_xpath_succeeds(path, expected, resolver) {
resolver = resolver ? resolver : null;
var res = document.evaluate(path, document, resolver, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null);
actual = [];
for (var i=0;;i++) {
var node = res.snapshotItem(i);
if (node === null) {
break;
}
actual.push(node);
}
assert_array_equals(actual, expected);
}
function test_xpath_throws(path, error_code, resolver) {
resolver = resolver ? resolver : null;
assert_throws(error_code, function() {document.evaluate(path, document, resolver, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null)})
}
function ns_resolver(x) {
map = {"html":"http://www.w3.org/1999/xhtml",
"svg":"http://www.w3.org/2000/svg",
"math":"http://www.w3.org/1998/Math/MathML",
"xlink":"http://www.w3.org/1999/xlink"};
var rv = map.hasOwnProperty(x) ? map[x] : null;
return rv;
}
generate_tests(test_xpath_succeeds,[
["Select html element based on attribute", "//div[@id='log']", [document.getElementById("log")]],
["Select html element based on attribute mixed case", "//div[@Id='log']", [document.getElementById("log")]],
["Select both HTML and SVG elements based on attribute", "//*[@id]", [document.getElementById("log")].concat(Array.prototype.slice.call(document.getElementsByTagName("path")))],
["Select HTML element with non-ascii attribute 1", "//*[@nonÄsciiattribute]", [document.getElementById("log")]],
["Select HTML element with non-ascii attribute 2", "//*[@nonäsciiattribute]", []],
["Select HTML element with non-ascii attribute 3", "//*[@nonÄsciiAttribute]", [document.getElementById("log")]],
["Select SVG element based on mixed case attribute", "//svg:path[@Id]", [], ns_resolver],
["Select both HTML and SVG elements based on mixed case attribute", "//*[@Id]", [document.getElementById("log")]],
["Select SVG elements with refX attribute", "//*[@refX]", [document.getElementById("a")]],
["Select SVG elements with refX attribute incorrect case", "//*[@Refx]", []],
["Select SVG elements with refX attribute lowercase", "//*[@refx]", []],
["Select SVG element with non-ascii attribute 1", "//*[@nonÄscii]", [document.getElementById("b")]],
["Select SVG element with non-ascii attribute 2", "//*[@nonäscii]", []],
["xmlns attribute", "//*[@xmlns]", []],
["svg element with XLink attribute", "//*[@xlink:href]", [document.getElementById("b")], ns_resolver]
])
</script>
![swh spinner](/static/img/swh-spinner.gif)
Computing file changes ...