XBL-interleaved anonymous content does not get DOM events

RESOLVED FIXED in mozilla0.9

Status

()

Core
XBL
P3
normal
RESOLVED FIXED
18 years ago
17 years ago

People

(Reporter: David Hyatt, Assigned: Dan Rosen)

Tracking

Trunk
mozilla0.9
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [xbl1.0])

Attachments

(2 attachments)

(Reporter)

Description

18 years ago
Anonymous content interleaved with explicit content does not get any DOM 
events.
(Reporter)

Updated

18 years ago
Status: NEW → ASSIGNED
Keywords: nsbeta2

Comment 1

18 years ago
How does this affect the user?  Need more infor to make the nsbeta2 call please.
Whiteboard: [NEED INFO]
(Reporter)

Comment 2

18 years ago
Right now anonymous content is being given back as event.target of DOM events.  
This is even being done for non-XBL anonymous content like the file control or 
Ender Lite.  When you turn on Ender Lite, any javascript that relies on 
event.target being the textfield is going to break.

Similarly, any JS that examines the event.target for the HTML4 file control will 
not be correct either.

Comment 3

18 years ago
Putting on [nsbeta2+] radar.  Will retest when new tree work is in.
Whiteboard: [NEED INFO] → [nsbeta2+]

Comment 4

18 years ago
Ignore my comment "Will retest when new tree work is in."
(Reporter)

Comment 5

18 years ago
joki's gonna hack around this.  he has an nsbeta2+ bug already for the HTML 
widgets.  The XUL widgets can wait until beta3.
Keywords: nsbeta2
Whiteboard: [nsbeta2+]

Comment 6

18 years ago
Adding nsbeta3 keyword.
Keywords: nsbeta3

Updated

18 years ago
Whiteboard: nsbeta3-
Target Milestone: --- → Future
(Reporter)

Updated

18 years ago
Whiteboard: nsbeta3- → [xbl1.0][nsbeta3-]
Target Milestone: Future → M18
(Reporter)

Updated

18 years ago
Summary: XBL anonymous content does not get DOM events → XBL-interleaved anonymous content does not get DOM events

Comment 7

18 years ago
mass-moving xbl1.0 bugs to future, adding helpwanted keyword
Keywords: helpwanted
Target Milestone: M18 → Future

Comment 8

17 years ago
->moz0.9
Target Milestone: Future → mozilla0.9

Comment 9

17 years ago
->dr
Assignee: hyatt → dr
Status: ASSIGNED → NEW
(Assignee)

Comment 10

17 years ago
hyatt: does this still happen since your insertion points rewrite? also, is this
windows-only or xp?
Status: NEW → ASSIGNED
(Assignee)

Comment 11

17 years ago
Pushing to 0.9.1 (my time for XUL/XBL, it looks like) to have more time for work
on embedding feature-completeness in 0.9.
Target Milestone: mozilla0.9 → mozilla0.9.1
(Assignee)

Comment 12

17 years ago
Back to 0.9. This is important, and is easier than I thought, if Hyatt is correct.
Keywords: helpwanted, nsbeta3
OS: Windows 2000 → All
Hardware: PC → All
Whiteboard: [xbl1.0][nsbeta3-] → [xbl1.0]
Target Milestone: mozilla0.9.1 → mozilla0.9
(Assignee)

Updated

17 years ago
Depends on: 73821
(Assignee)

Comment 13

17 years ago
Created attachment 29188 [details] [diff] [review]
corrects event flow in nsGenericElement and nsXULElement
(Assignee)

Comment 14

17 years ago
Patch attached to fix event flow through anonymous content. Note that simple
testcases for this in XML and HTML won't appear to work because of bug 73821,
but this problem should be fixed.

Johnny: can you review this? I'd like to check this in ASAP...
(Assignee)

Comment 15

17 years ago
XUL testcase:

test.xul
--------
<?xml version="1.0"?>
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<?xml-stylesheet href="test.css" type="text/css"?>

<window
  title="40105 testcase"
  xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
  <box id="outer" orient="vertical"
    onclick="dump(':: onclick fired for outer element: ' +
                  event.target.id + ' ::\n');">
    <button id="inner" label="test"
      onclick="dump(':: onclick fired for inner element: ' +
                    event.target.id + ' ::\n');"/>
  </box>
</window>

test.css
--------
box#outer {
  -moz-binding: url("test.xml#test");
}

test.xml
--------
<?xml version="1.0"?>

<bindings
  xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
  xmlns="http://www.mozilla.org/xbl">

  <binding id="test">
    <content>
      <xul:box id="anonymous" orient="horizontal"
        onclick="dump(':: onclick fired for anonymous element: ' +
                      event.target.id + ' ::\n');">
        <children/>
      </xul:box>
    </content>
  </binding>

</bindings>

Before the patch is applied, clicking on the button will dump

:: onclick fired for inner element: inner ::
:: onclick fired for outer element: inner ::

and with the patch, clicking the button will dump

:: onclick fired for inner element: inner ::
:: onclick fired for anonymous element: inner ::
:: onclick fired for outer element: inner ::

(where "inner" is the correct event target).
I'd prefere if joki could review this, Cc:ing.
(Reporter)

Comment 17

17 years ago
sr=hyatt
Ok, dr talked me throught this and I'm cool with this change, a few things to
change before checking in tho:

- Add a null check before using mDocument...

- Change "parent != mParent" to "parent.get() != mParent" since parent is a
nsCOMPtr and mParent is a raw pointer so this will most likely not compile on
some unixes...

Make those changes in both places and check this in! r=jst
(Assignee)

Comment 19

17 years ago
Created attachment 29325 [details] [diff] [review]
revised patch, per jst
(Assignee)

Comment 20

17 years ago
will check in when tree opens
(Assignee)

Comment 21

17 years ago
fix checked in.
Status: ASSIGNED → RESOLVED
Last Resolved: 17 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.