Open Bug 662335 Opened 13 years ago Updated 2 years ago

Remove support for event.originalTarget and event.explicitOriginalTarget on DOM events

Categories

(Core :: DOM: Events, task, P3)

task

Tracking

()

People

(Reporter: bruant.d, Unassigned)

References

(Blocks 2 open bugs)

Details

(Keywords: dev-doc-needed, site-compat)

These two properties are documented here: https://developer.mozilla.org/en/DOM/event/Comparison_of_Event_Targets
However, I have never seen them being used, there is no support in other browser I'd be aware of and current standard event properties (target & currentTarget) seems to enough to cover people use cases.
Blocks: 481510
Blocks: 517007
Blocks: 343032
> However, I have never seen them being used

http://mxr.mozilla.org/mozilla-central/search?string=originalTarget&find=.js&findi=&filter=^[^\0]*%24&hitlimit=&tree=mozilla-central

These are needed to deal with XBL-bound anonymous content.  Browsers that don't implement XBL don't need these properties, of course.

We could moz-prefix these, I guess, but that would be a pretty significant change.
.originalEventTarget is coming from http://www.w3.org/TR/2001/NOTE-xbl-20010223/#anonymous-events-scopes
(Not that Gecko's XBL1 implementation is exactly what that W3C note defines)
Ok, changing bug title accordingly.
Since these properties aren't part of the DOM Event Spec, then, specifically on DOM events, they should be removed.
Summary: remove support for event.originalTarget and event.explicitOriginalTarget → Remove support for event.originalTarget and event.explicitOriginalTarget on DOM events
You seem to have completely misunderstood comment 1 and comment 2....
(In reply to comment #4)
> You seem to have completely misunderstood comment 1 and comment 2....
Maybe? :-s

Ok, Hmm... My understanding is that XBL needs these properties, so they shouldn't be removed entirely (and your link to mxr was a proof that they are used in Mozilla codebase)
However, the DOM event spec doesn't define these properties (that's why I filed this bug under the "DOM:Event" component).

But maybe I misunderstand what XBL is. From what I've read on the spec, this isn't part of any DOM&friends spec.
I guess I should restart by asking the question: is XBL something that web developers use? want to use? Is it relevant to provide XBL features to web developers?
And if not, should it be hidden to them? I don't know if bug 343032 and bug 517007 are still up-to-date, but if they are, it would be some indication that this feature isn't really safe to expose to web developers. Worst case, it could turn into an obscure security issue.
> is XBL something that web developers use?

Not anymore, but they used to.

> want to use?

Yes.

> Is it relevant to provide XBL features to web developers?

The question is how to tell apart "web developers" and "extension developers"; they're both programming to the same DOM event model.
OS: Linux → All
Hardware: x86 → All
Depends on: war-on-xbl
Priority: -- → P3
Type: defect → task
No longer depends on: war-on-xbl
No longer blocks: 343032
Blocks: 674696
No longer blocks: 517007
Depends on: 1699809

I have a usecase for explicitOriginalTarget:

I like to prevent links from navigating if i press inside a contenteditable-element that is inside that link.
The same also if the contenteditable-element has focus and i press enter (also a click event is fired)
But in Firefox, to find out that I pressed enter inside a contenteditable element, i need explicitOriginalTarget

Probably, like in chrome, the contenteditable-element should not fire click in that case.

https://jsfiddle.net/wbdxtr47/10/

Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.