Changeset 247927 in webkit
- Timestamp:
- Jul 29, 2019 4:04:43 PM (5 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r247926 r247927 1 2019-07-29 Zalan Bujtas <zalan@apple.com> 2 3 [LFC][TFC] Introduce Box::establishesTableFormattingContext 4 https://bugs.webkit.org/show_bug.cgi?id=200060 5 6 Reviewed by Antti Koivisto. 7 8 https://www.w3.org/TR/CSS22/tables.html 9 10 The table generates a principal block container box called the table wrapper box that contains the table box itself and any caption boxes. 11 The table box is a block-level box that contains the table's internal table boxes. 12 The table wrapper box is block-level for 'display: table', and inline-level; for 'display: inline-table'. The table wrapper box establishes a block 13 formatting context, and the table box establishes a table formatting context." 14 15 * layout/layouttree/LayoutBox.cpp: 16 (WebCore::Layout::Box::establishesFormattingContext const): 17 (WebCore::Layout::Box::establishesTableFormattingContext const): 18 (WebCore::Layout::Box::isBlockLevelBox const): 19 (WebCore::Layout::Box::isInlineLevelBox const): 20 (WebCore::Layout::Box::isBlockContainerBox const): 21 * layout/layouttree/LayoutBox.h: 22 (WebCore::Layout::Box::isTableWrapperBox const): 23 (WebCore::Layout::Box::isTableBox const): 24 1 25 2019-07-29 Zalan Bujtas <zalan@apple.com> 2 26 -
trunk/Source/WebCore/layout/layouttree/LayoutBox.cpp
r247198 r247927 58 58 bool Box::establishesFormattingContext() const 59 59 { 60 return establishesBlockFormattingContext() || establishesInlineFormattingContext() ;60 return establishesBlockFormattingContext() || establishesInlineFormattingContext() || establishesTableFormattingContext(); 61 61 } 62 62 … … 81 81 82 82 return false; 83 } 84 85 bool Box::establishesTableFormattingContext() const 86 { 87 return isTableBox(); 83 88 } 84 89 … … 222 227 // Block level elements generate block level boxes. 223 228 auto display = m_style.display(); 224 return display == DisplayType::Block || display == DisplayType::ListItem || display == DisplayType::Table;229 return display == DisplayType::Block || display == DisplayType::ListItem || (display == DisplayType::Table && !isTableWrapperBox()); 225 230 } 226 231 … … 229 234 // Inline level elements generate inline level boxes. 230 235 auto display = m_style.display(); 231 return display == DisplayType::Inline || display == DisplayType::InlineBlock|| display == DisplayType::InlineTable;236 return display == DisplayType::Inline || isInlineBlockBox() || display == DisplayType::InlineTable; 232 237 } 233 238 234 239 bool Box::isBlockContainerBox() const 235 240 { 236 // Inline level elements generate inline level boxes.237 241 auto display = m_style.display(); 238 return display == DisplayType::Block || display == DisplayType::ListItem || display == DisplayType::InlineBlock || display == DisplayType::TableCell|| display == DisplayType::TableCaption; // TODO && !replaced element242 return display == DisplayType::Block || display == DisplayType::ListItem || isInlineBlockBox() || isTableWrapperBox() || isTableCell() || display == DisplayType::TableCaption; // TODO && !replaced element 239 243 } 240 244 -
trunk/Source/WebCore/layout/layouttree/LayoutBox.h
r247198 r247927 46 46 Document, 47 47 Body, 48 TableWrapperBox, // The table generates a principal block container box called the table wrapper box that contains the table box and any caption boxes. 49 TableBox, // The table box is a block-level box that contains the table's internal table boxes. 48 50 TableCell, 49 51 TableColumn, … … 77 79 bool establishesFormattingContext() const; 78 80 bool establishesBlockFormattingContext() const; 81 bool establishesTableFormattingContext() const; 79 82 bool establishesBlockFormattingContextOnly() const; 80 83 virtual bool establishesInlineFormattingContext() const { return false; } … … 114 117 bool isDocumentBox() const { return m_elementAttributes && m_elementAttributes.value().elementType == ElementType::Document; } 115 118 bool isBodyBox() const { return m_elementAttributes && m_elementAttributes.value().elementType == ElementType::Body; } 119 bool isTableWrapperBox() const { return m_elementAttributes && m_elementAttributes.value().elementType == ElementType::TableWrapperBox; } 120 bool isTableBox() const { return m_elementAttributes && m_elementAttributes.value().elementType == ElementType::TableBox; } 116 121 bool isTableCell() const { return m_elementAttributes && m_elementAttributes.value().elementType == ElementType::TableCell; } 117 122 bool isReplaced() const { return isImage() || isIFrame(); }
Note: See TracChangeset
for help on using the changeset viewer.