Rename IdReference to Id type and set as a parameter the referenced element.
Regenerated aria/client code and fix users' code.

Review at http://gwt-code-reviews.appspot.com/1824803

Review by: skybrian@google.com

git-svn-id: https://google-web-toolkit.googlecode.com/svn/trunk@11262 8db76d5a-ed1c-0410-87a9-c151d255dfc7
diff --git a/user/src/com/google/gwt/aria/client/ComboboxRoleImpl.java b/user/src/com/google/gwt/aria/client/ComboboxRoleImpl.java
index b1e61da..4152085 100644
--- a/user/src/com/google/gwt/aria/client/ComboboxRoleImpl.java
+++ b/user/src/com/google/gwt/aria/client/ComboboxRoleImpl.java
@@ -68,7 +68,7 @@
   }
 
   @Override
-  public void setAriaActivedescendantProperty(Element element, IdReference value) {
+  public void setAriaActivedescendantProperty(Element element, Id value) {
     Property.ACTIVEDESCENDANT.set(element, value);
   }
 
diff --git a/user/src/com/google/gwt/aria/client/CompositeRole.java b/user/src/com/google/gwt/aria/client/CompositeRole.java
index 3b853ab..8b5cab9 100644
--- a/user/src/com/google/gwt/aria/client/CompositeRole.java
+++ b/user/src/com/google/gwt/aria/client/CompositeRole.java
@@ -31,5 +31,5 @@
 
   void removeAriaActivedescendantProperty(Element element);
 
-  void setAriaActivedescendantProperty(Element element, IdReference value);
+  void setAriaActivedescendantProperty(Element element, Id value);
 }
diff --git a/user/src/com/google/gwt/aria/client/GridRoleImpl.java b/user/src/com/google/gwt/aria/client/GridRoleImpl.java
index 2e91f01..8d2c7f6 100644
--- a/user/src/com/google/gwt/aria/client/GridRoleImpl.java
+++ b/user/src/com/google/gwt/aria/client/GridRoleImpl.java
@@ -78,7 +78,7 @@
   }
 
   @Override
-  public void setAriaActivedescendantProperty(Element element, IdReference value) {
+  public void setAriaActivedescendantProperty(Element element, Id value) {
     Property.ACTIVEDESCENDANT.set(element, value);
   }
 
diff --git a/user/src/com/google/gwt/aria/client/GroupRole.java b/user/src/com/google/gwt/aria/client/GroupRole.java
index 9507677..6a37649 100644
--- a/user/src/com/google/gwt/aria/client/GroupRole.java
+++ b/user/src/com/google/gwt/aria/client/GroupRole.java
@@ -31,5 +31,5 @@
 
   void removeAriaActivedescendantProperty(Element element);
 
-  void setAriaActivedescendantProperty(Element element, IdReference value);
+  void setAriaActivedescendantProperty(Element element, Id value);
 }
diff --git a/user/src/com/google/gwt/aria/client/GroupRoleImpl.java b/user/src/com/google/gwt/aria/client/GroupRoleImpl.java
index b6b4f2f..df72646 100644
--- a/user/src/com/google/gwt/aria/client/GroupRoleImpl.java
+++ b/user/src/com/google/gwt/aria/client/GroupRoleImpl.java
@@ -48,7 +48,7 @@
   }
 
   @Override
