RESOLVED FIXED 239460
Inline Element::shadowRoot()
https://bugs.webkit.org/show_bug.cgi?id=239460
Summary Inline Element::shadowRoot()
Chris Dumez
Reported 2022-04-18 12:21:20 PDT
Inline Element::shadowRoot() given that it is small and shows up in Speedometer profiles.
Attachments
Patch (4.23 KB, patch)
2022-04-18 13:18 PDT, Chris Dumez
ews-feeder: commit-queue-
Patch (7.27 KB, patch)
2022-04-18 14:21 PDT, Chris Dumez
ews-feeder: commit-queue-
Patch (8.65 KB, patch)
2022-04-18 15:13 PDT, Chris Dumez
ews-feeder: commit-queue-
Patch (11.35 KB, patch)
2022-04-18 16:20 PDT, Chris Dumez
ews-feeder: commit-queue-
Patch (13.86 KB, patch)
2022-04-18 16:42 PDT, Chris Dumez
ews-feeder: commit-queue-
Patch (14.80 KB, patch)
2022-04-18 16:57 PDT, Chris Dumez
ews-feeder: commit-queue-
Patch (20.05 KB, patch)
2022-04-18 19:51 PDT, Chris Dumez
ews-feeder: commit-queue-
Patch (20.20 KB, patch)
2022-04-18 20:00 PDT, Chris Dumez
ews-feeder: commit-queue-
Patch (20.40 KB, patch)
2022-04-18 20:25 PDT, Chris Dumez
ews-feeder: commit-queue-
Patch (21.44 KB, patch)
2022-04-18 21:45 PDT, Chris Dumez
no flags
Patch (23.85 KB, patch)
2022-04-19 10:16 PDT, Chris Dumez
no flags
Patch (27.28 KB, patch)
2022-04-19 11:44 PDT, Chris Dumez
no flags
Chris Dumez
Comment 1 2022-04-18 13:18:43 PDT
Chris Dumez
Comment 2 2022-04-18 14:21:28 PDT
Chris Dumez
Comment 3 2022-04-18 15:13:16 PDT
Chris Dumez
Comment 4 2022-04-18 16:20:16 PDT
Chris Dumez
Comment 5 2022-04-18 16:42:12 PDT
Chris Dumez
Comment 6 2022-04-18 16:57:41 PDT
Chris Dumez
Comment 7 2022-04-18 19:51:49 PDT
Chris Dumez
Comment 8 2022-04-18 20:00:36 PDT
Chris Dumez
Comment 9 2022-04-18 20:25:50 PDT
Chris Dumez
Comment 10 2022-04-18 21:45:18 PDT
Darin Adler
Comment 11 2022-04-19 09:43:51 PDT
Comment on attachment 457854 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=457854&action=review > Source/WebCore/dom/Element.h:318 > + ShadowRoot* shadowRoot() const; If we add the inline keyword to the declaration of shadowRoot (like replace WEBCORE_EXPORT with inline) then, I seem to recall, we get compiler errors rather than linker errors when we call it without remembering to include ElementRareData.h. So I suggest including that keyword. We should use that technique more! I think Jer Noble is the one who pointed this out to me. > Source/WebCore/editing/cocoa/DataDetection.mm:694 > +std::optional<std::pair<Ref<HTMLElement>, IntRect>> DataDetection::findDataDetectionResultElementInImageOverlay(const FloatPoint& location, const HTMLElement& imageOverlayHost) This seems like a really good change, but not mentioned in change log.
Chris Dumez
Comment 12 2022-04-19 09:55:22 PDT
(In reply to Darin Adler from comment #11) > Comment on attachment 457854 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=457854&action=review > > > Source/WebCore/dom/Element.h:318 > > + ShadowRoot* shadowRoot() const; > > If we add the inline keyword to the declaration of shadowRoot (like replace > WEBCORE_EXPORT with inline) then, I seem to recall, we get compiler errors > rather than linker errors when we call it without remembering to include > ElementRareData.h. So I suggest including that keyword. We should use that > technique more! I think Jer Noble is the one who pointed this out to me. > > > Source/WebCore/editing/cocoa/DataDetection.mm:694 > > +std::optional<std::pair<Ref<HTMLElement>, IntRect>> DataDetection::findDataDetectionResultElementInImageOverlay(const FloatPoint& location, const HTMLElement& imageOverlayHost) > > This seems like a really good change, but not mentioned in change log. Ok, I'll mention in the changelog. The issue is that we'd need to include ElementRareData.h from the WebKit layer otherwise. And this is currently not possible because this header is not exported.
Chris Dumez
Comment 13 2022-04-19 10:13:49 PDT
(In reply to Darin Adler from comment #11) > Comment on attachment 457854 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=457854&action=review > > > Source/WebCore/dom/Element.h:318 > > + ShadowRoot* shadowRoot() const; > > If we add the inline keyword to the declaration of shadowRoot (like replace > WEBCORE_EXPORT with inline) then, I seem to recall, we get compiler errors > rather than linker errors when we call it without remembering to include > ElementRareData.h. So I suggest including that keyword. We should use that > technique more! I think Jer Noble is the one who pointed this out to me. Nice trick. This is good to know, thanks. I'll adopt in this patch.
Chris Dumez
Comment 14 2022-04-19 10:16:46 PDT
Chris Dumez
Comment 15 2022-04-19 11:44:53 PDT
EWS
Comment 16 2022-04-19 16:14:56 PDT
Committed r293042 (249781@main): <https://commits.webkit.org/249781@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 457921 [details].
Radar WebKit Bug Importer
Comment 17 2022-04-19 16:15:15 PDT
Note You need to log in before you can comment on or make changes to this bug.