Backout 506268f7735e & ea163112807d (bug 746142) for Android build failures
This commit is contained in:
@@ -441,7 +441,6 @@ GK_ATOM(inherits, "inherits")
|
||||
GK_ATOM(inheritstyle, "inheritstyle")
|
||||
GK_ATOM(initial_scale, "initial-scale")
|
||||
GK_ATOM(input, "input")
|
||||
GK_ATOM(inputmode, "inputmode")
|
||||
GK_ATOM(ins, "ins")
|
||||
GK_ATOM(insertafter, "insertafter")
|
||||
GK_ATOM(insertbefore, "insertbefore")
|
||||
|
||||
@@ -322,8 +322,6 @@ nsIMEStateManager::SetIMEState(const IMEState &aState,
|
||||
aContent->Tag() == nsGkAtoms::textarea)) {
|
||||
aContent->GetAttr(kNameSpaceID_None, nsGkAtoms::type,
|
||||
context.mHTMLInputType);
|
||||
aContent->GetAttr(kNameSpaceID_None, nsGkAtoms::inputmode,
|
||||
context.mHTMLInputInputmode);
|
||||
aContent->GetAttr(kNameSpaceID_None, nsGkAtoms::moz_action_hint,
|
||||
context.mActionHint);
|
||||
|
||||
|
||||
@@ -148,28 +148,6 @@ static const nsAttrValue::EnumTable kInputAutocompleteTable[] = {
|
||||
// Default autocomplete value is "".
|
||||
static const nsAttrValue::EnumTable* kInputDefaultAutocomplete = &kInputAutocompleteTable[0];
|
||||
|
||||
static const PRUint8 NS_INPUT_INPUTMODE_AUTO = 0;
|
||||
static const PRUint8 NS_INPUT_INPUTMODE_NUMERIC = 1;
|
||||
static const PRUint8 NS_INPUT_INPUTMODE_DIGIT = 2;
|
||||
static const PRUint8 NS_INPUT_INPUTMODE_UPPERCASE = 3;
|
||||
static const PRUint8 NS_INPUT_INPUTMODE_LOWERCASE = 4;
|
||||
static const PRUint8 NS_INPUT_INPUTMODE_TITLECASE = 5;
|
||||
static const PRUint8 NS_INPUT_INPUTMODE_AUTOCAPITALIZED = 6;
|
||||
|
||||
static const nsAttrValue::EnumTable kInputInputmodeTable[] = {
|
||||
{ "auto", NS_INPUT_INPUTMODE_AUTO },
|
||||
{ "numeric", NS_INPUT_INPUTMODE_NUMERIC },
|
||||
{ "digit", NS_INPUT_INPUTMODE_DIGIT },
|
||||
{ "uppercase", NS_INPUT_INPUTMODE_UPPERCASE },
|
||||
{ "lowercase", NS_INPUT_INPUTMODE_LOWERCASE },
|
||||
{ "titlecase", NS_INPUT_INPUTMODE_TITLECASE },
|
||||
{ "autocapitalized", NS_INPUT_INPUTMODE_AUTOCAPITALIZED },
|
||||
{ 0 }
|
||||
};
|
||||
|
||||
// Default inputmode value is "auto".
|
||||
static const nsAttrValue::EnumTable* kInputDefaultInputmode = &kInputInputmodeTable[0];
|
||||
|
||||
const double nsHTMLInputElement::kDefaultStepBase = 0;
|
||||
const double nsHTMLInputElement::kStepAny = 0;
|
||||
|
||||
@@ -884,8 +862,6 @@ NS_IMPL_ENUM_ATTR_DEFAULT_VALUE(nsHTMLInputElement, FormMethod, formmethod,
|
||||
kFormDefaultMethod->tag)
|
||||
NS_IMPL_BOOL_ATTR(nsHTMLInputElement, FormNoValidate, formnovalidate)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLInputElement, FormTarget, formtarget)
|
||||
NS_IMPL_ENUM_ATTR_DEFAULT_VALUE(nsHTMLInputElement, Inputmode, inputmode,
|
||||
kInputDefaultInputmode->tag)
|
||||
NS_IMPL_BOOL_ATTR(nsHTMLInputElement, Multiple, multiple)
|
||||
NS_IMPL_NON_NEGATIVE_INT_ATTR(nsHTMLInputElement, MaxLength, maxlength)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLInputElement, Name, name)
|
||||
@@ -2761,9 +2737,6 @@ nsHTMLInputElement::ParseAttribute(PRInt32 aNamespaceID,
|
||||
if (aAttribute == nsGkAtoms::autocomplete) {
|
||||
return aResult.ParseEnumValue(aValue, kInputAutocompleteTable, false);
|
||||
}
|
||||
if (aAttribute == nsGkAtoms::inputmode) {
|
||||
return aResult.ParseEnumValue(aValue, kInputInputmodeTable, false);
|
||||
}
|
||||
if (ParseImageAttribute(aAttribute, aValue, aResult)) {
|
||||
// We have to call |ParseImageAttribute| unconditionally since we
|
||||
// don't know if we're going to have a type="image" attribute yet,
|
||||
|
||||
@@ -110,15 +110,6 @@ reflectUnsignedInt({
|
||||
|
||||
// .indeterminate doesn't reflect a content attribute.
|
||||
|
||||
// .inputmode
|
||||
reflectLimitedEnumerated({
|
||||
element: document.createElement("input"),
|
||||
attribute: "inputmode",
|
||||
validValues: [ "numeric", "digit", "uppercase", "lowercase", "titlecase", "autocapitalized", "auto" ],
|
||||
invalidValues: [ "", "foo", "tulip" ],
|
||||
defaultValue: "auto"
|
||||
});
|
||||
|
||||
// TODO: list (HTMLElement)
|
||||
|
||||
// .max
|
||||
|
||||
@@ -20,7 +20,7 @@ interface nsIDOMValidityState;
|
||||
* http://www.whatwg.org/specs/web-apps/current-work/
|
||||
*/
|
||||
|
||||
[scriptable, uuid(83984fd0-b0b2-11e1-afa6-0800200c9a66)]
|
||||
[scriptable, uuid(c12471c8-155f-4368-9e8b-13a231e85f3b)]
|
||||
interface nsIDOMHTMLInputElement : nsIDOMHTMLElement
|
||||
{
|
||||
attribute DOMString accept;
|
||||
@@ -43,8 +43,6 @@ interface nsIDOMHTMLInputElement : nsIDOMHTMLElement
|
||||
attribute unsigned long height;
|
||||
attribute boolean indeterminate;
|
||||
|
||||
attribute DOMString inputmode;
|
||||
|
||||
readonly attribute nsIDOMHTMLElement list;
|
||||
attribute DOMString max;
|
||||
attribute long maxLength;
|
||||
|
||||
@@ -163,7 +163,6 @@ parent:
|
||||
SetInputContext(PRInt32 IMEEnabled,
|
||||
PRInt32 IMEOpen,
|
||||
nsString type,
|
||||
nsString inputmode,
|
||||
nsString actionHint,
|
||||
PRInt32 cause,
|
||||
PRInt32 focusChange);
|
||||
|
||||
@@ -682,7 +682,6 @@ bool
|
||||
TabParent::RecvSetInputContext(const PRInt32& aIMEEnabled,
|
||||
const PRInt32& aIMEOpen,
|
||||
const nsString& aType,
|
||||
const nsString& aInputmode,
|
||||
const nsString& aActionHint,
|
||||
const PRInt32& aCause,
|
||||
const PRInt32& aFocusChange)
|
||||
@@ -700,7 +699,6 @@ TabParent::RecvSetInputContext(const PRInt32& aIMEEnabled,
|
||||
context.mIMEState.mEnabled = static_cast<IMEState::Enabled>(aIMEEnabled);
|
||||
context.mIMEState.mOpen = static_cast<IMEState::Open>(aIMEOpen);
|
||||
context.mHTMLInputType.Assign(aType);
|
||||
context.mHTMLInputInputmode.Assign(aInputmode);
|
||||
context.mActionHint.Assign(aActionHint);
|
||||
InputContextAction action(
|
||||
static_cast<InputContextAction::Cause>(aCause),
|
||||
|
||||
@@ -98,7 +98,6 @@ public:
|
||||
virtual bool RecvSetInputContext(const PRInt32& aIMEEnabled,
|
||||
const PRInt32& aIMEOpen,
|
||||
const nsString& aType,
|
||||
const nsString& aInputmode,
|
||||
const nsString& aActionHint,
|
||||
const PRInt32& aCause,
|
||||
const PRInt32& aFocusChange);
|
||||
|
||||
@@ -539,7 +539,7 @@ public class GeckoAppShell
|
||||
}
|
||||
}
|
||||
|
||||
public static void notifyIMEEnabled(int state, String typeHint, String modeHint,
|
||||
public static void notifyIMEEnabled(int state, String typeHint,
|
||||
String actionHint, boolean landscapeFS)
|
||||
{
|
||||
if (GeckoApp.surfaceView == null)
|
||||
@@ -549,7 +549,6 @@ public class GeckoAppShell
|
||||
In addition, the IME UI is hidden */
|
||||
GeckoApp.surfaceView.mIMEState = state;
|
||||
GeckoApp.surfaceView.mIMETypeHint = typeHint;
|
||||
GeckoApp.surfaceView.mIMEModeHint = modeHint;
|
||||
GeckoApp.surfaceView.mIMEActionHint = actionHint;
|
||||
GeckoApp.surfaceView.mIMELandscapeFS = landscapeFS;
|
||||
IMEStateUpdater.enableIME();
|
||||
|
||||
@@ -63,7 +63,6 @@ class GeckoSurfaceView
|
||||
initEditable("");
|
||||
mIMEState = IME_STATE_DISABLED;
|
||||
mIMETypeHint = "";
|
||||
mIMEModeHint = "";
|
||||
mIMEActionHint = "";
|
||||
}
|
||||
|
||||
@@ -503,20 +502,6 @@ class GeckoSurfaceView
|
||||
else if (mIMETypeHint.equalsIgnoreCase("time"))
|
||||
outAttrs.inputType = InputType.TYPE_CLASS_DATETIME |
|
||||
InputType.TYPE_DATETIME_VARIATION_TIME;
|
||||
else if (mIMEModeHint.equalsIgnoreCase("numeric"))
|
||||
outAttrs.inputType = InputType.TYPE_CLASS_NUMBER |
|
||||
InputType.TYPE_NUMBER_FLAG_SIGNED |
|
||||
InputType.TYPE_NUMBER_FLAG_DECIMAL;
|
||||
else if (mIMEModeHint.equalsIgnoreCase("digit"))
|
||||
outAttrs.inputType = InputType.TYPE_CLASS_NUMBER;
|
||||
else if (mIMEModeHint.equalsIgnoreCase("uppercase"))
|
||||
outAttrs.inputType |= InputType.TYPE_TEXT_FLAG_CAP_CHARACTERS;
|
||||
else if (mIMEModeHint.equalsIgnoreCase("lowercase"))
|
||||
outAttrs.inputType = InputType.TYPE_CLASS_TEXT;
|
||||
else if (mIMEModeHint.equalsIgnoreCase("titlecase"))
|
||||
outAttrs.inputType |= InputType.TYPE_TEXT_FLAG_CAP_WORDS;
|
||||
else if (mIMEModeHint.equalsIgnoreCase("autocapitalized"))
|
||||
outAttrs.inputType |= InputType.TYPE_TEXT_FLAG_CAP_SENTENCES;
|
||||
|
||||
if (mIMEActionHint.equalsIgnoreCase("go"))
|
||||
outAttrs.imeOptions = EditorInfo.IME_ACTION_GO;
|
||||
@@ -763,7 +748,6 @@ class GeckoSurfaceView
|
||||
Editable.Factory mEditableFactory;
|
||||
int mIMEState;
|
||||
String mIMETypeHint;
|
||||
String mIMEModeHint;
|
||||
String mIMEActionHint;
|
||||
boolean mIMELandscapeFS;
|
||||
|
||||
|
||||
@@ -576,12 +576,12 @@ public class GeckoAppShell
|
||||
mInputConnection.notifyIME(type, state);
|
||||
}
|
||||
|
||||
public static void notifyIMEEnabled(int state, String typeHint, String modeHint,
|
||||
public static void notifyIMEEnabled(int state, String typeHint,
|
||||
String actionHint, boolean landscapeFS) {
|
||||
// notifyIMEEnabled() still needs the landscapeFS parameter because it is called from JNI
|
||||
// code that assumes it has the same signature as XUL Fennec's (which does use landscapeFS).
|
||||
if (mInputConnection != null)
|
||||
mInputConnection.notifyIMEEnabled(state, typeHint, modeHint, actionHint);
|
||||
mInputConnection.notifyIMEEnabled(state, typeHint, actionHint);
|
||||
}
|
||||
|
||||
public static void notifyIMEChange(String text, int start, int end, int newEnd) {
|
||||
|
||||
@@ -87,7 +87,6 @@ class GeckoInputConnection
|
||||
private static final Timer mIMETimer = new Timer("GeckoInputConnection Timer");
|
||||
private static int mIMEState;
|
||||
private static String mIMETypeHint = "";
|
||||
private static String mIMEModeHint;
|
||||
private static String mIMEActionHint = "";
|
||||
|
||||
private String mCurrentInputMethod;
|
||||
@@ -807,20 +806,6 @@ class GeckoInputConnection
|
||||
else if (mIMETypeHint.equalsIgnoreCase("time"))
|
||||
outAttrs.inputType = InputType.TYPE_CLASS_DATETIME
|
||||
| InputType.TYPE_DATETIME_VARIATION_TIME;
|
||||
else if (mIMEModeHint.equalsIgnoreCase("numeric"))
|
||||
outAttrs.inputType = InputType.TYPE_CLASS_NUMBER |
|
||||
InputType.TYPE_NUMBER_FLAG_SIGNED |
|
||||
InputType.TYPE_NUMBER_FLAG_DECIMAL;
|
||||
else if (mIMEModeHint.equalsIgnoreCase("digit"))
|
||||
outAttrs.inputType = InputType.TYPE_CLASS_NUMBER;
|
||||
else if (mIMEModeHint.equalsIgnoreCase("uppercase"))
|
||||
outAttrs.inputType |= InputType.TYPE_TEXT_FLAG_CAP_CHARACTERS;
|
||||
else if (mIMEModeHint.equalsIgnoreCase("lowercase"))
|
||||
outAttrs.inputType = InputType.TYPE_CLASS_TEXT;
|
||||
else if (mIMEModeHint.equalsIgnoreCase("titlecase"))
|
||||
outAttrs.inputType |= InputType.TYPE_TEXT_FLAG_CAP_WORDS;
|
||||
else if (mIMEModeHint.equalsIgnoreCase("autocapitalized"))
|
||||
outAttrs.inputType |= InputType.TYPE_TEXT_FLAG_CAP_SENTENCES;
|
||||
|
||||
if (mIMEActionHint.equalsIgnoreCase("go"))
|
||||
outAttrs.imeOptions = EditorInfo.IME_ACTION_GO;
|
||||
@@ -1059,7 +1044,7 @@ class GeckoInputConnection
|
||||
});
|
||||
}
|
||||
|
||||
public void notifyIMEEnabled(final int state, final String typeHint, final String modeHint, final String actionHint) {
|
||||
public void notifyIMEEnabled(final int state, final String typeHint, final String actionHint) {
|
||||
postToUiThread(new Runnable() {
|
||||
public void run() {
|
||||
View v = getView();
|
||||
@@ -1070,7 +1055,6 @@ class GeckoInputConnection
|
||||
In addition, the IME UI is hidden */
|
||||
mIMEState = state;
|
||||
mIMETypeHint = (typeHint == null) ? "" : typeHint;
|
||||
mIMEModeHint = (modeHint == null) ? "" : modeHint;
|
||||
mIMEActionHint = (actionHint == null) ? "" : actionHint;
|
||||
IMEStateUpdater.enableIME();
|
||||
}
|
||||
|
||||
@@ -99,7 +99,7 @@ AndroidBridge::Init(JNIEnv *jEnv,
|
||||
mGeckoAppShellClass = (jclass) jEnv->NewGlobalRef(jGeckoAppShellClass);
|
||||
|
||||
jNotifyIME = (jmethodID) jEnv->GetStaticMethodID(jGeckoAppShellClass, "notifyIME", "(II)V");
|
||||
jNotifyIMEEnabled = (jmethodID) jEnv->GetStaticMethodID(jGeckoAppShellClass, "notifyIMEEnabled", "(ILjava/lang/String;Ljava/lang/String;Ljava/lang/String;Z)V");
|
||||
jNotifyIMEEnabled = (jmethodID) jEnv->GetStaticMethodID(jGeckoAppShellClass, "notifyIMEEnabled", "(ILjava/lang/String;Ljava/lang/String;Z)V");
|
||||
jNotifyIMEChange = (jmethodID) jEnv->GetStaticMethodID(jGeckoAppShellClass, "notifyIMEChange", "(Ljava/lang/String;III)V");
|
||||
jNotifyScreenShot = (jmethodID) jEnv->GetStaticMethodID(jGeckoAppShellClass, "notifyScreenShot", "(Ljava/nio/ByteBuffer;IIIIIIII)V");
|
||||
jAcknowledgeEventSync = (jmethodID) jEnv->GetStaticMethodID(jGeckoAppShellClass, "acknowledgeEventSync", "()V");
|
||||
@@ -263,7 +263,7 @@ jstring NewJavaString(AutoLocalJNIFrame* frame, const PRUnichar* string, PRUint3
|
||||
|
||||
void
|
||||
AndroidBridge::NotifyIMEEnabled(int aState, const nsAString& aTypeHint,
|
||||
const nsAString& aModeHint, const nsAString& aActionHint)
|
||||
const nsAString& aActionHint)
|
||||
{
|
||||
ALOG_BRIDGE("AndroidBridge::NotifyIMEEnabled");
|
||||
if (!sBridge)
|
||||
@@ -275,20 +275,18 @@ AndroidBridge::NotifyIMEEnabled(int aState, const nsAString& aTypeHint,
|
||||
|
||||
AutoLocalJNIFrame jniFrame(env);
|
||||
nsPromiseFlatString typeHint(aTypeHint);
|
||||
nsPromiseFlatString modeHint(aModeHint);
|
||||
nsPromiseFlatString actionHint(aActionHint);
|
||||
|
||||
jvalue args[5];
|
||||
jvalue args[4];
|
||||
args[0].i = aState;
|
||||
args[1].l = NewJavaString(&jniFrame, typeHint.get(), typeHint.Length());
|
||||
args[2].l = env->NewString(modeHint.get(), modeHint.Length());
|
||||
args[3].l = env->NewString(actionHint.get(), actionHint.Length());
|
||||
args[4].z = false;
|
||||
args[2].l = NewJavaString(&jniFrame, actionHint.get(), actionHint.Length());
|
||||
args[3].z = false;
|
||||
|
||||
PRInt32 landscapeFS;
|
||||
if (NS_SUCCEEDED(Preferences::GetInt(IME_FULLSCREEN_PREF, &landscapeFS))) {
|
||||
if (landscapeFS == 1) {
|
||||
args[4].z = true;
|
||||
args[3].z = true;
|
||||
} else if (landscapeFS == -1){
|
||||
if (NS_SUCCEEDED(
|
||||
Preferences::GetInt(IME_FULLSCREEN_THRESHOLD_PREF,
|
||||
@@ -297,7 +295,7 @@ AndroidBridge::NotifyIMEEnabled(int aState, const nsAString& aTypeHint,
|
||||
// threshold to pixels and multiply the height by 100
|
||||
if (nsWindow::GetAndroidScreenBounds().height * 100 <
|
||||
landscapeFS * Bridge()->GetDPI()) {
|
||||
args[4].z = true;
|
||||
args[3].z = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -142,7 +142,7 @@ public:
|
||||
static void NotifyIME(int aType, int aState);
|
||||
|
||||
static void NotifyIMEEnabled(int aState, const nsAString& aTypeHint,
|
||||
const nsAString& aModeHint, const nsAString& aActionHint);
|
||||
const nsAString& aActionHint);
|
||||
|
||||
static void NotifyIMEChange(const PRUnichar *aText, PRUint32 aTextLen, int aStart, int aEnd, int aNewEnd);
|
||||
|
||||
|
||||
@@ -2115,7 +2115,6 @@ nsWindow::SetInputContext(const InputContext& aContext,
|
||||
|
||||
AndroidBridge::NotifyIMEEnabled(enabled,
|
||||
aContext.mHTMLInputType,
|
||||
aContext.mHTMLInputInputmode,
|
||||
aContext.mActionHint);
|
||||
}
|
||||
|
||||
|
||||
@@ -281,9 +281,6 @@ struct InputContext {
|
||||
/* The type of the input if the input is a html input field */
|
||||
nsString mHTMLInputType;
|
||||
|
||||
/* The type of the inputmode */
|
||||
nsString mHTMLInputInputmode;
|
||||
|
||||
/* A hint for the action that is performed when the input is submitted */
|
||||
nsString mActionHint;
|
||||
};
|
||||
|
||||
@@ -363,7 +363,6 @@ PuppetWidget::SetInputContext(const InputContext& aContext,
|
||||
static_cast<PRInt32>(aContext.mIMEState.mEnabled),
|
||||
static_cast<PRInt32>(aContext.mIMEState.mOpen),
|
||||
aContext.mHTMLInputType,
|
||||
aContext.mHTMLInputInputmode,
|
||||
aContext.mActionHint,
|
||||
static_cast<PRInt32>(aAction.mCause),
|
||||
static_cast<PRInt32>(aAction.mFocusChange));
|
||||
|
||||
Reference in New Issue
Block a user