-  public void setAriaActivedescendantProperty(Element element, IdReference value) {
+  public void setAriaActivedescendantProperty(Element element, Id value) {
     Property.ACTIVEDESCENDANT.set(element, value);
   }
 
diff --git a/user/src/com/google/gwt/aria/client/Id.java b/user/src/com/google/gwt/aria/client/Id.java
new file mode 100644
index 0000000..e15580c
--- /dev/null
+++ b/user/src/com/google/gwt/aria/client/Id.java
@@ -0,0 +1,86 @@
+/*
+ * Copyright 2012 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.aria.client;
+/////////////////////////////////////////////////////////
+// This is auto-generated code.  Do not manually edit! //
+/////////////////////////////////////////////////////////
+
+import com.google.gwt.dom.client.Element;
+import com.google.gwt.user.client.ui.Widget;
+
+/**
+ * Id reference attribute type
+ */
+public class Id implements AriaAttributeType {
+  /**
+   * Creates an Id instance for the {@code element} by getting
+   * the element 'id' attribute.
+   *
+   * @param element A DOM element which should have a
+   *        non empty, unique 'id' attribute set.
+   */
+  public static Id of(Element element) {
+    return new Id(element);
+  }
+
+  /**
+   * Creates an Id instance from the {@code elementId}.
+   *
+   * @param elementId A string identifier that should correspond
+   *        to the 'id' attribute value of a DOM element.
+   */
+  public static Id of(String elementId) {
+    return new Id(elementId);
+  }
+
+  /**
+   * Creates an Id instance for the {@code element} by getting
+   * the element 'id' attribute.
+   *
+   * @param widget An widget associated with a DOM element which should have a
+   *        non empty, unique 'id' attribute set.
+   */
+  public static Id of(Widget widget) {
+    assert widget != null : "Widget cannot be null";
+    return new Id(widget.getElement());
+  }
+
+  private String id;
+
+  /**
+   * An instance of {@link Id} is created.
+   *
+   * @param element Element with a unique id value set
+   */
+  private Id(Element element) {
+    assert element != null : "Element cannot be null";
+    init(element.getId());
+  }
+
+  private Id(String elementId) {
+    init(elementId);
+  }
+
+  @Override
+  public String getAriaValue() {
+    return id;
+  }
+
+  private void init(String elementId) {
+    assert elementId != null || elementId.equals("") :
+      "Invalid elementId: cannot be null or empty.";
+    this.id = elementId;
+  }
+}
diff --git a/user/src/com/google/gwt/aria/client/IdReference.java b/user/src/com/google/gwt/aria/client/IdReference.java
deleted file mode 100644
index 311c731..0000000
--- a/user/src/com/google/gwt/aria/client/IdReference.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Copyright 2012 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.aria.client;
-
-/////////////////////////////////////////////////////////
-// This is auto-generated code.  Do not manually edit! //
-/////////////////////////////////////////////////////////
-
-/**
- * Id reference attribute type
- */
-public class IdReference implements AriaAttributeType {
-  public static IdReference of(String value) {
-    return new IdReference(value);
-  }
-
-  private final String id;
-
-  /**
-   * An instance of {@link IdReference} is created.
-   *
-   * @param value String id value
-   */
-  private IdReference(String value) {
-    this.id = value;
-  }
-
-  @Override
-  public String getAriaValue() {
-    return id;
-  }
-}
diff --git a/user/src/com/google/gwt/aria/client/ListboxRoleImpl.java b/user/src/com/google/gwt/aria/client/ListboxRoleImpl.java
index f1f339f..6583a16 100644
--- a/user/src/com/google/gwt/aria/client/ListboxRoleImpl.java
+++ b/user/src/com/google/gwt/aria/client/ListboxRoleImpl.java
@@ -68,7 +68,7 @@
   }
 
   @Override
-  public void setAriaActivedescendantProperty(Element element, IdReference value) {
+  public void setAriaActivedescendantProperty(Element element, Id value) {
     Property.ACTIVEDESCENDANT.set(element, value);
   }
 
diff --git a/user/src/com/google/gwt/aria/client/MenuRoleImpl.java b/user/src/com/google/gwt/aria/client/MenuRoleImpl.java
index 2de8486..12a7d76 100644
--- a/user/src/com/google/gwt/aria/client/MenuRoleImpl.java
+++ b/user/src/com/google/gwt/aria/client/MenuRoleImpl.java
@@ -48,7 +48,7 @@
   }
 
   @Override
