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

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

Issue 16415002: Remove some unused variable assignments (Closed) Base URL: https://chromium.googlesource.com/chromium/blink@master
Patch Set: Created 7 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 | « no previous file | Source/core/editing/ReplaceSelectionCommand.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, 2008, 2009 Apple Inc. All rights reserved. 2 * Copyright (C) 2005, 2006, 2008, 2009 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 1274 matching lines...) Expand 10 before | Expand all | Expand 10 after
1285 Position(end.deprecatedNode(), end.deprecatedEditingOffse t() + endOffsetAdjustment, Position::PositionIsOffsetInAnchor)); 1285 Position(end.deprecatedNode(), end.deprecatedEditingOffse t() + endOffsetAdjustment, Position::PositionIsOffsetInAnchor));
1286 return true; 1286 return true;
1287 } 1287 }
1288 1288
1289 return false; 1289 return false;
1290 } 1290 }
1291 1291
1292 bool ApplyStyleCommand::mergeEndWithNextIfIdentical(const Position& start, const Position& end) 1292 bool ApplyStyleCommand::mergeEndWithNextIfIdentical(const Position& start, const Position& end)
1293 { 1293 {
1294 Node* endNode = end.containerNode(); 1294 Node* endNode = end.containerNode();
1295 int endOffset = end.computeOffsetInContainerNode(); 1295 int endOffset = end.computeOffsetInContainerNode();
Nico 2013/06/05 04:09:52 Can you move this into the body of the following i
1296 1296
1297 if (isAtomicNode(endNode)) { 1297 if (isAtomicNode(endNode)) {
1298 if (offsetIsBeforeLastNodeOffset(endOffset, endNode)) 1298 if (offsetIsBeforeLastNodeOffset(endOffset, endNode))
1299 return false; 1299 return false;
1300 1300
1301 unsigned parentLastOffset = end.deprecatedNode()->parentNode()->childNod es()->length() - 1;
1302 if (end.deprecatedNode()->nextSibling()) 1301 if (end.deprecatedNode()->nextSibling())
1303 return false; 1302 return false;
1304 1303
1305 endNode = end.deprecatedNode()->parentNode(); 1304 endNode = end.deprecatedNode()->parentNode();
1306 endOffset = parentLastOffset;
1307 } 1305 }
1308 1306
1309 if (!endNode->isElementNode() || endNode->hasTagName(brTag)) 1307 if (!endNode->isElementNode() || endNode->hasTagName(brTag))
1310 return false; 1308 return false;
1311 1309
1312 Node* nextSibling = endNode->nextSibling(); 1310 Node* nextSibling = endNode->nextSibling();
1313 if (nextSibling && areIdenticalElements(endNode, nextSibling)) { 1311 if (nextSibling && areIdenticalElements(endNode, nextSibling)) {
1314 Element* nextElement = static_cast<Element *>(nextSibling); 1312 Element* nextElement = static_cast<Element *>(nextSibling);
1315 Element* element = static_cast<Element *>(endNode); 1313 Element* element = static_cast<Element *>(endNode);
1316 Node* nextChild = nextElement->firstChild(); 1314 Node* nextChild = nextElement->firstChild();
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after
1542 String textToMove = nextText->data(); 1540 String textToMove = nextText->data();
1543 insertTextIntoNode(childText, childText->length(), textToMove); 1541 insertTextIntoNode(childText, childText->length(), textToMove);
1544 removeNode(next); 1542 removeNode(next);
1545 // don't move child node pointer. it may want to merge with more text no des. 1543 // don't move child node pointer. it may want to merge with more text no des.
1546 } 1544 }
1547 1545
1548 updateStartEnd(newStart, newEnd); 1546 updateStartEnd(newStart, newEnd);
1549 } 1547 }
1550 1548
1551 } 1549 }
OLDNEW
« no previous file with comments | « no previous file | Source/core/editing/ReplaceSelectionCommand.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698