| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 Google 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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 m_private.reset(new SurroundingText(*range, maxLength)); | 51 m_private.reset(new SurroundingText(*range, maxLength)); |
| 52 } | 52 } |
| 53 | 53 |
| 54 WebString WebSurroundingText::textContent() const | 54 WebString WebSurroundingText::textContent() const |
| 55 { | 55 { |
| 56 return m_private->content(); | 56 return m_private->content(); |
| 57 } | 57 } |
| 58 | 58 |
| 59 size_t WebSurroundingText::hitOffsetInTextContent() const | 59 size_t WebSurroundingText::hitOffsetInTextContent() const |
| 60 { | 60 { |
| 61 ASSERT(m_private->startOffsetInContent() == m_private->endOffsetInContent())
; | 61 DCHECK_EQ(m_private->startOffsetInContent(), m_private->endOffsetInContent()
); |
| 62 return m_private->startOffsetInContent(); | 62 return m_private->startOffsetInContent(); |
| 63 } | 63 } |
| 64 | 64 |
| 65 size_t WebSurroundingText::startOffsetInTextContent() const | 65 size_t WebSurroundingText::startOffsetInTextContent() const |
| 66 { | 66 { |
| 67 return m_private->startOffsetInContent(); | 67 return m_private->startOffsetInContent(); |
| 68 } | 68 } |
| 69 | 69 |
| 70 size_t WebSurroundingText::endOffsetInTextContent() const | 70 size_t WebSurroundingText::endOffsetInTextContent() const |
| 71 { | 71 { |
| 72 return m_private->endOffsetInContent(); | 72 return m_private->endOffsetInContent(); |
| 73 } | 73 } |
| 74 | 74 |
| 75 WebRange WebSurroundingText::rangeFromContentOffsets(size_t startOffsetInContent
, size_t endOffsetInContent) | 75 WebRange WebSurroundingText::rangeFromContentOffsets(size_t startOffsetInContent
, size_t endOffsetInContent) |
| 76 { | 76 { |
| 77 return m_private->rangeFromContentOffsets(startOffsetInContent, endOffsetInC
ontent); | 77 return m_private->rangeFromContentOffsets(startOffsetInContent, endOffsetInC
ontent); |
| 78 } | 78 } |
| 79 | 79 |
| 80 bool WebSurroundingText::isNull() const | 80 bool WebSurroundingText::isNull() const |
| 81 { | 81 { |
| 82 return !m_private.get(); | 82 return !m_private.get(); |
| 83 } | 83 } |
| 84 | 84 |
| 85 void WebSurroundingText::reset() | 85 void WebSurroundingText::reset() |
| 86 { | 86 { |
| 87 m_private.reset(0); | 87 m_private.reset(0); |
| 88 } | 88 } |
| 89 | 89 |
| 90 } // namespace blink | 90 } // namespace blink |
| OLD | NEW |