WebKit Bugzilla
Attachment 360686 Details for
Bug 194074
: [LFC] Use the used margin values in outOfFlowReplacedHorizontalGeometry consistently
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
Patch.txt (text/plain), 10.83 KB, created by
zalan
on 2019-01-30 20:56:38 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
zalan
Created:
2019-01-30 20:56:38 PST
Size:
10.83 KB
patch
obsolete
>diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog >index 677e0b94693..603a3996719 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,3 +1,13 @@ >+2019-01-30 Zalan Bujtas <zalan@apple.com> >+ >+ [LFC] Use the used margin values in outOfFlowReplacedHorizontalGeometry consistently >+ https://bugs.webkit.org/show_bug.cgi?id=194074 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * fast/block/block-only/absolute-position-with-margin-auto-simple2-expected.html: Added. >+ * fast/block/block-only/absolute-position-with-margin-auto-simple2.html: Added. >+ > 2019-01-30 Dean Jackson <dino@apple.com> > > PointerEvents - tiltX and tiltY are reversed >diff --git a/LayoutTests/fast/block/block-only/absolute-position-with-margin-auto-simple2-expected.html b/LayoutTests/fast/block/block-only/absolute-position-with-margin-auto-simple2-expected.html >new file mode 100644 >index 00000000000..4125784a9be >--- /dev/null >+++ b/LayoutTests/fast/block/block-only/absolute-position-with-margin-auto-simple2-expected.html >@@ -0,0 +1,9 @@ >+<style> >+div { >+ background-color: green; >+ width: 100px; >+ height: 100px; >+} >+</style> >+<div style="position: relative; left: 10px;"></div> >+<div style="position: relative; top: -100px; left: 390px;"></div> >diff --git a/LayoutTests/fast/block/block-only/absolute-position-with-margin-auto-simple2.html b/LayoutTests/fast/block/block-only/absolute-position-with-margin-auto-simple2.html >new file mode 100644 >index 00000000000..cd74732d29a >--- /dev/null >+++ b/LayoutTests/fast/block/block-only/absolute-position-with-margin-auto-simple2.html >@@ -0,0 +1,15 @@ >+<style> >+div { >+ margin-left: auto; >+ margin-right: auto; >+ position: absolute; >+ background-color: green; >+ height: 100px; >+} >+</style> >+<div style="height: 500px; width: 500px; background-color: transparent"> >+ <div style="left: 10px;"></div> >+ <div style="right: 10px;"></div> >+ <div style="left: 10px; width: 100px"></div> >+ <div style="right: 10px; width: 100px"></div> >+</div> >\ No newline at end of file >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 5aab4a24b09..1a50443d96e 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,17 @@ >+2019-01-30 Zalan Bujtas <zalan@apple.com> >+ >+ [LFC] Use the used margin values in outOfFlowReplacedHorizontalGeometry consistently >+ https://bugs.webkit.org/show_bug.cgi?id=194074 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Check the used margin variables whether we already computed start/end values. >+ >+ Test: fast/block/block-only/absolute-position-with-margin-auto-simple2.html >+ >+ * layout/FormattingContextGeometry.cpp: >+ (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry): >+ > 2019-01-30 Zalan Bujtas <zalan@apple.com> > > [LFC][BFC] Add support for block level replaced box. >diff --git a/Source/WebCore/layout/FormattingContextGeometry.cpp b/Source/WebCore/layout/FormattingContextGeometry.cpp >index 2f00b55fbe2..38cf4c27ee0 100644 >--- a/Source/WebCore/layout/FormattingContextGeometry.cpp >+++ b/Source/WebCore/layout/FormattingContextGeometry.cpp >@@ -642,7 +642,8 @@ HorizontalGeometry FormattingContext::Geometry::outOfFlowReplacedHorizontalGeome > auto right = computedValueIfNotAuto(style.logicalRight(), containingBlockWidth); > auto isStaticallyPositioned = !left && !right; > auto computedHorizontalMargin = Geometry::computedHorizontalMargin(layoutState, layoutBox); >- UsedHorizontalMargin usedHorizontalMargin; >+ Optional<LayoutUnit> usedMarginStart; >+ Optional<LayoutUnit> usedMarginEnd; > auto width = inlineReplacedWidthAndMargin(layoutState, layoutBox, usedWidth).width; > auto paddingLeft = displayBox.paddingLeft().valueOr(0); > auto paddingRight = displayBox.paddingRight().valueOr(0); >@@ -660,49 +661,53 @@ HorizontalGeometry FormattingContext::Geometry::outOfFlowReplacedHorizontalGeome > > if (!left || !right) { > // #2 >- usedHorizontalMargin = { computedHorizontalMargin.start.valueOr(0), computedHorizontalMargin.end.valueOr(0) }; >+ usedMarginStart = computedHorizontalMargin.start.valueOr(0); >+ usedMarginEnd = computedHorizontalMargin.end.valueOr(0); > } > >- if (!computedHorizontalMargin.start && !computedHorizontalMargin.end) { >+ if (!usedMarginStart && !usedMarginEnd) { > // #3 > auto marginStartAndEnd = containingBlockWidth - (*left + borderLeft + paddingLeft + width + paddingRight + borderRight + *right); >- if (marginStartAndEnd >= 0) >- usedHorizontalMargin = { marginStartAndEnd / 2, marginStartAndEnd / 2 }; >- else { >+ if (marginStartAndEnd >= 0) { >+ usedMarginStart = marginStartAndEnd / 2; >+ usedMarginEnd = usedMarginStart; >+ } else { > if (isLeftToRightDirection) { >- usedHorizontalMargin.start = 0_lu; >- usedHorizontalMargin.end = containingBlockWidth - (*left + usedHorizontalMargin.start + borderLeft + paddingLeft + width + paddingRight + borderRight + *right); >+ usedMarginStart = 0_lu; >+ usedMarginEnd = containingBlockWidth - (*left + *usedMarginStart + borderLeft + paddingLeft + width + paddingRight + borderRight + *right); > } else { >- usedHorizontalMargin.end = 0_lu; >- usedHorizontalMargin.start = containingBlockWidth - (*left + borderLeft + paddingLeft + width + paddingRight + borderRight + usedHorizontalMargin.end + *right); >+ usedMarginEnd = 0_lu; >+ usedMarginStart = containingBlockWidth - (*left + borderLeft + paddingLeft + width + paddingRight + borderRight + *usedMarginEnd + *right); > } > } > } > > // #4 > if (!left) >- left = containingBlockWidth - (usedHorizontalMargin.start + borderLeft + paddingLeft + width + paddingRight + borderRight + usedHorizontalMargin.end + *right); >+ left = containingBlockWidth - (*usedMarginStart + borderLeft + paddingLeft + width + paddingRight + borderRight + *usedMarginEnd + *right); > > if (!right) >- right = containingBlockWidth - (*left + usedHorizontalMargin.start + borderLeft + paddingLeft + width + paddingRight + borderRight + usedHorizontalMargin.end); >+ right = containingBlockWidth - (*left + *usedMarginStart + borderLeft + paddingLeft + width + paddingRight + borderRight + *usedMarginEnd); > >- if (!computedHorizontalMargin.start) >- usedHorizontalMargin.start = containingBlockWidth - (*left + borderLeft + paddingLeft + width + paddingRight + borderRight + usedHorizontalMargin.end + *right); >+ if (!usedMarginStart) >+ usedMarginStart = containingBlockWidth - (*left + borderLeft + paddingLeft + width + paddingRight + borderRight + *usedMarginEnd + *right); > >- if (!computedHorizontalMargin.end) >- usedHorizontalMargin.end = containingBlockWidth - (*left + usedHorizontalMargin.start + borderLeft + paddingLeft + width + paddingRight + borderRight + *right); >+ if (!usedMarginEnd) >+ usedMarginEnd = containingBlockWidth - (*left + *usedMarginStart + borderLeft + paddingLeft + width + paddingRight + borderRight + *right); > >- auto boxWidth = (*left + usedHorizontalMargin.start + borderLeft + paddingLeft + width + paddingRight + borderRight + usedHorizontalMargin.end + *right); >+ auto boxWidth = (*left + *usedMarginStart + borderLeft + paddingLeft + width + paddingRight + borderRight + *usedMarginEnd + *right); > if (boxWidth > containingBlockWidth) { > // #5 Over-constrained? > if (isLeftToRightDirection) >- right = containingBlockWidth - (*left + usedHorizontalMargin.start + borderLeft + paddingLeft + width + paddingRight + borderRight + usedHorizontalMargin.end); >+ right = containingBlockWidth - (*left + *usedMarginStart + borderLeft + paddingLeft + width + paddingRight + borderRight + *usedMarginEnd); > else >- left = containingBlockWidth - (usedHorizontalMargin.start + borderLeft + paddingLeft + width + paddingRight + borderRight + usedHorizontalMargin.end + *right); >+ left = containingBlockWidth - (*usedMarginStart + borderLeft + paddingLeft + width + paddingRight + borderRight + *usedMarginEnd + *right); > } > > ASSERT(left); > ASSERT(right); >+ ASSERT(usedMarginStart); >+ ASSERT(usedMarginEnd); > > // For out-of-flow elements the containing block is formed by the padding edge of the ancestor. > // At this point the non-statically positioned value is in the coordinate system of the padding box. Let's convert it to border box coordinate system. >@@ -712,8 +717,8 @@ HorizontalGeometry FormattingContext::Geometry::outOfFlowReplacedHorizontalGeome > *right += containingBlockPaddingVerticalEdge; > } > >- LOG_WITH_STREAM(FormattingContextLayout, stream << "[Position][Width][Margin] -> out-of-flow replaced -> left(" << *left << "px) right(" << *right << "px) width(" << width << "px) margin(" << usedHorizontalMargin.start << "px, " << usedHorizontalMargin.end << "px) layoutBox(" << &layoutBox << ")"); >- return { *left, *right, { width, usedHorizontalMargin, computedHorizontalMargin } }; >+ LOG_WITH_STREAM(FormattingContextLayout, stream << "[Position][Width][Margin] -> out-of-flow replaced -> left(" << *left << "px) right(" << *right << "px) width(" << width << "px) margin(" << *usedMarginStart << "px, " << *usedMarginEnd << "px) layoutBox(" << &layoutBox << ")"); >+ return { *left, *right, { width, { *usedMarginStart, *usedMarginEnd }, computedHorizontalMargin } }; > } > > HeightAndMargin FormattingContext::Geometry::complicatedCases(const LayoutState& layoutState, const Box& layoutBox, Optional<LayoutUnit> usedHeight) >diff --git a/Tools/ChangeLog b/Tools/ChangeLog >index 8009c0dd4d9..222252e0f79 100644 >--- a/Tools/ChangeLog >+++ b/Tools/ChangeLog >@@ -1,3 +1,12 @@ >+2019-01-30 Zalan Bujtas <zalan@apple.com> >+ >+ [LFC] Use the used margin values in outOfFlowReplacedHorizontalGeometry consistently >+ https://bugs.webkit.org/show_bug.cgi?id=194074 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * LayoutReloaded/misc/LFC-passing-tests.txt: >+ > 2019-01-30 Zalan Bujtas <zalan@apple.com> > > [LFC][BFC] Add support for block level replaced box. >diff --git a/Tools/LayoutReloaded/misc/LFC-passing-tests.txt b/Tools/LayoutReloaded/misc/LFC-passing-tests.txt >index 1a9548ea51e..2480fe40d0a 100644 >--- a/Tools/LayoutReloaded/misc/LFC-passing-tests.txt >+++ b/Tools/LayoutReloaded/misc/LFC-passing-tests.txt >@@ -83,6 +83,7 @@ fast/block/block-only/non-auto-top-bottom-height-with-margins.html > fast/block/block-only/non-auto-top-bottom-height-with-auto-margins.html > fast/block/block-only/abs-pos-with-border-padding-and-float-child-expected.html > fast/block/block-only/absolute-position-with-margin-auto-simple.html >+fast/block/block-only/absolute-position-with-margin-auto-simple2.html > fast/block/basic/002.html > fast/block/basic/003.html > fast/block/basic/004.html
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
koivisto
:
review+
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 194074
: 360686