/** * Creates an instance. * If no value is specified, it is set to "on" as browsers do * even if spec says that it is not allowed * (<a href="http://www.w3.org/TR/REC-html40/interact/forms.html#adef-value-INPUT">W3C</a>). * * @param qualifiedName the qualified name of the element type to instantiate * @param page the page that contains this element * @param attributes the initial attributes */ HtmlCheckBoxInput(final String qualifiedName, final SgmlPage page, final Map<String, DomAttr> attributes) { super(qualifiedName, page, addValueIfNeeded(page, attributes)); // fix the default value in case we have set it if (getAttributeDirect("value") == DEFAULT_VALUE) { setDefaultValue(ATTRIBUTE_NOT_DEFINED, false); } defaultCheckedState_ = hasAttribute("checked"); checkedState_ = defaultCheckedState_; }
/** * Creates an instance. * If no value is specified, it is set to "on" as browsers do * even if spec says that it is not allowed * (<a href="http://www.w3.org/TR/REC-html40/interact/forms.html#adef-value-INPUT">W3C</a>). * * @param qualifiedName the qualified name of the element type to instantiate * @param page the page that contains this element * @param attributes the initial attributes */ HtmlCheckBoxInput(final String qualifiedName, final SgmlPage page, final Map<String, DomAttr> attributes) { super(qualifiedName, page, addValueIfNeeded(page, attributes)); // fix the default value in case we have set it if (getAttributeDirect("value") == DEFAULT_VALUE) { setDefaultValue(ATTRIBUTE_NOT_DEFINED, false); } defaultCheckedState_ = hasAttribute("checked"); checkedState_ = defaultCheckedState_; }