OSDN Git Service

A WAR to enable the slider touch event on youtube.com
authorTeng-Hui Zhu <ztenghui@google.com>
Wed, 23 Nov 2011 01:27:11 +0000 (17:27 -0800)
committerTeng-Hui Zhu <ztenghui@google.com>
Wed, 23 Nov 2011 01:27:11 +0000 (17:27 -0800)
bug:5520141
Change-Id: Ib346c42037f68b5e8303f0c61196fb28e698f7c9

Source/WebCore/rendering/RenderBox.cpp

index 80d5699..fb1dd2c 100644 (file)
@@ -1562,6 +1562,13 @@ void RenderBox::computeLogicalWidth()
     // https://bugs.webkit.org/show_bug.cgi?id=46418
     if (hasOverrideSize() &&  parent()->style()->boxOrient() == HORIZONTAL
             && parent()->isFlexibleBox() && parent()->isFlexingChildren()) {
+#if PLATFORM(ANDROID)
+        // Strangely, the slider is get overrided as width 0 on youtube.com
+        // The wrong width will cause the touch hit test for the slider failed.
+        // This WAR should be safe since it is only targeted to slider.
+        // TODO: root cause this and see if any webkit update fix this.
+        if (!(isSlider() &&  overrideSize() == 0))
+#endif
         setLogicalWidth(overrideSize());
         return;
     }