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

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

Issue 67473002: Have ElementTraversal / NodeTraversal's next() methods take a reference (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase on master Created 7 years, 1 month 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/EditingStyle.cpp ('k') | Source/core/editing/FrameSelection.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) 2006, 2007, 2008, 2011 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2007, 2008, 2011 Apple Inc. All rights reserved.
3 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) 3 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 960 matching lines...) Expand 10 before | Expand all | Expand 10 after
971 void Editor::simplifyMarkup(Node* startNode, Node* endNode) 971 void Editor::simplifyMarkup(Node* startNode, Node* endNode)
972 { 972 {
973 if (!startNode) 973 if (!startNode)
974 return; 974 return;
975 if (endNode) { 975 if (endNode) {
976 if (startNode->document() != endNode->document()) 976 if (startNode->document() != endNode->document())
977 return; 977 return;
978 // check if start node is before endNode 978 // check if start node is before endNode
979 Node* node = startNode; 979 Node* node = startNode;
980 while (node && node != endNode) 980 while (node && node != endNode)
981 node = NodeTraversal::next(node); 981 node = NodeTraversal::next(*node);
982 if (!node) 982 if (!node)
983 return; 983 return;
984 } 984 }
985 985
986 ASSERT(m_frame.document()); 986 ASSERT(m_frame.document());
987 SimplifyMarkupCommand::create(*m_frame.document(), startNode, endNode ? Node Traversal::next(endNode) : 0)->apply(); 987 SimplifyMarkupCommand::create(*m_frame.document(), startNode, endNode ? Node Traversal::next(*endNode) : 0)->apply();
988 } 988 }
989 989
990 void Editor::copyImage(const HitTestResult& result) 990 void Editor::copyImage(const HitTestResult& result)
991 { 991 {
992 KURL url = result.absoluteLinkURL(); 992 KURL url = result.absoluteLinkURL();
993 if (url.isEmpty()) 993 if (url.isEmpty())
994 url = result.absoluteImageURL(); 994 url = result.absoluteImageURL();
995 995
996 Pasteboard::generalPasteboard()->writeImage(result.innerNonSharedNode(), url , result.altDisplayString()); 996 Pasteboard::generalPasteboard()->writeImage(result.innerNonSharedNode(), url , result.altDisplayString());
997 } 997 }
(...skipping 349 matching lines...) Expand 10 before | Expand all | Expand 10 after
1347 return spellChecker().isContinuousSpellCheckingEnabled(); 1347 return spellChecker().isContinuousSpellCheckingEnabled();
1348 } 1348 }
1349 1349
1350 void Editor::toggleOverwriteModeEnabled() 1350 void Editor::toggleOverwriteModeEnabled()
1351 { 1351 {
1352 m_overwriteModeEnabled = !m_overwriteModeEnabled; 1352 m_overwriteModeEnabled = !m_overwriteModeEnabled;
1353 frame().selection().setShouldShowBlockCursor(m_overwriteModeEnabled); 1353 frame().selection().setShouldShowBlockCursor(m_overwriteModeEnabled);
1354 } 1354 }
1355 1355
1356 } // namespace WebCore 1356 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/editing/EditingStyle.cpp ('k') | Source/core/editing/FrameSelection.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698