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

Side by Side Diff: Source/core/editing/SimplifyMarkupCommand.cpp

Issue 236203020: Separate repaint and layout requirements of StyleDifference (Step 1) (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase; Renaming of some methods and small changes in StyleDifference Created 6 years, 8 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 | Annotate | Revision Log
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | Source/core/rendering/RenderBlock.cpp » ('j') | Source/core/rendering/style/StyleDifference.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698