Changeset 203705 in webkit
- Timestamp:
- Jul 25, 2016 7:15:56 PM (8 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r203702 r203705 1 2016-07-25 Zalan Bujtas <zalan@apple.com> 2 3 RenderBox::haveSameDirection is used only by table items. 4 https://bugs.webkit.org/show_bug.cgi?id=160141 5 6 Reviewed by Simon Fraser. 7 8 Remove RenderBox::haveSameDirection() since it's used only by RenderTable* 9 classes. The new stand alone function (with 2 arguments) now checks if both of 10 the objects are valid. 11 12 No change in functionality. 13 14 * rendering/RenderBox.h: 15 (WebCore::RenderBox::hasSameDirectionAs): Deleted. 16 * rendering/RenderTable.cpp: 17 (WebCore::RenderTable::tableStartBorderAdjoiningCell): 18 (WebCore::RenderTable::tableEndBorderAdjoiningCell): 19 * rendering/RenderTable.h: 20 (WebCore::haveSameDirection): 21 * rendering/RenderTableCell.cpp: 22 (WebCore::RenderTableCell::hasStartBorderAdjoiningTable): 23 (WebCore::RenderTableCell::hasEndBorderAdjoiningTable): 24 * rendering/RenderTableCell.h: 25 (WebCore::RenderTableCell::borderAdjoiningTableStart): 26 (WebCore::RenderTableCell::borderAdjoiningTableEnd): 27 * rendering/RenderTableRow.h: 28 (WebCore::RenderTableRow::borderAdjoiningTableStart): 29 (WebCore::RenderTableRow::borderAdjoiningTableEnd): 30 * rendering/RenderTableSection.cpp: 31 (WebCore::RenderTableSection::borderAdjoiningStartCell): 32 (WebCore::RenderTableSection::borderAdjoiningEndCell): 33 (WebCore::RenderTableSection::firstRowCellAdjoiningTableStart): 34 (WebCore::RenderTableSection::firstRowCellAdjoiningTableEnd): 35 * rendering/RenderTableSection.h: 36 (WebCore::RenderTableSection::borderAdjoiningTableStart): 37 (WebCore::RenderTableSection::borderAdjoiningTableEnd): 38 1 39 2016-07-25 Chris Dumez <cdumez@apple.com> 2 40 -
trunk/Source/WebCore/rendering/RenderBox.h
r203656 r203705 605 605 } 606 606 607 bool hasSameDirectionAs(const RenderBox* object) const { return style().direction() == object->style().direction(); }608 609 607 #if ENABLE(CSS_SHAPES) 610 608 ShapeOutsideInfo* shapeOutsideInfo() const -
trunk/Source/WebCore/rendering/RenderTable.cpp
r203657 r203705 1566 1566 { 1567 1567 ASSERT(cell.isFirstOrLastCellInRow()); 1568 if ( hasSameDirectionAs(cell.row()))1568 if (isDirectionSame(this, cell.row())) 1569 1569 return style().borderStart(); 1570 1570 … … 1575 1575 { 1576 1576 ASSERT(cell.isFirstOrLastCellInRow()); 1577 if ( hasSameDirectionAs(cell.row()))1577 if (isDirectionSame(this, cell.row())) 1578 1578 return style().borderEnd(); 1579 1579 -
trunk/Source/WebCore/rendering/RenderTable.h
r203657 r203705 379 379 } 380 380 381 inline bool isDirectionSame(const RenderBox* tableItem, const RenderBox* otherTableItem) { return tableItem && otherTableItem ? tableItem->style().direction() == otherTableItem->style().direction() : true; } 382 381 383 } // namespace WebCore 382 384 -
trunk/Source/WebCore/rendering/RenderTableCell.cpp
r203657 r203705 507 507 bool isStartColumn = !col(); 508 508 bool isEndColumn = table()->colToEffCol(col() + colSpan() - 1) == table()->numEffCols() - 1; 509 bool hasSameDirectionAsTable = hasSameDirectionAs(section());509 bool hasSameDirectionAsTable = isDirectionSame(this, section()); 510 510 511 511 // The table direction determines the row direction. In mixed directionality, we cannot guarantee that … … 518 518 bool isStartColumn = !col(); 519 519 bool isEndColumn = table()->colToEffCol(col() + colSpan() - 1) == table()->numEffCols() - 1; 520 bool hasSameDirectionAsTable = hasSameDirectionAs(section());520 bool hasSameDirectionAsTable = isDirectionSame(this, section()); 521 521 522 522 // The table direction determines the row direction. In mixed directionality, we cannot guarantee that -
trunk/Source/WebCore/rendering/RenderTableCell.h
r203657 r203705 302 302 { 303 303 ASSERT(isFirstOrLastCellInRow()); 304 if ( section()->hasSameDirectionAs(table()))304 if (isDirectionSame(section(), table())) 305 305 return style().borderStart(); 306 306 … … 311 311 { 312 312 ASSERT(isFirstOrLastCellInRow()); 313 if ( section()->hasSameDirectionAs(table()))313 if (isDirectionSame(section(), table())) 314 314 return style().borderEnd(); 315 315 -
trunk/Source/WebCore/rendering/RenderTableRow.h
r203657 r203705 108 108 inline const BorderValue& RenderTableRow::borderAdjoiningTableStart() const 109 109 { 110 RenderTableSection* section = this->section(); 111 if (section && section->hasSameDirectionAs(table())) 110 if (isDirectionSame(section(), table())) 112 111 return style().borderStart(); 113 112 return style().borderEnd(); … … 116 115 inline const BorderValue& RenderTableRow::borderAdjoiningTableEnd() const 117 116 { 118 RenderTableSection* section = this->section(); 119 if (section && section->hasSameDirectionAs(table())) 117 if (isDirectionSame(section(), table())) 120 118 return style().borderEnd(); 121 119 return style().borderStart(); -
trunk/Source/WebCore/rendering/RenderTableSection.cpp
r203657 r203705 1423 1423 { 1424 1424 ASSERT(cell.isFirstOrLastCellInRow()); 1425 return hasSameDirectionAs(&cell) ? style().borderStart() : style().borderEnd();1425 return isDirectionSame(this, &cell) ? style().borderStart() : style().borderEnd(); 1426 1426 } 1427 1427 … … 1429 1429 { 1430 1430 ASSERT(cell.isFirstOrLastCellInRow()); 1431 return hasSameDirectionAs(&cell) ? style().borderEnd() : style().borderStart();1431 return isDirectionSame(this, &cell) ? style().borderEnd() : style().borderStart(); 1432 1432 } 1433 1433 1434 1434 const RenderTableCell* RenderTableSection::firstRowCellAdjoiningTableStart() const 1435 1435 { 1436 unsigned adjoiningStartCellColumnIndex = hasSameDirectionAs(table()) ? 0 : table()->lastColumnIndex();1436 unsigned adjoiningStartCellColumnIndex = isDirectionSame(this, table()) ? 0 : table()->lastColumnIndex(); 1437 1437 return cellAt(0, adjoiningStartCellColumnIndex).primaryCell(); 1438 1438 } … … 1440 1440 const RenderTableCell* RenderTableSection::firstRowCellAdjoiningTableEnd() const 1441 1441 { 1442 unsigned adjoiningEndCellColumnIndex = hasSameDirectionAs(table()) ? table()->lastColumnIndex() : 0;1442 unsigned adjoiningEndCellColumnIndex = isDirectionSame(this, table()) ? table()->lastColumnIndex() : 0; 1443 1443 return cellAt(0, adjoiningEndCellColumnIndex).primaryCell(); 1444 1444 } -
trunk/Source/WebCore/rendering/RenderTableSection.h
r203657 r203705 243 243 inline const BorderValue& RenderTableSection::borderAdjoiningTableStart() const 244 244 { 245 if ( hasSameDirectionAs(table()))245 if (isDirectionSame(this, table())) 246 246 return style().borderStart(); 247 247 return style().borderEnd(); … … 250 250 inline const BorderValue& RenderTableSection::borderAdjoiningTableEnd() const 251 251 { 252 if ( hasSameDirectionAs(table()))252 if (isDirectionSame(this, table())) 253 253 return style().borderEnd(); 254 254 return style().borderStart();
Note: See TracChangeset
for help on using the changeset viewer.