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

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

Issue 7862013: Merge 94840 - Crashes in WebCore::ApplyStyleCommand.doApply() (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/874/
Patch Set: Created 9 years, 3 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 | « LayoutTests/editing/style/remove-format-without-enclosing-block-expected.txt ('k') | no next file » | 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 263 matching lines...) Expand 10 before | Expand all | Expand 10 after
274 VisiblePosition beyondEnd(endOfParagraph(visibleEnd).next()); 274 VisiblePosition beyondEnd(endOfParagraph(visibleEnd).next());
275 while (paragraphStart.isNotNull() && paragraphStart != beyondEnd) { 275 while (paragraphStart.isNotNull() && paragraphStart != beyondEnd) {
276 StyleChange styleChange(style, paragraphStart.deepEquivalent()); 276 StyleChange styleChange(style, paragraphStart.deepEquivalent());
277 if (styleChange.cssStyle().length() || m_removeOnly) { 277 if (styleChange.cssStyle().length() || m_removeOnly) {
278 RefPtr<Node> block = enclosingBlock(paragraphStart.deepEquivalent(). deprecatedNode()); 278 RefPtr<Node> block = enclosingBlock(paragraphStart.deepEquivalent(). deprecatedNode());
279 if (!m_removeOnly) { 279 if (!m_removeOnly) {
280 RefPtr<Node> newBlock = moveParagraphContentsToNewBlockIfNecessa ry(paragraphStart.deepEquivalent()); 280 RefPtr<Node> newBlock = moveParagraphContentsToNewBlockIfNecessa ry(paragraphStart.deepEquivalent());
281 if (newBlock) 281 if (newBlock)
282 block = newBlock; 282 block = newBlock;
283 } 283 }
284 ASSERT(block->isHTMLElement()); 284 ASSERT(!block || block->isHTMLElement());
285 if (block->isHTMLElement()) { 285 if (block && block->isHTMLElement()) {
286 removeCSSStyle(style, toHTMLElement(block.get())); 286 removeCSSStyle(style, toHTMLElement(block.get()));
287 if (!m_removeOnly) 287 if (!m_removeOnly)
288 addBlockStyle(styleChange, toHTMLElement(block.get())); 288 addBlockStyle(styleChange, toHTMLElement(block.get()));
289 } 289 }
290 290
291 if (nextParagraphStart.isOrphan()) 291 if (nextParagraphStart.isOrphan())
292 nextParagraphStart = endOfParagraph(paragraphStart).next(); 292 nextParagraphStart = endOfParagraph(paragraphStart).next();
293 } 293 }
294 294
295 paragraphStart = nextParagraphStart; 295 paragraphStart = nextParagraphStart;
(...skipping 1192 matching lines...) Expand 10 before | Expand all | Expand 10 after
1488 } 1488 }
1489 else { 1489 else {
1490 child = child->nextSibling(); 1490 child = child->nextSibling();
1491 } 1491 }
1492 } 1492 }
1493 1493
1494 updateStartEnd(newStart, newEnd); 1494 updateStartEnd(newStart, newEnd);
1495 } 1495 }
1496 1496
1497 } 1497 }
OLDNEW
« no previous file with comments | « LayoutTests/editing/style/remove-format-without-enclosing-block-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698