Bug 471923 - kill tab-left-edge and tab-right-edge -moz-appearance values. r+sr=roc

This commit is contained in:
Dão Gottwald 2009-01-04 15:01:48 +01:00
Родитель c7a4bd6c96
Коммит be0b70e77f
6 изменённых файлов: 39 добавлений и 52 удалений

Просмотреть файл

@ -99,12 +99,6 @@
// A single pane (inside the tabpanels container)
#define NS_THEME_TAB_PANEL 62
// The tab just before the selection
#define NS_THEME_TAB_LEFT_EDGE 63
// The tab just after the selection
#define NS_THEME_TAB_RIGHT_EDGE 64
// The tab panels container.
#define NS_THEME_TAB_PANELS 65

Просмотреть файл

@ -523,8 +523,6 @@ CSS_KEY(progressbar-vertical, progressbar_vertical)
CSS_KEY(progresschunk, progresschunk)
CSS_KEY(progresschunk-vertical, progresschunk_vertical)
CSS_KEY(tab, tab)
CSS_KEY(tab-left-edge, tab_left_edge)
CSS_KEY(tab-right-edge, tab_right_edge)
CSS_KEY(tabpanels, tabpanels)
CSS_KEY(tabpanel, tabpanel)
CSS_KEY(tab-scroll-arrow-back, tabscrollarrow_back)

Просмотреть файл

