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 411 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
422 element = span; | 422 element = span; |
423 } else { | 423 } else { |
424 // Only handle HTML elements and text nodes. | 424 // Only handle HTML elements and text nodes. |
425 continue; | 425 continue; |
426 } | 426 } |
427 lastStyledNode = node; | 427 lastStyledNode = node; |
428 | 428 |
429 MutableStylePropertySet* inlineStyle = copyStyleOrCreateEmpty(element->i
nlineStyle()); | 429 MutableStylePropertySet* inlineStyle = copyStyleOrCreateEmpty(element->i
nlineStyle()); |
430 float currentFontSize = computedFontSize(node); | 430 float currentFontSize = computedFontSize(node); |
431 float desiredFontSize = max(MinimumFontSize, startingFontSizes.get(node)
+ style->fontSizeDelta()); | 431 float desiredFontSize = max(MinimumFontSize, startingFontSizes.get(node)
+ style->fontSizeDelta()); |
432 CSSValue* value = inlineStyle->getPropertyCSSValue(CSSPropertyFontSize); | 432 const CSSValue* value = inlineStyle->getPropertyCSSValue(CSSPropertyFont
Size); |
433 if (value) { | 433 if (value) { |
434 element->removeInlineStyleProperty(CSSPropertyFontSize); | 434 element->removeInlineStyleProperty(CSSPropertyFontSize); |
435 currentFontSize = computedFontSize(node); | 435 currentFontSize = computedFontSize(node); |
436 } | 436 } |
437 if (currentFontSize != desiredFontSize) { | 437 if (currentFontSize != desiredFontSize) { |
438 inlineStyle->setProperty(CSSPropertyFontSize, CSSPrimitiveValue::cre
ate(desiredFontSize, CSSPrimitiveValue::UnitType::Pixels), false); | 438 inlineStyle->setProperty(CSSPropertyFontSize, CSSPrimitiveValue::cre
ate(desiredFontSize, CSSPrimitiveValue::UnitType::Pixels), false); |
439 setNodeAttribute(element, styleAttr, AtomicString(inlineStyle->asTex
t())); | 439 setNodeAttribute(element, styleAttr, AtomicString(inlineStyle->asTex
t())); |
440 } | 440 } |
441 if (inlineStyle->isEmpty()) { | 441 if (inlineStyle->isEmpty()) { |
442 removeElementAttribute(element, styleAttr); | 442 removeElementAttribute(element, styleAttr); |
(...skipping 1288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1731 DEFINE_TRACE(ApplyStyleCommand) | 1731 DEFINE_TRACE(ApplyStyleCommand) |
1732 { | 1732 { |
1733 visitor->trace(m_style); | 1733 visitor->trace(m_style); |
1734 visitor->trace(m_start); | 1734 visitor->trace(m_start); |
1735 visitor->trace(m_end); | 1735 visitor->trace(m_end); |
1736 visitor->trace(m_styledInlineElement); | 1736 visitor->trace(m_styledInlineElement); |
1737 CompositeEditCommand::trace(visitor); | 1737 CompositeEditCommand::trace(visitor); |
1738 } | 1738 } |
1739 | 1739 |
1740 } // namespace blink | 1740 } // namespace blink |
OLD | NEW |