diff options
| -rw-r--r-- | core/java/android/webkit/DebugFlags.java | 6 | ||||
| -rw-r--r-- | core/java/android/webkit/WebTextView.java | 11 |
2 files changed, 12 insertions, 5 deletions
diff --git a/core/java/android/webkit/DebugFlags.java b/core/java/android/webkit/DebugFlags.java index 8e25395f1201..3cb5e24ec26c 100644 --- a/core/java/android/webkit/DebugFlags.java +++ b/core/java/android/webkit/DebugFlags.java @@ -45,5 +45,9 @@ class DebugFlags { public static final boolean WEB_TEXT_VIEW = false; public static final boolean WEB_VIEW = 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; } diff --git a/core/java/android/webkit/WebTextView.java b/core/java/android/webkit/WebTextView.java index a58d648c5ffd..f477f8fa1b4f 100644 --- a/core/java/android/webkit/WebTextView.java +++ b/core/java/android/webkit/WebTextView.java @@ -157,7 +157,7 @@ import junit.framework.Assert; // Set the text color to black, regardless of the theme. This ensures // that other applications that use embedded WebViews will properly // 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. setIncludeFontPadding(false); } @@ -404,8 +404,9 @@ import junit.framework.Assert; // onDraw should only be called for password fields. If WebTextView is // still drawing, but is no longer corresponding to a password field, // remove it. - if (mWebView == null || !mWebView.nativeFocusCandidateIsPassword() - || !isSameTextField(mWebView.nativeFocusCandidatePointer())) { + if (!DebugFlags.DRAW_WEBTEXTVIEW && (mWebView == null + || !mWebView.nativeFocusCandidateIsPassword() + || !isSameTextField(mWebView.nativeFocusCandidatePointer()))) { // Although calling remove() would seem to make more sense here, // 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 @@ -819,7 +820,9 @@ import junit.framework.Assert; } // For password fields, draw the WebTextView. For others, just show // webkit's drawing. - setWillNotDraw(!inPassword); + if (!DebugFlags.DRAW_WEBTEXTVIEW) { + setWillNotDraw(!inPassword); + } setBackgroundDrawable(inPassword ? mBackground : null); } |