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

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

Issue 853903002: Render string sequences of more than 64k characters. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Documentation. Created 5 years, 11 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
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 606 matching lines...) Expand 10 before | Expand all | Expand 10 after
617 617
618 private: 618 private:
619 unsigned m_nestedIsolateCount; 619 unsigned m_nestedIsolateCount;
620 bool m_haveAddedFakeRunForRootIsolate; 620 bool m_haveAddedFakeRunForRootIsolate;
621 LineMidpointState m_midpointStateForRootIsolate; 621 LineMidpointState m_midpointStateForRootIsolate;
622 BidiRunList<BidiRun>& m_runs; 622 BidiRunList<BidiRun>& m_runs;
623 }; 623 };
624 624
625 static void inline appendRunObjectIfNecessary(RenderObject* obj, unsigned start, unsigned end, InlineBidiResolver& resolver, AppendRunBehavior behavior, Isolate Tracker& tracker) 625 static void inline appendRunObjectIfNecessary(RenderObject* obj, unsigned start, unsigned end, InlineBidiResolver& resolver, AppendRunBehavior behavior, Isolate Tracker& tracker)
626 { 626 {
627 if (behavior == AppendingFakeRun) 627 // Trailing space code creates empty BidiRun objects, start == end, so
628 tracker.addFakeRunIfNecessary(obj, start, end, resolver); 628 // that case needs to be handled specifically.
629 else 629 bool addEmptyRun = (end == start);
630 resolver.runs().addRun(createRun(start, end, obj, resolver)); 630
631 // Append BidiRun objects, at most 64K chars at a time, until all
632 // text between |start| and |end| is represented.
633 while (end > start || addEmptyRun) {
634 addEmptyRun = false;
635 const int limit = USHRT_MAX; // InlineTextBox stores text length as unsi gned short.
636 unsigned limitedEnd = end;
637 if (end - start > limit)
638 limitedEnd = start + limit;
639 if (behavior == AppendingFakeRun)
640 tracker.addFakeRunIfNecessary(obj, start, limitedEnd, resolver);
641 else
642 resolver.runs().addRun(createRun(start, limitedEnd, obj, resolver));
643 start = limitedEnd;
644 }
631 } 645 }
632 646
633 static void adjustMidpointsAndAppendRunsForObjectIfNeeded(RenderObject* obj, uns igned start, unsigned end, InlineBidiResolver& resolver, AppendRunBehavior behav ior, IsolateTracker& tracker) 647 static void adjustMidpointsAndAppendRunsForObjectIfNeeded(RenderObject* obj, uns igned start, unsigned end, InlineBidiResolver& resolver, AppendRunBehavior behav ior, IsolateTracker& tracker)
634 { 648 {
635 if (start > end || RenderBlockFlow::shouldSkipCreatingRunsForObject(obj)) 649 if (start > end || RenderBlockFlow::shouldSkipCreatingRunsForObject(obj))
636 return; 650 return;
637 651
638 LineMidpointState& lineMidpointState = resolver.midpointState(); 652 LineMidpointState& lineMidpointState = resolver.midpointState();
639 bool haveNextMidpoint = (lineMidpointState.currentMidpoint() < lineMidpointS tate.numMidpoints()); 653 bool haveNextMidpoint = (lineMidpointState.currentMidpoint() < lineMidpointS tate.numMidpoints());
640 InlineIterator nextMidpoint; 654 InlineIterator nextMidpoint;
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
722 m_sor = m_eor; 736 m_sor = m_eor;
723 } 737 }
724 738
725 m_direction = WTF::Unicode::OtherNeutral; 739 m_direction = WTF::Unicode::OtherNeutral;
726 m_status.eor = WTF::Unicode::OtherNeutral; 740 m_status.eor = WTF::Unicode::OtherNeutral;
727 } 741 }
728 742
729 } 743 }
730 744
731 #endif // InlineIterator_h 745 #endif // InlineIterator_h
OLDNEW
« no previous file with comments | « LayoutTests/fast/text/wide-preformatted-expected.html ('k') | Source/platform/text/BidiResolver.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698