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

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

Issue 960353002: Handle null baseStyle in getPropertiesNotIn (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Patch for landing Created 5 years, 9 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
« no previous file with comments | « LayoutTests/editing/style/justify-left-crash-expected.html ('k') | no next file » | 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 1407 matching lines...) Expand 10 before | Expand all | Expand 10 after
1418 1418
1419 StyleChange::StyleChange(EditingStyle* style, const Position& position) 1419 StyleChange::StyleChange(EditingStyle* style, const Position& position)
1420 : m_applyBold(false) 1420 : m_applyBold(false)
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() || !positio n.element())
1429 return; 1429 return;
1430 1430
1431 RefPtrWillBeRawPtr<CSSComputedStyleDeclaration> computedStyle = position.com putedStyle(); 1431 RefPtrWillBeRawPtr<CSSComputedStyleDeclaration> computedStyle = position.com putedStyle();
1432 // FIXME: take care of background-color in effect 1432 // FIXME: take care of background-color in effect
1433 RefPtrWillBeRawPtr<MutableStylePropertySet> mutableStyle = getPropertiesNotI n(style->style(), computedStyle.get()); 1433 RefPtrWillBeRawPtr<MutableStylePropertySet> mutableStyle = getPropertiesNotI n(style->style(), computedStyle.get());
1434 ASSERT(mutableStyle);
1434 1435
1435 reconcileTextDecorationProperties(mutableStyle.get()); 1436 reconcileTextDecorationProperties(mutableStyle.get());
1436 if (!document->frame()->editor().shouldStyleWithCSS()) 1437 if (!document->frame()->editor().shouldStyleWithCSS())
1437 extractTextStyles(document, mutableStyle.get(), computedStyle->fixedPitc hFontType()); 1438 extractTextStyles(document, mutableStyle.get(), computedStyle->fixedPitc hFontType());
1438 1439
1439 // Changing the whitespace style in a tab span would collapse the tab into a space. 1440 // Changing the whitespace style in a tab span would collapse the tab into a space.
1440 if (isTabHTMLSpanElementTextNode(position.deprecatedNode()) || isTabHTMLSpan Element((position.deprecatedNode()))) 1441 if (isTabHTMLSpanElementTextNode(position.deprecatedNode()) || isTabHTMLSpan Element((position.deprecatedNode())))
1441 mutableStyle->removeProperty(CSSPropertyWhiteSpace); 1442 mutableStyle->removeProperty(CSSPropertyWhiteSpace);
1442 1443
1443 // If unicode-bidi is present in mutableStyle and direction is not, then add direction to mutableStyle. 1444 // 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
1678 { 1679 {
1679 for (Node* ancestor = node; ancestor; ancestor = ancestor->parentNode()) { 1680 for (Node* ancestor = node; ancestor; ancestor = ancestor->parentNode()) {
1680 RefPtrWillBeRawPtr<CSSComputedStyleDeclaration> ancestorStyle = CSSCompu tedStyleDeclaration::create(ancestor); 1681 RefPtrWillBeRawPtr<CSSComputedStyleDeclaration> ancestorStyle = CSSCompu tedStyleDeclaration::create(ancestor);
1681 if (!hasTransparentBackgroundColor(ancestorStyle.get())) 1682 if (!hasTransparentBackgroundColor(ancestorStyle.get()))
1682 return ancestorStyle->getPropertyCSSValue(CSSPropertyBackgroundColor ); 1683 return ancestorStyle->getPropertyCSSValue(CSSPropertyBackgroundColor );
1683 } 1684 }
1684 return nullptr; 1685 return nullptr;
1685 } 1686 }
1686 1687
1687 } 1688 }
OLDNEW
« no previous file with comments | « LayoutTests/editing/style/justify-left-crash-expected.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698