Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(186)

Side by Side Diff: Source/core/rendering/line/BreakingContextInlineHeaders.h

Issue 890853002: Revert of text-combine should scale rather than fall back to none when wide (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/core/rendering/RenderCombineText.cpp ('k') | Source/core/rendering/line/LineBreaker.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
483 inline void nextCharacter(UChar& currentCharacter, UChar& lastCharacter, UChar& secondToLastCharacter) 488 inline void nextCharacter(UChar& currentCharacter, UChar& lastCharacter, UChar& secondToLastCharacter)
484 { 489 {
485 secondToLastCharacter = lastCharacter; 490 secondToLastCharacter = lastCharacter;
486 lastCharacter = currentCharacter; 491 lastCharacter = currentCharacter;
487 } 492 }
488 493
489 inline float firstPositiveWidth(const WordMeasurements& wordMeasurements) 494 inline float firstPositiveWidth(const WordMeasurements& wordMeasurements)
490 { 495 {
491 for (size_t i = 0; i < wordMeasurements.size(); ++i) { 496 for (size_t i = 0; i < wordMeasurements.size(); ++i) {
492 if (wordMeasurements[i].width > 0) 497 if (wordMeasurements[i].width > 0)
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
530 535
531 bool isSVGText = renderText->isSVGInlineText(); 536 bool isSVGText = renderText->isSVGInlineText();
532 537
533 // If we have left a no-wrap inline and entered an autowrap inline while ign oring spaces 538 // If we have left a no-wrap inline and entered an autowrap inline while ign oring spaces
534 // then we need to mark the start of the autowrap inline as a potential line break now. 539 // then we need to mark the start of the autowrap inline as a potential line break now.
535 if (m_autoWrap && !RenderStyle::autoWrap(m_lastWS) && m_ignoringSpaces) { 540 if (m_autoWrap && !RenderStyle::autoWrap(m_lastWS) && m_ignoringSpaces) {
536 m_width.commit(); 541 m_width.commit();
537 m_lineBreak.moveToStartOf(m_current.object()); 542 m_lineBreak.moveToStartOf(m_current.object());
538 } 543 }
539 544
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
540 RenderStyle* style = renderText->style(m_lineInfo.isFirstLine()); 556 RenderStyle* style = renderText->style(m_lineInfo.isFirstLine());
541 const Font& font = style->font(); 557 const Font& font = style->font();
542 bool isFixedPitch = font.isFixedPitch(); 558 bool isFixedPitch = font.isFixedPitch();
543 559
544 unsigned lastSpace = m_current.offset(); 560 unsigned lastSpace = m_current.offset();
545 float wordSpacing = m_currentStyle->wordSpacing(); 561 float wordSpacing = m_currentStyle->wordSpacing();
546 float lastSpaceWordSpacing = 0; 562 float lastSpaceWordSpacing = 0;
547 float wordSpacingForWordMeasurement = 0; 563 float wordSpacingForWordMeasurement = 0;
548 564
549 float wrapW = m_width.uncommittedWidth() + inlineLogicalWidth(m_current.obje ct(), !m_appliedStartWidth, true); 565 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
891 907
892 if (style->textIndentType() == TextIndentHanging) 908 if (style->textIndentType() == TextIndentHanging)
893 shouldIndentText = shouldIndentText == IndentText ? DoNotIndentText : In dentText; 909 shouldIndentText = shouldIndentText == IndentText ? DoNotIndentText : In dentText;
894 910
895 return shouldIndentText; 911 return shouldIndentText;
896 } 912 }
897 913
898 } 914 }
899 915
900 #endif // BreakingContextInlineHeaders_h 916 #endif // BreakingContextInlineHeaders_h
OLDNEW
« no previous file with comments | « Source/core/rendering/RenderCombineText.cpp ('k') | Source/core/rendering/line/LineBreaker.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698