Changeset 249297 in webkit


Ignore:
Timestamp:
Aug 29, 2019 3:32:43 PM (5 years ago)
Author:
Alan Bujtas
Message:

[LFC][TFC] Initialize <tr> display boxes.
https://bugs.webkit.org/show_bug.cgi?id=201232
<rdar://problem/54806789>

Reviewed by Antti Koivisto.

Set them as blank for now.

  • layout/tableformatting/TableFormattingContext.cpp:

(WebCore::Layout::TableFormattingContext::initializeDisplayBoxToBlank const):
(WebCore::Layout::TableFormattingContext::layout const):

  • layout/tableformatting/TableFormattingContext.h:
  • layout/tableformatting/TableGrid.cpp:

(WebCore::Layout::TableGrid::Row::Row):
(WebCore::Layout::TableGrid::appendCell):

  • layout/tableformatting/TableGrid.h:

(WebCore::Layout::TableGrid::Row::box const):

Location:
trunk/Source/WebCore
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r249295 r249297  
     12019-08-29  Zalan Bujtas  <zalan@apple.com>
     2
     3        [LFC][TFC] Initialize <tr> display boxes.
     4        https://bugs.webkit.org/show_bug.cgi?id=201232
     5        <rdar://problem/54806789>
     6
     7        Reviewed by Antti Koivisto.
     8
     9        Set them as blank for now.
     10
     11        * layout/tableformatting/TableFormattingContext.cpp:
     12        (WebCore::Layout::TableFormattingContext::initializeDisplayBoxToBlank const):
     13        (WebCore::Layout::TableFormattingContext::layout const):
     14        * layout/tableformatting/TableFormattingContext.h:
     15        * layout/tableformatting/TableGrid.cpp:
     16        (WebCore::Layout::TableGrid::Row::Row):
     17        (WebCore::Layout::TableGrid::appendCell):
     18        * layout/tableformatting/TableGrid.h:
     19        (WebCore::Layout::TableGrid::Row::box const):
     20
    1212019-08-29  Youenn Fablet  <youenn@apple.com>
    222
  • trunk/Source/WebCore/layout/tableformatting/TableFormattingContext.cpp

    r249177 r249297  
    3030
    3131#include "LayoutBox.h"
     32#include "LayoutChildIterator.h"
    3233#include "TableFormattingState.h"
    3334#include <wtf/IsoMallocInlines.h>
     
    3738
    3839WTF_MAKE_ISO_ALLOCATED_IMPL(TableFormattingContext);
     40
     41// FIXME: This is temporary. Remove this function when table formatting is complete.
     42void TableFormattingContext::initializeDisplayBoxToBlank(Display::Box& displayBox) const
     43{
     44    displayBox.setBorder({ });
     45    displayBox.setPadding({ });
     46    displayBox.setHorizontalMargin({ });
     47    displayBox.setHorizontalComputedMargin({ });
     48    displayBox.setVerticalMargin({ { }, { } });
     49    displayBox.setTopLeft({ });
     50    displayBox.setContentBoxWidth({ });
     51    displayBox.setContentBoxHeight({ });
     52}
    3953
    4054// https://www.w3.org/TR/css-tables-3/#table-layout-algorithm
     
    5367    auto& columnList = grid.columnsContext().columns();
    5468    auto& rowList = grid.rows();
     69    // First row.
     70    auto& row = rowList.first();
     71    row.setLogicalTop({ });
     72    initializeDisplayBoxToBlank(layoutState.displayBoxForLayoutBox(row.box()));
     73
    5574    for (auto& cell : cellList) {
    5675        auto& cellLayoutBox = cell->tableCellBox;
     
    6281        auto& row = rowList.at(cellPosition.y());
    6382        auto& column = columnList.at(cellPosition.x());
     83
     84        initializeDisplayBoxToBlank(cellDisplayBox);
    6485        cellDisplayBox.setContentBoxWidth(column.logicalWidth());
    65         // FIXME: Do not use blanks.
    66         cellDisplayBox.setBorder({ });
    67         cellDisplayBox.setPadding({ });
    68         cellDisplayBox.setHorizontalMargin({ });
    69         cellDisplayBox.setHorizontalComputedMargin({ });
    70 
    7186        cellDisplayBox.setTopLeft({ column.logicalLeft(), row.logicalTop() });
    7287
     
    8398            auto& previousRow = rowList.at(cellPosition.y() - 1);
    8499            row.setLogicalTop(previousRow.logicalBottom());
     100            initializeDisplayBoxToBlank(layoutState.displayBoxForLayoutBox(row.box()));
    85101        }
    86102    }
  • trunk/Source/WebCore/layout/tableformatting/TableFormattingContext.h

    r249177 r249297  
    5656    void distributeAvailableWidth(LayoutUnit extraHorizontalSpace) const;
    5757
     58    void initializeDisplayBoxToBlank(Display::Box&) const;
     59
    5860    TableFormattingState& formattingState() const { return downcast<TableFormattingState>(FormattingContext::formattingState()); }
    5961};
  • trunk/Source/WebCore/layout/tableformatting/TableGrid.cpp

    r249177 r249297  
    8989}
    9090
     91TableGrid::Row::Row(const Box& rowBox)
     92    : m_layoutBox(rowBox)
     93{
     94}
     95
    9196TableGrid::CellInfo::CellInfo(const Box& tableCellBox, SlotPosition position, CellSize size)
    9297    : tableCellBox(tableCellBox)
     
    148153
    149154    if (isInNewRow)
    150         m_rows.append({ });
     155        m_rows.append({ *tableCellBox.parent() });
    151156
    152157    m_cellList.add(WTFMove(cellInfo));
  • trunk/Source/WebCore/layout/tableformatting/TableGrid.h

    r249177 r249297  
    110110    struct Row {
    111111    public:
     112        Row(const Box&);
     113
     114        const Box& box() const { return m_layoutBox; }
     115
    112116        void setLogicalTop(LayoutUnit logicalTop) { m_logicalTop = logicalTop; }
    113117        LayoutUnit logicalTop() const { return m_logicalTop; }
     
    121125        LayoutUnit m_logicalTop;
    122126        LayoutUnit m_logicalHeight;
     127        const Box& m_layoutBox;
    123128    };
    124129    using RowList = WTF::Vector<Row>;
Note: See TracChangeset for help on using the changeset viewer.