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 980 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
991 | 991 |
992 return result; | 992 return result; |
993 } | 993 } |
994 | 994 |
995 void ApplyStyleCommand::applyInlineStyleToPushDown(Node* node, EditingStyle* sty
le) | 995 void ApplyStyleCommand::applyInlineStyleToPushDown(Node* node, EditingStyle* sty
le) |
996 { | 996 { |
997 ASSERT(node); | 997 ASSERT(node); |
998 | 998 |
999 node->document().updateStyleIfNeeded(); | 999 node->document().updateStyleIfNeeded(); |
1000 | 1000 |
1001 if (!style || style->isEmpty() || !node->renderer()) | 1001 if (!style || style->isEmpty() || !node->renderer() || node->hasTagName(ifra
meTag)) |
1002 return; | 1002 return; |
1003 | 1003 |
1004 RefPtr<EditingStyle> newInlineStyle = style; | 1004 RefPtr<EditingStyle> newInlineStyle = style; |
1005 if (node->isHTMLElement() && toHTMLElement(node)->inlineStyle()) { | 1005 if (node->isHTMLElement() && toHTMLElement(node)->inlineStyle()) { |
1006 newInlineStyle = style->copy(); | 1006 newInlineStyle = style->copy(); |
1007 newInlineStyle->mergeInlineStyleOfElement(toHTMLElement(node), EditingSt
yle::OverrideValues); | 1007 newInlineStyle->mergeInlineStyleOfElement(toHTMLElement(node), EditingSt
yle::OverrideValues); |
1008 } | 1008 } |
1009 | 1009 |
1010 // Since addInlineStyleIfNeeded can't add styles to block-flow render object
s, add style attribute instead. | 1010 // Since addInlineStyleIfNeeded can't add styles to block-flow render object
s, add style attribute instead. |
1011 // FIXME: applyInlineStyleToRange should be used here instead. | 1011 // FIXME: applyInlineStyleToRange should be used here instead. |
(...skipping 531 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 |