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 435 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
446 | 446 |
447 if (selection.isNone()) | 447 if (selection.isNone()) |
448 return; | 448 return; |
449 | 449 |
450 RefPtrWillBeRawPtr<Range> selectedRange = selection.selection().toNormalized
Range(); | 450 RefPtrWillBeRawPtr<Range> selectedRange = selection.selection().toNormalized
Range(); |
451 if (!selectedRange) | 451 if (!selectedRange) |
452 return; | 452 return; |
453 | 453 |
454 selectedRange->deleteContents(ASSERT_NO_EXCEPTION); | 454 selectedRange->deleteContents(ASSERT_NO_EXCEPTION); |
455 | 455 |
456 setBaseAndExtent(selectedRange->startContainer(ASSERT_NO_EXCEPTION), selecte
dRange->startOffset(), selectedRange->startContainer(), selectedRange->startOffs
et(), ASSERT_NO_EXCEPTION); | 456 setBaseAndExtent(selectedRange->startContainer(), selectedRange->startOffset
(), selectedRange->startContainer(), selectedRange->startOffset(), ASSERT_NO_EXC
EPTION); |
457 } | 457 } |
458 | 458 |
459 bool DOMSelection::containsNode(const Node* n, bool allowPartial) const | 459 bool DOMSelection::containsNode(const Node* n, bool allowPartial) const |
460 { | 460 { |
461 if (!m_frame) | 461 if (!m_frame) |
462 return false; | 462 return false; |
463 | 463 |
464 FrameSelection& selection = m_frame->selection(); | 464 FrameSelection& selection = m_frame->selection(); |
465 | 465 |
466 if (!n || m_frame->document() != n->document() || selection.isNone()) | 466 if (!n || m_frame->document() != n->document() || selection.isNone()) |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
550 return node->document() == m_frame->document(); | 550 return node->document() == m_frame->document(); |
551 } | 551 } |
552 | 552 |
553 void DOMSelection::addConsoleError(const String& message) | 553 void DOMSelection::addConsoleError(const String& message) |
554 { | 554 { |
555 if (m_treeScope) | 555 if (m_treeScope) |
556 m_treeScope->document().addConsoleMessage(JSMessageSource, ErrorMessageL
evel, message); | 556 m_treeScope->document().addConsoleMessage(JSMessageSource, ErrorMessageL
evel, message); |
557 } | 557 } |
558 | 558 |
559 } // namespace WebCore | 559 } // namespace WebCore |
OLD | NEW |