OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (C) 2007, 2008, 2009 Apple Computer, Inc. | 2 * Copyright (C) 2007, 2008, 2009 Apple Computer, Inc. |
3 * Copyright (C) 2010, 2011 Google Inc. All rights reserved. | 3 * Copyright (C) 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 1410 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1421 , m_applyItalic(false) | 1421 , m_applyItalic(false) |
1422 , m_applyUnderline(false) | 1422 , m_applyUnderline(false) |
1423 , m_applyLineThrough(false) | 1423 , m_applyLineThrough(false) |
1424 , m_applySubscript(false) | 1424 , m_applySubscript(false) |
1425 , m_applySuperscript(false) | 1425 , m_applySuperscript(false) |
1426 { | 1426 { |
1427 Document* document = position.document(); | 1427 Document* document = position.document(); |
1428 if (!style || !style->style() || !document || !document->frame()) | 1428 if (!style || !style->style() || !document || !document->frame()) |
1429 return; | 1429 return; |
1430 | 1430 |
1431 if (!position.element()) | |
yosin_UTC9
2015/03/11 01:07:32
nit: we can put this test into L1428.
rwlbuis
2015/03/11 19:19:17
Done.
| |
1432 return; | |
1433 | |
1431 RefPtrWillBeRawPtr<CSSComputedStyleDeclaration> computedStyle = position.com putedStyle(); | 1434 RefPtrWillBeRawPtr<CSSComputedStyleDeclaration> computedStyle = position.com putedStyle(); |
1432 // FIXME: take care of background-color in effect | 1435 // FIXME: take care of background-color in effect |
1433 RefPtrWillBeRawPtr<MutableStylePropertySet> mutableStyle = getPropertiesNotI n(style->style(), computedStyle.get()); | 1436 RefPtrWillBeRawPtr<MutableStylePropertySet> mutableStyle = getPropertiesNotI n(style->style(), computedStyle.get()); |
1437 ASSERT(mutableStyle); | |
1434 | 1438 |
1435 reconcileTextDecorationProperties(mutableStyle.get()); | 1439 reconcileTextDecorationProperties(mutableStyle.get()); |
1436 if (!document->frame()->editor().shouldStyleWithCSS()) | 1440 if (!document->frame()->editor().shouldStyleWithCSS()) |
1437 extractTextStyles(document, mutableStyle.get(), computedStyle->fixedPitc hFontType()); | 1441 extractTextStyles(document, mutableStyle.get(), computedStyle->fixedPitc hFontType()); |
1438 | 1442 |
1439 // Changing the whitespace style in a tab span would collapse the tab into a space. | 1443 // Changing the whitespace style in a tab span would collapse the tab into a space. |
1440 if (isTabHTMLSpanElementTextNode(position.deprecatedNode()) || isTabHTMLSpan Element((position.deprecatedNode()))) | 1444 if (isTabHTMLSpanElementTextNode(position.deprecatedNode()) || isTabHTMLSpan Element((position.deprecatedNode()))) |
1441 mutableStyle->removeProperty(CSSPropertyWhiteSpace); | 1445 mutableStyle->removeProperty(CSSPropertyWhiteSpace); |
1442 | 1446 |
1443 // If unicode-bidi is present in mutableStyle and direction is not, then add direction to mutableStyle. | 1447 // If unicode-bidi is present in mutableStyle and direction is not, then add direction to mutableStyle. |
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1678 { | 1682 { |
1679 for (Node* ancestor = node; ancestor; ancestor = ancestor->parentNode()) { | 1683 for (Node* ancestor = node; ancestor; ancestor = ancestor->parentNode()) { |
1680 RefPtrWillBeRawPtr<CSSComputedStyleDeclaration> ancestorStyle = CSSCompu tedStyleDeclaration::create(ancestor); | 1684 RefPtrWillBeRawPtr<CSSComputedStyleDeclaration> ancestorStyle = CSSCompu tedStyleDeclaration::create(ancestor); |
1681 if (!hasTransparentBackgroundColor(ancestorStyle.get())) | 1685 if (!hasTransparentBackgroundColor(ancestorStyle.get())) |
1682 return ancestorStyle->getPropertyCSSValue(CSSPropertyBackgroundColor ); | 1686 return ancestorStyle->getPropertyCSSValue(CSSPropertyBackgroundColor ); |
1683 } | 1687 } |
1684 return nullptr; | 1688 return nullptr; |
1685 } | 1689 } |
1686 | 1690 |
1687 } | 1691 } |
OLD | NEW |