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

Side by Side Diff: third_party/WebKit/Source/core/dom/RangeBoundaryPoint.h

Issue 1858163002: Rename inDocument() to inShadowIncludingDocument() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase 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) 2008 Apple Inc. All Rights Reserved. 2 * Copyright (C) 2008 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 21 matching lines...) Expand all
32 32
33 namespace blink { 33 namespace blink {
34 34
35 class RangeBoundaryPoint { 35 class RangeBoundaryPoint {
36 DISALLOW_NEW(); 36 DISALLOW_NEW();
37 public: 37 public:
38 explicit RangeBoundaryPoint(RawPtr<Node> container); 38 explicit RangeBoundaryPoint(RawPtr<Node> container);
39 39
40 explicit RangeBoundaryPoint(const RangeBoundaryPoint&); 40 explicit RangeBoundaryPoint(const RangeBoundaryPoint&);
41 41
42 bool inDocument() const; 42 bool inShadowIncludingDocument() const;
43 const Position toPosition() const; 43 const Position toPosition() const;
44 44
45 Node* container() const; 45 Node* container() const;
46 int offset() const; 46 int offset() const;
47 Node* childBefore() const; 47 Node* childBefore() const;
48 48
49 void clear(); 49 void clear();
50 50
51 void set(RawPtr<Node> container, int offset, Node* childBefore); 51 void set(RawPtr<Node> container, int offset, Node* childBefore);
52 void setOffset(int); 52 void setOffset(int);
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 100
101 inline void RangeBoundaryPoint::ensureOffsetIsValid() const 101 inline void RangeBoundaryPoint::ensureOffsetIsValid() const
102 { 102 {
103 if (m_offsetInContainer >= 0) 103 if (m_offsetInContainer >= 0)
104 return; 104 return;
105 105
106 ASSERT(m_childBeforeBoundary); 106 ASSERT(m_childBeforeBoundary);
107 m_offsetInContainer = m_childBeforeBoundary->nodeIndex() + 1; 107 m_offsetInContainer = m_childBeforeBoundary->nodeIndex() + 1;
108 } 108 }
109 109
110 inline bool RangeBoundaryPoint::inDocument() const 110 inline bool RangeBoundaryPoint::inShadowIncludingDocument() const
111 { 111 {
112 return m_containerNode && m_containerNode->inDocument(); 112 return m_containerNode && m_containerNode->inShadowIncludingDocument();
113 } 113 }
114 114
115 inline const Position RangeBoundaryPoint::toPosition() const 115 inline const Position RangeBoundaryPoint::toPosition() const
116 { 116 {
117 ensureOffsetIsValid(); 117 ensureOffsetIsValid();
118 return Position::editingPositionOf(m_containerNode.get(), m_offsetInContaine r); 118 return Position::editingPositionOf(m_containerNode.get(), m_offsetInContaine r);
119 } 119 }
120 120
121 inline int RangeBoundaryPoint::offset() const 121 inline int RangeBoundaryPoint::offset() const
122 { 122 {
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
202 } else { 202 } else {
203 if (a.offset() != b.offset()) 203 if (a.offset() != b.offset())
204 return false; 204 return false;
205 } 205 }
206 return true; 206 return true;
207 } 207 }
208 208
209 } // namespace blink 209 } // namespace blink
210 210
211 #endif 211 #endif
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/dom/Range.cpp ('k') | third_party/WebKit/Source/core/dom/ScriptLoader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698