WebKit Bugzilla
Attachment 342024 Details for
Bug 186334
: [LFC] Add margin computation for floating, no-replaced elements.
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-186334-20180605195928.patch (text/plain), 2.81 KB, created by
zalan
on 2018-06-05 19:59:29 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
zalan
Created:
2018-06-05 19:59:29 PDT
Size:
2.81 KB
patch
obsolete
>Subversion Revision: 232525 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 4e0c983bf6852cd83224bc5b626677f56ab4ed45..6bcbad189631157652951333f045615e3ecff636 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,15 @@ >+2018-06-05 Zalan Bujtas <zalan@apple.com> >+ >+ [LFC] Add margin computation for floating, no-replaced elements. >+ https://bugs.webkit.org/show_bug.cgi?id=186334 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ If 'margin-left', or 'margin-right' are computed as 'auto', their used value is '0'. >+ >+ * layout/FormattingContextGeometry.cpp: >+ (WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedWidthAndMargin): >+ > 2018-06-05 Timothy Hatcher <timothy@apple.com> > > Clean up LocalDefaultSystemAppearance and prefers-dark-interface media query >diff --git a/Source/WebCore/layout/FormattingContextGeometry.cpp b/Source/WebCore/layout/FormattingContextGeometry.cpp >index 1a26fef9cf8790561a843d7b1c30b3203d4f6298..f78eeb6f5df85b26b843a6b81699539cfe0484d9 100644 >--- a/Source/WebCore/layout/FormattingContextGeometry.cpp >+++ b/Source/WebCore/layout/FormattingContextGeometry.cpp >@@ -220,11 +220,26 @@ FormattingContext::Geometry::WidthAndMargin FormattingContext::Geometry::floatin > { > ASSERT(layoutBox.isFloatingPositioned() && !layoutBox.replaced()); > // 10.3.5 Floating, non-replaced elements >+ // >+ // 1. If 'margin-left', or 'margin-right' are computed as 'auto', their used value is '0'. >+ // 2. If 'width' is computed as 'auto', the used value is the "shrink-to-fit" width. >+ auto& style = layoutBox.style(); >+ auto width = style.logicalWidth(); >+ LayoutUnit computedMarginLeftValue; >+ LayoutUnit computedMarginRightValue; >+ >+ { >+ auto marginLeft = style.marginLeft(); >+ auto marginRight = style.marginRight(); >+ auto containingBlockWidth = layoutContext.displayBoxForLayoutBox(*layoutBox.containingBlock())->width(); >+ // #1 >+ computedMarginLeftValue = marginLeft.isAuto() ? LayoutUnit(0) : valueForLength(marginLeft, containingBlockWidth); >+ computedMarginRightValue = marginRight.isAuto() ? LayoutUnit(0) : valueForLength(marginRight, containingBlockWidth); >+ } > >- // If 'width' is computed as 'auto', the used value is the "shrink-to-fit" width. >- auto width = layoutBox.style().logicalWidth(); >+ // #2 > auto computedWidthValue = width.isAuto() ? shrinkToFitWidth(layoutContext, layoutBox) : LayoutUnit(width.value()); >- return FormattingContext::Geometry::WidthAndMargin { computedWidthValue, { } }; >+ return FormattingContext::Geometry::WidthAndMargin { computedWidthValue, { computedMarginLeftValue, computedMarginRightValue } }; > } > > LayoutUnit FormattingContext::Geometry::floatingReplacedHeight(LayoutContext& layoutContext, const Box& 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 186334
: 342024