Title: [249085] trunk/Source/WebCore
- Revision
- 249085
- Author
- [email protected]
- Date
- 2019-08-24 06:34:50 -0700 (Sat, 24 Aug 2019)
Log Message
[LFC] Box::isAnonymous() can not rely on the lack of ElementType.
https://bugs.webkit.org/show_bug.cgi?id=201106
<rdar://problem/54660287>
Reviewed by Antti Koivisto.
Add bool m_isAnonymous member to mark anonymous layout boxes. Anonymous boxes are not rare enough to include this variable in RareData.
* layout/layouttree/LayoutBox.h:
(WebCore::Layout::Box::setIsAnonymous):
* layout/layouttree/LayoutTreeBuilder.cpp:
(WebCore::Layout::TreeBuilder::createLayoutBox):
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (249084 => 249085)
--- trunk/Source/WebCore/ChangeLog 2019-08-24 13:31:50 UTC (rev 249084)
+++ trunk/Source/WebCore/ChangeLog 2019-08-24 13:34:50 UTC (rev 249085)
@@ -1,3 +1,18 @@
+2019-08-24 Zalan Bujtas <[email protected]>
+
+ [LFC] Box::isAnonymous() can not rely on the lack of ElementType.
+ https://bugs.webkit.org/show_bug.cgi?id=201106
+ <rdar://problem/54660287>
+
+ Reviewed by Antti Koivisto.
+
+ Add bool m_isAnonymous member to mark anonymous layout boxes. Anonymous boxes are not rare enough to include this variable in RareData.
+
+ * layout/layouttree/LayoutBox.h:
+ (WebCore::Layout::Box::setIsAnonymous):
+ * layout/layouttree/LayoutTreeBuilder.cpp:
+ (WebCore::Layout::TreeBuilder::createLayoutBox):
+
2019-08-24 Antti Koivisto <[email protected]>
Implement layout system independent text box iterator
Modified: trunk/Source/WebCore/layout/layouttree/LayoutBox.cpp (249084 => 249085)
--- trunk/Source/WebCore/layout/layouttree/LayoutBox.cpp 2019-08-24 13:31:50 UTC (rev 249084)
+++ trunk/Source/WebCore/layout/layouttree/LayoutBox.cpp 2019-08-24 13:34:50 UTC (rev 249085)
@@ -43,6 +43,7 @@
, m_elementAttributes(attributes)
, m_baseTypeFlags(baseTypeFlags)
, m_hasRareData(false)
+ , m_isAnonymous(false)
{
if (isReplaced())
ensureRareData().replaced = makeUnique<Replaced>(*this);
Modified: trunk/Source/WebCore/layout/layouttree/LayoutBox.h (249084 => 249085)
--- trunk/Source/WebCore/layout/layouttree/LayoutBox.h 2019-08-24 13:31:50 UTC (rev 249084)
+++ trunk/Source/WebCore/layout/layouttree/LayoutBox.h 2019-08-24 13:34:50 UTC (rev 249085)
@@ -45,7 +45,7 @@
enum class ElementType {
Document,
Body,
- TableWrapperBox, // The table generates a principal block container box called the table wrapper box that contains the table box and any caption boxes.
+ TableWrapperBox, // The table generates a principal block container box called the table wrapper box that contains the table box and any caption boxes.
TableBox, // The table box is a block-level box that contains the table's internal table boxes.
TableColumn,
TableRow,
@@ -159,6 +159,8 @@
void setNextSibling(Box& nextSibling) { m_nextSibling = &nextSibling; }
void setPreviousSibling(Box& previousSibling) { m_previousSibling = &previousSibling; }
+ void setIsAnonymous() { m_isAnonymous = true; }
+
protected:
Box(Optional<ElementAttributes>, RenderStyle&&, BaseTypeFlags);
@@ -195,6 +197,7 @@
unsigned m_baseTypeFlags : 6;
bool m_hasRareData : 1;
+ bool m_isAnonymous : 1;
};
}
Modified: trunk/Source/WebCore/layout/layouttree/LayoutTreeBuilder.cpp (249084 => 249085)
--- trunk/Source/WebCore/layout/layouttree/LayoutTreeBuilder.cpp 2019-08-24 13:31:50 UTC (rev 249084)
+++ trunk/Source/WebCore/layout/layouttree/LayoutTreeBuilder.cpp 2019-08-24 13:34:50 UTC (rev 249085)
@@ -131,6 +131,7 @@
childLayoutBox = makeUnique<Box>(downcast<RenderText>(childRenderer).originalText(), RenderStyle::clone(parentRenderer.style()));
else
childLayoutBox = makeUnique<Box>(downcast<RenderText>(childRenderer).originalText(), RenderStyle::createAnonymousStyleWithDisplay(parentRenderer.style(), DisplayType::Inline));
+ childLayoutBox->setIsAnonymous();
return childLayoutBox;
}
@@ -142,6 +143,7 @@
if (is<RenderTable>(renderer)) {
// Construct the principal table wrapper box (and not the table box itself).
childLayoutBox = makeUnique<Container>(Box::ElementAttributes { Box::ElementType::TableWrapperBox }, RenderStyle::clone(renderer.style()));
+ childLayoutBox->setIsAnonymous();
} else if (is<RenderReplaced>(renderer)) {
if (displayType == DisplayType::Block)
childLayoutBox = makeUnique<Box>(elementAttributes(renderer), RenderStyle::clone(renderer.style()));
@@ -190,6 +192,9 @@
childLayoutBox->setColumnSpan(columnSpan);
}
+ if (childRenderer.isAnonymous())
+ childLayoutBox->setIsAnonymous();
+
return childLayoutBox;
}
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes