Changeset 248594 in webkit
- Timestamp:
- Aug 13, 2019 8:11:53 AM (5 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r248593 r248594 1 2019-08-13 Zalan Bujtas <zalan@apple.com> 2 3 [LFC][TFC] Add rowSpan and colSpan to Box 4 https://bugs.webkit.org/show_bug.cgi?id=200654 5 <rdar://problem/54239281> 6 7 Reviewed by Antti Koivisto. 8 9 colSpan and rowSpan are not part of the RenderStyle. We eventually need to find a more appropriate place for the "random DOM things". 10 11 * layout/layouttree/LayoutBox.cpp: 12 (WebCore::Layout::Box::setRowSpan): 13 (WebCore::Layout::Box::setColumnSpan): 14 (WebCore::Layout::Box::rowSpan const): 15 (WebCore::Layout::Box::columnSpan const): 16 * layout/layouttree/LayoutBox.h: 17 * layout/layouttree/LayoutTreeBuilder.cpp: 18 (WebCore::Layout::TreeBuilder::createLayoutBox): 19 1 20 2019-08-13 Youenn Fablet <youenn@apple.com> 2 21 -
trunk/Source/WebCore/layout/layouttree/LayoutBox.cpp
r248364 r248594 409 409 } 410 410 411 void Box::setRowSpan(unsigned rowSpan) 412 { 413 ensureRareData().rowSpan = rowSpan; 414 } 415 416 void Box::setColumnSpan(unsigned columnSpan) 417 { 418 ensureRareData().columnSpan = columnSpan; 419 } 420 421 unsigned Box::rowSpan() const 422 { 423 if (!hasRareData()) 424 return 1; 425 return rareData().rowSpan; 426 } 427 428 unsigned Box::columnSpan() const 429 { 430 if (!hasRareData()) 431 return 1; 432 return rareData().columnSpan; 433 } 434 411 435 Box::RareDataMap& Box::rareDataMap() 412 436 { -
trunk/Source/WebCore/layout/layouttree/LayoutBox.h
r248290 r248594 147 147 String textContent() const; 148 148 149 // FIXME: Find a better place for random DOM things. 150 void setRowSpan(unsigned); 151 void setColumnSpan(unsigned); 152 unsigned rowSpan() const; 153 unsigned columnSpan() const; 154 149 155 void setParent(Container& parent) { m_parent = &parent; } 150 156 void setNextSibling(Box& nextSibling) { m_nextSibling = &nextSibling; } … … 164 170 String textContent; 165 171 std::unique_ptr<Replaced> replaced; 172 unsigned rowSpan { 1 }; 173 unsigned columnSpan { 1 }; 166 174 }; 167 175 -
trunk/Source/WebCore/layout/layouttree/LayoutTreeBuilder.cpp
r248364 r248594 31 31 #include "DisplayBox.h" 32 32 #include "DisplayRun.h" 33 #include "HTMLTableCellElement.h" 33 34 #include "InlineFormattingState.h" 34 35 #include "LayoutBox.h" … … 47 48 #include "RenderTable.h" 48 49 #include "RenderTableCaption.h" 50 #include "RenderTableCell.h" 49 51 #include "RenderView.h" 50 52 #include <wtf/text/TextStream.h> … … 179 181 } 180 182 } 183 184 if (is<RenderTableCell>(renderer)) { 185 auto& cellElement = downcast<HTMLTableCellElement>(*renderer.element()); 186 auto rowSpan = cellElement.rowSpan(); 187 if (rowSpan > 1) 188 childLayoutBox->setRowSpan(rowSpan); 189 190 auto columnSpan = cellElement.colSpan(); 191 if (columnSpan > 1) 192 childLayoutBox->setColumnSpan(columnSpan); 193 } 194 181 195 return childLayoutBox; 182 196 }
Note: See TracChangeset
for help on using the changeset viewer.