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

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

Issue 218863002: [FastTextAutosizer] Fix the inline overlap issue. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 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 | Annotate | Revision Log
OLDNEW
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
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 // Notify inline renderers that their width may have changed.
807 if (renderer->parent() && renderer->parent()->isRenderInline())
808 renderer->setPreferredLogicalWidthsDirty(MarkOnlyThis);
skobes 2014/03/31 17:19:58 Do you know why this works? I would have guessed
pdr. 2014/04/01 06:06:43 A good question. In looking into this I found our
805 } 809 }
806 810
807 bool FastTextAutosizer::isWiderOrNarrowerDescendant(Cluster* cluster) 811 bool FastTextAutosizer::isWiderOrNarrowerDescendant(Cluster* cluster)
808 { 812 {
809 if (!cluster->m_parent || !mightBeWiderOrNarrowerDescendant(cluster->m_root) ) 813 if (!cluster->m_parent || !mightBeWiderOrNarrowerDescendant(cluster->m_root) )
810 return true; 814 return true;
811 815
812 const RenderBlock* parentDeepestBlockContainingAllText = deepestBlockContain ingAllText(cluster->m_parent); 816 const RenderBlock* parentDeepestBlockContainingAllText = deepestBlockContain ingAllText(cluster->m_parent);
813 ASSERT(m_blocksThatHaveBegunLayout.contains(cluster->m_root)); 817 ASSERT(m_blocksThatHaveBegunLayout.contains(cluster->m_root));
814 ASSERT(m_blocksThatHaveBegunLayout.contains(parentDeepestBlockContainingAllT ext)); 818 ASSERT(m_blocksThatHaveBegunLayout.contains(parentDeepestBlockContainingAllT ext));
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
926 m_textAutosizer = 0; 930 m_textAutosizer = 0;
927 } 931 }
928 932
929 FastTextAutosizer::LayoutScope::~LayoutScope() 933 FastTextAutosizer::LayoutScope::~LayoutScope()
930 { 934 {
931 if (m_textAutosizer) 935 if (m_textAutosizer)
932 m_textAutosizer->endLayout(m_block); 936 m_textAutosizer->endLayout(m_block);
933 } 937 }
934 938
935 } // namespace WebCore 939 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698