OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "core/css/resolver/FontBuilder.h" | 5 #include "core/css/resolver/FontBuilder.h" |
6 | 6 |
7 #include "core/css/CSSFontSelector.h" | 7 #include "core/css/CSSFontSelector.h" |
8 #include "core/dom/Document.h" | 8 #include "core/dom/Document.h" |
9 #include "core/dom/StyleEngine.h" | 9 #include "core/dom/StyleEngine.h" |
10 #include "core/frame/Settings.h" | 10 #include "core/frame/Settings.h" |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 | 53 |
54 EXPECT_EQ(16.0f, initial->GetFontDescription().ComputedSize()); | 54 EXPECT_EQ(16.0f, initial->GetFontDescription().ComputedSize()); |
55 } | 55 } |
56 | 56 |
57 TEST_F(FontBuilderInitTest, NotDirty) { | 57 TEST_F(FontBuilderInitTest, NotDirty) { |
58 FontBuilder builder(GetDocument()); | 58 FontBuilder builder(GetDocument()); |
59 ASSERT_FALSE(builder.FontDirty()); | 59 ASSERT_FALSE(builder.FontDirty()); |
60 } | 60 } |
61 | 61 |
62 // This test verifies that when you are setting some field F via FontBuilder, | 62 // This test verifies that when you are setting some field F via FontBuilder, |
63 // only F is actually modified on the incoming ComputedStyle::fontDescription. | 63 // only F is actually modified on the incoming |
| 64 // ComputedStyle::GetFontDescription. |
64 TEST_P(FontBuilderAdditiveTest, OnlySetValueIsModified) { | 65 TEST_P(FontBuilderAdditiveTest, OnlySetValueIsModified) { |
65 FunctionPair funcs = GetParam(); | 66 FunctionPair funcs = GetParam(); |
66 | 67 |
67 FontDescription parent_description; | 68 FontDescription parent_description; |
68 funcs.set_base_value(parent_description); | 69 funcs.set_base_value(parent_description); |
69 | 70 |
70 RefPtr<ComputedStyle> style = ComputedStyle::Create(); | 71 RefPtr<ComputedStyle> style = ComputedStyle::Create(); |
71 style->SetFontDescription(parent_description); | 72 style->SetFontDescription(parent_description); |
72 | 73 |
73 FontBuilder font_builder(GetDocument()); | 74 FontBuilder font_builder(GetDocument()); |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
201 FunctionPair(FontVariantCapsBase, FontVariantCapsValue), | 202 FunctionPair(FontVariantCapsBase, FontVariantCapsValue), |
202 FunctionPair(FontVariantLigaturesBase, FontVariantLigaturesValue), | 203 FunctionPair(FontVariantLigaturesBase, FontVariantLigaturesValue), |
203 FunctionPair(FontVariantNumericBase, FontVariantNumericValue), | 204 FunctionPair(FontVariantNumericBase, FontVariantNumericValue), |
204 FunctionPair(FontTextRenderingBase, FontTextRenderingValue), | 205 FunctionPair(FontTextRenderingBase, FontTextRenderingValue), |
205 FunctionPair(FontKerningBase, FontKerningValue), | 206 FunctionPair(FontKerningBase, FontKerningValue), |
206 FunctionPair(FontFontSmoothingBase, FontFontSmoothingValue), | 207 FunctionPair(FontFontSmoothingBase, FontFontSmoothingValue), |
207 FunctionPair(FontSizeBase, FontSizeValue), | 208 FunctionPair(FontSizeBase, FontSizeValue), |
208 FunctionPair(FontScriptBase, FontScriptValue))); | 209 FunctionPair(FontScriptBase, FontScriptValue))); |
209 | 210 |
210 } // namespace blink | 211 } // namespace blink |
OLD | NEW |