| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2000 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 2000 Lars Knoll (knoll@kde.org) |
| 3 * Copyright (C) 2003, 2004, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r
ight reserved. | 3 * Copyright (C) 2003, 2004, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r
ight reserved. |
| 4 * Copyright (C) 2010 Google Inc. All rights reserved. | 4 * Copyright (C) 2010 Google Inc. All rights reserved. |
| 5 * Copyright (C) 2013 Adobe Systems Incorporated. | 5 * Copyright (C) 2013 Adobe Systems Incorporated. |
| 6 * | 6 * |
| 7 * This library is free software; you can redistribute it and/or | 7 * This library is free software; you can redistribute it and/or |
| 8 * modify it under the terms of the GNU Library General Public | 8 * modify it under the terms of the GNU Library General Public |
| 9 * License as published by the Free Software Foundation; either | 9 * License as published by the Free Software Foundation; either |
| 10 * version 2 of the License, or (at your option) any later version. | 10 * version 2 of the License, or (at your option) any later version. |
| (...skipping 462 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 473 m_width.addUncommittedWidth(replacedLogicalWidth.toFloat()); | 473 m_width.addUncommittedWidth(replacedLogicalWidth.toFloat()); |
| 474 } else { | 474 } else { |
| 475 m_width.addUncommittedWidth(replacedLogicalWidth.toFloat()); | 475 m_width.addUncommittedWidth(replacedLogicalWidth.toFloat()); |
| 476 } | 476 } |
| 477 if (m_current.object()->isRubyRun()) | 477 if (m_current.object()->isRubyRun()) |
| 478 m_width.applyOverhang(toLayoutRubyRun(m_current.object()), m_lastObject,
m_nextObject); | 478 m_width.applyOverhang(toLayoutRubyRun(m_current.object()), m_lastObject,
m_nextObject); |
| 479 // Update prior line break context characters, using U+FFFD (OBJECT REPLACEM
ENT CHARACTER) for replaced element. | 479 // Update prior line break context characters, using U+FFFD (OBJECT REPLACEM
ENT CHARACTER) for replaced element. |
| 480 m_renderTextInfo.m_lineBreakIterator.updatePriorContext(replacementCharacter
); | 480 m_renderTextInfo.m_lineBreakIterator.updatePriorContext(replacementCharacter
); |
| 481 } | 481 } |
| 482 | 482 |
| 483 inline bool iteratorIsBeyondEndOfRenderCombineText(const InlineIterator& iter, R
enderCombineText* renderer) | |
| 484 { | |
| 485 return iter.object() == renderer && iter.offset() >= renderer->textLength(); | |
| 486 } | |
| 487 | |
| 488 inline void nextCharacter(UChar& currentCharacter, UChar& lastCharacter, UChar&
secondToLastCharacter) | 483 inline void nextCharacter(UChar& currentCharacter, UChar& lastCharacter, UChar&
secondToLastCharacter) |
| 489 { | 484 { |
| 490 secondToLastCharacter = lastCharacter; | 485 secondToLastCharacter = lastCharacter; |
| 491 lastCharacter = currentCharacter; | 486 lastCharacter = currentCharacter; |
| 492 } | 487 } |
| 493 | 488 |
| 494 inline float firstPositiveWidth(const WordMeasurements& wordMeasurements) | 489 inline float firstPositiveWidth(const WordMeasurements& wordMeasurements) |
| 495 { | 490 { |
| 496 for (size_t i = 0; i < wordMeasurements.size(); ++i) { | 491 for (size_t i = 0; i < wordMeasurements.size(); ++i) { |
| 497 if (wordMeasurements[i].width > 0) | 492 if (wordMeasurements[i].width > 0) |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 535 | 530 |
| 536 bool isSVGText = renderText->isSVGInlineText(); | 531 bool isSVGText = renderText->isSVGInlineText(); |
| 537 | 532 |
| 538 // If we have left a no-wrap inline and entered an autowrap inline while ign
oring spaces | 533 // If we have left a no-wrap inline and entered an autowrap inline while ign
oring spaces |
| 539 // then we need to mark the start of the autowrap inline as a potential line
break now. | 534 // then we need to mark the start of the autowrap inline as a potential line
break now. |
| 540 if (m_autoWrap && !RenderStyle::autoWrap(m_lastWS) && m_ignoringSpaces) { | 535 if (m_autoWrap && !RenderStyle::autoWrap(m_lastWS) && m_ignoringSpaces) { |
| 541 m_width.commit(); | 536 m_width.commit(); |
| 542 m_lineBreak.moveToStartOf(m_current.object()); | 537 m_lineBreak.moveToStartOf(m_current.object()); |
| 543 } | 538 } |
| 544 | 539 |
| 545 if (renderText->style()->hasTextCombine() && m_current.object()->isCombineTe
xt() && !toRenderCombineText(m_current.object())->isCombined()) { | |
| 546 RenderCombineText* combineRenderer = toRenderCombineText(m_current.objec
t()); | |
| 547 combineRenderer->combineText(); | |
| 548 // The length of the renderer's text may have changed. Increment stale i
terator positions | |
| 549 if (iteratorIsBeyondEndOfRenderCombineText(m_lineBreak, combineRenderer)
) { | |
| 550 ASSERT(iteratorIsBeyondEndOfRenderCombineText(m_resolver.position(),
combineRenderer)); | |
| 551 m_lineBreak.increment(); | |
| 552 m_resolver.position().increment(&m_resolver); | |
| 553 } | |
| 554 } | |
| 555 | |
| 556 RenderStyle* style = renderText->style(m_lineInfo.isFirstLine()); | 540 RenderStyle* style = renderText->style(m_lineInfo.isFirstLine()); |
| 557 const Font& font = style->font(); | 541 const Font& font = style->font(); |
| 558 bool isFixedPitch = font.isFixedPitch(); | 542 bool isFixedPitch = font.isFixedPitch(); |
| 559 | 543 |
| 560 unsigned lastSpace = m_current.offset(); | 544 unsigned lastSpace = m_current.offset(); |
| 561 float wordSpacing = m_currentStyle->wordSpacing(); | 545 float wordSpacing = m_currentStyle->wordSpacing(); |
| 562 float lastSpaceWordSpacing = 0; | 546 float lastSpaceWordSpacing = 0; |
| 563 float wordSpacingForWordMeasurement = 0; | 547 float wordSpacingForWordMeasurement = 0; |
| 564 | 548 |
| 565 float wrapW = m_width.uncommittedWidth() + inlineLogicalWidth(m_current.obje
ct(), !m_appliedStartWidth, true); | 549 float wrapW = m_width.uncommittedWidth() + inlineLogicalWidth(m_current.obje
ct(), !m_appliedStartWidth, true); |
| (...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 907 | 891 |
| 908 if (style->textIndentType() == TextIndentHanging) | 892 if (style->textIndentType() == TextIndentHanging) |
| 909 shouldIndentText = shouldIndentText == IndentText ? DoNotIndentText : In
dentText; | 893 shouldIndentText = shouldIndentText == IndentText ? DoNotIndentText : In
dentText; |
| 910 | 894 |
| 911 return shouldIndentText; | 895 return shouldIndentText; |
| 912 } | 896 } |
| 913 | 897 |
| 914 } | 898 } |
| 915 | 899 |
| 916 #endif // BreakingContextInlineHeaders_h | 900 #endif // BreakingContextInlineHeaders_h |
| OLD | NEW |