Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(608)

Side by Side Diff: third_party/WebKit/WebCore/rendering/RenderText.cpp

Issue 21184: WebKit merge 40722:40785 (part 1) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 11 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * (C) 1999 Lars Knoll (knoll@kde.org) 2 * (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 2000 Dirk Mueller (mueller@kde.org) 3 * (C) 2000 Dirk Mueller (mueller@kde.org)
4 * Copyright (C) 2004, 2005, 2006, 2007 Apple Inc. All rights reserved. 4 * Copyright (C) 2004, 2005, 2006, 2007 Apple Inc. All rights reserved.
5 * Copyright (C) 2006 Andrew Wellington (proton@wiretapped.net) 5 * Copyright (C) 2006 Andrew Wellington (proton@wiretapped.net)
6 * Copyright (C) 2006 Graham Dennis (graham.dennis@gmail.com) 6 * Copyright (C) 2006 Graham Dennis (graham.dennis@gmail.com)
7 * 7 *
8 * This library is free software; you can redistribute it and/or 8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public 9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either 10 * License as published by the Free Software Foundation; either
(...skipping 1147 matching lines...) Expand 10 before | Expand all | Expand 10 after
1158 { 1158 {
1159 StringImpl* si = m_text.get(); 1159 StringImpl* si = m_text.get();
1160 TextBreakIterator* iterator = characterBreakIterator(si->characters(), si->l ength()); 1160 TextBreakIterator* iterator = characterBreakIterator(si->characters(), si->l ength());
1161 if (!iterator) 1161 if (!iterator)
1162 return current - 1; 1162 return current - 1;
1163 1163
1164 long result = textBreakPreceding(iterator, current); 1164 long result = textBreakPreceding(iterator, current);
1165 if (result == TextBreakDone) 1165 if (result == TextBreakDone)
1166 result = current - 1; 1166 result = current - 1;
1167 1167
1168 #ifdef BUILDING_ON_TIGER
1169 // ICU 3.2 allows character breaks before a half-width Katakana voiced mark.
1170 if (static_cast<unsigned>(result) < si->length()) {
1171 UChar character = (*si)[result];
1172 if (character == 0xFF9E || character == 0xFF9F)
1173 --result;
1174 }
1175 #endif
1176
1168 return result; 1177 return result;
1169 } 1178 }
1170 1179
1171 #define HANGUL_CHOSEONG_START (0x1100) 1180 #define HANGUL_CHOSEONG_START (0x1100)
1172 #define HANGUL_CHOSEONG_END (0x115F) 1181 #define HANGUL_CHOSEONG_END (0x115F)
1173 #define HANGUL_JUNGSEONG_START (0x1160) 1182 #define HANGUL_JUNGSEONG_START (0x1160)
1174 #define HANGUL_JUNGSEONG_END (0x11A2) 1183 #define HANGUL_JUNGSEONG_END (0x11A2)
1175 #define HANGUL_JONGSEONG_START (0x11A8) 1184 #define HANGUL_JONGSEONG_START (0x11A8)
1176 #define HANGUL_JONGSEONG_END (0x11F9) 1185 #define HANGUL_JONGSEONG_END (0x11F9)
1177 #define HANGUL_SYLLABLE_START (0xAC00) 1186 #define HANGUL_SYLLABLE_START (0xAC00)
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
1272 { 1281 {
1273 StringImpl* si = m_text.get(); 1282 StringImpl* si = m_text.get();
1274 TextBreakIterator* iterator = characterBreakIterator(si->characters(), si->l ength()); 1283 TextBreakIterator* iterator = characterBreakIterator(si->characters(), si->l ength());
1275 if (!iterator) 1284 if (!iterator)
1276 return current + 1; 1285 return current + 1;
1277 1286
1278 long result = textBreakFollowing(iterator, current); 1287 long result = textBreakFollowing(iterator, current);
1279 if (result == TextBreakDone) 1288 if (result == TextBreakDone)
1280 result = current + 1; 1289 result = current + 1;
1281 1290
1291 #ifdef BUILDING_ON_TIGER
1292 // ICU 3.2 allows character breaks before a half-width Katakana voiced mark.
1293 if (static_cast<unsigned>(result) < si->length()) {
1294 UChar character = (*si)[result];
1295 if (character == 0xFF9E || character == 0xFF9F)
1296 ++result;
1297 }
1298 #endif
1299
1282 return result; 1300 return result;
1283 } 1301 }
1284 1302
1285 #ifndef NDEBUG 1303 #ifndef NDEBUG
1286 1304
1287 void RenderText::checkConsistency() const 1305 void RenderText::checkConsistency() const
1288 { 1306 {
1289 #ifdef CHECK_CONSISTENCY 1307 #ifdef CHECK_CONSISTENCY
1290 const InlineTextBox* prev = 0; 1308 const InlineTextBox* prev = 0;
1291 for (const InlineTextBox* child = m_firstTextBox; child != 0; child = child- >nextTextBox()) { 1309 for (const InlineTextBox* child = m_firstTextBox; child != 0; child = child- >nextTextBox()) {
1292 ASSERT(child->object() == this); 1310 ASSERT(child->object() == this);
1293 ASSERT(child->prevTextBox() == prev); 1311 ASSERT(child->prevTextBox() == prev);
1294 prev = child; 1312 prev = child;
1295 } 1313 }
1296 ASSERT(prev == m_lastTextBox); 1314 ASSERT(prev == m_lastTextBox);
1297 #endif 1315 #endif
1298 } 1316 }
1299 1317
1300 #endif 1318 #endif
1301 1319
1302 } // namespace WebCore 1320 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698