Changeset 162450 in webkit


Ignore:
Timestamp:
Jan 21, 2014, 10:44:03 AM (12 years ago)
Author:
eric.carlson@apple.com
Message:

Add ‎ ‏ and   to WebVTT parser
https://bugs.webkit.org/show_bug.cgi?id=85112

Reviewed by Jer Noble.

Source/WebCore:

No new tests, track-webvtt-tc022-entities.html was updated to test this.

  • html/track/WebVTTTokenizer.cpp:

(WebCore::WebVTTTokenizer::nextToken): Support RLM, LRM, and NBSP entities.

LayoutTests:

  • media/track/captions-webvtt/tc022-entities.vtt:
  • media/track/track-webvtt-tc022-entities-expected.txt:
  • media/track/track-webvtt-tc022-entities.html:
Location:
trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r162442 r162450  
     12014-01-21  Eric Carlson  <eric.carlson@apple.com>
     2
     3        Add &lrm; &rlm; and &nbsp; to WebVTT parser
     4        https://bugs.webkit.org/show_bug.cgi?id=85112
     5
     6        Reviewed by Jer Noble.
     7
     8        * media/track/captions-webvtt/tc022-entities.vtt:
     9        * media/track/track-webvtt-tc022-entities-expected.txt:
     10        * media/track/track-webvtt-tc022-entities.html:
     11
    1122014-01-21  Mihai Tica  <mitica@adobe.com>
    213
  • trunk/LayoutTests/media/track/captions-webvtt/tc022-entities.vtt

    r112898 r162450  
    11WEBVTT
    2 Cue content with escape characters for &, <, and >.
     2Cue content with escape characters for &, <, >, LRM, RLM and non-breaking space.
    33
    441
    5500:00:00.000 --> 00:00:30.500 align:start position:20%
    6 This cue has an amp &amp; character.
     6This cue has an amp character: &amp;
    77
    882
    9900:00:31.000 --> 00:01:00.500 align:start position:20%
    10 This cue has a less than &lt; character.
     10This cue has a less than character: &lt;
    1111
    12123
    131300:01:01.000 --> 00:02:00.500 align:start position:20%
    14 This cue has a greater than &gt; character.
     14This cue has a greater than character: &gt;
     15
     164
     1700:02:01.000 --> 00:03:00.500 align:start position:20%
     18This cue has a right-to-left mark (RLM): &rlm;
     19
     205
     2100:03:01.000 --> 00:04:00.500 align:start position:20%
     22This cue has a left-to-right mark (LRM): &lrm;
     23
     246
     2500:04:01.000 --> 00:05:00.500 align:start position:20%
     26This cue has a non-breakable space (NBSP): &nbsp;
  • trunk/LayoutTests/media/track/track-webvtt-tc022-entities-expected.txt

    r158743 r162450  
    44
    55*** Testing text track 0
    6 EXPECTED (cues.length == '3') OK
    7 EXPECTED (cues[0].getCueAsHTML().textContent == 'This cue has an amp & character.') OK
    8 EXPECTED (cues[1].getCueAsHTML().textContent == 'This cue has a less than < character.') OK
    9 EXPECTED (cues[2].getCueAsHTML().textContent == 'This cue has a greater than > character.') OK
     6EXPECTED (cues.length == '6') OK
     7EXPECTED (cues[0].getCueAsHTML().textContent == 'This cue has an amp character: &') OK
     8EXPECTED (cues[1].getCueAsHTML().textContent == 'This cue has a less than character: <') OK
     9EXPECTED (cues[2].getCueAsHTML().textContent == 'This cue has a greater than character: >') OK
     10EXPECTED (cues[3].getCueAsHTML().textContent == 'This cue has a right-to-left mark (RLM): ‏') OK
     11EXPECTED (cues[4].getCueAsHTML().textContent == 'This cue has a left-to-right mark (LRM): ‎') OK
     12EXPECTED (cues[5].getCueAsHTML().textContent == 'This cue has a non-breakable space (NBSP):  ') OK
    1013
    1114*** Testing text track 1
  • trunk/LayoutTests/media/track/track-webvtt-tc022-entities.html

    r102212 r162450  
    2525                var expected =
    2626                {
    27                     length : 3,
     27                    length : 6,
    2828                    tests:
    2929                    [
    3030                        {
    3131                            property : "getCueAsHTML().textContent",
    32                             values : ["This cue has an amp & character.",
    33                                       "This cue has a less than < character.",
    34                                       "This cue has a greater than > character."],
     32                            values : [
     33                                        "This cue has an amp character: \u0026",
     34                                        "This cue has a less than character: \u003C",
     35                                        "This cue has a greater than character: \u003E",
     36                                        "This cue has a right-to-left mark (RLM): \u200f",
     37                                        "This cue has a left-to-right mark (LRM): \u200e",
     38                                        "This cue has a non-breakable space (NBSP): \u00a0"
     39                                     ],
    3540                        },
    3641                    ],
  • trunk/Source/WebCore/ChangeLog

    r162447 r162450  
     12014-01-21  Eric Carlson  <eric.carlson@apple.com>
     2
     3        Add &lrm; &rlm; and &nbsp; to WebVTT parser
     4        https://bugs.webkit.org/show_bug.cgi?id=85112
     5
     6        Reviewed by Jer Noble.
     7
     8        No new tests, track-webvtt-tc022-entities.html was updated to test this.
     9
     10        * html/track/WebVTTTokenizer.cpp:
     11        (WebCore::WebVTTTokenizer::nextToken): Support RLM, LRM, and NBSP entities.
     12
    1132014-01-21  Commit Queue  <commit-queue@webkit.org>
    214
  • trunk/Source/WebCore/html/track/WebVTTTokenizer.cpp

    r142497 r162450  
    3636
    3737#include "MarkupTokenizerInlines.h"
     38#include <wtf/unicode/CharacterNames.h>
    3839
    3940namespace WebCore {
     
    108109            else if (vectorEqualsString(m_buffer, "&gt"))
    109110                bufferCharacter('>');
     111            else if (vectorEqualsString(m_buffer, "&lrm"))
     112                bufferCharacter(leftToRightMark);
     113            else if (vectorEqualsString(m_buffer, "&rlm"))
     114                bufferCharacter(rightToLeftMark);
     115            else if (vectorEqualsString(m_buffer, "&nbsp"))
     116                bufferCharacter(noBreakSpace);
    110117            else {
    111118                m_buffer.append(static_cast<LChar>(cc));
Note: See TracChangeset for help on using the changeset viewer.