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

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

Issue 2776983003: Expand FrameSelection/SelectionEditor::firstRange() (Closed)
Patch Set: Created 3 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
« no previous file with comments | « third_party/WebKit/Source/core/editing/SelectionEditor.h ('k') | 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) 2004, 2008, 2009, 2010 Apple Inc. All rights reserved. 2 * Copyright (C) 2004, 2008, 2009, 2010 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after
341 didFinishDOMMutation(); 341 didFinishDOMMutation();
342 return; 342 return;
343 } 343 }
344 const Position& newBase = 344 const Position& newBase =
345 updatePostionAfterAdoptingTextNodeSplit(m_selection.m_base, oldNode); 345 updatePostionAfterAdoptingTextNodeSplit(m_selection.m_base, oldNode);
346 const Position& newExtent = 346 const Position& newExtent =
347 updatePostionAfterAdoptingTextNodeSplit(m_selection.m_extent, oldNode); 347 updatePostionAfterAdoptingTextNodeSplit(m_selection.m_extent, oldNode);
348 didFinishTextChange(newBase, newExtent); 348 didFinishTextChange(newBase, newExtent);
349 } 349 }
350 350
351 Range* SelectionEditor::firstRange() const {
352 return createRange(firstEphemeralRangeOf(computeVisibleSelectionInDOMTree()));
353 }
354
355 bool SelectionEditor::shouldAlwaysUseDirectionalSelection() const { 351 bool SelectionEditor::shouldAlwaysUseDirectionalSelection() const {
356 return frame()->editor().behavior().shouldConsiderSelectionAsDirectional(); 352 return frame()->editor().behavior().shouldConsiderSelectionAsDirectional();
357 } 353 }
358 354
359 bool SelectionEditor::needsUpdateVisibleSelection() const { 355 bool SelectionEditor::needsUpdateVisibleSelection() const {
360 return m_cacheIsDirty || m_styleVersion != document().styleVersion(); 356 return m_cacheIsDirty || m_styleVersion != document().styleVersion();
361 } 357 }
362 358
363 void SelectionEditor::updateCachedVisibleSelectionIfNeeded() const { 359 void SelectionEditor::updateCachedVisibleSelectionIfNeeded() const {
364 // Note: Since we |FrameCaret::updateApperance()| is called from 360 // Note: Since we |FrameCaret::updateApperance()| is called from
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
403 DEFINE_TRACE(SelectionEditor) { 399 DEFINE_TRACE(SelectionEditor) {
404 visitor->trace(m_frame); 400 visitor->trace(m_frame);
405 visitor->trace(m_selection); 401 visitor->trace(m_selection);
406 visitor->trace(m_cachedVisibleSelectionInDOMTree); 402 visitor->trace(m_cachedVisibleSelectionInDOMTree);
407 visitor->trace(m_cachedVisibleSelectionInFlatTree); 403 visitor->trace(m_cachedVisibleSelectionInFlatTree);
408 visitor->trace(m_cachedRange); 404 visitor->trace(m_cachedRange);
409 SynchronousMutationObserver::trace(visitor); 405 SynchronousMutationObserver::trace(visitor);
410 } 406 }
411 407
412 } // namespace blink 408 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/editing/SelectionEditor.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698