Title: [142774] trunk
Revision
142774
Author
[email protected]
Date
2013-02-13 12:34:11 -0800 (Wed, 13 Feb 2013)

Log Message

Clicking outside captions menu should dismiss it
https://bugs.webkit.org/show_bug.cgi?id=109648

Reviewed by Eric Carlson.

Source/WebCore:

Add a virtual override to the platform-specific
defaultEventHandler to intercept any click in the controls,
and hide the captions menu if it is showing.

Test: media/video-controls-captions-trackmenu-hide-on-click.html

* html/shadow/MediaControlsApple.cpp:
(WebCore::MediaControlsApple::defaultEventHandler): Override from MediaControls. Hide
    captions menu if a click event comes in.
* html/shadow/MediaControlsApple.h:

LayoutTests:

New test for captions menu. Skip it everywhere but Mac.

* media/video-controls-captions-trackmenu-hide-on-click.html: Added.
* platform/mac/media/video-controls-captions-trackmenu-hide-on-click-expected.txt: Added.
* platform/chromium/TestExpectations:
* platform/efl/TestExpectations:
* platform/gtk/TestExpectations:
* platform/qt/TestExpectations:
* platform/win/TestExpectations:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (142773 => 142774)


--- trunk/LayoutTests/ChangeLog	2013-02-13 20:32:38 UTC (rev 142773)
+++ trunk/LayoutTests/ChangeLog	2013-02-13 20:34:11 UTC (rev 142774)
@@ -1,3 +1,20 @@
+2013-02-12  Dean Jackson  <[email protected]>
+
+        Clicking outside captions menu should dismiss it
+        https://bugs.webkit.org/show_bug.cgi?id=109648
+
+        Reviewed by Eric Carlson.
+
+        New test for captions menu. Skip it everywhere but Mac.
+
+        * media/video-controls-captions-trackmenu-hide-on-click.html: Added.
+        * platform/mac/media/video-controls-captions-trackmenu-hide-on-click-expected.txt: Added.
+        * platform/chromium/TestExpectations:
+        * platform/efl/TestExpectations:
+        * platform/gtk/TestExpectations:
+        * platform/qt/TestExpectations:
+        * platform/win/TestExpectations:
+
 2013-02-13  Morten Stenshorne  <[email protected]>
 
         WebKit ignores column-rules wider than column-gap

Modified: trunk/LayoutTests/platform/chromium/TestExpectations (142773 => 142774)


--- trunk/LayoutTests/platform/chromium/TestExpectations	2013-02-13 20:32:38 UTC (rev 142773)
+++ trunk/LayoutTests/platform/chromium/TestExpectations	2013-02-13 20:34:11 UTC (rev 142774)
@@ -3603,6 +3603,7 @@
 webkit.org/b/101670 media/video-controls-captions-trackmenu.html [ Skip ]
 webkit.org/b/101670 media/video-controls-captions-trackmenu-sorted.html [ Skip ]
 webkit.org/b/101670 media/video-controls-captions-trackmenu-localized.html [ Skip ]
+webkit.org/b/101670 media/video-controls-captions-trackmenu-hide-on-click.html [ Skip ]
 webkit.org/b/101670 media/track/track-user-preferences.html [ Skip ]
 
 webkit.org/b/92835 [ Android Mac Win Debug ] svg/as-background-image/svg-as-background-5.html [ Pass Slow ]

Modified: trunk/LayoutTests/platform/efl/TestExpectations (142773 => 142774)


--- trunk/LayoutTests/platform/efl/TestExpectations	2013-02-13 20:32:38 UTC (rev 142773)
+++ trunk/LayoutTests/platform/efl/TestExpectations	2013-02-13 20:34:11 UTC (rev 142774)
@@ -1720,6 +1720,7 @@
 webkit.org/b/101670 media/video-controls-captions-trackmenu.html [ Skip ]
 webkit.org/b/101670 media/video-controls-captions-trackmenu-sorted.html [ Skip ]
 webkit.org/b/101670 media/video-controls-captions-trackmenu-localized.html [ Skip ]
+webkit.org/b/101670 media/video-controls-captions-trackmenu-hide-on-click.html [ Skip ]
 webkit.org/b/101670 media/track/track-user-preferences.html [ Skip ]
 
 # Fails until we enable the Resource Timing API.

Modified: trunk/LayoutTests/platform/gtk/TestExpectations (142773 => 142774)


--- trunk/LayoutTests/platform/gtk/TestExpectations	2013-02-13 20:32:38 UTC (rev 142773)
+++ trunk/LayoutTests/platform/gtk/TestExpectations	2013-02-13 20:34:11 UTC (rev 142774)
@@ -754,6 +754,7 @@
 webkit.org/b/101670 media/video-controls-captions-trackmenu.html [ Skip ]
 webkit.org/b/101670 media/video-controls-captions-trackmenu-sorted.html [ Skip ]
 webkit.org/b/101670 media/video-controls-captions-trackmenu-localized.html [ Skip ]
