Changeset 122636 in webkit
- Timestamp:
- Jul 13, 2012 3:37:58 PM (12 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r122635 r122636 1 2012-07-13 Arpita Bahuguna <arpitabahuguna@gmail.com> 2 3 Refactor RenderTable to use the section's iteration functions. 4 https://bugs.webkit.org/show_bug.cgi?id=89751 5 6 Reviewed by Julien Chaffraix. 7 8 Removing anti-pattern wherever possible from RenderTable code. Also, modifying 9 RenderTable sections' iterations to use helper functions. 10 11 No new tests required for this change since no change in behavior is expected. 12 13 * rendering/RenderTable.cpp: 14 (WebCore::RenderTable::addOverflowFromChildren): 15 (WebCore::RenderTable::setCellLogicalWidths): 16 (WebCore::RenderTable::outerBorderStart): 17 (WebCore::RenderTable::outerBorderEnd): 18 Removed anti-patterns involving iterations over RenderObjects. 19 20 (WebCore::RenderTable::outerBorderAfter): 21 Modified RenderTable sections' iteration to use helper functions. 22 1 23 2012-07-13 Enrica Casucci <enrica@apple.com> 2 24 -
trunk/Source/WebCore/rendering/RenderTable.cpp
r121309 r122636 522 522 523 523 // Add overflow from our sections. 524 for (RenderObject* child = firstChild(); child; child = child->nextSibling()) { 525 if (child->isTableSection()) { 526 RenderTableSection* section = toRenderTableSection(child); 527 addOverflowFromChild(section); 528 } 529 } 524 for (RenderTableSection* section = topSection(); section; section = sectionBelow(section)) 525 addOverflowFromChild(section); 530 526 } 531 527 532 528 void RenderTable::setCellLogicalWidths() 533 529 { 534 for (RenderObject* child = firstChild(); child; child = child->nextSibling()) { 535 if (child->isTableSection()) 536 toRenderTableSection(child)->setCellLogicalWidths(); 537 } 530 for (RenderTableSection* section = topSection(); section; section = sectionBelow(section)) 531 section->setCellLogicalWidths(); 538 532 } 539 533 … … 1001 995 return 0; 1002 996 int borderWidth = 0; 1003 RenderTableSection* bottomSection; 1004 if (m_foot) 1005 bottomSection = m_foot; 1006 else { 1007 RenderObject* child; 1008 for (child = lastChild(); child && !child->isTableSection(); child = child->previousSibling()) { } 1009 bottomSection = child ? toRenderTableSection(child) : 0; 1010 } 1011 if (bottomSection) { 1012 borderWidth = bottomSection->outerBorderAfter(); 997 998 if (RenderTableSection* section = bottomSection()) { 999 borderWidth = section->outerBorderAfter(); 1013 1000 if (borderWidth < 0) 1014 return 0; 1001 return 0; // Overridden by hidden 1015 1002 } 1016 1003 const BorderValue& tb = style()->borderAfter(); … … 1036 1023 1037 1024 bool allHidden = true; 1038 for (RenderObject* child = firstChild(); child; child = child->nextSibling()) { 1039 if (!child->isTableSection()) 1040 continue; 1041 int sw = toRenderTableSection(child)->outerBorderStart(); 1025 for (RenderTableSection* section = topSection(); section; section = sectionBelow(section)) { 1026 int sw = section->outerBorderStart(); 1042 1027 if (sw < 0) 1043 1028 continue; … … 1065 1050 1066 1051 bool allHidden = true; 1067 for (RenderObject* child = firstChild(); child; child = child->nextSibling()) { 1068 if (!child->isTableSection()) 1069 continue; 1070 int sw = toRenderTableSection(child)->outerBorderEnd(); 1052 for (RenderTableSection* section = topSection(); section; section = sectionBelow(section)) { 1053 int sw = section->outerBorderEnd(); 1071 1054 if (sw < 0) 1072 1055 continue;
Note: See TracChangeset
for help on using the changeset viewer.