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

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

Issue 1858163002: Rename inDocument() to inShadowIncludingDocument() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 8 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
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 384 matching lines...) Expand 10 before | Expand all | Expand 10 after
395 m_frame->selection().clear(); 395 m_frame->selection().clear();
396 } 396 }
397 397
398 void DOMSelection::addRange(Range* newRange) 398 void DOMSelection::addRange(Range* newRange)
399 { 399 {
400 ASSERT(newRange); 400 ASSERT(newRange);
401 401
402 if (!m_frame) 402 if (!m_frame)
403 return; 403 return;
404 404
405 if (!newRange->inDocument()) { 405 if (!newRange->inShadowIncludingDocument()) {
406 addConsoleError("The given range isn't in document."); 406 addConsoleError("The given range isn't in document.");
407 return; 407 return;
408 } 408 }
409 409
410 FrameSelection& selection = m_frame->selection(); 410 FrameSelection& selection = m_frame->selection();
411 411
412 if (selection.isNone()) { 412 if (selection.isNone()) {
413 selection.setSelectedRange(newRange, VP_DEFAULT_AFFINITY); 413 selection.setSelectedRange(newRange, VP_DEFAULT_AFFINITY);
414 return; 414 return;
415 } 415 }
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
566 m_treeScope->document().addConsoleMessage(ConsoleMessage::create(JSMessa geSource, ErrorMessageLevel, message)); 566 m_treeScope->document().addConsoleMessage(ConsoleMessage::create(JSMessa geSource, ErrorMessageLevel, message));
567 } 567 }
568 568
569 DEFINE_TRACE(DOMSelection) 569 DEFINE_TRACE(DOMSelection)
570 { 570 {
571 visitor->trace(m_treeScope); 571 visitor->trace(m_treeScope);
572 DOMWindowProperty::trace(visitor); 572 DOMWindowProperty::trace(visitor);
573 } 573 }
574 574
575 } // namespace blink 575 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/dom/shadow/ShadowRoot.cpp ('k') | third_party/WebKit/Source/core/editing/EphemeralRange.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698