RESOLVED FIXED 80671
Split the extra logical height distribution logic out of RenderTableSection::layoutRows
https://bugs.webkit.org/show_bug.cgi?id=80671
Summary Split the extra logical height distribution logic out of RenderTableSection::...
Julien Chaffraix
Reported 2012-03-08 19:37:49 PST
Currently it's this logic is inlined in the function which makes it longer than it should be. Also the naming doesn't help understanding what is going on in the function at the moment. Patch forthcoming.
Attachments
Proposed refactoring. (9.25 KB, patch)
2012-03-08 19:43 PST, Julien Chaffraix
no flags
Same change, nits removed. (9.36 KB, patch)
2012-03-09 12:09 PST, Julien Chaffraix
no flags
Julien Chaffraix
Comment 1 2012-03-08 19:43:53 PST
Created attachment 130956 [details] Proposed refactoring.
Adrienne Walker
Comment 2 2012-03-09 11:34:05 PST
Comment on attachment 130956 [details] Proposed refactoring. View in context: https://bugs.webkit.org/attachment.cgi?id=130956&action=review In terms of correctness, this looks fine to me. > Source/WebCore/rendering/RenderTableSection.cpp:475 > + if (extraLogicalHeight > 0 && m_rowPos[totalRows]) { nit: maybe make this an early out for extra clarity. > Source/WebCore/rendering/RenderTableSection.cpp:479 > + int tot = m_rowPos[totalRows]; > + int add = 0; > + int prev = m_rowPos[0]; style nit: I realize you're just moving this code, but don't use abbreviations like "tot" and "prev". > Source/WebCore/rendering/RenderTableSection.cpp:499 > + if (m_rowPos[totalRows] || !nextSibling()) { nit: maybe an early return here too. > Source/WebCore/rendering/RenderTableSection.cpp:511 > + remainingExtraLogicalHeight = distributeExtraLogicalHeightToPercentRows(remainingExtraLogicalHeight, totalPercent); > + remainingExtraLogicalHeight = distributeExtraLogicalHeightToAutoRows(remainingExtraLogicalHeight, autoRowsCount); The previous code had checks for totalPercent == 0 and autoRowsCount == 0, which avoided a needless iteration through all of the rows. Is that worth keeping?
Julien Chaffraix
Comment 3 2012-03-09 11:49:21 PST
Comment on attachment 130956 [details] Proposed refactoring. View in context: https://bugs.webkit.org/attachment.cgi?id=130956&action=review >> Source/WebCore/rendering/RenderTableSection.cpp:511 >> + remainingExtraLogicalHeight = distributeExtraLogicalHeightToAutoRows(remainingExtraLogicalHeight, autoRowsCount); > > The previous code had checks for totalPercent == 0 and autoRowsCount == 0, which avoided a needless iteration through all of the rows. Is that worth keeping? Yes, autoRowsCount == 0 is handled inside distributeExtraLogicalHeightToAutoRows, however I forgot to keep the totalPercent check while cleaning the code. As a side note, a table usually doesn't have a lot of sections AFAICT but it's better not to slow down in case it does.
Julien Chaffraix
Comment 4 2012-03-09 12:09:18 PST
Created attachment 131069 [details] Same change, nits removed.
Adrienne Walker
Comment 5 2012-03-09 12:10:54 PST
Comment on attachment 131069 [details] Same change, nits removed. Looks good to me!
WebKit Review Bot
Comment 6 2012-03-09 14:58:22 PST
Comment on attachment 131069 [details] Same change, nits removed. Clearing flags on attachment: 131069 Committed r110336: <http://trac.webkit.org/changeset/110336>
WebKit Review Bot
Comment 7 2012-03-09 14:58:26 PST
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.