Revision: 6331
Author: jlaba...@google.com
Date: Thu Oct  8 14:22:37 2009
Log: Adding a semicolon to the javascript reference in empty Anchor widgets  
to fix a FF2 bug where Anchor widgets open the error console.

Patch by: jlabanca
Review by: rjrjr


http://code.google.com/p/google-web-toolkit/source/detail?r=6331

Modified:
  /trunk/user/src/com/google/gwt/user/client/ui/Anchor.java
  /trunk/user/test/com/google/gwt/user/client/ui/AnchorTest.java

=======================================
--- /trunk/user/src/com/google/gwt/user/client/ui/Anchor.java   Fri May 15  
13:39:00 2009
+++ /trunk/user/src/com/google/gwt/user/client/ui/Anchor.java   Thu Oct  8  
14:22:37 2009
@@ -74,26 +74,26 @@
    /**
     * Creates an anchor for scripting.
     *
-   * The anchor's href is set to <code>javascript:</code>, based on the
+   * The anchor's href is set to <code>javascript:;</code>, based on the
     * expectation that listeners will be added to the anchor.
     *
     * @param text the anchor's text
     */
    public Anchor(String text) {
-    this(text, "javascript:");
+    this(text, "javascript:;");
    }

    /**
     * Creates an anchor for scripting.
     *
-   * The anchor's href is set to <code>javascript:</code>, based on the
+   * The anchor's href is set to <code>javascript:;</code>, based on the
     * expectation that listeners will be added to the anchor.
     *
     * @param text the anchor's text
     * @param asHtml <code>true</code> to treat the specified text as html
     */
    public Anchor(String text, boolean asHtml) {
-    this(text, asHtml, "javascript:");
+    this(text, asHtml, "javascript:;");
    }

    /**
=======================================
--- /trunk/user/test/com/google/gwt/user/client/ui/AnchorTest.java      Thu Jul 
 
30 13:47:31 2009
+++ /trunk/user/test/com/google/gwt/user/client/ui/AnchorTest.java      Thu Oct 
  
8 14:22:37 2009
@@ -124,7 +124,7 @@
      assertEquals(1, DOM.getChildCount(p.getElement()));
      assertEquals("A", DOM.getChild(p.getElement(), 0).getTagName());
      assertEquals("Foo", anchor.getText());
-    assertAttributeHasValue("javascript:", anchor.getElement(), "href");
+    assertAttributeHasValue("javascript:;", anchor.getElement(), "href");

      for (String attribute : new String[]  
{"name", "id", "rel", "ref", "target"}) {
        assertAttributeNotPresent(attribute, anchor.getElement());
@@ -140,7 +140,7 @@
      assertEquals(1, DOM.getChildCount(p.getElement()));
      assertEquals("A", DOM.getChild(p.getElement(), 0).getTagName());
      assertEquals("SPAN", DOM.getChild(anchor.getElement(),  
0).getTagName());
-    assertAttributeHasValue("javascript:", anchor.getElement(), "href");
+    assertAttributeHasValue("javascript:;", anchor.getElement(), "href");

      for (String attribute : new String[]  
{"name", "id", "rel", "ref", "target"}) {
        assertAttributeNotPresent(attribute, anchor.getElement());

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

Reply via email to