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 * | 8 * |
9 * Redistribution and use in source and binary forms, with or without | 9 * Redistribution and use in source and binary forms, with or without |
10 * modification, are permitted provided that the following conditions | 10 * modification, are permitted provided that the following conditions |
(...skipping 1996 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2007 newStyle->setFontDescription(computedStyle->fontDescription()); | 2007 newStyle->setFontDescription(computedStyle->fontDescription()); |
2008 newStyle->font().update(newStyle->font().fontSelector()); | 2008 newStyle->font().update(newStyle->font().fontSelector()); |
2009 | 2009 |
2010 // Now map the font property longhands into the style. | 2010 // Now map the font property longhands into the style. |
2011 StyleResolver* styleResolver = canvas()->styleResolver(); | 2011 StyleResolver* styleResolver = canvas()->styleResolver(); |
2012 styleResolver->applyPropertyToStyle(CSSPropertyFontFamily, parsedStyle->getP
ropertyCSSValue(CSSPropertyFontFamily).get(), newStyle.get()); | 2012 styleResolver->applyPropertyToStyle(CSSPropertyFontFamily, parsedStyle->getP
ropertyCSSValue(CSSPropertyFontFamily).get(), newStyle.get()); |
2013 styleResolver->applyPropertyToCurrentStyle(CSSPropertyFontStyle, parsedStyle
->getPropertyCSSValue(CSSPropertyFontStyle).get()); | 2013 styleResolver->applyPropertyToCurrentStyle(CSSPropertyFontStyle, parsedStyle
->getPropertyCSSValue(CSSPropertyFontStyle).get()); |
2014 styleResolver->applyPropertyToCurrentStyle(CSSPropertyFontVariant, parsedSty
le->getPropertyCSSValue(CSSPropertyFontVariant).get()); | 2014 styleResolver->applyPropertyToCurrentStyle(CSSPropertyFontVariant, parsedSty
le->getPropertyCSSValue(CSSPropertyFontVariant).get()); |
2015 styleResolver->applyPropertyToCurrentStyle(CSSPropertyFontWeight, parsedStyl
e->getPropertyCSSValue(CSSPropertyFontWeight).get()); | 2015 styleResolver->applyPropertyToCurrentStyle(CSSPropertyFontWeight, parsedStyl
e->getPropertyCSSValue(CSSPropertyFontWeight).get()); |
2016 | 2016 |
2017 // As described in BUG66291, setting font-size on a font may entail a CSSPri
mitiveValue::computeLengthDouble call, | 2017 // As described in BUG66291, setting font-size and line-height on a font may
entail a CSSPrimitiveValue::computeLengthDouble call, |
2018 // which assumes the fontMetrics are available for the affected font, otherw
ise a crash occurs (see http://trac.webkit.org/changeset/96122). | 2018 // which assumes the fontMetrics are available for the affected font, otherw
ise a crash occurs (see http://trac.webkit.org/changeset/96122). |
2019 // The updateFont() call below updates the fontMetrics and ensures the prope
r setting of font-size. | 2019 // The updateFont() calls below update the fontMetrics and ensure the proper
setting of font-size and line-height. |
2020 styleResolver->updateFont(); | 2020 styleResolver->updateFont(); |
2021 styleResolver->applyPropertyToCurrentStyle(CSSPropertyFontSize, parsedStyle-
>getPropertyCSSValue(CSSPropertyFontSize).get()); | 2021 styleResolver->applyPropertyToCurrentStyle(CSSPropertyFontSize, parsedStyle-
>getPropertyCSSValue(CSSPropertyFontSize).get()); |
| 2022 styleResolver->updateFont(); |
2022 styleResolver->applyPropertyToCurrentStyle(CSSPropertyLineHeight, parsedStyl
e->getPropertyCSSValue(CSSPropertyLineHeight).get()); | 2023 styleResolver->applyPropertyToCurrentStyle(CSSPropertyLineHeight, parsedStyl
e->getPropertyCSSValue(CSSPropertyLineHeight).get()); |
2023 | 2024 |
2024 modifiableState().m_font = newStyle->font(); | 2025 modifiableState().m_font = newStyle->font(); |
2025 modifiableState().m_font.update(styleResolver->fontSelector()); | 2026 modifiableState().m_font.update(styleResolver->fontSelector()); |
2026 modifiableState().m_realizedFont = true; | 2027 modifiableState().m_realizedFont = true; |
2027 styleResolver->fontSelector()->registerForInvalidationCallbacks(&modifiableS
tate()); | 2028 styleResolver->fontSelector()->registerForInvalidationCallbacks(&modifiableS
tate()); |
2028 } | 2029 } |
2029 | 2030 |
2030 String CanvasRenderingContext2D::textAlign() const | 2031 String CanvasRenderingContext2D::textAlign() const |
2031 { | 2032 { |
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2277 { | 2278 { |
2278 if (enabled == state().m_imageSmoothingEnabled) | 2279 if (enabled == state().m_imageSmoothingEnabled) |
2279 return; | 2280 return; |
2280 | 2281 |
2281 realizeSaves(); | 2282 realizeSaves(); |
2282 modifiableState().m_imageSmoothingEnabled = enabled; | 2283 modifiableState().m_imageSmoothingEnabled = enabled; |
2283 drawingContext()->setImageInterpolationQuality(enabled ? DefaultInterpolatio
nQuality : InterpolationNone); | 2284 drawingContext()->setImageInterpolationQuality(enabled ? DefaultInterpolatio
nQuality : InterpolationNone); |
2284 } | 2285 } |
2285 | 2286 |
2286 } // namespace WebCore | 2287 } // namespace WebCore |
OLD | NEW |