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

Side by Side Diff: Source/core/editing/VisiblePosition.cpp

Issue 182413005: Return refererence from InlineBox::root() (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: re-upload because previous patch didn't upload correctly. Created 6 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserv ed. 2 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserv ed.
3 * Portions Copyright (c) 2011 Motorola Mobility, Inc. All rights reserved. 3 * Portions Copyright (c) 2011 Motorola Mobility, Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
182 } 182 }
183 183
184 ASSERT(offset == box->caretLeftmostOffset()); 184 ASSERT(offset == box->caretLeftmostOffset());
185 185
186 unsigned char level = box->bidiLevel(); 186 unsigned char level = box->bidiLevel();
187 InlineBox* prevBox = box->prevLeafChild(); 187 InlineBox* prevBox = box->prevLeafChild();
188 188
189 if (box->direction() == primaryDirection) { 189 if (box->direction() == primaryDirection) {
190 if (!prevBox) { 190 if (!prevBox) {
191 InlineBox* logicalStart = 0; 191 InlineBox* logicalStart = 0;
192 if (primaryDirection == LTR ? box->root()->getLogicalStartBo xWithNode(logicalStart) : box->root()->getLogicalEndBoxWithNode(logicalStart)) { 192 if (primaryDirection == LTR ? box->root().getLogicalStartBox WithNode(logicalStart) : box->root().getLogicalEndBoxWithNode(logicalStart)) {
193 box = logicalStart; 193 box = logicalStart;
194 renderer = &box->renderer(); 194 renderer = &box->renderer();
195 offset = primaryDirection == LTR ? box->caretMinOffset() : box->caretMaxOffset(); 195 offset = primaryDirection == LTR ? box->caretMinOffset() : box->caretMaxOffset();
196 } 196 }
197 break; 197 break;
198 } 198 }
199 if (prevBox->bidiLevel() >= level) 199 if (prevBox->bidiLevel() >= level)
200 break; 200 break;
201 201
202 level = prevBox->bidiLevel(); 202 level = prevBox->bidiLevel();
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
347 } 347 }
348 348
349 ASSERT(offset == box->caretRightmostOffset()); 349 ASSERT(offset == box->caretRightmostOffset());
350 350
351 unsigned char level = box->bidiLevel(); 351 unsigned char level = box->bidiLevel();
352 InlineBox* nextBox = box->nextLeafChild(); 352 InlineBox* nextBox = box->nextLeafChild();
353 353
354 if (box->direction() == primaryDirection) { 354 if (box->direction() == primaryDirection) {
355 if (!nextBox) { 355 if (!nextBox) {
356 InlineBox* logicalEnd = 0; 356 InlineBox* logicalEnd = 0;
357 if (primaryDirection == LTR ? box->root()->getLogicalEndBoxW ithNode(logicalEnd) : box->root()->getLogicalStartBoxWithNode(logicalEnd)) { 357 if (primaryDirection == LTR ? box->root().getLogicalEndBoxWi thNode(logicalEnd) : box->root().getLogicalStartBoxWithNode(logicalEnd)) {
358 box = logicalEnd; 358 box = logicalEnd;
359 renderer = &box->renderer(); 359 renderer = &box->renderer();
360 offset = primaryDirection == LTR ? box->caretMaxOffset() : box->caretMinOffset(); 360 offset = primaryDirection == LTR ? box->caretMaxOffset() : box->caretMinOffset();
361 } 361 }
362 break; 362 break;
363 } 363 }
364 364
365 if (nextBox->bidiLevel() >= level) 365 if (nextBox->bidiLevel() >= level)
366 break; 366 break;
367 367
(...skipping 431 matching lines...) Expand 10 before | Expand all | Expand 10 after
799 if (vpos) 799 if (vpos)
800 vpos->showTreeForThis(); 800 vpos->showTreeForThis();
801 } 801 }
802 802
803 void showTree(const WebCore::VisiblePosition& vpos) 803 void showTree(const WebCore::VisiblePosition& vpos)
804 { 804 {
805 vpos.showTreeForThis(); 805 vpos.showTreeForThis();
806 } 806 }
807 807
808 #endif 808 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698