Changeset 171158 in webkit


Ignore:
Timestamp:
Jul 16, 2014 4:34:23 PM (10 years ago)
Author:
roger_fong@apple.com
Message:

Captions container should not clip content.
https://bugs.webkit.org/show_bug.cgi?id=134840.
<rdar://problem/14553608>.

Reviewed by Simon Fraser.

Tests: media/track/track-in-band-subtitles-too-large.html

media/track/track-long-word-container-sizing.html

  • Modules/mediacontrols/mediaControlsApple.css:

(video::-webkit-media-text-track-container):
Set word break property of WebCTT cues to normal to make it consistent with in-band cues.

  • html/track/TextTrackCueGeneric.cpp:

(WebCore::TextTrackCueGenericBoxElement::applyCSSProperties):
Set -webkit-min-content on min-width/min-height property of the text track display.

  • html/track/VTTCue.cpp:

(WebCore::VTTCueBox::applyCSSProperties):
Do the same for WebVTT cues.

  • media/track/track-cue-rendering-snap-to-lines-not-set-expected.txt: Rebaseline.
  • media/track/captions-webvtt/long-word-small-track-display.vtt: Added.
  • media/track/track-in-band-subtitles-too-large-expected.txt: Added.
  • media/track/track-in-band-subtitles-too-large.html: Added.
  • media/track/track-long-word-container-sizing-expected.txt: Added.
  • media/track/track-long-word-container-sizing.html: Added.

We no longer break in the middle of a word, this test is no longer useful.

  • media/track/captions-webvtt/long-word.vtt: Removed.
  • media/track/track-word-breaking-expected.txt: Removed.
  • media/track/track-word-breaking.html: Removed.
Location:
trunk
Files:
5 added
3 deleted
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r171150 r171158  
     12014-07-16  Roger Fong  <roger_fong@apple.com>
     2
     3        Captions container should not clip content.
     4        https://bugs.webkit.org/show_bug.cgi?id=134840.
     5        <rdar://problem/14553608>.
     6
     7        Reviewed by Simon Fraser.
     8
     9        * media/track/track-cue-rendering-snap-to-lines-not-set-expected.txt: Rebaseline.
     10        * media/track/captions-webvtt/long-word-small-track-display.vtt: Added.
     11        * media/track/track-in-band-subtitles-too-large-expected.txt: Added.
     12        * media/track/track-in-band-subtitles-too-large.html: Added.
     13        * media/track/track-long-word-container-sizing-expected.txt: Added.
     14        * media/track/track-long-word-container-sizing.html: Added.
     15       
     16        We no longer break in the middle of a word, this test is no longer useful.
     17        * media/track/captions-webvtt/long-word.vtt: Removed.
     18        * media/track/track-word-breaking-expected.txt: Removed.
     19        * media/track/track-word-breaking.html: Removed.
     20
    1212014-07-16  Mike West  <mkwst@chromium.org>
    222
  • trunk/LayoutTests/media/track/track-cue-rendering-snap-to-lines-not-set-expected.txt

    r165905 r171158  
    1010EXPECTED (cueDisplayElement.innerText == 'This is a demo track to illustrate positioning features of cues.') OK
    1111Cue alignment (default or as specified): middle
    12 Cue left position (percentage): 50
     12Cue left position (percentage): 51
    1313Cue top position (percentage): 100
    1414
     
    2020EXPECTED (cueDisplayElement.innerText == 'Using HTML5 captions, you can position the cues anywhere.') OK
    2121Cue alignment (default or as specified): middle
    22 Cue left position (percentage): 50
     22Cue left position (percentage): 51
    2323Cue top position (percentage): 50
    2424
  • trunk/Source/WebCore/ChangeLog

    r171157 r171158  
     12014-07-16  Roger Fong  <roger_fong@apple.com>
     2
     3        Captions container should not clip content.
     4        https://bugs.webkit.org/show_bug.cgi?id=134840.
     5        <rdar://problem/14553608>.
     6
     7        Reviewed by Simon Fraser.
     8
     9        Tests: media/track/track-in-band-subtitles-too-large.html
     10               media/track/track-long-word-container-sizing.html
     11
     12        * Modules/mediacontrols/mediaControlsApple.css:
     13        (video::-webkit-media-text-track-container):
     14        Set word break property of WebCTT cues to normal to make it consistent with in-band cues.
     15        * html/track/TextTrackCueGeneric.cpp:
     16        (WebCore::TextTrackCueGenericBoxElement::applyCSSProperties):
     17        Set -webkit-min-content on min-width/min-height property of the text track display.
     18        * html/track/VTTCue.cpp:
     19        (WebCore::VTTCueBox::applyCSSProperties):
     20        Do the same for WebVTT cues.
     21
    1222014-07-16  Eric Carlson  <eric.carlson@apple.com>
    223
  • trunk/Source/WebCore/Modules/mediacontrols/mediaControlsApple.css

    r171004 r171158  
    710710    pointer-events: none;
    711711    -webkit-user-select: none;
    712     word-break: break-word;
    713712
    714713    -webkit-flex: 1 1;
  • trunk/Source/WebCore/html/track/TextTrackCueGeneric.cpp

    r170694 r171158  
    8282    }
    8383
     84    if (cue->getWritingDirection() == VTTCue::Horizontal)
     85        setInlineStyleProperty(CSSPropertyMinWidth, "-webkit-min-content");
     86    else
     87        setInlineStyleProperty(CSSPropertyMinHeight, "-webkit-min-content");
     88
    8489    if (cue->foregroundColor().isValid())
    8590        cueElement->setInlineStyleProperty(CSSPropertyColor, cue->foregroundColor().serialized());
     
    106111    setInlineStyleProperty(CSSPropertyWebkitWritingMode, cue->getCSSWritingMode(), false);
    107112    setInlineStyleProperty(CSSPropertyWhiteSpace, CSSValuePreWrap);
    108     setInlineStyleProperty(CSSPropertyWordBreak, CSSValueNormal);
    109113}
    110114
  • trunk/Source/WebCore/html/track/VTTCue.cpp

    r171004 r171158  
    175175        setInlineStyleProperty(CSSPropertyWidth, static_cast<double>(m_cue.getCSSSize()), CSSPrimitiveValue::CSS_PERCENTAGE);
    176176        setInlineStyleProperty(CSSPropertyHeight, CSSValueAuto);
     177        setInlineStyleProperty(CSSPropertyMinWidth, "-webkit-min-content");
    177178    } else {
    178179        setInlineStyleProperty(CSSPropertyWidth, CSSValueAuto);
    179180        setInlineStyleProperty(CSSPropertyHeight, static_cast<double>(m_cue.getCSSSize()),  CSSPrimitiveValue::CSS_PERCENTAGE);
     181        setInlineStyleProperty(CSSPropertyMinHeight, "-webkit-min-content");
    180182    }
    181183
Note: See TracChangeset for help on using the changeset viewer.