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

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

Issue 1477313003: Make SelectionEditor::setWithoutValidation() not to use obsoleted layout objects (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 2015-11-30T10:45:57 Created 5 years 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 | third_party/WebKit/Source/core/editing/SelectionEditor.h » ('j') | 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 271 matching lines...) Expand 10 before | Expand all | Expand 10 after
282 Node* PositionTemplate<Strategy>::commonAncestorContainer(const PositionTemplate <Strategy>& other) const 282 Node* PositionTemplate<Strategy>::commonAncestorContainer(const PositionTemplate <Strategy>& other) const
283 { 283 {
284 return Strategy::commonAncestor(*computeContainerNode(), *other.computeConta inerNode()); 284 return Strategy::commonAncestor(*computeContainerNode(), *other.computeConta inerNode());
285 } 285 }
286 286
287 int comparePositions(const PositionInComposedTree& positionA, const PositionInCo mposedTree& positionB) 287 int comparePositions(const PositionInComposedTree& positionA, const PositionInCo mposedTree& positionB)
288 { 288 {
289 ASSERT(positionA.isNotNull()); 289 ASSERT(positionA.isNotNull());
290 ASSERT(positionB.isNotNull()); 290 ASSERT(positionB.isNotNull());
291 291
292 positionA.anchorNode()->updateDistribution();
292 Node* containerA = positionA.computeContainerNode(); 293 Node* containerA = positionA.computeContainerNode();
294 positionB.anchorNode()->updateDistribution();
293 Node* containerB = positionB.computeContainerNode(); 295 Node* containerB = positionB.computeContainerNode();
294 int offsetA = positionA.computeOffsetInContainerNode(); 296 int offsetA = positionA.computeOffsetInContainerNode();
295 int offsetB = positionB.computeOffsetInContainerNode(); 297 int offsetB = positionB.computeOffsetInContainerNode();
296 return comparePositionsInComposedTree(containerA, offsetA, containerB, offse tB); 298 return comparePositionsInComposedTree(containerA, offsetA, containerB, offse tB);
297 } 299 }
298 300
299 template <typename Strategy> 301 template <typename Strategy>
300 int PositionTemplate<Strategy>::compareTo(const PositionTemplate<Strategy>& othe r) const 302 int PositionTemplate<Strategy>::compareTo(const PositionTemplate<Strategy>& othe r) const
301 { 303 {
302 return comparePositions(*this, other); 304 return comparePositions(*this, other);
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after
538 540
539 void showTree(const blink::Position* pos) 541 void showTree(const blink::Position* pos)
540 { 542 {
541 if (pos) 543 if (pos)
542 pos->showTreeForThis(); 544 pos->showTreeForThis();
543 else 545 else
544 fprintf(stderr, "Cannot showTree for (nil)\n"); 546 fprintf(stderr, "Cannot showTree for (nil)\n");
545 } 547 }
546 548
547 #endif 549 #endif
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/editing/SelectionEditor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698