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

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

Issue 1885453002: Rename Node::treeScope() to Node::treeScopeOrDocument() Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebased Created 4 years, 8 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, 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 28 matching lines...) Expand all
39 { 39 {
40 return !node || !node->isPseudoElement(); 40 return !node || !node->isPseudoElement();
41 } 41 }
42 #endif 42 #endif
43 43
44 template <typename Strategy> 44 template <typename Strategy>
45 const TreeScope* PositionTemplate<Strategy>::commonAncestorTreeScope(const Posit ionTemplate<Strategy>& a, const PositionTemplate<Strategy>& b) 45 const TreeScope* PositionTemplate<Strategy>::commonAncestorTreeScope(const Posit ionTemplate<Strategy>& a, const PositionTemplate<Strategy>& b)
46 { 46 {
47 if (!a.computeContainerNode() || !b.computeContainerNode()) 47 if (!a.computeContainerNode() || !b.computeContainerNode())
48 return nullptr; 48 return nullptr;
49 return a.computeContainerNode()->treeScope().commonAncestorTreeScope(b.compu teContainerNode()->treeScope()); 49 return a.computeContainerNode()->treeScopeOrDocument().commonAncestorTreeSco pe(b.computeContainerNode()->treeScopeOrDocument());
50 } 50 }
51 51
52 52
53 template <typename Strategy> 53 template <typename Strategy>
54 PositionTemplate<Strategy> PositionTemplate<Strategy>::editingPositionOf(Node* a nchorNode, int offset) 54 PositionTemplate<Strategy> PositionTemplate<Strategy>::editingPositionOf(Node* a nchorNode, int offset)
55 { 55 {
56 if (!anchorNode || anchorNode->isTextNode()) 56 if (!anchorNode || anchorNode->isTextNode())
57 return PositionTemplate<Strategy>(anchorNode, offset); 57 return PositionTemplate<Strategy>(anchorNode, offset);
58 58
59 if (!Strategy::editingIgnoresContent(anchorNode)) 59 if (!Strategy::editingIgnoresContent(anchorNode))
(...skipping 523 matching lines...) Expand 10 before | Expand all | Expand 10 after
583 583
584 void showTree(const blink::Position* pos) 584 void showTree(const blink::Position* pos)
585 { 585 {
586 if (pos) 586 if (pos)
587 pos->showTreeForThis(); 587 pos->showTreeForThis();
588 else 588 else
589 fprintf(stderr, "Cannot showTree for (nil)\n"); 589 fprintf(stderr, "Cannot showTree for (nil)\n");
590 } 590 }
591 591
592 #endif 592 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698