| 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 318 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 329 { | 329 { |
| 330 if (!m_emptyRun && !m_eor.atEnd()) { | 330 if (!m_emptyRun && !m_eor.atEnd()) { |
| 331 unsigned startOffset = m_sor.offset(); | 331 unsigned startOffset = m_sor.offset(); |
| 332 unsigned endOffset = m_eor.offset(); | 332 unsigned endOffset = m_eor.offset(); |
| 333 | 333 |
| 334 if (!m_endOfRunAtEndOfLine.atEnd() && endOffset >= m_endOfRunAtEndOfLine
.offset()) { | 334 if (!m_endOfRunAtEndOfLine.atEnd() && endOffset >= m_endOfRunAtEndOfLine
.offset()) { |
| 335 m_reachedEndOfLine = true; | 335 m_reachedEndOfLine = true; |
| 336 endOffset = m_endOfRunAtEndOfLine.offset(); | 336 endOffset = m_endOfRunAtEndOfLine.offset(); |
| 337 } | 337 } |
| 338 | 338 |
| 339 if (endOffset >= startOffset) | 339 // m_eor and m_endOfRunAtEndOfLine are inclusive while BidiRun's stop is |
| 340 runs.addRun(new Run(startOffset, endOffset + 1, context(), m_directi
on)); | 340 // exclusive so offset needs to be increased by one. |
| 341 endOffset += 1; |
| 342 |
| 343 // Append BidiRun objects, at most 64K chars at a time, until all |
| 344 // text between |startOffset| and |endOffset| is represented. |
| 345 while (startOffset < endOffset) { |
| 346 unsigned end = endOffset; |
| 347 const int limit = USHRT_MAX; // InlineTextBox stores text length as
unsigned short. |
| 348 if (end - startOffset > limit) |
| 349 end = startOffset + limit; |
| 350 runs.addRun(new Run(startOffset, end, context(), m_direction)); |
| 351 startOffset = end; |
| 352 } |
| 341 | 353 |
| 342 m_eor.increment(); | 354 m_eor.increment(); |
| 343 m_sor = m_eor; | 355 m_sor = m_eor; |
| 344 } | 356 } |
| 345 | 357 |
| 346 m_direction = WTF::Unicode::OtherNeutral; | 358 m_direction = WTF::Unicode::OtherNeutral; |
| 347 m_status.eor = WTF::Unicode::OtherNeutral; | 359 m_status.eor = WTF::Unicode::OtherNeutral; |
| 348 } | 360 } |
| 349 | 361 |
| 350 template <class Iterator, class Run> | 362 template <class Iterator, class Run> |
| (...skipping 727 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1078 template<class Iterator, class Run> | 1090 template<class Iterator, class Run> |
| 1079 MidpointState<Iterator> BidiResolver<Iterator, Run>::midpointStateForIsolatedRun
(Run* run) | 1091 MidpointState<Iterator> BidiResolver<Iterator, Run>::midpointStateForIsolatedRun
(Run* run) |
| 1080 { | 1092 { |
| 1081 return m_midpointStateForIsolatedRun.take(run); | 1093 return m_midpointStateForIsolatedRun.take(run); |
| 1082 } | 1094 } |
| 1083 | 1095 |
| 1084 | 1096 |
| 1085 } // namespace blink | 1097 } // namespace blink |
| 1086 | 1098 |
| 1087 #endif // BidiResolver_h | 1099 #endif // BidiResolver_h |
| OLD | NEW |