OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 Google Inc. All rights reserved. |
3 * Copyright (C) 2012 Apple Inc. All rights reserved. | 3 * Copyright (C) 2012 Apple Inc. All rights reserved. |
4 * | 4 * |
5 * This library is free software; you can redistribute it and/or | 5 * This library is free software; you can redistribute it and/or |
6 * modify it under the terms of the GNU Library General Public | 6 * modify it under the terms of the GNU Library General Public |
7 * License as published by the Free Software Foundation; either | 7 * License as published by the Free Software Foundation; either |
8 * version 2 of the License, or (at your option) any later version. | 8 * version 2 of the License, or (at your option) any later version. |
9 * | 9 * |
10 * This library is distributed in the hope that it will be useful, | 10 * This library is distributed in the hope that it will be useful, |
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
205 TextAutosizingWindowInfo windowInfo; | 205 TextAutosizingWindowInfo windowInfo; |
206 | 206 |
207 // Window area, in logical (density-independent) pixels. | 207 // Window area, in logical (density-independent) pixels. |
208 windowInfo.windowSize = m_document->settings()->textAutosizingWindowSizeOver
ride(); | 208 windowInfo.windowSize = m_document->settings()->textAutosizingWindowSizeOver
ride(); |
209 if (windowInfo.windowSize.isEmpty()) | 209 if (windowInfo.windowSize.isEmpty()) |
210 windowInfo.windowSize = mainFrame->view()->unscaledVisibleContentSize(In
cludeScrollbars); | 210 windowInfo.windowSize = mainFrame->view()->unscaledVisibleContentSize(In
cludeScrollbars); |
211 | 211 |
212 // Largest area of block that can be visible at once (assuming the main | 212 // Largest area of block that can be visible at once (assuming the main |
213 // frame doesn't get scaled to less than overview scale), in CSS pixels. | 213 // frame doesn't get scaled to less than overview scale), in CSS pixels. |
214 windowInfo.minLayoutSize = mainFrame->view()->layoutSize(); | 214 windowInfo.minLayoutSize = mainFrame->view()->layoutSize(); |
215 for (LocalFrame* frame = m_document->frame(); frame; frame = frame->tree().p
arent()) | 215 for (Frame* frame = m_document->frame(); frame; frame = frame->tree().parent
()) { |
216 windowInfo.minLayoutSize = windowInfo.minLayoutSize.shrunkTo(frame->view
()->layoutSize()); | 216 if (frame->isLocalFrame()) |
| 217 windowInfo.minLayoutSize = windowInfo.minLayoutSize.shrunkTo(toLocal
Frame(frame)->view()->layoutSize()); |
| 218 } |
217 | 219 |
218 // The layoutRoot could be neither a container nor a cluster, so walk up the
tree till we find each of these. | 220 // The layoutRoot could be neither a container nor a cluster, so walk up the
tree till we find each of these. |
219 RenderBlock* container = layoutRoot->isRenderBlock() ? toRenderBlock(layoutR
oot) : layoutRoot->containingBlock(); | 221 RenderBlock* container = layoutRoot->isRenderBlock() ? toRenderBlock(layoutR
oot) : layoutRoot->containingBlock(); |
220 while (container && !isAutosizingContainer(container)) | 222 while (container && !isAutosizingContainer(container)) |
221 container = container->containingBlock(); | 223 container = container->containingBlock(); |
222 | 224 |
223 RenderBlock* cluster = container; | 225 RenderBlock* cluster = container; |
224 while (cluster && (!isAutosizingContainer(cluster) || !isIndependentDescenda
nt(cluster))) | 226 while (cluster && (!isAutosizingContainer(cluster) || !isIndependentDescenda
nt(cluster))) |
225 cluster = cluster->containingBlock(); | 227 cluster = cluster->containingBlock(); |
226 | 228 |
(...skipping 619 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
846 if (i + 1 < clusterInfos.size()) { | 848 if (i + 1 < clusterInfos.size()) { |
847 LayoutUnit currentWidth = clusterInfos[i].root->contentLogicalWidth(
); | 849 LayoutUnit currentWidth = clusterInfos[i].root->contentLogicalWidth(
); |
848 LayoutUnit nextWidth = clusterInfos[i + 1].root->contentLogicalWidth
(); | 850 LayoutUnit nextWidth = clusterInfos[i + 1].root->contentLogicalWidth
(); |
849 if (currentWidth - nextWidth > maxWidthDifferenceWithinGroup) | 851 if (currentWidth - nextWidth > maxWidthDifferenceWithinGroup) |
850 groups.grow(groups.size() + 1); | 852 groups.grow(groups.size() + 1); |
851 } | 853 } |
852 } | 854 } |
853 } | 855 } |
854 | 856 |
855 } // namespace WebCore | 857 } // namespace WebCore |
OLD | NEW |