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

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

Issue 1258313006: Make startOfParagraph() not to use Position::deprecatedEditingOffset() (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 2015-08-03T15:27:45 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, 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 1117 matching lines...) Expand 10 before | Expand all | Expand 10 after
1128 if (!startNode) 1128 if (!startNode)
1129 return VisiblePosition(); 1129 return VisiblePosition();
1130 1130
1131 if (isRenderedAsNonInlineTableImageOrHR(startNode)) 1131 if (isRenderedAsNonInlineTableImageOrHR(startNode))
1132 return VisiblePosition(positionBeforeNode(startNode)); 1132 return VisiblePosition(positionBeforeNode(startNode));
1133 1133
1134 Element* startBlock = enclosingBlock(startNode); 1134 Element* startBlock = enclosingBlock(startNode);
1135 1135
1136 Node* node = startNode; 1136 Node* node = startNode;
1137 ContainerNode* highestRoot = highestEditableRoot(p); 1137 ContainerNode* highestRoot = highestEditableRoot(p);
1138 int offset = p.deprecatedEditingOffset(); 1138 int offset = p.computeEditingOffset();
1139 PositionAnchorType type = p.anchorType(); 1139 PositionAnchorType type = p.anchorType();
1140 1140
1141 Node* n = startNode; 1141 Node* n = startNode;
1142 bool startNodeIsEditable = startNode->hasEditableStyle(); 1142 bool startNodeIsEditable = startNode->hasEditableStyle();
1143 while (n) { 1143 while (n) {
1144 if (boundaryCrossingRule == CannotCrossEditingBoundary && !Position::nod eIsUserSelectAll(n) && n->hasEditableStyle() != startNodeIsEditable) 1144 if (boundaryCrossingRule == CannotCrossEditingBoundary && !Position::nod eIsUserSelectAll(n) && n->hasEditableStyle() != startNodeIsEditable)
1145 break; 1145 break;
1146 if (boundaryCrossingRule == CanSkipOverEditingBoundary) { 1146 if (boundaryCrossingRule == CanSkipOverEditingBoundary) {
1147 while (n && n->hasEditableStyle() != startNodeIsEditable) 1147 while (n && n->hasEditableStyle() != startNodeIsEditable)
1148 n = NodeTraversal::previousPostOrder(*n, startBlock); 1148 n = NodeTraversal::previousPostOrder(*n, startBlock);
(...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after
1452 HitTestRequest request = HitTestRequest::Move | HitTestRequest::ReadOnly | H itTestRequest::Active | HitTestRequest::IgnoreClipping; 1452 HitTestRequest request = HitTestRequest::Move | HitTestRequest::ReadOnly | H itTestRequest::Active | HitTestRequest::IgnoreClipping;
1453 HitTestResult result(request, contentsPoint); 1453 HitTestResult result(request, contentsPoint);
1454 frame->document()->layoutView()->hitTest(result); 1454 frame->document()->layoutView()->hitTest(result);
1455 1455
1456 if (Node* node = result.innerNode()) 1456 if (Node* node = result.innerNode())
1457 return frame->selection().selection().visiblePositionRespectingEditingBo undary(result.localPoint(), node); 1457 return frame->selection().selection().visiblePositionRespectingEditingBo undary(result.localPoint(), node);
1458 return VisiblePosition(); 1458 return VisiblePosition();
1459 } 1459 }
1460 1460
1461 } 1461 }
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