+webkit.org/b/101670 media/video-controls-captions-trackmenu-hide-on-click.html [ Skip ]
 webkit.org/b/101670 media/track/track-user-preferences.html [ Skip ]
 
 webkit.org/b/107194 storage/indexeddb/database-quota.html [ Timeout ]

Modified: trunk/LayoutTests/platform/qt/TestExpectations (142773 => 142774)


--- trunk/LayoutTests/platform/qt/TestExpectations	2013-02-13 20:32:38 UTC (rev 142773)
+++ trunk/LayoutTests/platform/qt/TestExpectations	2013-02-13 20:34:11 UTC (rev 142774)
@@ -2536,6 +2536,7 @@
 webkit.org/b/101670 media/video-controls-captions-trackmenu.html [ Skip ]
 webkit.org/b/101670 media/video-controls-captions-trackmenu-sorted.html [ Skip ]
 webkit.org/b/101670 media/video-controls-captions-trackmenu-localized.html [ Skip ]
+webkit.org/b/101670 media/video-controls-captions-trackmenu-hide-on-click.html [ Skip ]
 webkit.org/b/101670 media/track/track-user-preferences.html [ Skip ]
 
 # New, but failing test

Modified: trunk/LayoutTests/platform/win/TestExpectations (142773 => 142774)


--- trunk/LayoutTests/platform/win/TestExpectations	2013-02-13 20:32:38 UTC (rev 142773)
+++ trunk/LayoutTests/platform/win/TestExpectations	2013-02-13 20:34:11 UTC (rev 142774)
@@ -2528,6 +2528,7 @@
 media/video-controls-captions-trackmenu-localized.html
 media/video-controls-captions-trackmenu-sorted.html
 media/video-controls-captions-trackmenu.html
+media/video-controls-captions-trackmenu-hide-on-click.html
 media/video-controls-visible-exiting-fullscreen.html
 
 # Fails on JSC platforms due to gc timing issues

Modified: trunk/Source/WebCore/ChangeLog (142773 => 142774)


--- trunk/Source/WebCore/ChangeLog	2013-02-13 20:32:38 UTC (rev 142773)
+++ trunk/Source/WebCore/ChangeLog	2013-02-13 20:34:11 UTC (rev 142774)
@@ -1,3 +1,21 @@
+2013-02-12  Dean Jackson  <[email protected]>
+
+        Clicking outside captions menu should dismiss it
+        https://bugs.webkit.org/show_bug.cgi?id=109648
+
+        Reviewed by Eric Carlson.
+
+        Add a virtual override to the platform-specific
+        defaultEventHandler to intercept any click in the controls,
+        and hide the captions menu if it is showing.
+
+        Test: media/video-controls-captions-trackmenu-hide-on-click.html
+
+        * html/shadow/MediaControlsApple.cpp:
+        (WebCore::MediaControlsApple::defaultEventHandler): Override from MediaControls. Hide
+            captions menu if a click event comes in.
+        * html/shadow/MediaControlsApple.h:
+
 2013-02-13  Tommy Widenflycht  <[email protected]>
 
         MediaStream API: Use the source id when creating new tracks

Modified: trunk/Source/WebCore/html/shadow/MediaControlsApple.cpp (142773 => 142774)


--- trunk/Source/WebCore/html/shadow/MediaControlsApple.cpp	2013-02-13 20:32:38 UTC (rev 142773)
+++ trunk/Source/WebCore/html/shadow/MediaControlsApple.cpp	2013-02-13 20:34:11 UTC (rev 142774)
@@ -274,6 +274,18 @@
         m_closedCaptionsContainer->setMediaController(controller);
 }
 
+void MediaControlsApple::defaultEventHandler(Event* event)
+{
+    if (event->type() == eventNames().clickEvent) {
+        if (m_closedCaptionsContainer && m_closedCaptionsContainer->isShowing()) {
+            m_closedCaptionsContainer->hide();
+            event->setDefaultHandled();
+        }
+    }
+
+    MediaControls::defaultEventHandler(event);
+}
+
 void MediaControlsApple::hide()
 {
     MediaControls::hide();

Modified: trunk/Source/WebCore/html/shadow/MediaControlsApple.h (142773 => 142774)


--- trunk/Source/WebCore/html/shadow/MediaControlsApple.h	2013-02-13 20:32:38 UTC (rev 142773)
+++ trunk/Source/WebCore/html/shadow/MediaControlsApple.h	2013-02-13 20:34:11 UTC (rev 142774)
@@ -65,6 +65,8 @@
 private:
     MediaControlsApple(Document*);
 
+    virtual void defaultEventHandler(Event*) OVERRIDE;
+
     MediaControlRewindButtonElement* m_rewindButton;
     MediaControlReturnToRealtimeButtonElement* m_returnToRealTimeButton;
     MediaControlStatusDisplayElement* m_statusDisplay;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to