RESOLVED CONFIGURATION CHANGED Bug 91821
[Meta] Code calling shadowAncestorNode() does not seem to consider nested ShadowDOM
https://bugs.webkit.org/show_bug.cgi?id=91821
Summary [Meta] Code calling shadowAncestorNode() does not seem to consider nested Sha...
Shinya Kawanaka
Reported 2012-07-19 23:02:28 PDT
We would like to remove Node::shadowAncestorNode(), since it is confusing due to returning itself if not in Shadow DOM.
Attachments
Kent Tamura
Comment 1 2012-07-24 23:46:18 PDT
FYI: I have no plan to replace the remaining. Many instances of shadowAncestorNode() is in the editing area.
Dominic Cooney
Comment 2 2012-12-16 18:44:38 PST
If the remaining uses need to stay, should shadowAncestorNode be renamed to something more accurate? Or should we just close this bug?
Shinya Kawanaka
Comment 3 2012-12-16 20:36:08 PST
Please don't close this. I woud like to replace all, but the priority is low. Also, I have to read the code around shadowAncestorNode() when modifying shadowAncestorNode(), since it might contain a bug about nested Shadow DOM.
Dominic Cooney
Comment 4 2013-01-10 06:12:22 PST
@tkent: Is Comment 1 saying that _you_ don’t plan to replace calls to shadowAncestorNode in editing, or you don’t think _anyone_ should?
Shinya Kawanaka
Comment 5 2013-01-22 00:37:33 PST
I don't know why you think _anyone_ should not replace it... Anyway, most of code having shadowAncestorNode() has some bug as far as I see. We have to fix them sooner or later. Now that shadowAncestorNode() is deprecated, we should use shadowHost() when we fix the bugs.
Kent Tamura
Comment 6 2013-01-22 00:44:03 PST
Anyone should, of course.
Dominic Cooney
Comment 7 2013-01-22 06:44:32 PST
I’m confused. Let‘s talk in person and update the bug after that.
Hajime Morrita
Comment 8 2013-01-22 17:16:50 PST
Just FYI, here is what I heard: - Basically, shadowAncestorNode() is used in wrong way. We should replace/fix it correctly. - Shinya noticed that the usage of shadowAncestorNode() is a signal of unawareness of nested shadow trees. In many case, just replacing it to shadowHost() doesn't help much. We should inspect the code around and make it work properly instead of replacing it blindly. This is not so trivial. - Kent doesn't have any plan to do it by himself since many usage appears outside his territory. - Shinya has some idea about fixing them. He has no immediate plan to fix though since this issue is not yet prioritized well.
Shinya Kawanaka
Comment 9 2013-01-22 18:37:18 PST
(In reply to comment #8) > Just FYI, here is what I heard: > > - Basically, shadowAncestorNode() is used in wrong way. > We should replace/fix it correctly. > - Shinya noticed that the usage of shadowAncestorNode() is a > signal of unawareness of nested shadow trees. > In many case, just replacing it to shadowHost() doesn't help much. > We should inspect the code around and make it work properly instead of > replacing it blindly. This is not so trivial. > - Kent doesn't have any plan to do it by himself since > many usage appears outside his territory. > - Shinya has some idea about fixing them. He has no immediate plan to fix though > since this issue is not yet prioritized well. The original motivation is Bug 87230 (merged to this already... but maybe this bug should have been merged to that.) What morrita said is correct. Using shadowAncestorNode() is a very good signal to the unawareness of nested shadow trees. Sometimes it does not consider ShadowDOM itself well. As far as I see, most of code seems wrong. However, exposing a bug is not so trivial. shadowAncestorNode() is used in various code including editing, rendering, accessibility, event handler, etc.. Also, shadowAncestorNode() is deprecated, and we're using shadowHost() instead. So when we fix this kind of bugs, we have to consider using shadowHost() instead of shadowAncestorNode(). Anyway, I think the current bug title is confusing.
Shinya Kawanaka
Comment 10 2013-01-22 18:49:06 PST
*** Bug 91589 has been marked as a duplicate of this bug. ***
Hajime Morrita
Comment 11 2013-01-22 20:01:32 PST
(In reply to comment #9) > Also, shadowAncestorNode() is deprecated, and we're using shadowHost() instead. So when we fix this kind of bugs, we have to consider using shadowHost() instead of shadowAncestorNode(). This is good point. I don't think people outside Web Components team are aware of this. We could prevent further usage of this API by renaming it to deprecatedSomething(). Such change will make the code looks ugly and motivate us to fix it. http://www.joelonsoftware.com/articles/Wrong.html
Shinya Kawanaka
Comment 12 2013-01-22 21:11:29 PST
(In reply to comment #11) > (In reply to comment #9) > > Also, shadowAncestorNode() is deprecated, and we're using shadowHost() instead. So when we fix this kind of bugs, we have to consider using shadowHost() instead of shadowAncestorNode(). > > This is good point. > > I don't think people outside Web Components team are aware of this. > We could prevent further usage of this API by renaming it to deprecatedSomething(). > Such change will make the code looks ugly and motivate us to fix it. > http://www.joelonsoftware.com/articles/Wrong.html Yep. Let's do it first.
Ryosuke Niwa
Comment 13 2019-10-04 22:51:42 PDT
This function longer exists.
Note You need to log in before you can comment on or make changes to this bug.