Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(149)

Side by Side Diff: Source/core/page/DOMSelection.cpp

Issue 252783002: Make Range.detach() a no-op (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/core/frame/UseCounter.cpp ('k') | Source/web/ContextMenuClientImpl.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « Source/core/frame/UseCounter.cpp ('k') | Source/web/ContextMenuClientImpl.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698