Title: [240779] trunk
Revision
240779
Author
za...@apple.com
Date
2019-01-31 05:38:12 -0800 (Thu, 31 Jan 2019)

Log Message

[LFC][BFC] Add support for block level replaced box.
https://bugs.webkit.org/show_bug.cgi?id=194071

Reviewed by Antti Koivisto.

Source/WebCore:

* layout/layouttree/LayoutBox.cpp:
(WebCore::Layout::Box::Box):
* layout/layouttree/LayoutBox.h:
* layout/layouttree/LayoutTreeBuilder.cpp:
(WebCore::Layout::TreeBuilder::createSubTree):
(WebCore::Layout::outputLayoutBox):

Tools:

* LayoutReloaded/misc/LFC-passing-tests.txt:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (240778 => 240779)


--- trunk/Source/WebCore/ChangeLog	2019-01-31 13:06:16 UTC (rev 240778)
+++ trunk/Source/WebCore/ChangeLog	2019-01-31 13:38:12 UTC (rev 240779)
@@ -1,3 +1,17 @@
+2019-01-31  Zalan Bujtas  <za...@apple.com>
+
+        [LFC][BFC] Add support for block level replaced box.
+        https://bugs.webkit.org/show_bug.cgi?id=194071
+
+        Reviewed by Antti Koivisto.
+
+        * layout/layouttree/LayoutBox.cpp:
+        (WebCore::Layout::Box::Box):
+        * layout/layouttree/LayoutBox.h:
+        * layout/layouttree/LayoutTreeBuilder.cpp:
+        (WebCore::Layout::TreeBuilder::createSubTree):
+        (WebCore::Layout::outputLayoutBox):
+
 2019-01-31  Chris Fleizach  <cfleiz...@apple.com>
 
         ASSERTION FAILED: cache under WebCore::AXObjectCache::postTextStateChangePlatformNotification

Modified: trunk/Source/WebCore/layout/layouttree/LayoutBox.cpp (240778 => 240779)


--- trunk/Source/WebCore/layout/layouttree/LayoutBox.cpp	2019-01-31 13:06:16 UTC (rev 240778)
+++ trunk/Source/WebCore/layout/layouttree/LayoutBox.cpp	2019-01-31 13:38:12 UTC (rev 240779)
@@ -46,6 +46,11 @@
         m_replaced = std::make_unique<Replaced>(*this);
 }
 
+Box::Box(Optional<ElementAttributes> attributes, RenderStyle&& style)
+    : Box(attributes, WTFMove(style), BaseTypeFlag::BoxFlag)
+{
+}
+
 Box::~Box()
 {
 }

Modified: trunk/Source/WebCore/layout/layouttree/LayoutBox.h (240778 => 240779)


--- trunk/Source/WebCore/layout/layouttree/LayoutBox.h	2019-01-31 13:06:16 UTC (rev 240778)
+++ trunk/Source/WebCore/layout/layouttree/LayoutBox.h	2019-01-31 13:38:12 UTC (rev 240779)
@@ -61,15 +61,16 @@
     };
 
     enum BaseTypeFlag {
-        ContainerFlag         = 1 << 0,
-        BlockContainerFlag    = 1 << 1,
-        InlineBoxFlag         = 1 << 2,
-        InlineContainerFlag   = 1 << 3,
-        LineBreakBoxFlag      = 1 << 4
+        BoxFlag               = 1 << 0,
+        ContainerFlag         = 1 << 1,
+        BlockContainerFlag    = 1 << 2,
+        InlineBoxFlag         = 1 << 3,
+        InlineContainerFlag   = 1 << 4,
+        LineBreakBoxFlag      = 1 << 5
     };
     typedef unsigned BaseTypeFlags;
 
-    Box(Optional<ElementAttributes>, RenderStyle&&, BaseTypeFlags);
+    Box(Optional<ElementAttributes>, RenderStyle&&);
     virtual ~Box();
 
     bool establishesFormattingContext() const;
@@ -135,6 +136,9 @@
     void setNextSibling(Box& nextSibling) { m_nextSibling = &nextSibling; }
     void setPreviousSibling(Box& previousSibling) { m_previousSibling = &previousSibling; }
 
+protected:
+    Box(Optional<ElementAttributes>, RenderStyle&&, BaseTypeFlags);
+
 private:
     RenderStyle m_style;
     Optional<ElementAttributes> m_elementAttributes;

