Closed Bug 331772 Opened 15 years ago Closed 7 years ago

tooltiptext fails on XUL button in HTML page


(Core :: XUL, defect)

Not set





(Reporter: smolens, Assigned: mkmelin)


(Keywords: testcase)


(2 files, 3 obsolete files)

User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US; rv: Gecko/20060124 Firefox/
Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv: Gecko/20060124 Firefox/

The tooltiptext attribute on an XUL button created in an HTML document by document.createElementNS fails.  The tooltip doesn't appear.  Behaves the same when loaded in chrome.

Reproducible: Always

Steps to Reproduce:
1. Load test case.
2. Hover cursor over button.

Actual Results:  
No tooltip appears.

Expected Results:  
A tooltip should appear.
Attached file testcase (obsolete) —
Attached file testcase
It also happens with non-dynamic xul buttons (you had a regular html document, not an xhtml document), which normally prevents you from entering elements from other namespaces, unless you use document.createElementNS, which you did.

The problem is that this only works in xul documents, see:
Here the anonymous tooltip is created that is used for tooltips in xul elements with tooltiptext attributes. But it is only created for xul documents, as I said.
Attachment #216323 - Attachment is obsolete: true
Assignee: nobody → jag
Component: General → XP Toolkit/Widgets
Ever confirmed: true
Keywords: testcase
OS: Linux → All
Product: Firefox → Core
QA Contact: general → jrgmorrison
Version: unspecified → Trunk
Attached patch patch (obsolete) — Splinter Review
This makes it work. I would probably also need to patch titletip attributes.
But I'm really not sure if this is the right way to do this.
It doesn't work for cases where html documents are viewed outside of the browser, but in that case tooltip for html elements also don't work.
Assignee: jag → nobody
I can still see this in 3.6.2 at least. Any chance of moving forward on this? Although the patch has bitrotten, the proposed fix seems simple enough to be applied to the current implementation of FillInHTMLTooltip AFAICT. Any thoughts?
Supporting the previous comment!
The patch needs to be updated, tests have to be written, etc, to have a chance of getting it into the tree.
This issue affects addons such as GMail Conversation View:
Ok, so Thunderbird included a similar patch like the one above in bug 561854.

Now with bug 480356 fixed I'm looking to moving away from FillInHTMLTooltip for Thunderbird, which will also give us HTML5 form element validation and such.

This issue is kind of blocking me. If there is agreement about the suggested behavior?

In the thunderbird code we also had a test that makes xlink:title be the preferred title if also a plain title element is present. That's not the case with the current toolkit implementation. Is that wrong or preferred behavior?
QA Contact: jrgmorrison
Hardware: x86 → All
Assignee: nobody → mkmelin+mozilla
Attachment #216394 - Attachment is obsolete: true
Attachment #8347719 - Flags: review?(enndeakin)
Comment on attachment 8347719 [details] [diff] [review]

>-          while ((titleText == null) && (XLinkTitleText == null) &&
>-                 (SVGTitleText == null) && tipElement) {
>-            if (tipElement.nodeType == Node.ELEMENT_NODE &&
>-                tipElement.namespaceURI != XULNS) {
>-              titleText = tipElement.getAttribute("title");
>+          while (tipElement && !titleText && !XLinkTitleText && !SVGTitleText &&
>+                 !XULtooltiptextText) {

Comparing to null is done intentionally so that title="" can be used to undefine a title on a child element. So please use the original form. You might want to add a comment to that effect.
Summary: tooltiptext fails on XUL button dynamically created in HTML page → tooltiptext fails on XUL button HTML page
Comparing to null
Attachment #8347719 - Attachment is obsolete: true
Attachment #8347719 - Flags: review?(enndeakin)
Attachment #8349616 - Flags: review?(enndeakin)
Attachment #8349616 - Flags: review?(enndeakin) → review+
Keywords: checkin-needed
Summary: tooltiptext fails on XUL button HTML page → tooltiptext fails on XUL button in HTML page
Flags: in-testsuite+
Keywords: checkin-needed
Whiteboard: [fixed-in-fx-team]
Closed: 7 years ago
Resolution: --- → FIXED
Whiteboard: [fixed-in-fx-team]
Target Milestone: --- → mozilla29
You need to log in before you can comment on or make changes to this bug.