Changeset 142191 in webkit


Ignore:
Timestamp:
Feb 7, 2013 3:42:12 PM (11 years ago)
Author:
dino@apple.com
Message:

Use new speech bubble artwork for captions menu button
https://bugs.webkit.org/show_bug.cgi?id=109215

Reviewed by Eric Carlson.

Rather than call into RenderTheme to display this button, embed artwork
into the CSS. This means we can remove some uncalled methods in
RenderTheme.

  • css/mediaControlsQuickTime.css:

(video::-webkit-media-controls-toggle-closed-captions-button): New background image using SVG.

  • rendering/RenderTheme.cpp:

(WebCore::RenderTheme::paint): Don't call the specific painter for the CC button.

  • rendering/RenderTheme.h: Remove unused function.
  • rendering/RenderThemeMac.h: Ditto.
  • rendering/RenderThemeMac.mm: Ditto.
Location:
trunk/Source/WebCore
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r142190 r142191  
     12013-02-07  Dean Jackson  <dino@apple.com>
     2
     3        Use new speech bubble artwork for captions menu button
     4        https://bugs.webkit.org/show_bug.cgi?id=109215
     5
     6        Reviewed by Eric Carlson.
     7
     8        Rather than call into RenderTheme to display this button, embed artwork
     9        into the CSS. This means we can remove some uncalled methods in
     10        RenderTheme.
     11
     12        * css/mediaControlsQuickTime.css:
     13        (video::-webkit-media-controls-toggle-closed-captions-button): New background image using SVG.
     14        * rendering/RenderTheme.cpp:
     15        (WebCore::RenderTheme::paint): Don't call the specific painter for the CC button.
     16        * rendering/RenderTheme.h: Remove unused function.
     17        * rendering/RenderThemeMac.h: Ditto.
     18        * rendering/RenderThemeMac.mm: Ditto.
     19
    1202013-02-07  Michelangelo De Simone  <michelangelo@webkit.org>
    221
  • trunk/Source/WebCore/css/mediaControlsQuickTime.css

    r142003 r142191  
    239239    -webkit-box-ordinal-group: 3; /* between mute and fullscreen */
    240240    border: none !important;
     241    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 130 105"><g fill="rgb(224,224,224)"><path d="M98.766,43.224c0-23.163-21.775-41.94-48.637-41.94c-26.859,0-48.635,18.777-48.635,41.94c0,18.266,13.546,33.796,32.444,39.549c1.131,8.356,26.037,24.255,22.864,19.921c-4.462-6.096-5.159-13.183-5.07-17.566C77.85,84.397,98.766,65.923,98.766,43.224z"/><polygon points="128.044,84 100.956,84 114.5,98"/></g></svg>');
     242    background-repeat: no-repeat;
     243    background-size: 16px 16px;
    241244}
    242245
  • trunk/Source/WebCore/rendering/RenderTheme.cpp

    r142071 r142191  
    342342    case MediaReturnToRealtimeButtonPart:
    343343        return paintMediaReturnToRealtimeButton(o, paintInfo, r);
    344     case MediaToggleClosedCaptionsButtonPart:
    345         return paintMediaToggleClosedCaptionsButton(o, paintInfo, r);
    346344    case MediaSliderPart:
    347345        return paintMediaSliderTrack(o, paintInfo, r);
  • trunk/Source/WebCore/rendering/RenderTheme.h

    r140863 r142191  
    339339    virtual bool paintMediaRewindButton(RenderObject*, const PaintInfo&, const IntRect&) { return true; }
    340340    virtual bool paintMediaReturnToRealtimeButton(RenderObject*, const PaintInfo&, const IntRect&) { return true; }
    341     virtual bool paintMediaToggleClosedCaptionsButton(RenderObject*, const PaintInfo&, const IntRect&) { return true; }
    342341    virtual bool paintMediaControlsBackground(RenderObject*, const PaintInfo&, const IntRect&) { return true; }
    343342    virtual bool paintMediaCurrentTime(RenderObject*, const PaintInfo&, const IntRect&) { return true; }
  • trunk/Source/WebCore/rendering/RenderThemeMac.h

    r134520 r142191  
    5252    virtual bool paintMediaRewindButton(RenderObject*, const PaintInfo&, const IntRect&);
    5353    virtual bool paintMediaReturnToRealtimeButton(RenderObject*, const PaintInfo&, const IntRect&);
    54     virtual bool paintMediaToggleClosedCaptionsButton(RenderObject*, const PaintInfo&, const IntRect&);
    5554    virtual bool paintMediaControlsBackground(RenderObject*, const PaintInfo&, const IntRect&);
    5655    virtual bool paintMediaCurrentTime(RenderObject*, const PaintInfo&, const IntRect&);
  • trunk/Source/WebCore/rendering/RenderThemeMac.mm

    r136613 r142191  
    284284}
    285285
    286 bool RenderThemeMac::paintMediaToggleClosedCaptionsButton(RenderObject* o, const PaintInfo& paintInfo, const IntRect& r)
    287 {
    288     Node* node = o->node();
    289     if (!node)
    290         return false;
    291     if (!node->isMediaControlElement())
    292         return false;
    293 
    294     LocalCurrentGraphicsContext localContext(paintInfo.context);
    295     wkDrawMediaUIPart(mediaControlElementType(node), mediaControllerTheme(), localContext.cgContext(), r, getMediaUIPartStateFlags(node));
    296     return false;
    297 }
    298 
    299286bool RenderThemeMac::paintMediaControlsBackground(RenderObject* o, const PaintInfo& paintInfo, const IntRect& r)
    300287{
Note: See TracChangeset for help on using the changeset viewer.