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

Changeset 246459 in webkit


Ignore:
Timestamp:
Jun 15, 2019, 7:06:57 AM (7 years ago)
Author:
Alan Bujtas
Message:

[LFC] Fix over-constrained logic for out-of-flow non-replaced horizontal geometry.
https://bugs.webkit.org/show_bug.cgi?id=198879
<rdar://problem/51772995>

Reviewed by Antti Koivisto.

The over-constrained logic applies to the case when all the horizontal properties are set.

  • layout/FormattingContextGeometry.cpp:

(WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r246458 r246459  
     12019-06-15  Zalan Bujtas  <zalan@apple.com>
     2
     3        [LFC] Fix over-constrained logic for out-of-flow non-replaced horizontal geometry.
     4        https://bugs.webkit.org/show_bug.cgi?id=198879
     5        <rdar://problem/51772995>
     6
     7        Reviewed by Antti Koivisto.
     8
     9        The over-constrained logic applies to the case when all the horizontal properties are set.
     10
     11        * layout/FormattingContextGeometry.cpp:
     12        (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry):
     13
    1142019-06-15  Zalan Bujtas  <zalan@apple.com>
    215
  • trunk/Source/WebCore/layout/FormattingContextGeometry.cpp

    r246458 r246459  
    467467            usedHorizontalMargin.end = *computedHorizontalMargin.end;
    468468            usedHorizontalMargin.start = containingBlockWidth - (*left + borderLeft + paddingLeft + contentWidth() + paddingRight + borderRight + usedHorizontalMargin.end + *right);
    469             // Overconstrained? Ignore right (left).
    470             if (usedHorizontalMargin.start < 0) {
    471                 if (isLeftToRightDirection)
    472                     usedHorizontalMargin.start = containingBlockWidth - (*left + borderLeft + paddingLeft + contentWidth() + paddingRight + borderRight + usedHorizontalMargin.end);
    473                 else
    474                     usedHorizontalMargin.start = containingBlockWidth - (borderLeft + paddingLeft + contentWidth() + paddingRight + borderRight + usedHorizontalMargin.end + *right);
    475             }
    476469        } else if (!computedHorizontalMargin.end) {
    477470            usedHorizontalMargin.start = *computedHorizontalMargin.start;
    478471            usedHorizontalMargin.end = containingBlockWidth - (*left + usedHorizontalMargin.start + borderLeft + paddingLeft + contentWidth() + paddingRight + borderRight + *right);
     472        } else {
     473            usedHorizontalMargin = { *computedHorizontalMargin.start, *computedHorizontalMargin.end };
    479474            // Overconstrained? Ignore right (left).
    480             if (usedHorizontalMargin.end < 0) {
    481                 if (isLeftToRightDirection)
    482                     usedHorizontalMargin.end = containingBlockWidth - (*left + usedHorizontalMargin.start + borderLeft + paddingLeft + contentWidth() + paddingRight + borderRight);
    483                 else
    484                     usedHorizontalMargin.end = containingBlockWidth - (usedHorizontalMargin.start + borderLeft + paddingLeft + contentWidth() + paddingRight + borderRight + *right);
    485             }
    486         } else
    487             usedHorizontalMargin = { *computedHorizontalMargin.start, *computedHorizontalMargin.end };
     475            if (isLeftToRightDirection)
     476                right = containingBlockWidth - (usedHorizontalMargin.start + *left + borderLeft + paddingLeft + contentWidth() + paddingRight + borderRight + usedHorizontalMargin.end);
     477            else
     478                left = containingBlockWidth - (usedHorizontalMargin.start + borderLeft + paddingLeft + contentWidth() + paddingRight + borderRight + usedHorizontalMargin.end + *right);
     479        }
    488480    } else {
    489481        // Otherwise, set 'auto' values for 'margin-left' and 'margin-right' to 0, and pick the one of the following six rules that applies.
Note: See TracChangeset for help on using the changeset viewer.