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

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

Issue 2278463002: Get rid of FrameSelection::moveTo() taking two VisiblePosition objects (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 2016-08-24T17:07:58 Created 4 years, 3 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 | third_party/WebKit/Source/core/editing/FrameSelection.h » ('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 277 matching lines...) Expand 10 before | Expand all | Expand 10 after
288 } 288 }
289 289
290 if (!baseNode || !extentNode) 290 if (!baseNode || !extentNode)
291 UseCounter::count(m_frame, UseCounter::SelectionSetBaseAndExtentNull); 291 UseCounter::count(m_frame, UseCounter::SelectionSetBaseAndExtentNull);
292 292
293 if (!isValidForPosition(baseNode) || !isValidForPosition(extentNode)) 293 if (!isValidForPosition(baseNode) || !isValidForPosition(extentNode))
294 return; 294 return;
295 295
296 VisiblePosition visibleBase = createVisiblePosition(createPosition(baseNode, baseOffset)); 296 VisiblePosition visibleBase = createVisiblePosition(createPosition(baseNode, baseOffset));
297 VisiblePosition visibleExtent = createVisiblePosition(createPosition(extentN ode, extentOffset)); 297 VisiblePosition visibleExtent = createVisiblePosition(createPosition(extentN ode, extentOffset));
298 298 const bool selectionHasDirection = true;
299 m_frame->selection().moveTo(visibleBase, visibleExtent); 299 m_frame->selection().setSelection(VisibleSelection(visibleBase, visibleExten t, selectionHasDirection));
300 } 300 }
301 301
302 void DOMSelection::modify(const String& alterString, const String& directionStri ng, const String& granularityString) 302 void DOMSelection::modify(const String& alterString, const String& directionStri ng, const String& granularityString)
303 { 303 {
304 if (!isAvailable()) 304 if (!isAvailable())
305 return; 305 return;
306 306
307 FrameSelection::EAlteration alter; 307 FrameSelection::EAlteration alter;
308 if (equalIgnoringCase(alterString, "extend")) 308 if (equalIgnoringCase(alterString, "extend"))
309 alter = FrameSelection::AlterationExtend; 309 alter = FrameSelection::AlterationExtend;
(...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after
586 m_treeScope->document().addConsoleMessage(ConsoleMessage::create(JSMessa geSource, ErrorMessageLevel, message)); 586 m_treeScope->document().addConsoleMessage(ConsoleMessage::create(JSMessa geSource, ErrorMessageLevel, message));
587 } 587 }
588 588
589 DEFINE_TRACE(DOMSelection) 589 DEFINE_TRACE(DOMSelection)
590 { 590 {
591 visitor->trace(m_treeScope); 591 visitor->trace(m_treeScope);
592 DOMWindowProperty::trace(visitor); 592 DOMWindowProperty::trace(visitor);
593 } 593 }
594 594
595 } // namespace blink 595 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/editing/FrameSelection.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698