Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(786)

Side by Side Diff: Source/core/rendering/TextAutosizer.cpp

Issue 13963006: Remove frame flattening support as Chromium has no intention of using it (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Source/core/rendering/RenderPart.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 // Window area, in logical (density-independent) pixels. 113 // Window area, in logical (density-independent) pixels.
114 windowInfo.windowSize = m_document->settings()->textAutosizingWindowSizeOver ride(); 114 windowInfo.windowSize = m_document->settings()->textAutosizingWindowSizeOver ride();
115 if (windowInfo.windowSize.isEmpty()) { 115 if (windowInfo.windowSize.isEmpty()) {
116 bool includeScrollbars = !InspectorInstrumentation::shouldApplyScreenWid thOverride(mainFrame); 116 bool includeScrollbars = !InspectorInstrumentation::shouldApplyScreenWid thOverride(mainFrame);
117 windowInfo.windowSize = mainFrame->view()->unscaledVisibleContentSize(in cludeScrollbars ? ScrollableArea::IncludeScrollbars : ScrollableArea::ExcludeScr ollbars); 117 windowInfo.windowSize = mainFrame->view()->unscaledVisibleContentSize(in cludeScrollbars ? ScrollableArea::IncludeScrollbars : ScrollableArea::ExcludeScr ollbars);
118 } 118 }
119 119
120 // Largest area of block that can be visible at once (assuming the main 120 // Largest area of block that can be visible at once (assuming the main
121 // frame doesn't get scaled to less than overview scale), in CSS pixels. 121 // frame doesn't get scaled to less than overview scale), in CSS pixels.
122 windowInfo.minLayoutSize = mainFrame->view()->layoutSize(); 122 windowInfo.minLayoutSize = mainFrame->view()->layoutSize();
123 for (Frame* frame = m_document->frame(); frame; frame = frame->tree()->paren t()) { 123 for (Frame* frame = m_document->frame(); frame; frame = frame->tree()->paren t())
124 if (!frame->view()->isInChildFrameWithFrameFlattening()) 124 windowInfo.minLayoutSize = windowInfo.minLayoutSize.shrunkTo(frame->view ()->layoutSize());
125 windowInfo.minLayoutSize = windowInfo.minLayoutSize.shrunkTo(frame-> view()->layoutSize());
126 }
127 125
128 // The layoutRoot could be neither a container nor a cluster, so walk up the tree till we find each of these. 126 // The layoutRoot could be neither a container nor a cluster, so walk up the tree till we find each of these.
129 RenderBlock* container = layoutRoot->isRenderBlock() ? toRenderBlock(layoutR oot) : layoutRoot->containingBlock(); 127 RenderBlock* container = layoutRoot->isRenderBlock() ? toRenderBlock(layoutR oot) : layoutRoot->containingBlock();
130 while (container && !isAutosizingContainer(container)) 128 while (container && !isAutosizingContainer(container))
131 container = container->containingBlock(); 129 container = container->containingBlock();
132 130
133 RenderBlock* cluster = container; 131 RenderBlock* cluster = container;
134 while (cluster && (!isAutosizingContainer(cluster) || !isIndependentDescenda nt(cluster))) 132 while (cluster && (!isAutosizingContainer(cluster) || !isIndependentDescenda nt(cluster)))
135 cluster = cluster->containingBlock(); 133 cluster = cluster->containingBlock();
136 134
(...skipping 469 matching lines...) Expand 10 before | Expand all | Expand 10 after
606 if (i + 1 < clusterInfos.size()) { 604 if (i + 1 < clusterInfos.size()) {
607 float currentWidth = clusterInfos[i].root->contentLogicalWidth(); 605 float currentWidth = clusterInfos[i].root->contentLogicalWidth();
608 float nextWidth = clusterInfos[i + 1].root->contentLogicalWidth(); 606 float nextWidth = clusterInfos[i + 1].root->contentLogicalWidth();
609 if (currentWidth - nextWidth > maxWidthDifferenceWithinGroup) 607 if (currentWidth - nextWidth > maxWidthDifferenceWithinGroup)
610 groups.grow(groups.size() + 1); 608 groups.grow(groups.size() + 1);
611 } 609 }
612 } 610 }
613 } 611 }
614 612
615 } // namespace WebCore 613 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/rendering/RenderPart.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698