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

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

Issue 1315813002: Make DOMSelection to use VisibleSelection::toNormalizedEphemeralRange() instead of toNormalizedRange (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 2015-08-25T15:38:17 Created 5 years, 4 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
« no previous file with comments | « no previous file | no next file » | 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 427 matching lines...) Expand 10 before | Expand all | Expand 10 after
438 void DOMSelection::deleteFromDocument() 438 void DOMSelection::deleteFromDocument()
439 { 439 {
440 if (!m_frame) 440 if (!m_frame)
441 return; 441 return;
442 442
443 FrameSelection& selection = m_frame->selection(); 443 FrameSelection& selection = m_frame->selection();
444 444
445 if (selection.isNone()) 445 if (selection.isNone())
446 return; 446 return;
447 447
448 RefPtrWillBeRawPtr<Range> selectedRange = selection.selection().toNormalized Range(); 448 RefPtrWillBeRawPtr<Range> selectedRange = createRange(selection.selection(). toNormalizedEphemeralRange());
449 if (!selectedRange) 449 if (!selectedRange)
450 return; 450 return;
451 451
452 selectedRange->deleteContents(ASSERT_NO_EXCEPTION); 452 selectedRange->deleteContents(ASSERT_NO_EXCEPTION);
453 453
454 setBaseAndExtent(selectedRange->startContainer(), selectedRange->startOffset (), selectedRange->startContainer(), selectedRange->startOffset(), ASSERT_NO_EXC EPTION); 454 setBaseAndExtent(selectedRange->startContainer(), selectedRange->startOffset (), selectedRange->startContainer(), selectedRange->startOffset(), ASSERT_NO_EXC EPTION);
455 } 455 }
456 456
457 bool DOMSelection::containsNode(const Node* n, bool allowPartial) const 457 bool DOMSelection::containsNode(const Node* n, bool allowPartial) const
458 { 458 {
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
556 m_treeScope->document().addConsoleMessage(ConsoleMessage::create(JSMessa geSource, ErrorMessageLevel, message)); 556 m_treeScope->document().addConsoleMessage(ConsoleMessage::create(JSMessa geSource, ErrorMessageLevel, message));
557 } 557 }
558 558
559 DEFINE_TRACE(DOMSelection) 559 DEFINE_TRACE(DOMSelection)
560 { 560 {
561 visitor->trace(m_treeScope); 561 visitor->trace(m_treeScope);
562 DOMWindowProperty::trace(visitor); 562 DOMWindowProperty::trace(visitor);
563 } 563 }
564 564
565 } // namespace blink 565 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698