| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2012 Apple Computer, Inc. All rights reserved. | 2 * Copyright (C) 2012 Apple Computer, 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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 break; | 69 break; |
| 70 | 70 |
| 71 if (!currentNode->renderer() || !currentNode->renderer()->isRenderIn
line() || toRenderInline(currentNode->renderer())->alwaysCreateLineBoxes()) | 71 if (!currentNode->renderer() || !currentNode->renderer()->isRenderIn
line() || toRenderInline(currentNode->renderer())->alwaysCreateLineBoxes()) |
| 72 continue; | 72 continue; |
| 73 | 73 |
| 74 if (currentNode->firstChild() != currentNode->lastChild()) { | 74 if (currentNode->firstChild() != currentNode->lastChild()) { |
| 75 topNodeWithStartingStyle = 0; | 75 topNodeWithStartingStyle = 0; |
| 76 break; | 76 break; |
| 77 } | 77 } |
| 78 | 78 |
| 79 unsigned context; | 79 if (currentNode->renderStyle()->visualInvalidationDiff(*startingStyl
e).hasNoChange()) |
| 80 if (currentNode->renderStyle()->visualInvalidationDiff(*startingStyl
e, context) == StyleDifferenceEqual && !context) | |
| 81 topNodeWithStartingStyle = currentNode; | 80 topNodeWithStartingStyle = currentNode; |
| 82 | 81 |
| 83 } | 82 } |
| 84 if (topNodeWithStartingStyle) { | 83 if (topNodeWithStartingStyle) { |
| 85 for (Node* node = startingNode; node != topNodeWithStartingStyle; no
de = node->parentNode()) | 84 for (Node* node = startingNode; node != topNodeWithStartingStyle; no
de = node->parentNode()) |
| 86 nodesToRemove.append(node); | 85 nodesToRemove.append(node); |
| 87 } | 86 } |
| 88 } | 87 } |
| 89 | 88 |
| 90 // we perform all the DOM mutations at once. | 89 // we perform all the DOM mutations at once. |
| (...skipping 25 matching lines...) Expand all Loading... |
| 116 return 0; | 115 return 0; |
| 117 | 116 |
| 118 removeNode(nodesToRemove[startNodeIndex], AssumeContentIsAlwaysEditable); | 117 removeNode(nodesToRemove[startNodeIndex], AssumeContentIsAlwaysEditable); |
| 119 insertNodeBefore(nodesToRemove[startNodeIndex], highestAncestorToRemove, Ass
umeContentIsAlwaysEditable); | 118 insertNodeBefore(nodesToRemove[startNodeIndex], highestAncestorToRemove, Ass
umeContentIsAlwaysEditable); |
| 120 removeNode(highestAncestorToRemove, AssumeContentIsAlwaysEditable); | 119 removeNode(highestAncestorToRemove, AssumeContentIsAlwaysEditable); |
| 121 | 120 |
| 122 return pastLastNodeToRemove - startNodeIndex - 1; | 121 return pastLastNodeToRemove - startNodeIndex - 1; |
| 123 } | 122 } |
| 124 | 123 |
| 125 } // namespace WebCore | 124 } // namespace WebCore |
| OLD | NEW |