OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2005, 2006, 2008, 2009 Apple Inc. All rights reserved. | 2 * Copyright (C) 2005, 2006, 2008, 2009 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 874 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
885 bool ApplyStyleCommand::removeInlineStyleFromElement(EditingStyle* style, PassRe
fPtr<HTMLElement> element, InlineStyleRemovalMode mode, EditingStyle* extractedS
tyle) | 885 bool ApplyStyleCommand::removeInlineStyleFromElement(EditingStyle* style, PassRe
fPtr<HTMLElement> element, InlineStyleRemovalMode mode, EditingStyle* extractedS
tyle) |
886 { | 886 { |
887 ASSERT(element); | 887 ASSERT(element); |
888 | 888 |
889 if (!element->parentNode() || !element->parentNode()->isContentEditable(Node
::UserSelectAllIsAlwaysNonEditable)) | 889 if (!element->parentNode() || !element->parentNode()->isContentEditable(Node
::UserSelectAllIsAlwaysNonEditable)) |
890 return false; | 890 return false; |
891 | 891 |
892 if (isStyledInlineElementToRemove(element.get())) { | 892 if (isStyledInlineElementToRemove(element.get())) { |
893 if (mode == RemoveNone) | 893 if (mode == RemoveNone) |
894 return true; | 894 return true; |
895 ASSERT(extractedStyle); | 895 if (extractedStyle) |
896 extractedStyle->mergeInlineStyleOfElement(element.get(), EditingStyle::O
verrideValues); | 896 extractedStyle->mergeInlineStyleOfElement(element.get(), EditingStyl
e::OverrideValues); |
897 removeNodePreservingChildren(element); | 897 removeNodePreservingChildren(element); |
898 return true; | 898 return true; |
899 } | 899 } |
900 | 900 |
901 bool removed = false; | 901 bool removed = false; |
902 if (removeImplicitlyStyledElement(style, element.get(), mode, extractedStyle
)) | 902 if (removeImplicitlyStyledElement(style, element.get(), mode, extractedStyle
)) |
903 removed = true; | 903 removed = true; |
904 | 904 |
905 if (!element->inDocument()) | 905 if (!element->inDocument()) |
906 return removed; | 906 return removed; |
(...skipping 636 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1543 String textToMove = nextText->data(); | 1543 String textToMove = nextText->data(); |
1544 insertTextIntoNode(childText, childText->length(), textToMove); | 1544 insertTextIntoNode(childText, childText->length(), textToMove); |
1545 removeNode(next); | 1545 removeNode(next); |
1546 // don't move child node pointer. it may want to merge with more text no
des. | 1546 // don't move child node pointer. it may want to merge with more text no
des. |
1547 } | 1547 } |
1548 | 1548 |
1549 updateStartEnd(newStart, newEnd); | 1549 updateStartEnd(newStart, newEnd); |
1550 } | 1550 } |
1551 | 1551 |
1552 } | 1552 } |
OLD | NEW |