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

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

Issue 2065243003: [css-sizing] Ensure positive available size on replaced elements Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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 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 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com) 4 * (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com)
5 * (C) 2005, 2006 Samuel Weinig (sam.weinig@gmail.com) 5 * (C) 2005, 2006 Samuel Weinig (sam.weinig@gmail.com)
6 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserv ed. 6 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserv ed.
7 * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved. 7 * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved.
8 * 8 *
9 * This library is free software; you can redistribute it and/or 9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Library General Public 10 * modify it under the terms of the GNU Library General Public
(...skipping 2821 matching lines...) Expand 10 before | Expand all | Expand 10 after
2832 LayoutUnit availableLogicalWidth; 2832 LayoutUnit availableLogicalWidth;
2833 return computeIntrinsicLogicalWidthUsing(logicalWidth, availableLogicalW idth, borderAndPaddingLogicalWidth()) - borderAndPaddingLogicalWidth(); 2833 return computeIntrinsicLogicalWidthUsing(logicalWidth, availableLogicalW idth, borderAndPaddingLogicalWidth()) - borderAndPaddingLogicalWidth();
2834 } 2834 }
2835 case FitContent: 2835 case FitContent:
2836 case FillAvailable: 2836 case FillAvailable:
2837 case Percent: 2837 case Percent:
2838 case Calculated: { 2838 case Calculated: {
2839 // FIXME: containingBlockLogicalWidthForContent() is wrong if the replac ed element's writing-mode is perpendicular to the 2839 // FIXME: containingBlockLogicalWidthForContent() is wrong if the replac ed element's writing-mode is perpendicular to the
2840 // containing block's writing-mode. 2840 // containing block's writing-mode.
2841 // https://bugs.webkit.org/show_bug.cgi?id=46496 2841 // https://bugs.webkit.org/show_bug.cgi?id=46496
2842 const LayoutUnit cw = isOutOfFlowPositioned() ? containingBlockLogicalWi dthForPositioned(toLayoutBoxModelObject(container())) : containingBlockLogicalWi dthForContent(); 2842 const LayoutUnit cw = std::max(LayoutUnit(), isOutOfFlowPositioned() ? c ontainingBlockLogicalWidthForPositioned(toLayoutBoxModelObject(container())) : c ontainingBlockLogicalWidthForContent());
cbiesinger 2016/06/27 18:43:49 So, why do these functions return a negative value
jfernandez 2016/06/27 21:38:43 I though about that, actually. However, I've got l
2843 Length containerLogicalWidth = containingBlock()->style()->logicalWidth( ); 2843 Length containerLogicalWidth = containingBlock()->style()->logicalWidth( );
2844 // FIXME: Handle cases when containing block width is calculated or view port percent. 2844 // FIXME: Handle cases when containing block width is calculated or view port percent.
2845 // https://bugs.webkit.org/show_bug.cgi?id=91071 2845 // https://bugs.webkit.org/show_bug.cgi?id=91071
2846 if (logicalWidth.isIntrinsic()) 2846 if (logicalWidth.isIntrinsic())
2847 return computeIntrinsicLogicalWidthUsing(logicalWidth, cw, borderAnd PaddingLogicalWidth()) - borderAndPaddingLogicalWidth(); 2847 return computeIntrinsicLogicalWidthUsing(logicalWidth, cw, borderAnd PaddingLogicalWidth()) - borderAndPaddingLogicalWidth();
2848 if (cw > 0 || (!cw && (containerLogicalWidth.isFixed() || containerLogic alWidth.hasPercent()))) 2848 if (cw > 0 || (!cw && (containerLogicalWidth.isFixed() || containerLogic alWidth.hasPercent())))
2849 return adjustContentBoxLogicalWidthForBoxSizing(minimumValueForLengt h(logicalWidth, cw)); 2849 return adjustContentBoxLogicalWidthForBoxSizing(minimumValueForLengt h(logicalWidth, cw));
2850 return LayoutUnit(); 2850 return LayoutUnit();
2851 } 2851 }
2852 case Auto: 2852 case Auto:
(...skipping 2024 matching lines...) Expand 10 before | Expand all | Expand 10 after
4877 m_rareData->m_snapAreas->remove(&snapArea); 4877 m_rareData->m_snapAreas->remove(&snapArea);
4878 } 4878 }
4879 } 4879 }
4880 4880
4881 SnapAreaSet* LayoutBox::snapAreas() const 4881 SnapAreaSet* LayoutBox::snapAreas() const
4882 { 4882 {
4883 return m_rareData ? m_rareData->m_snapAreas.get() : nullptr; 4883 return m_rareData ? m_rareData->m_snapAreas.get() : nullptr;
4884 } 4884 }
4885 4885
4886 } // namespace blink 4886 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698