> Seconded. I got it working closely to what I said by doing : (see
> attached patch).
Invisible?
heh :) maybe list does not accept attachments !
here we go.
--- a/mozilla/content/html/content/src/nsHTMLInputElement.cpp 2006-12-30
06:47:55.000000000 -0400
+++ mozilla/content/html/content/src/nsHTMLInputElement.cpp 2007-01-31
10:19:28.000000000 -0400
@@ -1162,16 +1162,17 @@ nsHTMLInputElement::SetFocus(nsPresConte
nsLayoutUtils::ScrollIntoView(formControlFrame);
}
}
}
NS_IMETHODIMP
nsHTMLInputElement::Select()
{
+printf ("nsHTMLInputElement::Select\n\n");
nsresult rv = NS_OK;
nsIDocument* doc = GetCurrentDoc();
if (!doc)
return NS_OK;
// first see if we are disabled or not. If disabled then do nothing.
if (HasAttr(kNameSpaceID_None, nsGkAtoms::disabled)) {
@@ -1607,50 +1608,51 @@ nsHTMLInputElement::PostHandleEvent(nsEv
nsnull, &status);
} // case
} // switch
}
if (aVisitor.mEvent->message == NS_KEY_PRESS &&
mType == NS_FORM_INPUT_RADIO && !keyEvent->isAlt &&
!keyEvent->isControl && !keyEvent->isMeta) {
PRBool isMovingBack = PR_FALSE;
- switch (keyEvent->keyCode) {
- case NS_VK_UP:
- case NS_VK_LEFT:
- isMovingBack = PR_TRUE;
- case NS_VK_DOWN:
- case NS_VK_RIGHT:
- // Arrow key pressed, focus+select prev/next radio button
- nsCOMPtr<nsIRadioGroupContainer> container =
GetRadioGroupContainer();
- if (container) {
- nsAutoString name;
- if (GetNameIfExists(name)) {
- nsCOMPtr<nsIDOMHTMLInputElement> selectedRadioButton;
- container->GetNextRadioButton(name, isMovingBack, this,
-
getter_AddRefs(selectedRadioButton));
- nsCOMPtr<nsIContent> radioContent =
- do_QueryInterface(selectedRadioButton);
- if (radioContent) {
- rv = selectedRadioButton->Focus();
- if (NS_SUCCEEDED(rv)) {
- nsEventStatus status = nsEventStatus_eIgnore;
- nsMouseEvent event(NS_IS_TRUSTED_EVENT(aVisitor.mEvent),
- NS_MOUSE_CLICK, nsnull,
- nsMouseEvent::eReal);
- rv = nsEventDispatcher::Dispatch(radioContent,
- aVisitor.mPresContext,
- &event,
nsnull, &status);
+ if (!nsContentUtils::GetBoolPref("snav.enabled", PR_TRUE))
+ switch (keyEvent->keyCode) {
+ case NS_VK_UP:
+ case NS_VK_LEFT:
+ isMovingBack = PR_TRUE;
+ case NS_VK_DOWN:
+ case NS_VK_RIGHT:
+ // Arrow key pressed, focus+select prev/next radio button
+ nsCOMPtr<nsIRadioGroupContainer> container =
GetRadioGroupContainer();
+ if (container) {
+ nsAutoString name;
+ if (GetNameIfExists(name)) {
+ nsCOMPtr<nsIDOMHTMLInputElement> selectedRadioButton;
+ container->GetNextRadioButton(name, isMovingBack, this,
+
getter_AddRefs(selectedRadioButton));
+ nsCOMPtr<nsIContent> radioContent =
+ do_QueryInterface(selectedRadioButton);
+ if (radioContent) {
+ rv = selectedRadioButton->Focus();
if (NS_SUCCEEDED(rv)) {
- aVisitor.mEventStatus =
nsEventStatus_eConsumeNoDefault;
+ nsEventStatus status = nsEventStatus_eIgnore;
+ nsMouseEvent
event(NS_IS_TRUSTED_EVENT(aVisitor.mEvent),
+ NS_MOUSE_CLICK, nsnull,
+ nsMouseEvent::eReal);
+ rv = nsEventDispatcher::Dispatch(radioContent,
+ aVisitor.mPresContext,
+ &event,
nsnull, &status);
+ if (NS_SUCCEEDED(rv)) {
+ aVisitor.mEventStatus =
nsEventStatus_eConsumeNoDefault;
+ }
}
}
}
}
}
- }
}
/*
* If this is input type=text, and the user hit enter, fire onChange
* and submit the form (if we are in one)
*
* Bug 99920, bug 109463 and bug 147850:
* (a) if there is a submit control in the form, click the first
--
--Antonio Gomes
_______________________________________________
dev-embedding mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-embedding