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 2126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2137 // If the child is an orthogonal flow, child's height determines the wid th, but the height is not available until layout. | 2137 // If the child is an orthogonal flow, child's height determines the wid th, but the height is not available until layout. |
2138 // http://dev.w3.org/csswg/css-writing-modes-3/#orthogonal-shrink-to-fit | 2138 // http://dev.w3.org/csswg/css-writing-modes-3/#orthogonal-shrink-to-fit |
2139 if (!child.needsLayout()) { | 2139 if (!child.needsLayout()) { |
2140 minPreferredLogicalWidth = maxPreferredLogicalWidth = toLayoutBox(ch ild).logicalHeight(); | 2140 minPreferredLogicalWidth = maxPreferredLogicalWidth = toLayoutBox(ch ild).logicalHeight(); |
2141 return; | 2141 return; |
2142 } | 2142 } |
2143 m_needsRecalcLogicalWidthAfterLayoutChildren = true; | 2143 m_needsRecalcLogicalWidthAfterLayoutChildren = true; |
2144 minPreferredLogicalWidth = maxPreferredLogicalWidth = toLayoutBox(child) .computeLogicalHeightWithoutLayout(); | 2144 minPreferredLogicalWidth = maxPreferredLogicalWidth = toLayoutBox(child) .computeLogicalHeightWithoutLayout(); |
2145 return; | 2145 return; |
2146 } | 2146 } |
2147 minPreferredLogicalWidth = child.minPreferredLogicalWidth(); | 2147 |
2148 maxPreferredLogicalWidth = child.maxPreferredLogicalWidth(); | 2148 if (child.isLayoutBlock() && !child.isTable() && !child.isReplaced()) { |
mstensho (USE GERRIT)
2015/12/09 16:56:04
Why exclude table?
svillar
2015/12/09 17:41:32
Because there is a different section in the spec f
mstensho (USE GERRIT)
2015/12/09 19:17:33
This? http://imgur.com/osjEW7F
I think we should
| |
2149 const Length& computedInlineSize = child.styleRef().logicalWidth(); | |
2150 if (computedInlineSize.isFitContent() || computedInlineSize.isFillAvaila ble() || computedInlineSize.isAuto() | |
2151 || (computedInlineSize.hasPercent() && !toLayoutBox(child).percentag eLogicalHeightIsResolvable())) { | |
2152 minPreferredLogicalWidth = child.minPreferredLogicalWidth(); | |
2153 maxPreferredLogicalWidth = child.maxPreferredLogicalWidth(); | |
2154 } else { | |
2155 ASSERT(computedInlineSize.isMinContent() || computedInlineSize.isMax Content() || computedInlineSize.isSpecified()); | |
2156 LogicalExtentComputedValues computedValues; | |
2157 toLayoutBlock(child).computeLogicalWidth(computedValues); | |
mstensho (USE GERRIT)
2015/12/09 16:56:04
How is this supposed to work if we haven't laid ou
svillar
2015/12/09 17:41:32
It will work because for min|max-content computeLo
mstensho (USE GERRIT)
2015/12/09 19:17:33
OK, that should work.
But I still think my sugges
| |
2158 minPreferredLogicalWidth = maxPreferredLogicalWidth = computedValues .m_extent; | |
2159 } | |
2160 } else { | |
2161 // TODO(svillar): we leave the original implementation as default fallba ck. Still need to specialcase | |
2162 // some other situations: https://drafts.csswg.org/css-sizing/#intrinsic | |
2163 minPreferredLogicalWidth = child.minPreferredLogicalWidth(); | |
2164 maxPreferredLogicalWidth = child.maxPreferredLogicalWidth(); | |
2165 } | |
2166 | |
2149 if (child.isLayoutBlock() && toLayoutBlock(child).needsRecalcLogicalWidthAft erLayoutChildren()) | 2167 if (child.isLayoutBlock() && toLayoutBlock(child).needsRecalcLogicalWidthAft erLayoutChildren()) |
2150 m_needsRecalcLogicalWidthAfterLayoutChildren = true; | 2168 m_needsRecalcLogicalWidthAfterLayoutChildren = true; |
2151 } | 2169 } |
2152 | 2170 |
2153 bool LayoutBlock::hasLineIfEmpty() const | 2171 bool LayoutBlock::hasLineIfEmpty() const |
2154 { | 2172 { |
2155 if (!node()) | 2173 if (!node()) |
2156 return false; | 2174 return false; |
2157 | 2175 |
2158 if (node()->isRootEditableElement()) | 2176 if (node()->isRootEditableElement()) |
(...skipping 753 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2912 void LayoutBlock::showLineTreeAndMark(const InlineBox* markedBox1, const char* m arkedLabel1, const InlineBox* markedBox2, const char* markedLabel2, const Layout Object* obj) const | 2930 void LayoutBlock::showLineTreeAndMark(const InlineBox* markedBox1, const char* m arkedLabel1, const InlineBox* markedBox2, const char* markedLabel2, const Layout Object* obj) const |
2913 { | 2931 { |
2914 showLayoutObject(); | 2932 showLayoutObject(); |
2915 for (const RootInlineBox* root = firstRootBox(); root; root = root->nextRoot Box()) | 2933 for (const RootInlineBox* root = firstRootBox(); root; root = root->nextRoot Box()) |
2916 root->showLineTreeAndMark(markedBox1, markedLabel1, markedBox2, markedLa bel2, obj, 1); | 2934 root->showLineTreeAndMark(markedBox1, markedLabel1, markedBox2, markedLa bel2, obj, 1); |
2917 } | 2935 } |
2918 | 2936 |
2919 #endif | 2937 #endif |
2920 | 2938 |
2921 } // namespace blink | 2939 } // namespace blink |
OLD | NEW |