RESOLVED FIXED 240096
Add check if referenced element is SVG for clip-path
https://bugs.webkit.org/show_bug.cgi?id=240096
Summary Add check if referenced element is SVG for clip-path
Nikos Mouchtaris
Reported 2022-05-04 16:37:37 PDT
Add check if referenced element is SVG for clip-path
Attachments
Patch (1.94 KB, patch)
2022-05-04 16:43 PDT, Nikos Mouchtaris
no flags
Patch (1.94 KB, patch)
2022-05-04 16:48 PDT, Nikos Mouchtaris
no flags
Patch (3.63 KB, patch)
2022-05-04 20:51 PDT, Nikos Mouchtaris
no flags
Patch (3.64 KB, patch)
2022-05-05 11:35 PDT, Nikos Mouchtaris
no flags
Patch (3.09 KB, patch)
2022-05-05 11:43 PDT, Nikos Mouchtaris
no flags
Nikos Mouchtaris
Comment 1 2022-05-04 16:43:58 PDT
Nikos Mouchtaris
Comment 2 2022-05-04 16:48:51 PDT
Nikos Mouchtaris
Comment 3 2022-05-04 20:51:24 PDT
Nikos Mouchtaris
Comment 4 2022-05-05 11:35:16 PDT
Simon Fraser (smfr)
Comment 5 2022-05-05 11:39:33 PDT
Comment on attachment 458898 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=458898&action=review > Source/WebCore/rendering/PathOperation.cpp:51 > + if (!m_element) > + return nullptr; > return m_element.get(); This doesn't do anything. m_element.get() will already return null.
Nikos Mouchtaris
Comment 6 2022-05-05 11:43:30 PDT
Nikos Mouchtaris
Comment 7 2022-05-05 11:44:30 PDT
(In reply to Simon Fraser (smfr) from comment #5) > Comment on attachment 458898 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=458898&action=review > > > Source/WebCore/rendering/PathOperation.cpp:51 > > + if (!m_element) > > + return nullptr; > > return m_element.get(); > > This doesn't do anything. m_element.get() will already return null. Fixed.
EWS
Comment 8 2022-05-05 16:51:26 PDT
Committed r293870 (250331@main): <https://commits.webkit.org/250331@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 458901 [details].
Radar WebKit Bug Importer
Comment 9 2022-05-05 16:52:13 PDT
Tim Nguyen (:ntim)
Comment 10 2022-05-06 06:46:09 PDT
Comment on attachment 458901 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=458901&action=review > Source/WebCore/style/StyleBuilderConverter.h:632 > + if (is<SVGElement>(target.element.get())) > + return ReferencePathOperation::create(cssURLValue, fragment, downcast<SVGElement>(target.element.get())); > + return ReferencePathOperation::create(cssURLValue, fragment, nullptr); This seems like a good usecase for dynamicDowncast: return ReferencePathOperation::create(cssURLValue, fragment, dynamicDowncast<SVGElement>(target.element.get())); It will be null if it's not a SVGElement.
Tim Nguyen (:ntim)
Comment 11 2022-05-06 15:43:04 PDT
Comment on attachment 458901 [details] Patch Sorry, accidentally obsoleted by putting the wrong bug number in commit message.
Note You need to log in before you can comment on or make changes to this bug.