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 1145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1156 // Unlike text-size-adjust, the text autosizer should only inflate fonts. | 1156 // Unlike text-size-adjust, the text autosizer should only inflate fonts. |
1157 multiplier = 1; | 1157 multiplier = 1; |
1158 } | 1158 } |
1159 | 1159 |
1160 if (currentStyle.textAutosizingMultiplier() == multiplier) | 1160 if (currentStyle.textAutosizingMultiplier() == multiplier) |
1161 return; | 1161 return; |
1162 | 1162 |
1163 // We need to clone the layoutObject style to avoid breaking style sharing. | 1163 // We need to clone the layoutObject style to avoid breaking style sharing. |
1164 RefPtr<ComputedStyle> style = ComputedStyle::clone(currentStyle); | 1164 RefPtr<ComputedStyle> style = ComputedStyle::clone(currentStyle); |
1165 style->setTextAutosizingMultiplier(multiplier); | 1165 style->setTextAutosizingMultiplier(multiplier); |
1166 style->setUnique(); | 1166 style->setUnique(true); |
1167 | 1167 |
1168 switch (relayoutBehavior) { | 1168 switch (relayoutBehavior) { |
1169 case AlreadyInLayout: | 1169 case AlreadyInLayout: |
1170 // Don't free currentStyle until the end of the layout pass. This allows | 1170 // Don't free currentStyle until the end of the layout pass. This allows |
1171 // other parts of the system to safely hold raw ComputedStyle* pointers | 1171 // other parts of the system to safely hold raw ComputedStyle* pointers |
1172 // during layout, e.g. BreakingContext::m_currentStyle. | 1172 // during layout, e.g. BreakingContext::m_currentStyle. |
1173 m_stylesRetainedDuringLayout.push_back(¤tStyle); | 1173 m_stylesRetainedDuringLayout.push_back(¤tStyle); |
1174 | 1174 |
1175 layoutObject->setStyleInternal(std::move(style)); | 1175 layoutObject->setStyleInternal(std::move(style)); |
1176 DCHECK(!layouter || layoutObject->isDescendantOf(&layouter->root())); | 1176 DCHECK(!layouter || layoutObject->isDescendantOf(&layouter->root())); |
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1431 } | 1431 } |
1432 } | 1432 } |
1433 potentiallyInconsistentSuperclusters.clear(); | 1433 potentiallyInconsistentSuperclusters.clear(); |
1434 } | 1434 } |
1435 | 1435 |
1436 DEFINE_TRACE(TextAutosizer) { | 1436 DEFINE_TRACE(TextAutosizer) { |
1437 visitor->trace(m_document); | 1437 visitor->trace(m_document); |
1438 } | 1438 } |
1439 | 1439 |
1440 } // namespace blink | 1440 } // namespace blink |
OLD | NEW |