| 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 1250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1261 return nullptr; | 1261 return nullptr; |
| 1262 | 1262 |
| 1263 RefPtr<EditingStyle> style = EditingStyle::create(element, EditingStyle::All
Properties); | 1263 RefPtr<EditingStyle> style = EditingStyle::create(element, EditingStyle::All
Properties); |
| 1264 style->mergeTypingStyle(&element->document()); | 1264 style->mergeTypingStyle(&element->document()); |
| 1265 | 1265 |
| 1266 // If background color is transparent, traverse parent nodes until we hit a
different value or document root | 1266 // If background color is transparent, traverse parent nodes until we hit a
different value or document root |
| 1267 // Also, if the selection is a range, ignore the background color at the sta
rt of selection, | 1267 // Also, if the selection is a range, ignore the background color at the sta
rt of selection, |
| 1268 // and find the background color of the common ancestor. | 1268 // and find the background color of the common ancestor. |
| 1269 if (shouldUseBackgroundColorInEffect && (selection.isRange() || hasTranspare
ntBackgroundColor(style->m_mutableStyle.get()))) { | 1269 if (shouldUseBackgroundColorInEffect && (selection.isRange() || hasTranspare
ntBackgroundColor(style->m_mutableStyle.get()))) { |
| 1270 RefPtrWillBeRawPtr<Range> range(selection.toNormalizedRange()); | 1270 RefPtrWillBeRawPtr<Range> range(selection.toNormalizedRange()); |
| 1271 if (PassRefPtrWillBeRawPtr<CSSValue> value = backgroundColorInEffect(ran
ge->commonAncestorContainer(IGNORE_EXCEPTION))) | 1271 if (PassRefPtrWillBeRawPtr<CSSValue> value = backgroundColorInEffect(ran
ge->commonAncestorContainer())) |
| 1272 style->setProperty(CSSPropertyBackgroundColor, value->cssText()); | 1272 style->setProperty(CSSPropertyBackgroundColor, value->cssText()); |
| 1273 } | 1273 } |
| 1274 | 1274 |
| 1275 return style; | 1275 return style; |
| 1276 } | 1276 } |
| 1277 | 1277 |
| 1278 WritingDirection EditingStyle::textDirectionForSelection(const VisibleSelection&
selection, EditingStyle* typingStyle, bool& hasNestedOrMultipleEmbeddings) | 1278 WritingDirection EditingStyle::textDirectionForSelection(const VisibleSelection&
selection, EditingStyle* typingStyle, bool& hasNestedOrMultipleEmbeddings) |
| 1279 { | 1279 { |
| 1280 hasNestedOrMultipleEmbeddings = true; | 1280 hasNestedOrMultipleEmbeddings = true; |
| 1281 | 1281 |
| (...skipping 365 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1647 { | 1647 { |
| 1648 for (Node* ancestor = node; ancestor; ancestor = ancestor->parentNode()) { | 1648 for (Node* ancestor = node; ancestor; ancestor = ancestor->parentNode()) { |
| 1649 RefPtr<CSSComputedStyleDeclaration> ancestorStyle = CSSComputedStyleDecl
aration::create(ancestor); | 1649 RefPtr<CSSComputedStyleDeclaration> ancestorStyle = CSSComputedStyleDecl
aration::create(ancestor); |
| 1650 if (!hasTransparentBackgroundColor(ancestorStyle.get())) | 1650 if (!hasTransparentBackgroundColor(ancestorStyle.get())) |
| 1651 return ancestorStyle->getPropertyCSSValue(CSSPropertyBackgroundColor
); | 1651 return ancestorStyle->getPropertyCSSValue(CSSPropertyBackgroundColor
); |
| 1652 } | 1652 } |
| 1653 return nullptr; | 1653 return nullptr; |
| 1654 } | 1654 } |
| 1655 | 1655 |
| 1656 } | 1656 } |
| OLD | NEW |