Chromium Code Reviews| 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 884 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 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 if (pos.isNull()) |
| 901 return nullptr; | 901 return nullptr; |
| 902 | 902 |
| 903 document().updateLayoutIgnorePendingStylesheets(); | 903 document().updateLayoutIgnorePendingStylesheets(); |
| 904 | 904 |
| 905 if (!isEditablePosition(pos, ContentIsEditable, DoNotUpdateStyle)) | |
|
Yuta Kitamura
2014/06/13 07:29:01
I'm not 100% certain whether this check should liv
yosin_UTC9
2014/06/13 09:01:27
Agree. It should be caller's responsibility.
| |
| 906 return nullptr; | |
| 907 | |
| 905 // It's strange that this function is responsible for verifying that pos has not been invalidated | 908 // 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. | 909 // by an earlier call to this function. The caller, applyBlockStyle, should do this. |
| 907 VisiblePosition visiblePos(pos, VP_DEFAULT_AFFINITY); | 910 VisiblePosition visiblePos(pos, VP_DEFAULT_AFFINITY); |
| 908 VisiblePosition visibleParagraphStart(startOfParagraph(visiblePos)); | 911 VisiblePosition visibleParagraphStart(startOfParagraph(visiblePos)); |
| 909 VisiblePosition visibleParagraphEnd = endOfParagraph(visiblePos); | 912 VisiblePosition visibleParagraphEnd = endOfParagraph(visiblePos); |
| 910 VisiblePosition next = visibleParagraphEnd.next(); | 913 VisiblePosition next = visibleParagraphEnd.next(); |
| 911 VisiblePosition visibleEnd = next.isNotNull() ? next : visibleParagraphEnd; | 914 VisiblePosition visibleEnd = next.isNotNull() ? next : visibleParagraphEnd; |
| 912 | 915 |
| 913 Position upstreamStart = visibleParagraphStart.deepEquivalent().upstream(); | 916 Position upstreamStart = visibleParagraphStart.deepEquivalent().upstream(); |
| 914 Position upstreamEnd = visibleEnd.deepEquivalent().upstream(); | 917 Position upstreamEnd = visibleEnd.deepEquivalent().upstream(); |
| (...skipping 582 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1497 } | 1500 } |
| 1498 | 1501 |
| 1499 void CompositeEditCommand::trace(Visitor* visitor) | 1502 void CompositeEditCommand::trace(Visitor* visitor) |
| 1500 { | 1503 { |
| 1501 visitor->trace(m_commands); | 1504 visitor->trace(m_commands); |
| 1502 visitor->trace(m_composition); | 1505 visitor->trace(m_composition); |
| 1503 EditCommand::trace(visitor); | 1506 EditCommand::trace(visitor); |
| 1504 } | 1507 } |
| 1505 | 1508 |
| 1506 } // namespace WebCore | 1509 } // namespace WebCore |
| OLD | NEW |