This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 15532 - Collapsing or extending to a ProcessingInstruction should be OK
Summary: Collapsing or extending to a ProcessingInstruction should be OK
Status: RESOLVED FIXED
Alias: None
Product: WebAppsWG
Classification: Unclassified
Component: HISTORICAL - HTML Editing APIs (show other bugs)
Version: unspecified
Hardware: All All
: P2 normal
Target Milestone: ---
Assignee: Aryeh Gregor
QA Contact: HTML Editing APIs spec bugbot
URL: http://dvcs.w3.org/hg/editing/raw-fil...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-01-12 12:47 UTC by Stig Halvorsen
Modified: 2012-01-12 15:24 UTC (History)
2 users (show)

See Also:


Attachments
Test patch, PI (1.98 KB, patch)
2012-01-12 12:47 UTC, Stig Halvorsen
Details

Description Stig Halvorsen 2012-01-12 12:47:00 UTC
Created attachment 1065 [details]
Test patch, PI

In the selecttest/collapse.html and selecttest/extend.html tests there are a few tests that expect the browser to throw an INVALID_NODE_TYPE_ERR when trying to collapse or extend to a PI.
According to the Selection [1] and Range [2] specs, it is not illegal to do that, so I think the tests are wrong.

Patch attached.

[1]
http://dvcs.w3.org/hg/editing/raw-file/tip/editing.html#dom-selection-collapse
http://dvcs.w3.org/hg/editing/raw-file/tip/editing.html#dom-selection-extend

[2]
http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#concept-range-bp-set
Comment 1 Aryeh Gregor 2012-01-12 15:24:17 UTC
Thanks!  Accepted:

http://dvcs.w3.org/hg/editing/rev/9ca0bc5d4285

These checks date back from before DOM4 declared ProcessingInstructions to be CharacterData.  They weren't allowed as Range endpoints because they were an annoying special case.  Now they're allowed just like Text and Comment, with no extra spec effort, but the tests weren't updated.