<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>179237</bug_id>
          
          <creation_ts>2017-11-03 03:45:24 -0700</creation_ts>
          <short_desc>Automatic linebreaking of WebVTT subtitles is not supported</short_desc>
          <delta_ts>2023-10-25 09:20:50 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>Media</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          <see_also>https://bugs.webkit.org/show_bug.cgi?id=179370</see_also>
          <bug_file_loc>http://wpt.live/html/semantics/embedded-content/media-elements/track/track-element/track-webvtt-non-snap-to-lines.html</bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>WPTImpact</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Frédéric Wang Nélar">fred.wang</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>ahmad.saleem792</cc>
    
    <cc>eric.carlson</cc>
    
    <cc>fred.wang</cc>
    
    <cc>jer.noble</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1367870</commentid>
    <comment_count>0</comment_count>
    <who name="Frédéric Wang Nélar">fred.wang</who>
    <bug_when>2017-11-03 03:45:24 -0700</bug_when>
    <thetext>From the spec: https://w3c.github.io/webvtt/#introduction-multiple-lines

&quot;Line breaks in cues are honored. User agents will also insert extra line breaks if necessary to fit the cue in the cue’s width. In general, therefore, authors are encouraged to write cues all on one line except when a line break is definitely necessary.&quot;

This page uses the example from the specification:

https://people.igalia.com/fwang/webvtt-tests/subtitle-linebreaking.html

Linebreaking happens for the long (third) subtitle in Gecko, but not in WebKit. I tried both WebKitGTK+/Linux and Safari/macOS.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1368969</commentid>
    <comment_count>1</comment_count>
      <attachid>326204</attachid>
    <who name="Frédéric Wang Nélar">fred.wang</who>
    <bug_when>2017-11-07 03:47:45 -0800</bug_when>
    <thetext>Created attachment 326204
WIP Patch

I had reported this to Chromium and they reply it is fixed (see https://bugs.chromium.org/p/chromium/issues/detail?id=781186). The attached patch is based on https://chromium.googlesource.com/chromium/src.git/+/e6b16d301f0da8a22bfba7ab5997771af0459cf5%5E!/#F2 and removes a feature that is no longer in the WebVTT spec. It turns out to fix the linebreaking issue.

I also opened bug 179370 to import the WebVTT tests.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1987432</commentid>
    <comment_count>2</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2023-10-25 09:13:53 -0700</bug_when>
    <thetext>All browsers are failing WPT test linked in the URL (removed the standard link URL since it is in Comment 0). Added &apos;WPTImpact&apos; tag for future tracking.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1987433</commentid>
    <comment_count>3</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2023-10-25 09:20:50 -0700</bug_when>
    <thetext>We still have this code but in different shape here:

https://searchfox.org/wubkat/source/Source/WebCore/html/track/VTTCue.cpp#261

if (!cue-&gt;snapToLines()) {
        setInlineStyleProperty(CSSPropertyWhiteSpaceCollapse, CSSValuePreserve);
        setInlineStyleProperty(CSSPropertyTextWrapMode, CSSValueNowrap);
}</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>326204</attachid>
            <date>2017-11-07 03:47:45 -0800</date>
            <delta_ts>2017-11-07 03:47:45 -0800</delta_ts>
            <desc>WIP Patch</desc>
            <filename>179237.patch</filename>
            <type>text/plain</type>
            <size>1449</size>
            <attacher name="Frédéric Wang Nélar">fred.wang</attacher>
            
              <data encoding="base64">ZGlmZiAtLWdpdCBhL1NvdXJjZS9XZWJDb3JlL2h0bWwvdHJhY2svVlRUQ3VlLmNwcCBiL1NvdXJj
ZS9XZWJDb3JlL2h0bWwvdHJhY2svVlRUQ3VlLmNwcAppbmRleCAyMWVhNjY0ZTViYy4uZGNiOGIx
ZTIwZGMgMTAwNjQ0Ci0tLSBhL1NvdXJjZS9XZWJDb3JlL2h0bWwvdHJhY2svVlRUQ3VlLmNwcAor
KysgYi9Tb3VyY2UvV2ViQ29yZS9odG1sL3RyYWNrL1ZUVEN1ZS5jcHAKQEAgLTIwNSwyMyArMjA1
LDYgQEAgdm9pZCBWVFRDdWVCb3g6OmFwcGx5Q1NTUHJvcGVydGllcyhjb25zdCBJbnRTaXplJiB2
aWRlb1NpemUpCiAgICAgLy8gd2hvc2UgZmlyc3QgY2VsbCBpcyB0aGUgdmFsdWUgb2YgdGhlIGNv
cnJlc3BvbmRpbmcgY3VlJ3MgdGV4dCB0cmFjayBjdWUKICAgICAvLyBhbGlnbm1lbnQ6CiAgICAg
c2V0SW5saW5lU3R5bGVQcm9wZXJ0eShDU1NQcm9wZXJ0eVRleHRBbGlnbiwgbV9jdWUuZ2V0Q1NT
QWxpZ25tZW50KCkpOwotICAgIAotICAgIGlmICghbV9jdWUuc25hcFRvTGluZXMoKSkgewotICAg
ICAgICAvLyAxMC4xMy4xIFNldCB1cCB4IGFuZCB5OgotICAgICAgICAvLyBOb3RlOiB4IGFuZCB5
IGFyZSBzZXQgdGhyb3VnaCB0aGUgQ1NTIGxlZnQgYW5kIHRvcCBhYm92ZS4KLQotICAgICAgICAv
LyAxMC4xMy4yIFBvc2l0aW9uIHRoZSBib3hlcyBpbiBib3hlcyBzdWNoIHRoYXQgdGhlIHBvaW50
IHglIGFsb25nIHRoZQot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