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

Side by Side Diff: Source/core/editing/TypingCommand.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/FrameSelection.cpp ('k') | Source/core/editing/VisibleSelectionTest.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) 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2005, 2006, 2007, 2008 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 554 matching lines...) Expand 10 before | Expand all | Expand 10 after
565 // the current state of the document and we'll get the wrong result. 565 // the current state of the document and we'll get the wrong result.
566 Position extent = startingSelection().end(); 566 Position extent = startingSelection().end();
567 if (extent.containerNode() != selectionToDelete.end().containerNode( )) 567 if (extent.containerNode() != selectionToDelete.end().containerNode( ))
568 extent = selectionToDelete.extent(); 568 extent = selectionToDelete.extent();
569 else { 569 else {
570 int extraCharacters; 570 int extraCharacters;
571 if (selectionToDelete.start().containerNode() == selectionToDele te.end().containerNode()) 571 if (selectionToDelete.start().containerNode() == selectionToDele te.end().containerNode())
572 extraCharacters = selectionToDelete.end().computeOffsetInCon tainerNode() - selectionToDelete.start().computeOffsetInContainerNode(); 572 extraCharacters = selectionToDelete.end().computeOffsetInCon tainerNode() - selectionToDelete.start().computeOffsetInContainerNode();
573 else 573 else
574 extraCharacters = selectionToDelete.end().computeOffsetInCon tainerNode(); 574 extraCharacters = selectionToDelete.end().computeOffsetInCon tainerNode();
575 extent = Position(extent.containerNode(), extent.computeOffsetIn ContainerNode() + extraCharacters, Position::PositionIsOffsetInAnchor); 575 extent = Position(extent.containerNode(), extent.computeOffsetIn ContainerNode() + extraCharacters);
576 } 576 }
577 selectionAfterUndo.setWithoutValidation(startingSelection().start(), extent); 577 selectionAfterUndo.setWithoutValidation(startingSelection().start(), extent);
578 } 578 }
579 break; 579 break;
580 } 580 }
581 case NoSelection: 581 case NoSelection:
582 ASSERT_NOT_REACHED(); 582 ASSERT_NOT_REACHED();
583 break; 583 break;
584 } 584 }
585 585
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
624 ASSERT_NOT_REACHED(); 624 ASSERT_NOT_REACHED();
625 m_preservesTypingStyle = false; 625 m_preservesTypingStyle = false;
626 } 626 }
627 627
628 bool TypingCommand::isTypingCommand() const 628 bool TypingCommand::isTypingCommand() const
629 { 629 {
630 return true; 630 return true;
631 } 631 }
632 632
633 } // namespace blink 633 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/editing/FrameSelection.cpp ('k') | Source/core/editing/VisibleSelectionTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698