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 Apple Inc. All right reserved. | 3 * Copyright (C) 2003, 2004, 2006, 2007, 2008 Apple Inc. All right reserved. |
| 4 * | 4 * |
| 5 * This library is free software; you can redistribute it and/or | 5 * This library is free software; you can redistribute it and/or |
| 6 * modify it under the terms of the GNU Library General Public | 6 * modify it under the terms of the GNU Library General Public |
| 7 * License as published by the Free Software Foundation; either | 7 * License as published by the Free Software Foundation; either |
| 8 * version 2 of the License, or (at your option) any later version. | 8 * version 2 of the License, or (at your option) any later version. |
| 9 * | 9 * |
| 10 * This library is distributed in the hope that it will be useful, | 10 * This library is distributed in the hope that it will be useful, |
| (...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 212 // The current algorithm handles nested isolates one layer of nesting at a t ime. | 212 // The current algorithm handles nested isolates one layer of nesting at a t ime. |
| 213 // But when we layout each isolated span, we will walk into (and ignore) all | 213 // But when we layout each isolated span, we will walk into (and ignore) all |
| 214 // child isolated spans. | 214 // child isolated spans. |
| 215 void enterIsolate() { m_nestedIsolateCount++; } | 215 void enterIsolate() { m_nestedIsolateCount++; } |
| 216 void exitIsolate() { ASSERT(m_nestedIsolateCount >= 1); m_nestedIsolateCount --; } | 216 void exitIsolate() { ASSERT(m_nestedIsolateCount >= 1); m_nestedIsolateCount --; } |
| 217 bool inIsolate() const { return m_nestedIsolateCount; } | 217 bool inIsolate() const { return m_nestedIsolateCount; } |
| 218 | 218 |
| 219 void embed(WTF::Unicode::Direction, BidiEmbeddingSource); | 219 void embed(WTF::Unicode::Direction, BidiEmbeddingSource); |
| 220 bool commitExplicitEmbedding(); | 220 bool commitExplicitEmbedding(); |
| 221 | 221 |
| 222 void createBidiRunsForLine(const Iterator& end, VisualDirectionOverride = No VisualOverride, bool hardLineBreak = false); | 222 void createBidiRunsForLine(const Iterator& end, VisualDirectionOverride = No VisualOverride, bool hardLineBreak = false, bool reorderRuns = true); |
|
leviw_travelin_and_unemployed
2014/01/09 00:49:54
Boolean params make me sad. It'd be great if we co
| |
| 223 | 223 |
| 224 BidiRunList<Run>& runs() { return m_runs; } | 224 BidiRunList<Run>& runs() { return m_runs; } |
| 225 | 225 |
| 226 // FIXME: This used to be part of deleteRuns() but was a layering violation. | 226 // FIXME: This used to be part of deleteRuns() but was a layering violation. |
| 227 // It's unclear if this is still needed. | 227 // It's unclear if this is still needed. |
| 228 void markCurrentRunEmpty() { m_emptyRun = true; } | 228 void markCurrentRunEmpty() { m_emptyRun = true; } |
| 229 | 229 |
| 230 Vector<Run*>& isolatedRuns() { return m_isolatedRuns; } | 230 Vector<Run*>& isolatedRuns() { return m_isolatedRuns; } |
| 231 | 231 |
| 232 bool isEndOfLine(const Iterator& end) { return m_current == end || m_current .atEnd(); } | 232 bool isEndOfLine(const Iterator& end) { return m_current == end || m_current .atEnd(); } |
| (...skipping 395 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 628 return RTL; | 628 return RTL; |
| 629 } | 629 } |
| 630 increment(); | 630 increment(); |
| 631 } | 631 } |
| 632 if (hasStrongDirectionality) | 632 if (hasStrongDirectionality) |
| 633 *hasStrongDirectionality = false; | 633 *hasStrongDirectionality = false; |
| 634 return LTR; | 634 return LTR; |
| 635 } | 635 } |
| 636 | 636 |
| 637 template <class Iterator, class Run> | 637 template <class Iterator, class Run> |
| 638 void BidiResolver<Iterator, Run>::createBidiRunsForLine(const Iterator& end, Vis ualDirectionOverride override, bool hardLineBreak) | 638 void BidiResolver<Iterator, Run>::createBidiRunsForLine(const Iterator& end, Vis ualDirectionOverride override, bool hardLineBreak, bool reorderRuns) |
| 639 { | 639 { |
| 640 using namespace WTF::Unicode; | 640 using namespace WTF::Unicode; |
| 641 | 641 |
| 642 ASSERT(m_direction == OtherNeutral); | 642 ASSERT(m_direction == OtherNeutral); |
| 643 m_trailingSpaceRun = 0; | 643 m_trailingSpaceRun = 0; |
| 644 | 644 |
| 645 m_endOfLine = end; | 645 m_endOfLine = end; |
| 646 | 646 |
| 647 if (override != NoVisualOverride) { | 647 if (override != NoVisualOverride) { |
| 648 m_emptyRun = false; | 648 m_emptyRun = false; |
| (...skipping 378 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1027 m_reachedEndOfLine = stateAtEnd.m_reachedEndOfLine; | 1027 m_reachedEndOfLine = stateAtEnd.m_reachedEndOfLine; |
| 1028 m_lastBeforeET = stateAtEnd.m_lastBeforeET; | 1028 m_lastBeforeET = stateAtEnd.m_lastBeforeET; |
| 1029 m_emptyRun = stateAtEnd.m_emptyRun; | 1029 m_emptyRun = stateAtEnd.m_emptyRun; |
| 1030 m_direction = OtherNeutral; | 1030 m_direction = OtherNeutral; |
| 1031 break; | 1031 break; |
| 1032 } | 1032 } |
| 1033 } | 1033 } |
| 1034 } | 1034 } |
| 1035 | 1035 |
| 1036 m_runs.setLogicallyLastRun(m_runs.lastRun()); | 1036 m_runs.setLogicallyLastRun(m_runs.lastRun()); |
| 1037 reorderRunsFromLevels(); | 1037 if (reorderRuns) |
| 1038 reorderRunsFromLevels(); | |
| 1038 m_endOfRunAtEndOfLine = Iterator(); | 1039 m_endOfRunAtEndOfLine = Iterator(); |
| 1039 m_endOfLine = Iterator(); | 1040 m_endOfLine = Iterator(); |
| 1040 | 1041 |
| 1041 if (!hardLineBreak && m_runs.runCount()) | 1042 if (!hardLineBreak && m_runs.runCount()) |
| 1042 applyL1Rule(); | 1043 applyL1Rule(); |
| 1043 } | 1044 } |
| 1044 | 1045 |
| 1045 template <class Iterator, class Run> | 1046 template <class Iterator, class Run> |
| 1046 void BidiResolver<Iterator, Run>::setMidpointStateForIsolatedRun(Run* run, const MidpointState<Iterator>& midpoint) | 1047 void BidiResolver<Iterator, Run>::setMidpointStateForIsolatedRun(Run* run, const MidpointState<Iterator>& midpoint) |
| 1047 { | 1048 { |
| 1048 ASSERT(!m_midpointStateForIsolatedRun.contains(run)); | 1049 ASSERT(!m_midpointStateForIsolatedRun.contains(run)); |
| 1049 m_midpointStateForIsolatedRun.add(run, midpoint); | 1050 m_midpointStateForIsolatedRun.add(run, midpoint); |
| 1050 } | 1051 } |
| 1051 | 1052 |
| 1052 template<class Iterator, class Run> | 1053 template<class Iterator, class Run> |
| 1053 MidpointState<Iterator> BidiResolver<Iterator, Run>::midpointStateForIsolatedRun (Run* run) | 1054 MidpointState<Iterator> BidiResolver<Iterator, Run>::midpointStateForIsolatedRun (Run* run) |
| 1054 { | 1055 { |
| 1055 return m_midpointStateForIsolatedRun.take(run); | 1056 return m_midpointStateForIsolatedRun.take(run); |
| 1056 } | 1057 } |
| 1057 | 1058 |
| 1058 | 1059 |
| 1059 } // namespace WebCore | 1060 } // namespace WebCore |
| 1060 | 1061 |
| 1061 #endif // BidiResolver_h | 1062 #endif // BidiResolver_h |
| OLD | NEW |