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

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

Issue 1316303002: Move a member function intersectsNode() out from VisibleSelection class (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 2015-08-27T17:53:54 Created 5 years, 3 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 | Source/core/editing/VisibleSelection.h » ('j') | 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 376 matching lines...) Expand 10 before | Expand all | Expand 10 after
387 clearLayoutTreeSelection = true; 387 clearLayoutTreeSelection = true;
388 } else if (baseRemoved || extentRemoved) { 388 } else if (baseRemoved || extentRemoved) {
389 // The base and/or extent are about to be removed, but the start and end aren't. 389 // The base and/or extent are about to be removed, but the start and end aren't.
390 // Change the base and extent to the start and end, but don't re-validat e the 390 // Change the base and extent to the start and end, but don't re-validat e the
391 // selection, since doing so could move the start and end into the node 391 // selection, since doing so could move the start and end into the node
392 // that is about to be removed. 392 // that is about to be removed.
393 if (m_selection.isBaseFirst()) 393 if (m_selection.isBaseFirst())
394 m_selection.setWithoutValidation(m_selection.start(), m_selection.en d()); 394 m_selection.setWithoutValidation(m_selection.start(), m_selection.en d());
395 else 395 else
396 m_selection.setWithoutValidation(m_selection.end(), m_selection.star t()); 396 m_selection.setWithoutValidation(m_selection.end(), m_selection.star t());
397 } else if (m_selection.intersectsNode(&node)) { 397 } else if (intersectsNode(m_selection, &node)) {
398 // If we did nothing here, when this node's layoutObject was destroyed, the rect that it 398 // If we did nothing here, when this node's layoutObject was destroyed, the rect that it
399 // occupied would be invalidated, but, selection gaps that change as a r esult of 399 // occupied would be invalidated, but, selection gaps that change as a r esult of
400 // the removal wouldn't be invalidated. 400 // the removal wouldn't be invalidated.
401 // FIXME: Don't do so much unnecessary invalidation. 401 // FIXME: Don't do so much unnecessary invalidation.
402 clearLayoutTreeSelection = true; 402 clearLayoutTreeSelection = true;
403 } 403 }
404 404
405 if (clearLayoutTreeSelection) 405 if (clearLayoutTreeSelection)
406 m_selection.start().document()->layoutView()->clearSelection(); 406 m_selection.start().document()->layoutView()->clearSelection();
407 407
(...skipping 1650 matching lines...) Expand 10 before | Expand all | Expand 10 after
2058 2058
2059 void showTree(const blink::FrameSelection* sel) 2059 void showTree(const blink::FrameSelection* sel)
2060 { 2060 {
2061 if (sel) 2061 if (sel)
2062 sel->showTreeForThis(); 2062 sel->showTreeForThis();
2063 else 2063 else
2064 fprintf(stderr, "Cannot showTree for (nil) FrameSelection.\n"); 2064 fprintf(stderr, "Cannot showTree for (nil) FrameSelection.\n");
2065 } 2065 }
2066 2066
2067 #endif 2067 #endif
OLDNEW
« no previous file with comments | « no previous file | Source/core/editing/VisibleSelection.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698