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

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

Issue 691493005: Code readability patch, removed extra returned statements from code (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fixing Comment Created 6 years, 1 month 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/css/CSSFontFaceSrcValue.cpp
diff --git a/Source/core/css/CSSFontFaceSrcValue.cpp b/Source/core/css/CSSFontFaceSrcValue.cpp
index bc03ece0ad5e439a5d6f34519a5cce3c5df0aa7a..b06d2ada5c08e6e9fec2ace15efa2df9e0eee740 100644
--- a/Source/core/css/CSSFontFaceSrcValue.cpp
+++ b/Source/core/css/CSSFontFaceSrcValue.cpp
@@ -43,17 +43,10 @@ bool CSSFontFaceSrcValue::isSupportedFormat() const
{
// Normally we would just check the format, but in order to avoid conflicts with the old WinIE style of font-face,
// we will also check to see if the URL ends with .eot. If so, we'll go ahead and assume that we shouldn't load it.
- if (m_format.isEmpty()) {
- // Check for .eot.
- if (!m_resource.startsWith("data:", false) && m_resource.endsWith(".eot", false))
- return false;
- return true;
- }
-
- if (FontCustomPlatformData::supportsFormat(m_format))
- return true;
+ if (m_format.isEmpty())
+ return m_resource.startsWith("data:", false) || !m_resource.endsWith(".eot", false);
- return false;
+ return FontCustomPlatformData::supportsFormat(m_format);
}
String CSSFontFaceSrcValue::customCSSText() const
@@ -75,9 +68,7 @@ String CSSFontFaceSrcValue::customCSSText() const
bool CSSFontFaceSrcValue::hasFailedOrCanceledSubresources() const
{
- if (!m_fetched)
- return false;
- return m_fetched->loadFailedOrCanceled();
+ return m_fetched && m_fetched->loadFailedOrCanceled();
}
bool CSSFontFaceSrcValue::shouldSetCrossOriginAccessControl(const KURL& resource, SecurityOrigin* securityOrigin)
« 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