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

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

Issue 101763008: Fix some problems reported by clang static analyzer (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 11 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/dom/ContainerNode.cpp ('k') | Source/core/editing/CompositeEditCommand.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 1249 matching lines...) Expand 10 before | Expand all | Expand 10 after
1260 if (startOffset) 1260 if (startOffset)
1261 return false; 1261 return false;
1262 1262
1263 if (isAtomicNode(startNode)) { 1263 if (isAtomicNode(startNode)) {
1264 // note: prior siblings could be unrendered elements. it's silly to miss the 1264 // note: prior siblings could be unrendered elements. it's silly to miss the
1265 // merge opportunity just for that. 1265 // merge opportunity just for that.
1266 if (startNode->previousSibling()) 1266 if (startNode->previousSibling())
1267 return false; 1267 return false;
1268 1268
1269 startNode = startNode->parentNode(); 1269 startNode = startNode->parentNode();
1270 startOffset = 0;
1271 } 1270 }
1272 1271
1273 if (!startNode->isElementNode()) 1272 if (!startNode->isElementNode())
1274 return false; 1273 return false;
1275 1274
1276 Node* previousSibling = startNode->previousSibling(); 1275 Node* previousSibling = startNode->previousSibling();
1277 1276
1278 if (previousSibling && areIdenticalElements(startNode, previousSibling)) { 1277 if (previousSibling && areIdenticalElements(startNode, previousSibling)) {
1279 Element* previousElement = toElement(previousSibling); 1278 Element* previousElement = toElement(previousSibling);
1280 Element* element = toElement(startNode); 1279 Element* element = toElement(startNode);
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after
1543 String textToMove = nextText->data(); 1542 String textToMove = nextText->data();
1544 insertTextIntoNode(childText, childText->length(), textToMove); 1543 insertTextIntoNode(childText, childText->length(), textToMove);
1545 removeNode(next); 1544 removeNode(next);
1546 // don't move child node pointer. it may want to merge with more text no des. 1545 // don't move child node pointer. it may want to merge with more text no des.
1547 } 1546 }
1548 1547
1549 updateStartEnd(newStart, newEnd); 1548 updateStartEnd(newStart, newEnd);
1550 } 1549 }
1551 1550
1552 } 1551 }
OLDNEW
« no previous file with comments | « Source/core/dom/ContainerNode.cpp ('k') | Source/core/editing/CompositeEditCommand.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698