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

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

Issue 39293: WebKit merge 41447:41498 [third_party/WebKit] (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: remove CRLF Created 11 years, 9 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 1129 matching lines...) Expand 10 before | Expand all | Expand 10 after
1140 { 1140 {
1141 int l = 0; 1141 int l = 0;
1142 for (InlineTextBox* box = firstTextBox(); box; box = box->nextTextBox()) 1142 for (InlineTextBox* box = firstTextBox(); box; box = box->nextTextBox())
1143 l += box->len(); 1143 l += box->len();
1144 return l; 1144 return l;
1145 } 1145 }
1146 1146
1147 int RenderText::previousOffset(int current) const 1147 int RenderText::previousOffset(int current) const
1148 { 1148 {
1149 StringImpl* si = m_text.get(); 1149 StringImpl* si = m_text.get();
1150 TextBreakIterator* iterator = characterBreakIterator(si->characters(), si->l ength()); 1150 TextBreakIterator* iterator = cursorMovementIterator(si->characters(), si->l ength());
1151 if (!iterator) 1151 if (!iterator)
1152 return current - 1; 1152 return current - 1;
1153 1153
1154 long result = textBreakPreceding(iterator, current); 1154 long result = textBreakPreceding(iterator, current);
1155 if (result == TextBreakDone) 1155 if (result == TextBreakDone)
1156 result = current - 1; 1156 result = current - 1;
1157 1157
1158 #ifdef BUILDING_ON_TIGER 1158 #ifdef BUILDING_ON_TIGER
1159 // ICU 3.2 allows character breaks before a half-width Katakana voiced mark. 1159 // ICU 3.2 allows character breaks before a half-width Katakana voiced mark.
1160 if (static_cast<unsigned>(result) < si->length()) { 1160 if (static_cast<unsigned>(result) < si->length()) {
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
1263 return current; 1263 return current;
1264 #else 1264 #else
1265 // Platforms other than Mac delete by one code point. 1265 // Platforms other than Mac delete by one code point.
1266 return current - 1; 1266 return current - 1;
1267 #endif 1267 #endif
1268 } 1268 }
1269 1269
1270 int RenderText::nextOffset(int current) const 1270 int RenderText::nextOffset(int current) const
1271 { 1271 {
1272 StringImpl* si = m_text.get(); 1272 StringImpl* si = m_text.get();
1273 TextBreakIterator* iterator = characterBreakIterator(si->characters(), si->l ength()); 1273 TextBreakIterator* iterator = cursorMovementIterator(si->characters(), si->l ength());
1274 if (!iterator) 1274 if (!iterator)
1275 return current + 1; 1275 return current + 1;
1276 1276
1277 long result = textBreakFollowing(iterator, current); 1277 long result = textBreakFollowing(iterator, current);
1278 if (result == TextBreakDone) 1278 if (result == TextBreakDone)
1279 result = current + 1; 1279 result = current + 1;
1280 1280
1281 #ifdef BUILDING_ON_TIGER 1281 #ifdef BUILDING_ON_TIGER
1282 // ICU 3.2 allows character breaks before a half-width Katakana voiced mark. 1282 // ICU 3.2 allows character breaks before a half-width Katakana voiced mark.
1283 if (static_cast<unsigned>(result) < si->length()) { 1283 if (static_cast<unsigned>(result) < si->length()) {
(...skipping 17 matching lines...) Expand all
1301 ASSERT(child->prevTextBox() == prev); 1301 ASSERT(child->prevTextBox() == prev);
1302 prev = child; 1302 prev = child;
1303 } 1303 }
1304 ASSERT(prev == m_lastTextBox); 1304 ASSERT(prev == m_lastTextBox);
1305 #endif 1305 #endif
1306 } 1306 }
1307 1307
1308 #endif 1308 #endif
1309 1309
1310 } // namespace WebCore 1310 } // namespace WebCore
OLDNEW
« no previous file with comments | « third_party/WebKit/WebCore/rendering/RenderObject.cpp ('k') | third_party/WebKit/WebCore/rendering/RenderVideo.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698