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

Unified Diff: Source/core/css/CSSPrimitiveValue.cpp

Issue 170283003: Attempt to fix issue 344300 by guarding against rootStyle being null. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: more information test body Created 6 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/css/CSSPrimitiveValue.cpp
diff --git a/Source/core/css/CSSPrimitiveValue.cpp b/Source/core/css/CSSPrimitiveValue.cpp
index e108efc08326887ce6c5331db99dc44ab69d9e3e..e24c30bea9453937fc4dd521d15c9987bc9cfe39 100644
--- a/Source/core/css/CSSPrimitiveValue.cpp
+++ b/Source/core/css/CSSPrimitiveValue.cpp
@@ -563,7 +563,7 @@ double CSSPrimitiveValue::computeLengthDouble(const CSSToLengthConversionData& c
return m_value.calc->computeLengthPx(conversionData);
const RenderStyle& style = conversionData.style();
- const RenderStyle& rootStyle = conversionData.rootStyle();
+ const RenderStyle* rootStyle = conversionData.rootStyle();
bool computingFontSize = conversionData.computingFontSize();
double factor;
@@ -582,7 +582,10 @@ double CSSPrimitiveValue::computeLengthDouble(const CSSToLengthConversionData& c
factor = (computingFontSize ? style.fontDescription().specifiedSize() : style.fontDescription().computedSize()) / 2.0;
break;
case CSS_REMS:
- factor = computingFontSize ? rootStyle.fontDescription().specifiedSize() : rootStyle.fontDescription().computedSize();
+ if (rootStyle)
+ factor = computingFontSize ? rootStyle->fontDescription().specifiedSize() : rootStyle->fontDescription().computedSize();
+ else
+ factor = 1.0;
break;
case CSS_CHS:
factor = style.fontMetrics().zeroWidth();
« no previous file with comments | « LayoutTests/animations/pseudo-element-animation-with-rems-expected.txt ('k') | Source/core/css/CSSToLengthConversionData.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698