RESOLVED FIXED Bug 233382
Support rendering url(), CSS basic shapes other than path(), and coord-box for offset-path
https://bugs.webkit.org/show_bug.cgi?id=233382
Summary Support rendering url(), CSS basic shapes other than path(), and coord-box fo...
Kiet Ho
Reported 2021-11-19 13:55:10 PST
Support rendering url(), CSS basic shapes other than path(), and coord-box for offset-path. Right now offset-path will parse them just fine, but will ignore any shapes other than path().
Attachments
WIP (6.46 KB, patch)
2022-02-17 22:28 PST, Nikos Mouchtaris
no flags
WIP (6.46 KB, patch)
2022-02-18 01:20 PST, Nikos Mouchtaris
no flags
WIP (10.36 KB, patch)
2022-02-18 16:58 PST, Nikos Mouchtaris
no flags
Patch (10.77 KB, patch)
2022-02-21 22:52 PST, Nikos Mouchtaris
no flags
Patch (15.84 KB, patch)
2022-03-24 17:04 PDT, Nikos Mouchtaris
no flags
Patch (15.78 KB, patch)
2022-03-24 17:07 PDT, Nikos Mouchtaris
no flags
Patch (15.77 KB, patch)
2022-03-25 17:13 PDT, Nikos Mouchtaris
no flags
Patch (18.25 KB, patch)
2022-04-01 17:49 PDT, Nikos Mouchtaris
simon.fraser: review+
ews-feeder: commit-queue-
Patch (18.03 KB, patch)
2022-04-04 16:37 PDT, Nikos Mouchtaris
ntim: commit-queue-
Patch for landing (18.46 KB, patch)
2022-04-04 23:29 PDT, Tim Nguyen (:ntim)
no flags
Patch for landing (17.65 KB, patch)
2022-04-04 23:44 PDT, Tim Nguyen (:ntim)
no flags
Radar WebKit Bug Importer
Comment 1 2021-11-26 13:56:18 PST
Nikos Mouchtaris
Comment 2 2022-02-17 22:28:32 PST
Nikos Mouchtaris
Comment 3 2022-02-18 01:20:57 PST
Dean Jackson
Comment 4 2022-02-18 08:45:32 PST
Comment on attachment 452496 [details] WIP View in context: https://bugs.webkit.org/attachment.cgi?id=452496&action=review > Source/WebCore/rendering/style/RenderStyle.cpp:1474 > + // how to get current render box- want something like computeRoundedRectForBoxShape > + // marginBoxRect();pathForReferenceRect > + // return downcast<BoxPathOperation>(operation).pathForReferenceRect(box); Did you intend to leave this comment in?
Nikos Mouchtaris
Comment 5 2022-02-18 16:58:21 PST
Nikos Mouchtaris
Comment 6 2022-02-21 22:52:18 PST
Nikos Mouchtaris
Comment 7 2022-03-24 17:04:59 PDT
EWS Watchlist
Comment 8 2022-03-24 17:06:30 PDT
This patch modifies the imported WPT tests. Please ensure that any changes on the tests (not coming from a WPT import) are exported to WPT. Please see https://trac.webkit.org/wiki/WPTExportProcess
Nikos Mouchtaris
Comment 9 2022-03-24 17:07:36 PDT
Dean Jackson
Comment 10 2022-03-25 16:57:31 PDT
Comment on attachment 455707 [details] Patch would like to see more tests - shame WPT doesn't have them.
Nikos Mouchtaris
Comment 11 2022-03-25 17:13:38 PDT
Simon Fraser (smfr)
Comment 12 2022-03-25 19:05:34 PDT
Comment on attachment 455707 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=455707&action=review > Source/WebCore/rendering/PathOperation.h:71 > + static Ref<ReferencePathOperation> create(const String&, const String&, const RefPtr<SVGElement>); You need to name the string parameters in the header so the reader knows what they are. > Source/WebCore/rendering/PathOperation.h:85 > + ReferencePathOperation(const String&, const String&, const RefPtr<SVGElement>); Ditto > Source/WebCore/rendering/RenderLayer.cpp:1345 > + if (is<RenderBox>(renderer())) { > + auto cssBox = transformBoxToCSSBoxType(renderer().style().transformBox()); > + if (auto pathOperation = renderer().style().offsetPath()) { > + if (pathOperation->type() == PathOperation::Box) > + cssBox = downcast<BoxPathOperation>(pathOperation)->referenceBox(); > + } > + > + referenceBox = snapRectToDevicePixels(downcast<RenderBox>(renderer()).referenceBox(cssBox), renderer().document().deviceScaleFactor()); > + } This doesn't seem right. The presence of an offset path shouldn't affect transform rendering. This needs a testcase. > Source/WebCore/rendering/style/RenderStyle.cpp:1528 > + switch (operation.type()) > + { Brace on the previous line. > Source/WebCore/rendering/style/RenderStyle.cpp:1532 > + case PathOperation::Reference: > + { Ditto > Source/WebCore/rendering/style/RenderStyle.cpp:1538 > + case PathOperation::Box: > + { Ditto > Source/WebCore/rendering/style/RenderStyle.cpp:1542 > + case PathOperation::Ray: > + { Ditto
Nikos Mouchtaris
Comment 13 2022-04-01 17:49:00 PDT
Tim Nguyen (:ntim)
Comment 14 2022-04-04 14:46:07 PDT
Comment on attachment 456422 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=456422&action=review Looks like there are some trivial style errors. > Source/WebCore/ChangeLog:16 > + Tests: imported/w3c/web-platform-tests/css/motion/offset-path-shape.html > + imported/w3c/web-platform-tests/css/motion/offset-path-url.html Can you please export these tests? They're not upstream
Simon Fraser (smfr)
Comment 15 2022-04-04 14:53:36 PDT
Comment on attachment 456422 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=456422&action=review > Source/WebCore/rendering/PathOperation.cpp:2 > + * Copyright (C) 2012, 2013 Adobe Systems Incorporated. All rights reserved. Doesn't seem right for a new file. > Source/WebCore/rendering/PathOperation.h:74 > + const RefPtr<SVGElement> element() const; This can return a SVGElement* > Source/WebCore/rendering/PathOperation.h:85 > + ReferencePathOperation(const String& url, const String& fragment, const RefPtr<SVGElement> element); The argument can be a SVGElement* > Source/WebCore/rendering/RenderLayer.cpp:1340 > + if (pathOperation->type() == PathOperation::Box) { This should use is<BoxPathOperation>() > Source/WebCore/rendering/style/RenderStyle.cpp:1537 > + case PathOperation::Box: { > + return downcast<BoxPathOperation>(operation).getPath(); > + } You only need braces in case statements if you declare local variables. None of these cases do.
Nikos Mouchtaris
Comment 16 2022-04-04 16:37:24 PDT
Tim Nguyen (:ntim)
Comment 17 2022-04-04 23:21:17 PDT
Comment on attachment 456649 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=456649&action=review > LayoutTests/imported/w3c/web-platform-tests/css/motion/offset-path-geometry-box.html:6 > + <link rel="match" href="offset-path-shape-ref.html"> The ref is wrong here. I'll fix it upstream in the WPT PR, but please fix it in this patch.
Tim Nguyen (:ntim)
Comment 18 2022-04-04 23:23:29 PDT
Comment on attachment 456649 [details] Patch Please also fix the webkit-style errors on EWS, I think it's complaining specifically about `const RefPtr<SVGElement> element` in each constructor, I think it's sensible to remove the parameter names in those cases.
Tim Nguyen (:ntim)
Comment 19 2022-04-04 23:29:15 PDT
Created attachment 456674 [details] Patch for landing Addressed my 2 own comments (I copy pasted the previous attachment then did manual edits)
Tim Nguyen (:ntim)
Comment 20 2022-04-04 23:43:27 PDT
Comment on attachment 456674 [details] Patch for landing oh looks like you can't just copy an attachment and edit it
Tim Nguyen (:ntim)
Comment 21 2022-04-04 23:44:04 PDT
Created attachment 456675 [details] Patch for landing
EWS
Comment 22 2022-04-05 01:04:47 PDT
Committed r292382 (249247@main): <https://commits.webkit.org/249247@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 456675 [details].
Note You need to log in before you can comment on or make changes to this bug.