| 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 397 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 408 SelectionInFlatTree::Builder builder; | 408 SelectionInFlatTree::Builder builder; |
| 409 const PositionInFlatTree& base = ToPositionInFlatTree(selection_.Base()); | 409 const PositionInFlatTree& base = ToPositionInFlatTree(selection_.Base()); |
| 410 const PositionInFlatTree& extent = ToPositionInFlatTree(selection_.Extent()); | 410 const PositionInFlatTree& extent = ToPositionInFlatTree(selection_.Extent()); |
| 411 if (base.IsNotNull() && extent.IsNotNull()) | 411 if (base.IsNotNull() && extent.IsNotNull()) |
| 412 builder.SetBaseAndExtent(base, extent); | 412 builder.SetBaseAndExtent(base, extent); |
| 413 else if (base.IsNotNull()) | 413 else if (base.IsNotNull()) |
| 414 builder.Collapse(base); | 414 builder.Collapse(base); |
| 415 else if (extent.IsNotNull()) | 415 else if (extent.IsNotNull()) |
| 416 builder.Collapse(extent); | 416 builder.Collapse(extent); |
| 417 builder.SetAffinity(selection_.Affinity()) | 417 builder.SetAffinity(selection_.Affinity()) |
| 418 .SetHasTrailingWhitespace(selection_.HasTrailingWhitespace()) | |
| 419 .SetGranularity(selection_.Granularity()) | 418 .SetGranularity(selection_.Granularity()) |
| 420 .SetIsDirectional(selection_.IsDirectional()); | 419 .SetIsDirectional(selection_.IsDirectional()); |
| 421 cached_visible_selection_in_flat_tree_ = | 420 cached_visible_selection_in_flat_tree_ = |
| 422 CreateVisibleSelection(builder.Build()); | 421 CreateVisibleSelection(builder.Build()); |
| 423 if (!cached_visible_selection_in_flat_tree_.IsNone()) | 422 if (!cached_visible_selection_in_flat_tree_.IsNone()) |
| 424 return; | 423 return; |
| 425 style_version_for_dom_tree_ = GetDocument().StyleVersion(); | 424 style_version_for_dom_tree_ = GetDocument().StyleVersion(); |
| 426 cached_visible_selection_in_dom_tree_is_dirty_ = false; | 425 cached_visible_selection_in_dom_tree_is_dirty_ = false; |
| 427 cached_visible_selection_in_dom_tree_ = VisibleSelection(); | 426 cached_visible_selection_in_dom_tree_ = VisibleSelection(); |
| 428 } | 427 } |
| (...skipping 13 matching lines...) Expand all Loading... |
| 442 DEFINE_TRACE(SelectionEditor) { | 441 DEFINE_TRACE(SelectionEditor) { |
| 443 visitor->Trace(frame_); | 442 visitor->Trace(frame_); |
| 444 visitor->Trace(selection_); | 443 visitor->Trace(selection_); |
| 445 visitor->Trace(cached_visible_selection_in_dom_tree_); | 444 visitor->Trace(cached_visible_selection_in_dom_tree_); |
| 446 visitor->Trace(cached_visible_selection_in_flat_tree_); | 445 visitor->Trace(cached_visible_selection_in_flat_tree_); |
| 447 visitor->Trace(cached_range_); | 446 visitor->Trace(cached_range_); |
| 448 SynchronousMutationObserver::Trace(visitor); | 447 SynchronousMutationObserver::Trace(visitor); |
| 449 } | 448 } |
| 450 | 449 |
| 451 } // namespace blink | 450 } // namespace blink |
| OLD | NEW |