/** * {@inheritDoc} */ @Override public DisplayStyle getDefaultStyleDisplay() { if (hasFeature(CSS_INPUT_DISPLAY_INLINE_BLOCK)) { return DisplayStyle.INLINE_BLOCK; } if (hasFeature(CSS_INPUT_DISPLAY_RADIO_CHECKBOX_INLINE_BLOCK)) { final String type = getTypeAttribute(); if ("radio".equals(type) || "checkbox".equals(type)) { return DisplayStyle.INLINE_BLOCK; } } return DisplayStyle.INLINE; }
/** * {@inheritDoc} */ @Override public DisplayStyle getDefaultStyleDisplay() { if (hasFeature(CSS_INPUT_DISPLAY_INLINE_BLOCK)) { return DisplayStyle.INLINE_BLOCK; } if (hasFeature(CSS_INPUT_DISPLAY_RADIO_CHECKBOX_INLINE_BLOCK)) { final String type = getTypeAttribute(); if ("radio".equals(type) || "checkbox".equals(type)) { return DisplayStyle.INLINE_BLOCK; } } return DisplayStyle.INLINE; }
/** * Returns <tt>true</tt> if the specified element gets submitted when this form is submitted, * assuming that the form is submitted using the specified submit element. * * @param element the element to check * @param submitElement the element used to submit the form, or <tt>null</tt> if the form is * submitted by JavaScript * @return <tt>true</tt> if the specified element gets submitted when this form is submitted */ private boolean isSubmittable(final HtmlElement element, final SubmittableElement submitElement) { final String tagName = element.getTagName(); if (!isValidForSubmission(element, submitElement)) { return false; } // The one submit button that was clicked can be submitted but no other ones if (element == submitElement) { return true; } if (element instanceof HtmlInput) { final HtmlInput input = (HtmlInput) element; final String type = input.getTypeAttribute().toLowerCase(); if (type.equals("submit") || type.equals("image") || type.equals("reset") || type.equals("button")) { return false; } } if (tagName.equals("button")) { return false; } return true; }
/** * Returns {@code true} if the specified element gets submitted when this form is submitted, * assuming that the form is submitted using the specified submit element. * * @param element the element to check * @param submitElement the element used to submit the form, or {@code null} if the form is * submitted by JavaScript * @return {@code true} if the specified element gets submitted when this form is submitted */ private static boolean isSubmittable(final HtmlElement element, final SubmittableElement submitElement) { final String tagName = element.getTagName(); if (!isValidForSubmission(element, submitElement)) { return false; } // The one submit button that was clicked can be submitted but no other ones if (element == submitElement) { return true; } if (element instanceof HtmlInput) { final HtmlInput input = (HtmlInput) element; final String type = input.getTypeAttribute().toLowerCase(Locale.ROOT); if ("submit".equals(type) || "image".equals(type) || "reset".equals(type) || "button".equals(type)) { return false; } } if (HtmlButton.TAG_NAME.equals(tagName)) { return false; } return true; }
/** * Returns {@code true} if the specified element gets submitted when this form is submitted, * assuming that the form is submitted using the specified submit element. * * @param element the element to check * @param submitElement the element used to submit the form, or {@code null} if the form is * submitted by JavaScript * @return {@code true} if the specified element gets submitted when this form is submitted */ private static boolean isSubmittable(final HtmlElement element, final SubmittableElement submitElement) { final String tagName = element.getTagName(); if (!isValidForSubmission(element, submitElement)) { return false; } // The one submit button that was clicked can be submitted but no other ones if (element == submitElement) { return true; } if (element instanceof HtmlInput) { final HtmlInput input = (HtmlInput) element; final String type = input.getTypeAttribute().toLowerCase(Locale.ROOT); if ("submit".equals(type) || "image".equals(type) || "reset".equals(type) || "button".equals(type)) { return false; } } return !HtmlButton.TAG_NAME.equals(tagName); }
/** * Returns <tt>true</tt> if the specified element gets submitted when this form is submitted, * assuming that the form is submitted using the specified submit element. * * @param element the element to check * @param submitElement the element used to submit the form, or <tt>null</tt> if the form is * submitted by JavaScript * @return <tt>true</tt> if the specified element gets submitted when this form is submitted */ private boolean isSubmittable(final HtmlElement element, final SubmittableElement submitElement) { final String tagName = element.getTagName(); if (!isValidForSubmission(element, submitElement)) { return false; } // The one submit button that was clicked can be submitted but no other ones if (element == submitElement) { return true; } if (element instanceof HtmlInput) { final HtmlInput input = (HtmlInput) element; final String type = input.getTypeAttribute().toLowerCase(); if (type.equals("submit") || type.equals("image") || type.equals("reset") || type.equals("button")) { return false; } } if (tagName.equals("button")) { return false; } return true; }
/** * Returns <tt>true</tt> if the specified element gets submitted when this form is submitted, * assuming that the form is submitted using the specified submit element. * * @param element the element to check * @param submitElement the element used to submit the form, or <tt>null</tt> if the form is * submitted by JavaScript * @return <tt>true</tt> if the specified element gets submitted when this form is submitted */ private boolean isSubmittable(final HtmlElement element, final SubmittableElement submitElement) { final String tagName = element.getTagName(); if (!isValidForSubmission(element, submitElement)) { return false; } // The one submit button that was clicked can be submitted but no other ones if (element == submitElement) { return true; } if (element instanceof HtmlInput) { final HtmlInput input = (HtmlInput) element; final String type = input.getTypeAttribute().toLowerCase(); if (type.equals("submit") || type.equals("image") || type.equals("reset") || type.equals("button")) { return false; } } if (tagName.equals("button")) { return false; } return true; }
String type = getDomNodeOrDie().getTypeAttribute(); final BrowserVersion browserVersion = getBrowserVersion(); type = type.toLowerCase(Locale.ROOT);
String type = getDomNodeOrDie().getTypeAttribute(); final BrowserVersion browserVersion = getBrowserVersion(); type = type.toLowerCase(Locale.ROOT);
/** * Sets the value of the attribute "type". * Note: this replace the DOM node with a new one. * @param newType the new type to set */ public void jsxSet_type(final String newType) { HtmlInput input = getHtmlInputOrDie(); if (!input.getTypeAttribute().equalsIgnoreCase(newType)) { final AttributesImpl attributes = readAttributes(input); final int index = attributes.getIndex("type"); attributes.setValue(index, newType); final HtmlInput newInput = (HtmlInput) InputElementFactory.instance .createElement(input.getPage(), "input", attributes); if (input.getParentNode() != null) { input.getParentNode().replaceChild(newInput, input); } else { // the input hasn't yet been inserted into the DOM tree (likely has been // created via document.createElement()), so simply replace it with the // new Input instance created in the code above input = newInput; } input.setScriptObject(null); setDomNode(newInput, true); } }
/** * Sets the value of the attribute "type". * Note: this replace the DOM node with a new one. * @param newType the new type to set */ public void jsxSet_type(final String newType) { HtmlInput input = getHtmlInputOrDie(); if (!input.getTypeAttribute().equalsIgnoreCase(newType)) { final AttributesImpl attributes = readAttributes(input); final int index = attributes.getIndex("type"); attributes.setValue(index, newType); final HtmlInput newInput = (HtmlInput) InputElementFactory.instance .createElement(input.getPage(), "input", attributes); if (input.getParentNode() != null) { input.getParentNode().replaceChild(newInput, input); } else { // the input hasn't yet been inserted into the DOM tree (likely has been // created via document.createElement()), so simply replace it with the // new Input instance created in the code above input = newInput; } input.setScriptObject(null); setDomNode(newInput, true); } }
/** * Sets the value of the attribute "type". * Note: this replace the DOM node with a new one. * @param newType the new type to set */ public void jsxSet_type(final String newType) { HtmlInput input = getHtmlInputOrDie(); if (!input.getTypeAttribute().equalsIgnoreCase(newType)) { final AttributesImpl attributes = readAttributes(input); final int index = attributes.getIndex("type"); attributes.setValue(index, newType); final HtmlInput newInput = (HtmlInput) InputElementFactory.instance .createElement(input.getPage(), "input", attributes); if (input.getParentNode() != null) { input.getParentNode().replaceChild(newInput, input); } else { // the input hasn't yet been inserted into the DOM tree (likely has been // created via document.createElement()), so simply replace it with the // new Input instance created in the code above input = newInput; } input.setScriptObject(null); setDomNode(newInput, true); } }