OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2007, 2009 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007, 2009 Apple Inc. All rights reserved. |
3 * Copyright (C) 2012 Google Inc. All rights reserved. | 3 * Copyright (C) 2012 Google Inc. All rights reserved. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
7 * are met: | 7 * are met: |
8 * | 8 * |
9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
207 | 207 |
208 if (!isValidForPosition(node)) | 208 if (!isValidForPosition(node)) |
209 return; | 209 return; |
210 RefPtrWillBeRawPtr<Range> range = Range::create(node->document()); | 210 RefPtrWillBeRawPtr<Range> range = Range::create(node->document()); |
211 range->setStart(node, offset, exceptionState); | 211 range->setStart(node, offset, exceptionState); |
212 if (exceptionState.hadException()) | 212 if (exceptionState.hadException()) |
213 return; | 213 return; |
214 range->setEnd(node, offset, exceptionState); | 214 range->setEnd(node, offset, exceptionState); |
215 if (exceptionState.hadException()) | 215 if (exceptionState.hadException()) |
216 return; | 216 return; |
217 m_frame->selection().setSelectedRange(range.get(), DOWNSTREAM, m_frame->sele
ction().isDirectional()); | 217 m_frame->selection().setSelectedRange(range.get(), DOWNSTREAM, m_frame->sele
ction().isDirectional() ? FrameSelection::Directional : FrameSelection::NonDirec
tional); |
218 } | 218 } |
219 | 219 |
220 void DOMSelection::collapse(Node* node, ExceptionState& exceptionState) | 220 void DOMSelection::collapse(Node* node, ExceptionState& exceptionState) |
221 { | 221 { |
222 collapse(node, 0, exceptionState); | 222 collapse(node, 0, exceptionState); |
223 } | 223 } |
224 | 224 |
225 void DOMSelection::collapseToEnd(ExceptionState& exceptionState) | 225 void DOMSelection::collapseToEnd(ExceptionState& exceptionState) |
226 { | 226 { |
227 if (!m_frame) | 227 if (!m_frame) |
(...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
555 return node->document() == m_frame->document(); | 555 return node->document() == m_frame->document(); |
556 } | 556 } |
557 | 557 |
558 void DOMSelection::addConsoleError(const String& message) | 558 void DOMSelection::addConsoleError(const String& message) |
559 { | 559 { |
560 if (m_treeScope) | 560 if (m_treeScope) |
561 m_treeScope->document().addConsoleMessage(JSMessageSource, ErrorMessageL
evel, message); | 561 m_treeScope->document().addConsoleMessage(JSMessageSource, ErrorMessageL
evel, message); |
562 } | 562 } |
563 | 563 |
564 } // namespace WebCore | 564 } // namespace WebCore |
OLD | NEW |