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

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

Issue 1958093002: CONTINUED Make FrameSelection to hold non-canonicalized positions Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 2017-01-16T20:04:35 Created 3 years, 11 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 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 if (m_anchorNode) 114 if (m_anchorNode)
115 DCHECK_GE(offset, 0); 115 DCHECK_GE(offset, 0);
116 else 116 else
117 DCHECK_EQ(offset, 0); 117 DCHECK_EQ(offset, 0);
118 #if DCHECK_IS_ON() 118 #if DCHECK_IS_ON()
119 DCHECK(canBeAnchorNode<Strategy>(m_anchorNode.get())) << m_anchorNode; 119 DCHECK(canBeAnchorNode<Strategy>(m_anchorNode.get())) << m_anchorNode;
120 #endif 120 #endif
121 } 121 }
122 122
123 template <typename Strategy> 123 template <typename Strategy>
124 PositionTemplate<Strategy>::PositionTemplate(const Node& anchorNode, int offset)
125 : PositionTemplate(const_cast<Node*>(&anchorNode), offset) {}
126
127 template <typename Strategy>
124 PositionTemplate<Strategy>::PositionTemplate(const PositionTemplate& other) 128 PositionTemplate<Strategy>::PositionTemplate(const PositionTemplate& other)
125 : m_anchorNode(other.m_anchorNode), 129 : m_anchorNode(other.m_anchorNode),
126 m_offset(other.m_offset), 130 m_offset(other.m_offset),
127 m_anchorType(other.m_anchorType) {} 131 m_anchorType(other.m_anchorType) {}
128 132
129 // -- 133 // --
130 134
131 template <typename Strategy> 135 template <typename Strategy>
132 Node* PositionTemplate<Strategy>::computeContainerNode() const { 136 Node* PositionTemplate<Strategy>::computeContainerNode() const {
133 if (!m_anchorNode) 137 if (!m_anchorNode)
(...skipping 538 matching lines...) Expand 10 before | Expand all | Expand 10 after
672 } 676 }
673 677
674 void showTree(const blink::Position* pos) { 678 void showTree(const blink::Position* pos) {
675 if (pos) 679 if (pos)
676 pos->showTreeForThis(); 680 pos->showTreeForThis();
677 else 681 else
678 LOG(INFO) << "Cannot showTree for <null>"; 682 LOG(INFO) << "Cannot showTree for <null>";
679 } 683 }
680 684
681 #endif 685 #endif
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/editing/Position.h ('k') | third_party/WebKit/Source/core/editing/SelectionController.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698