Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(705)

Side by Side Diff: third_party/WebKit/Source/core/style/ComputedStyle.cpp

Issue 2755043002: Remove ComputedStyle::initializeBitDefaults(). (Closed)
Patch Set: Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « third_party/WebKit/Source/core/style/ComputedStyle.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 // check that you really *do* what to increase the size of ComputedStyle, then 92 // check that you really *do* what to increase the size of ComputedStyle, then
93 // update the SameSizeAsComputedStyle struct to match the updated storage of 93 // update the SameSizeAsComputedStyle struct to match the updated storage of
94 // ComputedStyle. 94 // ComputedStyle.
95 ASSERT_SIZE(ComputedStyle, SameSizeAsComputedStyle); 95 ASSERT_SIZE(ComputedStyle, SameSizeAsComputedStyle);
96 96
97 PassRefPtr<ComputedStyle> ComputedStyle::create() { 97 PassRefPtr<ComputedStyle> ComputedStyle::create() {
98 return adoptRef(new ComputedStyle(initialStyle())); 98 return adoptRef(new ComputedStyle(initialStyle()));
99 } 99 }
100 100
101 PassRefPtr<ComputedStyle> ComputedStyle::createInitialStyle() { 101 PassRefPtr<ComputedStyle> ComputedStyle::createInitialStyle() {
102 return adoptRef(new ComputedStyle(InitialStyle)); 102 return adoptRef(new ComputedStyle());
103 } 103 }
104 104
105 void ComputedStyle::invalidateInitialStyle() { 105 void ComputedStyle::invalidateInitialStyle() {
106 mutableInitialStyle().setTapHighlightColor(initialTapHighlightColor()); 106 mutableInitialStyle().setTapHighlightColor(initialTapHighlightColor());
107 } 107 }
108 108
109 PassRefPtr<ComputedStyle> ComputedStyle::createAnonymousStyleWithDisplay( 109 PassRefPtr<ComputedStyle> ComputedStyle::createAnonymousStyleWithDisplay(
110 const ComputedStyle& parentStyle, 110 const ComputedStyle& parentStyle,
111 EDisplay display) { 111 EDisplay display) {
112 RefPtr<ComputedStyle> newStyle = ComputedStyle::create(); 112 RefPtr<ComputedStyle> newStyle = ComputedStyle::create();
113 newStyle->inheritFrom(parentStyle); 113 newStyle->inheritFrom(parentStyle);
114 newStyle->setUnicodeBidi(parentStyle.getUnicodeBidi()); 114 newStyle->setUnicodeBidi(parentStyle.getUnicodeBidi());
115 newStyle->setDisplay(display); 115 newStyle->setDisplay(display);
116 return newStyle; 116 return newStyle;
117 } 117 }
118 118
119 PassRefPtr<ComputedStyle> ComputedStyle::clone(const ComputedStyle& other) { 119 PassRefPtr<ComputedStyle> ComputedStyle::clone(const ComputedStyle& other) {
120 return adoptRef(new ComputedStyle(other)); 120 return adoptRef(new ComputedStyle(other));
121 } 121 }
122 122
123 ALWAYS_INLINE ComputedStyle::ComputedStyle(InitialStyleTag) 123 ALWAYS_INLINE ComputedStyle::ComputedStyle()
124 : ComputedStyleBase(), RefCounted<ComputedStyle>() { 124 : ComputedStyleBase(), RefCounted<ComputedStyle>() {
125 initializeBitDefaults();
126
127 m_box.init(); 125 m_box.init();
128 m_visual.init(); 126 m_visual.init();
129 m_background.init(); 127 m_background.init();
130 m_surround.init(); 128 m_surround.init();
131 m_rareNonInheritedData.init(); 129 m_rareNonInheritedData.init();
132 m_rareNonInheritedData.access()->m_deprecatedFlexibleBox.init(); 130 m_rareNonInheritedData.access()->m_deprecatedFlexibleBox.init();
133 m_rareNonInheritedData.access()->m_flexibleBox.init(); 131 m_rareNonInheritedData.access()->m_flexibleBox.init();
134 m_rareNonInheritedData.access()->m_multiCol.init(); 132 m_rareNonInheritedData.access()->m_multiCol.init();
135 m_rareNonInheritedData.access()->m_transform.init(); 133 m_rareNonInheritedData.access()->m_transform.init();
136 m_rareNonInheritedData.access()->m_willChange.init(); 134 m_rareNonInheritedData.access()->m_willChange.init();
(...skipping 2344 matching lines...) Expand 10 before | Expand all | Expand 10 after
2481 if (value < 0) 2479 if (value < 0)
2482 fvalue -= 0.5f; 2480 fvalue -= 0.5f;
2483 else 2481 else
2484 fvalue += 0.5f; 2482 fvalue += 0.5f;
2485 } 2483 }
2486 2484
2487 return roundForImpreciseConversion<int>(fvalue / zoomFactor); 2485 return roundForImpreciseConversion<int>(fvalue / zoomFactor);
2488 } 2486 }
2489 2487
2490 } // namespace blink 2488 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/style/ComputedStyle.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698