123617 - can't tab to buttons checkboxes and radios in osx classic. r=jag, sr=bryner.
git-svn-id: svn://10.0.0.236/trunk@140329 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -316,8 +316,8 @@ nsNativeThemeMac::DrawWidgetBackground(nsIRenderingContext* aContext, nsIFrame*
|
||||
ConvertGeckoToNativeRect(transClipRect, clipRect);
|
||||
::ClipRect(&clipRect);
|
||||
#endif
|
||||
|
||||
PRInt32 eventState = GetContentState(aFrame);
|
||||
|
||||
PRInt32 eventState = GetContentState(aFrame, aWidgetType);
|
||||
|
||||
switch ( aWidgetType ) {
|
||||
|
||||
|
||||
@@ -84,11 +84,20 @@ nsNativeTheme::GetPrimaryPresShell(nsIFrame* aFrame, nsIPresShell** aResult)
|
||||
}
|
||||
|
||||
PRInt32
|
||||
nsNativeTheme::GetContentState(nsIFrame* aFrame)
|
||||
nsNativeTheme::GetContentState(nsIFrame* aFrame, PRUint8 aWidgetType)
|
||||
{
|
||||
if (!aFrame)
|
||||
return 0;
|
||||
|
||||
PRBool isXULCheckboxRadio = PR_FALSE;
|
||||
if (aWidgetType == NS_THEME_CHECKBOX || aWidgetType == NS_THEME_RADIO) {
|
||||
nsCOMPtr<nsIContent> checkboxRadioContent;
|
||||
aFrame->GetContent(getter_AddRefs(checkboxRadioContent));
|
||||
isXULCheckboxRadio = checkboxRadioContent->IsContentOfType(nsIContent::eXUL);
|
||||
if (isXULCheckboxRadio)
|
||||
aFrame->GetParent(&aFrame);
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIPresShell> shell;
|
||||
GetPrimaryPresShell(aFrame, getter_AddRefs(shell));
|
||||
if (!shell)
|
||||
@@ -102,6 +111,12 @@ nsNativeTheme::GetContentState(nsIFrame* aFrame)
|
||||
nsCOMPtr<nsIContent> content;
|
||||
aFrame->GetContent(getter_AddRefs(content));
|
||||
esm->GetContentState(content, flags);
|
||||
|
||||
if (isXULCheckboxRadio && aWidgetType == NS_THEME_RADIO) {
|
||||
if (IsFocused(aFrame))
|
||||
flags |= NS_EVENT_STATE_FOCUS;
|
||||
}
|
||||
|
||||
return flags;
|
||||
}
|
||||
|
||||
@@ -229,7 +244,7 @@ nsNativeTheme::IsWidgetStyled(nsIPresContext* aPresContext, nsIFrame* aFrame,
|
||||
lookAndFeel->GetColor(nsILookAndFeel::eColor_threedface,
|
||||
defaultBGColor);
|
||||
} else {
|
||||
PRInt32 contentState = GetContentState(aFrame);
|
||||
PRInt32 contentState = GetContentState(aFrame, aWidgetType);
|
||||
ConvertMarginToTwips(sButtonBorderSize, defaultBorderSize, p2t);
|
||||
if (contentState & NS_EVENT_STATE_HOVER &&
|
||||
contentState & NS_EVENT_STATE_ACTIVE)
|
||||
|
||||
@@ -55,13 +55,13 @@ class nsNativeTheme
|
||||
nsNativeTheme();
|
||||
|
||||
// Returns the content state (hover, focus, etc), see nsIEventStateManager.h
|
||||
PRInt32 GetContentState(nsIFrame* aFrame);
|
||||
PRInt32 GetContentState(nsIFrame* aFrame, PRUint8 aWidgetType);
|
||||
|
||||
// Returns whether the widget is already styled by content
|
||||
// Normally called from ThemeSupportsWidget to turn off native theming
|
||||
// for elements that are already styled.
|
||||
PRBool IsWidgetStyled(nsIPresContext* aPresContext, nsIFrame* aFrame,
|
||||
PRUint8 aWidgetType);
|
||||
PRUint8 aWidgetType);
|
||||
|
||||
// Accessors to widget-specific state information
|
||||
|
||||
@@ -84,6 +84,10 @@ class nsNativeTheme
|
||||
PRBool IsSelected(nsIFrame* aFrame) {
|
||||
return GetCheckedOrSelected(aFrame, PR_TRUE);
|
||||
}
|
||||
|
||||
PRBool IsFocused(nsIFrame* aFrame) {
|
||||
return CheckBooleanAttr(aFrame, mFocusedAtom);
|
||||
}
|
||||
|
||||
// tab:
|
||||
PRBool IsSelectedTab(nsIFrame* aFrame) {
|
||||
|
||||
@@ -31,7 +31,6 @@
|
||||
|
||||
button {
|
||||
-moz-appearance: button;
|
||||
-moz-user-focus: ignore;
|
||||
margin: 1px 5px 2px 5px;
|
||||
min-width: 6.3em;
|
||||
border: 6px solid;
|
||||
|
||||
@@ -31,7 +31,6 @@
|
||||
|
||||
checkbox {
|
||||
-moz-appearance: checkbox-container;
|
||||
-moz-user-focus: ignore;
|
||||
-moz-box-align: center;
|
||||
margin: 2px 4px;
|
||||
padding: 1px 2px 1px 4px;
|
||||
|
||||
@@ -29,10 +29,6 @@
|
||||
|
||||
/* ::::: radio ::::: */
|
||||
|
||||
radiogroup {
|
||||
-moz-user-focus: ignore;
|
||||
}
|
||||
|
||||
radio {
|
||||
-moz-appearance: radio-container;
|
||||
-moz-box-align: center;
|
||||
|
||||
Reference in New Issue
Block a user