Last Comment Bug 737612 - Range.insertNode() on a detached text node throws nonstandard exception type
: Range.insertNode() on a detached text node throws nonstandard exception type
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: DOM: Core & HTML (show other bugs)
: Trunk
: All All
: -- minor (vote)
: mozilla14
Assigned To: :Aryeh Gregor (working until September 2)
:
Mentors:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-03-20 13:25 PDT by :Aryeh Gregor (working until September 2)
Modified: 2013-04-04 13:53 PDT (History)
2 users (show)
ayg: in‑testsuite+
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
Patch v1 (2.66 KB, patch)
2012-03-20 13:32 PDT, :Aryeh Gregor (working until September 2)
bugs: review+
Details | Diff | Splinter Review

Description :Aryeh Gregor (working until September 2) 2012-03-20 13:25:59 PDT
Test-case:

data:text/html,<!DOCTYPE html>
<script>
var text = document.createTextNode("abc");
var range = document.createRange();
range.setStart(text, 1);
try {
range.insertNode(document.head);
} catch(e) {
document.documentElement.textContent = e
}
</script>

Gecko outputs

"""
[Exception... "Component returned failure code: 0x8000ffff (NS_ERROR_UNEXPECTED) [nsIDOMRange.insertNode]" nsresult: "0x8000ffff (NS_ERROR_UNEXPECTED)" location: "JS frame :: http://software.hixie.ch/utilities/js/live-dom-viewer/# :: <TOP_LEVEL> :: line 7" data: no]
"""

Chrome 19 dev is a HIERARCHY_REQUEST_ERR.  Opera Next 12.00 alpha is BAD_BOUNDARYPOINTS_ERR (which no longer exists).  IE10 Developer Preview actually succeeds (?!?).  The spec goes like Chrome:

"""
If start node is a Comment node, or a Text node whose parent is null, throw an "HierarchyRequestError" exception and terminate these steps.
"""
http://dvcs.w3.org/hg/domcore/raw-file/tip/dom-core.html#dom-range-insertnode

This causes failures here: http://w3c-test.org/webapps/DOMCore/tests/approved/Range-insertNode.html
Comment 1 :Aryeh Gregor (working until September 2) 2012-03-20 13:32:41 PDT
Created attachment 607689 [details] [diff] [review]
Patch v1
Comment 2 Mozilla RelEng Bot 2012-03-20 13:37:17 PDT
Autoland Patchset:
	Patches: 607689
	Branch: mozilla-central => try
	Destination: http://hg.mozilla.org/try/pushloghtml?changeset=584e5d522b3e
Try run started, revision 584e5d522b3e. To cancel or monitor the job, see: https://tbpl.mozilla.org/?tree=Try&rev=584e5d522b3e
Comment 3 Mozilla RelEng Bot 2012-03-21 06:53:54 PDT
Try run for 584e5d522b3e is complete.
Detailed breakdown of the results available here:
    https://tbpl.mozilla.org/?tree=Try&rev=584e5d522b3e
Results (out of 179 total builds):
    exception: 3
    success: 143
    warnings: 23
    failure: 10
Builds (or logs if builds failed) available at:
http://ftp.mozilla.org/pub/mozilla.org/firefox/try-builds/autolanduser@mozilla.com-584e5d522b3e
 Timed out after 12 hours without completing.
Comment 4 :Aryeh Gregor (working until September 2) 2012-03-21 09:30:55 PDT
http://hg.mozilla.org/integration/mozilla-inbound/rev/7e895f6e79e6
Comment 5 Marco Bonardo [::mak] 2012-03-22 06:26:56 PDT
https://hg.mozilla.org/mozilla-central/rev/7e895f6e79e6

Note You need to log in before you can comment on or make changes to this bug.