Reviewers: bobv,

Message:
 From IM:
  Bob: Why can't you put the public method on HistoryImplIE6?
  Joel: Because it's package-protected.
  Bob: Oh I see.


http://gwt-code-reviews.appspot.com/44804/diff/1/3
File user/src/com/google/gwt/user/client/impl/HistoryImplIE6.java
(right):

http://gwt-code-reviews.appspot.com/44804/diff/1/3#newcode28
Line 28: private boolean updateHash = true;
 From Bob: Remove unused field.



Please review this at http://gwt-code-reviews.appspot.com/44804

Affected files:
   M     user/src/com/google/gwt/user/client/impl/HistoryImpl.java
   M     user/src/com/google/gwt/user/client/impl/HistoryImplIE6.java


Index: user/src/com/google/gwt/user/client/impl/HistoryImpl.java
===================================================================
--- user/src/com/google/gwt/user/client/impl/HistoryImpl.java   (revision  
5594)
+++ user/src/com/google/gwt/user/client/impl/HistoryImpl.java   (working copy)
@@ -38,6 +38,18 @@
  public class HistoryImpl implements HasValueChangeHandlers<String>,
      HasHandlers {

+  static boolean updateHashOnIE6 = true;
+
+  /**
+   * Sets whether the IE6 history implementation will update the URL hash  
when
+   * creating a new item. This should be used only for applications with  
large
+   * DOM structures that are suffering from performance problems when  
creating
+   * a new history item on IE6 and 7.
+   */
+  public static void setUpdateHashOnIE6(boolean updateHash) {
+    HistoryImpl.updateHashOnIE6 = updateHash;
+  }
+
    public static native String getToken() /*-{
      return $wnd.__gwt_historyToken || "";
    }-*/;
Index: user/src/com/google/gwt/user/client/impl/HistoryImplIE6.java
===================================================================
--- user/src/com/google/gwt/user/client/impl/HistoryImplIE6.java        
(revision  
5594)
+++ user/src/com/google/gwt/user/client/impl/HistoryImplIE6.java        
(working  
copy)
@@ -25,6 +25,8 @@
   */
  class HistoryImplIE6 extends HistoryImpl {

+  private boolean updateHash = true;
+
    /**
     * Sanitizes an untrusted string to be used in an HTML context. NOTE:  
This
     * method of escaping strings should only be used on Internet Explorer.
@@ -167,7 +169,7 @@
            // if someone entered or linked to a bad url.
             
historyimplr...@com.google.gwt.user.client.impl.historyimplie6::reloadWindow()();
          }
-
+
          var historyToken =  
@com.google.gwt.user.client.impl.HistoryImpl::getToken()();
          if (historyToken && (token != historyToken)) {
             
historyimplr...@com.google.gwt.user.client.impl.historyimplie6::reloadWindow()();
@@ -199,7 +201,13 @@
      Location.reload();
    }

-  private native void updateHash(String token) /*-{
+  private void updateHash(String token) {
+    if (HistoryImpl.updateHashOnIE6) {
+      updateHashInternal(token);
+    }
+  }
+
+  private native void updateHashInternal(String token) /*-{
      $wnd.location.hash =  
th...@com.google.gwt.user.client.impl.historyimpl::encodeFragment(Ljava/lang/String;)(token);
    }-*/;
  }



--~--~---------~--~----~------------~-------~--~----~
http://groups.google.com/group/Google-Web-Toolkit-Contributors
-~----------~----~----~----~------~----~------~--~---

Reply via email to