| Summary: | Clean up BoxSide and BorderEdge code | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | WebKit | Reporter: | Simon Fraser (smfr) <simon.fraser> | ||||||||||||
| Component: | Layout and Rendering | Assignee: | Simon Fraser (smfr) <simon.fraser> | ||||||||||||
| Status: | RESOLVED FIXED | ||||||||||||||
| Severity: | Normal | CC: | bfulgham, changseok, esprehn+autocc, ews-watchlist, glenn, kondapallykalyan, pdr, sam, simon.fraser, webkit-bug-importer, zalan | ||||||||||||
| Priority: | P2 | Keywords: | InRadar | ||||||||||||
| Version: | WebKit Nightly Build | ||||||||||||||
| Hardware: | Unspecified | ||||||||||||||
| OS: | Unspecified | ||||||||||||||
| Attachments: |
|
||||||||||||||
|
Description
Simon Fraser (smfr)
2020-10-26 10:43:17 PDT
Created attachment 412334 [details]
Patch
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. Created attachment 412385 [details]
Patch
Created attachment 412830 [details]
Patch
Created attachment 412831 [details]
Patch
Created attachment 412844 [details]
Patch
Committed r269228: <https://trac.webkit.org/changeset/269228> All reviewed patches have been landed. Closing bug and clearing flags on attachment 412844 [details]. |