Closed Bug 40105 Opened 24 years ago Closed 23 years ago

XBL-interleaved anonymous content does not get DOM events

Categories

(Core :: XBL, defect, P3)

defect

Tracking

()

RESOLVED FIXED
mozilla0.9

People

(Reporter: hyatt, Assigned: dr)

References

Details

(Whiteboard: [xbl1.0])

Attachments

(2 files)

Anonymous content interleaved with explicit content does not get any DOM 
events.
Status: NEW → ASSIGNED
Keywords: nsbeta2
How does this affect the user?  Need more infor to make the nsbeta2 call please.
Whiteboard: [NEED INFO]
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.

Putting on [nsbeta2+] radar.  Will retest when new tree work is in.
Whiteboard: [NEED INFO] → [nsbeta2+]
Ignore my comment "Will retest when new tree work is in."
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+]
Adding nsbeta3 keyword.
Keywords: nsbeta3
Whiteboard: nsbeta3-
Target Milestone: --- → Future
Whiteboard: nsbeta3- → [xbl1.0][nsbeta3-]
Target Milestone: Future → M18
Summary: XBL anonymous content does not get DOM events → XBL-interleaved anonymous content does not get DOM events
mass-moving xbl1.0 bugs to future, adding helpwanted keyword
Keywords: helpwanted
Target Milestone: M18 → Future
->moz0.9
Target Milestone: Future → mozilla0.9
->dr
Assignee: hyatt → dr
Status: ASSIGNED → NEW
hyatt: does this still happen since your insertion points rewrite? also, is this
windows-only or xp?
Status: NEW → ASSIGNED
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
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
Depends on: 73821
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...
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.
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
will check in when tree opens
fix checked in.
Status: ASSIGNED → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.