| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
| 3 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc.
All rights reserved. | 3 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc.
All rights reserved. |
| 4 * Copyright (C) 2013 Google Inc. All rights reserved. | 4 * Copyright (C) 2013 Google Inc. All rights reserved. |
| 5 * | 5 * |
| 6 * This library is free software; you can redistribute it and/or | 6 * This library is free software; you can redistribute it and/or |
| 7 * modify it under the terms of the GNU Library General Public | 7 * modify it under the terms of the GNU Library General Public |
| 8 * License as published by the Free Software Foundation; either | 8 * License as published by the Free Software Foundation; either |
| 9 * version 2 of the License, or (at your option) any later version. | 9 * version 2 of the License, or (at your option) any later version. |
| 10 * | 10 * |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 #include "core/rendering/RenderTheme.h" | 32 #include "core/rendering/RenderTheme.h" |
| 33 #include "core/rendering/RenderView.h" | 33 #include "core/rendering/RenderView.h" |
| 34 #include "platform/fonts/FontDescription.h" | 34 #include "platform/fonts/FontDescription.h" |
| 35 #include "platform/text/LocaleToScriptMapping.h" | 35 #include "platform/text/LocaleToScriptMapping.h" |
| 36 | 36 |
| 37 namespace blink { | 37 namespace blink { |
| 38 | 38 |
| 39 // FIXME: This scoping class is a short-term fix to minimize the changes in | 39 // FIXME: This scoping class is a short-term fix to minimize the changes in |
| 40 // Font-constructing logic. | 40 // Font-constructing logic. |
| 41 class FontDescriptionChangeScope { | 41 class FontDescriptionChangeScope { |
| 42 STACK_ALLOCATED(); |
| 42 public: | 43 public: |
| 43 FontDescriptionChangeScope(FontBuilder* fontBuilder) | 44 FontDescriptionChangeScope(FontBuilder* fontBuilder) |
| 44 : m_fontBuilder(fontBuilder) | 45 : m_fontBuilder(fontBuilder) |
| 45 , m_fontDescription(fontBuilder->m_style->fontDescription()) | 46 , m_fontDescription(fontBuilder->m_style->fontDescription()) |
| 46 { | 47 { |
| 47 } | 48 } |
| 48 | 49 |
| 49 void reset() { m_fontDescription = FontDescription(); } | 50 void reset() { m_fontDescription = FontDescription(); } |
| 50 void set(const FontDescription& fontDescription) { m_fontDescription = fontD
escription; } | 51 void set(const FontDescription& fontDescription) { m_fontDescription = fontD
escription; } |
| 51 FontDescription& fontDescription() { return m_fontDescription; } | 52 FontDescription& fontDescription() { return m_fontDescription; } |
| 52 | 53 |
| 53 ~FontDescriptionChangeScope() | 54 ~FontDescriptionChangeScope() |
| 54 { | 55 { |
| 55 m_fontBuilder->didChangeFontParameters(m_fontBuilder->m_style->setFontDe
scription(m_fontDescription)); | 56 m_fontBuilder->didChangeFontParameters(m_fontBuilder->m_style->setFontDe
scription(m_fontDescription)); |
| 56 } | 57 } |
| 57 | 58 |
| 58 private: | 59 private: |
| 59 FontBuilder* m_fontBuilder; | 60 RawPtrWillBeMember<FontBuilder> m_fontBuilder; |
| 60 FontDescription m_fontDescription; | 61 FontDescription m_fontDescription; |
| 61 }; | 62 }; |
| 62 | 63 |
| 63 FontBuilder::FontBuilder() | 64 FontBuilder::FontBuilder() |
| 64 : m_document(0) | 65 : m_document(nullptr) |
| 65 , m_fontSizehasViewportUnits(false) | 66 , m_fontSizehasViewportUnits(false) |
| 66 , m_style(0) | 67 , m_style(0) |
| 67 , m_fontDirty(false) | 68 , m_fontDirty(false) |
| 68 { | 69 { |
| 69 } | 70 } |
| 70 | 71 |
| 71 void FontBuilder::initForStyleResolve(const Document& document, RenderStyle* sty
le) | 72 void FontBuilder::initForStyleResolve(const Document& document, RenderStyle* sty
le) |
| 72 { | 73 { |
| 73 ASSERT(document.frame()); | 74 ASSERT(document.frame()); |
| 74 m_document = &document; | 75 m_document = &document; |
| (...skipping 594 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 669 FontOrientation fontOrientation; | 670 FontOrientation fontOrientation; |
| 670 NonCJKGlyphOrientation glyphOrientation; | 671 NonCJKGlyphOrientation glyphOrientation; |
| 671 getFontAndGlyphOrientation(documentStyle, fontOrientation, glyphOrientation)
; | 672 getFontAndGlyphOrientation(documentStyle, fontOrientation, glyphOrientation)
; |
| 672 fontDescription.setOrientation(fontOrientation); | 673 fontDescription.setOrientation(fontOrientation); |
| 673 fontDescription.setNonCJKGlyphOrientation(glyphOrientation); | 674 fontDescription.setNonCJKGlyphOrientation(glyphOrientation); |
| 674 documentStyle->setFontDescription(fontDescription); | 675 documentStyle->setFontDescription(fontDescription); |
| 675 documentStyle->font().update(fontSelector); | 676 documentStyle->font().update(fontSelector); |
| 676 } | 677 } |
| 677 | 678 |
| 678 } | 679 } |
| OLD | NEW |