Title: [262697] trunk/Source/WebCore
- Revision
- 262697
- Author
- za...@apple.com
- Date
- 2020-06-07 07:56:08 -0700 (Sun, 07 Jun 2020)
Log Message
[LFC] Pass in the element attributes to Layout::ReplacedBox
https://bugs.webkit.org/show_bug.cgi?id=212879
Reviewed by Antti Koivisto.
The information whether the replace box is an image box is required to see if the box has intrinsic ratio (used for sizing inflow replaced content).
* layout/layouttree/LayoutReplacedBox.cpp:
(WebCore::Layout::ReplacedBox::ReplacedBox):
(): Deleted.
* layout/layouttree/LayoutReplacedBox.h:
* layout/layouttree/LayoutTreeBuilder.cpp:
(WebCore::Layout::TreeBuilder::createReplacedBox):
(WebCore::Layout::TreeBuilder::createLayoutBox):
* layout/layouttree/LayoutTreeBuilder.h:
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (262696 => 262697)
--- trunk/Source/WebCore/ChangeLog 2020-06-07 14:35:51 UTC (rev 262696)
+++ trunk/Source/WebCore/ChangeLog 2020-06-07 14:56:08 UTC (rev 262697)
@@ -1,3 +1,21 @@
+2020-06-07 Zalan Bujtas <za...@apple.com>
+
+ [LFC] Pass in the element attributes to Layout::ReplacedBox
+ https://bugs.webkit.org/show_bug.cgi?id=212879
+
+ Reviewed by Antti Koivisto.
+
+ The information whether the replace box is an image box is required to see if the box has intrinsic ratio (used for sizing inflow replaced content).
+
+ * layout/layouttree/LayoutReplacedBox.cpp:
+ (WebCore::Layout::ReplacedBox::ReplacedBox):
+ (): Deleted.
+ * layout/layouttree/LayoutReplacedBox.h:
+ * layout/layouttree/LayoutTreeBuilder.cpp:
+ (WebCore::Layout::TreeBuilder::createReplacedBox):
+ (WebCore::Layout::TreeBuilder::createLayoutBox):
+ * layout/layouttree/LayoutTreeBuilder.h:
+
2020-06-07 Philippe Normand <pnorm...@igalia.com>
Remove ENABLE_VIDEO_TRACK ifdef guards
Modified: trunk/Source/WebCore/layout/layouttree/LayoutReplacedBox.cpp (262696 => 262697)
--- trunk/Source/WebCore/layout/layouttree/LayoutReplacedBox.cpp 2020-06-07 14:35:51 UTC (rev 262696)
+++ trunk/Source/WebCore/layout/layouttree/LayoutReplacedBox.cpp 2020-06-07 14:56:08 UTC (rev 262697)
@@ -36,8 +36,8 @@
WTF_MAKE_ISO_ALLOCATED_IMPL(ReplacedBox);
-ReplacedBox::ReplacedBox(RenderStyle&& style)
- : Box({ }, WTFMove(style), Box::ReplacedBoxFlag)
+ReplacedBox::ReplacedBox(Optional<ElementAttributes> elementAttributes, RenderStyle&& style)
+ : Box(elementAttributes, WTFMove(style), Box::ReplacedBoxFlag)
{
}
Modified: trunk/Source/WebCore/layout/layouttree/LayoutReplacedBox.h (262696 => 262697)
--- trunk/Source/WebCore/layout/layouttree/LayoutReplacedBox.h 2020-06-07 14:35:51 UTC (rev 262696)
+++ trunk/Source/WebCore/layout/layouttree/LayoutReplacedBox.h 2020-06-07 14:56:08 UTC (rev 262697)
@@ -40,7 +40,7 @@
class ReplacedBox : public Box {
WTF_MAKE_ISO_ALLOCATED(ReplacedBox);
public:
- ReplacedBox(RenderStyle&&);
+ ReplacedBox(Optional<ElementAttributes>, RenderStyle&&);
virtual ~ReplacedBox() = default;
void setCachedImage(CachedImage& cachedImage) { m_cachedImage = &cachedImage; }
Modified: trunk/Source/WebCore/layout/layouttree/LayoutTreeBuilder.cpp (262696 => 262697)
--- trunk/Source/WebCore/layout/layouttree/LayoutTreeBuilder.cpp 2020-06-07 14:35:51 UTC (rev 262696)
+++ trunk/Source/WebCore/layout/layouttree/LayoutTreeBuilder.cpp 2020-06-07 14:56:08 UTC (rev 262697)
@@ -145,9 +145,9 @@
buildSubTree(m_layoutTreeContent.rootRenderer(), m_layoutTreeContent.rootLayoutBox());
}
-Box& TreeBuilder::createReplacedBox(RenderStyle&& style)
+Box& TreeBuilder::createReplacedBox(Optional<Box::ElementAttributes> elementAttributes, RenderStyle&& style)
{
- auto newBox = makeUnique<ReplacedBox>(WTFMove(style));
+ auto newBox = makeUnique<ReplacedBox>(elementAttributes, WTFMove(style));
auto& box = *newBox;
m_layoutTreeContent.addBox(WTFMove(newBox));
return box;
@@ -236,7 +236,7 @@
childLayoutBox = &createContainer(Box::ElementAttributes { Box::ElementType::TableWrapperBox }, WTFMove(tableWrapperBoxStyle));
childLayoutBox->setIsAnonymous();
} else if (is<RenderReplaced>(renderer)) {
- childLayoutBox = &createReplacedBox(WTFMove(clonedStyle));
+ childLayoutBox = &createReplacedBox(elementAttributes(renderer), WTFMove(clonedStyle));
// FIXME: We don't yet support all replaced elements and this is temporary anyway.
downcast<ReplacedBox>(*childLayoutBox).setIntrinsicSize(downcast<RenderReplaced>(renderer).intrinsicSize());
if (is<RenderImage>(renderer)) {
Modified: trunk/Source/WebCore/layout/layouttree/LayoutTreeBuilder.h (262696 => 262697)
--- trunk/Source/WebCore/layout/layouttree/LayoutTreeBuilder.h 2020-06-07 14:35:51 UTC (rev 262696)
+++ trunk/Source/WebCore/layout/layouttree/LayoutTreeBuilder.h 2020-06-07 14:56:08 UTC (rev 262697)
@@ -90,7 +90,7 @@
void buildTableStructure(const RenderTable& tableRenderer, ContainerBox& tableWrapperBox);
Box* createLayoutBox(const ContainerBox& parentContainer, const RenderObject& childRenderer);
- Box& createReplacedBox(RenderStyle&&);
+ Box& createReplacedBox(Optional<Box::ElementAttributes>, RenderStyle&&);
Box& createTextBox(String text, bool canUseSimplifiedTextMeasuring, RenderStyle&&);
Box& createLineBreakBox(bool isOptional, RenderStyle&&);
ContainerBox& createContainer(Optional<Box::ElementAttributes>, RenderStyle&&);
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes