WebKit Bugzilla
Attachment 342015 Details for
Bug 186327
: [LFC] Move inflow, replaced width and margin computation to a dedicated function.
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-186327-20180605181836.patch (text/plain), 4.62 KB, created by
zalan
on 2018-06-05 18:18:37 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
zalan
Created:
2018-06-05 18:18:37 PDT
Size:
4.62 KB
patch
obsolete
>Subversion Revision: 232525 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 4e0c983bf6852cd83224bc5b626677f56ab4ed45..b5a03ac7ab62ac60410e21fbd1a531188d015829 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,17 @@ >+2018-06-05 Zalan Bujtas <zalan@apple.com> >+ >+ [LFC] Move inflow, replaced width and margin computation to a dedicated function. >+ https://bugs.webkit.org/show_bug.cgi?id=186327 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ I was searching for the function inFlowReplacedWidthAndMargin() and there was none. >+ >+ * layout/blockformatting/BlockFormattingContext.h: >+ * layout/blockformatting/BlockFormattingContextGeometry.cpp: >+ (WebCore::Layout::BlockFormattingContext::Geometry::inFlowReplacedWidthAndMargin): >+ (WebCore::Layout::BlockFormattingContext::Geometry::inFlowWidthAndMargin): >+ > 2018-06-05 Timothy Hatcher <timothy@apple.com> > > Clean up LocalDefaultSystemAppearance and prefers-dark-interface media query >diff --git a/Source/WebCore/layout/blockformatting/BlockFormattingContext.h b/Source/WebCore/layout/blockformatting/BlockFormattingContext.h >index 48a01a555bd9203f6690c16f5cf42028996d2ef1..58ab2edfb221a08e345098cce151fd1ab98b8ff1 100644 >--- a/Source/WebCore/layout/blockformatting/BlockFormattingContext.h >+++ b/Source/WebCore/layout/blockformatting/BlockFormattingContext.h >@@ -71,6 +71,7 @@ private: > private: > static LayoutUnit inFlowNonReplacedHeight(LayoutContext&, const Box&); > static FormattingContext::Geometry::WidthAndMargin inFlowNonReplacedWidthAndMargin(LayoutContext&, const Box&, std::optional<LayoutUnit> precomputedWidth = std::nullopt); >+ static FormattingContext::Geometry::WidthAndMargin inFlowReplacedWidthAndMargin(LayoutContext&, const Box&); > }; > > // This class implements margin collapsing for block formatting context. >diff --git a/Source/WebCore/layout/blockformatting/BlockFormattingContextGeometry.cpp b/Source/WebCore/layout/blockformatting/BlockFormattingContextGeometry.cpp >index 552829b664a5f9c75f5553555de85d0e98d71f40..39e3eee7ad1c57649d3cec5b5024da7e1e67efdf 100644 >--- a/Source/WebCore/layout/blockformatting/BlockFormattingContextGeometry.cpp >+++ b/Source/WebCore/layout/blockformatting/BlockFormattingContextGeometry.cpp >@@ -219,6 +219,23 @@ FormattingContext::Geometry::WidthAndMargin BlockFormattingContext::Geometry::in > return FormattingContext::Geometry::WidthAndMargin { std::max(computedWidthAndMarginValue.width, initialContainingBlockWidth), { } }; > } > >+FormattingContext::Geometry::WidthAndMargin BlockFormattingContext::Geometry::inFlowReplacedWidthAndMargin(LayoutContext& layoutContext, const Box& layoutBox) >+{ >+ ASSERT(layoutBox.isInFlow() && layoutBox.replaced()); >+ >+ // 10.3.4 Block-level, replaced elements in normal flow >+ // >+ // 1. The used value of 'width' is determined as for inline replaced elements. >+ // 2. Then the rules for non-replaced block-level elements are applied to determine the margins. >+ >+ // #1 >+ auto inlineReplacedWidthAndMargin = FormattingContext::Geometry::inlineReplacedWidthAndMargin(layoutContext, layoutBox); >+ // #2 >+ auto inlineReplacedWidthAndBlockNonReplacedMargin = inFlowNonReplacedWidthAndMargin(layoutContext, layoutBox, inlineReplacedWidthAndMargin.width); >+ ASSERT(inlineReplacedWidthAndMargin.width == inlineReplacedWidthAndBlockNonReplacedMargin.width); >+ return inlineReplacedWidthAndBlockNonReplacedMargin; >+} >+ > LayoutPoint BlockFormattingContext::Geometry::staticPosition(LayoutContext& layoutContext, const Box& layoutBox) > { > // https://www.w3.org/TR/CSS22/visuren.html#block-formatting >@@ -319,17 +336,7 @@ FormattingContext::Geometry::WidthAndMargin BlockFormattingContext::Geometry::in > > if (!layoutBox.replaced()) > return inFlowNonReplacedWidthAndMargin(layoutContext, layoutBox); >- // 10.3.4 Block-level, replaced elements in normal flow >- // >- // 1. The used value of 'width' is determined as for inline replaced elements. >- // 2. Then the rules for non-replaced block-level elements are applied to determine the margins. >- >- // #1 >- auto inlineReplacedWidthAndMargin = FormattingContext::Geometry::inlineReplacedWidthAndMargin(layoutContext, layoutBox); >- // #2 >- auto inlineReplacedWidthAndBlockNonReplacedMargin = Geometry::inFlowNonReplacedWidthAndMargin(layoutContext, layoutBox, inlineReplacedWidthAndMargin.width); >- ASSERT(inlineReplacedWidthAndMargin.width == inlineReplacedWidthAndBlockNonReplacedMargin.width); >- return inlineReplacedWidthAndBlockNonReplacedMargin; >+ return inFlowReplacedWidthAndMargin(layoutContext, layoutBox); > } > > }
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
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 186327
: 342015