| OLD | NEW |
| 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 Loading... |
| 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. | 926 // It should be an ancestor of the paragraph start. |
| 927 // We can bail as we have a full block to work with. | 927 // We can bail as we have a full block to work with. |
| 928 ASSERT(upstreamStart.deprecatedNode()->isDescendantOf(enclosingBlock
(upstreamEnd.deprecatedNode()))); | |
| 929 return nullptr; | 928 return nullptr; |
| 930 } else if (isEndOfEditableOrNonEditableContent(visibleEnd)) { | 929 } else if (isEndOfEditableOrNonEditableContent(visibleEnd)) { |
| 931 // At the end of the editable region. We can bail here as well. | 930 // At the end of the editable region. We can bail here as well. |
| 932 return nullptr; | 931 return nullptr; |
| 933 } | 932 } |
| 934 } | 933 } |
| 935 | 934 |
| 936 if (visibleParagraphEnd.isNull()) | 935 if (visibleParagraphEnd.isNull()) |
| 937 return nullptr; | 936 return nullptr; |
| 938 | 937 |
| (...skipping 536 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1475 | 1474 |
| 1476 return node.release(); | 1475 return node.release(); |
| 1477 } | 1476 } |
| 1478 | 1477 |
| 1479 PassRefPtrWillBeRawPtr<Element> createBlockPlaceholderElement(Document& document
) | 1478 PassRefPtrWillBeRawPtr<Element> createBlockPlaceholderElement(Document& document
) |
| 1480 { | 1479 { |
| 1481 return document.createElement(brTag, false); | 1480 return document.createElement(brTag, false); |
| 1482 } | 1481 } |
| 1483 | 1482 |
| 1484 } // namespace WebCore | 1483 } // namespace WebCore |
| OLD | NEW |