| 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 1240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1251 if (!element) | 1251 if (!element) |
| 1252 return nullptr; | 1252 return nullptr; |
| 1253 | 1253 |
| 1254 RefPtr<EditingStyle> style = EditingStyle::create(element, EditingStyle::All
Properties); | 1254 RefPtr<EditingStyle> style = EditingStyle::create(element, EditingStyle::All
Properties); |
| 1255 style->mergeTypingStyle(&element->document()); | 1255 style->mergeTypingStyle(&element->document()); |
| 1256 | 1256 |
| 1257 // If background color is transparent, traverse parent nodes until we hit a
different value or document root | 1257 // If background color is transparent, traverse parent nodes until we hit a
different value or document root |
| 1258 // Also, if the selection is a range, ignore the background color at the sta
rt of selection, | 1258 // Also, if the selection is a range, ignore the background color at the sta
rt of selection, |
| 1259 // and find the background color of the common ancestor. | 1259 // and find the background color of the common ancestor. |
| 1260 if (shouldUseBackgroundColorInEffect && (selection.isRange() || hasTranspare
ntBackgroundColor(style->m_mutableStyle.get()))) { | 1260 if (shouldUseBackgroundColorInEffect && (selection.isRange() || hasTranspare
ntBackgroundColor(style->m_mutableStyle.get()))) { |
| 1261 RefPtr<Range> range(selection.toNormalizedRange()); | 1261 RefPtrWillBeRawPtr<Range> range(selection.toNormalizedRange()); |
| 1262 if (PassRefPtrWillBeRawPtr<CSSValue> value = backgroundColorInEffect(ran
ge->commonAncestorContainer(IGNORE_EXCEPTION))) | 1262 if (PassRefPtrWillBeRawPtr<CSSValue> value = backgroundColorInEffect(ran
ge->commonAncestorContainer(IGNORE_EXCEPTION))) |
| 1263 style->setProperty(CSSPropertyBackgroundColor, value->cssText()); | 1263 style->setProperty(CSSPropertyBackgroundColor, value->cssText()); |
| 1264 } | 1264 } |
| 1265 | 1265 |
| 1266 return style; | 1266 return style; |
| 1267 } | 1267 } |
| 1268 | 1268 |
| 1269 WritingDirection EditingStyle::textDirectionForSelection(const VisibleSelection&
selection, EditingStyle* typingStyle, bool& hasNestedOrMultipleEmbeddings) | 1269 WritingDirection EditingStyle::textDirectionForSelection(const VisibleSelection&
selection, EditingStyle* typingStyle, bool& hasNestedOrMultipleEmbeddings) |
| 1270 { | 1270 { |
| 1271 hasNestedOrMultipleEmbeddings = true; | 1271 hasNestedOrMultipleEmbeddings = true; |
| (...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1634 { | 1634 { |
| 1635 for (Node* ancestor = node; ancestor; ancestor = ancestor->parentNode()) { | 1635 for (Node* ancestor = node; ancestor; ancestor = ancestor->parentNode()) { |
| 1636 RefPtr<CSSComputedStyleDeclaration> ancestorStyle = CSSComputedStyleDecl
aration::create(ancestor); | 1636 RefPtr<CSSComputedStyleDeclaration> ancestorStyle = CSSComputedStyleDecl
aration::create(ancestor); |
| 1637 if (!hasTransparentBackgroundColor(ancestorStyle.get())) | 1637 if (!hasTransparentBackgroundColor(ancestorStyle.get())) |
| 1638 return ancestorStyle->getPropertyCSSValue(CSSPropertyBackgroundColor
); | 1638 return ancestorStyle->getPropertyCSSValue(CSSPropertyBackgroundColor
); |
| 1639 } | 1639 } |
| 1640 return nullptr; | 1640 return nullptr; |
| 1641 } | 1641 } |
| 1642 | 1642 |
| 1643 } | 1643 } |
| OLD | NEW |