OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "ScriptRunIterator.h" | 5 #include "ScriptRunIterator.h" |
6 | 6 |
7 #include "platform/text/ICUError.h" | 7 #include "platform/text/ICUError.h" |
8 #include "wtf/Threading.h" | 8 #include "wtf/Threading.h" |
9 #include <algorithm> | 9 #include <algorithm> |
10 | 10 |
(...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
338 m_scriptData->getScripts(m_aheadCharacter, m_aheadSet); | 338 m_scriptData->getScripts(m_aheadCharacter, m_aheadSet); |
339 if (m_aheadSet.isEmpty()) { | 339 if (m_aheadSet.isEmpty()) { |
340 // No scripts for this character. This has already been logged, so | 340 // No scripts for this character. This has already been logged, so |
341 // we just terminate processing this text. | 341 // we just terminate processing this text. |
342 return false; | 342 return false; |
343 } | 343 } |
344 if (m_aheadSet[0] == USCRIPT_INHERITED && m_aheadSet.size() > 1) { | 344 if (m_aheadSet[0] == USCRIPT_INHERITED && m_aheadSet.size() > 1) { |
345 if (m_nextSet[0] == USCRIPT_COMMON) { | 345 if (m_nextSet[0] == USCRIPT_COMMON) { |
346 // Overwrite the next set with the non-inherited portion of the set. | 346 // Overwrite the next set with the non-inherited portion of the set. |
347 m_nextSet = m_aheadSet; | 347 m_nextSet = m_aheadSet; |
348 m_nextSet.remove(0); | 348 m_nextSet.erase(0); |
349 // Discard the remaining values, we'll inherit. | 349 // Discard the remaining values, we'll inherit. |
350 m_aheadSet.resize(1); | 350 m_aheadSet.resize(1); |
351 } else { | 351 } else { |
352 // Else, this applies to anything. | 352 // Else, this applies to anything. |
353 m_aheadSet.resize(1); | 353 m_aheadSet.resize(1); |
354 } | 354 } |
355 } | 355 } |
356 return true; | 356 return true; |
357 } | 357 } |
358 | 358 |
359 UScriptCode ScriptRunIterator::resolveCurrentScript() const { | 359 UScriptCode ScriptRunIterator::resolveCurrentScript() const { |
360 UScriptCode result = m_currentSet.at(0); | 360 UScriptCode result = m_currentSet.at(0); |
361 return result == USCRIPT_COMMON ? m_commonPreferred : result; | 361 return result == USCRIPT_COMMON ? m_commonPreferred : result; |
362 } | 362 } |
363 | 363 |
364 } // namespace blink | 364 } // namespace blink |
OLD | NEW |