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

Side by Side Diff: Source/core/dom/Position.cpp

Issue 1262503010: Get rid of a redundant createLegacyEditingPosition() call in PositionAlgorithm<Strategy>::upstream() (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 2015-08-04T13:43:22 Created 5 years, 4 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2004, 2005, 2006, 2009 Apple Inc. All rights reserved. 2 * Copyright (C) 2004, 2005, 2006, 2009 Apple Inc. All rights reserved.
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 824 matching lines...) Expand 10 before | Expand all | Expand 10 after
835 if (Strategy::editingIgnoresContent(currentNode) || isRenderedHTMLTableE lement(currentNode)) { 835 if (Strategy::editingIgnoresContent(currentNode) || isRenderedHTMLTableE lement(currentNode)) {
836 if (currentPos.offsetInLeafNode() <= layoutObject->caretMinOffset()) 836 if (currentPos.offsetInLeafNode() <= layoutObject->caretMinOffset())
837 return createLegacyEditingPosition(currentNode, layoutObject->ca retMinOffset()); 837 return createLegacyEditingPosition(currentNode, layoutObject->ca retMinOffset());
838 continue; 838 continue;
839 } 839 }
840 840
841 // return current position if it is in laid out text 841 // return current position if it is in laid out text
842 if (layoutObject->isText() && toLayoutText(layoutObject)->firstTextBox() ) { 842 if (layoutObject->isText() && toLayoutText(layoutObject)->firstTextBox() ) {
843 if (currentNode != startNode) { 843 if (currentNode != startNode) {
844 ASSERT(currentPos.atStartOfNode()); 844 ASSERT(currentPos.atStartOfNode());
845 return createLegacyEditingPosition(currentNode, layoutObject->ca retMinOffset()); 845 return PositionAlgorithm<Strategy>(currentNode, layoutObject->ca retMinOffset());
846 } 846 }
847 847
848 unsigned textOffset = currentPos.offsetInLeafNode(); 848 unsigned textOffset = currentPos.offsetInLeafNode();
849 LayoutText* textLayoutObject = toLayoutText(layoutObject); 849 LayoutText* textLayoutObject = toLayoutText(layoutObject);
850 InlineTextBox* lastTextBox = textLayoutObject->lastTextBox(); 850 InlineTextBox* lastTextBox = textLayoutObject->lastTextBox();
851 for (InlineTextBox* box = textLayoutObject->firstTextBox(); box; box = box->nextTextBox()) { 851 for (InlineTextBox* box = textLayoutObject->firstTextBox(); box; box = box->nextTextBox()) {
852 if (textOffset <= box->end()) { 852 if (textOffset <= box->end()) {
853 if (textOffset >= box->start()) 853 if (textOffset >= box->start())
854 return currentPos.deprecatedComputePosition(); 854 return currentPos.deprecatedComputePosition();
855 continue; 855 continue;
(...skipping 682 matching lines...) Expand 10 before | Expand all | Expand 10 after
1538 1538
1539 void showTree(const blink::Position* pos) 1539 void showTree(const blink::Position* pos)
1540 { 1540 {
1541 if (pos) 1541 if (pos)
1542 pos->showTreeForThis(); 1542 pos->showTreeForThis();
1543 else 1543 else
1544 fprintf(stderr, "Cannot showTree for (nil)\n"); 1544 fprintf(stderr, "Cannot showTree for (nil)\n");
1545 } 1545 }
1546 1546
1547 #endif 1547 #endif
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698