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

Unified Diff: Source/core/html/canvas/CanvasRenderingContext2D.cpp

Issue 1210273002: Use CSS value instead of serialized string in CanvasRenderingContext2D::setFont (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 6 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/canvas/CanvasRenderingContext2D.cpp
diff --git a/Source/core/html/canvas/CanvasRenderingContext2D.cpp b/Source/core/html/canvas/CanvasRenderingContext2D.cpp
index ad626b2ac61dbe69366729cc585de45edfb25b38..892723a84d7e03de947b86e7310c57d4535a3b16 100644
--- a/Source/core/html/canvas/CanvasRenderingContext2D.cpp
+++ b/Source/core/html/canvas/CanvasRenderingContext2D.cpp
@@ -79,7 +79,6 @@ static const int defaultFontSize = 10;
static const char defaultFontFamily[] = "sans-serif";
static const char defaultFont[] = "10px sans-serif";
static const char inherit[] = "inherit";
-static const char initial[] = "initial";
static const char rtl[] = "rtl";
static const char ltr[] = "ltr";
static const double TryRestoreContextInterval = 0.5;
@@ -1682,10 +1681,10 @@ void CanvasRenderingContext2D::setFont(const String& newFont)
}
if (parsedStyle->isEmpty())
return;
- String fontValue = parsedStyle->getPropertyValue(CSSPropertyFont);
// According to http://lists.w3.org/Archives/Public/public-html/2009Jul/0947.html,
// the "inherit" and "initial" values must be ignored.
- if (fontValue == inherit || fontValue == initial)
+ RefPtrWillBeRawPtr<CSSValue> fontValue = parsedStyle->getPropertyCSSValue(CSSPropertyFontSize);
+ if (fontValue && (fontValue->isInitialValue() || fontValue->isInheritedValue()))
return;
m_fetchedFonts.add(newFont, parsedStyle);
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698