Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(580)

Unified Diff: third_party/WebKit/Source/core/layout/LayoutBox.cpp

Issue 2841823006: Resolve inline margins in over-constrained situations correctly. (Closed)
Patch Set: In regular block layout, the width of a child's margin box should always be equal to that of its containing block Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « AUTHORS ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/layout/LayoutBox.cpp
diff --git a/third_party/WebKit/Source/core/layout/LayoutBox.cpp b/third_party/WebKit/Source/core/layout/LayoutBox.cpp
index 6f2ceee06cd38b7eebf8828ca9cde565f9b1a570..22e237c79377f1eb45c604bb23545d2878ac52fe 100644
--- a/third_party/WebKit/Source/core/layout/LayoutBox.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutBox.cpp
@@ -2702,8 +2702,15 @@ void LayoutBox::ComputeLogicalWidth(
computed_values.margins_.start_, computed_values.margins_.end_,
Style()->MarginStart(), Style()->MarginEnd());
+ // CSS 2.1 10.3.3
+ // If 'width' is not 'auto' and 'border-left-width' + 'padding-left' + 'width'
+ // + 'padding-right' + 'border-right-width' (plus any of 'margin-left' or
+ // 'margin-right' that are not 'auto') is larger than the width of the
+ // containing block, then any 'auto' values for 'margin-left' or
+ // 'margin-right' treated as zero. The following should only apply for parent
+ // width >= children width
if (!has_perpendicular_containing_block && container_logical_width &&
- container_logical_width !=
+ container_logical_width >=
facetothefate 2017/04/26 18:09:43 To keep the old behavior, should be > I guess
(computed_values.extent_ + computed_values.margins_.start_ +
computed_values.margins_.end_) &&
!IsFloating() && !IsInline() && !cb->IsFlexibleBoxIncludingDeprecated() &&
« no previous file with comments | « AUTHORS ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698