зеркало из https://github.com/mozilla/pjs.git
Bug 220187 TABINDEX property ignored for input type=file
r=aaronleventhal, sr=jst Two children of <input type=file> should have same tabindex with their parent. Patch by neo.liu@sun.com
This commit is contained in:
Родитель
95f4110336
Коммит
6d4c813d6a
|
@ -156,18 +156,20 @@ nsFileControlFrame::CreateAnonymousContent(nsIPresContext* aPresContext,
|
||||||
rv = ef->CreateInstanceByTag(nodeInfo,getter_AddRefs(mTextContent));
|
rv = ef->CreateInstanceByTag(nodeInfo,getter_AddRefs(mTextContent));
|
||||||
NS_ENSURE_SUCCESS(rv, rv);
|
NS_ENSURE_SUCCESS(rv, rv);
|
||||||
|
|
||||||
|
nsCOMPtr<nsIDOMHTMLInputElement> fileContent(do_QueryInterface(mContent, &rv));
|
||||||
|
NS_ENSURE_SUCCESS(rv, rv);
|
||||||
|
PRInt32 tabIndex = -1;
|
||||||
if (mTextContent) {
|
if (mTextContent) {
|
||||||
mTextContent->SetAttr(kNameSpaceID_None, nsHTMLAtoms::type, NS_LITERAL_STRING("text"), PR_FALSE);
|
mTextContent->SetAttr(kNameSpaceID_None, nsHTMLAtoms::type, NS_LITERAL_STRING("text"), PR_FALSE);
|
||||||
nsCOMPtr<nsIDOMHTMLInputElement> textControl = do_QueryInterface(mTextContent);
|
nsCOMPtr<nsIDOMHTMLInputElement> textControl = do_QueryInterface(mTextContent);
|
||||||
if (textControl) {
|
if (textControl) {
|
||||||
// Initialize value when we create the content in case the value was set
|
// Initialize value when we create the content in case the value was set
|
||||||
// before we got here
|
// before we got here
|
||||||
nsCOMPtr<nsIDOMHTMLInputElement> fileContent = do_QueryInterface(mContent);
|
nsAutoString value;
|
||||||
if (fileContent) {
|
fileContent->GetValue(value);
|
||||||
nsAutoString value;
|
textControl->SetValue(value);
|
||||||
fileContent->GetValue(value);
|
fileContent->GetTabIndex(&tabIndex);
|
||||||
textControl->SetValue(value);
|
textControl->SetTabIndex(tabIndex);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
aChildList.AppendElement(mTextContent);
|
aChildList.AppendElement(mTextContent);
|
||||||
}
|
}
|
||||||
|
@ -178,6 +180,11 @@ nsFileControlFrame::CreateAnonymousContent(nsIPresContext* aPresContext,
|
||||||
|
|
||||||
if (mBrowse) {
|
if (mBrowse) {
|
||||||
mBrowse->SetAttr(kNameSpaceID_None, nsHTMLAtoms::type, NS_LITERAL_STRING("button"), PR_FALSE);
|
mBrowse->SetAttr(kNameSpaceID_None, nsHTMLAtoms::type, NS_LITERAL_STRING("button"), PR_FALSE);
|
||||||
|
nsCOMPtr<nsIDOMHTMLInputElement> browseControl = do_QueryInterface(mBrowse);
|
||||||
|
if (browseControl) {
|
||||||
|
fileContent->GetTabIndex(&tabIndex);
|
||||||
|
browseControl->SetTabIndex(tabIndex);
|
||||||
|
}
|
||||||
|
|
||||||
aChildList.AppendElement(mBrowse);
|
aChildList.AppendElement(mBrowse);
|
||||||
|
|
||||||
|
|
|
@ -156,18 +156,20 @@ nsFileControlFrame::CreateAnonymousContent(nsIPresContext* aPresContext,
|
||||||
rv = ef->CreateInstanceByTag(nodeInfo,getter_AddRefs(mTextContent));
|
rv = ef->CreateInstanceByTag(nodeInfo,getter_AddRefs(mTextContent));
|
||||||
NS_ENSURE_SUCCESS(rv, rv);
|
NS_ENSURE_SUCCESS(rv, rv);
|
||||||
|
|
||||||
|
nsCOMPtr<nsIDOMHTMLInputElement> fileContent(do_QueryInterface(mContent, &rv));
|
||||||
|
NS_ENSURE_SUCCESS(rv, rv);
|
||||||
|
PRInt32 tabIndex = -1;
|
||||||
if (mTextContent) {
|
if (mTextContent) {
|
||||||
mTextContent->SetAttr(kNameSpaceID_None, nsHTMLAtoms::type, NS_LITERAL_STRING("text"), PR_FALSE);
|
mTextContent->SetAttr(kNameSpaceID_None, nsHTMLAtoms::type, NS_LITERAL_STRING("text"), PR_FALSE);
|
||||||
nsCOMPtr<nsIDOMHTMLInputElement> textControl = do_QueryInterface(mTextContent);
|
nsCOMPtr<nsIDOMHTMLInputElement> textControl = do_QueryInterface(mTextContent);
|
||||||
if (textControl) {
|
if (textControl) {
|
||||||
// Initialize value when we create the content in case the value was set
|
// Initialize value when we create the content in case the value was set
|
||||||
// before we got here
|
// before we got here
|
||||||
nsCOMPtr<nsIDOMHTMLInputElement> fileContent = do_QueryInterface(mContent);
|
nsAutoString value;
|
||||||
if (fileContent) {
|
fileContent->GetValue(value);
|
||||||
nsAutoString value;
|
textControl->SetValue(value);
|
||||||
fileContent->GetValue(value);
|
fileContent->GetTabIndex(&tabIndex);
|
||||||
textControl->SetValue(value);
|
textControl->SetTabIndex(tabIndex);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
aChildList.AppendElement(mTextContent);
|
aChildList.AppendElement(mTextContent);
|
||||||
}
|
}
|
||||||
|
@ -178,6 +180,11 @@ nsFileControlFrame::CreateAnonymousContent(nsIPresContext* aPresContext,
|
||||||
|
|
||||||
if (mBrowse) {
|
if (mBrowse) {
|
||||||
mBrowse->SetAttr(kNameSpaceID_None, nsHTMLAtoms::type, NS_LITERAL_STRING("button"), PR_FALSE);
|
mBrowse->SetAttr(kNameSpaceID_None, nsHTMLAtoms::type, NS_LITERAL_STRING("button"), PR_FALSE);
|
||||||
|
nsCOMPtr<nsIDOMHTMLInputElement> browseControl = do_QueryInterface(mBrowse);
|
||||||
|
if (browseControl) {
|
||||||
|
fileContent->GetTabIndex(&tabIndex);
|
||||||
|
browseControl->SetTabIndex(tabIndex);
|
||||||
|
}
|
||||||
|
|
||||||
aChildList.AppendElement(mBrowse);
|
aChildList.AppendElement(mBrowse);
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче