| 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 564 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 Loading... |
| 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(¤tStyle); | 983 m_stylesRetainedDuringLayout.append(¤tStyle); |
| 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 Loading... |
| 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 |
| OLD | NEW |