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 794 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
805 // Add to this element's inline style and skip over its contents. | 805 // Add to this element's inline style and skip over its contents. |
806 next = NodeTraversal::nextSkippingChildren(*node); | 806 next = NodeTraversal::nextSkippingChildren(*node); |
807 if (!style->style()) | 807 if (!style->style()) |
808 continue; | 808 continue; |
809 RefPtrWillBeRawPtr<MutableStylePropertySet> inlineStyle = copyStyleO
rCreateEmpty(element->inlineStyle()); | 809 RefPtrWillBeRawPtr<MutableStylePropertySet> inlineStyle = copyStyleO
rCreateEmpty(element->inlineStyle()); |
810 inlineStyle->mergeAndOverrideOnConflict(style->style()); | 810 inlineStyle->mergeAndOverrideOnConflict(style->style()); |
811 setNodeAttribute(element, styleAttr, AtomicString(inlineStyle->asTex
t())); | 811 setNodeAttribute(element, styleAttr, AtomicString(inlineStyle->asTex
t())); |
812 continue; | 812 continue; |
813 } | 813 } |
814 | 814 |
815 if (isBlock(node.get())) | 815 if (isEnclosingBlock(node.get())) |
816 continue; | 816 continue; |
817 | 817 |
818 if (node->hasChildren()) { | 818 if (node->hasChildren()) { |
819 if (node->contains(pastEndNode.get()) || containsNonEditableRegion(*
node) || !node->parentNode()->hasEditableStyle()) | 819 if (node->contains(pastEndNode.get()) || containsNonEditableRegion(*
node) || !node->parentNode()->hasEditableStyle()) |
820 continue; | 820 continue; |
821 if (editingIgnoresContent(node.get())) { | 821 if (editingIgnoresContent(node.get())) { |
822 next = NodeTraversal::nextSkippingChildren(*node); | 822 next = NodeTraversal::nextSkippingChildren(*node); |
823 continue; | 823 continue; |
824 } | 824 } |
825 } | 825 } |
826 | 826 |
827 Node* runStart = node.get(); | 827 Node* runStart = node.get(); |
828 Node* runEnd = node.get(); | 828 Node* runEnd = node.get(); |
829 Node* sibling = node->nextSibling(); | 829 Node* sibling = node->nextSibling(); |
830 while (sibling && sibling != pastEndNode && !sibling->contains(pastEndNo
de.get()) | 830 while (sibling && sibling != pastEndNode && !sibling->contains(pastEndNo
de.get()) |
831 && (!isBlock(sibling) || isHTMLBRElement(*sibling)) | 831 && (!isEnclosingBlock(sibling) || isHTMLBRElement(*sibling)) |
832 && !containsNonEditableRegion(*sibling)) { | 832 && !containsNonEditableRegion(*sibling)) { |
833 runEnd = sibling; | 833 runEnd = sibling; |
834 sibling = runEnd->nextSibling(); | 834 sibling = runEnd->nextSibling(); |
835 } | 835 } |
836 ASSERT(runEnd); | 836 ASSERT(runEnd); |
837 next = NodeTraversal::nextSkippingChildren(*runEnd); | 837 next = NodeTraversal::nextSkippingChildren(*runEnd); |
838 | 838 |
839 Node* pastEndNode = NodeTraversal::nextSkippingChildren(*runEnd); | 839 Node* pastEndNode = NodeTraversal::nextSkippingChildren(*runEnd); |
840 if (!shouldApplyInlineStyleToRun(style, runStart, pastEndNode)) | 840 if (!shouldApplyInlineStyleToRun(style, runStart, pastEndNode)) |
841 continue; | 841 continue; |
(...skipping 752 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1594 DEFINE_TRACE(ApplyStyleCommand) | 1594 DEFINE_TRACE(ApplyStyleCommand) |
1595 { | 1595 { |
1596 visitor->trace(m_style); | 1596 visitor->trace(m_style); |
1597 visitor->trace(m_start); | 1597 visitor->trace(m_start); |
1598 visitor->trace(m_end); | 1598 visitor->trace(m_end); |
1599 visitor->trace(m_styledInlineElement); | 1599 visitor->trace(m_styledInlineElement); |
1600 CompositeEditCommand::trace(visitor); | 1600 CompositeEditCommand::trace(visitor); |
1601 } | 1601 } |
1602 | 1602 |
1603 } | 1603 } |
OLD | NEW |