-  public void setAriaActivedescendantProperty(Element element, IdReference value) {
+  public void setAriaActivedescendantProperty(Element element, Id value) {
     Property.ACTIVEDESCENDANT.set(element, value);
   }
 
diff --git a/user/src/com/google/gwt/aria/client/MenubarRoleImpl.java b/user/src/com/google/gwt/aria/client/MenubarRoleImpl.java
index 28b8f78..c41a270 100644
--- a/user/src/com/google/gwt/aria/client/MenubarRoleImpl.java
+++ b/user/src/com/google/gwt/aria/client/MenubarRoleImpl.java
@@ -48,7 +48,7 @@
   }
 
   @Override
-  public void setAriaActivedescendantProperty(Element element, IdReference value) {
+  public void setAriaActivedescendantProperty(Element element, Id value) {
     Property.ACTIVEDESCENDANT.set(element, value);
   }
 
diff --git a/user/src/com/google/gwt/aria/client/Property.java b/user/src/com/google/gwt/aria/client/Property.java
index 47b5ce2..5da9e17 100644
--- a/user/src/com/google/gwt/aria/client/Property.java
+++ b/user/src/com/google/gwt/aria/client/Property.java
@@ -41,8 +41,8 @@
  * </p>
  */
 public final class Property {
-  public static final Attribute<IdReference> ACTIVEDESCENDANT =
-      new AriaValueAttribute<IdReference>("aria-activedescendant", "");
+  public static final Attribute<Id> ACTIVEDESCENDANT =
+      new AriaValueAttribute<Id>("aria-activedescendant", "");
 
   public static final Attribute<Boolean> ATOMIC =
       new PrimitiveValueAttribute<Boolean>("aria-atomic", "false");
@@ -50,17 +50,17 @@
   public static final Attribute<AutocompleteValue> AUTOCOMPLETE =
       new AriaValueAttribute<AutocompleteValue>("aria-autocomplete", "none");
 
-  public static final Attribute<IdReference> CONTROLS =
-      new AriaValueAttribute<IdReference>("aria-controls", "");
+  public static final Attribute<Id> CONTROLS =
+      new AriaValueAttribute<Id>("aria-controls", "");
 
-  public static final Attribute<IdReference> DESCRIBEDBY =
-      new AriaValueAttribute<IdReference>("aria-describedby", "");
+  public static final Attribute<Id> DESCRIBEDBY =
+      new AriaValueAttribute<Id>("aria-describedby", "");
 
   public static final Attribute<DropeffectValue> DROPEFFECT =
       new AriaValueAttribute<DropeffectValue>("aria-dropeffect", "none");
 
-  public static final Attribute<IdReference> FLOWTO =
-      new AriaValueAttribute<IdReference>("aria-flowto", "");
+  public static final Attribute<Id> FLOWTO =
+      new AriaValueAttribute<Id>("aria-flowto", "");
 
   public static final Attribute<Boolean> HASPOPUP =
       new PrimitiveValueAttribute<Boolean>("aria-haspopup", "false");
@@ -68,8 +68,8 @@
   public static final Attribute<String> LABEL =
       new PrimitiveValueAttribute<String>("aria-label", "");
 
-  public static final Attribute<IdReference> LABELLEDBY =
-      new AriaValueAttribute<IdReference>("aria-labelledby", "");
+  public static final Attribute<Id> LABELLEDBY =
+      new AriaValueAttribute<Id>("aria-labelledby", "");
 
   public static final Attribute<Integer> LEVEL =
       new PrimitiveValueAttribute<Integer>("aria-level", "");
@@ -86,8 +86,8 @@
   public static final Attribute<OrientationValue> ORIENTATION =
       new AriaValueAttribute<OrientationValue>("aria-orientation", "vertical");
 
-  public static final Attribute<IdReference> OWNS =
-      new AriaValueAttribute<IdReference>("aria-owns", "");
+  public static final Attribute<Id> OWNS =
+      new AriaValueAttribute<Id>("aria-owns", "");
 
   public static final Attribute<Integer> POSINSET =
       new PrimitiveValueAttribute<Integer>("aria-posinset", "");
diff --git a/user/src/com/google/gwt/aria/client/RadiogroupRoleImpl.java b/user/src/com/google/gwt/aria/client/RadiogroupRoleImpl.java
index 163b617..f1c4cb5 100644
--- a/user/src/com/google/gwt/aria/client/RadiogroupRoleImpl.java
+++ b/user/src/com/google/gwt/aria/client/RadiogroupRoleImpl.java
@@ -58,7 +58,7 @@
   }
 
   @Override
-  public void setAriaActivedescendantProperty(Element element, IdReference value) {
+  public void setAriaActivedescendantProperty(Element element, Id value) {
     Property.ACTIVEDESCENDANT.set(element, value);
   }
 
diff --git a/user/src/com/google/gwt/aria/client/Role.java b/user/src/com/google/gwt/aria/client/Role.java
index bd05075..f1a67d8 100644
--- a/user/src/com/google/gwt/aria/client/Role.java
+++ b/user/src/com/google/gwt/aria/client/Role.java
@@ -113,15 +113,15 @@
 
   void setAriaBusyState(Element element, boolean value);
 
-  void setAriaControlsProperty(Element element, IdReference... value);
+  void setAriaControlsProperty(Element element, Id... value);
 
-  void setAriaDescribedbyProperty(Element element, IdReference... value);
+  void setAriaDescribedbyProperty(Element element, Id... value);
 
   void setAriaDisabledState(Element element, boolean value);
 
   void setAriaDropeffectProperty(Element element, DropeffectValue... value);
 
-  void setAriaFlowtoProperty(Element element, IdReference... value);
+  void setAriaFlowtoProperty(Element element, Id... value);
 
   void setAriaGrabbedState(Element element, GrabbedValue value);
 
@@ -131,13 +131,13 @@
 
   void setAriaInvalidState(Element element, InvalidValue value);
 
-  void setAriaLabelledbyProperty(Element element, IdReference... value);
+  void setAriaLabelledbyProperty(Element element, Id... value);
 
   void setAriaLabelProperty(Element element, String value);
 
   void setAriaLiveProperty(Element element, LiveValue value);
 
-  void setAriaOwnsProperty(Element element, IdReference... value);
+  void setAriaOwnsProperty(Element element, Id... value);
 
   void setAriaRelevantProperty(Element element, RelevantValue... value);
 
diff --git a/user/src/com/google/gwt/aria/client/RoleImpl.java b/user/src/com/google/gwt/aria/client/RoleImpl.java
index 669f633..96ed6ad 100644
--- a/user/src/com/google/gwt/aria/client/RoleImpl.java
+++ b/user/src/com/google/gwt/aria/client/RoleImpl.java
@@ -258,12 +258,12 @@
   }
 
   @Override
-  public void setAriaControlsProperty(Element element, IdReference... value) {
+  public void setAriaControlsProperty(Element element, Id... value) {
     Property.CONTROLS.set(element, value);
   }
 
   @Override
-  public void setAriaDescribedbyProperty(Element element, IdReference... value) {
+  public void setAriaDescribedbyProperty(Element element, Id... value) {
     Property.DESCRIBEDBY.set(element, value);
   }
 
@@ -278,7 +278,7 @@
   }
 
   @Override
-  public void setAriaFlowtoProperty(Element element, IdReference... value) {
+  public void setAriaFlowtoProperty(Element element, Id... value) {
     Property.FLOWTO.set(element, value);
   }
 
@@ -303,7 +303,7 @@
   }
 
   @Override
-  public void setAriaLabelledbyProperty(Element element, IdReference... value) {
+  public void setAriaLabelledbyProperty(Element element, Id... value) {
     Property.LABELLEDBY.set(element, value);
   }
 
@@ -318,7 +318,7 @@
   }
 
   @Override
-  public void setAriaOwnsProperty(Element element, IdReference... value) {
+  public void setAriaOwnsProperty(Element element, Id... value) {
     Property.OWNS.set(element, value);
   }
 
diff --git a/user/src/com/google/gwt/aria/client/RowRoleImpl.java b/user/src/com/google/gwt/aria/client/RowRoleImpl.java
index 7d56da5..c42f7e2 100644
--- a/user/src/com/google/gwt/aria/client/RowRoleImpl.java
+++ b/user/src/com/google/gwt/aria/client/RowRoleImpl.java
@@ -68,7 +68,7 @@
   }
 
   @Override
-  public void setAriaActivedescendantProperty(Element element, IdReference value) {
+  public void setAriaActivedescendantProperty(Element element, Id value) {
     Property.ACTIVEDESCENDANT.set(element, value);
   }
 
diff --git a/user/src/com/google/gwt/aria/client/RowgroupRoleImpl.java b/user/src/com/google/gwt/aria/client/RowgroupRoleImpl.java
index 0b191b5..01ebd34 100644
--- a/user/src/com/google/gwt/aria/client/RowgroupRoleImpl.java
+++ b/user/src/com/google/gwt/aria/client/RowgroupRoleImpl.java
@@ -48,7 +48,7 @@
   }
 
   @Override
-  public void setAriaActivedescendantProperty(Element element, IdReference value) {
+  public void setAriaActivedescendantProperty(Element element, Id value) {
     Property.ACTIVEDESCENDANT.set(element, value);
   }
 
diff --git a/user/src/com/google/gwt/aria/client/ScrollbarRoleImpl.java b/user/src/com/google/gwt/aria/client/ScrollbarRoleImpl.java
index b18e79d..0d2e6ae 100644
--- a/user/src/com/google/gwt/aria/client/ScrollbarRoleImpl.java
+++ b/user/src/com/google/gwt/aria/client/ScrollbarRoleImpl.java
@@ -88,7 +88,7 @@
   }
 
   @Override
-  public void setAriaControlsProperty(Element element, IdReference... value) {
+  public void setAriaControlsProperty(Element element, Id... value) {
     Property.CONTROLS.set(element, value);
   }
 
diff --git a/user/src/com/google/gwt/aria/client/TablistRoleImpl.java b/user/src/com/google/gwt/aria/client/TablistRoleImpl.java
index eea6f82..c510af1 100644
--- a/user/src/com/google/gwt/aria/client/TablistRoleImpl.java
+++ b/user/src/com/google/gwt/aria/client/TablistRoleImpl.java
@@ -58,7 +58,7 @@
   }
 
   @Override
-  public void setAriaActivedescendantProperty(Element element, IdReference value) {
+  public void setAriaActivedescendantProperty(Element element, Id value) {
     Property.ACTIVEDESCENDANT.set(element, value);
   }
 
diff --git a/user/src/com/google/gwt/aria/client/TextboxRole.java b/user/src/com/google/gwt/aria/client/TextboxRole.java
index 03f6a37..7c6ea38 100644
--- a/user/src/com/google/gwt/aria/client/TextboxRole.java
+++ b/user/src/com/google/gwt/aria/client/TextboxRole.java
@@ -47,7 +47,7 @@
 
   void removeAriaRequiredProperty(Element element);
 
-  void setAriaActivedescendantProperty(Element element, IdReference value);
+  void setAriaActivedescendantProperty(Element element, Id value);
 
   void setAriaAutocompleteProperty(Element element, AutocompleteValue value);
 
diff --git a/user/src/com/google/gwt/aria/client/TextboxRoleImpl.java b/user/src/com/google/gwt/aria/client/TextboxRoleImpl.java
index bb02892..72dfce0 100644
--- a/user/src/com/google/gwt/aria/client/TextboxRoleImpl.java
+++ b/user/src/com/google/gwt/aria/client/TextboxRoleImpl.java
@@ -78,7 +78,7 @@
   }
 
   @Override
-  public void setAriaActivedescendantProperty(Element element, IdReference value) {
+  public void setAriaActivedescendantProperty(Element element, Id value) {
     Property.ACTIVEDESCENDANT.set(element, value);
   }
 
diff --git a/user/src/com/google/gwt/aria/client/ToolbarRoleImpl.java b/user/src/com/google/gwt/aria/client/ToolbarRoleImpl.java
index 561448f..e58dcb7 100644
--- a/user/src/com/google/gwt/aria/client/ToolbarRoleImpl.java
+++ b/user/src/com/google/gwt/aria/client/ToolbarRoleImpl.java
@@ -48,7 +48,7 @@
   }
 
   @Override
-  public void setAriaActivedescendantProperty(Element element, IdReference value) {
+  public void setAriaActivedescendantProperty(Element element, Id value) {
     Property.ACTIVEDESCENDANT.set(element, value);
   }
 
diff --git a/user/src/com/google/gwt/aria/client/TreeRoleImpl.java b/user/src/com/google/gwt/aria/client/TreeRoleImpl.java
index b22c5b8..4cd7c55 100644
--- a/user/src/com/google/gwt/aria/client/TreeRoleImpl.java
+++ b/user/src/com/google/gwt/aria/client/TreeRoleImpl.java
@@ -68,7 +68,7 @@
   }
 
   @Override
-  public void setAriaActivedescendantProperty(Element element, IdReference value) {
+  public void setAriaActivedescendantProperty(Element element, Id value) {
     Property.ACTIVEDESCENDANT.set(element, value);
   }
 
diff --git a/user/src/com/google/gwt/aria/client/TreegridRoleImpl.java b/user/src/com/google/gwt/aria/client/TreegridRoleImpl.java
index 0bee03c..eb12ce2 100644
--- a/user/src/com/google/gwt/aria/client/TreegridRoleImpl.java
+++ b/user/src/com/google/gwt/aria/client/TreegridRoleImpl.java
@@ -88,7 +88,7 @@
   }
 
   @Override
-  public void setAriaActivedescendantProperty(Element element, IdReference value) {
+  public void setAriaActivedescendantProperty(Element element, Id value) {
     Property.ACTIVEDESCENDANT.set(element, value);
   }
 
diff --git a/user/src/com/google/gwt/user/client/ui/MenuBar.java b/user/src/com/google/gwt/user/client/ui/MenuBar.java
index 949b358..0cb43d4 100644
--- a/user/src/com/google/gwt/user/client/ui/MenuBar.java
+++ b/user/src/com/google/gwt/user/client/ui/MenuBar.java
@@ -15,7 +15,7 @@
  */
 package com.google.gwt.user.client.ui;
 
-import com.google.gwt.aria.client.IdReference;
+import com.google.gwt.aria.client.Id;
 import com.google.gwt.aria.client.Roles;
 import com.google.gwt.core.client.GWT;
 import com.google.gwt.core.client.Scheduler;
@@ -762,7 +762,7 @@
       }
 
       Roles.getMenubarRole().setAriaActivedescendantProperty(getElement(),
-          IdReference.of(DOM.getElementAttribute(item.getElement(), "id")));
+          Id.of(item.getElement()));
     }
 
     selectedItem = item;
