Loading core/java/android/webkit/DebugFlags.java +5 −1 Original line number Original line Diff line number Diff line Loading @@ -45,5 +45,9 @@ class DebugFlags { public static final boolean WEB_TEXT_VIEW = false; public static final boolean WEB_TEXT_VIEW = false; public static final boolean WEB_VIEW = false; public static final boolean WEB_VIEW = false; public static final boolean WEB_VIEW_CORE = false; public static final boolean WEB_VIEW_CORE = false; /* * Set to true to allow the WebTextView to draw on top of the web page in a * different color so that you can see how the two line up. */ public static final boolean DRAW_WEBTEXTVIEW = false; } } core/java/android/webkit/WebTextView.java +7 −4 Original line number Original line Diff line number Diff line Loading @@ -157,7 +157,7 @@ import junit.framework.Assert; // Set the text color to black, regardless of the theme. This ensures // Set the text color to black, regardless of the theme. This ensures // that other applications that use embedded WebViews will properly // that other applications that use embedded WebViews will properly // display the text in password textfields. // display the text in password textfields. setTextColor(Color.BLACK); setTextColor(DebugFlags.DRAW_WEBTEXTVIEW ? Color.RED : Color.BLACK); // This helps to align the text better with the text in the web page. // This helps to align the text better with the text in the web page. setIncludeFontPadding(false); setIncludeFontPadding(false); } } Loading Loading @@ -404,8 +404,9 @@ import junit.framework.Assert; // onDraw should only be called for password fields. If WebTextView is // onDraw should only be called for password fields. If WebTextView is // still drawing, but is no longer corresponding to a password field, // still drawing, but is no longer corresponding to a password field, // remove it. // remove it. if (mWebView == null || !mWebView.nativeFocusCandidateIsPassword() if (!DebugFlags.DRAW_WEBTEXTVIEW && (mWebView == null || !isSameTextField(mWebView.nativeFocusCandidatePointer())) { || !mWebView.nativeFocusCandidateIsPassword() || !isSameTextField(mWebView.nativeFocusCandidatePointer()))) { // Although calling remove() would seem to make more sense here, // Although calling remove() would seem to make more sense here, // changing it to not be a password field will make it not draw. // changing it to not be a password field will make it not draw. // Other code will make sure that it is removed completely, but this // Other code will make sure that it is removed completely, but this Loading Loading @@ -819,7 +820,9 @@ import junit.framework.Assert; } } // For password fields, draw the WebTextView. For others, just show // For password fields, draw the WebTextView. For others, just show // webkit's drawing. // webkit's drawing. if (!DebugFlags.DRAW_WEBTEXTVIEW) { setWillNotDraw(!inPassword); setWillNotDraw(!inPassword); } setBackgroundDrawable(inPassword ? mBackground : null); setBackgroundDrawable(inPassword ? mBackground : null); } } Loading Loading
core/java/android/webkit/DebugFlags.java +5 −1 Original line number Original line Diff line number Diff line Loading @@ -45,5 +45,9 @@ class DebugFlags { public static final boolean WEB_TEXT_VIEW = false; public static final boolean WEB_TEXT_VIEW = false; public static final boolean WEB_VIEW = false; public static final boolean WEB_VIEW = false; public static final boolean WEB_VIEW_CORE = false; public static final boolean WEB_VIEW_CORE = false; /* * Set to true to allow the WebTextView to draw on top of the web page in a * different color so that you can see how the two line up. */ public static final boolean DRAW_WEBTEXTVIEW = false; } }
core/java/android/webkit/WebTextView.java +7 −4 Original line number Original line Diff line number Diff line Loading @@ -157,7 +157,7 @@ import junit.framework.Assert; // Set the text color to black, regardless of the theme. This ensures // Set the text color to black, regardless of the theme. This ensures // that other applications that use embedded WebViews will properly // that other applications that use embedded WebViews will properly // display the text in password textfields. // display the text in password textfields. setTextColor(Color.BLACK); setTextColor(DebugFlags.DRAW_WEBTEXTVIEW ? Color.RED : Color.BLACK); // This helps to align the text better with the text in the web page. // This helps to align the text better with the text in the web page. setIncludeFontPadding(false); setIncludeFontPadding(false); } } Loading Loading @@ -404,8 +404,9 @@ import junit.framework.Assert; // onDraw should only be called for password fields. If WebTextView is // onDraw should only be called for password fields. If WebTextView is // still drawing, but is no longer corresponding to a password field, // still drawing, but is no longer corresponding to a password field, // remove it. // remove it. if (mWebView == null || !mWebView.nativeFocusCandidateIsPassword() if (!DebugFlags.DRAW_WEBTEXTVIEW && (mWebView == null || !isSameTextField(mWebView.nativeFocusCandidatePointer())) { || !mWebView.nativeFocusCandidateIsPassword() || !isSameTextField(mWebView.nativeFocusCandidatePointer()))) { // Although calling remove() would seem to make more sense here, // Although calling remove() would seem to make more sense here, // changing it to not be a password field will make it not draw. // changing it to not be a password field will make it not draw. // Other code will make sure that it is removed completely, but this // Other code will make sure that it is removed completely, but this Loading Loading @@ -819,7 +820,9 @@ import junit.framework.Assert; } } // For password fields, draw the WebTextView. For others, just show // For password fields, draw the WebTextView. For others, just show // webkit's drawing. // webkit's drawing. if (!DebugFlags.DRAW_WEBTEXTVIEW) { setWillNotDraw(!inPassword); setWillNotDraw(!inPassword); } setBackgroundDrawable(inPassword ? mBackground : null); setBackgroundDrawable(inPassword ? mBackground : null); } } Loading