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

Side by Side Diff: third_party/WebKit/Source/core/layout/LayoutReplaced.cpp

Issue 2065243003: [css-sizing] Ensure positive available size on replaced elements Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: A different approach. Created 4 years, 1 month 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * Copyright (C) 2000 Dirk Mueller (mueller@kde.org) 3 * Copyright (C) 2000 Dirk Mueller (mueller@kde.org)
4 * Copyright (C) 2004, 2006, 2007 Apple Inc. All rights reserved. 4 * Copyright (C) 2004, 2006, 2007 Apple Inc. All rights reserved.
5 * Copyright (C) Research In Motion Limited 2011-2012. All rights reserved. 5 * Copyright (C) Research In Motion Limited 2011-2012. All rights reserved.
6 * 6 *
7 * This library is free software; you can redistribute it and/or 7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public 8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either 9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version. 10 * version 2 of the License, or (at your option) any later version.
(...skipping 806 matching lines...) Expand 10 before | Expand all | Expand 10 after
817 } 817 }
818 818
819 void LayoutReplaced::computePreferredLogicalWidths() { 819 void LayoutReplaced::computePreferredLogicalWidths() {
820 ASSERT(preferredLogicalWidthsDirty()); 820 ASSERT(preferredLogicalWidthsDirty());
821 821
822 // We cannot resolve some logical width here (i.e. percent, fill-available or 822 // We cannot resolve some logical width here (i.e. percent, fill-available or
823 // fit-content) as the available logical width may not be set on our 823 // fit-content) as the available logical width may not be set on our
824 // containing block. 824 // containing block.
825 const Length& logicalWidth = style()->logicalWidth(); 825 const Length& logicalWidth = style()->logicalWidth();
826 if (logicalWidth.isPercentOrCalc() || logicalWidth.isFillAvailable() || 826 if (logicalWidth.isPercentOrCalc() || logicalWidth.isFillAvailable() ||
827 logicalWidth.isFitContent()) 827 logicalWidth.isFitContent() ||
828 (logicalWidth.isAuto() && (style()->logicalMinWidth().isFillAvailable() ||
829 style()->logicalMinWidth().isFitContent() ||
mstensho (USE GERRIT) 2016/11/10 19:54:25 Why no isPercentOrCalc() here?
jfernandez 2016/11/10 20:54:39 umm, not sure, I thought about that. I tried to ke
830 style()->logicalMaxWidth().isFillAvailable() ||
831 style()->logicalMaxWidth().isFitContent())))
828 computeIntrinsicLogicalWidths(m_minPreferredLogicalWidth, 832 computeIntrinsicLogicalWidths(m_minPreferredLogicalWidth,
829 m_maxPreferredLogicalWidth); 833 m_maxPreferredLogicalWidth);
830 else 834 else
831 m_minPreferredLogicalWidth = m_maxPreferredLogicalWidth = 835 m_minPreferredLogicalWidth = m_maxPreferredLogicalWidth =
832 computeReplacedLogicalWidth(ComputePreferred); 836 computeReplacedLogicalWidth(ComputePreferred);
833 837
834 const ComputedStyle& styleToUse = styleRef(); 838 const ComputedStyle& styleToUse = styleRef();
835 if (styleToUse.logicalWidth().isPercentOrCalc() || 839 if (styleToUse.logicalWidth().isPercentOrCalc() ||
836 styleToUse.logicalMaxWidth().isPercentOrCalc()) 840 styleToUse.logicalMaxWidth().isPercentOrCalc())
837 m_minPreferredLogicalWidth = LayoutUnit(); 841 m_minPreferredLogicalWidth = LayoutUnit();
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
938 inlineBoxWrapper()->root().setHasSelectedChildren(state != SelectionNone); 942 inlineBoxWrapper()->root().setHasSelectedChildren(state != SelectionNone);
939 } 943 }
940 944
941 void LayoutReplaced::IntrinsicSizingInfo::transpose() { 945 void LayoutReplaced::IntrinsicSizingInfo::transpose() {
942 size = size.transposedSize(); 946 size = size.transposedSize();
943 aspectRatio = aspectRatio.transposedSize(); 947 aspectRatio = aspectRatio.transposedSize();
944 std::swap(hasWidth, hasHeight); 948 std::swap(hasWidth, hasHeight);
945 } 949 }
946 950
947 } // namespace blink 951 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698