Changeset 203705 in webkit


Ignore:
Timestamp:
Jul 25, 2016 7:15:56 PM (8 years ago)
Author:
Alan Bujtas
Message:

RenderBox::haveSameDirection is used only by table items.
https://bugs.webkit.org/show_bug.cgi?id=160141

Reviewed by Simon Fraser.

Remove RenderBox::haveSameDirection() since it's used only by RenderTable*
classes. The new stand alone function (with 2 arguments) now checks if both of
the objects are valid.

No change in functionality.

  • rendering/RenderBox.h:

(WebCore::RenderBox::hasSameDirectionAs): Deleted.

  • rendering/RenderTable.cpp:

(WebCore::RenderTable::tableStartBorderAdjoiningCell):
(WebCore::RenderTable::tableEndBorderAdjoiningCell):

  • rendering/RenderTable.h:

(WebCore::haveSameDirection):

  • rendering/RenderTableCell.cpp:

(WebCore::RenderTableCell::hasStartBorderAdjoiningTable):
(WebCore::RenderTableCell::hasEndBorderAdjoiningTable):

  • rendering/RenderTableCell.h:

(WebCore::RenderTableCell::borderAdjoiningTableStart):
(WebCore::RenderTableCell::borderAdjoiningTableEnd):

  • rendering/RenderTableRow.h:

(WebCore::RenderTableRow::borderAdjoiningTableStart):
(WebCore::RenderTableRow::borderAdjoiningTableEnd):

  • rendering/RenderTableSection.cpp:

(WebCore::RenderTableSection::borderAdjoiningStartCell):
(WebCore::RenderTableSection::borderAdjoiningEndCell):
(WebCore::RenderTableSection::firstRowCellAdjoiningTableStart):
(WebCore::RenderTableSection::firstRowCellAdjoiningTableEnd):

  • rendering/RenderTableSection.h:

(WebCore::RenderTableSection::borderAdjoiningTableStart):
(WebCore::RenderTableSection::borderAdjoiningTableEnd):

