OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |