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

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

Issue 300023009: Get rid of false assert from CompositeEditCommand::moveParagraphContentsToNewBlockIfNecessary (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 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
« no previous file with comments | « LayoutTests/editing/execCommand/justify-center-empty-list-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 905 matching lines...) Expand 10 before | Expand all | Expand 10 after
916 // block but don't try and move content into it, since there's nothi ng for moveParagraphs to move. 916 // block but don't try and move content into it, since there's nothi ng for moveParagraphs to move.
917 if (!Position::hasRenderedNonAnonymousDescendantsWithHeight(upstream Start.deprecatedNode()->renderer())) 917 if (!Position::hasRenderedNonAnonymousDescendantsWithHeight(upstream Start.deprecatedNode()->renderer()))
918 return insertNewDefaultParagraphElementAt(upstreamStart); 918 return insertNewDefaultParagraphElementAt(upstreamStart);
919 } else if (isBlock(upstreamEnd.deprecatedNode())) { 919 } else if (isBlock(upstreamEnd.deprecatedNode())) {
920 if (!upstreamEnd.deprecatedNode()->isDescendantOf(upstreamStart.depr ecatedNode())) { 920 if (!upstreamEnd.deprecatedNode()->isDescendantOf(upstreamStart.depr ecatedNode())) {
921 // If the paragraph end is a descendant of paragraph start, then we need to run 921 // If the paragraph end is a descendant of paragraph start, then we need to run
922 // the rest of this function. If not, we can bail here. 922 // the rest of this function. If not, we can bail here.
923 return nullptr; 923 return nullptr;
924 } 924 }
925 } else if (enclosingBlock(upstreamEnd.deprecatedNode()) != upstreamStart .deprecatedNode()) { 925 } else if (enclosingBlock(upstreamEnd.deprecatedNode()) != upstreamStart .deprecatedNode()) {
926 // The visibleEnd. It must be an ancestor of the paragraph start.
927 // We can bail as we have a full block to work with.
928 ASSERT(upstreamStart.deprecatedNode()->isDescendantOf(enclosingBlock (upstreamEnd.deprecatedNode())));
Yuta Kitamura 2014/05/28 09:14:10 I tried to follow the code but couldn't understand
yosin_UTC9 2014/05/29 04:04:39 My reasoning is rather simple. We have a case brea
Yuta Kitamura 2014/05/29 09:00:24 I thought about this for some time but I couldn't
Yuta Kitamura 2014/05/30 04:40:45 I started to feel like this ASSERT is indeed bogus
yosin_UTC9 2014/05/30 05:04:26 Done.
929 return nullptr; 926 return nullptr;
930 } else if (isEndOfEditableOrNonEditableContent(visibleEnd)) { 927 } else if (isEndOfEditableOrNonEditableContent(visibleEnd)) {
931 // At the end of the editable region. We can bail here as well. 928 // At the end of the editable region. We can bail here as well.
932 return nullptr; 929 return nullptr;
933 } 930 }
934 } 931 }
935 932
936 RefPtr<Node> newBlock = insertNewDefaultParagraphElementAt(upstreamStart); 933 RefPtr<Node> newBlock = insertNewDefaultParagraphElementAt(upstreamStart);
937 934
938 bool endWasBr = isHTMLBRElement(*visibleParagraphEnd.deepEquivalent().deprec atedNode()); 935 bool endWasBr = isHTMLBRElement(*visibleParagraphEnd.deepEquivalent().deprec atedNode());
(...skipping 531 matching lines...) Expand 10 before | Expand all | Expand 10 after
1470 1467
1471 return node.release(); 1468 return node.release();
1472 } 1469 }
1473 1470
1474 PassRefPtrWillBeRawPtr<Element> createBlockPlaceholderElement(Document& document ) 1471 PassRefPtrWillBeRawPtr<Element> createBlockPlaceholderElement(Document& document )
1475 { 1472 {
1476 return document.createElement(brTag, false); 1473 return document.createElement(brTag, false);
1477 } 1474 }
1478 1475
1479 } // namespace WebCore 1476 } // namespace WebCore
OLDNEW
« no previous file with comments | « LayoutTests/editing/execCommand/justify-center-empty-list-crash-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698