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 435 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
446 void TextAutosizer::setMultiplier(RenderObject* renderer, float multiplier) | 446 void TextAutosizer::setMultiplier(RenderObject* renderer, float multiplier) |
447 { | 447 { |
448 RefPtr<RenderStyle> newStyle = RenderStyle::clone(renderer->style()); | 448 RefPtr<RenderStyle> newStyle = RenderStyle::clone(renderer->style()); |
449 newStyle->setTextAutosizingMultiplier(multiplier); | 449 newStyle->setTextAutosizingMultiplier(multiplier); |
450 newStyle->setUnique(); | 450 newStyle->setUnique(); |
451 renderer->setStyle(newStyle.release()); | 451 renderer->setStyle(newStyle.release()); |
452 } | 452 } |
453 | 453 |
454 void TextAutosizer::setMultiplierForList(RenderObject* renderer, float multiplie
r) | 454 void TextAutosizer::setMultiplierForList(RenderObject* renderer, float multiplie
r) |
455 { | 455 { |
456 #ifndef NDEBUG | 456 #if ENABLE(ASSERT) |
457 Node* parentNode = renderer->generatingNode(); | 457 Node* parentNode = renderer->generatingNode(); |
458 ASSERT(parentNode); | 458 ASSERT(parentNode); |
459 ASSERT(isHTMLOListElement(parentNode) || isHTMLUListElement(parentNode)); | 459 ASSERT(isHTMLOListElement(parentNode) || isHTMLUListElement(parentNode)); |
460 #endif | 460 #endif |
461 setMultiplier(renderer, multiplier); | 461 setMultiplier(renderer, multiplier); |
462 | 462 |
463 // Make sure all list items are autosized consistently. | 463 // Make sure all list items are autosized consistently. |
464 for (RenderObject* child = renderer->slowFirstChild(); child; child = child-
>nextSibling()) { | 464 for (RenderObject* child = renderer->slowFirstChild(); child; child = child-
>nextSibling()) { |
465 if (child->isListItem() && child->style()->textAutosizingMultiplier() ==
1) | 465 if (child->isListItem() && child->style()->textAutosizingMultiplier() ==
1) |
466 setMultiplier(child, multiplier); | 466 setMultiplier(child, multiplier); |
(...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
819 if (i + 1 < clusterInfos.size()) { | 819 if (i + 1 < clusterInfos.size()) { |
820 LayoutUnit currentWidth = clusterInfos[i].root->contentLogicalWidth(
); | 820 LayoutUnit currentWidth = clusterInfos[i].root->contentLogicalWidth(
); |
821 LayoutUnit nextWidth = clusterInfos[i + 1].root->contentLogicalWidth
(); | 821 LayoutUnit nextWidth = clusterInfos[i + 1].root->contentLogicalWidth
(); |
822 if (currentWidth - nextWidth > maxWidthDifferenceWithinGroup) | 822 if (currentWidth - nextWidth > maxWidthDifferenceWithinGroup) |
823 groups.grow(groups.size() + 1); | 823 groups.grow(groups.size() + 1); |
824 } | 824 } |
825 } | 825 } |
826 } | 826 } |
827 | 827 |
828 } // namespace WebCore | 828 } // namespace WebCore |
OLD | NEW |