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 418 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
429 | 429 |
430 // Dummy spans are created when text node is split, so that style informatio
n | 430 // Dummy spans are created when text node is split, so that style informatio
n |
431 // can be propagated, which can result in more splitting. If a dummy span ge
ts | 431 // can be propagated, which can result in more splitting. If a dummy span ge
ts |
432 // cloned/split, the new node is always a sibling of it. Therefore, we scan | 432 // cloned/split, the new node is always a sibling of it. Therefore, we scan |
433 // all the children of the dummy's parent | 433 // all the children of the dummy's parent |
434 Node* next; | 434 Node* next; |
435 for (Node* node = dummySpanAncestor->firstChild(); node; node = next) { | 435 for (Node* node = dummySpanAncestor->firstChild(); node; node = next) { |
436 next = node->nextSibling(); | 436 next = node->nextSibling(); |
437 if (isSpanWithoutAttributesOrUnstyledStyleSpan(node)) | 437 if (isSpanWithoutAttributesOrUnstyledStyleSpan(node)) |
438 removeNodePreservingChildren(node); | 438 removeNodePreservingChildren(node); |
439 node = next; | |
440 } | 439 } |
441 } | 440 } |
442 | 441 |
443 HTMLElement* ApplyStyleCommand::splitAncestorsWithUnicodeBidi(Node* node, bool b
efore, WritingDirection allowedDirection) | 442 HTMLElement* ApplyStyleCommand::splitAncestorsWithUnicodeBidi(Node* node, bool b
efore, WritingDirection allowedDirection) |
444 { | 443 { |
445 // We are allowed to leave the highest ancestor with unicode-bidi unsplit if
it is unicode-bidi: embed and direction: allowedDirection. | 444 // We are allowed to leave the highest ancestor with unicode-bidi unsplit if
it is unicode-bidi: embed and direction: allowedDirection. |
446 // In that case, we return the unsplit ancestor. Otherwise, we return 0. | 445 // In that case, we return the unsplit ancestor. Otherwise, we return 0. |
447 Node* block = enclosingBlock(node); | 446 Node* block = enclosingBlock(node); |
448 if (!block) | 447 if (!block) |
449 return 0; | 448 return 0; |
(...skipping 1097 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1547 String textToMove = nextText->data(); | 1546 String textToMove = nextText->data(); |
1548 insertTextIntoNode(childText, childText->length(), textToMove); | 1547 insertTextIntoNode(childText, childText->length(), textToMove); |
1549 removeNode(next); | 1548 removeNode(next); |
1550 // don't move child node pointer. it may want to merge with more text no
des. | 1549 // don't move child node pointer. it may want to merge with more text no
des. |
1551 } | 1550 } |
1552 | 1551 |
1553 updateStartEnd(newStart, newEnd); | 1552 updateStartEnd(newStart, newEnd); |
1554 } | 1553 } |
1555 | 1554 |
1556 } | 1555 } |
OLD | NEW |