Changeset 238430 in webkit


Ignore:
Timestamp:
Nov 21, 2018 3:13:22 PM (5 years ago)
Author:
Alan Bujtas
Message:

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

Reviewed by Antti Koivisto.

Source/WebCore:

Like padding and border, horizontal margins also force run breaks and offset them.

Test: fast/inline/inline-content-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-with-margin-left-right-expected.txt: Added.
  • fast/inline/inline-content-with-margin-left-right.html: Added.
Location:
trunk
Files:
2 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r238429 r238430  
     12018-11-21  Zalan Bujtas  <zalan@apple.com>
     2
     3        [LFC][IFC] Horizontal margins should be considered as non-breakable space
     4        https://bugs.webkit.org/show_bug.cgi?id=191894
     5
     6        Reviewed by Antti Koivisto.
     7
     8        * fast/inline/inline-content-with-margin-left-right-expected.txt: Added.
     9        * fast/inline/inline-content-with-margin-left-right.html: Added.
     10
    1112018-11-21  Ryosuke Niwa  <rniwa@webkit.org>
    212
  • trunk/Source/WebCore/ChangeLog

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

    r238422 r238430  
    464464    auto padding = Geometry::computedPadding(layoutState(), root);
    465465    auto border = Geometry::computedBorder(layoutState(), root);
     466    auto horizontalMargins = Geometry::computedNonCollapsedHorizontalMarginValue(layoutState(), root);
    466467    // Setup breaking boundaries for this subtree.
    467468    auto* lastDescendantInlineBox = inlineFormattingState.lastInlineItem();
     
    473474        if (&root == &(this->root()))
    474475            return false;
    475         return (padding && padding->horizontal.left) || border.horizontal.left || root.isPositioned();
     476        return (padding && padding->horizontal.left) || border.horizontal.left || horizontalMargins.left || root.isPositioned();
    476477    };
    477478
     
    479480        if (&root == &(this->root()))
    480481            return false;
    481         return (padding && padding->horizontal.right) || border.horizontal.right || root.isPositioned();
     482        return (padding && padding->horizontal.right) || border.horizontal.right || horizontalMargins.right || root.isPositioned();
    482483    };
    483484
     
    497498            firstDescendantInlineBox->addNonBreakableStart(padding->horizontal.left);
    498499        firstDescendantInlineBox->addNonBreakableStart(border.horizontal.left);
     500        firstDescendantInlineBox->addNonBreakableStart(horizontalMargins.left);
    499501    }
    500502
     
    504506            lastDescendantInlineBox->addNonBreakableEnd(padding->horizontal.right);
    505507        lastDescendantInlineBox->addNonBreakableEnd(border.horizontal.right);
     508        lastDescendantInlineBox->addNonBreakableEnd(horizontalMargins.right);
    506509    }
    507510}
  • trunk/Tools/ChangeLog

    r238422 r238430  
     12018-11-21  Zalan Bujtas  <zalan@apple.com>
     2
     3        [LFC][IFC] Horizontal margins should be considered as non-breakable space
     4        https://bugs.webkit.org/show_bug.cgi?id=191894
     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

    r238422 r238430  
    7575fast/inline/inline-content-with-padding-left-right.html
    7676fast/inline/inline-content-with-border-left-right.html
     77fast/inline/inline-content-with-margin-left-right.html
    7778fast/block/basic/height-percentage-simple.html
    7879fast/block/basic/child-block-level-box-with-height-percent.html
Note: See TracChangeset for help on using the changeset viewer.