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 432 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
443 hasTextChild = true; | 443 hasTextChild = true; |
444 // We only calculate this multiplier on-demand to ensure the parent
block of this text | 444 // We only calculate this multiplier on-demand to ensure the parent
block of this text |
445 // has entered layout. | 445 // has entered layout. |
446 if (!multiplier) | 446 if (!multiplier) |
447 multiplier = cluster->m_flags & SUPPRESSING ? 1.0f : clusterMult
iplier(cluster); | 447 multiplier = cluster->m_flags & SUPPRESSING ? 1.0f : clusterMult
iplier(cluster); |
448 applyMultiplier(child, multiplier, layouter); | 448 applyMultiplier(child, multiplier, layouter); |
449 | 449 |
450 // FIXME: Investigate why MarkOnlyThis is sufficient. | 450 // FIXME: Investigate why MarkOnlyThis is sufficient. |
451 if (parent->isLayoutInline()) | 451 if (parent->isLayoutInline()) |
452 child->setPreferredLogicalWidthsDirty(MarkOnlyThis); | 452 child->setPreferredLogicalWidthsDirty(MarkOnlyThis); |
453 } else if (child->isLayoutInline()) { | 453 } else if (child->isLayoutInline() && behavior == DescendToInnerBlocks)
{ |
454 multiplier = inflate(child, layouter, behavior, multiplier); | 454 multiplier = inflate(child, layouter, behavior, multiplier); |
455 } else if (child->isLayoutBlock() && behavior == DescendToInnerBlocks | 455 } else if (child->isLayoutBlock() && behavior == DescendToInnerBlocks |
456 && !classifyBlock(child, INDEPENDENT | EXPLICIT_WIDTH | SUPPRESSING)
) { | 456 && !classifyBlock(child, INDEPENDENT | EXPLICIT_WIDTH | SUPPRESSING)
) { |
457 multiplier = inflate(child, layouter, behavior, multiplier); | 457 multiplier = inflate(child, layouter, behavior, multiplier); |
458 } | 458 } |
459 child = child->nextSibling(); | 459 child = child->nextSibling(); |
460 } | 460 } |
461 | 461 |
462 if (hasTextChild) { | 462 if (hasTextChild) { |
463 applyMultiplier(parent, multiplier, layouter); // Parent handles line sp
acing. | 463 applyMultiplier(parent, multiplier, layouter); // Parent handles line sp
acing. |
(...skipping 724 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1188 } | 1188 } |
1189 return computedSize; | 1189 return computedSize; |
1190 } | 1190 } |
1191 | 1191 |
1192 DEFINE_TRACE(TextAutosizer) | 1192 DEFINE_TRACE(TextAutosizer) |
1193 { | 1193 { |
1194 visitor->trace(m_document); | 1194 visitor->trace(m_document); |
1195 } | 1195 } |
1196 | 1196 |
1197 } // namespace blink | 1197 } // namespace blink |
OLD | NEW |