Using 2.1 M1 I noticed that Element has the method hasTagName, which
looks like this:
public final boolean hasTagName(String tagName) {
assert tagName != null : "tagName must not be null";
return tagName.equals(getTagName());
}
Almost synonymous with this:
"div".equals(element.getTagName())
However one gotcha got me, assume element is a "div":
"div".equals(element.getTagName()) ---> returns false :-(
"DIV".equals(element.getTagName()) ---> returns true :-)
Likewise:
element.hasTagName("div") ---> returns false :-(
element.hasTagName("DIV") ---> returns true :-)
Obviously Java's String .equals() method is case sensitive. But how
would we know that element.getTagName returns uppercase or otherwise?
Here is the method at is stands in 2.1 M1:
/**
* Gets the element's full tag name, including the namespace-prefix
if
* present.
*
* @return the element's tag name
*/
public final String getTagName() {
return DOMImpl.impl.getTagName(this);
}
--
You received this message because you are subscribed to the Google Groups
"Google Web Toolkit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-web-toolkit?hl=en.