RESOLVED FIXED 218197
Clean up BoxSide and BorderEdge code
https://bugs.webkit.org/show_bug.cgi?id=218197
Summary Clean up BoxSide and BorderEdge code
Simon Fraser (smfr)
Reported 2020-10-26 10:43:17 PDT
Clean up BoxSide and BorderEdge code
Attachments
Patch (83.63 KB, patch)
2020-10-26 10:48 PDT, Simon Fraser (smfr)
sam: review+
ews-feeder: commit-queue-
Patch (86.26 KB, patch)
2020-10-26 21:04 PDT, Simon Fraser (smfr)
ews-feeder: commit-queue-
Patch (86.26 KB, patch)
2020-10-30 22:14 PDT, Simon Fraser (smfr)
ews-feeder: commit-queue-
Patch (86.37 KB, patch)
2020-10-30 22:43 PDT, Simon Fraser (smfr)
ews-feeder: commit-queue-
Patch (86.37 KB, patch)
2020-10-31 10:27 PDT, Simon Fraser (smfr)
no flags
Simon Fraser (smfr)
Comment 1 2020-10-26 10:48:36 PDT
Sam Weinig
Comment 2 2020-10-26 11:07:34 PDT
Comment on attachment 412334 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=412334&action=review > Source/WebCore/platform/RectEdges.h:52 > + T& at(BoxSide side) { return m_sides[static_cast<size_t>(side)]; } The more traditional thing would be to use operation[] here. > Source/WebCore/platform/RectEdges.h:89 > + std::array<T, 4> m_sides { }; I don't think you need the braces at all here. It should default initialize the members by default. > Source/WebCore/platform/text/WritingMode.h:131 > +constexpr std::initializer_list<BoxSide> allBoxSides = { BoxSide::Top, BoxSide::Right, BoxSide::Bottom, BoxSide::Left }; I think this would make more sense as std::array<BoxSide, 4>. Keeping initializer_list is mostly best used as a parameter to a function. I also think we should try to replace this, perhaps as a follow up, with specific iterators on RectEdges. > Source/WebCore/rendering/RenderBoxModelObject.cpp:1799 > + static constexpr std::initializer_list<BoxSide> paintOrderSides = { BoxSide::Top, BoxSide::Bottom, BoxSide::Left, BoxSide::Right }; like with the other use, I think this would be better as a std::array.
Simon Fraser (smfr)
Comment 3 2020-10-26 21:04:30 PDT
Simon Fraser (smfr)
Comment 4 2020-10-30 22:14:19 PDT
Simon Fraser (smfr)
Comment 5 2020-10-30 22:43:39 PDT
Simon Fraser (smfr)
Comment 6 2020-10-31 10:27:05 PDT
EWS
Comment 7 2020-10-31 12:06:29 PDT
Committed r269228: <https://trac.webkit.org/changeset/269228> All reviewed patches have been landed. Closing bug and clearing flags on attachment 412844 [details].
Radar WebKit Bug Importer
Comment 8 2020-10-31 12:07:19 PDT
Note You need to log in before you can comment on or make changes to this bug.