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

Side by Side Diff: third_party/WebKit/Source/core/editing/commands/DeleteSelectionCommand.cpp

Issue 1896793002: Rename (updateLayout/updateStyle).*.() to updateStyleAndLayout.*.() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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 365 matching lines...) Expand 10 before | Expand all | Expand 10 after
376 Node* child = node->firstChild(); 376 Node* child = node->firstChild();
377 while (child) { 377 while (child) {
378 Node* remove = child; 378 Node* remove = child;
379 child = child->nextSibling(); 379 child = child->nextSibling();
380 removeNode(remove, editingState, shouldAssumeContentIsAlwaysEditable ); 380 removeNode(remove, editingState, shouldAssumeContentIsAlwaysEditable );
381 if (editingState->isAborted()) 381 if (editingState->isAborted())
382 return; 382 return;
383 } 383 }
384 384
385 // Make sure empty cell has some height, if a placeholder can be inserte d. 385 // Make sure empty cell has some height, if a placeholder can be inserte d.
386 document().updateLayoutIgnorePendingStylesheets(); 386 document().updateStyleAndLayoutIgnorePendingStylesheets();
387 LayoutObject* r = node->layoutObject(); 387 LayoutObject* r = node->layoutObject();
388 if (r && r->isTableCell() && toLayoutTableCell(r)->contentHeight() <= 0) { 388 if (r && r->isTableCell() && toLayoutTableCell(r)->contentHeight() <= 0) {
389 Position firstEditablePosition = firstEditablePositionInNode(node); 389 Position firstEditablePosition = firstEditablePositionInNode(node);
390 if (firstEditablePosition.isNotNull()) 390 if (firstEditablePosition.isNotNull())
391 insertBlockPlaceholder(firstEditablePosition, editingState); 391 insertBlockPlaceholder(firstEditablePosition, editingState);
392 } 392 }
393 return; 393 return;
394 } 394 }
395 395
396 if (node == m_startBlock) { 396 if (node == m_startBlock) {
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after
589 return; 589 return;
590 m_downstreamEnd = Position::editingPositionOf(m_downstreamEn d.anchorNode(), offset); 590 m_downstreamEnd = Position::editingPositionOf(m_downstreamEn d.anchorNode(), offset);
591 } 591 }
592 } 592 }
593 } 593 }
594 } 594 }
595 } 595 }
596 596
597 void DeleteSelectionCommand::fixupWhitespace() 597 void DeleteSelectionCommand::fixupWhitespace()
598 { 598 {
599 document().updateLayoutIgnorePendingStylesheets(); 599 document().updateStyleAndLayoutIgnorePendingStylesheets();
600 // TODO(yosin) |isRenderedCharacter()| should be removed, and we should use 600 // TODO(yosin) |isRenderedCharacter()| should be removed, and we should use
601 // |VisiblePosition::characterAfter()| and 601 // |VisiblePosition::characterAfter()| and
602 // |VisiblePosition::characterBefore()| 602 // |VisiblePosition::characterBefore()|
603 if (m_leadingWhitespace.isNotNull() && !isRenderedCharacter(m_leadingWhitesp ace) && m_leadingWhitespace.anchorNode()->isTextNode()) { 603 if (m_leadingWhitespace.isNotNull() && !isRenderedCharacter(m_leadingWhitesp ace) && m_leadingWhitespace.anchorNode()->isTextNode()) {
604 Text* textNode = toText(m_leadingWhitespace.anchorNode()); 604 Text* textNode = toText(m_leadingWhitespace.anchorNode());
605 DCHECK(!textNode->layoutObject() || textNode->layoutObject()->style()->c ollapseWhiteSpace()) << textNode; 605 DCHECK(!textNode->layoutObject() || textNode->layoutObject()->style()->c ollapseWhiteSpace()) << textNode;
606 replaceTextInNodePreservingMarkers(textNode, m_leadingWhitespace.compute OffsetInContainerNode(), 1, nonBreakingSpaceString()); 606 replaceTextInNodePreservingMarkers(textNode, m_leadingWhitespace.compute OffsetInContainerNode(), 1, nonBreakingSpaceString());
607 } 607 }
608 if (m_trailingWhitespace.isNotNull() && !isRenderedCharacter(m_trailingWhite space) && m_trailingWhitespace.anchorNode()->isTextNode()) { 608 if (m_trailingWhitespace.isNotNull() && !isRenderedCharacter(m_trailingWhite space) && m_trailingWhitespace.anchorNode()->isTextNode()) {
609 Text* textNode = toText(m_trailingWhitespace.anchorNode()); 609 Text* textNode = toText(m_trailingWhitespace.anchorNode());
(...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after
962 visitor->trace(m_deleteIntoBlockquoteStyle); 962 visitor->trace(m_deleteIntoBlockquoteStyle);
963 visitor->trace(m_startRoot); 963 visitor->trace(m_startRoot);
964 visitor->trace(m_endRoot); 964 visitor->trace(m_endRoot);
965 visitor->trace(m_startTableRow); 965 visitor->trace(m_startTableRow);
966 visitor->trace(m_endTableRow); 966 visitor->trace(m_endTableRow);
967 visitor->trace(m_temporaryPlaceholder); 967 visitor->trace(m_temporaryPlaceholder);
968 CompositeEditCommand::trace(visitor); 968 CompositeEditCommand::trace(visitor);
969 } 969 }
970 970
971 } // namespace blink 971 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698