⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 237451 in webkit


Ignore:
Timestamp:
Oct 26, 2018, 7:25:14 AM (8 years ago)
Author:
Alan Bujtas
Message:

[LFC] Inline formatting context has higher priority than block
​https://bugs.webkit.org/show_bug.cgi?id=190924

Reviewed by Antti Koivisto.

When an element establishes both inline and block formatting contexts, we need to pick one to
create (and we choose the content driven formatting type (inline)). See example below:

<div style="overflow: hidden">This text should be inside an inlines formatting context.</div>

  • layout/LayoutContext.cpp:

(WebCore::Layout::LayoutContext::formattingContext const):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r237449 r237451  
     12018-10-26  Zalan Bujtas  <zalan@apple.com>
     2
     3        [LFC] Inline formatting context has higher priority than block
     4        https://bugs.webkit.org/show_bug.cgi?id=190924
     5
     6        Reviewed by Antti Koivisto.
     7
     8        When an element establishes both inline and block formatting contexts, we need to pick one to
     9        create (and we choose the content driven formatting type (inline)). See example below:
     10
     11        <div style="overflow: hidden">This text should be inside an inlines formatting context.</div>
     12
     13        * layout/LayoutContext.cpp:
     14        (WebCore::Layout::LayoutContext::formattingContext const):
     15
    1162018-10-26  Ali Juma  <ajuma@chromium.org>
    217
  • trunk/Source/WebCore/layout/LayoutContext.cpp

    r235735 r237451  
    159159std::unique_ptr<FormattingContext> LayoutContext::formattingContext(const Box& formattingContextRoot) const
    160160{
     161    if (formattingContextRoot.establishesInlineFormattingContext())
     162        return std::make_unique<InlineFormattingContext>(formattingContextRoot);
     163
    161164    if (formattingContextRoot.establishesBlockFormattingContext())
    162165        return std::make_unique<BlockFormattingContext>(formattingContextRoot);
    163 
    164     if (formattingContextRoot.establishesInlineFormattingContext())
    165         return std::make_unique<InlineFormattingContext>(formattingContextRoot);
    166166
    167167    ASSERT_NOT_IMPLEMENTED_YET();
Note: See TracChangeset for help on using the changeset viewer.