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

Side by Side Diff: Source/core/html/canvas/CanvasRenderingContext2D.cpp

Issue 15864004: Move create() methods from StylePropertySet to MutableStylePropertySet. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/html/HTMLTableElement.cpp ('k') | Source/core/inspector/InspectorStyleSheet.cpp » ('j') | 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) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights reserved. 2 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights reserved.
3 * Copyright (C) 2008, 2010 Nokia Corporation and/or its subsidiary(-ies) 3 * Copyright (C) 2008, 2010 Nokia Corporation and/or its subsidiary(-ies)
4 * Copyright (C) 2007 Alp Toker <alp@atoker.com> 4 * Copyright (C) 2007 Alp Toker <alp@atoker.com>
5 * Copyright (C) 2008 Eric Seidel <eric@webkit.org> 5 * Copyright (C) 2008 Eric Seidel <eric@webkit.org>
6 * Copyright (C) 2008 Dirk Schulze <krit@webkit.org> 6 * Copyright (C) 2008 Dirk Schulze <krit@webkit.org>
7 * Copyright (C) 2010 Torch Mobile (Beijing) Co. Ltd. All rights reserved. 7 * Copyright (C) 2010 Torch Mobile (Beijing) Co. Ltd. All rights reserved.
8 * Copyright (C) 2012 Intel Corporation. All rights reserved. 8 * Copyright (C) 2012 Intel Corporation. All rights reserved.
9 * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved. 9 * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved.
10 * 10 *
(...skipping 1957 matching lines...) Expand 10 before | Expand all | Expand 10 after
1968 } 1968 }
1969 1969
1970 return serializedFont.toString(); 1970 return serializedFont.toString();
1971 } 1971 }
1972 1972
1973 void CanvasRenderingContext2D::setFont(const String& newFont) 1973 void CanvasRenderingContext2D::setFont(const String& newFont)
1974 { 1974 {
1975 if (newFont == state().m_unparsedFont && state().m_realizedFont) 1975 if (newFont == state().m_unparsedFont && state().m_realizedFont)
1976 return; 1976 return;
1977 1977
1978 RefPtr<StylePropertySet> parsedStyle = StylePropertySet::create(); 1978 RefPtr<MutableStylePropertySet> parsedStyle = MutableStylePropertySet::creat e();
1979 CSSParser::parseValue(parsedStyle.get(), CSSPropertyFont, newFont, true, str ictToCSSParserMode(!m_usesCSSCompatibilityParseMode), 0); 1979 CSSParser::parseValue(parsedStyle.get(), CSSPropertyFont, newFont, true, str ictToCSSParserMode(!m_usesCSSCompatibilityParseMode), 0);
1980 if (parsedStyle->isEmpty()) 1980 if (parsedStyle->isEmpty())
1981 return; 1981 return;
1982 1982
1983 String fontValue = parsedStyle->getPropertyValue(CSSPropertyFont); 1983 String fontValue = parsedStyle->getPropertyValue(CSSPropertyFont);
1984 1984
1985 // According to http://lists.w3.org/Archives/Public/public-html/2009Jul/0947 .html, 1985 // According to http://lists.w3.org/Archives/Public/public-html/2009Jul/0947 .html,
1986 // the "inherit" and "initial" values must be ignored. 1986 // the "inherit" and "initial" values must be ignored.
1987 if (fontValue == "inherit" || fontValue == "initial") 1987 if (fontValue == "inherit" || fontValue == "initial")
1988 return; 1988 return;
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after
2250 } 2250 }
2251 2251
2252 PassRefPtr<Canvas2DContextAttributes> CanvasRenderingContext2D::getContextAttrib utes() const 2252 PassRefPtr<Canvas2DContextAttributes> CanvasRenderingContext2D::getContextAttrib utes() const
2253 { 2253 {
2254 RefPtr<Canvas2DContextAttributes> attributes = Canvas2DContextAttributes::cr eate(); 2254 RefPtr<Canvas2DContextAttributes> attributes = Canvas2DContextAttributes::cr eate();
2255 attributes->setAlpha(m_hasAlpha); 2255 attributes->setAlpha(m_hasAlpha);
2256 return attributes.release(); 2256 return attributes.release();
2257 } 2257 }
2258 2258
2259 } // namespace WebCore 2259 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/html/HTMLTableElement.cpp ('k') | Source/core/inspector/InspectorStyleSheet.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698