Skip to content
This repository was archived by the owner on Jul 10, 2023. It is now read-only.

Commit bb31565

Browse files
committed
Merge pull request #37 from pcwalton/inline
Inline all the things
2 parents 6d44ce5 + a4fc2fb commit bb31565

File tree

3 files changed

+99
-0
lines changed

3 files changed

+99
-0
lines changed

complete.rs

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ impl<'self> CompleteSelectResults {
8282
}
8383
}
8484

85+
#[inline(always)]
8586
pub fn computed_style(&'self self) -> CompleteStyle<'self> {
8687
CompleteStyle {
8788
inner: self.inner.computed_style()
@@ -97,117 +98,146 @@ impl<'self> CompleteStyle<'self> {
9798

9899
// CSS 2.1, Section 8 - Box model
99100

101+
#[inline(always)]
100102
pub fn margin_top(&self) -> CSSMargin {
101103
strip(self.inner.margin_top())
102104
}
103105

106+
#[inline(always)]
104107
pub fn margin_right(&self) -> CSSMargin {
105108
strip(self.inner.margin_right())
106109
}
107110

111+
#[inline(always)]
108112
pub fn margin_bottom(&self) -> CSSMargin {
109113
strip(self.inner.margin_bottom())
110114
}
111115

116+
#[inline(always)]
112117
pub fn margin_left(&self) -> CSSMargin {
113118
strip(self.inner.margin_left())
114119
}
115120

121+
#[inline(always)]
116122
pub fn padding_top(&self) -> CSSPadding {
117123
strip(self.inner.padding_top())
118124
}
119125

126+
#[inline(always)]
120127
pub fn padding_right(&self) -> CSSPadding {
121128
strip(self.inner.padding_right())
122129
}
123130

131+
#[inline(always)]
124132
pub fn padding_bottom(&self) -> CSSPadding {
125133
strip(self.inner.padding_bottom())
126134
}
127135

136+
#[inline(always)]
128137
pub fn padding_left(&self) -> CSSPadding {
129138
strip(self.inner.padding_left())
130139
}
131140

141+
#[inline(always)]
132142
pub fn border_top_style(&self) -> CSSBorderStyle {
133143
strip(self.inner.border_top_style())
134144
}
135145

146+
#[inline(always)]
136147
pub fn border_right_style(&self) -> CSSBorderStyle {
137148
strip(self.inner.border_right_style())
138149
}
150+
151+
#[inline(always)]
139152
pub fn border_bottom_style(&self) -> CSSBorderStyle {
140153
strip(self.inner.border_bottom_style())
141154
}
142155

156+
#[inline(always)]
143157
pub fn border_left_style(&self) -> CSSBorderStyle {
144158
strip(self.inner.border_left_style())
145159
}
146160

161+
#[inline(always)]
147162
pub fn border_top_width(&self) -> CSSBorderWidth {
148163
strip(self.inner.border_top_width())
149164
}
150165

166+
#[inline(always)]
151167
pub fn border_right_width(&self) -> CSSBorderWidth {
152168
strip(self.inner.border_right_width())
153169
}
154170

171+
#[inline(always)]
155172
pub fn border_bottom_width(&self) -> CSSBorderWidth {
156173
strip(self.inner.border_bottom_width())
157174
}
158175

176+
#[inline(always)]
159177
pub fn border_left_width(&self) -> CSSBorderWidth {
160178
strip(self.inner.border_left_width())
161179
}
162180

181+
#[inline(always)]
163182
pub fn border_top_color(&self) -> Color {
164183
strip(self.inner.border_top_color())
165184
}
166185

186+
#[inline(always)]
167187
pub fn border_right_color(&self) -> Color {
168188
strip(self.inner.border_right_color())
169189
}
170190

191+
#[inline(always)]
171192
pub fn border_bottom_color(&self) -> Color {
172193
strip(self.inner.border_bottom_color())
173194
}
174195

196+
#[inline(always)]
175197
pub fn border_left_color(&self) -> Color {
176198
strip(self.inner.border_left_color())
177199
}
178200

179201
// CSS 2.1, Section 9 - Visual formatting model
180202

203+
#[inline(always)]
181204
pub fn display(&self, root: bool) -> CSSDisplay {
182205
strip(self.inner.display(root))
183206
}
184207

208+
#[inline(always)]
185209
pub fn position(&self) -> CSSPosition {
186210
strip(self.inner.position())
187211
}
188212

213+
#[inline(always)]
189214
pub fn float(&self) -> CSSFloat {
190215
strip(self.inner.float())
191216
}
192217

218+
#[inline(always)]
193219
pub fn clear(&self) -> CSSClear {
194220
strip(self.inner.clear())
195221
}
196222

197223
// CSS 2.1, Section 10 - Visual formatting model details
198224

225+
#[inline(always)]
199226
pub fn width(&self) -> CSSWidth {
200227
strip(self.inner.width())
201228
}
202229

230+
#[inline(always)]
203231
pub fn height(&self) -> CSSHeight {
204232
strip(self.inner.height())
205233
}
206234

235+
#[inline(always)]
207236
pub fn line_height(&self) -> CSSLineHeight {
208237
strip(self.inner.line_height())
209238
}
210239

240+
#[inline(always)]
211241
pub fn vertical_align(&self) -> CSSVerticalAlign {
212242
strip(self.inner.vertical_align())
213243
}
@@ -220,38 +250,46 @@ impl<'self> CompleteStyle<'self> {
220250

221251
// CSS 2.1, Section 14 - Colors and Backgrounds
222252

253+
#[inline(always)]
223254
pub fn background_color(&self) -> Color {
224255
strip(self.inner.background_color())
225256
}
226257

258+
#[inline(always)]
227259
pub fn color(&self) -> Color {
228260
strip(self.inner.color())
229261
}
230262

231263
// CSS 2.1, Section 15 - Fonts
232264

265+
#[inline(always)]
233266
pub fn font_family(&self) -> ~[CSSFontFamily] {
234267
strip(self.inner.font_family())
235268
}
236269

270+
#[inline(always)]
237271
pub fn font_style(&self) -> CSSFontStyle {
238272
strip(self.inner.font_style())
239273
}
240274

275+
#[inline(always)]
241276
pub fn font_weight(&self) -> CSSFontWeight {
242277
strip(self.inner.font_weight())
243278
}
244279

280+
#[inline(always)]
245281
pub fn font_size(&self) -> CSSFontSize {
246282
strip(self.inner.font_size())
247283
}
248284

285+
#[inline(always)]
249286
pub fn text_decoration(&self) -> CSSTextDecoration{
250287
strip(self.inner.text_decoration())
251288
}
252289

253290
// CSS 2.1, Section 16 - Text
254291

292+
#[inline(always)]
255293
pub fn text_align(&self) -> CSSTextAlign {
256294
strip(self.inner.text_align())
257295
}
@@ -262,6 +300,7 @@ impl<'self> CompleteStyle<'self> {
262300

263301
}
264302

303+
#[inline]
265304
fn strip<T>(value: CSSValue<T>) -> T {
266305
match value {
267306
Inherit => fail!(~"unexpected 'inherit' value in complete style"),

0 commit comments

Comments
 (0)