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

Changeset 238448 in webkit


Ignore:
Timestamp:
Nov 22, 2018, 10:51:33 AM (8 years ago)
Author:
Alan Bujtas
Message:

[LFC][IFC] Offset formatting context root runs with horizontal margins.
https://bugs.webkit.org/show_bug.cgi?id=191900

Reviewed by Antti Koivisto.

Source/WebCore:

Inline runs generated by formatting roots (inline-block) need to be adjusted with the horizontal margins.
(The test case has padding and border as well, but they are _inside_ the formatting context.)

Test: fast/inline/inline-content-and-nested-formatting-root-with-margin-left-right.html

  • layout/inlineformatting/InlineFormattingContext.cpp:

(WebCore::Layout::InlineFormattingContext::collectInlineContentForSubtree const):

Tools:

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

LayoutTests:

  • fast/inline/inline-content-and-nested-formatting-root-with-margin-left-right-expected.txt: Added.
  • fast/inline/inline-content-and-nested-formatting-root-with-margin-left-right.html: Added.
Location:
trunk
Files:
2 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r238447 r238448  
     12018-11-22  Zalan Bujtas  <zalan@apple.com>
     2
     3        [LFC][IFC] Offset formatting context root runs with horizontal margins.
     4        https://bugs.webkit.org/show_bug.cgi?id=191900
     5
     6        Reviewed by Antti Koivisto.
     7
     8        * fast/inline/inline-content-and-nested-formatting-root-with-margin-left-right-expected.txt: Added.
     9        * fast/inline/inline-content-and-nested-formatting-root-with-margin-left-right.html: Added.
     10
    1112018-11-22  Simon Fraser  <simon.fraser@apple.com>
    212
  • trunk/Source/WebCore/ChangeLog

    r238447 r238448  
     12018-11-22  Zalan Bujtas  <zalan@apple.com>
     2
     3        [LFC][IFC] Offset formatting context root runs with horizontal margins.
     4        https://bugs.webkit.org/show_bug.cgi?id=191900
     5
     6        Reviewed by Antti Koivisto.
     7
     8        Inline runs generated by formatting roots (inline-block) need to be adjusted with the horizontal margins.
     9        (The test case has padding and border as well, but they are _inside_ the formatting context.)
     10
     11        Test: fast/inline/inline-content-and-nested-formatting-root-with-margin-left-right.html
     12
     13        * layout/inlineformatting/InlineFormattingContext.cpp:
     14        (WebCore::Layout::InlineFormattingContext::collectInlineContentForSubtree const):
     15
    1162018-11-22  Simon Fraser  <simon.fraser@apple.com>
    217
  • trunk/Source/WebCore/layout/inlineformatting/InlineFormattingContext.cpp

    r238430 r238448  
    444444    if (root.establishesFormattingContext() && &root != &(this->root())) {
    445445        createAndAppendInlineItem();
    446         inlineFormattingState.inlineContent().last()->addDetachingRule({ InlineItem::DetachingRule::BreakAtStart, InlineItem::DetachingRule::BreakAtEnd });
     446        auto& inlineRun = *inlineFormattingState.inlineContent().last();
     447
     448        auto horizontalMargins = Geometry::computedNonCollapsedHorizontalMarginValue(layoutState(), root);
     449        inlineRun.addDetachingRule({ InlineItem::DetachingRule::BreakAtStart, InlineItem::DetachingRule::BreakAtEnd });
     450        inlineRun.addNonBreakableStart(horizontalMargins.left);
     451        inlineRun.addNonBreakableEnd(horizontalMargins.right);
    447452        // Skip formatting root subtree. They are not part of this inline formatting context.
    448453        return;
  • trunk/Tools/ChangeLog

    r238445 r238448  
     12018-11-22  Zalan Bujtas  <zalan@apple.com>
     2
     3        [LFC][IFC] Offset formatting context root runs with horizontal margins.
     4        https://bugs.webkit.org/show_bug.cgi?id=191900
     5
     6        Reviewed by Antti Koivisto.
     7
     8        * LayoutReloaded/misc/LFC-passing-tests.txt:
     9
    1102018-11-22  Philippe Normand  <pnormand@igalia.com>
    211
  • trunk/Tools/LayoutReloaded/misc/LFC-passing-tests.txt

    r238430 r238448  
    7676fast/inline/inline-content-with-border-left-right.html
    7777fast/inline/inline-content-with-margin-left-right.html
     78fast/inline/inline-content-and-nested-formatting-root-with-margin-left-right.html
    7879fast/block/basic/height-percentage-simple.html
    7980fast/block/basic/child-block-level-box-with-height-percent.html
Note: See TracChangeset for help on using the changeset viewer.