OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. | 2 * Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. |
3 * Copyright (C) 2008, 2009 Google, Inc. | 3 * Copyright (C) 2008, 2009 Google, Inc. |
4 * | 4 * |
5 * This library is free software; you can redistribute it and/or | 5 * This library is free software; you can redistribute it and/or |
6 * modify it under the terms of the GNU Library General Public | 6 * modify it under the terms of the GNU Library General Public |
7 * License as published by the Free Software Foundation; either | 7 * License as published by the Free Software Foundation; either |
8 * version 2 of the License, or (at your option) any later version. | 8 * version 2 of the License, or (at your option) any later version. |
9 * | 9 * |
10 * This library is distributed in the hope that it will be useful, | 10 * This library is distributed in the hope that it will be useful, |
(...skipping 11 matching lines...) Expand all Loading... |
22 #import "core/layout/LayoutThemeMac.h" | 22 #import "core/layout/LayoutThemeMac.h" |
23 | 23 |
24 #import "core/CSSValueKeywords.h" | 24 #import "core/CSSValueKeywords.h" |
25 #import "core/HTMLNames.h" | 25 #import "core/HTMLNames.h" |
26 #import "core/fileapi/FileList.h" | 26 #import "core/fileapi/FileList.h" |
27 #import "core/html/HTMLMeterElement.h" | 27 #import "core/html/HTMLMeterElement.h" |
28 #import "core/layout/LayoutMeter.h" | 28 #import "core/layout/LayoutMeter.h" |
29 #import "core/layout/LayoutProgress.h" | 29 #import "core/layout/LayoutProgress.h" |
30 #import "core/layout/LayoutView.h" | 30 #import "core/layout/LayoutView.h" |
31 #import "core/paint/MediaControlsPainter.h" | 31 #import "core/paint/MediaControlsPainter.h" |
| 32 #import "core/style/AuthorStyleInfo.h" |
32 #import "core/style/ShadowList.h" | 33 #import "core/style/ShadowList.h" |
33 #import "platform/LayoutTestSupport.h" | 34 #import "platform/LayoutTestSupport.h" |
34 #import "platform/PlatformResourceLoader.h" | 35 #import "platform/PlatformResourceLoader.h" |
35 #import "platform/graphics/BitmapImage.h" | 36 #import "platform/graphics/BitmapImage.h" |
36 #import "platform/mac/ColorMac.h" | 37 #import "platform/mac/ColorMac.h" |
37 #import "platform/mac/LocalCurrentGraphicsContext.h" | 38 #import "platform/mac/LocalCurrentGraphicsContext.h" |
38 #import "platform/mac/ThemeMac.h" | 39 #import "platform/mac/ThemeMac.h" |
39 #import "platform/mac/WebCoreNSCellExtras.h" | 40 #import "platform/mac/WebCoreNSCellExtras.h" |
40 #import "platform/text/PlatformLocale.h" | 41 #import "platform/text/PlatformLocale.h" |
41 #import "platform/text/StringTruncator.h" | 42 #import "platform/text/StringTruncator.h" |
(...skipping 388 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
430 } | 431 } |
431 | 432 |
432 if (needsFallback) | 433 if (needsFallback) |
433 color = LayoutTheme::systemColor(cssValueId); | 434 color = LayoutTheme::systemColor(cssValueId); |
434 | 435 |
435 m_systemColorCache.set(cssValueId, color.rgb()); | 436 m_systemColorCache.set(cssValueId, color.rgb()); |
436 | 437 |
437 return color; | 438 return color; |
438 } | 439 } |
439 | 440 |
440 bool LayoutThemeMac::isControlStyled(const ComputedStyle& style) const | 441 bool LayoutThemeMac::isControlStyled(const ComputedStyle& style, const AuthorSty
leInfo& authorStyle) const |
441 { | 442 { |
442 if (style.appearance() == TextFieldPart || style.appearance() == TextAreaPar
t) | 443 if (style.appearance() == TextFieldPart || style.appearance() == TextAreaPar
t) |
443 return style.hasAuthorBorder() || style.boxShadow(); | 444 return authorStyle.specifiesBorder() || style.boxShadow(); |
444 | 445 |
445 // FIXME: This is horrible, but there is not much else that can be done. | 446 // FIXME: This is horrible, but there is not much else that can be done. |
446 // Menu lists cannot draw properly when scaled. They can't really draw | 447 // Menu lists cannot draw properly when scaled. They can't really draw |
447 // properly when transformed either. We can't detect the transform case at | 448 // properly when transformed either. We can't detect the transform case at |
448 // style adjustment time so that will just have to stay broken. We can | 449 // style adjustment time so that will just have to stay broken. We can |
449 // however detect that we're zooming. If zooming is in effect we treat it | 450 // however detect that we're zooming. If zooming is in effect we treat it |
450 // like the control is styled. | 451 // like the control is styled. |
451 if (style.appearance() == MenulistPart && style.effectiveZoom() != 1.0f) | 452 if (style.appearance() == MenulistPart && style.effectiveZoom() != 1.0f) |
452 return true; | 453 return true; |
453 // FIXME: NSSearchFieldCell doesn't work well when scaled. | 454 // FIXME: NSSearchFieldCell doesn't work well when scaled. |
454 if (style.appearance() == SearchFieldPart && style.effectiveZoom() != 1) | 455 if (style.appearance() == SearchFieldPart && style.effectiveZoom() != 1) |
455 return true; | 456 return true; |
456 | 457 |
457 return LayoutTheme::isControlStyled(style); | 458 return LayoutTheme::isControlStyled(style, authorStyle); |
458 } | 459 } |
459 | 460 |
460 void LayoutThemeMac::addVisualOverflow(const LayoutObject& object, IntRect& rect
) | 461 void LayoutThemeMac::addVisualOverflow(const LayoutObject& object, IntRect& rect
) |
461 { | 462 { |
462 ControlPart part = object.style()->appearance(); | 463 ControlPart part = object.style()->appearance(); |
463 | 464 |
464 #if USE(NEW_THEME) | 465 #if USE(NEW_THEME) |
465 switch (part) { | 466 switch (part) { |
466 case CheckboxPart: | 467 case CheckboxPart: |
467 case RadioPart: | 468 case RadioPart: |
(...skipping 705 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1173 | 1174 |
1174 bool LayoutThemeMac::shouldUseFallbackTheme(const ComputedStyle& style) const | 1175 bool LayoutThemeMac::shouldUseFallbackTheme(const ComputedStyle& style) const |
1175 { | 1176 { |
1176 ControlPart part = style.appearance(); | 1177 ControlPart part = style.appearance(); |
1177 if (part == CheckboxPart || part == RadioPart) | 1178 if (part == CheckboxPart || part == RadioPart) |
1178 return style.effectiveZoom() != 1; | 1179 return style.effectiveZoom() != 1; |
1179 return false; | 1180 return false; |
1180 } | 1181 } |
1181 | 1182 |
1182 } // namespace blink | 1183 } // namespace blink |
OLD | NEW |