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

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

Issue 315513003: Make sure calling moveParagaph() with proper parameters in CompositeEditCommand::moveParagraphConten (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 2014-06-05T10:29:01 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 | « LayoutTests/editing/execCommand/apply-style-empty-paragraph-start-crash-expected.txt ('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 932 matching lines...) Expand 10 before | Expand all | Expand 10 after
943 } 943 }
944 } 944 }
945 945
946 if (visibleParagraphEnd.isNull()) 946 if (visibleParagraphEnd.isNull())
947 return nullptr; 947 return nullptr;
948 948
949 RefPtrWillBeRawPtr<Node> newBlock = insertNewDefaultParagraphElementAt(upstr eamStart); 949 RefPtrWillBeRawPtr<Node> newBlock = insertNewDefaultParagraphElementAt(upstr eamStart);
950 950
951 bool endWasBr = isHTMLBRElement(*visibleParagraphEnd.deepEquivalent().deprec atedNode()); 951 bool endWasBr = isHTMLBRElement(*visibleParagraphEnd.deepEquivalent().deprec atedNode());
952 952
953 // Inserting default paragraph element can change visible position. We
954 // should update visible positions before use them.
955 visiblePos = VisiblePosition(pos, VP_DEFAULT_AFFINITY);
956 visibleParagraphStart = VisiblePosition(startOfParagraph(visiblePos));
957 visibleParagraphEnd = VisiblePosition(endOfParagraph(visiblePos));
953 moveParagraphs(visibleParagraphStart, visibleParagraphEnd, VisiblePosition(f irstPositionInNode(newBlock.get()))); 958 moveParagraphs(visibleParagraphStart, visibleParagraphEnd, VisiblePosition(f irstPositionInNode(newBlock.get())));
954 959
955 if (newBlock->lastChild() && isHTMLBRElement(*newBlock->lastChild()) && !end WasBr) 960 if (newBlock->lastChild() && isHTMLBRElement(*newBlock->lastChild()) && !end WasBr)
956 removeNode(newBlock->lastChild()); 961 removeNode(newBlock->lastChild());
957 962
958 return newBlock.release(); 963 return newBlock.release();
959 } 964 }
960 965
961 void CompositeEditCommand::pushAnchorElementDown(Node* anchorNode) 966 void CompositeEditCommand::pushAnchorElementDown(Node* anchorNode)
962 { 967 {
(...skipping 529 matching lines...) Expand 10 before | Expand all | Expand 10 after
1492 } 1497 }
1493 1498
1494 void CompositeEditCommand::trace(Visitor* visitor) 1499 void CompositeEditCommand::trace(Visitor* visitor)
1495 { 1500 {
1496 visitor->trace(m_commands); 1501 visitor->trace(m_commands);
1497 visitor->trace(m_composition); 1502 visitor->trace(m_composition);
1498 EditCommand::trace(visitor); 1503 EditCommand::trace(visitor);
1499 } 1504 }
1500 1505
1501 } // namespace WebCore 1506 } // namespace WebCore
OLDNEW
« no previous file with comments | « LayoutTests/editing/execCommand/apply-style-empty-paragraph-start-crash-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698