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, 2009, 2010 Apple Inc. All right reserve
d. | 3 * Copyright (C) 2003, 2004, 2006, 2007, 2009, 2010 Apple Inc. |
| 4 * All right reserved. |
4 * | 5 * |
5 * This library is free software; you can redistribute it and/or | 6 * This library is free software; you can redistribute it and/or |
6 * modify it under the terms of the GNU Library General Public | 7 * modify it under the terms of the GNU Library General Public |
7 * License as published by the Free Software Foundation; either | 8 * License as published by the Free Software Foundation; either |
8 * 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. |
9 * | 10 * |
10 * This library is distributed in the hope that it will be useful, | 11 * This library is distributed in the hope that it will be useful, |
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 * Library General Public License for more details. | 14 * Library General Public License for more details. |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 unsigned char newLevel = parent ? parent->level() : 0; | 90 unsigned char newLevel = parent ? parent->level() : 0; |
90 if (context->dir() == RightToLeft) | 91 if (context->dir() == RightToLeft) |
91 newLevel = nextGreaterOddLevel(newLevel); | 92 newLevel = nextGreaterOddLevel(newLevel); |
92 else if (parent) | 93 else if (parent) |
93 newLevel = nextGreaterEvenLevel(newLevel); | 94 newLevel = nextGreaterEvenLevel(newLevel); |
94 | 95 |
95 return BidiContext::create(newLevel, context->dir(), context->override(), | 96 return BidiContext::create(newLevel, context->dir(), context->override(), |
96 context->source(), parent); | 97 context->source(), parent); |
97 } | 98 } |
98 | 99 |
99 // The BidiContext stack must be immutable -- they're re-used for re-layout afte
r | 100 // The BidiContext stack must be immutable -- they're re-used for re-layout |
100 // DOM modification/editing -- so we copy all the non-unicode contexts, and | 101 // after DOM modification/editing -- so we copy all the non-unicode contexts, |
101 // recalculate their levels. | 102 // and recalculate their levels. |
102 PassRefPtr<BidiContext> | 103 PassRefPtr<BidiContext> |
103 BidiContext::copyStackRemovingUnicodeEmbeddingContexts() { | 104 BidiContext::copyStackRemovingUnicodeEmbeddingContexts() { |
104 Vector<BidiContext*, 64> contexts; | 105 Vector<BidiContext*, 64> contexts; |
105 for (BidiContext* iter = this; iter; iter = iter->parent()) { | 106 for (BidiContext* iter = this; iter; iter = iter->parent()) { |
106 if (iter->source() != FromUnicode) | 107 if (iter->source() != FromUnicode) |
107 contexts.append(iter); | 108 contexts.append(iter); |
108 } | 109 } |
109 ASSERT(contexts.size()); | 110 ASSERT(contexts.size()); |
110 | 111 |
111 RefPtr<BidiContext> topContext = | 112 RefPtr<BidiContext> topContext = |
(...skipping 10 matching lines...) Expand all Loading... |
122 return true; | 123 return true; |
123 if (c1.level() != c2.level() || c1.override() != c2.override() || | 124 if (c1.level() != c2.level() || c1.override() != c2.override() || |
124 c1.dir() != c2.dir() || c1.source() != c2.source()) | 125 c1.dir() != c2.dir() || c1.source() != c2.source()) |
125 return false; | 126 return false; |
126 if (!c1.parent()) | 127 if (!c1.parent()) |
127 return !c2.parent(); | 128 return !c2.parent(); |
128 return c2.parent() && *c1.parent() == *c2.parent(); | 129 return c2.parent() && *c1.parent() == *c2.parent(); |
129 } | 130 } |
130 | 131 |
131 } // namespace blink | 132 } // namespace blink |
OLD | NEW |