diff --git a/user/src/com/google/gwt/user/client/ui/Tree.java b/user/src/com/google/gwt/user/client/ui/Tree.java
index bb95982..a83796c 100644
--- a/user/src/com/google/gwt/user/client/ui/Tree.java
+++ b/user/src/com/google/gwt/user/client/ui/Tree.java
@@ -15,8 +15,8 @@
  */
 package com.google.gwt.user.client.ui;
 
-import com.google.gwt.aria.client.IdReference;
 import com.google.gwt.aria.client.ExpandedValue;
+import com.google.gwt.aria.client.Id;
 import com.google.gwt.aria.client.Roles;
 import com.google.gwt.aria.client.SelectedValue;
 import com.google.gwt.core.client.GWT;
@@ -1428,7 +1428,7 @@
     // Update the 'aria-activedescendant' state for the focusable element to
     // match the id of the currently selected item
 
-    Roles.getTreeRole().setAriaActivedescendantProperty(focusable,
-        IdReference.of(DOM.getElementAttribute(curSelectionContentElem, "id")));
+    Roles.getTreeRole().setAriaActivedescendantProperty(focusable, Id.of(
+        curSelectionContentElem));
   }
 }
diff --git a/user/test/com/google/gwt/aria/client/AttributeTest.java b/user/test/com/google/gwt/aria/client/AttributeTest.java
index 4ab5a8e..94db21a 100644
--- a/user/test/com/google/gwt/aria/client/AttributeTest.java
+++ b/user/test/com/google/gwt/aria/client/AttributeTest.java
@@ -17,6 +17,8 @@
 import com.google.gwt.dom.client.Document;
 import com.google.gwt.dom.client.Element;
 import com.google.gwt.junit.client.GWTTestCase;
