[webkit-reviews] review granted: [Bug 115362] [CSS Grid Layout] Implement support for <flex> : [Attachment 211926] Patch
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Mon Oct 14 02:04:00 PDT 2013
Andreas Kling <akling at apple.com> has granted Sergio Villar Senin
<svillar at igalia.com>'s request for review:
Bug 115362: [CSS Grid Layout] Implement support for <flex>
https://bugs.webkit.org/show_bug.cgi?id=115362
Attachment 211926: Patch
https://bugs.webkit.org/attachment.cgi?id=211926&action=review
------- Additional Comments from Andreas Kling <akling at apple.com>
View in context: https://bugs.webkit.org/attachment.cgi?id=211926&action=review
r=me
> Source/WebCore/rendering/RenderGrid.cpp:78
> + // Required by std::sort.
> + GridTrackForNormalization operator=(const GridTrackForNormalization& o)
Huh. I thought the compiler would generate this.
> Source/WebCore/rendering/RenderGrid.cpp:392
> + std::sort(tracksForNormalization.begin(), tracksForNormalization.end(),
sortByGridNormalizedFlexValue);
I would use a lambda instead of a separate function here:
std::sort(tracksForNormalization.begin(), tracksForNormalization.end(),
[](const GridTrackForNormalization& a, const GridTrackForNormalization& b) {
return a.m_normalizedFlexValue < b.m_normalizedFlexValue;
});
> Source/WebCore/rendering/style/GridLength.h:72
> + return m_length == o.m_length && m_flex == o.m_flex && m_type ==
o.m_type;
It would be better to do these comparisons in "cheapness" order:
m_type -> m_flex -> m_length
More information about the webkit-reviews
mailing list