⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 264103 in webkit


Ignore:
Timestamp:
Jul 8, 2020, 9:41:35 AM (6 years ago)
Author:
Alan Bujtas
Message:

[LFC][TFC] Table width is computed as if box-sizing was border-box
​https://bugs.webkit.org/show_bug.cgi?id=214070

Reviewed by Antti Koivisto.

Source/WebCore:

Apparently the width property of the <table> works as if box-sizing were set to border-box (and <div style="display: table" does not).

Test: fast/layoutformattingcontext/table-with-padding-and-border-simple.html

  • layout/layouttree/LayoutTreeBuilder.cpp:

(WebCore::Layout::TreeBuilder::buildTableStructure):

LayoutTests:

  • fast/layoutformattingcontext/table-with-padding-and-border-simple-expected.html: Added.
  • fast/layoutformattingcontext/table-with-padding-and-border-simple.html: Added.
Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r264102 r264103  
     12020-07-08  Zalan Bujtas  <zalan@apple.com>
     2
     3        [LFC][TFC] Table width is computed as if box-sizing was border-box
     4        https://bugs.webkit.org/show_bug.cgi?id=214070
     5
     6        Reviewed by Antti Koivisto.
     7
     8        * fast/layoutformattingcontext/table-with-padding-and-border-simple-expected.html: Added.
     9        * fast/layoutformattingcontext/table-with-padding-and-border-simple.html: Added.
     10
    1112020-07-08  Per Arne Vollan  <pvollan@apple.com>
    212
  • trunk/Source/WebCore/ChangeLog

    r264101 r264103  
     12020-07-08  Zalan Bujtas  <zalan@apple.com>
     2
     3        [LFC][TFC] Table width is computed as if box-sizing was border-box
     4        https://bugs.webkit.org/show_bug.cgi?id=214070
     5
     6        Reviewed by Antti Koivisto.
     7
     8        Apparently the width property of the <table> works as if box-sizing were set to border-box (and <div style="display: table" does not).
     9
     10        Test: fast/layoutformattingcontext/table-with-padding-and-border-simple.html
     11
     12        * layout/layouttree/LayoutTreeBuilder.cpp:
     13        (WebCore::Layout::TreeBuilder::buildTableStructure):
     14
    1152020-07-07  Antoine Quint  <graouts@webkit.org>
    216
  • trunk/Source/WebCore/layout/layouttree/LayoutTreeBuilder.cpp

    r262792 r264103  
    3535#include "HTMLTableCellElement.h"
    3636#include "HTMLTableColElement.h"
     37#include "HTMLTableElement.h"
    3738#include "InlineFormattingState.h"
    3839#include "InvalidationContext.h"
    … …  
    316317    tableBoxStyle.setFloating(Float::No);
    317318    tableBoxStyle.resetMargin();
     319    // FIXME: Figure out where the spec says table width is like box-sizing: border-box;
     320    if (is<HTMLTableElement>(tableRenderer.element()))
     321        tableBoxStyle.setBoxSizing(BoxSizing::BorderBox);
    318322    auto& tableBox = createContainer(Box::ElementAttributes { Box::ElementType::TableBox }, WTFMove(tableBoxStyle));
    319323    appendChild(tableWrapperBox, tableBox);
Note: See TracChangeset for help on using the changeset viewer.