| 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 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 180 TextAutosizingWindowInfo windowInfo; | 180 TextAutosizingWindowInfo windowInfo; |
| 181 | 181 |
| 182 // Window area, in logical (density-independent) pixels. | 182 // Window area, in logical (density-independent) pixels. |
| 183 windowInfo.windowSize = m_document->settings()->textAutosizingWindowSizeOver
ride(); | 183 windowInfo.windowSize = m_document->settings()->textAutosizingWindowSizeOver
ride(); |
| 184 if (windowInfo.windowSize.isEmpty()) | 184 if (windowInfo.windowSize.isEmpty()) |
| 185 windowInfo.windowSize = mainFrame->view()->unscaledVisibleContentSize(Sc
rollableArea::IncludeScrollbars); | 185 windowInfo.windowSize = mainFrame->view()->unscaledVisibleContentSize(Sc
rollableArea::IncludeScrollbars); |
| 186 | 186 |
| 187 // Largest area of block that can be visible at once (assuming the main | 187 // Largest area of block that can be visible at once (assuming the main |
| 188 // frame doesn't get scaled to less than overview scale), in CSS pixels. | 188 // frame doesn't get scaled to less than overview scale), in CSS pixels. |
| 189 windowInfo.minLayoutSize = mainFrame->view()->layoutSize(); | 189 windowInfo.minLayoutSize = mainFrame->view()->layoutSize(); |
| 190 for (Frame* frame = m_document->frame(); frame; frame = frame->tree()->paren
t()) | 190 for (Frame* frame = m_document->frame(); frame; frame = frame->tree().parent
()) |
| 191 windowInfo.minLayoutSize = windowInfo.minLayoutSize.shrunkTo(frame->view
()->layoutSize()); | 191 windowInfo.minLayoutSize = windowInfo.minLayoutSize.shrunkTo(frame->view
()->layoutSize()); |
| 192 | 192 |
| 193 // The layoutRoot could be neither a container nor a cluster, so walk up the
tree till we find each of these. | 193 // The layoutRoot could be neither a container nor a cluster, so walk up the
tree till we find each of these. |
| 194 RenderBlock* container = layoutRoot->isRenderBlock() ? toRenderBlock(layoutR
oot) : layoutRoot->containingBlock(); | 194 RenderBlock* container = layoutRoot->isRenderBlock() ? toRenderBlock(layoutR
oot) : layoutRoot->containingBlock(); |
| 195 while (container && !isAutosizingContainer(container)) | 195 while (container && !isAutosizingContainer(container)) |
| 196 container = container->containingBlock(); | 196 container = container->containingBlock(); |
| 197 | 197 |
| 198 RenderBlock* cluster = container; | 198 RenderBlock* cluster = container; |
| 199 while (cluster && (!isAutosizingContainer(cluster) || !isIndependentDescenda
nt(cluster))) | 199 while (cluster && (!isAutosizingContainer(cluster) || !isIndependentDescenda
nt(cluster))) |
| 200 cluster = cluster->containingBlock(); | 200 cluster = cluster->containingBlock(); |
| (...skipping 529 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 730 if (i + 1 < clusterInfos.size()) { | 730 if (i + 1 < clusterInfos.size()) { |
| 731 float currentWidth = clusterInfos[i].root->contentLogicalWidth(); | 731 float currentWidth = clusterInfos[i].root->contentLogicalWidth(); |
| 732 float nextWidth = clusterInfos[i + 1].root->contentLogicalWidth(); | 732 float nextWidth = clusterInfos[i + 1].root->contentLogicalWidth(); |
| 733 if (currentWidth - nextWidth > maxWidthDifferenceWithinGroup) | 733 if (currentWidth - nextWidth > maxWidthDifferenceWithinGroup) |
| 734 groups.grow(groups.size() + 1); | 734 groups.grow(groups.size() + 1); |
| 735 } | 735 } |
| 736 } | 736 } |
| 737 } | 737 } |
| 738 | 738 |
| 739 } // namespace WebCore | 739 } // namespace WebCore |
| OLD | NEW |