Modified: trunk/Source/WebCore/layout/layouttree/LayoutTreeBuilder.cpp (240778 => 240779)


--- trunk/Source/WebCore/layout/layouttree/LayoutTreeBuilder.cpp	2019-01-31 13:06:16 UTC (rev 240778)
+++ trunk/Source/WebCore/layout/layouttree/LayoutTreeBuilder.cpp	2019-01-31 13:38:12 UTC (rev 240779)
@@ -77,7 +77,7 @@
                 return Box::ElementAttributes { Box::ElementType::TableFooterGroup };
             if (element->hasTagName(HTMLNames::tfootTag))
                 return Box::ElementAttributes { Box::ElementType::TableFooterGroup };
-            if (element->hasTagName(HTMLNames::imgTag))
+            if (element->hasTagName(HTMLNames::imgTag) || element->hasTagName(HTMLNames::iframeTag))
                 return Box::ElementAttributes { Box::ElementType::Replaced };
             return Box::ElementAttributes { Box::ElementType::GenericElement };
         }
@@ -92,7 +92,11 @@
             downcast<InlineBox>(*box).setTextContent(downcast<RenderText>(child).originalText());
         } else if (is<RenderReplaced>(child)) {
             auto& renderer = downcast<RenderReplaced>(child);
-            box = std::make_unique<InlineBox>(elementAttributes(renderer), RenderStyle::clone(renderer.style()));
+            auto display = renderer.style().display();
+            if (display == DisplayType::Block)
+                box = std::make_unique<Box>(elementAttributes(renderer), RenderStyle::clone(renderer.style()));
+            else
+                box = std::make_unique<InlineBox>(elementAttributes(renderer), RenderStyle::clone(renderer.style()));
         } else if (is<RenderElement>(child)) {
             auto& renderer = downcast<RenderElement>(child);
             auto display = renderer.style().display();
@@ -176,7 +180,9 @@
         if (!layoutBox.parent())
             stream << "initial ";
         stream << "block container";
-    } else
+    } else if (layoutBox.isBlockLevelBox())
+        stream << "block box";
+    else
         stream << "box";
     // FIXME: Inline text runs don't create display boxes yet.
     if (displayBox) {

Modified: trunk/Tools/ChangeLog (240778 => 240779)


--- trunk/Tools/ChangeLog	2019-01-31 13:06:16 UTC (rev 240778)
+++ trunk/Tools/ChangeLog	2019-01-31 13:38:12 UTC (rev 240779)
@@ -1,3 +1,12 @@
+2019-01-31  Zalan Bujtas  <za...@apple.com>
+
+        [LFC][BFC] Add support for block level replaced box.
+        https://bugs.webkit.org/show_bug.cgi?id=194071
+
+        Reviewed by Antti Koivisto.
+
+        * LayoutReloaded/misc/LFC-passing-tests.txt:
+
 2019-01-31  Fujii Hironori  <hironori.fu...@sony.com>
 
         Fix WebKitTestRunner's testPath with Windows full paths

Modified: trunk/Tools/LayoutReloaded/misc/LFC-passing-tests.txt (240778 => 240779)


--- trunk/Tools/LayoutReloaded/misc/LFC-passing-tests.txt	2019-01-31 13:06:16 UTC (rev 240778)
+++ trunk/Tools/LayoutReloaded/misc/LFC-passing-tests.txt	2019-01-31 13:38:12 UTC (rev 240779)
@@ -414,6 +414,12 @@
 css2.1/20110323/absolute-non-replaced-width-014.htm
 css2.1/20110323/absolute-non-replaced-width-015.htm
 css2.1/20110323/absolute-non-replaced-width-016.htm
+css2.1/20110323/absolute-replaced-height-004.htm
+css2.1/20110323/absolute-replaced-height-005.htm
+css2.1/20110323/absolute-replaced-height-007.htm
+css2.1/20110323/absolute-replaced-height-011.htm
+css2.1/20110323/absolute-replaced-height-012.htm
+css2.1/20110323/absolute-replaced-height-014.htm
 css2.1/t0402-c71-fwd-parsing-00-f.html
 css2.1/t0402-c71-fwd-parsing-01-f.html
 css2.1/t0402-c71-fwd-parsing-03-f.html
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to