OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 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 are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 14 matching lines...) Expand all Loading... |
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
29 */ | 29 */ |
30 | 30 |
31 #include "config.h" | 31 #include "config.h" |
32 #include "WebRange.h" | 32 #include "WebRange.h" |
33 | 33 |
34 #include "WebExceptionCode.h" | 34 #include "WebExceptionCode.h" |
35 #include "WebFrameImpl.h" | 35 #include "WebLocalFrameImpl.h" |
36 #include "WebNode.h" | 36 #include "WebNode.h" |
37 #include "bindings/v8/ExceptionState.h" | 37 #include "bindings/v8/ExceptionState.h" |
38 #include "bindings/v8/ExceptionStatePlaceholder.h" | 38 #include "bindings/v8/ExceptionStatePlaceholder.h" |
39 #include "core/dom/Document.h" | 39 #include "core/dom/Document.h" |
40 #include "core/dom/Element.h" | 40 #include "core/dom/Element.h" |
41 #include "core/dom/Range.h" | 41 #include "core/dom/Range.h" |
42 #include "core/dom/shadow/ShadowRoot.h" | 42 #include "core/dom/shadow/ShadowRoot.h" |
43 #include "core/editing/FrameSelection.h" | 43 #include "core/editing/FrameSelection.h" |
44 #include "core/editing/PlainTextRange.h" | 44 #include "core/editing/PlainTextRange.h" |
45 #include "core/frame/FrameView.h" | 45 #include "core/frame/FrameView.h" |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 WebRange WebRange::expandedToParagraph() const | 103 WebRange WebRange::expandedToParagraph() const |
104 { | 104 { |
105 WebRange copy(*this); | 105 WebRange copy(*this); |
106 copy.m_private->expand("block", IGNORE_EXCEPTION); | 106 copy.m_private->expand("block", IGNORE_EXCEPTION); |
107 return copy; | 107 return copy; |
108 } | 108 } |
109 | 109 |
110 // static | 110 // static |
111 WebRange WebRange::fromDocumentRange(WebLocalFrame* frame, int start, int length
) | 111 WebRange WebRange::fromDocumentRange(WebLocalFrame* frame, int start, int length
) |
112 { | 112 { |
113 WebCore::LocalFrame* webFrame = toWebFrameImpl(frame)->frame(); | 113 WebCore::LocalFrame* webFrame = toWebLocalFrameImpl(frame)->frame(); |
114 Element* selectionRoot = webFrame->selection().rootEditableElement(); | 114 Element* selectionRoot = webFrame->selection().rootEditableElement(); |
115 ContainerNode* scope = selectionRoot ? selectionRoot : webFrame->document()-
>documentElement(); | 115 ContainerNode* scope = selectionRoot ? selectionRoot : webFrame->document()-
>documentElement(); |
116 return PlainTextRange(start, start + length).createRange(*scope); | 116 return PlainTextRange(start, start + length).createRange(*scope); |
117 } | 117 } |
118 | 118 |
119 WebVector<WebFloatQuad> WebRange::textQuads() const | 119 WebVector<WebFloatQuad> WebRange::textQuads() const |
120 { | 120 { |
121 if (isNull()) | 121 if (isNull()) |
122 return WebVector<WebFloatQuad>(); | 122 return WebVector<WebFloatQuad>(); |
123 | 123 |
(...skipping 17 matching lines...) Expand all Loading... |
141 : m_private(range) | 141 : m_private(range) |
142 { | 142 { |
143 } | 143 } |
144 | 144 |
145 WebRange::operator PassRefPtrWillBeRawPtr<WebCore::Range>() const | 145 WebRange::operator PassRefPtrWillBeRawPtr<WebCore::Range>() const |
146 { | 146 { |
147 return m_private.get(); | 147 return m_private.get(); |
148 } | 148 } |
149 | 149 |
150 } // namespace blink | 150 } // namespace blink |
OLD | NEW |