Changeset 142910 in webkit


Ignore:
Timestamp:
Feb 14, 2013, 1:51:49 PM (12 years ago)
Author:
eric.carlson@apple.com
Message:

[Mac] adjust caption color user preference calculation
https://bugs.webkit.org/show_bug.cgi?id=109840

Reviewed by Dean Jackson.

No new tests, it isn't possible to test this with DRT.

  • page/CaptionUserPreferencesMac.mm:

(WebCore::CaptionUserPreferencesMac::captionsWindowCSS): The color is "important" if either the

color or opacity are supposed to override.

(WebCore::CaptionUserPreferencesMac::captionsBackgroundCSS): Ditto.
(WebCore::CaptionUserPreferencesMac::captionsTextColor): Ditto.

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r142909 r142910  
     12013-02-14  Eric Carlson  <eric.carlson@apple.com>
     2
     3        [Mac] adjust caption color user preference calculation
     4        https://bugs.webkit.org/show_bug.cgi?id=109840
     5
     6        Reviewed by Dean Jackson.
     7
     8        No new tests, it isn't possible to test this with DRT.
     9
     10        * page/CaptionUserPreferencesMac.mm:
     11        (WebCore::CaptionUserPreferencesMac::captionsWindowCSS): The color is "important" if either the
     12            color or opacity are supposed to override.
     13        (WebCore::CaptionUserPreferencesMac::captionsBackgroundCSS): Ditto.
     14        (WebCore::CaptionUserPreferencesMac::captionsTextColor): Ditto.
     15
    1162013-02-14  Cosmin Truta  <ctruta@rim.com>
    217
  • trunk/Source/WebCore/page/CaptionUserPreferencesMac.mm

    r142809 r142910  
    162162        windowColor = Color::transparent;
    163163
     164    bool important = behavior == kMACaptionAppearanceBehaviorUseValue;
    164165    CGFloat opacity = MACaptionAppearanceGetWindowOpacity(kMACaptionAppearanceDomainUser, &behavior);
    165     String windowStyle = colorPropertyCSS(CSSPropertyBackgroundColor, Color(windowColor.red(), windowColor.green(), windowColor.blue(), static_cast<int>(opacity * 255)), behavior == kMACaptionAppearanceBehaviorUseValue);
     166    if (!important)
     167        important = behavior == kMACaptionAppearanceBehaviorUseValue;
     168    String windowStyle = colorPropertyCSS(CSSPropertyBackgroundColor, Color(windowColor.red(), windowColor.green(), windowColor.blue(), static_cast<int>(opacity * 255)), important);
    166169
    167170    if (!opacity)
     
    189192        backgroundColor = defaultBackgroundColor;
    190193
     194    bool important = behavior == kMACaptionAppearanceBehaviorUseValue;
    191195    CGFloat opacity = MACaptionAppearanceGetBackgroundOpacity(kMACaptionAppearanceDomainUser, 0);
    192     String backgroundStyle = colorPropertyCSS(CSSPropertyBackgroundColor, Color(backgroundColor.red(), backgroundColor.green(), backgroundColor.blue(), static_cast<int>(opacity * 255)), behavior == kMACaptionAppearanceBehaviorUseValue);
     196    if (!important)
     197        important = behavior == kMACaptionAppearanceBehaviorUseValue;
     198    String backgroundStyle = colorPropertyCSS(CSSPropertyBackgroundColor, Color(backgroundColor.red(), backgroundColor.green(), backgroundColor.blue(), static_cast<int>(opacity * 255)), important);
    193199
    194200    if (!opacity)
     
    215221        textColor = Color::white;
    216222   
     223    important = behavior == kMACaptionAppearanceBehaviorUseValue;
    217224    CGFloat opacity = MACaptionAppearanceGetForegroundOpacity(kMACaptionAppearanceDomainUser, &behavior);
    218     important = behavior == kMACaptionAppearanceBehaviorUseValue;
     225    if (!important)
     226        important = behavior == kMACaptionAppearanceBehaviorUseValue;
    219227    return Color(textColor.red(), textColor.green(), textColor.blue(), static_cast<int>(opacity * 255));
    220228}
Note: See TracChangeset for help on using the changeset viewer.