| 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 566 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 577 } | 577 } |
| 578 renderer = renderer->nextInPreOrder(); | 578 renderer = renderer->nextInPreOrder(); |
| 579 } | 579 } |
| 580 } | 580 } |
| 581 | 581 |
| 582 void TextAutosizer::setAllTextNeedsLayout() | 582 void TextAutosizer::setAllTextNeedsLayout() |
| 583 { | 583 { |
| 584 LayoutObject* renderer = m_document->layoutView(); | 584 LayoutObject* renderer = m_document->layoutView(); |
| 585 while (renderer) { | 585 while (renderer) { |
| 586 if (renderer->isText()) | 586 if (renderer->isText()) |
| 587 renderer->setNeedsLayoutAndFullPaintInvalidation(); | 587 renderer->setNeedsLayoutAndFullPaintInvalidation(LayoutInvalidationR
eason::TextAutosizing); |
| 588 renderer = renderer->nextInPreOrder(); | 588 renderer = renderer->nextInPreOrder(); |
| 589 } | 589 } |
| 590 } | 590 } |
| 591 | 591 |
| 592 TextAutosizer::BlockFlags TextAutosizer::classifyBlock(const LayoutObject* rende
rer, BlockFlags mask) const | 592 TextAutosizer::BlockFlags TextAutosizer::classifyBlock(const LayoutObject* rende
rer, BlockFlags mask) const |
| 593 { | 593 { |
| 594 if (!renderer->isLayoutBlock()) | 594 if (!renderer->isLayoutBlock()) |
| 595 return 0; | 595 return 0; |
| 596 | 596 |
| 597 const LayoutBlock* block = toLayoutBlock(renderer); | 597 const LayoutBlock* block = toLayoutBlock(renderer); |
| (...skipping 380 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 978 style->setTextAutosizingMultiplier(multiplier); | 978 style->setTextAutosizingMultiplier(multiplier); |
| 979 style->setUnique(); | 979 style->setUnique(); |
| 980 | 980 |
| 981 switch (relayoutBehavior) { | 981 switch (relayoutBehavior) { |
| 982 case AlreadyInLayout: | 982 case AlreadyInLayout: |
| 983 // Don't free currentStyle until the end of the layout pass. This allows
other parts of the system | 983 // Don't free currentStyle until the end of the layout pass. This allows
other parts of the system |
| 984 // to safely hold raw LayoutStyle* pointers during layout, e.g. Breaking
Context::m_currentStyle. | 984 // to safely hold raw LayoutStyle* pointers during layout, e.g. Breaking
Context::m_currentStyle. |
| 985 m_stylesRetainedDuringLayout.append(¤tStyle); | 985 m_stylesRetainedDuringLayout.append(¤tStyle); |
| 986 | 986 |
| 987 renderer->setStyleInternal(style.release()); | 987 renderer->setStyleInternal(style.release()); |
| 988 renderer->setNeedsLayoutAndFullPaintInvalidation(); | 988 renderer->setNeedsLayoutAndFullPaintInvalidation(LayoutInvalidationReaso
n::TextAutosizing); |
| 989 break; | 989 break; |
| 990 | 990 |
| 991 case LayoutNeeded: | 991 case LayoutNeeded: |
| 992 renderer->setStyle(style.release()); | 992 renderer->setStyle(style.release()); |
| 993 break; | 993 break; |
| 994 } | 994 } |
| 995 | 995 |
| 996 if (multiplier != 1) | 996 if (multiplier != 1) |
| 997 m_pageInfo.m_hasAutosized = true; | 997 m_pageInfo.m_hasAutosized = true; |
| 998 } | 998 } |
| (...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1174 } | 1174 } |
| 1175 return computedSize; | 1175 return computedSize; |
| 1176 } | 1176 } |
| 1177 | 1177 |
| 1178 DEFINE_TRACE(TextAutosizer) | 1178 DEFINE_TRACE(TextAutosizer) |
| 1179 { | 1179 { |
| 1180 visitor->trace(m_document); | 1180 visitor->trace(m_document); |
| 1181 } | 1181 } |
| 1182 | 1182 |
| 1183 } // namespace blink | 1183 } // namespace blink |
| OLD | NEW |