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

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

Issue 2877193002: Prune ComputeVisibleSelectionDeprecated from FrameSelection::ShouldPaintCaret (Closed)
Patch Set: Created 3 years, 7 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 | 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 498 matching lines...) Expand 10 before | Expand all | Expand 10 after
509 509
510 void FrameSelection::InvalidatePaint(const LayoutBlock& block, 510 void FrameSelection::InvalidatePaint(const LayoutBlock& block,
511 const PaintInvalidatorContext& context) { 511 const PaintInvalidatorContext& context) {
512 frame_caret_->InvalidatePaint(block, context); 512 frame_caret_->InvalidatePaint(block, context);
513 } 513 }
514 514
515 bool FrameSelection::ShouldPaintCaret(const LayoutBlock& block) const { 515 bool FrameSelection::ShouldPaintCaret(const LayoutBlock& block) const {
516 DCHECK_GE(GetDocument().Lifecycle().GetState(), 516 DCHECK_GE(GetDocument().Lifecycle().GetState(),
517 DocumentLifecycle::kLayoutClean); 517 DocumentLifecycle::kLayoutClean);
518 bool result = frame_caret_->ShouldPaintCaret(block); 518 bool result = frame_caret_->ShouldPaintCaret(block);
519 DCHECK(!result || (ComputeVisibleSelectionInDOMTreeDeprecated().IsCaret() && 519 DCHECK(!result || (ComputeVisibleSelectionInDOMTree().IsCaret() &&
520 ComputeVisibleSelectionInDOMTree().HasEditableStyle())); 520 ComputeVisibleSelectionInDOMTree().HasEditableStyle()));
521 return result; 521 return result;
522 } 522 }
523 523
524 IntRect FrameSelection::AbsoluteCaretBounds() { 524 IntRect FrameSelection::AbsoluteCaretBounds() {
525 DCHECK(ComputeVisibleSelectionInDOMTree().IsValidFor(*frame_->GetDocument())); 525 DCHECK(ComputeVisibleSelectionInDOMTree().IsValidFor(*frame_->GetDocument()));
526 return frame_caret_->AbsoluteCaretBounds(); 526 return frame_caret_->AbsoluteCaretBounds();
527 } 527 }
528 528
529 void FrameSelection::PaintCaret(GraphicsContext& context, 529 void FrameSelection::PaintCaret(GraphicsContext& context,
(...skipping 688 matching lines...) Expand 10 before | Expand all | Expand 10 after
1218 } 1218 }
1219 1219
1220 void showTree(const blink::FrameSelection* sel) { 1220 void showTree(const blink::FrameSelection* sel) {
1221 if (sel) 1221 if (sel)
1222 sel->ShowTreeForThis(); 1222 sel->ShowTreeForThis();
1223 else 1223 else
1224 LOG(INFO) << "Cannot showTree for <null> FrameSelection."; 1224 LOG(INFO) << "Cannot showTree for <null> FrameSelection.";
1225 } 1225 }
1226 1226
1227 #endif 1227 #endif
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698