| 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 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 187 // have the same specified font size. | 187 // have the same specified font size. |
| 188 // 3. It should not contain <br> elements. | 188 // 3. It should not contain <br> elements. |
| 189 // 4. It should contain only inline elements unless they are containers, | 189 // 4. It should contain only inline elements unless they are containers, |
| 190 // children of link elements or children of sub-containers. | 190 // children of link elements or children of sub-containers. |
| 191 int linkCount = 0; | 191 int linkCount = 0; |
| 192 RenderObject* renderer = block->firstChild(); | 192 RenderObject* renderer = block->firstChild(); |
| 193 float matchingFontSize = -1; | 193 float matchingFontSize = -1; |
| 194 | 194 |
| 195 while (renderer) { | 195 while (renderer) { |
| 196 if (!isPotentialClusterRoot(renderer)) { | 196 if (!isPotentialClusterRoot(renderer)) { |
| 197 if (renderer->isText() && toRenderText(renderer)->text().impl()->str
ipWhiteSpace()->length() > 3) | 197 if (renderer->isText() && toRenderText(renderer)->text().stripWhiteS
pace().length() > 3) |
| 198 return false; | 198 return false; |
| 199 if (!renderer->isInline() || renderer->isBR()) | 199 if (!renderer->isInline() || renderer->isBR()) |
| 200 return false; | 200 return false; |
| 201 } | 201 } |
| 202 if (renderer->style()->isLink()) { | 202 if (renderer->style()->isLink()) { |
| 203 linkCount++; | 203 linkCount++; |
| 204 if (matchingFontSize < 0) | 204 if (matchingFontSize < 0) |
| 205 matchingFontSize = renderer->style()->specifiedFontSize(); | 205 matchingFontSize = renderer->style()->specifiedFontSize(); |
| 206 else if (matchingFontSize != renderer->style()->specifiedFontSize()) | 206 else if (matchingFontSize != renderer->style()->specifiedFontSize()) |
| 207 return false; | 207 return false; |
| (...skipping 955 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1163 } | 1163 } |
| 1164 return computedSize; | 1164 return computedSize; |
| 1165 } | 1165 } |
| 1166 | 1166 |
| 1167 void TextAutosizer::trace(Visitor* visitor) | 1167 void TextAutosizer::trace(Visitor* visitor) |
| 1168 { | 1168 { |
| 1169 visitor->trace(m_document); | 1169 visitor->trace(m_document); |
| 1170 } | 1170 } |
| 1171 | 1171 |
| 1172 } // namespace blink | 1172 } // namespace blink |
| OLD | NEW |