@ -402,8 +402,6 @@ const PRInt32 nsCSSProps::kAppearanceKTable[] = {
eCSSKeyword_progressbar_vertical, NS_THEME_PROGRESSBAR_VERTICAL,
eCSSKeyword_progresschunk_vertical, NS_THEME_PROGRESSBAR_CHUNK_VERTICAL,
eCSSKeyword_tab, NS_THEME_TAB,
eCSSKeyword_tab_left_edge, NS_THEME_TAB_LEFT_EDGE,
eCSSKeyword_tab_right_edge, NS_THEME_TAB_RIGHT_EDGE,
eCSSKeyword_tabpanels, NS_THEME_TAB_PANELS,
eCSSKeyword_tabpanel, NS_THEME_TAB_PANEL,
eCSSKeyword_tabscrollarrow_back, NS_THEME_TAB_SCROLLARROW_BACK,

Просмотреть файл

@ -108,14 +108,12 @@ tab:focus > .tab-middle {
tab[beforeselected="true"],
tab[afterselected="true"][chromedir="rtl"] {
-moz-appearance: tab-left-edge;
border-right: none;
-moz-border-radius-topright: 0;
}
tab[afterselected="true"],
tab[beforeselected="true"][chromedir="rtl"] {
-moz-appearance: tab-right-edge;
border-left: none;
-moz-border-radius-topleft: 0;
}

Просмотреть файл

@ -272,8 +272,6 @@ nsNativeThemeWin::GetTheme(PRUint8 aWidgetType)
case NS_THEME_PROGRESSBAR_CHUNK_VERTICAL:
return nsUXThemeData::GetTheme(eUXProgress);
case NS_THEME_TAB:
case NS_THEME_TAB_LEFT_EDGE:
case NS_THEME_TAB_RIGHT_EDGE:
case NS_THEME_TAB_PANEL:
case NS_THEME_TAB_PANELS:
return nsUXThemeData::GetTheme(eUXTab);
@ -695,9 +693,7 @@ nsNativeThemeWin::GetThemePartAndState(nsIFrame* aFrame, PRUint8 aWidgetType,
aState = TS_NORMAL;
return NS_OK;
}
case NS_THEME_TAB:
case NS_THEME_TAB_LEFT_EDGE:
case NS_THEME_TAB_RIGHT_EDGE: {
case NS_THEME_TAB: {
aPart = TABP_TAB;
if (!aFrame) {
aState = TS_NORMAL;
@ -976,21 +972,26 @@ RENDER_AGAIN:
// For left edge and right edge tabs, we need to adjust the widget
// rects and clip rects so that the edges don't get drawn.
if (aWidgetType == NS_THEME_TAB_LEFT_EDGE || aWidgetType == NS_THEME_TAB_RIGHT_EDGE) {
// HACK ALERT: There appears to be no way to really obtain this value, so we're forced
// to just use the default value for Luna (which also happens to be correct for
// all the other skins I've tried).
PRInt32 edgeSize = 2;
if (aWidgetType == NS_THEME_TAB) {
PRBool isLeft = IsLeftToSelectedTab(aFrame);
PRBool isRight = !isLeft && IsRightToSelectedTab(aFrame);
if (isLeft || isRight) {
// HACK ALERT: There appears to be no way to really obtain this value, so we're forced
// to just use the default value for Luna (which also happens to be correct for
// all the other skins I've tried).
PRInt32 edgeSize = 2;
// Armed with the size of the edge, we now need to either shift to the left or to the
// right. The clip rect won't include this extra area, so we know that we're
// effectively shifting the edge out of view (such that it won't be painted).
if (aWidgetType == NS_THEME_TAB_LEFT_EDGE)
// The right edge should not be drawn. Extend our rect by the edge size.
widgetRect.right += edgeSize;
else
// The left edge should not be drawn. Move the widget rect's left coord back.
widgetRect.left -= edgeSize;
// Armed with the size of the edge, we now need to either shift to the left or to the
// right. The clip rect won't include this extra area, so we know that we're
// effectively shifting the edge out of view (such that it won't be painted).
if (isLeft)
// The right edge should not be drawn. Extend our rect by the edge size.
widgetRect.right += edgeSize;
else
// The left edge should not be drawn. Move the widget rect's left coord back.
widgetRect.left -= edgeSize;
}
}
// widgetRect is the bounding box for a widget, yet the scale track is only
@ -1223,12 +1224,14 @@ nsNativeThemeWin::GetWidgetBorder(nsIDeviceContext* aContext,
aResult->right = outerRect.right - contentRect.right;
// Remove the edges for tabs that are before or after the selected tab,
if (aWidgetType == NS_THEME_TAB_LEFT_EDGE)
// Remove the right edge, since we won't be drawing it.
aResult->right = 0;
else if (aWidgetType == NS_THEME_TAB_RIGHT_EDGE)
// Remove the left edge, since we won't be drawing it.
aResult->left = 0;
if (aWidgetType == NS_THEME_TAB) {
if (IsLeftToSelectedTab(aFrame))
// Remove the right edge, since we won't be drawing it.
aResult->right = 0;
else if (IsRightToSelectedTab(aFrame))
// Remove the left edge, since we won't be drawing it.
aResult->left = 0;
}
if (aFrame && (aWidgetType == NS_THEME_TEXTFIELD || aWidgetType == NS_THEME_TEXTFIELD_MULTILINE)) {
nsIContent* content = aFrame->GetContent();
@ -1703,8 +1706,6 @@ nsNativeThemeWin::ClassicThemeSupportsWidget(nsPresContext* aPresContext,
case NS_THEME_PROGRESSBAR_CHUNK:
case NS_THEME_PROGRESSBAR_CHUNK_VERTICAL:
case NS_THEME_TAB:
case NS_THEME_TAB_LEFT_EDGE:
case NS_THEME_TAB_RIGHT_EDGE:
case NS_THEME_TAB_PANEL:
case NS_THEME_TAB_PANELS:
case NS_THEME_MENUITEM:
@ -1739,8 +1740,6 @@ nsNativeThemeWin::ClassicGetWidgetBorder(nsIDeviceContext* aContext,
case NS_THEME_DROPDOWN:
case NS_THEME_DROPDOWN_TEXTFIELD:
case NS_THEME_TAB:
case NS_THEME_TAB_LEFT_EDGE:
case NS_THEME_TAB_RIGHT_EDGE:
case NS_THEME_TEXTFIELD:
case NS_THEME_TEXTFIELD_MULTILINE:
(*aResult).top = (*aResult).left = (*aResult).bottom = (*aResult).right = 2;
@ -1871,8 +1870,6 @@ nsNativeThemeWin::ClassicGetMinimumWidgetSize(nsIRenderingContext* aContext, nsI
case NS_THEME_PROGRESSBAR:
case NS_THEME_PROGRESSBAR_VERTICAL:
case NS_THEME_TAB:
case NS_THEME_TAB_LEFT_EDGE:
case NS_THEME_TAB_RIGHT_EDGE:
case NS_THEME_TAB_PANEL:
case NS_THEME_TAB_PANELS:
// no minimum widget size
@ -2074,8 +2071,6 @@ nsresult nsNativeThemeWin::ClassicGetThemePartAndState(nsIFrame* aFrame, PRUint8
case NS_THEME_PROGRESSBAR:
case NS_THEME_PROGRESSBAR_VERTICAL:
case NS_THEME_TAB:
case NS_THEME_TAB_LEFT_EDGE:
case NS_THEME_TAB_RIGHT_EDGE:
case NS_THEME_TAB_PANEL:
case NS_THEME_TAB_PANELS:
case NS_THEME_MENUBAR:
@ -2555,14 +2550,12 @@ RENDER_AGAIN:
break;
// Draw Tab
case NS_THEME_TAB:
case NS_THEME_TAB_LEFT_EDGE:
case NS_THEME_TAB_RIGHT_EDGE: {
case NS_THEME_TAB: {
DrawTab(hdc, widgetRect,
IsBottomTab(aFrame) ? BF_BOTTOM : BF_TOP,
IsSelectedTab(aFrame),
aWidgetType != NS_THEME_TAB_RIGHT_EDGE,
aWidgetType != NS_THEME_TAB_LEFT_EDGE);
!IsRightToSelectedTab(aFrame),
!IsLeftToSelectedTab(aFrame));
break;
}
@ -2703,8 +2696,6 @@ nsNativeThemeWin::GetWidgetNativeDrawingFlags(PRUint8 aWidgetType)
case NS_THEME_PROGRESSBAR_CHUNK:
case NS_THEME_PROGRESSBAR_CHUNK_VERTICAL:
case NS_THEME_TAB:
case NS_THEME_TAB_LEFT_EDGE:
case NS_THEME_TAB_RIGHT_EDGE:
case NS_THEME_TAB_PANEL:
case NS_THEME_TAB_PANELS:
case NS_THEME_MENUBAR:

Просмотреть файл

@ -125,6 +125,14 @@ class nsNativeTheme
return IsNextToSelectedTab(aFrame, 1);
}
PRBool IsLeftToSelectedTab(nsIFrame* aFrame) {
return IsFrameRTL(aFrame) ? IsAfterSelectedTab(aFrame) : IsBeforeSelectedTab(aFrame);
}
PRBool IsRightToSelectedTab(nsIFrame* aFrame) {
return IsFrameRTL(aFrame) ? IsBeforeSelectedTab(aFrame) : IsAfterSelectedTab(aFrame);
}
// toolbarbutton:
PRBool IsCheckedButton(nsIFrame* aFrame) {
return CheckBooleanAttr(aFrame, nsWidgetAtoms::checked);