RESOLVED FIXED 71500
Correct usage of LayoutUnits and integers in Table rendering classes
https://bugs.webkit.org/show_bug.cgi?id=71500
Summary Correct usage of LayoutUnits and integers in Table rendering classes
Levi Weintraub
Reported 2011-11-03 13:23:10 PDT
Table layout still needs to be done with integers to preserve rules from the spec. There were also a few places missing LayoutUnits.
Attachments
Patch (35.14 KB, patch)
2011-11-03 13:45 PDT, Levi Weintraub
no flags
Patch for landing (35.12 KB, patch)
2011-11-03 16:54 PDT, Levi Weintraub
no flags
Levi Weintraub
Comment 1 2011-11-03 13:45:51 PDT
Darin Adler
Comment 2 2011-11-03 15:28:32 PDT
Comment on attachment 113552 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=113552&action=review Are all those max<int> needed? If both arguments are already int, I would expect you could leave out the <int>. Lets not leave things behind that show the churn from when we converted to LayoutUnit and back. We should only have things like <int> if they are actually needed. > Source/WebCore/rendering/AutoTableLayout.cpp:255 > + maxWidth = max<int>(maxWidth, static_cast<int>(min(maxNonPercent, numeric_limits<LayoutUnit>::max() / 2.0f))); > + maxWidth = max<int>(maxWidth, static_cast<int>(min(maxPercent, numeric_limits<LayoutUnit>::max() / 2.0f))); It seems unfortunate to convert from LayoutUnit to int using static_cast. Isn’t there a better way? For example, could you just leave out the cast entirely, since the argument to max<int> is an int? > Source/WebCore/rendering/AutoTableLayout.cpp:392 > + int cellLogicalWidth = max<int>(m_layoutStruct[pos].effectiveMinLogicalWidth, static_cast<int>(cellMinLogicalWidth * m_layoutStruct[pos].logicalWidth.value() / fixedWidth)); Same comment here about static_cast<int>. I think it can be omitted. > Source/WebCore/rendering/AutoTableLayout.cpp:428 > + int colMaxLogicalWidth = max<int>(m_layoutStruct[pos].effectiveMaxLogicalWidth, static_cast<int>(spanMaxLogicalWidth ? cellMaxLogicalWidth * static_cast<float>(m_layoutStruct[pos].effectiveMaxLogicalWidth) / spanMaxLogicalWidth : cellMaxLogicalWidth)); And here.
Levi Weintraub
Comment 3 2011-11-03 16:54:27 PDT
Created attachment 113581 [details] Patch for landing
WebKit Review Bot
Comment 4 2011-11-03 17:57:16 PDT
Comment on attachment 113581 [details] Patch for landing Clearing flags on attachment: 113581 Committed r99254: <http://trac.webkit.org/changeset/99254>
WebKit Review Bot
Comment 5 2011-11-03 17:57:21 PDT
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.