WebKit Bugzilla
Attachment 346487 Details for
Bug 188306
: [LFC][Floating] Now that the document renderer belongs to "complicated cases", adjust viewport stretching.
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-188306-20180803083309.patch (text/plain), 10.94 KB, created by
zalan
on 2018-08-03 08:33:09 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
zalan
Created:
2018-08-03 08:33:09 PDT
Size:
10.94 KB
patch
obsolete
>Subversion Revision: 234544 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 11ff0f572c837655993468f02d4e46f0d4f5d651..78015c969a20f2d4d2d6cea2a4347dcf5f9e6de9 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,22 @@ >+2018-08-03 Zalan Bujtas <zalan@apple.com> >+ >+ [LFC][Floating] Now that the document renderer belongs to "complicated cases", adjust viewport stretching. >+ https://bugs.webkit.org/show_bug.cgi?id=188306 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ And add passing cases for floats. >+ >+ * layout/blockformatting/BlockFormattingContextGeometry.cpp: >+ (WebCore::Layout::initialContainingBlock): >+ (WebCore::Layout::isStretchedToInitialContainingBlock): >+ (WebCore::Layout::stretchHeightToInitialContainingBlock): >+ (WebCore::Layout::stretchWidthToInitialContainingBlock): >+ (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin): >+ (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin): >+ (WebCore::Layout::BlockFormattingContext::Geometry::inFlowHeightAndMargin): >+ (WebCore::Layout::isStretchedToViewport): Deleted. >+ > 2018-08-03 Zalan Bujtas <zalan@apple.com> > > [LFC] Do not check margin box while validating geometry. >diff --git a/Source/WebCore/layout/blockformatting/BlockFormattingContextGeometry.cpp b/Source/WebCore/layout/blockformatting/BlockFormattingContextGeometry.cpp >index a6d7f09f4568c489af4a700e4baebac0e206e009..6dffc0ba9d9ba2cd2ed0de237a14c72299947907 100644 >--- a/Source/WebCore/layout/blockformatting/BlockFormattingContextGeometry.cpp >+++ b/Source/WebCore/layout/blockformatting/BlockFormattingContextGeometry.cpp >@@ -36,7 +36,15 @@ > namespace WebCore { > namespace Layout { > >-static bool isStretchedToViewport(const LayoutContext& layoutContext, const Box& layoutBox) >+static const Container& initialContainingBlock(const Box& layoutBox) >+{ >+ auto* containingBlock = layoutBox.containingBlock(); >+ while (containingBlock->containingBlock()) >+ containingBlock = containingBlock->containingBlock(); >+ return *containingBlock; >+} >+ >+static bool isStretchedToInitialContainingBlock(const LayoutContext& layoutContext, const Box& layoutBox) > { > ASSERT(layoutBox.isInFlow()); > // In quirks mode, body and html stretch to the viewport. >@@ -49,12 +57,24 @@ static bool isStretchedToViewport(const LayoutContext& layoutContext, const Box& > return layoutBox.style().logicalHeight().isAuto(); > } > >-static const Container& initialContainingBlock(const Box& layoutBox) >+static HeightAndMargin stretchHeightToInitialContainingBlock(HeightAndMargin heightAndMargin, LayoutUnit initialContainingBlockHeight) > { >- auto* containingBlock = layoutBox.containingBlock(); >- while (containingBlock->containingBlock()) >- containingBlock = containingBlock->containingBlock(); >- return *containingBlock; >+ auto verticalMargins = heightAndMargin.margin.top + heightAndMargin.margin.bottom; >+ // Stretch but never overstretch with the margins. >+ if (heightAndMargin.height + verticalMargins < initialContainingBlockHeight) >+ heightAndMargin.height = initialContainingBlockHeight - verticalMargins; >+ >+ return heightAndMargin; >+} >+ >+static WidthAndMargin stretchWidthToInitialContainingBlock(WidthAndMargin widthAndMargin, LayoutUnit initialContainingBlockWidth) >+{ >+ auto horizontalMargins = widthAndMargin.margin.left + widthAndMargin.margin.right; >+ // Stretch but never overstretch with the margins. >+ if (widthAndMargin.width + horizontalMargins < initialContainingBlockWidth) >+ widthAndMargin.width = initialContainingBlockWidth - horizontalMargins; >+ >+ return widthAndMargin; > } > > HeightAndMargin BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin(LayoutContext& layoutContext, const Box& layoutBox) >@@ -129,17 +149,7 @@ HeightAndMargin BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMarg > > auto heightAndMargin = compute(); > >- if (!isStretchedToViewport(layoutContext, layoutBox)) { >- LOG_WITH_STREAM(FormattingContextLayout, stream << "[Height][Margin] -> inflow non-replaced -> height(" << heightAndMargin.height << "px) margin(" << heightAndMargin.margin.top << "px, " << heightAndMargin.margin.bottom << "px) -> layoutBox(" << &layoutBox << ")"); >- return heightAndMargin; >- } >- >- auto initialContainingBlockHeight = layoutContext.displayBoxForLayoutBox(initialContainingBlock(layoutBox))->contentBoxHeight(); >- // Stretch but never overstretch with the margins. >- if (heightAndMargin.height + heightAndMargin.margin.top + heightAndMargin.margin.bottom < initialContainingBlockHeight) >- heightAndMargin.height = initialContainingBlockHeight - heightAndMargin.margin.top - heightAndMargin.margin.bottom; >- >- LOG_WITH_STREAM(FormattingContextLayout, stream << "[Height][Margin] -> inflow non-replaced -> streched to viewport -> height(" << heightAndMargin.height << "px) margin(" << heightAndMargin.margin.top << "px, " << heightAndMargin.margin.bottom << "px) -> layoutBox(" << &layoutBox << ")"); >+ LOG_WITH_STREAM(FormattingContextLayout, stream << "[Height][Margin] -> inflow non-replaced -> height(" << heightAndMargin.height << "px) margin(" << heightAndMargin.margin.top << "px, " << heightAndMargin.margin.bottom << "px) -> layoutBox(" << &layoutBox << ")"); > return heightAndMargin; > } > >@@ -230,16 +240,13 @@ WidthAndMargin BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin > }; > > auto widthAndMargin = compute(); >- if (!isStretchedToViewport(layoutContext, layoutBox)) { >+ if (!isStretchedToInitialContainingBlock(layoutContext, layoutBox)) { > LOG_WITH_STREAM(FormattingContextLayout, stream << "[Width][Margin] -> inflow non-replaced -> width(" << widthAndMargin.width << "px) margin(" << widthAndMargin.margin.left << "px, " << widthAndMargin.margin.right << "px) -> layoutBox(" << &layoutBox << ")"); > return widthAndMargin; > } > > auto initialContainingBlockWidth = layoutContext.displayBoxForLayoutBox(initialContainingBlock(layoutBox))->contentBoxWidth(); >- auto horizontalMargins = widthAndMargin.margin.left + widthAndMargin.margin.right; >- // Stretch but never overstretch with the margins. >- if (widthAndMargin.width + horizontalMargins < initialContainingBlockWidth) >- widthAndMargin.width = initialContainingBlockWidth - horizontalMargins; >+ widthAndMargin = stretchWidthToInitialContainingBlock(widthAndMargin, initialContainingBlockWidth); > > LOG_WITH_STREAM(FormattingContextLayout, stream << "[Width][Margin] -> inflow non-replaced -> streched to viewport-> width(" << widthAndMargin.width << "px) margin(" << widthAndMargin.margin.left << "px, " << widthAndMargin.margin.right << "px) -> layoutBox(" << &layoutBox << ")"); > return widthAndMargin; >@@ -370,13 +377,24 @@ HeightAndMargin BlockFormattingContext::Geometry::inFlowHeightAndMargin(LayoutCo > if (layoutBox.replaced()) > return FormattingContext::Geometry::inlineReplacedHeightAndMargin(layoutContext, layoutBox); > >+ HeightAndMargin heightAndMargin; > // TODO: Figure out the case for the document element. Let's just complicated-case it for now. > if (layoutBox.isOverflowVisible() && !layoutBox.isDocumentBox()) >- return inFlowNonReplacedHeightAndMargin(layoutContext, layoutBox); >+ heightAndMargin = inFlowNonReplacedHeightAndMargin(layoutContext, layoutBox); >+ else { >+ // 10.6.6 Complicated cases >+ // Block-level, non-replaced elements in normal flow when 'overflow' does not compute to 'visible' (except if the 'overflow' property's value has been propagated to the viewport). >+ heightAndMargin = FormattingContext::Geometry::complicatedCases(layoutContext, layoutBox); >+ } >+ >+ if (!isStretchedToInitialContainingBlock(layoutContext, layoutBox)) >+ return heightAndMargin; >+ >+ auto initialContainingBlockHeight = layoutContext.displayBoxForLayoutBox(initialContainingBlock(layoutBox))->contentBoxHeight(); >+ heightAndMargin = stretchHeightToInitialContainingBlock(heightAndMargin, initialContainingBlockHeight); > >- // 10.6.6 Complicated cases >- // Block-level, non-replaced elements in normal flow when 'overflow' does not compute to 'visible' (except if the 'overflow' property's value has been propagated to the viewport). >- return FormattingContext::Geometry::complicatedCases(layoutContext, layoutBox); >+ LOG_WITH_STREAM(FormattingContextLayout, stream << "[Height][Margin] -> inflow non-replaced -> streched to viewport -> height(" << heightAndMargin.height << "px) margin(" << heightAndMargin.margin.top << "px, " << heightAndMargin.margin.bottom << "px) -> layoutBox(" << &layoutBox << ")"); >+ return heightAndMargin; > } > > WidthAndMargin BlockFormattingContext::Geometry::inFlowWidthAndMargin(LayoutContext& layoutContext, const Box& layoutBox) >diff --git a/Tools/ChangeLog b/Tools/ChangeLog >index 63bc8a732faf37b8734b3f512985d2e022691f6c..6fa0d4f52477c0fd1205bc678ad16a82d5ed95c9 100644 >--- a/Tools/ChangeLog >+++ b/Tools/ChangeLog >@@ -1,3 +1,12 @@ >+2018-08-03 Zalan Bujtas <zalan@apple.com> >+ >+ [LFC][Floating] Now that the document renderer belongs to "complicated cases", adjust viewport stretching. >+ https://bugs.webkit.org/show_bug.cgi?id=188306 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * LayoutReloaded/misc/LFC-passing-tests.txt: >+ > 2018-08-03 Carlos Garcia Campos <cgarcia@igalia.com> > > [WPE] Use the new key mapper API from WPEBackend >diff --git a/Tools/LayoutReloaded/misc/LFC-passing-tests.txt b/Tools/LayoutReloaded/misc/LFC-passing-tests.txt >index fc58a3363084cae74157172a861515929802e527..72d352a7133adf27a0451a4ebc7be3aed13b9c98 100644 >--- a/Tools/LayoutReloaded/misc/LFC-passing-tests.txt >+++ b/Tools/LayoutReloaded/misc/LFC-passing-tests.txt >@@ -33,4 +33,16 @@ fast/block/block-only/relative-siblings.html > fast/block/block-only/relative-simple.html > fast/block/block-only/absolute-position-when-containing-block-is-not-in-the-formatting-context2.html > fast/block/block-only/margin-collapse-with-block-formatting-context.html >-fast/block/block-only/margin-collapse-with-block-formatting-context2.html >\ No newline at end of file >+fast/block/block-only/margin-collapse-with-block-formatting-context2.html >+fast/block/block-only/float-left-when-container-has-padding-margin.html >+fast/block/block-only/floating-box-left-and-right-multiple-with-top-offset.html >+fast/block/block-only/floating-box-left-and-right-multiple.html >+fast/block/block-only/floating-box-right-simple.html >+fast/block/block-only/floating-box-with-new-formatting-context.html >+fast/block/block-only/floating-box-with-relative-positioned-sibling.html >+fast/block/block-only/floating-left-right-simple.html >+fast/block/block-only/floating-left-right-with-all-margins.html >+fast/block/block-only/floating-lefts-and-rights-simple.html >+fast/block/block-only/floating-multiple-lefts-in-body.html >+fast/block/block-only/floating-multiple-lefts-multiple-lines.html >+fast/block/block-only/floating-multiple-lefts.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 188306
: 346487