Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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 Loading... | |
| 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 |
| OLD | NEW |