OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2005, 2006, 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2005, 2006, 2008 Apple Inc. All rights reserved. |
3 * Copyright (C) 2009, 2010, 2011 Google Inc. All rights reserved. | 3 * Copyright (C) 2009, 2010, 2011 Google Inc. All rights reserved. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
7 * are met: | 7 * are met: |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 466 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
477 if (inlineStyle) { | 477 if (inlineStyle) { |
478 if (element->isHTMLElement()) { | 478 if (element->isHTMLElement()) { |
479 Vector<QualifiedName> attributes; | 479 Vector<QualifiedName> attributes; |
480 HTMLElement* htmlElement = toHTMLElement(element); | 480 HTMLElement* htmlElement = toHTMLElement(element); |
481 ASSERT(htmlElement); | 481 ASSERT(htmlElement); |
482 | 482 |
483 if (newInlineStyle->conflictsWithImplicitStyleOfElement(htmlElem
ent)) { | 483 if (newInlineStyle->conflictsWithImplicitStyleOfElement(htmlElem
ent)) { |
484 // e.g. <b style="font-weight: normal;"> is converted to <sp
an style="font-weight: normal;"> | 484 // e.g. <b style="font-weight: normal;"> is converted to <sp
an style="font-weight: normal;"> |
485 node = replaceElementWithSpanPreservingChildrenAndAttributes
(htmlElement); | 485 node = replaceElementWithSpanPreservingChildrenAndAttributes
(htmlElement); |
486 element = toElement(node); | 486 element = toElement(node); |
| 487 inlineStyle = element->inlineStyle(); |
487 insertedNodes.didReplaceNode(*htmlElement, *node); | 488 insertedNodes.didReplaceNode(*htmlElement, *node); |
488 } else if (newInlineStyle->extractConflictingImplicitStyleOfAttr
ibutes(htmlElement, EditingStyle::PreserveWritingDirection, 0, attributes, | 489 } else if (newInlineStyle->extractConflictingImplicitStyleOfAttr
ibutes(htmlElement, EditingStyle::PreserveWritingDirection, 0, attributes, |
489 EditingStyle::DoNotExtractMatchingStyle)) { | 490 EditingStyle::DoNotExtractMatchingStyle)) { |
490 // e.g. <font size="3" style="font-size: 20px;"> is converte
d to <font style="font-size: 20px;"> | 491 // e.g. <font size="3" style="font-size: 20px;"> is converte
d to <font style="font-size: 20px;"> |
491 for (size_t i = 0; i < attributes.size(); i++) | 492 for (size_t i = 0; i < attributes.size(); i++) |
492 removeNodeAttribute(element, attributes[i]); | 493 removeNodeAttribute(element, attributes[i]); |
493 } | 494 } |
494 } | 495 } |
495 | 496 |
496 ContainerNode* context = element->parentNode(); | 497 ContainerNode* context = element->parentNode(); |
(...skipping 996 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1493 removeNodeAndPruneAncestors(nodeAfterInsertionPos.get()); | 1494 removeNodeAndPruneAncestors(nodeAfterInsertionPos.get()); |
1494 | 1495 |
1495 VisibleSelection selectionAfterReplace(m_selectReplacement ? start : end, en
d); | 1496 VisibleSelection selectionAfterReplace(m_selectReplacement ? start : end, en
d); |
1496 | 1497 |
1497 setEndingSelection(selectionAfterReplace); | 1498 setEndingSelection(selectionAfterReplace); |
1498 | 1499 |
1499 return true; | 1500 return true; |
1500 } | 1501 } |
1501 | 1502 |
1502 } // namespace WebCore | 1503 } // namespace WebCore |
OLD | NEW |