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

Side by Side Diff: Source/core/layout/TextAutosizer.cpp

Issue 1025213002: Begin tracking why layout is invalidated (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase Created 5 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 564 matching lines...) Expand 10 before | Expand all | Expand 10 after
575 } 575 }
576 renderer = renderer->nextInPreOrder(); 576 renderer = renderer->nextInPreOrder();
577 } 577 }
578 } 578 }
579 579
580 void TextAutosizer::setAllTextNeedsLayout() 580 void TextAutosizer::setAllTextNeedsLayout()
581 { 581 {
582 LayoutObject* renderer = m_document->layoutView(); 582 LayoutObject* renderer = m_document->layoutView();
583 while (renderer) { 583 while (renderer) {
584 if (renderer->isText()) 584 if (renderer->isText())
585 renderer->setNeedsLayoutAndFullPaintInvalidation(); 585 renderer->setNeedsLayoutAndFullPaintInvalidation(LayoutInvalidationR eason::TextAutosizing);
586 renderer = renderer->nextInPreOrder(); 586 renderer = renderer->nextInPreOrder();
587 } 587 }
588 } 588 }
589 589
590 TextAutosizer::BlockFlags TextAutosizer::classifyBlock(const LayoutObject* rende rer, BlockFlags mask) const 590 TextAutosizer::BlockFlags TextAutosizer::classifyBlock(const LayoutObject* rende rer, BlockFlags mask) const
591 { 591 {
592 if (!renderer->isLayoutBlock()) 592 if (!renderer->isLayoutBlock())
593 return 0; 593 return 0;
594 594
595 const LayoutBlock* block = toLayoutBlock(renderer); 595 const LayoutBlock* block = toLayoutBlock(renderer);
(...skipping 380 matching lines...) Expand 10 before | Expand all | Expand 10 after
976 style->setTextAutosizingMultiplier(multiplier); 976 style->setTextAutosizingMultiplier(multiplier);
977 style->setUnique(); 977 style->setUnique();
978 978
979 switch (relayoutBehavior) { 979 switch (relayoutBehavior) {
980 case AlreadyInLayout: 980 case AlreadyInLayout:
981 // Don't free currentStyle until the end of the layout pass. This allows other parts of the system 981 // Don't free currentStyle until the end of the layout pass. This allows other parts of the system
982 // to safely hold raw ComputedStyle* pointers during layout, e.g. Breaki ngContext::m_currentStyle. 982 // to safely hold raw ComputedStyle* pointers during layout, e.g. Breaki ngContext::m_currentStyle.
983 m_stylesRetainedDuringLayout.append(&currentStyle); 983 m_stylesRetainedDuringLayout.append(&currentStyle);
984 984
985 renderer->setStyleInternal(style.release()); 985 renderer->setStyleInternal(style.release());
986 renderer->setNeedsLayoutAndFullPaintInvalidation(); 986 renderer->setNeedsLayoutAndFullPaintInvalidation(LayoutInvalidationReaso n::TextAutosizing);
987 break; 987 break;
988 988
989 case LayoutNeeded: 989 case LayoutNeeded:
990 renderer->setStyle(style.release()); 990 renderer->setStyle(style.release());
991 break; 991 break;
992 } 992 }
993 993
994 if (multiplier != 1) 994 if (multiplier != 1)
995 m_pageInfo.m_hasAutosized = true; 995 m_pageInfo.m_hasAutosized = true;
996 } 996 }
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after
1172 } 1172 }
1173 return computedSize; 1173 return computedSize;
1174 } 1174 }
1175 1175
1176 DEFINE_TRACE(TextAutosizer) 1176 DEFINE_TRACE(TextAutosizer)
1177 { 1177 {
1178 visitor->trace(m_document); 1178 visitor->trace(m_document);
1179 } 1179 }
1180 1180
1181 } // namespace blink 1181 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/layout/SubtreeLayoutScope.cpp ('k') | Source/core/layout/svg/LayoutSVGInlineText.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698