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

Side by Side Diff: sky/engine/core/editing/DeleteSelectionCommand.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 Apple Computer, Inc. All rights reserved. 2 * Copyright (C) 2005 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 265 matching lines...) Expand 10 before | Expand all | Expand 10 after
276 // Do not remove an element of table structure; remove its contents. 276 // Do not remove an element of table structure; remove its contents.
277 // Likewise for the root editable element. 277 // Likewise for the root editable element.
278 Node* child = node->firstChild(); 278 Node* child = node->firstChild();
279 while (child) { 279 while (child) {
280 Node* remove = child; 280 Node* remove = child;
281 child = child->nextSibling(); 281 child = child->nextSibling();
282 removeNode(remove, shouldAssumeContentIsAlwaysEditable); 282 removeNode(remove, shouldAssumeContentIsAlwaysEditable);
283 } 283 }
284 284
285 // Make sure empty cell has some height, if a placeholder can be inserte d. 285 // Make sure empty cell has some height, if a placeholder can be inserte d.
286 document().updateLayoutIgnorePendingStylesheets(); 286 document().updateLayout();
287 return; 287 return;
288 } 288 }
289 289
290 if (node == m_startBlock) { 290 if (node == m_startBlock) {
291 VisiblePosition previous = VisiblePosition(firstPositionInNode(m_startBl ock.get())).previous(); 291 VisiblePosition previous = VisiblePosition(firstPositionInNode(m_startBl ock.get())).previous();
292 if (previous.isNotNull() && !isEndOfBlock(previous)) 292 if (previous.isNotNull() && !isEndOfBlock(previous))
293 m_needPlaceholder = true; 293 m_needPlaceholder = true;
294 } 294 }
295 if (node == m_endBlock) { 295 if (node == m_endBlock) {
296 VisiblePosition next = VisiblePosition(lastPositionInNode(m_endBlock.get ())).next(); 296 VisiblePosition next = VisiblePosition(lastPositionInNode(m_endBlock.get ())).next();
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after
467 removeChildrenInRange(m_downstreamEnd.deprecatedNode(), offs et, m_downstreamEnd.deprecatedEditingOffset()); 467 removeChildrenInRange(m_downstreamEnd.deprecatedNode(), offs et, m_downstreamEnd.deprecatedEditingOffset());
468 m_downstreamEnd = createLegacyEditingPosition(m_downstreamEn d.deprecatedNode(), offset); 468 m_downstreamEnd = createLegacyEditingPosition(m_downstreamEn d.deprecatedNode(), offset);
469 } 469 }
470 } 470 }
471 } 471 }
472 } 472 }
473 } 473 }
474 474
475 void DeleteSelectionCommand::fixupWhitespace() 475 void DeleteSelectionCommand::fixupWhitespace()
476 { 476 {
477 document().updateLayoutIgnorePendingStylesheets(); 477 document().updateLayout();
478 // FIXME: isRenderedCharacter should be removed, and we should use VisiblePo sition::characterAfter and VisiblePosition::characterBefore 478 // FIXME: isRenderedCharacter should be removed, and we should use VisiblePo sition::characterAfter and VisiblePosition::characterBefore
479 if (m_leadingWhitespace.isNotNull() && !m_leadingWhitespace.isRenderedCharac ter() && m_leadingWhitespace.deprecatedNode()->isTextNode()) { 479 if (m_leadingWhitespace.isNotNull() && !m_leadingWhitespace.isRenderedCharac ter() && m_leadingWhitespace.deprecatedNode()->isTextNode()) {
480 Text* textNode = toText(m_leadingWhitespace.deprecatedNode()); 480 Text* textNode = toText(m_leadingWhitespace.deprecatedNode());
481 ASSERT(!textNode->renderer() || textNode->renderer()->style()->collapseW hiteSpace()); 481 ASSERT(!textNode->renderer() || textNode->renderer()->style()->collapseW hiteSpace());
482 replaceTextInNodePreservingMarkers(textNode, m_leadingWhitespace.depreca tedEditingOffset(), 1, nonBreakingSpaceString()); 482 replaceTextInNodePreservingMarkers(textNode, m_leadingWhitespace.depreca tedEditingOffset(), 1, nonBreakingSpaceString());
483 } 483 }
484 if (m_trailingWhitespace.isNotNull() && !m_trailingWhitespace.isRenderedChar acter() && m_trailingWhitespace.deprecatedNode()->isTextNode()) { 484 if (m_trailingWhitespace.isNotNull() && !m_trailingWhitespace.isRenderedChar acter() && m_trailingWhitespace.deprecatedNode()->isTextNode()) {
485 Text* textNode = toText(m_trailingWhitespace.deprecatedNode()); 485 Text* textNode = toText(m_trailingWhitespace.deprecatedNode());
486 ASSERT(!textNode->renderer() ||textNode->renderer()->style()->collapseWh iteSpace()); 486 ASSERT(!textNode->renderer() ||textNode->renderer()->style()->collapseWh iteSpace());
487 replaceTextInNodePreservingMarkers(textNode, m_trailingWhitespace.deprec atedEditingOffset(), 1, nonBreakingSpaceString()); 487 replaceTextInNodePreservingMarkers(textNode, m_trailingWhitespace.deprec atedEditingOffset(), 1, nonBreakingSpaceString());
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after
667 667
668 // Normally deletion doesn't preserve the typing style that was present before i t. For example, 668 // Normally deletion doesn't preserve the typing style that was present before i t. For example,
669 // type a character, Bold, then delete the character and start typing. The Bold typing style shouldn't 669 // type a character, Bold, then delete the character and start typing. The Bold typing style shouldn't
670 // stick around. Deletion should preserve a typing style that *it* sets, howeve r. 670 // stick around. Deletion should preserve a typing style that *it* sets, howeve r.
671 bool DeleteSelectionCommand::preservesTypingStyle() const 671 bool DeleteSelectionCommand::preservesTypingStyle() const
672 { 672 {
673 return false; 673 return false;
674 } 674 }
675 675
676 } // namespace blink 676 } // namespace blink
OLDNEW
« no previous file with comments | « sky/engine/core/editing/CompositeEditCommand.cpp ('k') | sky/engine/core/editing/EditorCommand.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698