OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2007 Apple Inc. | 2 * Copyright (C) 2007 Apple Inc. |
3 * Copyright (C) 2007 Alp Toker <alp@atoker.com> | 3 * Copyright (C) 2007 Alp Toker <alp@atoker.com> |
4 * Copyright (C) 2008 Collabora Ltd. | 4 * Copyright (C) 2008 Collabora Ltd. |
5 * Copyright (C) 2008, 2009 Google Inc. | 5 * Copyright (C) 2008, 2009 Google Inc. |
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. |
11 * | 11 * |
12 * This library is distributed in the hope that it will be useful, | 12 * This library is distributed in the hope that it will be useful, |
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
15 * Library General Public License for more details. | 15 * Library General Public License for more details. |
16 * | 16 * |
17 * You should have received a copy of the GNU Library General Public License | 17 * You should have received a copy of the GNU Library General Public License |
18 * along with this library; see the file COPYING.LIB. If not, write to | 18 * along with this library; see the file COPYING.LIB. If not, write to |
19 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | 19 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
20 * Boston, MA 02110-1301, USA. | 20 * Boston, MA 02110-1301, USA. |
21 * | 21 * |
22 */ | 22 */ |
23 | 23 |
24 #include "config.h" | 24 #include "config.h" |
25 #include "core/layout/LayoutThemeChromiumSkia.h" | 25 #include "core/layout/LayoutThemeChromiumSkia.h" |
26 | 26 |
| 27 #include "core/layout/LayoutObject.h" |
27 #include "core/layout/LayoutThemeChromiumFontProvider.h" | 28 #include "core/layout/LayoutThemeChromiumFontProvider.h" |
28 #include "core/rendering/PaintInfo.h" | 29 #include "core/rendering/PaintInfo.h" |
29 #include "core/rendering/RenderBox.h" | 30 #include "core/rendering/RenderBox.h" |
30 #include "core/rendering/RenderMediaControls.h" | 31 #include "core/rendering/RenderMediaControls.h" |
31 #include "core/rendering/RenderObject.h" | |
32 #include "core/rendering/RenderProgress.h" | 32 #include "core/rendering/RenderProgress.h" |
33 #include "platform/LayoutTestSupport.h" | 33 #include "platform/LayoutTestSupport.h" |
34 #include "platform/PlatformResourceLoader.h" | 34 #include "platform/PlatformResourceLoader.h" |
35 #include "platform/graphics/GraphicsContext.h" | 35 #include "platform/graphics/GraphicsContext.h" |
36 #include "platform/graphics/Image.h" | 36 #include "platform/graphics/Image.h" |
37 #include "platform/scroll/ScrollbarTheme.h" | 37 #include "platform/scroll/ScrollbarTheme.h" |
38 #include "wtf/CurrentTime.h" | 38 #include "wtf/CurrentTime.h" |
39 #include "wtf/StdLibExtras.h" | 39 #include "wtf/StdLibExtras.h" |
40 | 40 |
41 namespace blink { | 41 namespace blink { |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
175 } | 175 } |
176 | 176 |
177 void LayoutThemeChromiumSkia::adjustButtonStyle(RenderStyle& style, Element*) co
nst | 177 void LayoutThemeChromiumSkia::adjustButtonStyle(RenderStyle& style, Element*) co
nst |
178 { | 178 { |
179 if (style.appearance() == PushButtonPart) { | 179 if (style.appearance() == PushButtonPart) { |
180 // Ignore line-height. | 180 // Ignore line-height. |
181 style.setLineHeight(RenderStyle::initialLineHeight()); | 181 style.setLineHeight(RenderStyle::initialLineHeight()); |
182 } | 182 } |
183 } | 183 } |
184 | 184 |
185 bool LayoutThemeChromiumSkia::paintTextArea(RenderObject* o, const PaintInfo& i,
const IntRect& r) | 185 bool LayoutThemeChromiumSkia::paintTextArea(LayoutObject* o, const PaintInfo& i,
const IntRect& r) |
186 { | 186 { |
187 return paintTextField(o, i, r); | 187 return paintTextField(o, i, r); |
188 } | 188 } |
189 | 189 |
190 void LayoutThemeChromiumSkia::adjustSearchFieldStyle(RenderStyle& style, Element
*) const | 190 void LayoutThemeChromiumSkia::adjustSearchFieldStyle(RenderStyle& style, Element
*) const |
191 { | 191 { |
192 // Ignore line-height. | 192 // Ignore line-height. |
193 style.setLineHeight(RenderStyle::initialLineHeight()); | 193 style.setLineHeight(RenderStyle::initialLineHeight()); |
194 } | 194 } |
195 | 195 |
196 bool LayoutThemeChromiumSkia::paintSearchField(RenderObject* o, const PaintInfo&
i, const IntRect& r) | 196 bool LayoutThemeChromiumSkia::paintSearchField(LayoutObject* o, const PaintInfo&
i, const IntRect& r) |
197 { | 197 { |
198 return paintTextField(o, i, r); | 198 return paintTextField(o, i, r); |
199 } | 199 } |
200 | 200 |
201 void LayoutThemeChromiumSkia::adjustSearchFieldCancelButtonStyle(RenderStyle& st
yle, Element*) const | 201 void LayoutThemeChromiumSkia::adjustSearchFieldCancelButtonStyle(RenderStyle& st
yle, Element*) const |
202 { | 202 { |
203 // Scale the button size based on the font size | 203 // Scale the button size based on the font size |
204 float fontScale = style.fontSize() / defaultControlFontPixelSize; | 204 float fontScale = style.fontSize() / defaultControlFontPixelSize; |
205 int cancelButtonSize = lroundf(std::min(std::max(minCancelButtonSize, defaul
tCancelButtonSize * fontScale), maxCancelButtonSize)); | 205 int cancelButtonSize = lroundf(std::min(std::max(minCancelButtonSize, defaul
tCancelButtonSize * fontScale), maxCancelButtonSize)); |
206 style.setWidth(Length(cancelButtonSize, Fixed)); | 206 style.setWidth(Length(cancelButtonSize, Fixed)); |
207 style.setHeight(Length(cancelButtonSize, Fixed)); | 207 style.setHeight(Length(cancelButtonSize, Fixed)); |
208 } | 208 } |
209 | 209 |
210 IntRect LayoutThemeChromiumSkia::convertToPaintingRect(RenderObject* inputRender
er, const RenderObject* partRenderer, LayoutRect partRect, const IntRect& localO
ffset) const | 210 IntRect LayoutThemeChromiumSkia::convertToPaintingRect(LayoutObject* inputRender
er, const LayoutObject* partRenderer, LayoutRect partRect, const IntRect& localO
ffset) const |
211 { | 211 { |
212 // Compute an offset between the part renderer and the input renderer. | 212 // Compute an offset between the part renderer and the input renderer. |
213 LayoutSize offsetFromInputRenderer = -partRenderer->offsetFromAncestorContai
ner(inputRenderer); | 213 LayoutSize offsetFromInputRenderer = -partRenderer->offsetFromAncestorContai
ner(inputRenderer); |
214 // Move the rect into partRenderer's coords. | 214 // Move the rect into partRenderer's coords. |
215 partRect.move(offsetFromInputRenderer); | 215 partRect.move(offsetFromInputRenderer); |
216 // Account for the local drawing offset. | 216 // Account for the local drawing offset. |
217 partRect.move(localOffset.x(), localOffset.y()); | 217 partRect.move(localOffset.x(), localOffset.y()); |
218 | 218 |
219 return pixelSnappedIntRect(partRect); | 219 return pixelSnappedIntRect(partRect); |
220 } | 220 } |
221 | 221 |
222 bool LayoutThemeChromiumSkia::paintSearchFieldCancelButton(RenderObject* cancelB
uttonObject, const PaintInfo& paintInfo, const IntRect& r) | 222 bool LayoutThemeChromiumSkia::paintSearchFieldCancelButton(LayoutObject* cancelB
uttonObject, const PaintInfo& paintInfo, const IntRect& r) |
223 { | 223 { |
224 // Get the renderer of <input> element. | 224 // Get the renderer of <input> element. |
225 if (!cancelButtonObject->node()) | 225 if (!cancelButtonObject->node()) |
226 return false; | 226 return false; |
227 Node* input = cancelButtonObject->node()->shadowHost(); | 227 Node* input = cancelButtonObject->node()->shadowHost(); |
228 RenderObject* baseRenderer = input ? input->renderer() : cancelButtonObject; | 228 LayoutObject* baseRenderer = input ? input->renderer() : cancelButtonObject; |
229 if (!baseRenderer->isBox()) | 229 if (!baseRenderer->isBox()) |
230 return false; | 230 return false; |
231 RenderBox* inputRenderBox = toRenderBox(baseRenderer); | 231 RenderBox* inputRenderBox = toRenderBox(baseRenderer); |
232 LayoutRect inputContentBox = inputRenderBox->contentBoxRect(); | 232 LayoutRect inputContentBox = inputRenderBox->contentBoxRect(); |
233 | 233 |
234 // Make sure the scaled button stays square and will fit in its parent's box
. | 234 // Make sure the scaled button stays square and will fit in its parent's box
. |
235 LayoutUnit cancelButtonSize = std::min(inputContentBox.width(), std::min<Lay
outUnit>(inputContentBox.height(), r.height())); | 235 LayoutUnit cancelButtonSize = std::min(inputContentBox.width(), std::min<Lay
outUnit>(inputContentBox.height(), r.height())); |
236 // Calculate cancel button's coordinates relative to the input element. | 236 // Calculate cancel button's coordinates relative to the input element. |
237 // Center the button vertically. Round up though, so if it has to be one pi
xel off-center, it will | 237 // Center the button vertically. Round up though, so if it has to be one pi
xel off-center, it will |
238 // be one pixel closer to the bottom of the field. This tends to look bette
r with the text. | 238 // be one pixel closer to the bottom of the field. This tends to look bette
r with the text. |
(...skipping 18 matching lines...) Expand all Loading... |
257 void LayoutThemeChromiumSkia::adjustSearchFieldResultsDecorationStyle(RenderStyl
e& style, Element*) const | 257 void LayoutThemeChromiumSkia::adjustSearchFieldResultsDecorationStyle(RenderStyl
e& style, Element*) const |
258 { | 258 { |
259 // Scale the decoration size based on the font size | 259 // Scale the decoration size based on the font size |
260 float fontScale = style.fontSize() / defaultControlFontPixelSize; | 260 float fontScale = style.fontSize() / defaultControlFontPixelSize; |
261 int magnifierSize = lroundf(std::min(std::max(minSearchFieldResultsDecoratio
nSize, defaultSearchFieldResultsDecorationSize * fontScale), | 261 int magnifierSize = lroundf(std::min(std::max(minSearchFieldResultsDecoratio
nSize, defaultSearchFieldResultsDecorationSize * fontScale), |
262 maxSearchFieldResultsDecorationSize)); | 262 maxSearchFieldResultsDecorationSize)); |
263 style.setWidth(Length(magnifierSize, Fixed)); | 263 style.setWidth(Length(magnifierSize, Fixed)); |
264 style.setHeight(Length(magnifierSize, Fixed)); | 264 style.setHeight(Length(magnifierSize, Fixed)); |
265 } | 265 } |
266 | 266 |
267 bool LayoutThemeChromiumSkia::paintSearchFieldResultsDecoration(RenderObject* ma
gnifierObject, const PaintInfo& paintInfo, const IntRect& r) | 267 bool LayoutThemeChromiumSkia::paintSearchFieldResultsDecoration(LayoutObject* ma
gnifierObject, const PaintInfo& paintInfo, const IntRect& r) |
268 { | 268 { |
269 // Get the renderer of <input> element. | 269 // Get the renderer of <input> element. |
270 if (!magnifierObject->node()) | 270 if (!magnifierObject->node()) |
271 return false; | 271 return false; |
272 Node* input = magnifierObject->node()->shadowHost(); | 272 Node* input = magnifierObject->node()->shadowHost(); |
273 RenderObject* baseRenderer = input ? input->renderer() : magnifierObject; | 273 LayoutObject* baseRenderer = input ? input->renderer() : magnifierObject; |
274 if (!baseRenderer->isBox()) | 274 if (!baseRenderer->isBox()) |
275 return false; | 275 return false; |
276 RenderBox* inputRenderBox = toRenderBox(baseRenderer); | 276 RenderBox* inputRenderBox = toRenderBox(baseRenderer); |
277 LayoutRect inputContentBox = inputRenderBox->contentBoxRect(); | 277 LayoutRect inputContentBox = inputRenderBox->contentBoxRect(); |
278 | 278 |
279 // Make sure the scaled decoration stays square and will fit in its parent's
box. | 279 // Make sure the scaled decoration stays square and will fit in its parent's
box. |
280 LayoutUnit magnifierSize = std::min(inputContentBox.width(), std::min<Layout
Unit>(inputContentBox.height(), r.height())); | 280 LayoutUnit magnifierSize = std::min(inputContentBox.width(), std::min<Layout
Unit>(inputContentBox.height(), r.height())); |
281 // Calculate decoration's coordinates relative to the input element. | 281 // Calculate decoration's coordinates relative to the input element. |
282 // Center the decoration vertically. Round up though, so if it has to be on
e pixel off-center, it will | 282 // Center the decoration vertically. Round up though, so if it has to be on
e pixel off-center, it will |
283 // be one pixel closer to the bottom of the field. This tends to look bette
r with the text. | 283 // be one pixel closer to the bottom of the field. This tends to look bette
r with the text. |
284 LayoutRect magnifierRect(magnifierObject->offsetFromAncestorContainer(inputR
enderBox).width(), | 284 LayoutRect magnifierRect(magnifierObject->offsetFromAncestorContainer(inputR
enderBox).width(), |
285 inputContentBox.y() + (inputContentBox.height() - magnifierSize + 1) / 2
, | 285 inputContentBox.y() + (inputContentBox.height() - magnifierSize + 1) / 2
, |
286 magnifierSize, magnifierSize); | 286 magnifierSize, magnifierSize); |
287 IntRect paintingRect = convertToPaintingRect(inputRenderBox, magnifierObject
, magnifierRect, r); | 287 IntRect paintingRect = convertToPaintingRect(inputRenderBox, magnifierObject
, magnifierRect, r); |
288 | 288 |
289 DEFINE_STATIC_REF(Image, magnifierImage, (Image::loadPlatformResource("searc
hMagnifier"))); | 289 DEFINE_STATIC_REF(Image, magnifierImage, (Image::loadPlatformResource("searc
hMagnifier"))); |
290 paintInfo.context->drawImage(magnifierImage, paintingRect); | 290 paintInfo.context->drawImage(magnifierImage, paintingRect); |
291 return false; | 291 return false; |
292 } | 292 } |
293 | 293 |
294 bool LayoutThemeChromiumSkia::paintMediaSliderTrack(RenderObject* object, const
PaintInfo& paintInfo, const IntRect& rect) | 294 bool LayoutThemeChromiumSkia::paintMediaSliderTrack(LayoutObject* object, const
PaintInfo& paintInfo, const IntRect& rect) |
295 { | 295 { |
296 return RenderMediaControls::paintMediaControlsPart(MediaSlider, object, pain
tInfo, rect); | 296 return RenderMediaControls::paintMediaControlsPart(MediaSlider, object, pain
tInfo, rect); |
297 } | 297 } |
298 | 298 |
299 bool LayoutThemeChromiumSkia::paintMediaVolumeSliderTrack(RenderObject* object,
const PaintInfo& paintInfo, const IntRect& rect) | 299 bool LayoutThemeChromiumSkia::paintMediaVolumeSliderTrack(LayoutObject* object,
const PaintInfo& paintInfo, const IntRect& rect) |
300 { | 300 { |
301 return RenderMediaControls::paintMediaControlsPart(MediaVolumeSlider, object
, paintInfo, rect); | 301 return RenderMediaControls::paintMediaControlsPart(MediaVolumeSlider, object
, paintInfo, rect); |
302 } | 302 } |
303 | 303 |
304 void LayoutThemeChromiumSkia::adjustSliderThumbSize(RenderStyle& style, Element*
) const | 304 void LayoutThemeChromiumSkia::adjustSliderThumbSize(RenderStyle& style, Element*
) const |
305 { | 305 { |
306 RenderMediaControls::adjustMediaSliderThumbSize(style); | 306 RenderMediaControls::adjustMediaSliderThumbSize(style); |
307 } | 307 } |
308 | 308 |
309 bool LayoutThemeChromiumSkia::paintMediaSliderThumb(RenderObject* object, const
PaintInfo& paintInfo, const IntRect& rect) | 309 bool LayoutThemeChromiumSkia::paintMediaSliderThumb(LayoutObject* object, const
PaintInfo& paintInfo, const IntRect& rect) |
310 { | 310 { |
311 return RenderMediaControls::paintMediaControlsPart(MediaSliderThumb, object,
paintInfo, rect); | 311 return RenderMediaControls::paintMediaControlsPart(MediaSliderThumb, object,
paintInfo, rect); |
312 } | 312 } |
313 | 313 |
314 bool LayoutThemeChromiumSkia::paintMediaToggleClosedCaptionsButton(RenderObject*
o, const PaintInfo& paintInfo, const IntRect& r) | 314 bool LayoutThemeChromiumSkia::paintMediaToggleClosedCaptionsButton(LayoutObject*
o, const PaintInfo& paintInfo, const IntRect& r) |
315 { | 315 { |
316 return RenderMediaControls::paintMediaControlsPart(MediaShowClosedCaptionsBu
tton, o, paintInfo, r); | 316 return RenderMediaControls::paintMediaControlsPart(MediaShowClosedCaptionsBu
tton, o, paintInfo, r); |
317 } | 317 } |
318 | 318 |
319 bool LayoutThemeChromiumSkia::paintMediaCastButton(RenderObject* o, const PaintI
nfo& paintInfo, const IntRect& r) | 319 bool LayoutThemeChromiumSkia::paintMediaCastButton(LayoutObject* o, const PaintI
nfo& paintInfo, const IntRect& r) |
320 { | 320 { |
321 return RenderMediaControls::paintMediaControlsPart(MediaCastOffButton, o, pa
intInfo, r); | 321 return RenderMediaControls::paintMediaControlsPart(MediaCastOffButton, o, pa
intInfo, r); |
322 } | 322 } |
323 | 323 |
324 bool LayoutThemeChromiumSkia::paintMediaVolumeSliderThumb(RenderObject* object,
const PaintInfo& paintInfo, const IntRect& rect) | 324 bool LayoutThemeChromiumSkia::paintMediaVolumeSliderThumb(LayoutObject* object,
const PaintInfo& paintInfo, const IntRect& rect) |
325 { | 325 { |
326 return RenderMediaControls::paintMediaControlsPart(MediaVolumeSliderThumb, o
bject, paintInfo, rect); | 326 return RenderMediaControls::paintMediaControlsPart(MediaVolumeSliderThumb, o
bject, paintInfo, rect); |
327 } | 327 } |
328 | 328 |
329 bool LayoutThemeChromiumSkia::paintMediaPlayButton(RenderObject* object, const P
aintInfo& paintInfo, const IntRect& rect) | 329 bool LayoutThemeChromiumSkia::paintMediaPlayButton(LayoutObject* object, const P
aintInfo& paintInfo, const IntRect& rect) |
330 { | 330 { |
331 return RenderMediaControls::paintMediaControlsPart(MediaPlayButton, object,
paintInfo, rect); | 331 return RenderMediaControls::paintMediaControlsPart(MediaPlayButton, object,
paintInfo, rect); |
332 } | 332 } |
333 | 333 |
334 bool LayoutThemeChromiumSkia::paintMediaOverlayPlayButton(RenderObject* object,
const PaintInfo& paintInfo, const IntRect& rect) | 334 bool LayoutThemeChromiumSkia::paintMediaOverlayPlayButton(LayoutObject* object,
const PaintInfo& paintInfo, const IntRect& rect) |
335 { | 335 { |
336 return RenderMediaControls::paintMediaControlsPart(MediaOverlayPlayButton, o
bject, paintInfo, rect); | 336 return RenderMediaControls::paintMediaControlsPart(MediaOverlayPlayButton, o
bject, paintInfo, rect); |
337 } | 337 } |
338 | 338 |
339 bool LayoutThemeChromiumSkia::paintMediaMuteButton(RenderObject* object, const P
aintInfo& paintInfo, const IntRect& rect) | 339 bool LayoutThemeChromiumSkia::paintMediaMuteButton(LayoutObject* object, const P
aintInfo& paintInfo, const IntRect& rect) |
340 { | 340 { |
341 return RenderMediaControls::paintMediaControlsPart(MediaMuteButton, object,
paintInfo, rect); | 341 return RenderMediaControls::paintMediaControlsPart(MediaMuteButton, object,
paintInfo, rect); |
342 } | 342 } |
343 | 343 |
344 String LayoutThemeChromiumSkia::formatMediaControlsTime(float time) const | 344 String LayoutThemeChromiumSkia::formatMediaControlsTime(float time) const |
345 { | 345 { |
346 return RenderMediaControls::formatMediaControlsTime(time); | 346 return RenderMediaControls::formatMediaControlsTime(time); |
347 } | 347 } |
348 | 348 |
349 String LayoutThemeChromiumSkia::formatMediaControlsCurrentTime(float currentTime
, float duration) const | 349 String LayoutThemeChromiumSkia::formatMediaControlsCurrentTime(float currentTime
, float duration) const |
350 { | 350 { |
351 return RenderMediaControls::formatMediaControlsCurrentTime(currentTime, dura
tion); | 351 return RenderMediaControls::formatMediaControlsCurrentTime(currentTime, dura
tion); |
352 } | 352 } |
353 | 353 |
354 bool LayoutThemeChromiumSkia::paintMediaFullscreenButton(RenderObject* object, c
onst PaintInfo& paintInfo, const IntRect& rect) | 354 bool LayoutThemeChromiumSkia::paintMediaFullscreenButton(LayoutObject* object, c
onst PaintInfo& paintInfo, const IntRect& rect) |
355 { | 355 { |
356 return RenderMediaControls::paintMediaControlsPart(MediaEnterFullscreenButto
n, object, paintInfo, rect); | 356 return RenderMediaControls::paintMediaControlsPart(MediaEnterFullscreenButto
n, object, paintInfo, rect); |
357 } | 357 } |
358 | 358 |
359 void LayoutThemeChromiumSkia::adjustMenuListStyle(RenderStyle& style, Element*)
const | 359 void LayoutThemeChromiumSkia::adjustMenuListStyle(RenderStyle& style, Element*)
const |
360 { | 360 { |
361 // Height is locked to auto on all browsers. | 361 // Height is locked to auto on all browsers. |
362 style.setLineHeight(RenderStyle::initialLineHeight()); | 362 style.setLineHeight(RenderStyle::initialLineHeight()); |
363 } | 363 } |
364 | 364 |
365 void LayoutThemeChromiumSkia::adjustMenuListButtonStyle(RenderStyle& style, Elem
ent* e) const | 365 void LayoutThemeChromiumSkia::adjustMenuListButtonStyle(RenderStyle& style, Elem
ent* e) const |
366 { | 366 { |
367 adjustMenuListStyle(style, e); | 367 adjustMenuListStyle(style, e); |
368 } | 368 } |
369 | 369 |
370 // Used to paint styled menulists (i.e. with a non-default border) | 370 // Used to paint styled menulists (i.e. with a non-default border) |
371 bool LayoutThemeChromiumSkia::paintMenuListButton(RenderObject* o, const PaintIn
fo& i, const IntRect& rect) | 371 bool LayoutThemeChromiumSkia::paintMenuListButton(LayoutObject* o, const PaintIn
fo& i, const IntRect& rect) |
372 { | 372 { |
373 return paintMenuList(o, i, rect); | 373 return paintMenuList(o, i, rect); |
374 } | 374 } |
375 | 375 |
376 int LayoutThemeChromiumSkia::popupInternalPaddingLeft(const RenderStyle& style)
const | 376 int LayoutThemeChromiumSkia::popupInternalPaddingLeft(const RenderStyle& style)
const |
377 { | 377 { |
378 return menuListInternalPadding(style, LeftPadding); | 378 return menuListInternalPadding(style, LeftPadding); |
379 } | 379 } |
380 | 380 |
381 int LayoutThemeChromiumSkia::popupInternalPaddingRight(const RenderStyle& style)
const | 381 int LayoutThemeChromiumSkia::popupInternalPaddingRight(const RenderStyle& style)
const |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
467 double LayoutThemeChromiumSkia::animationDurationForProgressBar(RenderProgress*
renderProgress) const | 467 double LayoutThemeChromiumSkia::animationDurationForProgressBar(RenderProgress*
renderProgress) const |
468 { | 468 { |
469 return progressAnimationInterval * progressAnimationFrames * 2; // "2" for b
ack and forth | 469 return progressAnimationInterval * progressAnimationFrames * 2; // "2" for b
ack and forth |
470 } | 470 } |
471 | 471 |
472 IntRect LayoutThemeChromiumSkia::progressValueRectFor(RenderProgress* renderProg
ress, const IntRect& rect) const | 472 IntRect LayoutThemeChromiumSkia::progressValueRectFor(RenderProgress* renderProg
ress, const IntRect& rect) const |
473 { | 473 { |
474 return renderProgress->isDeterminate() ? determinateProgressValueRectFor(ren
derProgress, rect) : indeterminateProgressValueRectFor(renderProgress, rect); | 474 return renderProgress->isDeterminate() ? determinateProgressValueRectFor(ren
derProgress, rect) : indeterminateProgressValueRectFor(renderProgress, rect); |
475 } | 475 } |
476 | 476 |
477 LayoutThemeChromiumSkia::DirectionFlippingScope::DirectionFlippingScope(RenderOb
ject* renderer, const PaintInfo& paintInfo, const IntRect& rect) | 477 LayoutThemeChromiumSkia::DirectionFlippingScope::DirectionFlippingScope(LayoutOb
ject* renderer, const PaintInfo& paintInfo, const IntRect& rect) |
478 : m_needsFlipping(!renderer->style()->isLeftToRightDirection()) | 478 : m_needsFlipping(!renderer->style()->isLeftToRightDirection()) |
479 , m_paintInfo(paintInfo) | 479 , m_paintInfo(paintInfo) |
480 { | 480 { |
481 if (!m_needsFlipping) | 481 if (!m_needsFlipping) |
482 return; | 482 return; |
483 m_paintInfo.context->save(); | 483 m_paintInfo.context->save(); |
484 m_paintInfo.context->translate(2 * rect.x() + rect.width(), 0); | 484 m_paintInfo.context->translate(2 * rect.x() + rect.width(), 0); |
485 m_paintInfo.context->scale(-1, 1); | 485 m_paintInfo.context->scale(-1, 1); |
486 } | 486 } |
487 | 487 |
488 LayoutThemeChromiumSkia::DirectionFlippingScope::~DirectionFlippingScope() | 488 LayoutThemeChromiumSkia::DirectionFlippingScope::~DirectionFlippingScope() |
489 { | 489 { |
490 if (!m_needsFlipping) | 490 if (!m_needsFlipping) |
491 return; | 491 return; |
492 m_paintInfo.context->restore(); | 492 m_paintInfo.context->restore(); |
493 } | 493 } |
494 | 494 |
495 } // namespace blink | 495 } // namespace blink |
OLD | NEW |