jhy/jsoup — pull request #402 by code4craft (2014-03-21 06:39:25+00:00)
Title: nth-of-type selector does not work with tag such as "SVG"

In selector like `#type svg:nth-of-type(%d)`, only the first element of tag "svg" will be selected.
```java
protected int calculatePosition(Element root, Element element) {
int pos = 0;
Elements family = element.parent().children();
for (int i = 0; i < family.size(); i++) {
if (family.get(i).tag() == element.tag()) pos++;
if (family.get(i) == element) break;
}
return pos;
}
```

The element is compared by Tag object. And the Tag object is create by `Tag.valueOf()`.

For known tags, they will be got from the map `Tag.tags`. But for unknown tag (such as svg), it is created ever time when call , so the compare "if (family.get(i).tag() == element.tag()) pos++;" will return false.

I tried to fix it by change "==" to "equals". I added some tests in CssTest and get them passed.