| OLD | NEW |
| 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, 2013 Intel Corporation. All rights reserved. | 8 * Copyright (C) 2012, 2013 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 20 matching lines...) Expand all Loading... |
| 31 */ | 31 */ |
| 32 | 32 |
| 33 #include "config.h" | 33 #include "config.h" |
| 34 #include "core/html/canvas/CanvasRenderingContext2D.h" | 34 #include "core/html/canvas/CanvasRenderingContext2D.h" |
| 35 | 35 |
| 36 #include "CSSPropertyNames.h" | 36 #include "CSSPropertyNames.h" |
| 37 #include "bindings/v8/ExceptionState.h" | 37 #include "bindings/v8/ExceptionState.h" |
| 38 #include "bindings/v8/ExceptionStatePlaceholder.h" | 38 #include "bindings/v8/ExceptionStatePlaceholder.h" |
| 39 #include "core/accessibility/AXObjectCache.h" | 39 #include "core/accessibility/AXObjectCache.h" |
| 40 #include "core/css/CSSFontSelector.h" | 40 #include "core/css/CSSFontSelector.h" |
| 41 #include "core/css/parser/BisonCSSParser.h" | 41 #include "core/css/parser/CSSParser.h" |
| 42 #include "core/css/StylePropertySet.h" | 42 #include "core/css/StylePropertySet.h" |
| 43 #include "core/css/resolver/StyleResolver.h" | 43 #include "core/css/resolver/StyleResolver.h" |
| 44 #include "core/dom/ExceptionCode.h" | 44 #include "core/dom/ExceptionCode.h" |
| 45 #include "core/fetch/ImageResource.h" | 45 #include "core/fetch/ImageResource.h" |
| 46 #include "core/html/HTMLCanvasElement.h" | 46 #include "core/html/HTMLCanvasElement.h" |
| 47 #include "core/html/HTMLImageElement.h" | 47 #include "core/html/HTMLImageElement.h" |
| 48 #include "core/html/HTMLMediaElement.h" | 48 #include "core/html/HTMLMediaElement.h" |
| 49 #include "core/html/HTMLVideoElement.h" | 49 #include "core/html/HTMLVideoElement.h" |
| 50 #include "core/html/ImageData.h" | 50 #include "core/html/ImageData.h" |
| 51 #include "core/html/TextMetrics.h" | 51 #include "core/html/TextMetrics.h" |
| (...skipping 1959 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2011 } | 2011 } |
| 2012 | 2012 |
| 2013 void CanvasRenderingContext2D::setFont(const String& newFont) | 2013 void CanvasRenderingContext2D::setFont(const String& newFont) |
| 2014 { | 2014 { |
| 2015 MutableStylePropertyMap::iterator i = m_fetchedFonts.find(newFont); | 2015 MutableStylePropertyMap::iterator i = m_fetchedFonts.find(newFont); |
| 2016 RefPtr<MutableStylePropertySet> parsedStyle = i != m_fetchedFonts.end() ? i-
>value : 0; | 2016 RefPtr<MutableStylePropertySet> parsedStyle = i != m_fetchedFonts.end() ? i-
>value : 0; |
| 2017 | 2017 |
| 2018 if (!parsedStyle) { | 2018 if (!parsedStyle) { |
| 2019 parsedStyle = MutableStylePropertySet::create(); | 2019 parsedStyle = MutableStylePropertySet::create(); |
| 2020 CSSParserMode mode = m_usesCSSCompatibilityParseMode ? HTMLQuirksMode :
HTMLStandardMode; | 2020 CSSParserMode mode = m_usesCSSCompatibilityParseMode ? HTMLQuirksMode :
HTMLStandardMode; |
| 2021 BisonCSSParser::parseValue(parsedStyle.get(), CSSPropertyFont, newFont,
true, mode, 0); | 2021 CSSParser::parseValue(parsedStyle.get(), CSSPropertyFont, newFont, true,
mode, 0); |
| 2022 m_fetchedFonts.add(newFont, parsedStyle); | 2022 m_fetchedFonts.add(newFont, parsedStyle); |
| 2023 } | 2023 } |
| 2024 if (parsedStyle->isEmpty()) | 2024 if (parsedStyle->isEmpty()) |
| 2025 return; | 2025 return; |
| 2026 | 2026 |
| 2027 String fontValue = parsedStyle->getPropertyValue(CSSPropertyFont); | 2027 String fontValue = parsedStyle->getPropertyValue(CSSPropertyFont); |
| 2028 | 2028 |
| 2029 // According to http://lists.w3.org/Archives/Public/public-html/2009Jul/0947
.html, | 2029 // According to http://lists.w3.org/Archives/Public/public-html/2009Jul/0947
.html, |
| 2030 // the "inherit" and "initial" values must be ignored. | 2030 // the "inherit" and "initial" values must be ignored. |
| 2031 if (fontValue == "inherit" || fontValue == "initial") | 2031 if (fontValue == "inherit" || fontValue == "initial") |
| (...skipping 368 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2400 const int focusRingWidth = 5; | 2400 const int focusRingWidth = 5; |
| 2401 const int focusRingOutline = 0; | 2401 const int focusRingOutline = 0; |
| 2402 c->drawFocusRing(path, focusRingWidth, focusRingOutline, focusRingColor); | 2402 c->drawFocusRing(path, focusRingWidth, focusRingOutline, focusRingColor); |
| 2403 | 2403 |
| 2404 c->restore(); | 2404 c->restore(); |
| 2405 | 2405 |
| 2406 didDraw(dirtyRect); | 2406 didDraw(dirtyRect); |
| 2407 } | 2407 } |
| 2408 | 2408 |
| 2409 } // namespace WebCore | 2409 } // namespace WebCore |
| OLD | NEW |