Changeset 238422 in webkit


Ignore:
Timestamp:
Nov 21, 2018 9:38:08 AM (5 years ago)
Author:
Alan Bujtas
Message:

[LFC][IFC] Border should be considered as non-breakable space
https://bugs.webkit.org/show_bug.cgi?id=191891

Reviewed by Antti Koivisto.

Source/WebCore:

Like padding, border also forces run breaks and offsets them.

Test: fast/inline/inline-content-with-border-left-right.html

  • layout/inlineformatting/InlineFormattingContext.cpp:

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

Tools:

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

LayoutTests:

  • fast/inline/inline-content-with-border-left-right-expected.txt: Added.
  • fast/inline/inline-content-with-border-left-right.html: Added.
Location:
trunk
Files:
2 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r238416 r238422  
     12018-11-21  Zalan Bujtas <zalan@apple.com>
     2
     3        [LFC][IFC] Border should be considered as non-breakable space
     4        https://bugs.webkit.org/show_bug.cgi?id=191891
     5
     6        Reviewed by Antti Koivisto.
     7
     8        * fast/inline/inline-content-with-border-left-right-expected.txt: Added.
     9        * fast/inline/inline-content-with-border-left-right.html: Added.
     10
    1112018-11-21  Alicia Boya García  <aboya@igalia.com>
    212
  • trunk/Source/WebCore/ChangeLog

    r238420 r238422  
     12018-11-21  Zalan Bujtas  <zalan@apple.com>
     2
     3        [LFC][IFC] Border should be considered as non-breakable space
     4        https://bugs.webkit.org/show_bug.cgi?id=191891
     5
     6        Reviewed by Antti Koivisto.
     7
     8        Like padding, border also forces run breaks and offsets them.
     9
     10        Test: fast/inline/inline-content-with-border-left-right.html
     11
     12        * layout/inlineformatting/InlineFormattingContext.cpp:
     13        (WebCore::Layout::InlineFormattingContext::collectInlineContentForSubtree const):
     14
    1152018-11-21  Zalan Bujtas  <zalan@apple.com>
    216
  • trunk/Source/WebCore/layout/inlineformatting/InlineFormattingContext.cpp

    r238420 r238422  
    463463    // FIXME: Revisit this when we figured out how inline boxes fit the display tree.
    464464    auto padding = Geometry::computedPadding(layoutState(), root);
     465    auto border = Geometry::computedBorder(layoutState(), root);
    465466    // Setup breaking boundaries for this subtree.
    466467    auto* lastDescendantInlineBox = inlineFormattingState.lastInlineItem();
     
    470471
    471472    auto rootBreaksAtStart = [&] {
    472         // FIXME: add padding-inline-start, margin-inline-start etc.
    473         if (padding && padding->horizontal.left)
    474             return true;
    475         return root.isPositioned();
     473        if (&root == &(this->root()))
     474            return false;
     475        return (padding && padding->horizontal.left) || border.horizontal.left || root.isPositioned();
    476476    };
    477477
    478478    auto rootBreaksAtEnd = [&] {
    479         // FIXME: add padding-inline-end, margin-inline-end etc.
    480         if (padding && padding->horizontal.right)
    481             return true;
    482         return root.isPositioned();
     479        if (&root == &(this->root()))
     480            return false;
     481        return (padding && padding->horizontal.right) || border.horizontal.right || root.isPositioned();
    483482    };
    484483
     
    495494        ASSERT(firstDescendantInlineBox);
    496495        firstDescendantInlineBox->addDetachingRule(InlineItem::DetachingRule::BreakAtStart);
    497         if (padding && padding->horizontal.left)
     496        if (padding)
    498497            firstDescendantInlineBox->addNonBreakableStart(padding->horizontal.left);
     498        firstDescendantInlineBox->addNonBreakableStart(border.horizontal.left);
    499499    }
    500500
    501501    if (rootBreaksAtEnd()) {
    502502        lastDescendantInlineBox->addDetachingRule(InlineItem::DetachingRule::BreakAtEnd);
    503         if (padding && padding->horizontal.right)
     503        if (padding)
    504504            lastDescendantInlineBox->addNonBreakableEnd(padding->horizontal.right);
     505        lastDescendantInlineBox->addNonBreakableEnd(border.horizontal.right);
    505506    }
    506507}
  • trunk/Tools/ChangeLog

    r238415 r238422  
     12018-11-21  Zalan Bujtas  <zalan@apple.com>
     2
     3        [LFC][IFC] Border should be considered as non-breakable space
     4        https://bugs.webkit.org/show_bug.cgi?id=191891
     5
     6        Reviewed by Antti Koivisto.
     7
     8        * LayoutReloaded/misc/LFC-passing-tests.txt:
     9
    1102018-11-21  Zalan Bujtas  <zalan@apple.com>
    211
  • trunk/Tools/LayoutReloaded/misc/LFC-passing-tests.txt

    r238415 r238422  
    7474fast/inline/simple-inline-with-out-of-flow-descendant2.html
    7575fast/inline/inline-content-with-padding-left-right.html
     76fast/inline/inline-content-with-border-left-right.html
    7677fast/block/basic/height-percentage-simple.html
    7778fast/block/basic/child-block-level-box-with-height-percent.html
Note: See TracChangeset for help on using the changeset viewer.