Closed
Bug 300808
Opened 19 years ago
Closed 19 years ago
When content is removed from the document the corresponding tooltip should not appear
Categories
(Core :: Layout, defect)
Tracking
()
RESOLVED
FIXED
People
(Reporter: martijn.martijn, Assigned: martijn.martijn)
References
(Blocks 1 open bug)
Details
(Keywords: testcase)
Attachments
(7 files, 1 obsolete file)
|
707 bytes,
text/html
|
Details | |
|
724 bytes,
text/html
|
Details | |
|
791 bytes,
text/html
|
Details | |
|
779 bytes,
text/html
|
Details | |
|
9.29 KB,
patch
|
Details | Diff | Splinter Review | |
|
10.95 KB,
patch
|
Details | Diff | Splinter Review | |
|
3.20 KB,
patch
|
neil
:
review+
bzbarsky
:
superreview+
|
Details | Diff | Splinter Review |
This is a follow-up from bug 269927 See upcoming testcase. The testcase should explain what the bug is about.
| Assignee | ||
Comment 1•19 years ago
|
||
Actually, IE6 does this also wrong (but displays the tooltip at the right spot at least). Opera8 does it right, it does not show a tooltip.
| Assignee | ||
Comment 2•19 years ago
|
||
Another case for when the tooltip is already there and then the content gets removed.
Comment 3•19 years ago
|
||
Updated•19 years ago
|
Attachment #189347 -
Attachment description: Variant of first testcase that deletes a basic "is in document" check → Variant of first testcase that defeats a basic "is in document" check
Comment 5•19 years ago
|
||
Attachment #189356 -
Flags: superreview?(jst)
Attachment #189356 -
Flags: review?(neil.parkwaycc.co.uk)
| Assignee | ||
Comment 6•19 years ago
|
||
I tried the patch. It works fine for testcase1 and testcase2. But for the "Variant of first..." testcase, I can't get a tooltip at all for the green div with the patch. I would also hope the patch this testcase4 variant, but it doesn't seem like it does.
Comment 7•19 years ago
|
||
Yeah, testcase 3 is a problem, since in that case any mousemove actually removes the node from the document, canceling the tooltip timer... I really don't see a good way to fix it. :( I think I can fix testcase 4. Let me poke a second. ;)
Comment 8•19 years ago
|
||
Comment on attachment 189356 [details] [diff] [review] Proposed patch This patch causes shutdown crashes anyway...
Attachment #189356 -
Attachment is obsolete: true
Attachment #189356 -
Flags: superreview?(jst)
Attachment #189356 -
Flags: superreview-
Attachment #189356 -
Flags: review?(neil.parkwaycc.co.uk)
Attachment #189356 -
Flags: review-
Comment 9•19 years ago
|
||
So the DocumentWillBeDestroyed notification comes far too late to fix testcase 4. Further, this is still crashing when tearing down the main browser window, and I can't tell why -- somehow a dead nsXULTooltipListener is ending up as an observer on the XULDocument, even though I think I wrote code to prevent that... I've sort of reached the end of the time I alloted to myself to look into this, but if someone wants to pick it up, they should feel free to.
Updated•19 years ago
|
Keywords: helpwanted
| Assignee | ||
Comment 10•19 years ago
|
||
I now had a close look at testcase3, I now actually think it is correct to not show a tooltip. Opera8 is doing that (not showing a tooltip).
| Assignee | ||
Comment 11•19 years ago
|
||
This is the "Not quite working..." patch from Boris, but it also removes the majority of the code in nsXULTooltipListener::MouseOut and replaces it with HideTooltip(). It fixes the crash on exit. I don't know why it fixes that, but I think the current code in nsXULTooltipListener::MouseOut isn't really useful, afaics.
Comment 12•19 years ago
|
||
Ah... you do want to have the code in mouseout, because otherwise an
already-posted tooltip will die if you move around a bit (say you have two spans
in a div, the tooltip is for the div, and you move from one span to the other)...
Does just replacing that first block in that function with:
if (!mCurrentTooltip) {
KillTooltipTimer();
}
fix the crash? It looks to me like it possibly should.| Assignee | ||
Comment 13•19 years ago
|
||
(In reply to comment #12) > Ah... you do want to have the code in mouseout, because otherwise an > already-posted tooltip will die if you move around a bit (say you have two spans > in a div, the tooltip is for the div, and you move from one span to the other)... That isn't working already now, see: http://wargers.org/titletip.htm Moving from one div to the other and the tooltip disappears and appears again.
| Assignee | ||
Comment 15•19 years ago
|
||
I think so. When mouseout is fired that piece of code aks for getTarget which is the node that was left and then it checks if that node is the same node as the node where the tooltipnode is attached to. So, that code should always succeed, hence what is happening in comment 13. Perhaps it can be fixed by checking if the relatedTarget is inside the targetNode. > Does just replacing that first block in that function with: > > if (!mCurrentTooltip) { > KillTooltipTimer(); > } > > fix the crash? It looks to me like it possibly should. Yes, that seems to fix the crash.
Comment 16•19 years ago
|
||
Hmm... I guess the targetNode is not the node that has the tooltip on it but just the last thing we did mousemove over, eh? Given that, this may be reasonable...
| Assignee | ||
Comment 18•19 years ago
|
||
Right. Any ideas how to fix that? I've submitted bug 301317 for the issue mentioned in comment 13 (it's not easy for me to fix and I rather keep it separate from this).
Comment 19•19 years ago
|
||
Not sure offhand. I suppose we could add an event listener for the PageHide event to the document we're observing... Or we could propagate PageHide notifications to nsIDocumentObservers in some way. jst, peterv, sicking, thoughts? I'm guessing the event listener approach is simpler...
Comment 22•19 years ago
|
||
This bug is a little broader than that one, I think. And the original problem reported here is quite different.
Blocks: 45497
Updated•19 years ago
|
Flags: blocking1.9a1?
| Assignee | ||
Comment 23•19 years ago
|
||
Ok, testcase1 seems to work for me now. With Testcase 2 and testcase3 I can still see the issue. However, I'm beginning to think this is not a bug, it's more a matter of tastes. Currently, Mozilla is acting the same as IE6 regarding testcase2 and testcase3. Testcase4, on the other hand, is a real bug (and an annoying one). Neil created a nifty patch for bug 329521: https://bugzilla.mozilla.org/attachment.cgi?id=215521 Similar code could be used to fix the issue in testcase4. I've tried this once, and it works. Is this a good way to fix the bug, Boris?
Comment 24•19 years ago
|
||
Hmm... I guess the context menu _is_ rather outside of Gecko that way, eh? Sure, let's do that. Make sure to fix both xpfe and toolkit?
| Assignee | ||
Comment 25•19 years ago
|
||
I haven't checked this in SeaMonkey (since I only build Firefox), but I think it should also work fine in there.
Attachment #221019 -
Flags: review?(neil)
Comment 26•19 years ago
|
||
Comment on attachment 221019 [details] [diff] [review] patch4 >+ } >+ else { Nit: xpfe style is } else {
Attachment #221019 -
Flags: review?(neil) → review+
| Assignee | ||
Comment 27•19 years ago
|
||
Comment on attachment 221019 [details] [diff] [review] patch4 Does this need sr? /me naively asking Boris for sr.
Attachment #221019 -
Flags: superreview?(bzbarsky)
Updated•19 years ago
|
Attachment #221019 -
Flags: superreview?(bzbarsky) → superreview+
Updated•19 years ago
|
Assignee: nobody → martijn.martijn
| Assignee | ||
Comment 28•19 years ago
|
||
Checking in browser/base/content/browser.js; /cvsroot/mozilla/browser/base/content/browser.js,v <-- browser.js new revision: 1.649; previous revision: 1.648 done Checking in xpfe/browser/resources/content/nsBrowserStatusHandler.js; /cvsroot/mozilla/xpfe/browser/resources/content/nsBrowserStatusHandler.js,v <-- nsBrowserStatusHandler.js new revision: 1.67; previous revision: 1.66 done Checked in on trunk. I'm marking this bug fixed. Like I said in comment 23, I don't necessarily think that testcase2 and testcase3 show a bug in Mozilla. If anyone has a different opinion about this, please file a new bug for it.
Status: NEW → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
| Assignee | ||
Comment 29•19 years ago
|
||
(I checked in with Neil's nit, btw)
Flags: blocking1.9a1?
Keywords: helpwanted
You need to log in
before you can comment on or make changes to this bug.
Description
•