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

Side by Side Diff: sky/engine/core/editing/InsertLineBreakCommand.cpp

Issue 834693007: Remove the remaining parts of ignorePendingStylesheets and placeholder styles. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Remove comment. Created 5 years, 11 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2005, 2006 Apple Computer, Inc. All rights reserved. 2 * Copyright (C) 2005, 2006 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 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 insertNodeAt(nodeToInsert.get(), pos); 94 insertNodeAt(nodeToInsert.get(), pos);
95 setEndingSelection(VisibleSelection(positionInParentAfterNode(*nodeToIns ert), DOWNSTREAM, endingSelection().isDirectional())); 95 setEndingSelection(VisibleSelection(positionInParentAfterNode(*nodeToIns ert), DOWNSTREAM, endingSelection().isDirectional()));
96 } else if (pos.deprecatedNode()->isTextNode()) { 96 } else if (pos.deprecatedNode()->isTextNode()) {
97 // Split a text node 97 // Split a text node
98 Text* textNode = toText(pos.deprecatedNode()); 98 Text* textNode = toText(pos.deprecatedNode());
99 splitTextNode(textNode, pos.deprecatedEditingOffset()); 99 splitTextNode(textNode, pos.deprecatedEditingOffset());
100 insertNodeBefore(nodeToInsert, textNode); 100 insertNodeBefore(nodeToInsert, textNode);
101 Position endingPosition = firstPositionInNode(textNode); 101 Position endingPosition = firstPositionInNode(textNode);
102 102
103 // Handle whitespace that occurs after the split 103 // Handle whitespace that occurs after the split
104 document().updateLayoutIgnorePendingStylesheets(); 104 document().updateLayout();
105 if (!endingPosition.isRenderedCharacter()) { 105 if (!endingPosition.isRenderedCharacter()) {
106 Position positionBeforeTextNode(positionInParentBeforeNode(*textNode )); 106 Position positionBeforeTextNode(positionInParentBeforeNode(*textNode ));
107 // Clear out all whitespace and insert one non-breaking space 107 // Clear out all whitespace and insert one non-breaking space
108 deleteInsignificantTextDownstream(endingPosition); 108 deleteInsignificantTextDownstream(endingPosition);
109 ASSERT(!textNode->renderer() || textNode->renderer()->style()->colla pseWhiteSpace()); 109 ASSERT(!textNode->renderer() || textNode->renderer()->style()->colla pseWhiteSpace());
110 // Deleting insignificant whitespace will remove textNode if it cont ains nothing but insignificant whitespace. 110 // Deleting insignificant whitespace will remove textNode if it cont ains nothing but insignificant whitespace.
111 if (textNode->inDocument()) 111 if (textNode->inDocument())
112 insertTextIntoNode(textNode, 0, nonBreakingSpaceString()); 112 insertTextIntoNode(textNode, 0, nonBreakingSpaceString());
113 else { 113 else {
114 RefPtr<Text> nbspNode = document().createTextNode(nonBreakingSpa ceString()); 114 RefPtr<Text> nbspNode = document().createTextNode(nonBreakingSpa ceString());
(...skipping 16 matching lines...) Expand all
131 // before the line break (if the line break is at the end of a block it isn't selectable). 131 // before the line break (if the line break is at the end of a block it isn't selectable).
132 // So, this next call sets the endingSelection() to a caret just after t he line break 132 // So, this next call sets the endingSelection() to a caret just after t he line break
133 // that we inserted, or just before it if it's at the end of a block. 133 // that we inserted, or just before it if it's at the end of a block.
134 setEndingSelection(endingSelection().visibleEnd()); 134 setEndingSelection(endingSelection().visibleEnd());
135 } 135 }
136 136
137 rebalanceWhitespace(); 137 rebalanceWhitespace();
138 } 138 }
139 139
140 } 140 }
OLDNEW
« no previous file with comments | « sky/engine/core/editing/FrameSelection.cpp ('k') | sky/engine/core/editing/InsertParagraphSeparatorCommand.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698