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