Changeset 141795 in webkit


Ignore:
Timestamp:
Feb 4, 2013 1:00:26 PM (11 years ago)
Author:
commit-queue@webkit.org
Message:

Implemet :lang() pseudo class support for the WebVTT ::cue pseudo element
https://bugs.webkit.org/show_bug.cgi?id=105478

Patch by Dima Gorbik <dgorbik@apple.com> on 2013-02-04
Reviewed by Antti Koivisto.

Source/WebCore:

In WebVTT lang is preprocessed and stored in the lang attribute of the element,
so we access it instead of walking up the tree the way it is done in HTML.

Existing tests were modified to cover this case.

  • css/SelectorChecker.cpp:

(WebCore::SelectorChecker::checkOne):

LayoutTests:

  • media/track/captions-webvtt/styling-lang.vtt:
  • media/track/track-css-matching-lang-expected.txt:
  • media/track/track-css-matching-lang.html:
Location:
trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r141791 r141795  
     12013-02-04  Dima Gorbik  <dgorbik@apple.com>
     2
     3        Implemet :lang() pseudo class support for the WebVTT ::cue pseudo element
     4        https://bugs.webkit.org/show_bug.cgi?id=105478
     5
     6        Reviewed by Antti Koivisto.
     7
     8        * media/track/captions-webvtt/styling-lang.vtt:
     9        * media/track/track-css-matching-lang-expected.txt:
     10        * media/track/track-css-matching-lang.html:
     11
    1122013-02-04  Tom Sepez  <tsepez@chromiium.org>
    213
  • trunk/LayoutTests/media/track/captions-webvtt/styling-lang.vtt

    r140877 r141795  
    22
    331
    4 00:00.000 --> 00:01.000
     400:00.000 --> 00:00.500
    55<lang en><c>English<lang ru><c> Русский<lang en><c> English again</c></lang></c></lang></c></lang>
     6
     72
     800:00.500 --> 00:01.000
     9<lang en><i>English<lang ru><b> Русский<lang en><u> English again</u></lang></b></lang></i></lang>
  • trunk/LayoutTests/media/track/track-css-matching-lang-expected.txt

    r140877 r141795  
    55EXPECTED (getComputedStyle(cueNode).color == 'rgb(255, 0, 0)') OK
    66EXPECTED (getComputedStyle(cueNode).color == 'rgb(0, 128, 0)') OK
     7
     8RUN(video.currentTime = 0.6)
     9EVENT(seeked)
     10EXPECTED (getComputedStyle(cueNode).color == 'rgb(128, 0, 128)') OK
     11EXPECTED (getComputedStyle(cueNode).color == 'rgb(0, 255, 0)') OK
     12EXPECTED (getComputedStyle(cueNode).color == 'rgb(128, 0, 128)') OK
    713END OF TEST
    814
  • trunk/LayoutTests/media/track/track-css-matching-lang.html

    r140877 r141795  
    99
    1010        <style>
     11        ::cue(:lang(ru)) { color: lime; }
     12        ::cue(:lang(en)) { color: purple; }
    1113        ::cue(c[lang="ru"]) { color: red; }
    1214        ::cue(c[lang="en"]) { color: green; }
     
    1719        var cueNode;
    1820        var seekedCount = 0;
    19         var seekTimes = [0.1];
     21        var seekTimes = [0.1, 0.6];
    2022
    21         var info = [["rgb(0, 128, 0)", "rgb(255, 0, 0)", "rgb(0, 128, 0)"]];
     23        var info = [["rgb(0, 128, 0)", "rgb(255, 0, 0)", "rgb(0, 128, 0)"],
     24                    ["rgb(128, 0, 128)", "rgb(0, 255, 0)", "rgb(128, 0, 128)"]];
    2225
    2326        function seeked()
  • trunk/Source/WebCore/ChangeLog

    r141792 r141795  
     12013-02-04  Dima Gorbik  <dgorbik@apple.com>
     2
     3        Implemet :lang() pseudo class support for the WebVTT ::cue pseudo element
     4        https://bugs.webkit.org/show_bug.cgi?id=105478
     5
     6        Reviewed by Antti Koivisto.
     7
     8        In WebVTT lang is preprocessed and stored in the lang attribute of the element,
     9        so we access it instead of walking up the tree the way it is done in HTML.
     10
     11        Existing tests were modified to cover this case.
     12
     13        * css/SelectorChecker.cpp:
     14        (WebCore::SelectorChecker::checkOne):
     15
    1162013-02-04  Tim Horton  <timothy_horton@apple.com>
    217
  • trunk/Source/WebCore/css/SelectorChecker.cpp

    r141529 r141795  
    820820        case CSSSelector::PseudoLang:
    821821            {
    822                 AtomicString value = element->computeInheritedLanguage();
     822                AtomicString value;
     823#if ENABLE(VIDEO_TRACK)
     824                if (element->isWebVTTElement())
     825                    value = element->getAttribute(langAttr);
     826                else
     827#endif
     828                    value = element->computeInheritedLanguage();
    823829                const AtomicString& argument = selector->argument();
    824830                if (value.isEmpty() || !value.startsWith(argument, false))
Note: See TracChangeset for help on using the changeset viewer.