diff --git a/gwt-src/nu/validator/htmlparser/gwt/BrowserTreeBuilder.java b/gwt-src/nu/validator/htmlparser/gwt/BrowserTreeBuilder.java
index 2eaa6764..26905cce 100644
--- a/gwt-src/nu/validator/htmlparser/gwt/BrowserTreeBuilder.java
+++ b/gwt-src/nu/validator/htmlparser/gwt/BrowserTreeBuilder.java
@@ -474,4 +474,84 @@ private static native void removeChild(JavaScriptObject parent,
fatal(e);
}
}
+
+ private static native JavaScriptObject getNextSibling(
+ JavaScriptObject node) /*-{
+ return node.nextSibling;
+ }-*/;
+
+ private static native String getLocalName(
+ JavaScriptObject node) /*-{
+ return node.localName;
+ }-*/;
+
+ private static native boolean hasAttribute(
+ JavaScriptObject node, String name) /*-{
+ return node.hasAttribute(name);
+ }-*/;
+
+ @Override
+ // https://html.spec.whatwg.org/multipage/form-elements.html#concept-select-option-selectedness
+ // Implements "maybe clone an option into selectedcontent"
+ protected void optionElementPopped(JavaScriptObject option)
+ throws SAXException {
+ try {
+ // Find the nearest ancestor