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) 2007 David Smith (catfish.man@gmail.com) | 4 * (C) 2007 David Smith (catfish.man@gmail.com) |
5 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved. | 5 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved. |
6 * Copyright (C) Research In Motion Limited 2010. All rights reserved. | 6 * Copyright (C) Research In Motion Limited 2010. All rights reserved. |
7 * | 7 * |
8 * This library is free software; you can redistribute it and/or | 8 * This library is free software; you can redistribute it and/or |
9 * modify it under the terms of the GNU Library General Public | 9 * modify it under the terms of the GNU Library General Public |
10 * License as published by the Free Software Foundation; either | 10 * License as published by the Free Software Foundation; either |
(...skipping 2106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2117 // If the child is an orthogonal flow, child's height determines the wid th, but the height is not available until layout. | 2117 // If the child is an orthogonal flow, child's height determines the wid th, but the height is not available until layout. |
2118 // http://dev.w3.org/csswg/css-writing-modes-3/#orthogonal-shrink-to-fit | 2118 // http://dev.w3.org/csswg/css-writing-modes-3/#orthogonal-shrink-to-fit |
2119 if (!child.needsLayout()) { | 2119 if (!child.needsLayout()) { |
2120 minPreferredLogicalWidth = maxPreferredLogicalWidth = toLayoutBox(ch ild).logicalHeight(); | 2120 minPreferredLogicalWidth = maxPreferredLogicalWidth = toLayoutBox(ch ild).logicalHeight(); |
2121 return; | 2121 return; |
2122 } | 2122 } |
2123 m_needsRecalcLogicalWidthAfterLayoutChildren = true; | 2123 m_needsRecalcLogicalWidthAfterLayoutChildren = true; |
2124 minPreferredLogicalWidth = maxPreferredLogicalWidth = toLayoutBox(child) .computeLogicalHeightWithoutLayout(); | 2124 minPreferredLogicalWidth = maxPreferredLogicalWidth = toLayoutBox(child) .computeLogicalHeightWithoutLayout(); |
2125 return; | 2125 return; |
2126 } | 2126 } |
2127 minPreferredLogicalWidth = child.minPreferredLogicalWidth(); | 2127 |
2128 maxPreferredLogicalWidth = child.maxPreferredLogicalWidth(); | 2128 if (child.isLayoutBlock() && !child.isTable()) { |
mstensho (USE GERRIT)
2015/12/18 12:03:46
The table check is still here. I had a comment on
svillar
2015/12/18 12:40:37
I forgot to reply to that comment. The problem wit
mstensho (USE GERRIT)
2015/12/18 14:05:12
Aha, with your changes a fixed width now means tha
| |
2129 const Length& computedInlineSize = child.styleRef().logicalWidth(); | |
2130 if (computedInlineSize.isFitContent() || computedInlineSize.isFillAvaila ble() || computedInlineSize.isAuto() | |
2131 || computedInlineSize.hasPercent()) { | |
2132 // TODO(svillar): we could do a lot better for percents (we're consi dering them always indefinite) | |
2133 // but we need https://codereview.chromium.org/1383003002/ first to be fixed | |
2134 minPreferredLogicalWidth = child.minPreferredLogicalWidth(); | |
2135 maxPreferredLogicalWidth = child.maxPreferredLogicalWidth(); | |
2136 } else { | |
2137 ASSERT(computedInlineSize.isMinContent() || computedInlineSize.isMax Content() || computedInlineSize.isFixed()); | |
2138 LogicalExtentComputedValues computedValues; | |
2139 toLayoutBlock(child).computeLogicalWidth(computedValues); | |
2140 minPreferredLogicalWidth = maxPreferredLogicalWidth = computedValues .m_extent; | |
2141 child.clearPreferredLogicalWidthsDirty(); | |
2142 } | |
2143 } else { | |
2144 // TODO(svillar): we leave the original implementation as default fallba ck. Still need to specialcase | |
2145 // some other situations: https://drafts.csswg.org/css-sizing/#intrinsic | |
2146 minPreferredLogicalWidth = child.minPreferredLogicalWidth(); | |
2147 maxPreferredLogicalWidth = child.maxPreferredLogicalWidth(); | |
2148 } | |
2149 | |
2129 if (child.isLayoutBlock() && toLayoutBlock(child).needsRecalcLogicalWidthAft erLayoutChildren()) | 2150 if (child.isLayoutBlock() && toLayoutBlock(child).needsRecalcLogicalWidthAft erLayoutChildren()) |
2130 m_needsRecalcLogicalWidthAfterLayoutChildren = true; | 2151 m_needsRecalcLogicalWidthAfterLayoutChildren = true; |
2131 } | 2152 } |
2132 | 2153 |
2133 bool LayoutBlock::hasLineIfEmpty() const | 2154 bool LayoutBlock::hasLineIfEmpty() const |
2134 { | 2155 { |
2135 if (!node()) | 2156 if (!node()) |
2136 return false; | 2157 return false; |
2137 | 2158 |
2138 if (node()->isRootEditableElement()) | 2159 if (node()->isRootEditableElement()) |
(...skipping 753 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2892 void LayoutBlock::showLineTreeAndMark(const InlineBox* markedBox1, const char* m arkedLabel1, const InlineBox* markedBox2, const char* markedLabel2, const Layout Object* obj) const | 2913 void LayoutBlock::showLineTreeAndMark(const InlineBox* markedBox1, const char* m arkedLabel1, const InlineBox* markedBox2, const char* markedLabel2, const Layout Object* obj) const |
2893 { | 2914 { |
2894 showLayoutObject(); | 2915 showLayoutObject(); |
2895 for (const RootInlineBox* root = firstRootBox(); root; root = root->nextRoot Box()) | 2916 for (const RootInlineBox* root = firstRootBox(); root; root = root->nextRoot Box()) |
2896 root->showLineTreeAndMark(markedBox1, markedLabel1, markedBox2, markedLa bel2, obj, 1); | 2917 root->showLineTreeAndMark(markedBox1, markedLabel1, markedBox2, markedLa bel2, obj, 1); |
2897 } | 2918 } |
2898 | 2919 |
2899 #endif | 2920 #endif |
2900 | 2921 |
2901 } // namespace blink | 2922 } // namespace blink |
OLD | NEW |