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 1430 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1441 HTMLElement* styleContainer = 0; | 1441 HTMLElement* styleContainer = 0; |
1442 for (Node* container = startNode.get(); container && startNode == endNode; c
ontainer = container->firstChild()) { | 1442 for (Node* container = startNode.get(); container && startNode == endNode; c
ontainer = container->firstChild()) { |
1443 if (isHTMLFontElement(*container)) | 1443 if (isHTMLFontElement(*container)) |
1444 fontContainer = toHTMLFontElement(container); | 1444 fontContainer = toHTMLFontElement(container); |
1445 bool styleContainerIsNotSpan = !isHTMLSpanElement(styleContainer); | 1445 bool styleContainerIsNotSpan = !isHTMLSpanElement(styleContainer); |
1446 if (container->isHTMLElement()) { | 1446 if (container->isHTMLElement()) { |
1447 HTMLElement* containerElement = toHTMLElement(container); | 1447 HTMLElement* containerElement = toHTMLElement(container); |
1448 if (isHTMLSpanElement(*containerElement) || (styleContainerIsNotSpan
&& containerElement->hasChildren())) | 1448 if (isHTMLSpanElement(*containerElement) || (styleContainerIsNotSpan
&& containerElement->hasChildren())) |
1449 styleContainer = toHTMLElement(container); | 1449 styleContainer = toHTMLElement(container); |
1450 } | 1450 } |
1451 if (!container->firstChild()) | 1451 if (!container->hasChildren()) |
1452 break; | 1452 break; |
1453 startNode = container->firstChild(); | 1453 startNode = container->firstChild(); |
1454 endNode = container->lastChild(); | 1454 endNode = container->lastChild(); |
1455 } | 1455 } |
1456 | 1456 |
1457 // Font tags need to go outside of CSS so that CSS font sizes override leagc
y font sizes. | 1457 // Font tags need to go outside of CSS so that CSS font sizes override leagc
y font sizes. |
1458 if (styleChange.applyFontColor() || styleChange.applyFontFace() || styleChan
ge.applyFontSize()) { | 1458 if (styleChange.applyFontColor() || styleChange.applyFontFace() || styleChan
ge.applyFontSize()) { |
1459 if (fontContainer) { | 1459 if (fontContainer) { |
1460 if (styleChange.applyFontColor()) | 1460 if (styleChange.applyFontColor()) |
1461 setNodeAttribute(fontContainer, colorAttr, AtomicString(styleCha
nge.fontColor())); | 1461 setNodeAttribute(fontContainer, colorAttr, AtomicString(styleCha
nge.fontColor())); |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1571 void ApplyStyleCommand::trace(Visitor* visitor) | 1571 void ApplyStyleCommand::trace(Visitor* visitor) |
1572 { | 1572 { |
1573 visitor->trace(m_style); | 1573 visitor->trace(m_style); |
1574 visitor->trace(m_start); | 1574 visitor->trace(m_start); |
1575 visitor->trace(m_end); | 1575 visitor->trace(m_end); |
1576 visitor->trace(m_styledInlineElement); | 1576 visitor->trace(m_styledInlineElement); |
1577 CompositeEditCommand::trace(visitor); | 1577 CompositeEditCommand::trace(visitor); |
1578 } | 1578 } |
1579 | 1579 |
1580 } | 1580 } |
OLD | NEW |