https://javaserverfaces.dev.java.net/issues/show_bug.cgi?id=131
SECTION: Modified Files
----------------------------
M src/com/sun/faces/renderkit/html_basic/SecretRenderer.java
M src/com/sun/faces/renderkit/html_basic/TextRenderer.java
- Output the autocomplete attribute if value is 'off'
otherwise render nothing.
M src/com/sun/faces/taglib/jsf_core/ValidatorTag.java
- minor unrelated comment change
M systest/build-tests.xml
- add new systest to validate autocomplete attribute rendering
A systest/web/golden/standard/autocomplete.txt
A systest/web/standard/autocomplete.jsp
- new systest to validate autocomplete attribute rendering
SECTION: Diffs
----------------------------
Index: src/com/sun/faces/renderkit/html_basic/SecretRenderer.java
===================================================================
RCS file:
/cvs/javaserverfaces-sources/jsf-ri/src/com/sun/faces/renderkit/html_basic/SecretRenderer.java,v
retrieving revision 1.58
diff -u -r1.58 SecretRenderer.java
--- src/com/sun/faces/renderkit/html_basic/SecretRenderer.java 21 Apr
2005 18:55:37 -0000 1.58
+++ src/com/sun/faces/renderkit/html_basic/SecretRenderer.java 10 Aug
2005 20:58:10 -0000
@@ -91,6 +91,19 @@
writer.writeAttribute("name", component.getClientId(context),
"clientId");
+ String autoComplete = (String)
+ component.getAttributes().get("autocomplete");
+ if (autoComplete != null) {
+ // only output the autocomplete attribute if the value
+ // is 'off' since its lack of presence will be interpreted
+ // as 'on' by the browser
+ if ("off".equals(autoComplete)) {
+ writer.writeAttribute("autocomplete",
+ "off",
+ "autocomplete");
+ }
+ }
+
// render default text specified
if (currentValue != null) {
writer.writeAttribute("value", currentValue, "value");
Index: src/com/sun/faces/renderkit/html_basic/TextRenderer.java
===================================================================
RCS file:
/cvs/javaserverfaces-sources/jsf-ri/src/com/sun/faces/renderkit/html_basic/TextRenderer.java,v
retrieving revision 1.69
diff -u -r1.69 TextRenderer.java
--- src/com/sun/faces/renderkit/html_basic/TextRenderer.java 21 Apr
2005 18:55:37 -0000 1.69
+++ src/com/sun/faces/renderkit/html_basic/TextRenderer.java 10 Aug
2005 20:58:10 -0000
@@ -94,6 +94,19 @@
writer.writeAttribute("name", (component.getClientId(context)),
"clientId");
+ String autoComplete = (String)
+ component.getAttributes().get("autocomplete");
+ if (autoComplete != null) {
+ // only output the autocomplete attribute if the value
+ // is 'off' since its lack of presence will be interpreted
+ // as 'on' by the browser
+ if ("off".equals(autoComplete)) {
+ writer.writeAttribute("autocomplete",
+ "off",
+ "autocomplete");
+ }
+ }
+
// render default text specified
if (currentValue != null) {
writer.writeAttribute("value", currentValue, "value");
Index: src/com/sun/faces/taglib/jsf_core/ValidatorTag.java
===================================================================
RCS file:
/cvs/javaserverfaces-sources/jsf-ri/src/com/sun/faces/taglib/jsf_core/ValidatorTag.java,v
retrieving revision 1.1
diff -u -r1.1 ValidatorTag.java
--- src/com/sun/faces/taglib/jsf_core/ValidatorTag.java 5 May 2005
20:51:27 -0000 1.1
+++ src/com/sun/faces/taglib/jsf_core/ValidatorTag.java 10 Aug 2005
20:58:10 -0000
@@ -65,7 +65,7 @@
} // END setBinding
- // -------------------------------------------- Methods from
ConverterELTag
+ // -------------------------------------------- Methods from
ValidatorELTag
protected Validator createValidator()
Index: systest/build-tests.xml
===================================================================
RCS file: /cvs/javaserverfaces-sources/jsf-ri/systest/build-tests.xml,v
retrieving revision 1.87
diff -u -r1.87 build-tests.xml
--- systest/build-tests.xml 2 Aug 2005 20:24:54 -0000 1.87
+++ systest/build-tests.xml 10 Aug 2005 20:58:10 -0000
@@ -674,6 +674,9 @@
request="${context.path}/faces/standard/component01.jsp"
recordGolden="${local.golden.path}/standard/component01.txt"
golden="${golden.path}/standard/component01.txt"
failonerror="${failonerror}"/>
+ <tester host="${host}" port="${port}" protocol="${protocol}"
+ request="${context.path}/faces/standard/autocomplete.jsp"
+ golden="${golden.path}/standard/autocomplete.txt"
failonerror="${failonerror}"/>
</target>
<target name="test.html.taglib"