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

Side by Side Diff: Source/core/rendering/InlineIterator.h

Issue 813133002: iter (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years 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
« no previous file with comments | « no previous file | Source/core/rendering/InlineTextBox.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 Apple Inc. All right r eserved. 3 * Copyright (C) 2003, 2004, 2006, 2007, 2008, 2009, 2010 Apple Inc. All right r eserved.
4 * Copyright (C) 2010 Google Inc. All rights reserved. 4 * Copyright (C) 2010 Google Inc. All rights reserved.
5 * 5 *
6 * This library is free software; you can redistribute it and/or 6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public 7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either 8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version. 9 * version 2 of the License, or (at your option) any later version.
10 * 10 *
(...skipping 466 matching lines...) Expand 10 before | Expand all | Expand 10 after
477 477
478 template <> 478 template <>
479 inline int InlineBidiResolver::findFirstTrailingSpaceAtRun(BidiRun* run) 479 inline int InlineBidiResolver::findFirstTrailingSpaceAtRun(BidiRun* run)
480 { 480 {
481 ASSERT(run); 481 ASSERT(run);
482 RenderObject* lastObject = run->m_object; 482 RenderObject* lastObject = run->m_object;
483 if (!lastObject->isText()) 483 if (!lastObject->isText())
484 return run->m_stop; 484 return run->m_stop;
485 485
486 RenderText* lastText = toRenderText(lastObject); 486 RenderText* lastText = toRenderText(lastObject);
487
488 // There can only be trailing space if the lastText node has two or more cod e-points.
489 if (lastText->textLength() <= 1)
490 return run->stop();
491
487 int firstSpace; 492 int firstSpace;
488 if (lastText->is8Bit()) 493 if (lastText->is8Bit())
489 firstSpace = findFirstTrailingSpace(lastText, lastText->characters8(), r un->start(), run->stop()); 494 firstSpace = findFirstTrailingSpace(lastText, lastText->characters8(), r un->start(), run->stop());
490 else 495 else
491 firstSpace = findFirstTrailingSpace(lastText, lastText->characters16(), run->start(), run->stop()); 496 firstSpace = findFirstTrailingSpace(lastText, lastText->characters16(), run->start(), run->stop());
492 return firstSpace; 497 return firstSpace;
493 } 498 }
494 499
495 template <> 500 template <>
496 inline BidiRun* InlineBidiResolver::addTrailingRun(BidiRunList<BidiRun>& runs, i nt start, int stop, BidiRun* run, BidiContext* context, TextDirection direction) const 501 inline BidiRun* InlineBidiResolver::addTrailingRun(BidiRunList<BidiRun>& runs, i nt start, int stop, BidiRun* run, BidiContext* context, TextDirection direction) const
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after
722 m_sor = m_eor; 727 m_sor = m_eor;
723 } 728 }
724 729
725 m_direction = WTF::Unicode::OtherNeutral; 730 m_direction = WTF::Unicode::OtherNeutral;
726 m_status.eor = WTF::Unicode::OtherNeutral; 731 m_status.eor = WTF::Unicode::OtherNeutral;
727 } 732 }
728 733
729 } 734 }
730 735
731 #endif // InlineIterator_h 736 #endif // InlineIterator_h
OLDNEW
« no previous file with comments | « no previous file | Source/core/rendering/InlineTextBox.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698