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, 2011 Apple Inc. | 3 * Copyright (C) 2003, 2004, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. |
4 * All right reserved. | 4 * All right reserved. |
5 * Copyright (C) 2010 Google Inc. All rights reserved. | 5 * Copyright (C) 2010 Google Inc. All rights reserved. |
6 * | 6 * |
7 * This library is free software; you can redistribute it and/or | 7 * This library is free software; you can redistribute it and/or |
8 * modify it under the terms of the GNU Library General Public | 8 * modify it under the terms of the GNU Library General Public |
9 * License as published by the Free Software Foundation; either | 9 * License as published by the Free Software Foundation; either |
10 * version 2 of the License, or (at your option) any later version. | 10 * version 2 of the License, or (at your option) any later version. |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
133 VisualDirectionOverride override, bool previousLineBrokeCleanly, | 133 VisualDirectionOverride override, bool previousLineBrokeCleanly, |
134 bool isNewUBAParagraph) | 134 bool isNewUBAParagraph) |
135 { | 135 { |
136 // FIXME: We should pass a BidiRunList into createBidiRunsForLine instead | 136 // FIXME: We should pass a BidiRunList into createBidiRunsForLine instead |
137 // of the resolver owning the runs. | 137 // of the resolver owning the runs. |
138 ASSERT(&topResolver.runs() == &bidiRuns); | 138 ASSERT(&topResolver.runs() == &bidiRuns); |
139 ASSERT(topResolver.position() != endOfLine); | 139 ASSERT(topResolver.position() != endOfLine); |
140 LayoutObject* currentRoot = topResolver.position().root(); | 140 LayoutObject* currentRoot = topResolver.position().root(); |
141 topResolver.createBidiRunsForLine(endOfLine, override, | 141 topResolver.createBidiRunsForLine(endOfLine, override, |
142 previousLineBrokeCleanly); | 142 previousLineBrokeCleanly); |
143 struct BidiRunsWithRoot { | |
144 LayoutObject* root; | |
eae
2015/09/04 18:31:56
Could you mark this const?
| |
145 Vector<BidiRun*> isolatedRuns; | |
146 }; | |
147 Vector<BidiRunsWithRoot> isolatedRunsStack; | |
143 | 148 |
144 while (!topResolver.isolatedRuns().isEmpty()) { | 149 while (true) { |
150 if (topResolver.isolatedRuns().isEmpty()) { | |
151 if (isolatedRunsStack.isEmpty()) | |
152 break; | |
153 topResolver.isolatedRuns().appendVector(isolatedRunsStack.last().iso latedRuns); | |
154 ASSERT(!topResolver.isolatedRuns().isEmpty()); | |
155 currentRoot = isolatedRunsStack.last().root; | |
156 isolatedRunsStack.removeLast(); | |
157 } | |
158 | |
145 // It does not matter which order we resolve the runs as long as we | 159 // It does not matter which order we resolve the runs as long as we |
146 // resolve them all. | 160 // resolve them all. |
147 BidiRun* isolatedRun = topResolver.isolatedRuns().last(); | 161 BidiRun* isolatedRun = topResolver.isolatedRuns().last(); |
148 topResolver.isolatedRuns().removeLast(); | 162 topResolver.isolatedRuns().removeLast(); |
149 | 163 |
150 LayoutObject* startObj = isolatedRun->object(); | 164 LayoutObject* startObj = isolatedRun->object(); |
151 | 165 |
152 // Only inlines make sense with unicode-bidi: isolate (blocks are | 166 // Only inlines make sense with unicode-bidi: isolate (blocks are |
153 // already isolated). | 167 // already isolated). |
154 // FIXME: Because enterIsolate is not passed a LayoutObject, we have to | 168 // FIXME: Because enterIsolate is not passed a LayoutObject, we have to |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
192 // FIXME: What should end and previousLineBrokeCleanly be? | 206 // FIXME: What should end and previousLineBrokeCleanly be? |
193 // rniwa says previousLineBrokeCleanly is just a WinIE hack and could | 207 // rniwa says previousLineBrokeCleanly is just a WinIE hack and could |
194 // always be false here? | 208 // always be false here? |
195 isolatedResolver.createBidiRunsForLine(endOfLine, NoVisualOverride, | 209 isolatedResolver.createBidiRunsForLine(endOfLine, NoVisualOverride, |
196 previousLineBrokeCleanly); | 210 previousLineBrokeCleanly); |
197 | 211 |
198 ASSERT(isolatedResolver.runs().runCount()); | 212 ASSERT(isolatedResolver.runs().runCount()); |
199 if (isolatedResolver.runs().runCount()) | 213 if (isolatedResolver.runs().runCount()) |
200 bidiRuns.replaceRunWithRuns(isolatedRun, isolatedResolver.runs()); | 214 bidiRuns.replaceRunWithRuns(isolatedRun, isolatedResolver.runs()); |
201 | 215 |
202 // If we encountered any nested isolate runs, just move them | 216 // If we encountered any nested isolate runs, save them for later |
203 // to the top resolver's list for later processing. | 217 // processing. |
204 if (!isolatedResolver.isolatedRuns().isEmpty()) { | 218 if (!isolatedResolver.isolatedRuns().isEmpty()) { |
205 topResolver.isolatedRuns().appendVector( | 219 isolatedRunsStack.resize(isolatedRunsStack.size() + 1); |
220 isolatedRunsStack.last().isolatedRuns.appendVector( | |
206 isolatedResolver.isolatedRuns()); | 221 isolatedResolver.isolatedRuns()); |
207 currentRoot = isolatedInline; | 222 isolatedRunsStack.last().root = isolatedInline; |
208 restoreIsolatedMidpointStates(topResolver, isolatedResolver); | 223 restoreIsolatedMidpointStates(topResolver, isolatedResolver); |
209 } | 224 } |
210 } | 225 } |
211 } | 226 } |
212 | 227 |
213 } // namespace blink | 228 } // namespace blink |
214 | 229 |
215 #endif // BidiRunForLine_h | 230 #endif // BidiRunForLine_h |
OLD | NEW |