Title: [166180] trunk/Source/WebCore
Revision
166180
Author
[email protected]
Date
2014-03-24 10:38:28 -0700 (Mon, 24 Mar 2014)

Log Message

Merge Minor WebVTT Cleanups from Blink
https://bugs.webkit.org/show_bug.cgi?id=130681

Reviewed by Eric Carlson.

Merged from Blink (patch by [email protected]):
https://chromium.googlesource.com/chromium/blink/+/693eb5e2933dca0eab5bbd604e9f3406fe9fd1ab
http://crbug.com/52593009
https://chromium.googlesource.com/chromium/blink/+/40b3602feab34e9be829fd742b6ad6ded322a09f
http://crbug.com/104243003

* html/track/TextTrack.cpp:
(WebCore::TextTrack::setMode):
* html/track/TextTrack.idl:
* html/track/TextTrackCue.h:
* html/track/VTTCue.cpp:
(WebCore::VTTCue::VTTCue):
* html/track/VTTCue.h:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (166179 => 166180)


--- trunk/Source/WebCore/ChangeLog	2014-03-24 17:37:54 UTC (rev 166179)
+++ trunk/Source/WebCore/ChangeLog	2014-03-24 17:38:28 UTC (rev 166180)
@@ -1,3 +1,24 @@
+2014-03-24  Brent Fulgham  <[email protected]>
+
+        Merge Minor WebVTT Cleanups from Blink
+        https://bugs.webkit.org/show_bug.cgi?id=130681
+
+        Reviewed by Eric Carlson.
+
+        Merged from Blink (patch by [email protected]):
+        https://chromium.googlesource.com/chromium/blink/+/693eb5e2933dca0eab5bbd604e9f3406fe9fd1ab
+        http://crbug.com/52593009
+        https://chromium.googlesource.com/chromium/blink/+/40b3602feab34e9be829fd742b6ad6ded322a09f
+        http://crbug.com/104243003
+
+        * html/track/TextTrack.cpp:
+        (WebCore::TextTrack::setMode):
+        * html/track/TextTrack.idl:
+        * html/track/TextTrackCue.h:
+        * html/track/VTTCue.cpp:
+        (WebCore::VTTCue::VTTCue):
+        * html/track/VTTCue.h:
+
 2014-03-24  Commit Queue  <[email protected]>
 
         Unreviewed, rolling out r166169.

Modified: trunk/Source/WebCore/html/track/TextTrack.cpp (166179 => 166180)


