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

Unified 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: Add test Created 5 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: Source/core/editing/EditingStyle.cpp
diff --git a/Source/core/editing/EditingStyle.cpp b/Source/core/editing/EditingStyle.cpp
index 6e44f9af1d6196af24e7f72b7bed299f42c75d18..92e51d4d6524f539ca3cccccdbeea512df3741f2 100644
--- a/Source/core/editing/EditingStyle.cpp
+++ b/Source/core/editing/EditingStyle.cpp
@@ -1434,7 +1434,7 @@ StyleChange::StyleChange(EditingStyle* style, const Position& position)
reconcileTextDecorationProperties(mutableStyle.get());
if (!document->frame()->editor().shouldStyleWithCSS())
- extractTextStyles(document, mutableStyle.get(), computedStyle->fixedPitchFontType());
+ extractTextStyles(document, mutableStyle.get(), computedStyle ? computedStyle->fixedPitchFontType() : NonFixedPitchFont);
// Changing the whitespace style in a tab span would collapse the tab into a space.
if (isTabHTMLSpanElementTextNode(position.deprecatedNode()) || isTabHTMLSpanElement((position.deprecatedNode())))
@@ -1578,8 +1578,9 @@ static bool fontWeightNeedsResolving(CSSValue* fontWeight)
PassRefPtrWillBeRawPtr<MutableStylePropertySet> getPropertiesNotIn(StylePropertySet* styleWithRedundantProperties, CSSStyleDeclaration* baseStyle)
{
ASSERT(styleWithRedundantProperties);
- ASSERT(baseStyle);
RefPtrWillBeRawPtr<MutableStylePropertySet> result = styleWithRedundantProperties->mutableCopy();
+ if (!baseStyle)
+ return result.release();
result->removeEquivalentProperties(baseStyle);

Powered by Google App Engine
This is Rietveld 408576698