Title: [125607] branches/chromium/1180
Revision
125607
Author
infe...@chromium.org
Date
2012-08-14 14:33:21 -0700 (Tue, 14 Aug 2012)

Log Message

Merge 123822 - [Chromium] Regression: Global-buffer-overflow in WebCore::mediaControlElementType
BUG=132270
Review URL: https://chromiumcodereview.appspot.com/10827333

Modified Paths

Added Paths

Diff

Copied: branches/chromium/1180/LayoutTests/accessibility/media-controls-expected.txt (from rev 123822, trunk/LayoutTests/accessibility/media-controls-expected.txt) (0 => 125607)


--- branches/chromium/1180/LayoutTests/accessibility/media-controls-expected.txt	                        (rev 0)
+++ branches/chromium/1180/LayoutTests/accessibility/media-controls-expected.txt	2012-08-14 21:33:21 UTC (rev 125607)
@@ -0,0 +1,9 @@
+This tests that the script creation of an audio element with controls works when accessibility is enabled and does not crash.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Copied: branches/chromium/1180/LayoutTests/accessibility/media-controls.html (from rev 123822, trunk/LayoutTests/accessibility/media-controls.html) (0 => 125607)


--- branches/chromium/1180/LayoutTests/accessibility/media-controls.html	                        (rev 0)
+++ branches/chromium/1180/LayoutTests/accessibility/media-controls.html	2012-08-14 21:33:21 UTC (rev 125607)
@@ -0,0 +1,19 @@
+<!DOCTYPE HTML>
+<html>
+  <body>
+    <script src=""
+    <script>
+      description("This tests that the script creation of an audio element with controls works when accessibility is enabled and does not crash.");
+
+      if (window.testRunner && window.accessibilityController) {
+          function createAudio() {
+              var audio = document.createElement('audio');
+              audio.setAttribute('controls', 'controls');
+              document.documentElement.appendChild(audio);
+          }
+          window._onload_ = createAudio;
+      }
+    </script>
+    <script src=""
+  </body>
+</html>

Modified: branches/chromium/1180/Source/WebCore/html/shadow/MediaControlRootElementChromium.cpp (125606 => 125607)


--- branches/chromium/1180/Source/WebCore/html/shadow/MediaControlRootElementChromium.cpp	2012-08-14 21:23:58 UTC (rev 125606)
+++ branches/chromium/1180/Source/WebCore/html/shadow/MediaControlRootElementChromium.cpp	2012-08-14 21:33:21 UTC (rev 125607)
@@ -49,8 +49,7 @@
 static const double timeWithoutMouseMovementBeforeHidingControls = 2;
 
 MediaControlChromiumEnclosureElement::MediaControlChromiumEnclosureElement(Document* document)
-    : HTMLDivElement(HTMLNames::divTag, document->document())
-    , m_mediaController(0)
+    : MediaControlElement(document)
 {
 }
 
@@ -59,6 +58,13 @@
     return adoptRef(new MediaControlChromiumEnclosureElement(document));
 }
 
+MediaControlElementType MediaControlChromiumEnclosureElement::displayType() const
+{
+    // Mapping onto same MediaControlElementType as panel element, since it has similar properties.
+    return MediaControlsPanel;
+}
+
+
 const AtomicString& MediaControlChromiumEnclosureElement::shadowPseudoId() const
 {
     DEFINE_STATIC_LOCAL(AtomicString, id, ("-webkit-media-controls-enclosure"));

Modified: branches/chromium/1180/Source/WebCore/html/shadow/MediaControlRootElementChromium.h (125606 => 125607)


--- branches/chromium/1180/Source/WebCore/html/shadow/MediaControlRootElementChromium.h	2012-08-14 21:23:58 UTC (rev 125606)
+++ branches/chromium/1180/Source/WebCore/html/shadow/MediaControlRootElementChromium.h	2012-08-14 21:33:21 UTC (rev 125607)
@@ -29,6 +29,7 @@
 
 #if ENABLE(VIDEO)
 
+#include "MediaControlElements.h"
 #include "MediaControls.h"
 #include <wtf/RefPtr.h>
 
@@ -61,22 +62,15 @@
 class MediaControlTextTrackDisplayElement;
 #endif
 
-class MediaControlChromiumEnclosureElement : public HTMLDivElement {
+class MediaControlChromiumEnclosureElement : public MediaControlElement {
 public:
     static PassRefPtr<MediaControlChromiumEnclosureElement> create(Document*);
 
-    virtual const AtomicString& shadowPseudoId() const;
-
-    void setMediaController(MediaControllerInterface* controller) { m_mediaController = controller; }
-    MediaControllerInterface* mediaController() const { return m_mediaController; }
-
-protected:
-    MediaControlChromiumEnclosureElement(Document*);
-
 private:
-    virtual bool isMediaControlElement() const { return true; }
+    explicit MediaControlChromiumEnclosureElement(Document*);
 
-    MediaControllerInterface* m_mediaController;
+    virtual MediaControlElementType displayType() const;
+    virtual const AtomicString& shadowPseudoId() const;
 };
 
 class MediaControlRootElementChromium : public MediaControls {
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to