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

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

Issue 335773002: Don't move uneditable paragraph contents in CompositeEditCommand::moveParagraphContentsToNewBlockIfN (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 2014-06-16T12:44:07 Created 6 years, 6 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
« no previous file with comments | « Source/core/editing/ApplyStyleCommand.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2005, 2006, 2007, 2008 Apple 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 879 matching lines...) Expand 10 before | Expand all | Expand 10 after
890 RefPtrWillBeRawPtr<Element> paragraphElement = createDefaultParagraphElement (document()); 890 RefPtrWillBeRawPtr<Element> paragraphElement = createDefaultParagraphElement (document());
891 paragraphElement->appendChild(createBreakElement(document())); 891 paragraphElement->appendChild(createBreakElement(document()));
892 insertNodeAt(paragraphElement, position); 892 insertNodeAt(paragraphElement, position);
893 return paragraphElement.release(); 893 return paragraphElement.release();
894 } 894 }
895 895
896 // If the paragraph is not entirely within it's own block, create one and move t he paragraph into 896 // If the paragraph is not entirely within it's own block, create one and move t he paragraph into
897 // it, and return that block. Otherwise return 0. 897 // it, and return that block. Otherwise return 0.
898 PassRefPtrWillBeRawPtr<Element> CompositeEditCommand::moveParagraphContentsToNew BlockIfNecessary(const Position& pos) 898 PassRefPtrWillBeRawPtr<Element> CompositeEditCommand::moveParagraphContentsToNew BlockIfNecessary(const Position& pos)
899 { 899 {
900 if (pos.isNull()) 900 ASSERT(isEditablePosition(pos, ContentIsEditable, DoNotUpdateStyle));
901 return nullptr;
902
903 document().updateLayoutIgnorePendingStylesheets();
904 901
905 // It's strange that this function is responsible for verifying that pos has not been invalidated 902 // It's strange that this function is responsible for verifying that pos has not been invalidated
906 // by an earlier call to this function. The caller, applyBlockStyle, should do this. 903 // by an earlier call to this function. The caller, applyBlockStyle, should do this.
907 VisiblePosition visiblePos(pos, VP_DEFAULT_AFFINITY); 904 VisiblePosition visiblePos(pos, VP_DEFAULT_AFFINITY);
908 VisiblePosition visibleParagraphStart(startOfParagraph(visiblePos)); 905 VisiblePosition visibleParagraphStart(startOfParagraph(visiblePos));
909 VisiblePosition visibleParagraphEnd = endOfParagraph(visiblePos); 906 VisiblePosition visibleParagraphEnd = endOfParagraph(visiblePos);
910 VisiblePosition next = visibleParagraphEnd.next(); 907 VisiblePosition next = visibleParagraphEnd.next();
911 VisiblePosition visibleEnd = next.isNotNull() ? next : visibleParagraphEnd; 908 VisiblePosition visibleEnd = next.isNotNull() ? next : visibleParagraphEnd;
912 909
913 Position upstreamStart = visibleParagraphStart.deepEquivalent().upstream(); 910 Position upstreamStart = visibleParagraphStart.deepEquivalent().upstream();
(...skipping 583 matching lines...) Expand 10 before | Expand all | Expand 10 after
1497 } 1494 }
1498 1495
1499 void CompositeEditCommand::trace(Visitor* visitor) 1496 void CompositeEditCommand::trace(Visitor* visitor)
1500 { 1497 {
1501 visitor->trace(m_commands); 1498 visitor->trace(m_commands);
1502 visitor->trace(m_composition); 1499 visitor->trace(m_composition);
1503 EditCommand::trace(visitor); 1500 EditCommand::trace(visitor);
1504 } 1501 }
1505 1502
1506 } // namespace WebCore 1503 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/editing/ApplyStyleCommand.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698