Chromium Code Reviews| 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 9460837de934d171b87138dd10dc175b49815f74..504df4f713d29aa844eb519047b6c5cdb7ad0ead 100644 |
| --- a/third_party/WebKit/Source/core/layout/LayoutBox.cpp |
| +++ b/third_party/WebKit/Source/core/layout/LayoutBox.cpp |
| @@ -2724,9 +2724,13 @@ LayoutUnit LayoutBox::computeLogicalWidthUsing(SizeType widthType, |
| marginStart, marginEnd, toLayoutBlockFlow(cb))); |
| if (widthType == MainOrPreferredSize && |
| - sizesLogicalWidthToFitContent(logicalWidth)) |
| + sizesLogicalWidthToFitContent(logicalWidth)) { |
| + // Reset width so that any percent margins on inline children do not |
| + // use it when calculating min/max preferred width. |
|
eae
2017/04/10 05:17:57
Would you mind filing a bug about this const_cast
|
| + const_cast<LayoutBox*>(this)->setLogicalWidth(LayoutUnit()); |
| return std::max(minPreferredLogicalWidth(), |
| std::min(maxPreferredLogicalWidth(), logicalWidthResult)); |
| + } |
| return logicalWidthResult; |
| } |