OLD | NEW |
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 Loading... |
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 Loading... |
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 } |
OLD | NEW |