Chromium Code Reviews| 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 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 Loading... | |
| 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 bool addEmptyRun = (end == start); |
|
eae
2015/01/15 20:07:07
The general approach seems fine, I have a hard tim
Daniel Bratell
2015/01/16 13:47:32
There is code that calls this with start == end an
| |
| 628 tracker.addFakeRunIfNecessary(obj, start, end, resolver); | 628 while (end > start || addEmptyRun) { |
| 629 else | 629 const int limit = USHRT_MAX; // Use a small number in Debug to keep the code well tested? |
| 630 resolver.runs().addRun(createRun(start, end, obj, resolver)); | 630 unsigned limitedEnd = end; |
| 631 if (end - start > limit) | |
| 632 limitedEnd = start + limit; | |
| 633 if (behavior == AppendingFakeRun) | |
| 634 tracker.addFakeRunIfNecessary(obj, start, limitedEnd, resolver); | |
| 635 else | |
| 636 resolver.runs().addRun(createRun(start, limitedEnd, obj, resolver)); | |
| 637 if (addEmptyRun) | |
| 638 break; | |
| 639 start = limitedEnd; | |
| 640 } | |
| 631 } | 641 } |
| 632 | 642 |
| 633 static void adjustMidpointsAndAppendRunsForObjectIfNeeded(RenderObject* obj, uns igned start, unsigned end, InlineBidiResolver& resolver, AppendRunBehavior behav ior, IsolateTracker& tracker) | 643 static void adjustMidpointsAndAppendRunsForObjectIfNeeded(RenderObject* obj, uns igned start, unsigned end, InlineBidiResolver& resolver, AppendRunBehavior behav ior, IsolateTracker& tracker) |
| 634 { | 644 { |
| 635 if (start > end || RenderBlockFlow::shouldSkipCreatingRunsForObject(obj)) | 645 if (start > end || RenderBlockFlow::shouldSkipCreatingRunsForObject(obj)) |
| 636 return; | 646 return; |
| 637 | 647 |
| 638 LineMidpointState& lineMidpointState = resolver.midpointState(); | 648 LineMidpointState& lineMidpointState = resolver.midpointState(); |
| 639 bool haveNextMidpoint = (lineMidpointState.currentMidpoint() < lineMidpointS tate.numMidpoints()); | 649 bool haveNextMidpoint = (lineMidpointState.currentMidpoint() < lineMidpointS tate.numMidpoints()); |
| 640 InlineIterator nextMidpoint; | 650 InlineIterator nextMidpoint; |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 722 m_sor = m_eor; | 732 m_sor = m_eor; |
| 723 } | 733 } |
| 724 | 734 |
| 725 m_direction = WTF::Unicode::OtherNeutral; | 735 m_direction = WTF::Unicode::OtherNeutral; |
| 726 m_status.eor = WTF::Unicode::OtherNeutral; | 736 m_status.eor = WTF::Unicode::OtherNeutral; |
| 727 } | 737 } |
| 728 | 738 |
| 729 } | 739 } |
| 730 | 740 |
| 731 #endif // InlineIterator_h | 741 #endif // InlineIterator_h |
| OLD | NEW |