Revision: 9942
Author: [email protected]
Date: Tue Apr 5 06:00:39 2011
Log: cherry picking r9938 & r9939 for release 2.3m1
http://code.google.com/p/google-web-toolkit/source/detail?r=9942
Deleted:
/releases/2.3/user/src/com/google/gwt/storage/client/StorageImplMozilla.java
Modified:
/releases/2.3/user/src/com/google/gwt/storage/Storage.gwt.xml
/releases/2.3/user/src/com/google/gwt/storage/client/StorageImpl.java
/releases/2.3/user/src/com/google/gwt/storage/client/StorageImplIE8.java
/releases/2.3/user/test/com/google/gwt/user/client/WindowTest.java
=======================================
---
/releases/2.3/user/src/com/google/gwt/storage/client/StorageImplMozilla.java
Mon Mar 7 05:34:43 2011
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Copyright 2011 Google Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"); you may
not
- * use this file except in compliance with the License. You may obtain a
copy of
- * the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
under
- * the License.
- */
-
-package com.google.gwt.storage.client;
-
-
-/**
- * Mozilla-specific implementation of a Storage.
- *
- * <p>
- * Implementation of StorageEvents is incomplete for Mozilla. This class
amends
- * the properties consistently with W3C's StorageEvent.
- * </p>
- */
-class StorageImplMozilla extends StorageImplNonNativeEvents {
- /*
- * Firefox incorrectly handles indices outside the range of
- * 0 to storage.length(). See bugzilla.mozilla.org/show_bug.cgi?id=50924
- */
- @Override
- public native String key(String storage, int index) /*-{
- return (index >= 0 && index < $wnd[storage].length) ?
- $wnd[storage].key(index) : null;
- }-*/;
-}
=======================================
--- /releases/2.3/user/src/com/google/gwt/storage/Storage.gwt.xml Fri Mar
11 09:47:37 2011
+++ /releases/2.3/user/src/com/google/gwt/storage/Storage.gwt.xml Tue Apr
5 06:00:39 2011
@@ -34,16 +34,12 @@
<when-property-is name="storageSupport" value="no" />
</replace-with>
- <replace-with class="com.google.gwt.storage.client.StorageImplMozilla">
- <when-type-is class="com.google.gwt.storage.client.StorageImpl" />
- <when-property-is name="user.agent" value="gecko1_8" />
- </replace-with>
-
<replace-with
class="com.google.gwt.storage.client.StorageImplNonNativeEvents">
<when-type-is class="com.google.gwt.storage.client.StorageImpl" />
<any>
<when-property-is name="user.agent" value="safari" />
<when-property-is name="user.agent" value="ie9" />
+ <when-property-is name="user.agent" value="gecko1_8" />
</any>
</replace-with>
=======================================
--- /releases/2.3/user/src/com/google/gwt/storage/client/StorageImpl.java
Mon Mar 7 05:34:43 2011
+++ /releases/2.3/user/src/com/google/gwt/storage/client/StorageImpl.java
Tue Apr 5 06:00:39 2011
@@ -146,7 +146,13 @@
* Storage - Storage.key(n)</a>
*/
public native String key(String storage, int index) /*-{
- return $wnd[storage].key(index);
+ // few browsers implement retrieval correctly when index is out of
range.
+ // compensate to preserve API expectation. According to W3C Web
Storage spec
+ // <a href="http://www.w3.org/TR/webstorage/#dom-storage-key">
+ // "If n is greater than or equal to the number of key/value pairs in
the
+ // object, then this method must return null."
+ return (index >= 0 && index < $wnd[storage].length) ?
+ $wnd[storage].key(index) : null;
}-*/;
/**
=======================================
---
/releases/2.3/user/src/com/google/gwt/storage/client/StorageImplIE8.java
Mon Mar 7 05:34:43 2011
+++
/releases/2.3/user/src/com/google/gwt/storage/client/StorageImplIE8.java
Tue Apr 5 06:00:39 2011
@@ -24,17 +24,6 @@
* - Introduction to DOM Storage</a>
*/
class StorageImplIE8 extends StorageImplNonNativeEvents {
- /*
- * IE8 will throw "JavaScriptException: (Error): Invalid argument." for
- * indices outside the range of 0 - storage.length(). In this impl
method, we
- * return null instead, in order to match the Storage spec.
- */
- @Override
- public native String key(String storage, int index) /*-{
- return (index >= 0 && index < $wnd[storage].length) ?
- $wnd[storage].key(index) : null;
- }-*/;
-
/*
* IE8 will throw "Class doesn't support Automation" error when comparing
* $wnd["localStorage"] === $wnd["localStorage"]. In this impl method, we
=======================================
--- /releases/2.3/user/test/com/google/gwt/user/client/WindowTest.java Tue
Aug 10 10:18:55 2010
+++ /releases/2.3/user/test/com/google/gwt/user/client/WindowTest.java Tue
Apr 5 06:00:39 2011
@@ -304,11 +304,16 @@
if (Navigator.getUserAgent().toLowerCase().contains("chrome")) {
return;
}
+
+ // FF4 on win can start in 'almost' fullscreen when the window title
bar
+ // is hidden but accounted incorrectly, so, move the window and
resize to
+ // smaller size first, to take it out of 'full screen mode'.
+ Window.moveTo(10,10);
+ Window.resizeTo(700, 500);
// store the original size (to be used in restoreSize)
clientHeight = Window.getClientHeight();
clientWidth = Window.getClientWidth();
-
// IE cannot resize window out of the screen, so we need to move the
// window such that it can be resized to below size.
// We do not have method to return the window coordinates
(screenLeft,
@@ -321,9 +326,11 @@
// sizes as requested.
// If the sizes are too big, for example, height >
screen.availHeight + 40
// on FF, resizeTo silently sets the height to screen.availHeight +
40.
- Window.resizeTo(800, 600);
- extraHeight = 600 - Window.getClientHeight();
- extraWidth = 800 - Window.getClientWidth();
+ // Some test machines are configured at this time as 800x600, reduce
the size
+ // to give some 'buffer'
+ Window.resizeTo(750, 550);
+ extraWidth = 750 - Window.getClientWidth();
+ extraHeight = 550 - Window.getClientHeight();
initialized = true;
restoreSize();
}
@@ -363,13 +370,14 @@
public void execute() {
// Sizes must be appropriate, otherwise browsers may not resize as
// requested. See comments in ResizeHelper.
- int width = 900;
+ int width = 600;
int height = 500;
// ensureInitialized could fail on Chrome
if (!ResizeHelper.resizeTo(width, height)) {
handlerRegistration.removeHandler();
finishTest(); // nothing we can test
}
+
assertEquals(width, Window.getClientWidth() +
ResizeHelper.getExtraWidth());
assertEquals(height, Window.getClientHeight() +
ResizeHelper.getExtraHeight());
// TODO: TestResizeHandler.getWidth() returns 0 -- need to
investigate
@@ -380,7 +388,7 @@
assertEquals(height + 20, Window.getClientHeight() +
ResizeHelper.getExtraHeight());
// assertEquals(resizeHandler.getWidth(), Window.getClientWidth());
// assertEquals(resizeHandler.getHeight(),
Window.getClientHeight());
-
+
// Cleanup the window
handlerRegistration.removeHandler();
ResizeHelper.restoreSize();
--
http://groups.google.com/group/Google-Web-Toolkit-Contributors