Bug 108302

Summary: Tooltip in ShadowDOM does not work correctly
Product: WebKit Reporter: Shinya Kawanaka <shinyak>
Component: DOMAssignee: Web Components Team <webcomponents-bugzilla>
Status: RESOLVED DUPLICATE    
Severity: Normal CC: eric, morrita, ojan.autocc, rniwa, webcomponents-bugzilla, webkit.review.bot
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 91821, 97279    
Attachments:
Description Flags
Patch
none
Patch none

Description Shinya Kawanaka 2013-01-30 00:30:21 PST
If nodes in ShadowDOM has title attribute, tooltip should be displayed correctly.
However, the current behavior of tooltip is very weird. For example.

1) tooltip of host element is displayed
2) if another tooltip is shown, the tooltip for ShadowDOM is displayed on the previous tooltip.

I believe hittest is not correctly implemented for ShadowDOM.
Also, this is very related to deprecatedShadowAncestorNode() bug (Bug 91821), as far as I see EventHandler code.
Comment 1 Hajime Morrita 2013-01-30 00:50:01 PST
Do you have any repro? It will help to let someone fix this.
Comment 2 Shinya Kawanaka 2013-01-30 18:14:49 PST
Created attachment 185644 [details]
Patch
Comment 3 Shinya Kawanaka 2013-01-30 18:17:12 PST
The patch contains repro.

I think we have two approaches for this issue.
1) If hit test result is in UA, we use host element instead.
2) If hit test result is in a shadow tree and there is no information for tooltip, we use host element recursively.

I chose (1) approach for this patch, since this won't change behavior much.
But it might worth considering adopting (2) approach.
Comment 4 Hajime Morrita 2013-01-30 18:41:15 PST
Comment on attachment 185644 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=185644&action=review

> Source/WebCore/rendering/HitTestResult.h:141
>      void setToNonShadowAncestor();

Can we just get rid of this one by replacing with new one?
Feels like having this is just wrong.
Comment 5 Shinya Kawanaka 2013-01-30 18:52:49 PST
(In reply to comment #4)
> (From update of attachment 185644 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=185644&action=review
> 
> > Source/WebCore/rendering/HitTestResult.h:141
> >      void setToNonShadowAncestor();
> 
> Can we just get rid of this one by replacing with new one?
> Feels like having this is just wrong.

The other calling is in if(allowShadowContent), so I think we have to have another method, which set nodes in document treescope.
Comment 6 Shinya Kawanaka 2013-01-30 20:55:21 PST
Created attachment 185670 [details]
Patch
Comment 7 Andreas Kling 2014-02-05 11:45:54 PST
Comment on attachment 185670 [details]
Patch

Clearing review flag on patches from before 2014. If this patch is still relevant, please reset the r? flag.
Comment 8 Ryosuke Niwa 2019-10-04 22:37:59 PDT

*** This bug has been marked as a duplicate of bug 157705 ***