Location:
trunk/Source/WebCore
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r203702 r203705  
     12016-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
    1392016-07-25  Chris Dumez  <cdumez@apple.com>
    240
  • trunk/Source/WebCore/rendering/RenderBox.h

    r203656 r203705  
    605605    }
    606606
    607     bool hasSameDirectionAs(const RenderBox* object) const { return style().direction() == object->style().direction(); }
    608 
    609607#if ENABLE(CSS_SHAPES)
    610608    ShapeOutsideInfo* shapeOutsideInfo() const
  • trunk/Source/WebCore/rendering/RenderTable.cpp

    r203657 r203705  
    15661566{
    15671567    ASSERT(cell.isFirstOrLastCellInRow());
    1568     if (hasSameDirectionAs(cell.row()))
     1568    if (isDirectionSame(this, cell.row()))
    15691569        return style().borderStart();
    15701570
     
    15751575{
    15761576    ASSERT(cell.isFirstOrLastCellInRow());
    1577     if (hasSameDirectionAs(cell.row()))
     1577    if (isDirectionSame(this, cell.row()))
    15781578        return style().borderEnd();
    15791579
  • trunk/Source/WebCore/rendering/RenderTable.h

    r203657 r203705  
    379379}
    380380
     381inline bool isDirectionSame(const RenderBox* tableItem, const RenderBox* otherTableItem) { return tableItem && otherTableItem ? tableItem->style().direction() == otherTableItem->style().direction() : true; }
     382
    381383} // namespace WebCore
    382384
  • trunk/Source/WebCore/rendering/RenderTableCell.cpp

    r203657 r203705  
    507507    bool isStartColumn = !col();
    508508    bool isEndColumn = table()->colToEffCol(col() + colSpan() - 1) == table()->numEffCols() - 1;
    509     bool hasSameDirectionAsTable = hasSameDirectionAs(section());
     509    bool hasSameDirectionAsTable = isDirectionSame(this, section());
    510510
    511511    // The table direction determines the row direction. In mixed directionality, we cannot guarantee that
     
    518518    bool isStartColumn = !col();
    519519    bool isEndColumn = table()->colToEffCol(col() + colSpan() - 1) == table()->numEffCols() - 1;
    520     bool hasSameDirectionAsTable = hasSameDirectionAs(section());
     520    bool hasSameDirectionAsTable = isDirectionSame(this, section());
    521521
    522522    // The table direction determines the row direction. In mixed directionality, we cannot guarantee that
  • trunk/Source/WebCore/rendering/RenderTableCell.h

    r203657 r203705  
    302302{
    303303    ASSERT(isFirstOrLastCellInRow());
    304     if (section()->hasSameDirectionAs(table()))
     304    if (isDirectionSame(section(), table()))
    305305        return style().borderStart();
    306306
     
    311311{
    312312    ASSERT(isFirstOrLastCellInRow());
    313     if (section()->hasSameDirectionAs(table()))
     313    if (isDirectionSame(section(), table()))
    314314        return style().borderEnd();
    315315
  • trunk/Source/WebCore/rendering/RenderTableRow.h

    r203657 r203705  
    108108inline const BorderValue& RenderTableRow::borderAdjoiningTableStart() const
    109109{
    110     RenderTableSection* section = this->section();
    111     if (section && section->hasSameDirectionAs(table()))
     110    if (isDirectionSame(section(), table()))
    112111        return style().borderStart();
    113112    return style().borderEnd();
     
    116115inline const BorderValue& RenderTableRow::borderAdjoiningTableEnd() const
    117116{
    118     RenderTableSection* section = this->section();
    119     if (section && section->hasSameDirectionAs(table()))
     117    if (isDirectionSame(section(), table()))
    120118        return style().borderEnd();
    121119    return style().borderStart();
  • trunk/Source/WebCore/rendering/RenderTableSection.cpp

    r203657 r203705  
    14231423{
    14241424    ASSERT(cell.isFirstOrLastCellInRow());
    1425     return hasSameDirectionAs(&cell) ? style().borderStart() : style().borderEnd();
     1425    return isDirectionSame(this, &cell) ? style().borderStart() : style().borderEnd();
    14261426}
    14271427
     
    14291429{
    14301430    ASSERT(cell.isFirstOrLastCellInRow());
    1431     return hasSameDirectionAs(&cell) ? style().borderEnd() : style().borderStart();
     1431    return isDirectionSame(this, &cell) ? style().borderEnd() : style().borderStart();
    14321432}
    14331433
    14341434const RenderTableCell* RenderTableSection::firstRowCellAdjoiningTableStart() const
    14351435{
    1436     unsigned adjoiningStartCellColumnIndex = hasSameDirectionAs(table()) ? 0 : table()->lastColumnIndex();
     1436    unsigned adjoiningStartCellColumnIndex = isDirectionSame(this, table()) ? 0 : table()->lastColumnIndex();
    14371437    return cellAt(0, adjoiningStartCellColumnIndex).primaryCell();
    14381438}
     
    14401440const RenderTableCell* RenderTableSection::firstRowCellAdjoiningTableEnd() const
    14411441{
    1442     unsigned adjoiningEndCellColumnIndex = hasSameDirectionAs(table()) ? table()->lastColumnIndex() : 0;
     1442    unsigned adjoiningEndCellColumnIndex = isDirectionSame(this, table()) ? table()->lastColumnIndex() : 0;
    14431443    return cellAt(0, adjoiningEndCellColumnIndex).primaryCell();
    14441444}
  • trunk/Source/WebCore/rendering/RenderTableSection.h

    r203657 r203705  
    243243inline const BorderValue& RenderTableSection::borderAdjoiningTableStart() const
    244244{
    245     if (hasSameDirectionAs(table()))
     245    if (isDirectionSame(this, table()))
    246246        return style().borderStart();
    247247    return style().borderEnd();
     
    250250inline const BorderValue& RenderTableSection::borderAdjoiningTableEnd() const
    251251{
    252     if (hasSameDirectionAs(table()))
     252    if (isDirectionSame(this, table()))
    253253        return style().borderEnd();
    254254    return style().borderStart();
Note: See TracChangeset for help on using the changeset viewer.