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

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

Issue 2973583002: Get rid of SelectionTemplate::has_trailing_whitespace_ (Closed)
Patch Set: 2017-07-05T15:40:09 Created 3 years, 5 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) 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
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
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
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/editing/FrameSelection.cpp ('k') | third_party/WebKit/Source/core/editing/SelectionTemplate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698