OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 1999 Antti Koivisto (koivisto@kde.org) | 2 * Copyright (C) 1999 Antti Koivisto (koivisto@kde.org) |
3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights | 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights |
4 * reserved. | 4 * reserved. |
5 * Copyright (C) 2011 Adobe Systems Incorporated. All rights reserved. | 5 * Copyright (C) 2011 Adobe Systems Incorporated. All rights reserved. |
6 * | 6 * |
7 * This library is free software; you can redistribute it and/or | 7 * This library is free software; you can redistribute it and/or |
8 * modify it under the terms of the GNU Library General Public | 8 * modify it under the terms of the GNU Library General Public |
9 * License as published by the Free Software Foundation; either | 9 * License as published by the Free Software Foundation; either |
10 * version 2 of the License, or (at your option) any later version. | 10 * version 2 of the License, or (at your option) any later version. |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 ASSERT_SIZE(ComputedStyle, SameSizeAsComputedStyle); | 93 ASSERT_SIZE(ComputedStyle, SameSizeAsComputedStyle); |
94 | 94 |
95 PassRefPtr<ComputedStyle> ComputedStyle::Create() { | 95 PassRefPtr<ComputedStyle> ComputedStyle::Create() { |
96 return AdoptRef(new ComputedStyle(InitialStyle())); | 96 return AdoptRef(new ComputedStyle(InitialStyle())); |
97 } | 97 } |
98 | 98 |
99 PassRefPtr<ComputedStyle> ComputedStyle::CreateInitialStyle() { | 99 PassRefPtr<ComputedStyle> ComputedStyle::CreateInitialStyle() { |
100 return AdoptRef(new ComputedStyle()); | 100 return AdoptRef(new ComputedStyle()); |
101 } | 101 } |
102 | 102 |
| 103 ComputedStyle& ComputedStyle::MutableInitialStyle() { |
| 104 LEAK_SANITIZER_DISABLED_SCOPE; |
| 105 DEFINE_STATIC_REF(ComputedStyle, initial_style, |
| 106 (ComputedStyle::CreateInitialStyle())); |
| 107 return *initial_style; |
| 108 } |
| 109 |
103 void ComputedStyle::InvalidateInitialStyle() { | 110 void ComputedStyle::InvalidateInitialStyle() { |
104 MutableInitialStyle().SetTapHighlightColor(InitialTapHighlightColor()); | 111 MutableInitialStyle().SetTapHighlightColor(InitialTapHighlightColor()); |
105 } | 112 } |
106 | 113 |
107 PassRefPtr<ComputedStyle> ComputedStyle::CreateAnonymousStyleWithDisplay( | 114 PassRefPtr<ComputedStyle> ComputedStyle::CreateAnonymousStyleWithDisplay( |
108 const ComputedStyle& parent_style, | 115 const ComputedStyle& parent_style, |
109 EDisplay display) { | 116 EDisplay display) { |
110 RefPtr<ComputedStyle> new_style = ComputedStyle::Create(); | 117 RefPtr<ComputedStyle> new_style = ComputedStyle::Create(); |
111 new_style->InheritFrom(parent_style); | 118 new_style->InheritFrom(parent_style); |
112 new_style->SetUnicodeBidi(parent_style.GetUnicodeBidi()); | 119 new_style->SetUnicodeBidi(parent_style.GetUnicodeBidi()); |
(...skipping 2396 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2509 if (value < 0) | 2516 if (value < 0) |
2510 fvalue -= 0.5f; | 2517 fvalue -= 0.5f; |
2511 else | 2518 else |
2512 fvalue += 0.5f; | 2519 fvalue += 0.5f; |
2513 } | 2520 } |
2514 | 2521 |
2515 return RoundForImpreciseConversion<int>(fvalue / zoom_factor); | 2522 return RoundForImpreciseConversion<int>(fvalue / zoom_factor); |
2516 } | 2523 } |
2517 | 2524 |
2518 } // namespace blink | 2525 } // namespace blink |
OLD | NEW |