Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6)

Side by Side Diff: Source/core/editing/EditingStyle.cpp

Issue 252783002: Make Range.detach() a no-op (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/core/dom/Range.idl ('k') | Source/core/editing/Editor.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 1258 matching lines...) Expand 10 before | Expand all | Expand 10 after
1269 return nullptr; 1269 return nullptr;
1270 1270
1271 RefPtr<EditingStyle> style = EditingStyle::create(element, EditingStyle::All Properties); 1271 RefPtr<EditingStyle> style = EditingStyle::create(element, EditingStyle::All Properties);
1272 style->mergeTypingStyle(&element->document()); 1272 style->mergeTypingStyle(&element->document());
1273 1273
1274 // If background color is transparent, traverse parent nodes until we hit a different value or document root 1274 // If background color is transparent, traverse parent nodes until we hit a different value or document root
1275 // Also, if the selection is a range, ignore the background color at the sta rt of selection, 1275 // Also, if the selection is a range, ignore the background color at the sta rt of selection,
1276 // and find the background color of the common ancestor. 1276 // and find the background color of the common ancestor.
1277 if (shouldUseBackgroundColorInEffect && (selection.isRange() || hasTranspare ntBackgroundColor(style->m_mutableStyle.get()))) { 1277 if (shouldUseBackgroundColorInEffect && (selection.isRange() || hasTranspare ntBackgroundColor(style->m_mutableStyle.get()))) {
1278 RefPtrWillBeRawPtr<Range> range(selection.toNormalizedRange()); 1278 RefPtrWillBeRawPtr<Range> range(selection.toNormalizedRange());
1279 if (PassRefPtrWillBeRawPtr<CSSValue> value = backgroundColorInEffect(ran ge->commonAncestorContainer(IGNORE_EXCEPTION))) 1279 if (PassRefPtrWillBeRawPtr<CSSValue> value = backgroundColorInEffect(ran ge->commonAncestorContainer()))
1280 style->setProperty(CSSPropertyBackgroundColor, value->cssText()); 1280 style->setProperty(CSSPropertyBackgroundColor, value->cssText());
1281 } 1281 }
1282 1282
1283 return style; 1283 return style;
1284 } 1284 }
1285 1285
1286 WritingDirection EditingStyle::textDirectionForSelection(const VisibleSelection& selection, EditingStyle* typingStyle, bool& hasNestedOrMultipleEmbeddings) 1286 WritingDirection EditingStyle::textDirectionForSelection(const VisibleSelection& selection, EditingStyle* typingStyle, bool& hasNestedOrMultipleEmbeddings)
1287 { 1287 {
1288 hasNestedOrMultipleEmbeddings = true; 1288 hasNestedOrMultipleEmbeddings = true;
1289 1289
(...skipping 365 matching lines...) Expand 10 before | Expand all | Expand 10 after
1655 { 1655 {
1656 for (Node* ancestor = node; ancestor; ancestor = ancestor->parentNode()) { 1656 for (Node* ancestor = node; ancestor; ancestor = ancestor->parentNode()) {
1657 RefPtr<CSSComputedStyleDeclaration> ancestorStyle = CSSComputedStyleDecl aration::create(ancestor); 1657 RefPtr<CSSComputedStyleDeclaration> ancestorStyle = CSSComputedStyleDecl aration::create(ancestor);
1658 if (!hasTransparentBackgroundColor(ancestorStyle.get())) 1658 if (!hasTransparentBackgroundColor(ancestorStyle.get()))
1659 return ancestorStyle->getPropertyCSSValue(CSSPropertyBackgroundColor ); 1659 return ancestorStyle->getPropertyCSSValue(CSSPropertyBackgroundColor );
1660 } 1660 }
1661 return nullptr; 1661 return nullptr;
1662 } 1662 }
1663 1663
1664 } 1664 }
OLDNEW
« no previous file with comments | « Source/core/dom/Range.idl ('k') | Source/core/editing/Editor.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698