mirror of
https://github.com/servo/servo.git
synced 2025-08-24 14:48:21 +01:00
Update web-platform-tests to revision 4bba821de44da9ed47c2562f995a0da6eecc177b
This commit is contained in:
parent
af637640ae
commit
c8c377df9f
48 changed files with 697 additions and 8688 deletions
|
@ -17,14 +17,6 @@ testDiv.parentNode.removeChild(testDiv);
|
|||
|
||||
function mySurroundContents(range, newParent) {
|
||||
try {
|
||||
// "If the detached flag is set, throw an "InvalidStateError" exception
|
||||
// and terminate these steps."
|
||||
try {
|
||||
range.collapsed;
|
||||
} catch (e) {
|
||||
return "INVALID_STATE_ERR";
|
||||
}
|
||||
|
||||
// "If a non-Text node is partially contained in the context object,
|
||||
// throw a "InvalidStateError" exception and terminate these steps."
|
||||
var node = range.commonAncestorContainer;
|
||||
|
@ -118,8 +110,6 @@ function testSurroundContents(i, j) {
|
|||
var actualRoots = [];
|
||||
var expectedRoots = [];
|
||||
|
||||
var detached = false;
|
||||
|
||||
domTests[i][j].step(function() {
|
||||
restoreIframe(actualIframe, i, j);
|
||||
restoreIframe(expectedIframe, i, j);
|
||||
|
@ -129,12 +119,6 @@ function testSurroundContents(i, j) {
|
|||
actualNode = actualIframe.contentWindow.testNode;
|
||||
expectedNode = expectedIframe.contentWindow.testNode;
|
||||
|
||||
try {
|
||||
actualRange.collapsed;
|
||||
} catch (e) {
|
||||
detached = true;
|
||||
}
|
||||
|
||||
assert_equals(actualIframe.contentWindow.unexpectedException, null,
|
||||
"Unexpected exception thrown when setting up Range for actual surroundContents()");
|
||||
assert_equals(expectedIframe.contentWindow.unexpectedException, null,
|
||||
|
@ -160,15 +144,8 @@ function testSurroundContents(i, j) {
|
|||
// also the trees containing the moved nodes. These might not be the
|
||||
// same, if we're inserting a node from a detached tree or a different
|
||||
// document.
|
||||
//
|
||||
// Detached ranges are always in the contentDocument.
|
||||
if (detached) {
|
||||
actualRoots.push(actualIframe.contentDocument);
|
||||
expectedRoots.push(expectedIframe.contentDocument);
|
||||
} else {
|
||||
actualRoots.push(furthestAncestor(actualRange.startContainer));
|
||||
expectedRoots.push(furthestAncestor(expectedRange.startContainer));
|
||||
}
|
||||
actualRoots.push(furthestAncestor(actualRange.startContainer));
|
||||
expectedRoots.push(furthestAncestor(expectedRange.startContainer));
|
||||
|
||||
if (furthestAncestor(actualNode) != actualRoots[0]) {
|
||||
actualRoots.push(furthestAncestor(actualNode));
|
||||
|
@ -264,11 +241,6 @@ function testSurroundContents(i, j) {
|
|||
assertNodesEqual(actualRoots[k], expectedRoots[k], k ? "moved node's tree root" : "range's tree root");
|
||||
}
|
||||
|
||||
if (detached) {
|
||||
// No further tests we can do
|
||||
return;
|
||||
}
|
||||
|
||||
assert_equals(actualRange.startOffset, expectedRange.startOffset,
|
||||
"Unexpected startOffset after surroundContents()");
|
||||
assert_equals(actualRange.endOffset, expectedRange.endOffset,
|
||||
|
@ -300,8 +272,6 @@ function testSurroundContents(i, j) {
|
|||
positionTests[i][j].done();
|
||||
}
|
||||
|
||||
testRanges.unshift('"detached"');
|
||||
|
||||
var iStart = 0;
|
||||
var iStop = testRangesShort.length;
|
||||
var jStart = 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue