| OLD | NEW |
| 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 Loading... |
| 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(Node* container); | 38 explicit RangeBoundaryPoint(Node* container); |
| 39 | 39 |
| 40 explicit RangeBoundaryPoint(const RangeBoundaryPoint&); | 40 explicit RangeBoundaryPoint(const RangeBoundaryPoint&); |
| 41 | 41 |
| 42 bool inShadowIncludingDocument() const; | 42 bool isConnected() 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(Node* container, int offset, Node* childBefore); | 51 void set(Node* container, int offset, Node* childBefore); |
| 52 void setOffset(int); | 52 void setOffset(int); |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 return; | 115 return; |
| 116 DCHECK(!m_containerNode->isCharacterDataNode()); | 116 DCHECK(!m_containerNode->isCharacterDataNode()); |
| 117 markValid(); | 117 markValid(); |
| 118 if (!m_childBeforeBoundary) { | 118 if (!m_childBeforeBoundary) { |
| 119 m_offsetInContainer = 0; | 119 m_offsetInContainer = 0; |
| 120 return; | 120 return; |
| 121 } | 121 } |
| 122 m_offsetInContainer = m_childBeforeBoundary->nodeIndex() + 1; | 122 m_offsetInContainer = m_childBeforeBoundary->nodeIndex() + 1; |
| 123 } | 123 } |
| 124 | 124 |
| 125 inline bool RangeBoundaryPoint::inShadowIncludingDocument() const | 125 inline bool RangeBoundaryPoint::isConnected() const |
| 126 { | 126 { |
| 127 return m_containerNode && m_containerNode->inShadowIncludingDocument(); | 127 return m_containerNode && m_containerNode->isConnected(); |
| 128 } | 128 } |
| 129 | 129 |
| 130 inline bool RangeBoundaryPoint::isOffsetValid() const | 130 inline bool RangeBoundaryPoint::isOffsetValid() const |
| 131 { | 131 { |
| 132 if (m_offsetInContainer == invalidOffset) { | 132 if (m_offsetInContainer == invalidOffset) { |
| 133 DCHECK(!m_containerNode->isTextNode()); | 133 DCHECK(!m_containerNode->isTextNode()); |
| 134 return false; | 134 return false; |
| 135 } | 135 } |
| 136 return domTreeVersion() == m_domTreeVersion || m_containerNode->isCharacterD
ataNode(); | 136 return domTreeVersion() == m_domTreeVersion || m_containerNode->isCharacterD
ataNode(); |
| 137 } | 137 } |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 242 } else { | 242 } else { |
| 243 if (a.offset() != b.offset()) | 243 if (a.offset() != b.offset()) |
| 244 return false; | 244 return false; |
| 245 } | 245 } |
| 246 return true; | 246 return true; |
| 247 } | 247 } |
| 248 | 248 |
| 249 } // namespace blink | 249 } // namespace blink |
| 250 | 250 |
| 251 #endif | 251 #endif |
| OLD | NEW |