Support addEventListener on W3C Range objects

VERIFIED INVALID

Status

()

--
enhancement
VERIFIED INVALID
7 years ago
7 years ago

People

(Reporter: chenzx, Unassigned)

Tracking

Trunk
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Reporter)

Description

7 years ago
User Agent: Mozilla/5.0 (Windows NT 5.1; rv:10.0.2) Gecko/20100101 Firefox/10.0.2
Build ID: 20120215223356

Steps to reproduce:

i encounter a problem in dev recently:
i need to do some tricks on text string in html dom document
-- i need to select a sentence intelligently within a text string

currently
i parse the document tree & contruct a series of Range objects
& and then `surroundContents` with a <span> element
and bind events on these <span>'s using  `surroundContents` API

sometimes, call to `surroundContents` may fail accounding to W3C Range API spec

My question is, why cannot just addEventListener on W3C Range objects,
so that i do NOT need to insert extra <span> elements to modify the DOM tree?


Actual results:

This is feature request.


Expected results:

This is feature request.
(Reporter)

Comment 1

7 years ago
Also,
wouldn't it be nice if we can simply make a Range object highlight-able?
Selection highlight currently seems to be browser internal default behavour.
(Reporter)

Comment 2

7 years ago
Created attachment 604298 [details]
a test html explains what i want to do

Updated

7 years ago
Attachment #604298 - Attachment mime type: text/plain → text/html

Updated

7 years ago
Severity: normal → enhancement
Component: Untriaged → DOM
OS: Windows XP → All
Product: Firefox → Core
QA Contact: untriaged → general
Hardware: x86 → All
Version: 10 Branch → Trunk

Comment 3

7 years ago
If you want to change standardized DOM APIs, please file bugs on W3C https://www.w3.org/Bugs/Public/
Status: UNCONFIRMED → RESOLVED
Last Resolved: 7 years ago
Resolution: --- → INVALID
Verified. This would be in violation of the spec: <https://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html>
Status: RESOLVED → VERIFIED
(Reporter)

Comment 5

7 years ago
sorry, i didn't see any `violation `
this is a feature enhancement, not a `change` to W3C DOM spec,

btw, a multiline <span> will internally contain render-elements for each line, these are NOT parts of DOM tree, so as to Range, which should also be possible to implement event listener using some internal sync-shadow fragment nodes.

This can also make web dev more easier, -- Hey, if one says Mozilla/Firefox MUST fully obey the W3C spec and any feature enhancement needs will be ignored, then W3C obeys whom? That saying would be irresponsible doubtly.
You need to log in before you can comment on or make changes to this bug.