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

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

Issue 1289423005: Move a static member function hasRenderedNonAnonymousDescendantsWithHeight() out from PositionAlgori (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 2015-08-19T23:25:33 Rebase Created 5 years, 4 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/Position.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 923 matching lines...) Expand 10 before | Expand all | Expand 10 after
934 if (comparePositions(pos, upstreamStart) < 0) 934 if (comparePositions(pos, upstreamStart) < 0)
935 return nullptr; 935 return nullptr;
936 936
937 // Perform some checks to see if we need to perform work in this function. 937 // Perform some checks to see if we need to perform work in this function.
938 if (isBlock(upstreamStart.anchorNode())) { 938 if (isBlock(upstreamStart.anchorNode())) {
939 // If the block is the root editable element, always move content to a n ew block, 939 // If the block is the root editable element, always move content to a n ew block,
940 // since it is illegal to modify attributes on the root editable element for editing. 940 // since it is illegal to modify attributes on the root editable element for editing.
941 if (upstreamStart.anchorNode() == editableRootForPosition(upstreamStart) ) { 941 if (upstreamStart.anchorNode() == editableRootForPosition(upstreamStart) ) {
942 // If the block is the root editable element and it contains no visi ble content, create a new 942 // If the block is the root editable element and it contains no visi ble content, create a new
943 // block but don't try and move content into it, since there's nothi ng for moveParagraphs to move. 943 // block but don't try and move content into it, since there's nothi ng for moveParagraphs to move.
944 if (!Position::hasRenderedNonAnonymousDescendantsWithHeight(upstream Start.anchorNode()->layoutObject())) 944 if (!hasRenderedNonAnonymousDescendantsWithHeight(upstreamStart.anch orNode()->layoutObject()))
945 return insertNewDefaultParagraphElementAt(upstreamStart); 945 return insertNewDefaultParagraphElementAt(upstreamStart);
946 } else if (isBlock(upstreamEnd.anchorNode())) { 946 } else if (isBlock(upstreamEnd.anchorNode())) {
947 if (!upstreamEnd.anchorNode()->isDescendantOf(upstreamStart.anchorNo de())) { 947 if (!upstreamEnd.anchorNode()->isDescendantOf(upstreamStart.anchorNo de())) {
948 // If the paragraph end is a descendant of paragraph start, then we need to run 948 // If the paragraph end is a descendant of paragraph start, then we need to run
949 // the rest of this function. If not, we can bail here. 949 // the rest of this function. If not, we can bail here.
950 return nullptr; 950 return nullptr;
951 } 951 }
952 } else if (enclosingBlock(upstreamEnd.anchorNode()) != upstreamStart.anc horNode()) { 952 } else if (enclosingBlock(upstreamEnd.anchorNode()) != upstreamStart.anc horNode()) {
953 // It should be an ancestor of the paragraph start. 953 // It should be an ancestor of the paragraph start.
954 // We can bail as we have a full block to work with. 954 // We can bail as we have a full block to work with.
(...skipping 547 matching lines...) Expand 10 before | Expand all | Expand 10 after
1502 } 1502 }
1503 1503
1504 DEFINE_TRACE(CompositeEditCommand) 1504 DEFINE_TRACE(CompositeEditCommand)
1505 { 1505 {
1506 visitor->trace(m_commands); 1506 visitor->trace(m_commands);
1507 visitor->trace(m_composition); 1507 visitor->trace(m_composition);
1508 EditCommand::trace(visitor); 1508 EditCommand::trace(visitor);
1509 } 1509 }
1510 1510
1511 } // namespace blink 1511 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/editing/Position.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698