OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
169 if (inlineObj->isRenderBlock() && m_clusterForBlock.contains(toRenderBlo
ck(inlineObj))) | 169 if (inlineObj->isRenderBlock() && m_clusterForBlock.contains(toRenderBlo
ck(inlineObj))) |
170 continue; | 170 continue; |
171 | 171 |
172 applyMultiplier(inlineObj, cluster->m_multiplier); | 172 applyMultiplier(inlineObj, cluster->m_multiplier); |
173 } | 173 } |
174 } | 174 } |
175 | 175 |
176 AtomicString FastTextAutosizer::fingerprint(const RenderBlock* block) | 176 AtomicString FastTextAutosizer::fingerprint(const RenderBlock* block) |
177 { | 177 { |
178 // FIXME(crbug.com/322340): Implement a better fingerprinting algorithm. | 178 // FIXME(crbug.com/322340): Implement a better fingerprinting algorithm. |
179 return String::number((unsigned long long) block); | 179 return AtomicString::number((unsigned long long) block); |
180 } | 180 } |
181 | 181 |
182 void FastTextAutosizer::recalcClusterIfNeeded(FastTextAutosizer::Cluster* cluste
r) | 182 void FastTextAutosizer::recalcClusterIfNeeded(FastTextAutosizer::Cluster* cluste
r) |
183 { | 183 { |
184 ASSERT(m_windowWidth > 0); | 184 ASSERT(m_windowWidth > 0); |
185 if (!cluster->needsClusterRecalc()) | 185 if (!cluster->needsClusterRecalc()) |
186 return; | 186 return; |
187 | 187 |
188 WTF::HashSet<RenderBlock*>& blocks = cluster->m_blocks; | 188 WTF::HashSet<RenderBlock*>& blocks = cluster->m_blocks; |
189 | 189 |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
222 | 222 |
223 // Cluster root layout width, in CSS pixels. | 223 // Cluster root layout width, in CSS pixels. |
224 float rootWidth = toRenderBlock(cluster->m_clusterRoot)->contentLogicalWidth
(); | 224 float rootWidth = toRenderBlock(cluster->m_clusterRoot)->contentLogicalWidth
(); |
225 | 225 |
226 // FIXME: incorporate font scale factor. | 226 // FIXME: incorporate font scale factor. |
227 float multiplier = min(rootWidth, layoutWidth) / m_windowWidth; | 227 float multiplier = min(rootWidth, layoutWidth) / m_windowWidth; |
228 cluster->m_multiplier = max(multiplier, 1.0f); | 228 cluster->m_multiplier = max(multiplier, 1.0f); |
229 } | 229 } |
230 | 230 |
231 } // namespace WebCore | 231 } // namespace WebCore |
OLD | NEW |