Title: [132553] trunk
Revision
132553
Author
[email protected]
Date
2012-10-25 18:55:41 -0700 (Thu, 25 Oct 2012)

Log Message

Hide popup while transitioning from the suggestion picker to the calendar picker
https://bugs.webkit.org/show_bug.cgi?id=99537

Reviewed by Kent Tamura.

Source/WebCore:

Right now you can see a squished calendar picker while transitioning
from suggestion picker from calendar picker. This change will hide the
popup before opening the calendar picker.

No new tests.

* Resources/pagepopups/pickerCommon.js: Hiding the window will also trigger a resize event so I created a separate event, didOpenPicker.
(hideWindow): Resize the window to 1x1 because we can't resize to 0x0.
* Resources/pagepopups/suggestionPicker.js:
(SuggestionPicker.prototype.selectEntry): Hide the window first and then open the calendar picker.

LayoutTests:

* fast/forms/resources/picker-common.js:
(popupOpenCallbackWrapper): Use didOpenPicker event.

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (132552 => 132553)


--- trunk/LayoutTests/ChangeLog	2012-10-26 01:51:01 UTC (rev 132552)
+++ trunk/LayoutTests/ChangeLog	2012-10-26 01:55:41 UTC (rev 132553)
@@ -1,3 +1,13 @@
+2012-10-25  Keishi Hattori  <[email protected]>
+
+        Hide popup while transitioning from the suggestion picker to the calendar picker
+        https://bugs.webkit.org/show_bug.cgi?id=99537
+
+        Reviewed by Kent Tamura.
+
+        * fast/forms/resources/picker-common.js:
+        (popupOpenCallbackWrapper): Use didOpenPicker event.
+
 2012-10-25  Sheriff Bot  <[email protected]>
 
         Unreviewed, rolling out r132514.

Modified: trunk/LayoutTests/fast/forms/resources/picker-common.js (132552 => 132553)


--- trunk/LayoutTests/fast/forms/resources/picker-common.js	2012-10-26 01:51:01 UTC (rev 132552)
+++ trunk/LayoutTests/fast/forms/resources/picker-common.js	2012-10-26 01:55:41 UTC (rev 132553)
@@ -21,7 +21,7 @@
 }
 
 function popupOpenCallbackWrapper() {
-    popupWindow.removeEventListener("resize", popupOpenCallbackWrapper);
+    popupWindow.removeEventListener("didOpenPicker", popupOpenCallbackWrapper);
     popupOpenCallback();
 }
 

Modified: trunk/Source/WebCore/ChangeLog (132552 => 132553)


--- trunk/Source/WebCore/ChangeLog	2012-10-26 01:51:01 UTC (rev 132552)
+++ trunk/Source/WebCore/ChangeLog	2012-10-26 01:55:41 UTC (rev 132553)
@@ -1,3 +1,21 @@
+2012-10-25  Keishi Hattori  <[email protected]>
+
+        Hide popup while transitioning from the suggestion picker to the calendar picker
+        https://bugs.webkit.org/show_bug.cgi?id=99537
+
+        Reviewed by Kent Tamura.
+
+        Right now you can see a squished calendar picker while transitioning
+        from suggestion picker from calendar picker. This change will hide the
+        popup before opening the calendar picker.
+
+        No new tests.
+
+        * Resources/pagepopups/pickerCommon.js: Hiding the window will also trigger a resize event so I created a separate event, didOpenPicker.
+        (hideWindow): Resize the window to 1x1 because we can't resize to 0x0.
+        * Resources/pagepopups/suggestionPicker.js:
+        (SuggestionPicker.prototype.selectEntry): Hide the window first and then open the calendar picker.
+
 2012-10-25  Anders Carlsson  <[email protected]>
 
         Fix build.

Modified: trunk/Source/WebCore/Resources/pagepopups/pickerCommon.js (132552 => 132553)


--- trunk/Source/WebCore/Resources/pagepopups/pickerCommon.js	2012-10-26 01:51:01 UTC (rev 132552)
+++ trunk/Source/WebCore/Resources/pagepopups/pickerCommon.js	2012-10-26 01:55:41 UTC (rev 132553)
@@ -163,6 +163,16 @@
     }
 }
 
+function hideWindow() {
+    setWindowRect(new Rect(0, 0, 1, 1));
+}
+
+window.addEventListener("resize", function() {
+    if (window.innerWidth === 1 && window.innerHeight === 1)
+        return;
+    window.dispatchEvent(new CustomEvent("didOpenPicker"));
+}, false);
+
 /**
  * @return {!number}
  */

Modified: trunk/Source/WebCore/Resources/pagepopups/suggestionPicker.js (132552 => 132553)


--- trunk/Source/WebCore/Resources/pagepopups/suggestionPicker.js	2012-10-26 01:51:01 UTC (rev 132552)
+++ trunk/Source/WebCore/Resources/pagepopups/suggestionPicker.js	2012-10-26 01:55:41 UTC (rev 132553)
@@ -190,7 +190,8 @@
     if (typeof entry.dataset.value !== "undefined") {
         this.submitValue(entry.dataset.value);
     } else if (entry.dataset.action ="" SuggestionPicker.ActionNames.OpenCalendarPicker) {
-        openCalendarPicker();
+        hideWindow();
+        setTimeout(openCalendarPicker, 0);
     }
 };
 
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to