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

Side by Side Diff: third_party/WebKit/Source/core/editing/VisibleUnits.cpp

Issue 1741073002: Rename enums/functions that collide in chromium style in core/layout/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@get-names-6
Patch Set: get-names-7: rebase Created 4 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 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 386 matching lines...) Expand 10 before | Expand all | Expand 10 after
397 397
398 const InlineTextBox* previousBox = leafBoxes.previousTextBox(&startBox->root (), textBox); 398 const InlineTextBox* previousBox = leafBoxes.previousTextBox(&startBox->root (), textBox);
399 if (previousBox) 399 if (previousBox)
400 return previousBox; 400 return previousBox;
401 401
402 previousBox = leafBoxes.previousTextBox(startBox->root().prevRootBox(), 0); 402 previousBox = leafBoxes.previousTextBox(startBox->root().prevRootBox(), 0);
403 if (previousBox) 403 if (previousBox)
404 return previousBox; 404 return previousBox;
405 405
406 while (1) { 406 while (1) {
407 Node* startNode = startBox->lineLayoutItem().nonPseudoNode(); 407 Node* startNode = startBox->getLineLayoutItem().nonPseudoNode();
408 if (!startNode) 408 if (!startNode)
409 break; 409 break;
410 410
411 Position position = previousRootInlineBoxCandidatePosition(startNode, vi siblePosition, ContentIsEditable); 411 Position position = previousRootInlineBoxCandidatePosition(startNode, vi siblePosition, ContentIsEditable);
412 if (position.isNull()) 412 if (position.isNull())
413 break; 413 break;
414 414
415 RenderedPosition renderedPosition(position, TextAffinity::Downstream); 415 RenderedPosition renderedPosition(position, TextAffinity::Downstream);
416 RootInlineBox* previousRoot = renderedPosition.rootBox(); 416 RootInlineBox* previousRoot = renderedPosition.rootBox();
417 if (!previousRoot) 417 if (!previousRoot)
(...skipping 20 matching lines...) Expand all
438 438
439 const InlineTextBox* nextBox = leafBoxes.nextTextBox(&startBox->root(), text Box); 439 const InlineTextBox* nextBox = leafBoxes.nextTextBox(&startBox->root(), text Box);
440 if (nextBox) 440 if (nextBox)
441 return nextBox; 441 return nextBox;
442 442
443 nextBox = leafBoxes.nextTextBox(startBox->root().nextRootBox(), 0); 443 nextBox = leafBoxes.nextTextBox(startBox->root().nextRootBox(), 0);
444 if (nextBox) 444 if (nextBox)
445 return nextBox; 445 return nextBox;
446 446
447 while (1) { 447 while (1) {
448 Node* startNode =startBox->lineLayoutItem().nonPseudoNode(); 448 Node* startNode =startBox->getLineLayoutItem().nonPseudoNode();
449 if (!startNode) 449 if (!startNode)
450 break; 450 break;
451 451
452 Position position = nextRootInlineBoxCandidatePosition(startNode, visibl ePosition, ContentIsEditable); 452 Position position = nextRootInlineBoxCandidatePosition(startNode, visibl ePosition, ContentIsEditable);
453 if (position.isNull()) 453 if (position.isNull())
454 break; 454 break;
455 455
456 RenderedPosition renderedPosition(position, TextAffinity::Downstream); 456 RenderedPosition renderedPosition(position, TextAffinity::Downstream);
457 RootInlineBox* nextRoot = renderedPosition.rootBox(); 457 RootInlineBox* nextRoot = renderedPosition.rootBox();
458 if (!nextRoot) 458 if (!nextRoot)
(...skipping 17 matching lines...) Expand all
476 { 476 {
477 previousBoxInDifferentBlock = false; 477 previousBoxInDifferentBlock = false;
478 478
479 // FIXME: Handle the case when we don't have an inline text box. 479 // FIXME: Handle the case when we don't have an inline text box.
480 const InlineTextBox* previousBox = logicallyPreviousBox(visiblePosition, tex tBox, previousBoxInDifferentBlock, leafBoxes); 480 const InlineTextBox* previousBox = logicallyPreviousBox(visiblePosition, tex tBox, previousBoxInDifferentBlock, leafBoxes);
481 481
482 int len = 0; 482 int len = 0;
483 string.clear(); 483 string.clear();
484 if (previousBox) { 484 if (previousBox) {
485 previousBoxLength = previousBox->len(); 485 previousBoxLength = previousBox->len();
486 previousBox->lineLayoutItem().text().appendTo(string, previousBox->start (), previousBoxLength); 486 previousBox->getLineLayoutItem().text().appendTo(string, previousBox->st art(), previousBoxLength);
487 len += previousBoxLength; 487 len += previousBoxLength;
488 } 488 }
489 textBox->lineLayoutItem().text().appendTo(string, textBox->start(), textBox- >len()); 489 textBox->getLineLayoutItem().text().appendTo(string, textBox->start(), textB ox->len());
490 len += textBox->len(); 490 len += textBox->len();
491 491
492 return wordBreakIterator(string.data(), len); 492 return wordBreakIterator(string.data(), len);
493 } 493 }
494 494
495 static TextBreakIterator* wordBreakIteratorForMaxOffsetBoundary(const VisiblePos ition& visiblePosition, const InlineTextBox* textBox, 495 static TextBreakIterator* wordBreakIteratorForMaxOffsetBoundary(const VisiblePos ition& visiblePosition, const InlineTextBox* textBox,
496 bool& nextBoxInDifferentBlock, Vector<UChar, 1024>& string, CachedLogicallyO rderedLeafBoxes& leafBoxes) 496 bool& nextBoxInDifferentBlock, Vector<UChar, 1024>& string, CachedLogicallyO rderedLeafBoxes& leafBoxes)
497 { 497 {
498 nextBoxInDifferentBlock = false; 498 nextBoxInDifferentBlock = false;
499 499
500 // FIXME: Handle the case when we don't have an inline text box. 500 // FIXME: Handle the case when we don't have an inline text box.
501 const InlineTextBox* nextBox = logicallyNextBox(visiblePosition, textBox, ne xtBoxInDifferentBlock, leafBoxes); 501 const InlineTextBox* nextBox = logicallyNextBox(visiblePosition, textBox, ne xtBoxInDifferentBlock, leafBoxes);
502 502
503 int len = 0; 503 int len = 0;
504 string.clear(); 504 string.clear();
505 textBox->lineLayoutItem().text().appendTo(string, textBox->start(), textBox- >len()); 505 textBox->getLineLayoutItem().text().appendTo(string, textBox->start(), textB ox->len());
506 len += textBox->len(); 506 len += textBox->len();
507 if (nextBox) { 507 if (nextBox) {
508 nextBox->lineLayoutItem().text().appendTo(string, nextBox->start(), next Box->len()); 508 nextBox->getLineLayoutItem().text().appendTo(string, nextBox->start(), n extBox->len());
509 len += nextBox->len(); 509 len += nextBox->len();
510 } 510 }
511 511
512 return wordBreakIterator(string.data(), len); 512 return wordBreakIterator(string.data(), len);
513 } 513 }
514 514
515 static bool isLogicalStartOfWord(TextBreakIterator* iter, int position, bool har dLineBreak) 515 static bool isLogicalStartOfWord(TextBreakIterator* iter, int position, bool har dLineBreak)
516 { 516 {
517 bool boundary = hardLineBreak ? true : iter->isBoundary(position); 517 bool boundary = hardLineBreak ? true : iter->isBoundary(position);
518 if (!boundary) 518 if (!boundary)
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
565 int previousBoxLength = 0; 565 int previousBoxLength = 0;
566 bool previousBoxInDifferentBlock = false; 566 bool previousBoxInDifferentBlock = false;
567 bool nextBoxInDifferentBlock = false; 567 bool nextBoxInDifferentBlock = false;
568 bool movingIntoNewBox = previouslyVisitedBox != box; 568 bool movingIntoNewBox = previouslyVisitedBox != box;
569 569
570 if (offsetInBox == box->caretMinOffset()) { 570 if (offsetInBox == box->caretMinOffset()) {
571 iter = wordBreakIteratorForMinOffsetBoundary(visiblePosition, textBo x, previousBoxLength, previousBoxInDifferentBlock, string, leafBoxes); 571 iter = wordBreakIteratorForMinOffsetBoundary(visiblePosition, textBo x, previousBoxLength, previousBoxInDifferentBlock, string, leafBoxes);
572 } else if (offsetInBox == box->caretMaxOffset()) { 572 } else if (offsetInBox == box->caretMaxOffset()) {
573 iter = wordBreakIteratorForMaxOffsetBoundary(visiblePosition, textBo x, nextBoxInDifferentBlock, string, leafBoxes); 573 iter = wordBreakIteratorForMaxOffsetBoundary(visiblePosition, textBo x, nextBoxInDifferentBlock, string, leafBoxes);
574 } else if (movingIntoNewBox) { 574 } else if (movingIntoNewBox) {
575 iter = wordBreakIterator(textBox->lineLayoutItem().text(), textBox-> start(), textBox->len()); 575 iter = wordBreakIterator(textBox->getLineLayoutItem().text(), textBo x->start(), textBox->len());
576 previouslyVisitedBox = box; 576 previouslyVisitedBox = box;
577 } 577 }
578 578
579 if (!iter) 579 if (!iter)
580 break; 580 break;
581 581
582 iter->first(); 582 iter->first();
583 int offsetInIterator = offsetInBox - textBox->start() + previousBoxLengt h; 583 int offsetInIterator = offsetInBox - textBox->start() + previousBoxLengt h;
584 584
585 bool isWordBreak; 585 bool isWordBreak;
(...skipping 403 matching lines...) Expand 10 before | Expand all | Expand 10 after
989 if (!startNode) 989 if (!startNode)
990 return PositionWithAffinityTemplate<Strategy>(); 990 return PositionWithAffinityTemplate<Strategy>();
991 } else { 991 } else {
992 // Generated content (e.g. list markers and CSS :before and :after pseud oelements) have no corresponding DOM element, 992 // Generated content (e.g. list markers and CSS :before and :after pseud oelements) have no corresponding DOM element,
993 // and so cannot be represented by a VisiblePosition. Use whatever follo ws instead. 993 // and so cannot be represented by a VisiblePosition. Use whatever follo ws instead.
994 startBox = rootBox->firstLeafChild(); 994 startBox = rootBox->firstLeafChild();
995 while (true) { 995 while (true) {
996 if (!startBox) 996 if (!startBox)
997 return PositionWithAffinityTemplate<Strategy>(); 997 return PositionWithAffinityTemplate<Strategy>();
998 998
999 startNode = startBox->lineLayoutItem().nonPseudoNode(); 999 startNode = startBox->getLineLayoutItem().nonPseudoNode();
1000 if (startNode) 1000 if (startNode)
1001 break; 1001 break;
1002 1002
1003 startBox = startBox->nextLeafChild(); 1003 startBox = startBox->nextLeafChild();
1004 } 1004 }
1005 } 1005 }
1006 1006
1007 return PositionWithAffinityTemplate<Strategy>(startNode->isTextNode() ? Posi tionTemplate<Strategy>(toText(startNode), toInlineTextBox(startBox)->start()) : PositionTemplate<Strategy>::beforeNode(startNode)); 1007 return PositionWithAffinityTemplate<Strategy>(startNode->isTextNode() ? Posi tionTemplate<Strategy>(toText(startNode), toInlineTextBox(startBox)->start()) : PositionTemplate<Strategy>::beforeNode(startNode));
1008 } 1008 }
1009 1009
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
1086 return VisiblePositionTemplate<Strategy>(); 1086 return VisiblePositionTemplate<Strategy>();
1087 } else { 1087 } else {
1088 // Generated content (e.g. list markers and CSS :before and :after 1088 // Generated content (e.g. list markers and CSS :before and :after
1089 // pseudo elements) have no corresponding DOM element, and so cannot be 1089 // pseudo elements) have no corresponding DOM element, and so cannot be
1090 // represented by a VisiblePosition. Use whatever precedes instead. 1090 // represented by a VisiblePosition. Use whatever precedes instead.
1091 endBox = rootBox->lastLeafChild(); 1091 endBox = rootBox->lastLeafChild();
1092 while (true) { 1092 while (true) {
1093 if (!endBox) 1093 if (!endBox)
1094 return VisiblePositionTemplate<Strategy>(); 1094 return VisiblePositionTemplate<Strategy>();
1095 1095
1096 endNode = endBox->lineLayoutItem().nonPseudoNode(); 1096 endNode = endBox->getLineLayoutItem().nonPseudoNode();
1097 if (endNode) 1097 if (endNode)
1098 break; 1098 break;
1099 1099
1100 endBox = endBox->prevLeafChild(); 1100 endBox = endBox->prevLeafChild();
1101 } 1101 }
1102 } 1102 }
1103 1103
1104 PositionTemplate<Strategy> pos; 1104 PositionTemplate<Strategy> pos;
1105 if (isHTMLBRElement(*endNode)) { 1105 if (isHTMLBRElement(*endNode)) {
1106 pos = PositionTemplate<Strategy>::beforeNode(endNode); 1106 pos = PositionTemplate<Strategy>::beforeNode(endNode);
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after
1323 RenderedPosition renderedPosition((createVisiblePosition(position))) ; 1323 RenderedPosition renderedPosition((createVisiblePosition(position))) ;
1324 root = renderedPosition.rootBox(); 1324 root = renderedPosition.rootBox();
1325 if (!root) 1325 if (!root)
1326 return createVisiblePosition(position); 1326 return createVisiblePosition(position);
1327 } 1327 }
1328 } 1328 }
1329 1329
1330 if (root) { 1330 if (root) {
1331 // FIXME: Can be wrong for multi-column layout and with transforms. 1331 // FIXME: Can be wrong for multi-column layout and with transforms.
1332 LayoutPoint pointInLine = absoluteLineDirectionPointToLocalPointInBlock( root, lineDirectionPoint); 1332 LayoutPoint pointInLine = absoluteLineDirectionPointToLocalPointInBlock( root, lineDirectionPoint);
1333 LineLayoutItem lineLayoutItem = root->closestLeafChildForPoint(pointInLi ne, isEditablePosition(p))->lineLayoutItem(); 1333 LineLayoutItem lineLayoutItem = root->closestLeafChildForPoint(pointInLi ne, isEditablePosition(p))->getLineLayoutItem();
1334 Node* node = lineLayoutItem.node(); 1334 Node* node = lineLayoutItem.node();
1335 if (node && editingIgnoresContent(node)) 1335 if (node && editingIgnoresContent(node))
1336 return createVisiblePosition(positionInParentBeforeNode(*node)); 1336 return createVisiblePosition(positionInParentBeforeNode(*node));
1337 return createVisiblePosition(lineLayoutItem.positionForPoint(pointInLine )); 1337 return createVisiblePosition(lineLayoutItem.positionForPoint(pointInLine ));
1338 } 1338 }
1339 1339
1340 // Could not find a previous line. This means we must already be on the firs t line. 1340 // Could not find a previous line. This means we must already be on the firs t line.
1341 // Move to the start of the content in this block, which effectively moves u s 1341 // Move to the start of the content in this block, which effectively moves u s
1342 // to the start of the line we're on. 1342 // to the start of the line we're on.
1343 Element* rootElement = node->hasEditableStyle(editableType) ? node->rootEdit ableElement(editableType) : node->document().documentElement(); 1343 Element* rootElement = node->hasEditableStyle(editableType) ? node->rootEdit ableElement(editableType) : node->document().documentElement();
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
1379 RenderedPosition renderedPosition((createVisiblePosition(position))) ; 1379 RenderedPosition renderedPosition((createVisiblePosition(position))) ;
1380 root = renderedPosition.rootBox(); 1380 root = renderedPosition.rootBox();
1381 if (!root) 1381 if (!root)
1382 return createVisiblePosition(position); 1382 return createVisiblePosition(position);
1383 } 1383 }
1384 } 1384 }
1385 1385
1386 if (root) { 1386 if (root) {
1387 // FIXME: Can be wrong for multi-column layout and with transforms. 1387 // FIXME: Can be wrong for multi-column layout and with transforms.
1388 LayoutPoint pointInLine = absoluteLineDirectionPointToLocalPointInBlock( root, lineDirectionPoint); 1388 LayoutPoint pointInLine = absoluteLineDirectionPointToLocalPointInBlock( root, lineDirectionPoint);
1389 LineLayoutItem lineLayoutItem = root->closestLeafChildForPoint(pointInLi ne, isEditablePosition(p))->lineLayoutItem(); 1389 LineLayoutItem lineLayoutItem = root->closestLeafChildForPoint(pointInLi ne, isEditablePosition(p))->getLineLayoutItem();
1390 Node* node = lineLayoutItem.node(); 1390 Node* node = lineLayoutItem.node();
1391 if (node && editingIgnoresContent(node)) 1391 if (node && editingIgnoresContent(node))
1392 return createVisiblePosition(positionInParentBeforeNode(*node)); 1392 return createVisiblePosition(positionInParentBeforeNode(*node));
1393 return createVisiblePosition(lineLayoutItem.positionForPoint(pointInLine )); 1393 return createVisiblePosition(lineLayoutItem.positionForPoint(pointInLine ));
1394 } 1394 }
1395 1395
1396 // Could not find a next line. This means we must already be on the last lin e. 1396 // Could not find a next line. This means we must already be on the last lin e.
1397 // Move to the end of the content in this block, which effectively moves us 1397 // Move to the end of the content in this block, which effectively moves us
1398 // to the end of the line we're on. 1398 // to the end of the line we're on.
1399 Element* rootElement = node->hasEditableStyle(editableType) ? node->rootEdit ableElement(editableType) : node->document().documentElement(); 1399 Element* rootElement = node->hasEditableStyle(editableType) ? node->rootEdit ableElement(editableType) : node->document().documentElement();
(...skipping 731 matching lines...) Expand 10 before | Expand all | Expand 10 after
2131 } 2131 }
2132 Node* node = position.position().anchorNode(); 2132 Node* node = position.position().anchorNode();
2133 2133
2134 layoutObject = node->layoutObject(); 2134 layoutObject = node->layoutObject();
2135 if (!layoutObject) 2135 if (!layoutObject)
2136 return LayoutRect(); 2136 return LayoutRect();
2137 2137
2138 InlineBoxPosition boxPosition = computeInlineBoxPosition(position.position() , position.affinity()); 2138 InlineBoxPosition boxPosition = computeInlineBoxPosition(position.position() , position.affinity());
2139 2139
2140 if (boxPosition.inlineBox) 2140 if (boxPosition.inlineBox)
2141 layoutObject = LineLayoutAPIShim::layoutObjectFrom(boxPosition.inlineBox ->lineLayoutItem()); 2141 layoutObject = LineLayoutAPIShim::layoutObjectFrom(boxPosition.inlineBox ->getLineLayoutItem());
2142 2142
2143 return layoutObject->localCaretRect(boxPosition.inlineBox, boxPosition.offse tInBox); 2143 return layoutObject->localCaretRect(boxPosition.inlineBox, boxPosition.offse tInBox);
2144 } 2144 }
2145 2145
2146 LayoutRect localCaretRectOfPosition(const PositionWithAffinity& position, Layout Object*& layoutObject) 2146 LayoutRect localCaretRectOfPosition(const PositionWithAffinity& position, Layout Object*& layoutObject)
2147 { 2147 {
2148 return localCaretRectOfPositionTemplate<EditingStrategy>(position, layoutObj ect); 2148 return localCaretRectOfPositionTemplate<EditingStrategy>(position, layoutObj ect);
2149 } 2149 }
2150 2150
2151 LayoutRect localCaretRectOfPosition(const PositionInFlatTreeWithAffinity& positi on, LayoutObject*& layoutObject) 2151 LayoutRect localCaretRectOfPosition(const PositionInFlatTreeWithAffinity& positi on, LayoutObject*& layoutObject)
(...skipping 414 matching lines...) Expand 10 before | Expand all | Expand 10 after
2566 2566
2567 // The text continues on the next line only if the last text box is not on this line and 2567 // The text continues on the next line only if the last text box is not on this line and
2568 // none of the boxes on this line have a larger start offset. 2568 // none of the boxes on this line have a larger start offset.
2569 2569
2570 bool continuesOnNextLine = true; 2570 bool continuesOnNextLine = true;
2571 InlineBox* otherBox = box; 2571 InlineBox* otherBox = box;
2572 while (continuesOnNextLine) { 2572 while (continuesOnNextLine) {
2573 otherBox = otherBox->nextLeafChild(); 2573 otherBox = otherBox->nextLeafChild();
2574 if (!otherBox) 2574 if (!otherBox)
2575 break; 2575 break;
2576 if (otherBox == lastTextBox || (LineLayoutAPIShim::layoutObj ectFrom(otherBox->lineLayoutItem()) == textLayoutObject && toInlineTextBox(other Box)->start() > textOffset)) 2576 if (otherBox == lastTextBox || (LineLayoutAPIShim::layoutObj ectFrom(otherBox->getLineLayoutItem()) == textLayoutObject && toInlineTextBox(ot herBox)->start() > textOffset))
2577 continuesOnNextLine = false; 2577 continuesOnNextLine = false;
2578 } 2578 }
2579 2579
2580 otherBox = box; 2580 otherBox = box;
2581 while (continuesOnNextLine) { 2581 while (continuesOnNextLine) {
2582 otherBox = otherBox->prevLeafChild(); 2582 otherBox = otherBox->prevLeafChild();
2583 if (!otherBox) 2583 if (!otherBox)
2584 break; 2584 break;
2585 if (otherBox == lastTextBox || (LineLayoutAPIShim::layoutObj ectFrom(otherBox->lineLayoutItem()) == textLayoutObject && toInlineTextBox(other Box)->start() > textOffset)) 2585 if (otherBox == lastTextBox || (LineLayoutAPIShim::layoutObj ectFrom(otherBox->getLineLayoutItem()) == textLayoutObject && toInlineTextBox(ot herBox)->start() > textOffset))
2586 continuesOnNextLine = false; 2586 continuesOnNextLine = false;
2587 } 2587 }
2588 2588
2589 if (continuesOnNextLine) 2589 if (continuesOnNextLine)
2590 return currentPos.computePosition(); 2590 return currentPos.computePosition();
2591 } 2591 }
2592 } 2592 }
2593 } 2593 }
2594 return lastVisible.deprecatedComputePosition(); 2594 return lastVisible.deprecatedComputePosition();
2595 } 2595 }
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
2697 2697
2698 // The text continues on the next line only if the last text box is not on this line and 2698 // The text continues on the next line only if the last text box is not on this line and
2699 // none of the boxes on this line have a larger start offset. 2699 // none of the boxes on this line have a larger start offset.
2700 2700
2701 bool continuesOnNextLine = true; 2701 bool continuesOnNextLine = true;
2702 InlineBox* otherBox = box; 2702 InlineBox* otherBox = box;
2703 while (continuesOnNextLine) { 2703 while (continuesOnNextLine) {
2704 otherBox = otherBox->nextLeafChild(); 2704 otherBox = otherBox->nextLeafChild();
2705 if (!otherBox) 2705 if (!otherBox)
2706 break; 2706 break;
2707 if (otherBox == lastTextBox || (LineLayoutAPIShim::layoutObj ectFrom(otherBox->lineLayoutItem()) == textLayoutObject && toInlineTextBox(other Box)->start() >= textOffset)) 2707 if (otherBox == lastTextBox || (LineLayoutAPIShim::layoutObj ectFrom(otherBox->getLineLayoutItem()) == textLayoutObject && toInlineTextBox(ot herBox)->start() >= textOffset))
2708 continuesOnNextLine = false; 2708 continuesOnNextLine = false;
2709 } 2709 }
2710 2710
2711 otherBox = box; 2711 otherBox = box;
2712 while (continuesOnNextLine) { 2712 while (continuesOnNextLine) {
2713 otherBox = otherBox->prevLeafChild(); 2713 otherBox = otherBox->prevLeafChild();
2714 if (!otherBox) 2714 if (!otherBox)
2715 break; 2715 break;
2716 if (otherBox == lastTextBox || (LineLayoutAPIShim::layoutObj ectFrom(otherBox->lineLayoutItem()) == textLayoutObject && toInlineTextBox(other Box)->start() >= textOffset)) 2716 if (otherBox == lastTextBox || (LineLayoutAPIShim::layoutObj ectFrom(otherBox->getLineLayoutItem()) == textLayoutObject && toInlineTextBox(ot herBox)->start() >= textOffset))
2717 continuesOnNextLine = false; 2717 continuesOnNextLine = false;
2718 } 2718 }
2719 2719
2720 if (continuesOnNextLine) 2720 if (continuesOnNextLine)
2721 return currentPos.computePosition(); 2721 return currentPos.computePosition();
2722 } 2722 }
2723 } 2723 }
2724 } 2724 }
2725 2725
2726 return lastVisible.deprecatedComputePosition(); 2726 return lastVisible.deprecatedComputePosition();
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after
2939 TextDirection primaryDirection = primaryDirectionOf(*p.anchorNode()); 2939 TextDirection primaryDirection = primaryDirectionOf(*p.anchorNode());
2940 const TextAffinity affinity = visiblePosition.affinity(); 2940 const TextAffinity affinity = visiblePosition.affinity();
2941 2941
2942 while (true) { 2942 while (true) {
2943 InlineBoxPosition boxPosition = computeInlineBoxPosition(p, affinity, pr imaryDirection); 2943 InlineBoxPosition boxPosition = computeInlineBoxPosition(p, affinity, pr imaryDirection);
2944 InlineBox* box = boxPosition.inlineBox; 2944 InlineBox* box = boxPosition.inlineBox;
2945 int offset = boxPosition.offsetInBox; 2945 int offset = boxPosition.offsetInBox;
2946 if (!box) 2946 if (!box)
2947 return primaryDirection == LTR ? previousVisuallyDistinctCandidate(d eepPosition) : nextVisuallyDistinctCandidate(deepPosition); 2947 return primaryDirection == LTR ? previousVisuallyDistinctCandidate(d eepPosition) : nextVisuallyDistinctCandidate(deepPosition);
2948 2948
2949 LineLayoutItem lineLayoutItem = box->lineLayoutItem(); 2949 LineLayoutItem lineLayoutItem = box->getLineLayoutItem();
2950 2950
2951 while (true) { 2951 while (true) {
2952 if ((lineLayoutItem.isAtomicInlineLevel() || lineLayoutItem.isBR()) && offset == box->caretRightmostOffset()) 2952 if ((lineLayoutItem.isAtomicInlineLevel() || lineLayoutItem.isBR()) && offset == box->caretRightmostOffset())
2953 return box->isLeftToRightDirection() ? previousVisuallyDistinctC andidate(deepPosition) : nextVisuallyDistinctCandidate(deepPosition); 2953 return box->isLeftToRightDirection() ? previousVisuallyDistinctC andidate(deepPosition) : nextVisuallyDistinctCandidate(deepPosition);
2954 2954
2955 if (!lineLayoutItem.node()) { 2955 if (!lineLayoutItem.node()) {
2956 box = box->prevLeafChild(); 2956 box = box->prevLeafChild();
2957 if (!box) 2957 if (!box)
2958 return primaryDirection == LTR ? previousVisuallyDistinctCan didate(deepPosition) : nextVisuallyDistinctCandidate(deepPosition); 2958 return primaryDirection == LTR ? previousVisuallyDistinctCan didate(deepPosition) : nextVisuallyDistinctCandidate(deepPosition);
2959 lineLayoutItem = box->lineLayoutItem(); 2959 lineLayoutItem = box->getLineLayoutItem();
2960 offset = box->caretRightmostOffset(); 2960 offset = box->caretRightmostOffset();
2961 continue; 2961 continue;
2962 } 2962 }
2963 2963
2964 offset = box->isLeftToRightDirection() ? lineLayoutItem.previousOffs et(offset) : lineLayoutItem.nextOffset(offset); 2964 offset = box->isLeftToRightDirection() ? lineLayoutItem.previousOffs et(offset) : lineLayoutItem.nextOffset(offset);
2965 2965
2966 int caretMinOffset = box->caretMinOffset(); 2966 int caretMinOffset = box->caretMinOffset();
2967 int caretMaxOffset = box->caretMaxOffset(); 2967 int caretMaxOffset = box->caretMaxOffset();
2968 2968
2969 if (offset > caretMinOffset && offset < caretMaxOffset) 2969 if (offset > caretMinOffset && offset < caretMaxOffset)
2970 break; 2970 break;
2971 2971
2972 if (box->isLeftToRightDirection() ? offset < caretMinOffset : offset > caretMaxOffset) { 2972 if (box->isLeftToRightDirection() ? offset < caretMinOffset : offset > caretMaxOffset) {
2973 // Overshot to the left. 2973 // Overshot to the left.
2974 InlineBox* prevBox = box->prevLeafChildIgnoringLineBreak(); 2974 InlineBox* prevBox = box->prevLeafChildIgnoringLineBreak();
2975 if (!prevBox) { 2975 if (!prevBox) {
2976 PositionTemplate<Strategy> positionOnLeft = primaryDirection == LTR ? previousVisuallyDistinctCandidate(visiblePosition.deepEquivalent()) : nextVisuallyDistinctCandidate(visiblePosition.deepEquivalent()); 2976 PositionTemplate<Strategy> positionOnLeft = primaryDirection == LTR ? previousVisuallyDistinctCandidate(visiblePosition.deepEquivalent()) : nextVisuallyDistinctCandidate(visiblePosition.deepEquivalent());
2977 if (positionOnLeft.isNull()) 2977 if (positionOnLeft.isNull())
2978 return PositionTemplate<Strategy>(); 2978 return PositionTemplate<Strategy>();
2979 2979
2980 InlineBox* boxOnLeft = computeInlineBoxPosition(positionOnLe ft, affinity, primaryDirection).inlineBox; 2980 InlineBox* boxOnLeft = computeInlineBoxPosition(positionOnLe ft, affinity, primaryDirection).inlineBox;
2981 if (boxOnLeft && boxOnLeft->root() == box->root()) 2981 if (boxOnLeft && boxOnLeft->root() == box->root())
2982 return PositionTemplate<Strategy>(); 2982 return PositionTemplate<Strategy>();
2983 return positionOnLeft; 2983 return positionOnLeft;
2984 } 2984 }
2985 2985
2986 // Reposition at the other logical position corresponding to our 2986 // Reposition at the other logical position corresponding to our
2987 // edge's visual position and go for another round. 2987 // edge's visual position and go for another round.
2988 box = prevBox; 2988 box = prevBox;
2989 lineLayoutItem = box->lineLayoutItem(); 2989 lineLayoutItem = box->getLineLayoutItem();
2990 offset = prevBox->caretRightmostOffset(); 2990 offset = prevBox->caretRightmostOffset();
2991 continue; 2991 continue;
2992 } 2992 }
2993 2993
2994 ASSERT(offset == box->caretLeftmostOffset()); 2994 ASSERT(offset == box->caretLeftmostOffset());
2995 2995
2996 unsigned char level = box->bidiLevel(); 2996 unsigned char level = box->bidiLevel();
2997 InlineBox* prevBox = box->prevLeafChild(); 2997 InlineBox* prevBox = box->prevLeafChild();
2998 2998
2999 if (box->direction() == primaryDirection) { 2999 if (box->direction() == primaryDirection) {
3000 if (!prevBox) { 3000 if (!prevBox) {
3001 InlineBox* logicalStart = 0; 3001 InlineBox* logicalStart = 0;
3002 if (primaryDirection == LTR ? box->root().getLogicalStartBox WithNode(logicalStart) : box->root().getLogicalEndBoxWithNode(logicalStart)) { 3002 if (primaryDirection == LTR ? box->root().getLogicalStartBox WithNode(logicalStart) : box->root().getLogicalEndBoxWithNode(logicalStart)) {
3003 box = logicalStart; 3003 box = logicalStart;
3004 lineLayoutItem = box->lineLayoutItem(); 3004 lineLayoutItem = box->getLineLayoutItem();
3005 offset = primaryDirection == LTR ? box->caretMinOffset() : box->caretMaxOffset(); 3005 offset = primaryDirection == LTR ? box->caretMinOffset() : box->caretMaxOffset();
3006 } 3006 }
3007 break; 3007 break;
3008 } 3008 }
3009 if (prevBox->bidiLevel() >= level) 3009 if (prevBox->bidiLevel() >= level)
3010 break; 3010 break;
3011 3011
3012 level = prevBox->bidiLevel(); 3012 level = prevBox->bidiLevel();
3013 3013
3014 InlineBox* nextBox = box; 3014 InlineBox* nextBox = box;
3015 do { 3015 do {
3016 nextBox = nextBox->nextLeafChild(); 3016 nextBox = nextBox->nextLeafChild();
3017 } while (nextBox && nextBox->bidiLevel() > level); 3017 } while (nextBox && nextBox->bidiLevel() > level);
3018 3018
3019 if (nextBox && nextBox->bidiLevel() == level) 3019 if (nextBox && nextBox->bidiLevel() == level)
3020 break; 3020 break;
3021 3021
3022 box = prevBox; 3022 box = prevBox;
3023 lineLayoutItem = box->lineLayoutItem(); 3023 lineLayoutItem = box->getLineLayoutItem();
3024 offset = box->caretRightmostOffset(); 3024 offset = box->caretRightmostOffset();
3025 if (box->direction() == primaryDirection) 3025 if (box->direction() == primaryDirection)
3026 break; 3026 break;
3027 continue; 3027 continue;
3028 } 3028 }
3029 3029
3030 while (prevBox && !prevBox->lineLayoutItem().node()) 3030 while (prevBox && !prevBox->getLineLayoutItem().node())
3031 prevBox = prevBox->prevLeafChild(); 3031 prevBox = prevBox->prevLeafChild();
3032 3032
3033 if (prevBox) { 3033 if (prevBox) {
3034 box = prevBox; 3034 box = prevBox;
3035 lineLayoutItem = box->lineLayoutItem(); 3035 lineLayoutItem = box->getLineLayoutItem();
3036 offset = box->caretRightmostOffset(); 3036 offset = box->caretRightmostOffset();
3037 if (box->bidiLevel() > level) { 3037 if (box->bidiLevel() > level) {
3038 do { 3038 do {
3039 prevBox = prevBox->prevLeafChild(); 3039 prevBox = prevBox->prevLeafChild();
3040 } while (prevBox && prevBox->bidiLevel() > level); 3040 } while (prevBox && prevBox->bidiLevel() > level);
3041 3041
3042 if (!prevBox || prevBox->bidiLevel() < level) 3042 if (!prevBox || prevBox->bidiLevel() < level)
3043 continue; 3043 continue;
3044 } 3044 }
3045 } else { 3045 } else {
(...skipping 10 matching lines...) Expand all
3056 level = box->bidiLevel(); 3056 level = box->bidiLevel();
3057 while (InlineBox* prevBox = box->prevLeafChild()) { 3057 while (InlineBox* prevBox = box->prevLeafChild()) {
3058 if (prevBox->bidiLevel() < level) 3058 if (prevBox->bidiLevel() < level)
3059 break; 3059 break;
3060 box = prevBox; 3060 box = prevBox;
3061 } 3061 }
3062 if (box->bidiLevel() == level) 3062 if (box->bidiLevel() == level)
3063 break; 3063 break;
3064 level = box->bidiLevel(); 3064 level = box->bidiLevel();
3065 } 3065 }
3066 lineLayoutItem = box->lineLayoutItem(); 3066 lineLayoutItem = box->getLineLayoutItem();
3067 offset = primaryDirection == LTR ? box->caretMinOffset() : box-> caretMaxOffset(); 3067 offset = primaryDirection == LTR ? box->caretMinOffset() : box-> caretMaxOffset();
3068 } 3068 }
3069 break; 3069 break;
3070 } 3070 }
3071 3071
3072 p = PositionTemplate<Strategy>::editingPositionOf(lineLayoutItem.node(), offset); 3072 p = PositionTemplate<Strategy>::editingPositionOf(lineLayoutItem.node(), offset);
3073 3073
3074 if ((isVisuallyEquivalentCandidate(p) && mostForwardCaretPosition(p) != downstreamStart) || p.atStartOfTree() || p.atEndOfTree()) 3074 if ((isVisuallyEquivalentCandidate(p) && mostForwardCaretPosition(p) != downstreamStart) || p.atStartOfTree() || p.atEndOfTree())
3075 return p; 3075 return p;
3076 3076
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
3114 TextDirection primaryDirection = primaryDirectionOf(*p.anchorNode()); 3114 TextDirection primaryDirection = primaryDirectionOf(*p.anchorNode());
3115 const TextAffinity affinity = visiblePosition.affinity(); 3115 const TextAffinity affinity = visiblePosition.affinity();
3116 3116
3117 while (true) { 3117 while (true) {
3118 InlineBoxPosition boxPosition = computeInlineBoxPosition(p, affinity, pr imaryDirection); 3118 InlineBoxPosition boxPosition = computeInlineBoxPosition(p, affinity, pr imaryDirection);
3119 InlineBox* box = boxPosition.inlineBox; 3119 InlineBox* box = boxPosition.inlineBox;
3120 int offset = boxPosition.offsetInBox; 3120 int offset = boxPosition.offsetInBox;
3121 if (!box) 3121 if (!box)
3122 return primaryDirection == LTR ? nextVisuallyDistinctCandidate(deepP osition) : previousVisuallyDistinctCandidate(deepPosition); 3122 return primaryDirection == LTR ? nextVisuallyDistinctCandidate(deepP osition) : previousVisuallyDistinctCandidate(deepPosition);
3123 3123
3124 LayoutObject* layoutObject = LineLayoutAPIShim::layoutObjectFrom(box->li neLayoutItem()); 3124 LayoutObject* layoutObject = LineLayoutAPIShim::layoutObjectFrom(box->ge tLineLayoutItem());
3125 3125
3126 while (true) { 3126 while (true) {
3127 if ((layoutObject->isAtomicInlineLevel() || layoutObject->isBR()) && offset == box->caretLeftmostOffset()) 3127 if ((layoutObject->isAtomicInlineLevel() || layoutObject->isBR()) && offset == box->caretLeftmostOffset())
3128 return box->isLeftToRightDirection() ? nextVisuallyDistinctCandi date(deepPosition) : previousVisuallyDistinctCandidate(deepPosition); 3128 return box->isLeftToRightDirection() ? nextVisuallyDistinctCandi date(deepPosition) : previousVisuallyDistinctCandidate(deepPosition);
3129 3129
3130 if (!layoutObject->node()) { 3130 if (!layoutObject->node()) {
3131 box = box->nextLeafChild(); 3131 box = box->nextLeafChild();
3132 if (!box) 3132 if (!box)
3133 return primaryDirection == LTR ? nextVisuallyDistinctCandida te(deepPosition) : previousVisuallyDistinctCandidate(deepPosition); 3133 return primaryDirection == LTR ? nextVisuallyDistinctCandida te(deepPosition) : previousVisuallyDistinctCandidate(deepPosition);
3134 layoutObject = LineLayoutAPIShim::layoutObjectFrom(box->lineLayo utItem()); 3134 layoutObject = LineLayoutAPIShim::layoutObjectFrom(box->getLineL ayoutItem());
3135 offset = box->caretLeftmostOffset(); 3135 offset = box->caretLeftmostOffset();
3136 continue; 3136 continue;
3137 } 3137 }
3138 3138
3139 offset = box->isLeftToRightDirection() ? layoutObject->nextOffset(of fset) : layoutObject->previousOffset(offset); 3139 offset = box->isLeftToRightDirection() ? layoutObject->nextOffset(of fset) : layoutObject->previousOffset(offset);
3140 3140
3141 int caretMinOffset = box->caretMinOffset(); 3141 int caretMinOffset = box->caretMinOffset();
3142 int caretMaxOffset = box->caretMaxOffset(); 3142 int caretMaxOffset = box->caretMaxOffset();
3143 3143
3144 if (offset > caretMinOffset && offset < caretMaxOffset) 3144 if (offset > caretMinOffset && offset < caretMaxOffset)
3145 break; 3145 break;
3146 3146
3147 if (box->isLeftToRightDirection() ? offset > caretMaxOffset : offset < caretMinOffset) { 3147 if (box->isLeftToRightDirection() ? offset > caretMaxOffset : offset < caretMinOffset) {
3148 // Overshot to the right. 3148 // Overshot to the right.
3149 InlineBox* nextBox = box->nextLeafChildIgnoringLineBreak(); 3149 InlineBox* nextBox = box->nextLeafChildIgnoringLineBreak();
3150 if (!nextBox) { 3150 if (!nextBox) {
3151 PositionTemplate<Strategy> positionOnRight = primaryDirectio n == LTR ? nextVisuallyDistinctCandidate(deepPosition) : previousVisuallyDistinc tCandidate(deepPosition); 3151 PositionTemplate<Strategy> positionOnRight = primaryDirectio n == LTR ? nextVisuallyDistinctCandidate(deepPosition) : previousVisuallyDistinc tCandidate(deepPosition);
3152 if (positionOnRight.isNull()) 3152 if (positionOnRight.isNull())
3153 return PositionTemplate<Strategy>(); 3153 return PositionTemplate<Strategy>();
3154 3154
3155 InlineBox* boxOnRight = computeInlineBoxPosition(positionOnR ight, affinity, primaryDirection).inlineBox; 3155 InlineBox* boxOnRight = computeInlineBoxPosition(positionOnR ight, affinity, primaryDirection).inlineBox;
3156 if (boxOnRight && boxOnRight->root() == box->root()) 3156 if (boxOnRight && boxOnRight->root() == box->root())
3157 return PositionTemplate<Strategy>(); 3157 return PositionTemplate<Strategy>();
3158 return positionOnRight; 3158 return positionOnRight;
3159 } 3159 }
3160 3160
3161 // Reposition at the other logical position corresponding to our 3161 // Reposition at the other logical position corresponding to our
3162 // edge's visual position and go for another round. 3162 // edge's visual position and go for another round.
3163 box = nextBox; 3163 box = nextBox;
3164 layoutObject = LineLayoutAPIShim::layoutObjectFrom(box->lineLayo utItem()); 3164 layoutObject = LineLayoutAPIShim::layoutObjectFrom(box->getLineL ayoutItem());
3165 offset = nextBox->caretLeftmostOffset(); 3165 offset = nextBox->caretLeftmostOffset();
3166 continue; 3166 continue;
3167 } 3167 }
3168 3168
3169 ASSERT(offset == box->caretRightmostOffset()); 3169 ASSERT(offset == box->caretRightmostOffset());
3170 3170
3171 unsigned char level = box->bidiLevel(); 3171 unsigned char level = box->bidiLevel();
3172 InlineBox* nextBox = box->nextLeafChild(); 3172 InlineBox* nextBox = box->nextLeafChild();
3173 3173
3174 if (box->direction() == primaryDirection) { 3174 if (box->direction() == primaryDirection) {
3175 if (!nextBox) { 3175 if (!nextBox) {
3176 InlineBox* logicalEnd = 0; 3176 InlineBox* logicalEnd = 0;
3177 if (primaryDirection == LTR ? box->root().getLogicalEndBoxWi thNode(logicalEnd) : box->root().getLogicalStartBoxWithNode(logicalEnd)) { 3177 if (primaryDirection == LTR ? box->root().getLogicalEndBoxWi thNode(logicalEnd) : box->root().getLogicalStartBoxWithNode(logicalEnd)) {
3178 box = logicalEnd; 3178 box = logicalEnd;
3179 layoutObject = LineLayoutAPIShim::layoutObjectFrom(box-> lineLayoutItem()); 3179 layoutObject = LineLayoutAPIShim::layoutObjectFrom(box-> getLineLayoutItem());
3180 offset = primaryDirection == LTR ? box->caretMaxOffset() : box->caretMinOffset(); 3180 offset = primaryDirection == LTR ? box->caretMaxOffset() : box->caretMinOffset();
3181 } 3181 }
3182 break; 3182 break;
3183 } 3183 }
3184 3184
3185 if (nextBox->bidiLevel() >= level) 3185 if (nextBox->bidiLevel() >= level)
3186 break; 3186 break;
3187 3187
3188 level = nextBox->bidiLevel(); 3188 level = nextBox->bidiLevel();
3189 3189
3190 InlineBox* prevBox = box; 3190 InlineBox* prevBox = box;
3191 do { 3191 do {
3192 prevBox = prevBox->prevLeafChild(); 3192 prevBox = prevBox->prevLeafChild();
3193 } while (prevBox && prevBox->bidiLevel() > level); 3193 } while (prevBox && prevBox->bidiLevel() > level);
3194 3194
3195 // For example, abc FED 123 ^ CBA 3195 // For example, abc FED 123 ^ CBA
3196 if (prevBox && prevBox->bidiLevel() == level) 3196 if (prevBox && prevBox->bidiLevel() == level)
3197 break; 3197 break;
3198 3198
3199 // For example, abc 123 ^ CBA or 123 ^ CBA abc 3199 // For example, abc 123 ^ CBA or 123 ^ CBA abc
3200 box = nextBox; 3200 box = nextBox;
3201 layoutObject = LineLayoutAPIShim::layoutObjectFrom(box->lineLayo utItem()); 3201 layoutObject = LineLayoutAPIShim::layoutObjectFrom(box->getLineL ayoutItem());
3202 offset = box->caretLeftmostOffset(); 3202 offset = box->caretLeftmostOffset();
3203 if (box->direction() == primaryDirection) 3203 if (box->direction() == primaryDirection)
3204 break; 3204 break;
3205 continue; 3205 continue;
3206 } 3206 }
3207 3207
3208 while (nextBox && !nextBox->lineLayoutItem().node()) 3208 while (nextBox && !nextBox->getLineLayoutItem().node())
3209 nextBox = nextBox->nextLeafChild(); 3209 nextBox = nextBox->nextLeafChild();
3210 3210
3211 if (nextBox) { 3211 if (nextBox) {
3212 box = nextBox; 3212 box = nextBox;
3213 layoutObject = LineLayoutAPIShim::layoutObjectFrom(box->lineLayo utItem()); 3213 layoutObject = LineLayoutAPIShim::layoutObjectFrom(box->getLineL ayoutItem());
3214 offset = box->caretLeftmostOffset(); 3214 offset = box->caretLeftmostOffset();
3215 3215
3216 if (box->bidiLevel() > level) { 3216 if (box->bidiLevel() > level) {
3217 do { 3217 do {
3218 nextBox = nextBox->nextLeafChild(); 3218 nextBox = nextBox->nextLeafChild();
3219 } while (nextBox && nextBox->bidiLevel() > level); 3219 } while (nextBox && nextBox->bidiLevel() > level);
3220 3220
3221 if (!nextBox || nextBox->bidiLevel() < level) 3221 if (!nextBox || nextBox->bidiLevel() < level)
3222 continue; 3222 continue;
3223 } 3223 }
(...skipping 10 matching lines...) Expand all
3234 level = box->bidiLevel(); 3234 level = box->bidiLevel();
3235 while (InlineBox* nextBox = box->nextLeafChild()) { 3235 while (InlineBox* nextBox = box->nextLeafChild()) {
3236 if (nextBox->bidiLevel() < level) 3236 if (nextBox->bidiLevel() < level)
3237 break; 3237 break;
3238 box = nextBox; 3238 box = nextBox;
3239 } 3239 }
3240 if (box->bidiLevel() == level) 3240 if (box->bidiLevel() == level)
3241 break; 3241 break;
3242 level = box->bidiLevel(); 3242 level = box->bidiLevel();
3243 } 3243 }
3244 layoutObject = LineLayoutAPIShim::layoutObjectFrom(box->lineLayo utItem()); 3244 layoutObject = LineLayoutAPIShim::layoutObjectFrom(box->getLineL ayoutItem());
3245 offset = primaryDirection == LTR ? box->caretMaxOffset() : box-> caretMinOffset(); 3245 offset = primaryDirection == LTR ? box->caretMaxOffset() : box-> caretMinOffset();
3246 } 3246 }
3247 break; 3247 break;
3248 } 3248 }
3249 3249
3250 p = PositionTemplate<Strategy>::editingPositionOf(layoutObject->node(), offset); 3250 p = PositionTemplate<Strategy>::editingPositionOf(layoutObject->node(), offset);
3251 3251
3252 if ((isVisuallyEquivalentCandidate(p) && mostForwardCaretPosition(p) != downstreamStart) || p.atStartOfTree() || p.atEndOfTree()) 3252 if ((isVisuallyEquivalentCandidate(p) && mostForwardCaretPosition(p) != downstreamStart) || p.atStartOfTree() || p.atEndOfTree())
3253 return p; 3253 return p;
3254 3254
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
3364 { 3364 {
3365 return previousPositionOfAlgorithm<EditingStrategy>(visiblePosition, rule); 3365 return previousPositionOfAlgorithm<EditingStrategy>(visiblePosition, rule);
3366 } 3366 }
3367 3367
3368 VisiblePositionInFlatTree previousPositionOf(const VisiblePositionInFlatTree& vi siblePosition, EditingBoundaryCrossingRule rule) 3368 VisiblePositionInFlatTree previousPositionOf(const VisiblePositionInFlatTree& vi siblePosition, EditingBoundaryCrossingRule rule)
3369 { 3369 {
3370 return previousPositionOfAlgorithm<EditingInFlatTreeStrategy>(visiblePositio n, rule); 3370 return previousPositionOfAlgorithm<EditingInFlatTreeStrategy>(visiblePositio n, rule);
3371 } 3371 }
3372 3372
3373 } // namespace blink 3373 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698