Changeset 294192 in webkit


Ignore:
Timestamp:
May 14, 2022 6:30:56 AM (2 years ago)
Author:
Alan Bujtas
Message:

[FFC][Integration] Do not reset the effective display value for flex root
https://bugs.webkit.org/show_bug.cgi?id=240412

Reviewed by Antti Koivisto.

Non-inline formatting roots (e.g. flex) should not need display type adjustment.

  • layout/integration/LayoutIntegrationBoxTree.cpp:

(WebCore::LayoutIntegration::rootBoxStyle):
(WebCore::LayoutIntegration::rootBoxFirstLineStyle):
(WebCore::LayoutIntegration::BoxTree::BoxTree):
(WebCore::LayoutIntegration::BoxTree::updateStyle):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r294191 r294192  
     12022-05-14  Alan Bujtas  <zalan@apple.com>
     2
     3        [FFC][Integration] Do not reset the effective display value for flex root
     4        https://bugs.webkit.org/show_bug.cgi?id=240412
     5
     6        Reviewed by Antti Koivisto.
     7
     8        Non-inline formatting roots (e.g. flex) should not need display type adjustment.
     9
     10        * layout/integration/LayoutIntegrationBoxTree.cpp:
     11        (WebCore::LayoutIntegration::rootBoxStyle):
     12        (WebCore::LayoutIntegration::rootBoxFirstLineStyle):
     13        (WebCore::LayoutIntegration::BoxTree::BoxTree):
     14        (WebCore::LayoutIntegration::BoxTree::updateStyle):
     15
    1162022-05-14  Alan Bujtas  <zalan@apple.com>
    217
  • trunk/Source/WebCore/layout/integration/LayoutIntegrationBoxTree.cpp

    r293293 r294192  
    5858#define CAN_USE_FIRST_LINE_STYLE_RESOLVE 1
    5959
    60 static RenderStyle rootBoxStyle(const RenderStyle& style)
    61 {
    62     auto clonedStyle = RenderStyle::clone(style);
    63     clonedStyle.setEffectiveDisplay(DisplayType::Block);
     60static RenderStyle rootBoxStyle(const RenderBlock& rootRenderer)
     61{
     62    auto clonedStyle = RenderStyle::clone(rootRenderer.style());
     63    if (is<RenderBlockFlow>(rootRenderer))
     64        clonedStyle.setEffectiveDisplay(DisplayType::Block);
    6465    return clonedStyle;
    6566}
     
    7273        return { };
    7374    auto clonedStyle = RenderStyle::clonePtr(firstLineStyle);
    74     clonedStyle->setEffectiveDisplay(DisplayType::Block);
     75    if (is<RenderBlockFlow>(rootRenderer))
     76        clonedStyle->setEffectiveDisplay(DisplayType::Block);
    7577    return clonedStyle;
    7678#else
     
    8284BoxTree::BoxTree(RenderBlock& rootRenderer)
    8385    : m_rootRenderer(rootRenderer)
    84     , m_root(Layout::Box::ElementAttributes { Layout::Box::ElementType::IntegrationBlockContainer }, rootBoxStyle(rootRenderer.style()), rootBoxFirstLineStyle(rootRenderer))
     86    , m_root(Layout::Box::ElementAttributes { Layout::Box::ElementType::IntegrationBlockContainer }, rootBoxStyle(rootRenderer), rootBoxFirstLineStyle(rootRenderer))
    8587{
    8688    if (rootRenderer.isAnonymous())
     
    218220
    219221    if (&layoutBox == &rootLayoutBox())
    220         layoutBox.updateStyle(rootBoxStyle(style), rootBoxFirstLineStyle(downcast<RenderBlockFlow>(renderer)));
     222        layoutBox.updateStyle(rootBoxStyle(downcast<RenderBlock>(renderer)), rootBoxFirstLineStyle(downcast<RenderBlock>(renderer)));
    221223    else
    222224        layoutBox.updateStyle(style, firstLineStyle());
Note: See TracChangeset for help on using the changeset viewer.