Range.insertNode() on a detached text node throws nonstandard exception type

RESOLVED FIXED in mozilla14

Status

()

Core
DOM: Core & HTML
--
minor
RESOLVED FIXED
6 years ago
4 years ago

People

(Reporter: ayg, Assigned: ayg)

Tracking

Trunk
mozilla14
Points:
---
Bug Flags:
in-testsuite +

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

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
Assignee: nobody → ayg
Status: NEW → ASSIGNED
Created attachment 607689 [details] [diff] [review]
Patch v1
Attachment #607689 - Flags: review?(bugs)
Whiteboard: [autoland-try:-u all]

Updated

6 years ago
Whiteboard: [autoland-try:-u all] → [autoland-in-queue]

Comment 2

6 years ago
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

Updated

6 years ago
Attachment #607689 - Flags: review?(bugs) → review+

Comment 3

6 years ago
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.

Updated

6 years ago
Whiteboard: [autoland-in-queue]
http://hg.mozilla.org/integration/mozilla-inbound/rev/7e895f6e79e6
Flags: in-testsuite+
OS: Linux → All
Hardware: x86 → All
Target Milestone: --- → mozilla14
https://hg.mozilla.org/mozilla-central/rev/7e895f6e79e6
Status: ASSIGNED → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → FIXED
Component: DOM: Traversal-Range → DOM: Core & HTML
Product: Core → Core
You need to log in before you can comment on or make changes to this bug.