+import com.google.gwt.user.client.ui.Button;
+import com.google.gwt.user.client.ui.Label;
 
 /**
  * Tests {@link Attribute} ARIA class
@@ -27,6 +29,7 @@
   private Attribute<Boolean> attribute2;
   private Attribute<String> attribute3;
   private Attribute<RelevantValue> attribute4;
+  private Attribute<Id> attribute5;
 
   public void testSetGetRemove_booleanValue() {
     attribute2.setDefault(div);
@@ -58,6 +61,29 @@
     assertEquals(RelevantValue.REMOVALS.getAriaValue(), attribute4.get(div));
   }
 
+  public void testSetGetRemove_idrefValue() {
+    attribute5.set(div, Id.of("1"), Id.of("2"));
+    assertEquals("1 2", attribute5.get(div));
+    attribute5.remove(div);
+    assertEquals("", attribute5.get(div));
+
+    Element ref1 = Document.get().createDivElement();
+    ref1.setId("ref1");
+    Element ref2 = Document.get().createDivElement();
+    ref2.setId("ref2");
+    attribute5.set(div, Id.of(ref1), Id.of(ref2));
+    assertEquals("ref1 ref2", attribute5.get(div));
+
+    Button b = new Button();
+    b.getElement().setId("b");
+    Label l1 = new Label();
+    l1.getElement().setId("l1");
+    Label l2 = new Label();
+    l2.getElement().setId("l2");
+    attribute5.set(b.getElement(), Id.of(l1), Id.of(l2));
+    assertEquals("l1 l2", attribute5.get(b.getElement()));
+  }
+
   public void testSetDefaultValue_noSet() {
     try {
       attribute3.setDefault(div);
@@ -82,6 +108,7 @@
     attribute2 = new PrimitiveValueAttribute<Boolean>("attr2", "true");
     attribute3 = new PrimitiveValueAttribute<String>("attr3");
     attribute4 = new AriaValueAttribute<RelevantValue>("attr4", "additions text");
+    attribute5 = new AriaValueAttribute<Id>("attr5", "");
   }
 
   @Override
diff --git a/user/test/com/google/gwt/aria/client/RoleImplTest.java b/user/test/com/google/gwt/aria/client/RoleImplTest.java
index 4fd88f2..65d9e2a 100644
--- a/user/test/com/google/gwt/aria/client/RoleImplTest.java
+++ b/user/test/com/google/gwt/aria/client/RoleImplTest.java
@@ -36,7 +36,7 @@
 
   public void testSetGetRemoveProperty() {
     assertEquals("", regionRole.getAriaLabelledbyProperty(div));
-    regionRole.setAriaLabelledbyProperty(div, IdReference.of("test1"));
+    regionRole.setAriaLabelledbyProperty(div, Id.of("test1"));
     assertEquals("test1", regionRole.getAriaLabelledbyProperty(div));
     regionRole.removeAriaLabelledbyProperty(div);
     assertEquals("", regionRole.getAriaLabelledbyProperty(div));