8326694: Defer setting of autocapitalize attribute
Reviewed-by: jjg
This commit is contained in:
parent
38ad514589
commit
be2b92bd8b
@ -480,8 +480,7 @@ public class Navigation {
|
|||||||
var inputText = HtmlTree.INPUT(HtmlAttr.InputType.TEXT, HtmlIds.SEARCH_INPUT)
|
var inputText = HtmlTree.INPUT(HtmlAttr.InputType.TEXT, HtmlIds.SEARCH_INPUT)
|
||||||
.put(HtmlAttr.PLACEHOLDER, resources.getText("doclet.search_placeholder"))
|
.put(HtmlAttr.PLACEHOLDER, resources.getText("doclet.search_placeholder"))
|
||||||
.put(HtmlAttr.ARIA_LABEL, resources.getText("doclet.search_in_documentation"))
|
.put(HtmlAttr.ARIA_LABEL, resources.getText("doclet.search_in_documentation"))
|
||||||
.put(HtmlAttr.AUTOCOMPLETE, "off")
|
.put(HtmlAttr.AUTOCOMPLETE, "off");
|
||||||
.put(HtmlAttr.AUTOCAPITALIZE, "off");
|
|
||||||
var inputReset = HtmlTree.INPUT(HtmlAttr.InputType.RESET, HtmlIds.RESET_SEARCH)
|
var inputReset = HtmlTree.INPUT(HtmlAttr.InputType.RESET, HtmlIds.RESET_SEARCH)
|
||||||
.put(HtmlAttr.VALUE, resources.getText("doclet.search_reset"));
|
.put(HtmlAttr.VALUE, resources.getText("doclet.search_reset"));
|
||||||
var searchDiv = HtmlTree.DIV(HtmlStyle.navListSearch)
|
var searchDiv = HtmlTree.DIV(HtmlStyle.navListSearch)
|
||||||
|
@ -84,8 +84,7 @@ public class SearchWriter extends HtmlDocletWriter {
|
|||||||
.add(HtmlTree.DIV(HtmlTree.INPUT(HtmlAttr.InputType.TEXT, HtmlId.of("page-search-input"))
|
.add(HtmlTree.DIV(HtmlTree.INPUT(HtmlAttr.InputType.TEXT, HtmlId.of("page-search-input"))
|
||||||
.put(HtmlAttr.PLACEHOLDER, resources.getText("doclet.search_placeholder"))
|
.put(HtmlAttr.PLACEHOLDER, resources.getText("doclet.search_placeholder"))
|
||||||
.put(HtmlAttr.ARIA_LABEL, resources.getText("doclet.search_in_documentation"))
|
.put(HtmlAttr.ARIA_LABEL, resources.getText("doclet.search_in_documentation"))
|
||||||
.put(HtmlAttr.AUTOCOMPLETE, "off")
|
.put(HtmlAttr.AUTOCOMPLETE, "off"))
|
||||||
.put(HtmlAttr.AUTOCAPITALIZE, "off"))
|
|
||||||
.add(HtmlTree.INPUT(HtmlAttr.InputType.RESET, HtmlId.of("page-search-reset"))
|
.add(HtmlTree.INPUT(HtmlAttr.InputType.RESET, HtmlId.of("page-search-reset"))
|
||||||
.put(HtmlAttr.VALUE, resources.getText("doclet.search_reset"))
|
.put(HtmlAttr.VALUE, resources.getText("doclet.search_reset"))
|
||||||
.put(HtmlAttr.STYLE, "margin: 6px;"))
|
.put(HtmlAttr.STYLE, "margin: 6px;"))
|
||||||
|
@ -95,8 +95,7 @@ public class TableOfContents {
|
|||||||
.add(HtmlTree.INPUT(HtmlAttr.InputType.TEXT, HtmlStyle.filterInput)
|
.add(HtmlTree.INPUT(HtmlAttr.InputType.TEXT, HtmlStyle.filterInput)
|
||||||
.put(HtmlAttr.PLACEHOLDER, writer.resources.getText("doclet.filter_label"))
|
.put(HtmlAttr.PLACEHOLDER, writer.resources.getText("doclet.filter_label"))
|
||||||
.put(HtmlAttr.ARIA_LABEL, writer.resources.getText("doclet.filter_table_of_contents"))
|
.put(HtmlAttr.ARIA_LABEL, writer.resources.getText("doclet.filter_table_of_contents"))
|
||||||
.put(HtmlAttr.AUTOCOMPLETE, "off")
|
.put(HtmlAttr.AUTOCOMPLETE, "off"))
|
||||||
.put(HtmlAttr.AUTOCAPITALIZE, "off"))
|
|
||||||
.add(HtmlTree.INPUT(HtmlAttr.InputType.RESET, HtmlStyle.resetFilter)
|
.add(HtmlTree.INPUT(HtmlAttr.InputType.RESET, HtmlStyle.resetFilter)
|
||||||
.put(HtmlAttr.VALUE, writer.resources.getText("doclet.filter_reset")));
|
.put(HtmlAttr.VALUE, writer.resources.getText("doclet.filter_reset")));
|
||||||
}
|
}
|
||||||
|
@ -39,7 +39,6 @@ public enum HtmlAttr {
|
|||||||
ARIA_ORIENTATION("aria-orientation"),
|
ARIA_ORIENTATION("aria-orientation"),
|
||||||
ARIA_SELECTED("aria-selected"),
|
ARIA_SELECTED("aria-selected"),
|
||||||
AUTOCOMPLETE,
|
AUTOCOMPLETE,
|
||||||
AUTOCAPITALIZE,
|
|
||||||
CHECKED,
|
CHECKED,
|
||||||
CLASS,
|
CLASS,
|
||||||
CLEAR,
|
CLEAR,
|
||||||
|
@ -246,6 +246,7 @@ document.addEventListener("DOMContentLoaded", function(e) {
|
|||||||
}
|
}
|
||||||
document.querySelectorAll("input.filter-input").forEach(function(input) {
|
document.querySelectorAll("input.filter-input").forEach(function(input) {
|
||||||
input.removeAttribute("disabled");
|
input.removeAttribute("disabled");
|
||||||
|
input.setAttribute("autocapitalize", "off");
|
||||||
input.value = "";
|
input.value = "";
|
||||||
input.addEventListener("input", function(e) {
|
input.addEventListener("input", function(e) {
|
||||||
const pattern = input.value ? input.value.trim()
|
const pattern = input.value ? input.value.trim()
|
||||||
|
@ -244,6 +244,7 @@ $(window).on("load", function() {
|
|||||||
setSearchUrl();
|
setSearchUrl();
|
||||||
});
|
});
|
||||||
input.prop("disabled", false);
|
input.prop("disabled", false);
|
||||||
|
input.attr("autocapitalize", "off");
|
||||||
reset.prop("disabled", false);
|
reset.prop("disabled", false);
|
||||||
|
|
||||||
var urlParams = new URLSearchParams(window.location.search);
|
var urlParams = new URLSearchParams(window.location.search);
|
||||||
@ -263,4 +264,4 @@ $(window).on("load", function() {
|
|||||||
notify.html(messages.enterTerm);
|
notify.html(messages.enterTerm);
|
||||||
}
|
}
|
||||||
input.select().focus();
|
input.select().focus();
|
||||||
});
|
});
|
||||||
|
@ -426,6 +426,7 @@ $(function() {
|
|||||||
});
|
});
|
||||||
search.val('');
|
search.val('');
|
||||||
search.prop("disabled", false);
|
search.prop("disabled", false);
|
||||||
|
search.attr("autocapitalize", "off");
|
||||||
reset.prop("disabled", false);
|
reset.prop("disabled", false);
|
||||||
reset.click(function() {
|
reset.click(function() {
|
||||||
search.val('').focus();
|
search.val('').focus();
|
||||||
|
@ -434,7 +434,7 @@ public class TestSearch extends JavadocTester {
|
|||||||
"""
|
"""
|
||||||
<div class="nav-list-search">
|
<div class="nav-list-search">
|
||||||
<input type="text" id="search-input" disabled placeholder="Search" aria-label="S\
|
<input type="text" id="search-input" disabled placeholder="Search" aria-label="S\
|
||||||
earch in documentation" autocomplete="off" autocapitalize="off">
|
earch in documentation" autocomplete="off">
|
||||||
<input type="reset" id="reset-search" disabled value="Reset">
|
<input type="reset" id="reset-search" disabled value="Reset">
|
||||||
</div>""");
|
</div>""");
|
||||||
}
|
}
|
||||||
|
@ -134,7 +134,7 @@ public class TestSpecTag extends JavadocTester {
|
|||||||
<ol class="sub-nav-list"></ol>
|
<ol class="sub-nav-list"></ol>
|
||||||
<div class="nav-list-search">
|
<div class="nav-list-search">
|
||||||
<input type="text" id="search-input" disabled placeholder="Search" aria-label="S\
|
<input type="text" id="search-input" disabled placeholder="Search" aria-label="S\
|
||||||
earch in documentation" autocomplete="off" autocapitalize="off">
|
earch in documentation" autocomplete="off">
|
||||||
<input type="reset" id="reset-search" disabled value="Reset">
|
<input type="reset" id="reset-search" disabled value="Reset">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
Reference in New Issue
Block a user