--- trunk/Source/WebCore/html/track/TextTrack.cpp	2014-03-24 17:37:54 UTC (rev 166179)
+++ trunk/Source/WebCore/html/track/TextTrack.cpp	2014-03-24 17:38:28 UTC (rev 166180)
@@ -210,11 +210,10 @@
 
 void TextTrack::setMode(const AtomicString& mode)
 {
+    ASSERT(mode == disabledKeyword() || mode == hiddenKeyword() || mode == showingKeyword());
+
     // On setting, if the new value isn't equal to what the attribute would currently
     // return, the new value must be processed as follows ...
-    if (mode != disabledKeyword() && mode != hiddenKeyword() && mode != showingKeyword())
-        return;
-
     if (m_mode == mode)
         return;
 

Modified: trunk/Source/WebCore/html/track/TextTrack.idl (166179 => 166180)


--- trunk/Source/WebCore/html/track/TextTrack.idl	2014-03-24 17:37:54 UTC (rev 166179)
+++ trunk/Source/WebCore/html/track/TextTrack.idl	2014-03-24 17:38:28 UTC (rev 166180)
@@ -23,6 +23,9 @@
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
  */
 
+enum TextTrackMode { "disabled",  "hidden",  "showing" };
+enum TextTrackKind { "subtitles",  "captions",  "descriptions",  "chapters", "metadata" };
+
 [
     Conditional=VIDEO_TRACK,
     EventTarget,
@@ -31,19 +34,20 @@
     SkipVTableValidation,
 ] interface TextTrack {
     readonly attribute DOMString id;
-    [CustomSetter] attribute DOMString kind;
+    [CustomSetter] attribute TextTrackKind kind;
     readonly attribute DOMString label;
     [CustomSetter] attribute DOMString language;
 
-    attribute DOMString mode;
+    attribute TextTrackMode mode;
 
     readonly attribute TextTrackCueList cues;
     readonly attribute TextTrackCueList activeCues;
-             attribute EventListener oncuechange;
 
     [RaisesException] void addCue(TextTrackCue cue);
     [RaisesException] void removeCue(TextTrackCue cue);
 
+             attribute EventListener oncuechange;
+
 #if defined(ENABLE_WEBVTT_REGIONS) && ENABLE_WEBVTT_REGIONS
     readonly attribute VTTRegionList regions;
     void addRegion(VTTRegion region);

Modified: trunk/Source/WebCore/html/track/TextTrackCue.h (166179 => 166180)


--- trunk/Source/WebCore/html/track/TextTrackCue.h	2014-03-24 17:37:54 UTC (rev 166179)
+++ trunk/Source/WebCore/html/track/TextTrackCue.h	2014-03-24 17:38:28 UTC (rev 166180)
@@ -120,8 +120,8 @@
 
     ScriptExecutionContext& m_scriptExecutionContext;
 
-    bool m_isActive;
-    bool m_pauseOnExit;
+    bool m_isActive : 1;
+    bool m_pauseOnExit : 1;
 };
 
 } // namespace WebCore

Modified: trunk/Source/WebCore/html/track/VTTCue.cpp (166179 => 166180)


--- trunk/Source/WebCore/html/track/VTTCue.cpp	2014-03-24 17:37:54 UTC (rev 166179)
+++ trunk/Source/WebCore/html/track/VTTCue.cpp	2014-03-24 17:38:28 UTC (rev 166180)
@@ -218,12 +218,12 @@
     , m_cueSize(100)
     , m_writingDirection(Horizontal)
     , m_cueAlignment(Middle)
-    , m_webVTTNodeTree(0)
-    , m_snapToLines(true)
+    , m_webVTTNodeTree(nullptr)
     , m_cueBackgroundBox(HTMLSpanElement::create(spanTag, toDocument(context)))
-    , m_displayTreeShouldChange(true)
     , m_displayDirection(CSSValueLtr)
     , m_displaySize(0)
+    , m_snapToLines(true)
+    , m_displayTreeShouldChange(true)
     , m_notifyRegion(true)
 {
 }

Modified: trunk/Source/WebCore/html/track/VTTCue.h (166179 => 166180)


--- trunk/Source/WebCore/html/track/VTTCue.h	2014-03-24 17:37:54 UTC (rev 166179)
+++ trunk/Source/WebCore/html/track/VTTCue.h	2014-03-24 17:38:28 UTC (rev 166180)
@@ -201,25 +201,21 @@
 
     WritingDirection m_writingDirection;
     CueAlignment m_cueAlignment;
+#if ENABLE(WEBVTT_REGIONS)
+    String m_regionId;
+#endif
 
     RefPtr<DocumentFragment> m_webVTTNodeTree;
-
-    bool m_snapToLines;
-
     RefPtr<HTMLSpanElement> m_cueBackgroundBox;
-
-    bool m_displayTreeShouldChange;
     RefPtr<VTTCueBox> m_displayTree;
 
     CSSValueID m_displayDirection;
-
     int m_displaySize;
-
     std::pair<float, float> m_displayPosition;
-#if ENABLE(WEBVTT_REGIONS)
-    String m_regionId;
-#endif
-    bool m_notifyRegion;
+
+    bool m_snapToLines : 1;
+    bool m_displayTreeShouldChange : 1;
+    bool m_notifyRegion : 1;
 };
 
 VTTCue* toVTTCue(TextTrackCue*);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to