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

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

Issue 1213483003: Get rid of redundant parameter PositionIsOffsetInAnchor from PositionAlgorithm constructor (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 6 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 | « Source/core/editing/EditingTestBase.cpp ('k') | Source/core/editing/TypingCommand.cpp » ('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 1383 matching lines...) Expand 10 before | Expand all | Expand 10 after
1394 ContainerNode* ownerElementParent = ownerElement->parentNode(); 1394 ContainerNode* ownerElementParent = ownerElement->parentNode();
1395 if (!ownerElementParent) 1395 if (!ownerElementParent)
1396 return; 1396 return;
1397 1397
1398 // This method's purpose is it to make it easier to select iframes (in order to delete them). Don't do anything if the iframe isn't deletable. 1398 // This method's purpose is it to make it easier to select iframes (in order to delete them). Don't do anything if the iframe isn't deletable.
1399 if (!ownerElementParent->hasEditableStyle()) 1399 if (!ownerElementParent->hasEditableStyle())
1400 return; 1400 return;
1401 1401
1402 // Create compute positions before and after the element. 1402 // Create compute positions before and after the element.
1403 unsigned ownerElementNodeIndex = ownerElement->nodeIndex(); 1403 unsigned ownerElementNodeIndex = ownerElement->nodeIndex();
1404 VisiblePosition beforeOwnerElement(VisiblePosition(Position(ownerElementPare nt, ownerElementNodeIndex, Position::PositionIsOffsetInAnchor))); 1404 VisiblePosition beforeOwnerElement(VisiblePosition(Position(ownerElementPare nt, ownerElementNodeIndex)));
1405 VisiblePosition afterOwnerElement(VisiblePosition(Position(ownerElementParen t, ownerElementNodeIndex + 1, Position::PositionIsOffsetInAnchor), VP_UPSTREAM_I F_POSSIBLE)); 1405 VisiblePosition afterOwnerElement(VisiblePosition(Position(ownerElementParen t, ownerElementNodeIndex + 1), VP_UPSTREAM_IF_POSSIBLE));
1406 1406
1407 // Focus on the parent frame, and then select from before this element to af ter. 1407 // Focus on the parent frame, and then select from before this element to af ter.
1408 VisibleSelection newSelection(beforeOwnerElement, afterOwnerElement); 1408 VisibleSelection newSelection(beforeOwnerElement, afterOwnerElement);
1409 page->focusController().setFocusedFrame(parent); 1409 page->focusController().setFocusedFrame(parent);
1410 toLocalFrame(parent)->selection().setSelection(newSelection); 1410 toLocalFrame(parent)->selection().setSelection(newSelection);
1411 } 1411 }
1412 1412
1413 void FrameSelection::selectAll() 1413 void FrameSelection::selectAll()
1414 { 1414 {
1415 Document* document = m_frame->document(); 1415 Document* document = m_frame->document();
(...skipping 619 matching lines...) Expand 10 before | Expand all | Expand 10 after
2035 2035
2036 void showTree(const blink::FrameSelection* sel) 2036 void showTree(const blink::FrameSelection* sel)
2037 { 2037 {
2038 if (sel) 2038 if (sel)
2039 sel->showTreeForThis(); 2039 sel->showTreeForThis();
2040 else 2040 else
2041 fprintf(stderr, "Cannot showTree for (nil) FrameSelection.\n"); 2041 fprintf(stderr, "Cannot showTree for (nil) FrameSelection.\n");
2042 } 2042 }
2043 2043
2044 #endif 2044 #endif
OLDNEW
« no previous file with comments | « Source/core/editing/EditingTestBase.cpp ('k') | Source/core/editing/TypingCommand.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698