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

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

Issue 2704123003: Expand FrameSeleciton::isCaret() to increase chances of hoisting update layout (Closed)
Patch Set: 2017-02-21T12:50:46 Created 3 years, 10 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 462 matching lines...) Expand 10 before | Expand all | Expand 10 after
473 void FrameSelection::invalidatePaintIfNeeded( 473 void FrameSelection::invalidatePaintIfNeeded(
474 const LayoutBlock& block, 474 const LayoutBlock& block,
475 const PaintInvalidatorContext& context, 475 const PaintInvalidatorContext& context,
476 PaintInvalidationReason reason) { 476 PaintInvalidationReason reason) {
477 m_frameCaret->invalidatePaintIfNeeded(block, context, reason); 477 m_frameCaret->invalidatePaintIfNeeded(block, context, reason);
478 } 478 }
479 479
480 bool FrameSelection::shouldPaintCaret(const LayoutBlock& block) const { 480 bool FrameSelection::shouldPaintCaret(const LayoutBlock& block) const {
481 DCHECK_GE(document().lifecycle().state(), DocumentLifecycle::LayoutClean); 481 DCHECK_GE(document().lifecycle().state(), DocumentLifecycle::LayoutClean);
482 bool result = m_frameCaret->shouldPaintCaret(block); 482 bool result = m_frameCaret->shouldPaintCaret(block);
483 DCHECK(!result || (isCaret() && hasEditableStyle())); 483 DCHECK(!result || (computeVisibleSelectionInDOMTreeDeprecated().isCaret() &&
484 hasEditableStyle()));
484 return result; 485 return result;
485 } 486 }
486 487
487 IntRect FrameSelection::absoluteCaretBounds() { 488 IntRect FrameSelection::absoluteCaretBounds() {
488 DCHECK(computeVisibleSelectionInDOMTree().isValidFor(*m_frame->document())); 489 DCHECK(computeVisibleSelectionInDOMTree().isValidFor(*m_frame->document()));
489 return m_frameCaret->absoluteCaretBounds(); 490 return m_frameCaret->absoluteCaretBounds();
490 } 491 }
491 492
492 void FrameSelection::paintCaret(GraphicsContext& context, 493 void FrameSelection::paintCaret(GraphicsContext& context,
493 const LayoutPoint& paintOffset) { 494 const LayoutPoint& paintOffset) {
(...skipping 684 matching lines...) Expand 10 before | Expand all | Expand 10 after
1178 } 1179 }
1179 1180
1180 void showTree(const blink::FrameSelection* sel) { 1181 void showTree(const blink::FrameSelection* sel) {
1181 if (sel) 1182 if (sel)
1182 sel->showTreeForThis(); 1183 sel->showTreeForThis();
1183 else 1184 else
1184 LOG(INFO) << "Cannot showTree for <null> FrameSelection."; 1185 LOG(INFO) << "Cannot showTree for <null> FrameSelection.";
1185 } 1186 }
1186 1187
1187 #endif 1188 #endif
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/editing/FrameSelection.h ('k') | third_party/WebKit/Source/core/editing/FrameSelectionTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698