Bug 1192855 - Check validity in advance for nsRange::InsertNode; r=hsivonen

This commit is contained in:
Aryeh Gregor 2015-10-07 16:07:39 +03:00
parent d35c184925
commit 0ba87aa775
11 changed files with 319 additions and 563 deletions

View File

@ -1876,6 +1876,50 @@ bool IsAllowedAsChild(nsIContent* aNewChild, nsINode* aParent,
return false;
}
void
nsINode::EnsurePreInsertionValidity(nsINode& aNewChild, nsINode* aRefChild,
ErrorResult& aError)
{
EnsurePreInsertionValidity1(aNewChild, aRefChild, aError);
if (aError.Failed()) {
return;
}
EnsurePreInsertionValidity2(false, aNewChild, aRefChild, aError);
}
void
nsINode::EnsurePreInsertionValidity1(nsINode& aNewChild, nsINode* aRefChild,
ErrorResult& aError)
{
if ((!IsNodeOfType(eDOCUMENT) &&
!IsNodeOfType(eDOCUMENT_FRAGMENT) &&
!IsElement()) ||
!aNewChild.IsNodeOfType(eCONTENT)) {
aError.Throw(NS_ERROR_DOM_HIERARCHY_REQUEST_ERR);
return;
}
}
void
nsINode::EnsurePreInsertionValidity2(bool aReplace, nsINode& aNewChild,
nsINode* aRefChild, ErrorResult& aError)
{
nsIContent* newContent = aNewChild.AsContent();
if (newContent->IsRootOfAnonymousSubtree()) {
// This is anonymous content. Don't allow its insertion
// anywhere, since it might have UnbindFromTree calls coming
// its way.
aError.Throw(NS_ERROR_DOM_NOT_SUPPORTED_ERR);
return;
}
// Make sure that the inserted node is allowed as a child of its new parent.
if (!IsAllowedAsChild(newContent, this, aReplace, aRefChild)) {
aError.Throw(NS_ERROR_DOM_HIERARCHY_REQUEST_ERR);
return;
}
}
nsINode*
nsINode::ReplaceOrInsertBefore(bool aReplace, nsINode* aNewChild,
nsINode* aRefChild, ErrorResult& aError)
@ -1887,11 +1931,8 @@ nsINode::ReplaceOrInsertBefore(bool aReplace, nsINode* aNewChild,
// the bad XBL cases.
MOZ_ASSERT_IF(aReplace, aRefChild);
if ((!IsNodeOfType(eDOCUMENT) &&
!IsNodeOfType(eDOCUMENT_FRAGMENT) &&
!IsElement()) ||
!aNewChild->IsNodeOfType(eCONTENT)) {
aError.Throw(NS_ERROR_DOM_HIERARCHY_REQUEST_ERR);
EnsurePreInsertionValidity1(*aNewChild, aRefChild, aError);
if (aError.Failed()) {
return nullptr;
}
@ -1939,19 +1980,8 @@ nsINode::ReplaceOrInsertBefore(bool aReplace, nsINode* aNewChild,
}
}
nsIDocument* doc = OwnerDoc();
nsIContent* newContent = static_cast<nsIContent*>(aNewChild);
if (newContent->IsRootOfAnonymousSubtree()) {
// This is anonymous content. Don't allow its insertion
// anywhere, since it might have UnbindFromTree calls coming
// its way.
aError.Throw(NS_ERROR_DOM_NOT_SUPPORTED_ERR);
return nullptr;
}
// Make sure that the inserted node is allowed as a child of its new parent.
if (!IsAllowedAsChild(newContent, this, aReplace, aRefChild)) {
aError.Throw(NS_ERROR_DOM_HIERARCHY_REQUEST_ERR);
EnsurePreInsertionValidity2(aReplace, *aNewChild, aRefChild, aError);
if (aError.Failed()) {
return nullptr;
}
@ -1971,6 +2001,7 @@ nsINode::ReplaceOrInsertBefore(bool aReplace, nsINode* aNewChild,
Maybe<nsAutoTArray<nsCOMPtr<nsIContent>, 50> > fragChildren;
// Remove the new child from the old parent if one exists
nsIContent* newContent = aNewChild->AsContent();
nsCOMPtr<nsINode> oldParent = newContent->GetParentNode();
if (oldParent) {
int32_t removeIndex = oldParent->IndexOf(newContent);
@ -2180,6 +2211,7 @@ nsINode::ReplaceOrInsertBefore(bool aReplace, nsINode* aNewChild,
// DocumentType nodes are the only nodes that can have a null
// ownerDocument according to the DOM spec, and we need to allow
// inserting them w/o calling AdoptNode().
nsIDocument* doc = OwnerDoc();
if (doc != newContent->OwnerDoc()) {
aError = AdoptNodeIntoOwnerDoc(this, aNewChild);
if (aError.Failed()) {

View File

@ -1735,6 +1735,8 @@ public:
// The DOM spec says that when nodeValue is defined to be null "setting it
// has no effect", so we don't throw an exception.
}
void EnsurePreInsertionValidity(nsINode& aNewChild, nsINode* aRefChild,
mozilla::ErrorResult& aError);
nsINode* InsertBefore(nsINode& aNode, nsINode* aChild,
mozilla::ErrorResult& aError)
{
@ -1884,6 +1886,11 @@ protected:
nsresult CompareDocumentPosition(nsIDOMNode* aOther,
uint16_t* aReturn);
void EnsurePreInsertionValidity1(nsINode& aNewChild, nsINode* aRefChild,
mozilla::ErrorResult& aError);
void EnsurePreInsertionValidity2(bool aReplace, nsINode& aNewChild,
nsINode* aRefChild,
mozilla::ErrorResult& aError);
nsresult ReplaceOrInsertBefore(bool aReplace, nsIDOMNode *aNewChild,
nsIDOMNode *aRefChild, nsIDOMNode **aReturn);
nsINode* ReplaceOrInsertBefore(bool aReplace, nsINode* aNewChild,

View File

@ -2485,6 +2485,12 @@ nsRange::InsertNode(nsINode& aNode, ErrorResult& aRv)
return;
}
referenceParentNode->EnsurePreInsertionValidity(aNode, tStartContainer,
aRv);
if (aRv.Failed()) {
return;
}
nsCOMPtr<nsIDOMText> secondPart;
aRv = startTextNode->SplitText(tStartOffset, getter_AddRefs(secondPart));
if (aRv.Failed()) {
@ -2505,6 +2511,11 @@ nsRange::InsertNode(nsINode& aNode, ErrorResult& aRv)
if (aRv.Failed()) {
return;
}
tStartContainer->EnsurePreInsertionValidity(aNode, referenceNode, aRv);
if (aRv.Failed()) {
return;
}
}
// We might need to update the end to include the new node (bug 433662).

View File

@ -0,0 +1,7 @@
# THIS FILE IS AUTOGENERATED BY parseFailures.py - DO NOT EDIT
[DEFAULT]
support-files =
[test_Range-insertNode.html.json]
[test_Range-surroundContents.html.json]

View File

@ -0,0 +1,6 @@
{
"0,1: resulting range position for range [paras[0].firstChild, 0, paras[0].firstChild, 0], node paras[0].firstChild": true,
"4,2: resulting range position for range [paras[1].firstChild, 0, paras[1].firstChild, 0], node paras[1].firstChild": true,
"6,6: resulting range position for range [detachedPara1.firstChild, 0, detachedPara1.firstChild, 0], node detachedPara1.firstChild": true,
"8,4: resulting range position for range [foreignPara1.firstChild, 0, foreignPara1.firstChild, 0], node foreignPara1.firstChild": true
}

View File

@ -0,0 +1,44 @@
{
"0,1: resulting range position for range [paras[0].firstChild, 0, paras[0].firstChild, 0], node paras[0].firstChild": true,
"1,1: resulting range position for range [paras[0].firstChild, 0, paras[0].firstChild, 1], node paras[0].firstChild": true,
"2,1: resulting range position for range [paras[0].firstChild, 2, paras[0].firstChild, 8], node paras[0].firstChild": true,
"3,1: resulting range position for range [paras[0].firstChild, 2, paras[0].firstChild, 9], node paras[0].firstChild": true,
"4,2: resulting range position for range [paras[1].firstChild, 0, paras[1].firstChild, 0], node paras[1].firstChild": true,
"5,2: resulting range position for range [paras[1].firstChild, 2, paras[1].firstChild, 9], node paras[1].firstChild": true,
"6,6: resulting range position for range [detachedPara1.firstChild, 0, detachedPara1.firstChild, 0], node detachedPara1.firstChild": true,
"7,6: resulting range position for range [detachedPara1.firstChild, 2, detachedPara1.firstChild, 8], node detachedPara1.firstChild": true,
"8,4: resulting range position for range [foreignPara1.firstChild, 0, foreignPara1.firstChild, 0], node foreignPara1.firstChild": true,
"9,4: resulting range position for range [foreignPara1.firstChild, 2, foreignPara1.firstChild, 8], node foreignPara1.firstChild": true,
"37,0: resulting DOM for range [processingInstruction, 0, processingInstruction, 4], node paras[0]": true,
"37,0: resulting range position for range [processingInstruction, 0, processingInstruction, 4], node paras[0]": true,
"37,1: resulting DOM for range [processingInstruction, 0, processingInstruction, 4], node paras[0].firstChild": true,
"37,1: resulting range position for range [processingInstruction, 0, processingInstruction, 4], node paras[0].firstChild": true,
"37,2: resulting DOM for range [processingInstruction, 0, processingInstruction, 4], node paras[1].firstChild": true,
"37,2: resulting range position for range [processingInstruction, 0, processingInstruction, 4], node paras[1].firstChild": true,
"37,3: resulting DOM for range [processingInstruction, 0, processingInstruction, 4], node foreignPara1": true,
"37,3: resulting range position for range [processingInstruction, 0, processingInstruction, 4], node foreignPara1": true,
"37,4: resulting DOM for range [processingInstruction, 0, processingInstruction, 4], node foreignPara1.firstChild": true,
"37,4: resulting range position for range [processingInstruction, 0, processingInstruction, 4], node foreignPara1.firstChild": true,
"37,5: resulting DOM for range [processingInstruction, 0, processingInstruction, 4], node detachedPara1": true,
"37,5: resulting range position for range [processingInstruction, 0, processingInstruction, 4], node detachedPara1": true,
"37,6: resulting DOM for range [processingInstruction, 0, processingInstruction, 4], node detachedPara1.firstChild": true,
"37,6: resulting range position for range [processingInstruction, 0, processingInstruction, 4], node detachedPara1.firstChild": true,
"37,8: resulting DOM for range [processingInstruction, 0, processingInstruction, 4], node detachedDiv": true,
"37,8: resulting range position for range [processingInstruction, 0, processingInstruction, 4], node detachedDiv": true,
"37,10: resulting DOM for range [processingInstruction, 0, processingInstruction, 4], node foreignPara2": true,
"37,10: resulting range position for range [processingInstruction, 0, processingInstruction, 4], node foreignPara2": true,
"37,12: resulting DOM for range [processingInstruction, 0, processingInstruction, 4], node xmlElement": true,
"37,12: resulting range position for range [processingInstruction, 0, processingInstruction, 4], node xmlElement": true,
"37,13: resulting DOM for range [processingInstruction, 0, processingInstruction, 4], node detachedTextNode": true,
"37,13: resulting range position for range [processingInstruction, 0, processingInstruction, 4], node detachedTextNode": true,
"37,14: resulting DOM for range [processingInstruction, 0, processingInstruction, 4], node foreignTextNode": true,
"37,14: resulting range position for range [processingInstruction, 0, processingInstruction, 4], node foreignTextNode": true,
"37,15: resulting DOM for range [processingInstruction, 0, processingInstruction, 4], node processingInstruction": true,
"37,15: resulting range position for range [processingInstruction, 0, processingInstruction, 4], node processingInstruction": true,
"37,16: resulting DOM for range [processingInstruction, 0, processingInstruction, 4], node detachedProcessingInstruction": true,
"37,16: resulting range position for range [processingInstruction, 0, processingInstruction, 4], node detachedProcessingInstruction": true,
"37,17: resulting DOM for range [processingInstruction, 0, processingInstruction, 4], node comment": true,
"37,17: resulting range position for range [processingInstruction, 0, processingInstruction, 4], node comment": true,
"37,18: resulting DOM for range [processingInstruction, 0, processingInstruction, 4], node detachedComment": true,
"37,18: resulting range position for range [processingInstruction, 0, processingInstruction, 4], node detachedComment": true
}

View File

@ -827,93 +827,210 @@ function myExtractContents(range) {
}
/**
* insertNode() implementation, following the spec. If an exception is
* supposed to be thrown, will return a string with the name (e.g.,
* "HIERARCHY_REQUEST_ERR") instead of a document fragment. It might also
* return an arbitrary human-readable string if a condition is hit that implies
* a spec bug.
* insertNode() implementation, following the spec. If an exception is meant
* to be thrown, will return a string with the expected exception name, for
* instance "HIERARCHY_REQUEST_ERR".
*/
function myInsertNode(range, node) {
// "If the detached flag is set, throw an "InvalidStateError" exception and
// terminate these steps."
//
// Assume that if accessing collapsed throws, it's detached.
try {
range.collapsed;
} catch (e) {
return "INVALID_STATE_ERR";
}
// "If start node is a Comment node, or a Text node whose parent is null,
// throw an "HierarchyRequestError" exception and terminate these steps."
if (range.startContainer.nodeType == Node.COMMENT_NODE
// "If range's start node is either a ProcessingInstruction or Comment
// node, or a Text node whose parent is null, throw an
// "HierarchyRequestError" exception and terminate these steps."
if (range.startContainer.nodeType == Node.PROCESSING_INSTRUCTION_NODE
|| range.startContainer.nodeType == Node.COMMENT_NODE
|| (range.startContainer.nodeType == Node.TEXT_NODE
&& !range.startContainer.parentNode)) {
return "HIERARCHY_REQUEST_ERR";
}
// "If start node is a Text node, split it with offset context object's
// start offset, and let reference node be the result."
var referenceNode;
// "Let referenceNode be null."
var referenceNode = null;
// "If range's start node is a Text node, set referenceNode to that Text node."
if (range.startContainer.nodeType == Node.TEXT_NODE) {
// We aren't testing how ranges vary under mutations, and browsers vary
// in how they mutate for splitText, so let's just force the correct
// way.
var start = [range.startContainer, range.startOffset];
var end = [range.endContainer, range.endOffset];
referenceNode = range.startContainer;
referenceNode = range.startContainer.splitText(range.startOffset);
if (start[0] == end[0]
&& end[1] > start[1]) {
end[0] = referenceNode;
end[1] -= start[1];
} else if (end[0] == start[0].parentNode
&& end[1] > indexOf(referenceNode)) {
end[1]++;
}
range.setStart(start[0], start[1]);
range.setEnd(end[0], end[1]);
// "Otherwise, let reference node be the child of start node whose index is
// start offset, or null if there is no such child."
// "Otherwise, set referenceNode to the child of start node whose index is
// start offset, and null if there is no such child."
} else {
if (range.startOffset < range.startContainer.childNodes.length) {
referenceNode = range.startContainer.childNodes[range.startOffset];
if (typeof referenceNode == "undefined") {
} else {
referenceNode = null;
}
}
// "If reference node is null, let parent be start node."
var parent_;
if (!referenceNode) {
parent_ = range.startContainer;
// "Let parent be range's start node if referenceNode is null, and
// referenceNode's parent otherwise."
var parent_ = referenceNode === null ? range.startContainer :
referenceNode.parentNode;
// "Otherwise, let parent be the parent of reference node."
} else {
parent_ = referenceNode.parentNode;
// "Ensure pre-insertion validity of node into parent before
// referenceNode."
var error = ensurePreInsertionValidity(node, parent_, referenceNode);
if (error) {
return error;
}
// "Let new offset be the index of reference node, or parent's length if
// reference node is null."
var newOffset = referenceNode ? indexOf(referenceNode) : nodeLength(parent_);
// "If range's start node is a Text node, set referenceNode to the result
// of splitting it with offset range's start offset."
if (range.startContainer.nodeType == Node.TEXT_NODE) {
referenceNode = range.startContainer.splitText(range.startOffset);
}
// "Add node's length to new offset, if node is a DocumentFragment.
// Otherwise add one to new offset."
newOffset += node.nodeType == Node.DOCUMENT_FRAGMENT_NODE
? nodeLength(node)
: 1;
// "If node is referenceNode, set referenceNode to its next sibling."
if (node == referenceNode) {
referenceNode = referenceNode.nextSibling;
}
// "Pre-insert node into parent before reference node."
try {
// "If node's parent is not null, remove node from its parent."
if (node.parentNode) {
node.parentNode.removeChild(node);
}
// "Let newOffset be parent's length if referenceNode is null, and
// referenceNode's index otherwise."
var newOffset = referenceNode === null ? nodeLength(parent_) :
indexOf(referenceNode);
// "Increase newOffset by node's length if node is a DocumentFragment node,
// and one otherwise."
newOffset += node.nodeType == Node.DOCUMENT_FRAGMENT_NODE ?
nodeLength(node) : 1;
// "Pre-insert node into parent before referenceNode."
parent_.insertBefore(node, referenceNode);
} catch (e) {
return getDomExceptionName(e);
// "If range's start and end are the same, set range's end to (parent,
// newOffset)."
if (range.startContainer == range.endContainer
&& range.startOffset == range.endOffset) {
range.setEnd(parent_, newOffset);
}
}
// "If start and end are the same, set end to (parent, new offset)."
if (range.collapsed) {
range.setEnd(parent_, newOffset);
// To make filter() calls more readable
function isElement(node) {
return node.nodeType == Node.ELEMENT_NODE;
}
function isText(node) {
return node.nodeType == Node.TEXT_NODE;
}
function isDoctype(node) {
return node.nodeType == Node.DOCUMENT_TYPE_NODE;
}
function ensurePreInsertionValidity(node, parent_, child) {
// "If parent is not a Document, DocumentFragment, or Element node, throw a
// HierarchyRequestError."
if (parent_.nodeType != Node.DOCUMENT_NODE
&& parent_.nodeType != Node.DOCUMENT_FRAGMENT_NODE
&& parent_.nodeType != Node.ELEMENT_NODE) {
return "HIERARCHY_REQUEST_ERR";
}
// "If node is a host-including inclusive ancestor of parent, throw a
// HierarchyRequestError."
//
// XXX Does not account for host
if (isInclusiveAncestor(node, parent_)) {
return "HIERARCHY_REQUEST_ERR";
}
// "If child is not null and its parent is not parent, throw a NotFoundError
// exception."
if (child && child.parentNode != parent_) {
return "NOT_FOUND_ERR";
}
// "If node is not a DocumentFragment, DocumentType, Element, Text,
// ProcessingInstruction, or Comment node, throw a HierarchyRequestError."
if (node.nodeType != Node.DOCUMENT_FRAGMENT_NODE
&& node.nodeType != Node.DOCUMENT_TYPE_NODE
&& node.nodeType != Node.ELEMENT_NODE
&& node.nodeType != Node.TEXT_NODE
&& node.nodeType != Node.PROCESSING_INSTRUCTION_NODE
&& node.nodeType != Node.COMMENT_NODE) {
return "HIERARCHY_REQUEST_ERR";
}
// "If either node is a Text node and parent is a document, or node is a
// doctype and parent is not a document, throw a HierarchyRequestError."
if ((node.nodeType == Node.TEXT_NODE
&& parent_.nodeType == Node.DOCUMENT_NODE)
|| (node.nodeType == Node.DOCUMENT_TYPE_NODE
&& parent_.nodeType != Node.DOCUMENT_NODE)) {
return "HIERARCHY_REQUEST_ERR";
}
// "If parent is a document, and any of the statements below, switched on
// node, are true, throw a HierarchyRequestError."
if (parent_.nodeType == Node.DOCUMENT_NODE) {
switch (node.nodeType) {
case Node.DOCUMENT_FRAGMENT_NODE:
// "If node has more than one element child or has a Text node
// child. Otherwise, if node has one element child and either
// parent has an element child, child is a doctype, or child is not
// null and a doctype is following child."
if ([].filter.call(node.childNodes, isElement).length > 1) {
return "HIERARCHY_REQUEST_ERR";
}
if ([].some.call(node.childNodes, isText)) {
return "HIERARCHY_REQUEST_ERR";
}
if ([].filter.call(node.childNodes, isElement).length == 1) {
if ([].some.call(parent_.childNodes, isElement)) {
return "HIERARCHY_REQUEST_ERR";
}
if (child && child.nodeType == Node.DOCUMENT_TYPE_NODE) {
return "HIERARCHY_REQUEST_ERR";
}
if (child && [].slice.call(parent_.childNodes, indexOf(child) + 1)
.filter(isDoctype)) {
return "HIERARCHY_REQUEST_ERR";
}
}
break;
case Node.ELEMENT_NODE:
// "parent has an element child, child is a doctype, or child is
// not null and a doctype is following child."
if ([].some.call(parent_.childNodes, isElement)) {
return "HIERARCHY_REQUEST_ERR";
}
if (child.nodeType == Node.DOCUMENT_TYPE_NODE) {
return "HIERARCHY_REQUEST_ERR";
}
if (child && [].slice.call(parent_.childNodes, indexOf(child) + 1)
.filter(isDoctype)) {
return "HIERARCHY_REQUEST_ERR";
}
break;
case Node.DOCUMENT_TYPE_NODE:
// "parent has a doctype child, an element is preceding child, or
// child is null and parent has an element child."
if ([].some.call(parent_.childNodes, isDoctype)) {
return "HIERARCHY_REQUEST_ERR";
}
if (child && [].slice.call(parent_.childNodes, 0, indexOf(child))
.some(isElement)) {
return "HIERARCHY_REQUEST_ERR";
}
if (!child && [].some.call(parent_.childNodes, isElement)) {
return "HIERARCHY_REQUEST_ERR";
}
break;
}
}
}

View File

@ -18,6 +18,7 @@ MOCHITEST_MANIFESTS += [
'failures/html/dom/lists/mochitest.ini',
'failures/html/dom/mochitest.ini',
'failures/html/dom/nodes/mochitest.ini',
'failures/html/dom/ranges/mochitest.ini',
'failures/html/html/browsers/the-window-object/mochitest.ini',
'failures/html/html/browsers/the-window-object/named-access-on-the-window-object/mochitest.ini',
'failures/html/html/dom/documents/dta/doc.gEBN/mochitest.ini',

View File

@ -6,4 +6,3 @@
if (os == "win") and (version == "6.2.9200") and (processor == "x86_64") and (bits == 64): FAIL
if (os == "linux") and (version == "Ubuntu 12.04") and (processor == "x86_64") and (bits == 64): FAIL

View File

@ -1,482 +1,14 @@
[Range-insertNode.html]
type: testharness
[0,0: resulting DOM for range [paras[0\].firstChild, 0, paras[0\].firstChild, 0\], node paras[0\]]
expected: FAIL
[0,0: resulting range position for range [paras[0\].firstChild, 0, paras[0\].firstChild, 0\], node paras[0\]]
expected: FAIL
[0,1: resulting range position for range [paras[0\].firstChild, 0, paras[0\].firstChild, 0\], node paras[0\].firstChild]
expected: FAIL
[0,7: resulting DOM for range [paras[0\].firstChild, 0, paras[0\].firstChild, 0\], node document]
expected: FAIL
[0,7: resulting range position for range [paras[0\].firstChild, 0, paras[0\].firstChild, 0\], node document]
expected: FAIL
[0,9: resulting DOM for range [paras[0\].firstChild, 0, paras[0\].firstChild, 0\], node foreignDoc]
expected: FAIL
[0,9: resulting range position for range [paras[0\].firstChild, 0, paras[0\].firstChild, 0\], node foreignDoc]
expected: FAIL
[0,11: resulting DOM for range [paras[0\].firstChild, 0, paras[0\].firstChild, 0\], node xmlDoc]
expected: FAIL
[0,11: resulting range position for range [paras[0\].firstChild, 0, paras[0\].firstChild, 0\], node xmlDoc]
expected: FAIL
[0,20: resulting DOM for range [paras[0\].firstChild, 0, paras[0\].firstChild, 0\], node doctype]
expected: FAIL
[0,20: resulting range position for range [paras[0\].firstChild, 0, paras[0\].firstChild, 0\], node doctype]
expected: FAIL
[0,21: resulting DOM for range [paras[0\].firstChild, 0, paras[0\].firstChild, 0\], node foreignDoctype]
expected: FAIL
[0,21: resulting range position for range [paras[0\].firstChild, 0, paras[0\].firstChild, 0\], node foreignDoctype]
expected: FAIL
[1,0: resulting DOM for range [paras[0\].firstChild, 0, paras[0\].firstChild, 1\], node paras[0\]]
expected: FAIL
[1,0: resulting range position for range [paras[0\].firstChild, 0, paras[0\].firstChild, 1\], node paras[0\]]
expected: FAIL
[1,7: resulting DOM for range [paras[0\].firstChild, 0, paras[0\].firstChild, 1\], node document]
expected: FAIL
[1,7: resulting range position for range [paras[0\].firstChild, 0, paras[0\].firstChild, 1\], node document]
expected: FAIL
[1,9: resulting DOM for range [paras[0\].firstChild, 0, paras[0\].firstChild, 1\], node foreignDoc]
expected: FAIL
[1,9: resulting range position for range [paras[0\].firstChild, 0, paras[0\].firstChild, 1\], node foreignDoc]
expected: FAIL
[1,11: resulting DOM for range [paras[0\].firstChild, 0, paras[0\].firstChild, 1\], node xmlDoc]
expected: FAIL
[1,11: resulting range position for range [paras[0\].firstChild, 0, paras[0\].firstChild, 1\], node xmlDoc]
expected: FAIL
[1,20: resulting DOM for range [paras[0\].firstChild, 0, paras[0\].firstChild, 1\], node doctype]
expected: FAIL
[1,20: resulting range position for range [paras[0\].firstChild, 0, paras[0\].firstChild, 1\], node doctype]
expected: FAIL
[1,21: resulting DOM for range [paras[0\].firstChild, 0, paras[0\].firstChild, 1\], node foreignDoctype]
expected: FAIL
[1,21: resulting range position for range [paras[0\].firstChild, 0, paras[0\].firstChild, 1\], node foreignDoctype]
expected: FAIL
[2,0: resulting DOM for range [paras[0\].firstChild, 2, paras[0\].firstChild, 8\], node paras[0\]]
expected: FAIL
[2,0: resulting range position for range [paras[0\].firstChild, 2, paras[0\].firstChild, 8\], node paras[0\]]
expected: FAIL
[2,7: resulting DOM for range [paras[0\].firstChild, 2, paras[0\].firstChild, 8\], node document]
expected: FAIL
[2,7: resulting range position for range [paras[0\].firstChild, 2, paras[0\].firstChild, 8\], node document]
expected: FAIL
[2,9: resulting DOM for range [paras[0\].firstChild, 2, paras[0\].firstChild, 8\], node foreignDoc]
expected: FAIL
[2,9: resulting range position for range [paras[0\].firstChild, 2, paras[0\].firstChild, 8\], node foreignDoc]
expected: FAIL
[2,11: resulting DOM for range [paras[0\].firstChild, 2, paras[0\].firstChild, 8\], node xmlDoc]
expected: FAIL
[2,11: resulting range position for range [paras[0\].firstChild, 2, paras[0\].firstChild, 8\], node xmlDoc]
expected: FAIL
[2,20: resulting DOM for range [paras[0\].firstChild, 2, paras[0\].firstChild, 8\], node doctype]
expected: FAIL
[2,20: resulting range position for range [paras[0\].firstChild, 2, paras[0\].firstChild, 8\], node doctype]
expected: FAIL
[2,21: resulting DOM for range [paras[0\].firstChild, 2, paras[0\].firstChild, 8\], node foreignDoctype]
expected: FAIL
[2,21: resulting range position for range [paras[0\].firstChild, 2, paras[0\].firstChild, 8\], node foreignDoctype]
expected: FAIL
[3,0: resulting DOM for range [paras[0\].firstChild, 2, paras[0\].firstChild, 9\], node paras[0\]]
expected: FAIL
[3,0: resulting range position for range [paras[0\].firstChild, 2, paras[0\].firstChild, 9\], node paras[0\]]
expected: FAIL
[3,7: resulting DOM for range [paras[0\].firstChild, 2, paras[0\].firstChild, 9\], node document]
expected: FAIL
[3,7: resulting range position for range [paras[0\].firstChild, 2, paras[0\].firstChild, 9\], node document]
expected: FAIL
[3,9: resulting DOM for range [paras[0\].firstChild, 2, paras[0\].firstChild, 9\], node foreignDoc]
expected: FAIL
[3,9: resulting range position for range [paras[0\].firstChild, 2, paras[0\].firstChild, 9\], node foreignDoc]
expected: FAIL
[3,11: resulting DOM for range [paras[0\].firstChild, 2, paras[0\].firstChild, 9\], node xmlDoc]
expected: FAIL
[3,11: resulting range position for range [paras[0\].firstChild, 2, paras[0\].firstChild, 9\], node xmlDoc]
expected: FAIL
[3,20: resulting DOM for range [paras[0\].firstChild, 2, paras[0\].firstChild, 9\], node doctype]
expected: FAIL
[3,20: resulting range position for range [paras[0\].firstChild, 2, paras[0\].firstChild, 9\], node doctype]
expected: FAIL
[3,21: resulting DOM for range [paras[0\].firstChild, 2, paras[0\].firstChild, 9\], node foreignDoctype]
expected: FAIL
[3,21: resulting range position for range [paras[0\].firstChild, 2, paras[0\].firstChild, 9\], node foreignDoctype]
expected: FAIL
[4,2: resulting range position for range [paras[1\].firstChild, 0, paras[1\].firstChild, 0\], node paras[1\].firstChild]
expected: FAIL
[4,7: resulting DOM for range [paras[1\].firstChild, 0, paras[1\].firstChild, 0\], node document]
expected: FAIL
[4,7: resulting range position for range [paras[1\].firstChild, 0, paras[1\].firstChild, 0\], node document]
expected: FAIL
[4,9: resulting DOM for range [paras[1\].firstChild, 0, paras[1\].firstChild, 0\], node foreignDoc]
expected: FAIL
[4,9: resulting range position for range [paras[1\].firstChild, 0, paras[1\].firstChild, 0\], node foreignDoc]
expected: FAIL
[4,11: resulting DOM for range [paras[1\].firstChild, 0, paras[1\].firstChild, 0\], node xmlDoc]
expected: FAIL
[4,11: resulting range position for range [paras[1\].firstChild, 0, paras[1\].firstChild, 0\], node xmlDoc]
expected: FAIL
[4,20: resulting DOM for range [paras[1\].firstChild, 0, paras[1\].firstChild, 0\], node doctype]
expected: FAIL
[4,20: resulting range position for range [paras[1\].firstChild, 0, paras[1\].firstChild, 0\], node doctype]
expected: FAIL
[4,21: resulting DOM for range [paras[1\].firstChild, 0, paras[1\].firstChild, 0\], node foreignDoctype]
expected: FAIL
[4,21: resulting range position for range [paras[1\].firstChild, 0, paras[1\].firstChild, 0\], node foreignDoctype]
expected: FAIL
[5,7: resulting DOM for range [paras[1\].firstChild, 2, paras[1\].firstChild, 9\], node document]
expected: FAIL
[5,7: resulting range position for range [paras[1\].firstChild, 2, paras[1\].firstChild, 9\], node document]
expected: FAIL
[5,9: resulting DOM for range [paras[1\].firstChild, 2, paras[1\].firstChild, 9\], node foreignDoc]
expected: FAIL
[5,9: resulting range position for range [paras[1\].firstChild, 2, paras[1\].firstChild, 9\], node foreignDoc]
expected: FAIL
[5,11: resulting DOM for range [paras[1\].firstChild, 2, paras[1\].firstChild, 9\], node xmlDoc]
expected: FAIL
[5,11: resulting range position for range [paras[1\].firstChild, 2, paras[1\].firstChild, 9\], node xmlDoc]
expected: FAIL
[5,20: resulting DOM for range [paras[1\].firstChild, 2, paras[1\].firstChild, 9\], node doctype]
expected: FAIL
[5,20: resulting range position for range [paras[1\].firstChild, 2, paras[1\].firstChild, 9\], node doctype]
expected: FAIL
[5,21: resulting DOM for range [paras[1\].firstChild, 2, paras[1\].firstChild, 9\], node foreignDoctype]
expected: FAIL
[5,21: resulting range position for range [paras[1\].firstChild, 2, paras[1\].firstChild, 9\], node foreignDoctype]
expected: FAIL
[6,5: resulting DOM for range [detachedPara1.firstChild, 0, detachedPara1.firstChild, 0\], node detachedPara1]
expected: FAIL
[6,5: resulting range position for range [detachedPara1.firstChild, 0, detachedPara1.firstChild, 0\], node detachedPara1]
expected: FAIL
[6,6: resulting range position for range [detachedPara1.firstChild, 0, detachedPara1.firstChild, 0\], node detachedPara1.firstChild]
expected: FAIL
[6,7: resulting DOM for range [detachedPara1.firstChild, 0, detachedPara1.firstChild, 0\], node document]
expected: FAIL
[6,7: resulting range position for range [detachedPara1.firstChild, 0, detachedPara1.firstChild, 0\], node document]
expected: FAIL
[6,8: resulting DOM for range [detachedPara1.firstChild, 0, detachedPara1.firstChild, 0\], node detachedDiv]
expected: FAIL
[6,8: resulting range position for range [detachedPara1.firstChild, 0, detachedPara1.firstChild, 0\], node detachedDiv]
expected: FAIL
[6,9: resulting DOM for range [detachedPara1.firstChild, 0, detachedPara1.firstChild, 0\], node foreignDoc]
expected: FAIL
[6,9: resulting range position for range [detachedPara1.firstChild, 0, detachedPara1.firstChild, 0\], node foreignDoc]
expected: FAIL
[6,11: resulting DOM for range [detachedPara1.firstChild, 0, detachedPara1.firstChild, 0\], node xmlDoc]
expected: FAIL
[6,11: resulting range position for range [detachedPara1.firstChild, 0, detachedPara1.firstChild, 0\], node xmlDoc]
expected: FAIL
[6,20: resulting DOM for range [detachedPara1.firstChild, 0, detachedPara1.firstChild, 0\], node doctype]
expected: FAIL
[6,20: resulting range position for range [detachedPara1.firstChild, 0, detachedPara1.firstChild, 0\], node doctype]
expected: FAIL
[6,21: resulting DOM for range [detachedPara1.firstChild, 0, detachedPara1.firstChild, 0\], node foreignDoctype]
expected: FAIL
[6,21: resulting range position for range [detachedPara1.firstChild, 0, detachedPara1.firstChild, 0\], node foreignDoctype]
expected: FAIL
[7,5: resulting DOM for range [detachedPara1.firstChild, 2, detachedPara1.firstChild, 8\], node detachedPara1]
expected: FAIL
[7,5: resulting range position for range [detachedPara1.firstChild, 2, detachedPara1.firstChild, 8\], node detachedPara1]
expected: FAIL
[7,7: resulting DOM for range [detachedPara1.firstChild, 2, detachedPara1.firstChild, 8\], node document]
expected: FAIL
[7,7: resulting range position for range [detachedPara1.firstChild, 2, detachedPara1.firstChild, 8\], node document]
expected: FAIL
[7,8: resulting DOM for range [detachedPara1.firstChild, 2, detachedPara1.firstChild, 8\], node detachedDiv]
expected: FAIL
[7,8: resulting range position for range [detachedPara1.firstChild, 2, detachedPara1.firstChild, 8\], node detachedDiv]
expected: FAIL
[7,9: resulting DOM for range [detachedPara1.firstChild, 2, detachedPara1.firstChild, 8\], node foreignDoc]
expected: FAIL
[7,9: resulting range position for range [detachedPara1.firstChild, 2, detachedPara1.firstChild, 8\], node foreignDoc]
expected: FAIL
[7,11: resulting DOM for range [detachedPara1.firstChild, 2, detachedPara1.firstChild, 8\], node xmlDoc]
expected: FAIL
[7,11: resulting range position for range [detachedPara1.firstChild, 2, detachedPara1.firstChild, 8\], node xmlDoc]
expected: FAIL
[7,20: resulting DOM for range [detachedPara1.firstChild, 2, detachedPara1.firstChild, 8\], node doctype]
expected: FAIL
[7,20: resulting range position for range [detachedPara1.firstChild, 2, detachedPara1.firstChild, 8\], node doctype]
expected: FAIL
[7,21: resulting DOM for range [detachedPara1.firstChild, 2, detachedPara1.firstChild, 8\], node foreignDoctype]
expected: FAIL
[7,21: resulting range position for range [detachedPara1.firstChild, 2, detachedPara1.firstChild, 8\], node foreignDoctype]
expected: FAIL
[8,3: resulting DOM for range [foreignPara1.firstChild, 0, foreignPara1.firstChild, 0\], node foreignPara1]
expected: FAIL
[8,3: resulting range position for range [foreignPara1.firstChild, 0, foreignPara1.firstChild, 0\], node foreignPara1]
expected: FAIL
[8,4: resulting range position for range [foreignPara1.firstChild, 0, foreignPara1.firstChild, 0\], node foreignPara1.firstChild]
expected: FAIL
[8,7: resulting DOM for range [foreignPara1.firstChild, 0, foreignPara1.firstChild, 0\], node document]
expected: FAIL
[8,7: resulting range position for range [foreignPara1.firstChild, 0, foreignPara1.firstChild, 0\], node document]
expected: FAIL
[8,9: resulting DOM for range [foreignPara1.firstChild, 0, foreignPara1.firstChild, 0\], node foreignDoc]
expected: FAIL
[8,9: resulting range position for range [foreignPara1.firstChild, 0, foreignPara1.firstChild, 0\], node foreignDoc]
expected: FAIL
[8,11: resulting DOM for range [foreignPara1.firstChild, 0, foreignPara1.firstChild, 0\], node xmlDoc]
expected: FAIL
[8,11: resulting range position for range [foreignPara1.firstChild, 0, foreignPara1.firstChild, 0\], node xmlDoc]
expected: FAIL
[8,20: resulting DOM for range [foreignPara1.firstChild, 0, foreignPara1.firstChild, 0\], node doctype]
expected: FAIL
[8,20: resulting range position for range [foreignPara1.firstChild, 0, foreignPara1.firstChild, 0\], node doctype]
expected: FAIL
[8,21: resulting DOM for range [foreignPara1.firstChild, 0, foreignPara1.firstChild, 0\], node foreignDoctype]
expected: FAIL
[8,21: resulting range position for range [foreignPara1.firstChild, 0, foreignPara1.firstChild, 0\], node foreignDoctype]
expected: FAIL
[9,3: resulting DOM for range [foreignPara1.firstChild, 2, foreignPara1.firstChild, 8\], node foreignPara1]
expected: FAIL
[9,3: resulting range position for range [foreignPara1.firstChild, 2, foreignPara1.firstChild, 8\], node foreignPara1]
expected: FAIL
[9,7: resulting DOM for range [foreignPara1.firstChild, 2, foreignPara1.firstChild, 8\], node document]
expected: FAIL
[9,7: resulting range position for range [foreignPara1.firstChild, 2, foreignPara1.firstChild, 8\], node document]
expected: FAIL
[9,9: resulting DOM for range [foreignPara1.firstChild, 2, foreignPara1.firstChild, 8\], node foreignDoc]
expected: FAIL
[9,9: resulting range position for range [foreignPara1.firstChild, 2, foreignPara1.firstChild, 8\], node foreignDoc]
expected: FAIL
[9,11: resulting DOM for range [foreignPara1.firstChild, 2, foreignPara1.firstChild, 8\], node xmlDoc]
expected: FAIL
[9,11: resulting range position for range [foreignPara1.firstChild, 2, foreignPara1.firstChild, 8\], node xmlDoc]
expected: FAIL
[9,20: resulting DOM for range [foreignPara1.firstChild, 2, foreignPara1.firstChild, 8\], node doctype]
expected: FAIL
[9,20: resulting range position for range [foreignPara1.firstChild, 2, foreignPara1.firstChild, 8\], node doctype]
expected: FAIL
[9,21: resulting DOM for range [foreignPara1.firstChild, 2, foreignPara1.firstChild, 8\], node foreignDoctype]
expected: FAIL
[9,21: resulting range position for range [foreignPara1.firstChild, 2, foreignPara1.firstChild, 8\], node foreignDoctype]
expected: FAIL
[18,0: resulting DOM for range [paras[0\].firstChild, 0, paras[1\].firstChild, 0\], node paras[0\]]
expected: FAIL
[18,0: resulting range position for range [paras[0\].firstChild, 0, paras[1\].firstChild, 0\], node paras[0\]]
expected: FAIL
[18,7: resulting DOM for range [paras[0\].firstChild, 0, paras[1\].firstChild, 0\], node document]
expected: FAIL
[18,7: resulting range position for range [paras[0\].firstChild, 0, paras[1\].firstChild, 0\], node document]
expected: FAIL
[18,9: resulting DOM for range [paras[0\].firstChild, 0, paras[1\].firstChild, 0\], node foreignDoc]
expected: FAIL
[18,9: resulting range position for range [paras[0\].firstChild, 0, paras[1\].firstChild, 0\], node foreignDoc]
expected: FAIL
[18,11: resulting DOM for range [paras[0\].firstChild, 0, paras[1\].firstChild, 0\], node xmlDoc]
expected: FAIL
[18,11: resulting range position for range [paras[0\].firstChild, 0, paras[1\].firstChild, 0\], node xmlDoc]
expected: FAIL
[18,20: resulting DOM for range [paras[0\].firstChild, 0, paras[1\].firstChild, 0\], node doctype]
expected: FAIL
[18,20: resulting range position for range [paras[0\].firstChild, 0, paras[1\].firstChild, 0\], node doctype]
expected: FAIL
[18,21: resulting DOM for range [paras[0\].firstChild, 0, paras[1\].firstChild, 0\], node foreignDoctype]
expected: FAIL
[18,21: resulting range position for range [paras[0\].firstChild, 0, paras[1\].firstChild, 0\], node foreignDoctype]
expected: FAIL
[19,0: resulting DOM for range [paras[0\].firstChild, 0, paras[1\].firstChild, 8\], node paras[0\]]
expected: FAIL
[19,0: resulting range position for range [paras[0\].firstChild, 0, paras[1\].firstChild, 8\], node paras[0\]]
expected: FAIL
[19,7: resulting DOM for range [paras[0\].firstChild, 0, paras[1\].firstChild, 8\], node document]
expected: FAIL
[19,7: resulting range position for range [paras[0\].firstChild, 0, paras[1\].firstChild, 8\], node document]
expected: FAIL
[19,9: resulting DOM for range [paras[0\].firstChild, 0, paras[1\].firstChild, 8\], node foreignDoc]
expected: FAIL
[19,9: resulting range position for range [paras[0\].firstChild, 0, paras[1\].firstChild, 8\], node foreignDoc]
expected: FAIL
[19,11: resulting DOM for range [paras[0\].firstChild, 0, paras[1\].firstChild, 8\], node xmlDoc]
expected: FAIL
[19,11: resulting range position for range [paras[0\].firstChild, 0, paras[1\].firstChild, 8\], node xmlDoc]
expected: FAIL
[19,20: resulting DOM for range [paras[0\].firstChild, 0, paras[1\].firstChild, 8\], node doctype]
expected: FAIL
[19,20: resulting range position for range [paras[0\].firstChild, 0, paras[1\].firstChild, 8\], node doctype]
expected: FAIL
[19,21: resulting DOM for range [paras[0\].firstChild, 0, paras[1\].firstChild, 8\], node foreignDoctype]
expected: FAIL
[19,21: resulting range position for range [paras[0\].firstChild, 0, paras[1\].firstChild, 8\], node foreignDoctype]
expected: FAIL
[20,0: resulting DOM for range [paras[0\].firstChild, 3, paras[3\], 1\], node paras[0\]]
expected: FAIL
[20,0: resulting range position for range [paras[0\].firstChild, 3, paras[3\], 1\], node paras[0\]]
expected: FAIL
[20,7: resulting DOM for range [paras[0\].firstChild, 3, paras[3\], 1\], node document]
expected: FAIL
[20,7: resulting range position for range [paras[0\].firstChild, 3, paras[3\], 1\], node document]
expected: FAIL
[20,9: resulting DOM for range [paras[0\].firstChild, 3, paras[3\], 1\], node foreignDoc]
expected: FAIL
[20,9: resulting range position for range [paras[0\].firstChild, 3, paras[3\], 1\], node foreignDoc]
expected: FAIL
[20,11: resulting DOM for range [paras[0\].firstChild, 3, paras[3\], 1\], node xmlDoc]
expected: FAIL
[20,11: resulting range position for range [paras[0\].firstChild, 3, paras[3\], 1\], node xmlDoc]
expected: FAIL
[20,20: resulting DOM for range [paras[0\].firstChild, 3, paras[3\], 1\], node doctype]
expected: FAIL
[20,20: resulting range position for range [paras[0\].firstChild, 3, paras[3\], 1\], node doctype]
expected: FAIL
[20,21: resulting DOM for range [paras[0\].firstChild, 3, paras[3\], 1\], node foreignDoctype]
expected: FAIL
[20,21: resulting range position for range [paras[0\].firstChild, 3, paras[3\], 1\], node foreignDoctype]
expected: FAIL

View File

@ -1,7 +1,7 @@
[event_setattribute.html]
type: testharness
disabled:
if e10s and os == "linux": https://bugzilla.mozilla.org/show_bug.cgi?id=1210717
if e10s and (os == "linux"): https://bugzilla.mozilla.org/show_bug.cgi?id=1210717
[localStorage mutations fire StorageEvents that are caught by the event listener attached via setattribute.]
expected: FAIL