Open
Bug 148542
Opened 22 years ago
Updated 2 years ago
Make HandleEventWithTarget work with display: none content
Categories
(Core :: DOM: UI Events & Focus Handling, defect)
Tracking
()
NEW
Future
People
(Reporter: john, Unassigned)
References
Details
(Whiteboard: [FIX])
Attachments
(1 file, 1 obsolete file)
(deleted),
patch
|
bryner
:
superreview+
|
Details | Diff | Splinter Review |
When the frame does not exist for a piece of content (as in the case of display:
none), PresShell::HandleEventWithTarget() does not send the event to the
content. This is wrong behavior, IMO. Some content has definite things it can
do when it receives events, regardless of what frame it is using--forms with
submit/reset events are a good example.
When this is fixed, nsHTMLFormElement::Submit() and Reset() should be fixed to
call HandleEventWithTarget() (they bypass HandleEventWithTarget() as of bug 125578).
Updated•22 years ago
|
QA Contact: rakeshmishra → trix
Reporter | ||
Comment 1•22 years ago
|
||
I have changed my mind on this; the PresShell should not be the main place you
send DOM events, period. You can still send DOM events to content in a display:
none iframe and in those cases there will be no PresShell. Thus this shifts to
"stop calling PresShell's HandleEventWithTarget() so much and provide an
alternative."
Reporter | ||
Updated•22 years ago
|
Status: NEW → ASSIGNED
Target Milestone: --- → Future
Reporter | ||
Comment 2•22 years ago
|
||
This patch:
(1) nsCOMPtr-izes and nsCOMArray-izes the event content in nsPresShell.cpp
(2) makes HandleEventWithTarget() / HandleEvent() / HandleEventInternal() work
when no frame exists
(3) makes HandleDOMEventWithTarget() call HandleEventWithTarget() so that it
has the second pass and Pre/PostHandleEvent and everything--in short, so that
we only have one major event firing path in presshell (and perhaps can
eventually collapse that with ESM)
(4) tries to make frame / content setting more consistent, specifically ensure
that content is immediately set
(5) Moves the logic to figure out which frame the gui event refers to into its
own function to make HandleEvent() more readable
I have been running through a bunch of sites and no problems so far; haven't
tested *every* possible function in Mozilla but I have run through a lot and it
works as expected. Form submission and form controls work well; one thing I
made sure to do was hit enter in an input to ensure that
HandleDOMEventWithTarget() works.
Reporter | ||
Comment 3•22 years ago
|
||
CC'ing some events dudes.
One thing that setting the content immediately does is it ensures that we always
call GetContentForEvent() instead of GetContent(). GetContentForEvent() has
several extra things it does, including the logic for image maps and canvas
frame voodoo. I have not found a case where this matters yet, but I can guess
there are a goodly number of edge cases where it does.
The major thing this does is make HandleDOMEventWithTarget go through the same
path as other stuff, which will aid in future element dispatch rewrite stuff by
having fewer code paths to consolidate and test.
Reporter | ||
Updated•22 years ago
|
Whiteboard: [FIX]
Reporter | ||
Updated•22 years ago
|
Attachment #110264 -
Flags: review?(bryner)
Reporter | ||
Comment 4•22 years ago
|
||
bryner and I spoke last night and the major potential objection to switching
HandleDOMEventWithTarget() to use HandleEventWithTarget() is that retargeting
would occur even if you do. Retargeting in HandleEventWithTarget() is pretty
lame anyway--it should either (a) be done by the caller or (b)
HandleEventWithTarget() should be named HandleGUIEventWithTarget() and call the
real HandleEventWithTarget() after retargeting.
It still has its merits:
- event groups (system event group + normal) would happen for DOM events
- PreHandleEvent / PostHandleEvent gets called (important when you fire mouse /
key events at content)
Reporter | ||
Comment 5•22 years ago
|
||
Same patch, updated to tip. I had to merge in aaronl's keydead patch for bug
110718; I put that into HandleEventWithTarget() since it's not doing the same
thing as SetRealEventInfo(). ctrl+T works fine while the document is in the
in-between state.
I will need to either (a) not have HandleDOMEventWithTarget call
HandleEventWithTarget() for now and file another bug; or (b) fix the
retargeting issues by moving retargeting to the callers. (b) is preferable but
depends on time. This patch should not be reviewed, it's just for transport.
Reporter | ||
Updated•22 years ago
|
Attachment #110264 -
Attachment is obsolete: true
Reporter | ||
Updated•22 years ago
|
Attachment #110264 -
Flags: review?(bryner)
Reporter | ||
Updated•22 years ago
|
Attachment #111407 -
Flags: review?(bryner)
Reporter | ||
Comment 6•22 years ago
|
||
Comment on attachment 111407 [details] [diff] [review]
Patch v1.0.1
So as it turns out, this patch *is* The One. HandleEventInternal() is the
method being called, and that one doesn't have any retargeting.
Attachment #111407 -
Attachment description: Patch v1.0.1, for transport → Patch v1.0.1
Reporter | ||
Updated•22 years ago
|
Attachment #111407 -
Flags: superreview?(bryner)
Attachment #111407 -
Flags: review?(saari)
Attachment #111407 -
Flags: review?(bryner)
Comment 7•22 years ago
|
||
Is there a real test case that this is fixing, or theoretical behavior? What
does IE do in this case?
Reporter | ||
Comment 8•22 years ago
|
||
saari: this is theoretical behavior, and cleanup of the code. It is more of a
stepping stone for other bugs I'm working on and helps pave the way to add event
groups and do some of the other events cleanup. bryner has gone through it,
btw, and was ok with it.
Reporter | ||
Comment 9•22 years ago
|
||
What this basically boils down to is that the major path in our code, the one in
which we do rudimentary event groups (the system pass) and prehandle /
posthandleevent stuff, *cannot* be used for many events and content. This fixes
that and makes it so we have one place we can modify to do things like good
event groups.
Updated•22 years ago
|
Attachment #111407 -
Flags: superreview?(bryner) → superreview+
Updated•19 years ago
|
Attachment #111407 -
Flags: review?(saari) → review?(bzbarsky)
Comment 10•19 years ago
|
||
Matti, does that patch apply to current trunk?
Comment 11•19 years ago
|
||
Sorry, i don't know..
I just found it and I thought it would be nice to get itz in the tree if it
still works....
Comment 12•19 years ago
|
||
Ah, I just tried... 9 of the 13 hunks don't apply.
We do want this change (for 1.9, probably), but it'd basically have to be redone
(with the patch as cribnotes, possibly).
Comment 13•19 years ago
|
||
Comment on attachment 111407 [details] [diff] [review]
Patch v1.0.1
Removing request pending patch that actually applies and has been tested...
Attachment #111407 -
Flags: review?(bzbarsky)
Comment 14•18 years ago
|
||
So... is this relevant in today's world? I only see the ESM calling HandleEventWithTarget now...
Updated•15 years ago
|
QA Contact: trix → events
Assignee | ||
Updated•6 years ago
|
Component: Event Handling → User events and focus handling
Comment 15•3 years ago
|
||
The bug assignee didn't login in Bugzilla in the last 7 months.
:hsinyi, could you have a look please?
For more information, please visit auto_nag documentation.
Assignee: john → nobody
Status: ASSIGNED → NEW
Flags: needinfo?(htsai)
Updated•3 years ago
|
Flags: needinfo?(htsai)
Updated•2 years ago
|
Severity: normal → S3
You need to log in
before you can comment on or make changes to this bug.
Description
•