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 784 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
795 ASSERT(renderer); | 795 ASSERT(renderer); |
796 RenderStyle* currentStyle = renderer->style(); | 796 RenderStyle* currentStyle = renderer->style(); |
797 if (currentStyle->textAutosizingMultiplier() == multiplier) | 797 if (currentStyle->textAutosizingMultiplier() == multiplier) |
798 return; | 798 return; |
799 | 799 |
800 // We need to clone the render style to avoid breaking style sharing. | 800 // We need to clone the render style to avoid breaking style sharing. |
801 RefPtr<RenderStyle> style = RenderStyle::clone(currentStyle); | 801 RefPtr<RenderStyle> style = RenderStyle::clone(currentStyle); |
802 style->setTextAutosizingMultiplier(multiplier); | 802 style->setTextAutosizingMultiplier(multiplier); |
803 style->setUnique(); | 803 style->setUnique(); |
804 renderer->setStyleInternal(style.release()); | 804 renderer->setStyleInternal(style.release()); |
| 805 |
| 806 if (renderer->isRenderBlock()) |
| 807 toRenderBlock(renderer)->invalidateLineHeight(); |
805 } | 808 } |
806 | 809 |
807 bool FastTextAutosizer::isWiderOrNarrowerDescendant(Cluster* cluster) | 810 bool FastTextAutosizer::isWiderOrNarrowerDescendant(Cluster* cluster) |
808 { | 811 { |
809 if (!cluster->m_parent || !mightBeWiderOrNarrowerDescendant(cluster->m_root)
) | 812 if (!cluster->m_parent || !mightBeWiderOrNarrowerDescendant(cluster->m_root)
) |
810 return true; | 813 return true; |
811 | 814 |
812 const RenderBlock* parentDeepestBlockContainingAllText = deepestBlockContain
ingAllText(cluster->m_parent); | 815 const RenderBlock* parentDeepestBlockContainingAllText = deepestBlockContain
ingAllText(cluster->m_parent); |
813 ASSERT(m_blocksThatHaveBegunLayout.contains(cluster->m_root)); | 816 ASSERT(m_blocksThatHaveBegunLayout.contains(cluster->m_root)); |
814 ASSERT(m_blocksThatHaveBegunLayout.contains(parentDeepestBlockContainingAllT
ext)); | 817 ASSERT(m_blocksThatHaveBegunLayout.contains(parentDeepestBlockContainingAllT
ext)); |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
926 m_textAutosizer = 0; | 929 m_textAutosizer = 0; |
927 } | 930 } |
928 | 931 |
929 FastTextAutosizer::LayoutScope::~LayoutScope() | 932 FastTextAutosizer::LayoutScope::~LayoutScope() |
930 { | 933 { |
931 if (m_textAutosizer) | 934 if (m_textAutosizer) |
932 m_textAutosizer->endLayout(m_block); | 935 m_textAutosizer->endLayout(m_block); |
933 } | 936 } |
934 | 937 |
935 } // namespace WebCore | 938 } // namespace WebCore |
OLD | NEW |