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 1386 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1397 | 1397 |
1398 if (dummyElement) | 1398 if (dummyElement) |
1399 removeNode(dummyElement); | 1399 removeNode(dummyElement); |
1400 | 1400 |
1401 applyInlineStyleChange(start, passedEnd, styleChange, addStyledElement); | 1401 applyInlineStyleChange(start, passedEnd, styleChange, addStyledElement); |
1402 } | 1402 } |
1403 | 1403 |
1404 Position ApplyStyleCommand::positionToComputeInlineStyleChange(PassRefPtr<Node>
startNode, RefPtr<Node>& dummyElement) | 1404 Position ApplyStyleCommand::positionToComputeInlineStyleChange(PassRefPtr<Node>
startNode, RefPtr<Node>& dummyElement) |
1405 { | 1405 { |
1406 // It's okay to obtain the style at the startNode because we've removed all
relevant styles from the current run. | 1406 // It's okay to obtain the style at the startNode because we've removed all
relevant styles from the current run. |
1407 Position positionForStyleComparison; | |
1408 if (!startNode->isElementNode()) { | 1407 if (!startNode->isElementNode()) { |
1409 dummyElement = createStyleSpanElement(document()); | 1408 dummyElement = createStyleSpanElement(document()); |
1410 insertNodeAt(dummyElement, positionBeforeNode(startNode.get())); | 1409 insertNodeAt(dummyElement, positionBeforeNode(startNode.get())); |
1411 return positionBeforeNode(dummyElement.get()); | 1410 return positionBeforeNode(dummyElement.get()); |
1412 } | 1411 } |
1413 | 1412 |
1414 return firstPositionInOrBeforeNode(startNode.get()); | 1413 return firstPositionInOrBeforeNode(startNode.get()); |
1415 } | 1414 } |
1416 | 1415 |
1417 void ApplyStyleCommand::applyInlineStyleChange(PassRefPtr<Node> passedStart, Pas
sRefPtr<Node> passedEnd, StyleChange& styleChange, EAddStyledElement addStyledEl
ement) | 1416 void ApplyStyleCommand::applyInlineStyleChange(PassRefPtr<Node> passedStart, Pas
sRefPtr<Node> passedEnd, StyleChange& styleChange, EAddStyledElement addStyledEl
ement) |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 } |
OLD | NEW |