Split the intrinsic padding update code out of RenderTableSection::layoutRows
authorjchaffraix@webkit.org <jchaffraix@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 5 Oct 2012 03:56:17 +0000 (03:56 +0000)
committerjchaffraix@webkit.org <jchaffraix@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 5 Oct 2012 03:56:17 +0000 (03:56 +0000)
commitb344fef22f586b923c2a7dab2e5b535ec8b886ae
treee95cc8bcca73584c97ec88068adbe3193895d1a3
parent04d587f73d18ca39be142fcf650bdc8d85ceccc5
Split the intrinsic padding update code out of RenderTableSection::layoutRows
https://bugs.webkit.org/show_bug.cgi?id=98454

Reviewed by Eric Seidel.

RenderTableSection::layoutRows is very long and it's difficult to see what's
going on. This change moves the intrinsic padding update code into RenderTableCell
for clarity. While at it, cleaned up a bit the code (renaming variables, functions).

Change covered by existing table tests.

* rendering/RenderTableCell.cpp:
(WebCore::RenderTableCell::computeIntrinsicPadding):
Added this new function that does the update. Removed the 'default' case, replaced by
the explicit label BASELINE_MIDDLE.

* rendering/RenderTableCell.h:
(WebCore::RenderTableCell::setIntrinsicPaddingBefore):
(WebCore::RenderTableCell::setIntrinsicPaddingAfter):
(WebCore::RenderTableCell::setIntrinsicPadding):
Moved those setters to the private section as we want other classes
to use computeIntrinsicPadding.

* rendering/RenderTableSection.cpp:
(WebCore::RenderTableSection::layoutRows):
Replaced the code with a call to RenderTableCell::computeIntrinsicPadding.
Also moved 2 variables in the loop per our coding style.

* rendering/RenderTableSection.h:
(WebCore::RenderTableSection::rowBaseline):
Renamed to match our coding style.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@130454 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/rendering/RenderTableCell.cpp
Source/WebCore/rendering/RenderTableCell.h
Source/WebCore/rendering/RenderTableSection.cpp
Source/WebCore/rendering/RenderTableSection.h