Bug 476062. Instead of turning off -moz-appearance when an element has a box-shadow, just ignore the box-shadow. r+sr=dbaron

--HG--
extra : rebase_source : 68e79ec44afd089b93870a5d87ea549d5f04b9d6
This commit is contained in:
Robert O'Callahan 2009-04-01 14:07:18 +13:00
Родитель f91b31cf4a
Коммит fa161021f4
7 изменённых файлов: 9 добавлений и 37 удалений

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

@ -1108,7 +1108,7 @@ nsCSSRendering::PaintBoxShadowOuter(nsPresContext* aPresContext,
const nsRect& aDirtyRect)
{
const nsStyleBorder* styleBorder = aForFrame->GetStyleBorder();
if (!styleBorder->mBoxShadow)
if (!styleBorder->mBoxShadow || aForFrame->IsThemed())
return;
PRIntn sidesToSkip = aForFrame->GetSkipSides();
@ -1203,7 +1203,7 @@ nsCSSRendering::PaintBoxShadowInner(nsPresContext* aPresContext,
const nsRect& aDirtyRect)
{
const nsStyleBorder* styleBorder = aForFrame->GetStyleBorder();
if (!styleBorder->mBoxShadow)
if (!styleBorder->mBoxShadow || aForFrame->IsThemed())
return;
// Get any border radius, since box-shadow must also have rounded corners if the frame does

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

@ -150,7 +150,6 @@ enum nsLayoutPhase {
#define NS_AUTHOR_SPECIFIED_BACKGROUND (1 << 0)
#define NS_AUTHOR_SPECIFIED_BORDER (1 << 1)
#define NS_AUTHOR_SPECIFIED_PADDING (1 << 2)
#define NS_AUTHOR_SPECIFIED_BOX_SHADOW (1 << 3)
// An interface for presentation contexts. Presentation contexts are
// objects that provide an outer context for a presentation shell.

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

@ -3881,7 +3881,7 @@ ComputeOutlineAndEffectsRect(nsIFrame* aFrame, PRBool* aAnyOutlineOrEffects,
// box-shadow
nsCSSShadowArray* boxShadows = aFrame->GetStyleBorder()->mBoxShadow;
if (boxShadows) {
if (boxShadows && !aFrame->IsThemed()) {
nsRect shadows;
for (PRUint32 i = 0; i < boxShadows->Length(); ++i) {
nsRect tmpRect = r;

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

@ -1,21 +1,12 @@
<!DOCTYPE HTML>
<html>
<head>
<style>
body { overflow:hidden; }
input, button, select {
-moz-appearance:none;
}
</style>
</head>
<body>
<p><div style="-moz-appearance:button; width:100px; height:20px;"></div>
<p><input>
<p><input type=submit value=submit>
<p><input type=text value=text >
<p><input type=password value=password>
<p><input type=reset value=reset>
<p><input type=file>
<p><input type=image src="http://www.mozilla.org/favicon.ico">
<p><input type=button value=button>
<p><button> &lt;button> </button>
<p><button type=button> &lt;button type=button> </button>

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

@ -2,20 +2,18 @@
<html>
<head>
<style>
body { overflow:hidden; }
input, button, select {
-moz-box-shadow: -10000px 0px gold;
input, button, select, div {
-moz-box-shadow: 10px 10px gold, 10px 1000px blue;
}
</style>
</head>
<body>
<p><div style="-moz-appearance:button; width:100px; height:20px;"></div>
<p><input>
<p><input type=submit value=submit>
<p><input type=text value=text >
<p><input type=password value=password>
<p><input type=reset value=reset>
<p><input type=file>
<p><input type=image src="http://www.mozilla.org/favicon.ico">
<p><input type=button value=button>
<p><button> &lt;button> </button>
<p><button type=button> &lt;button type=button> </button>

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

@ -5657,15 +5657,13 @@ nsRuleNode::HasAuthorSpecifiedRules(nsStyleContext* aStyleContext,
nsRuleDataColor colorData;
nsRuleDataMargin marginData;
nsCSSValue firstBackgroundImage;
nsCSSValue firstBoxShadow;
PRUint32 nValues = 0;
PRUint32 inheritBits = 0;
if (ruleTypeMask & NS_AUTHOR_SPECIFIED_BACKGROUND)
inheritBits |= NS_STYLE_INHERIT_BIT(Background);
if (ruleTypeMask & (NS_AUTHOR_SPECIFIED_BORDER |
NS_AUTHOR_SPECIFIED_BOX_SHADOW))
if (ruleTypeMask & NS_AUTHOR_SPECIFIED_BORDER)
inheritBits |= NS_STYLE_INHERIT_BIT(Border);
if (ruleTypeMask & NS_AUTHOR_SPECIFIED_PADDING)
@ -5710,7 +5708,6 @@ nsRuleNode::HasAuthorSpecifiedRules(nsStyleContext* aStyleContext,
nsCSSValue* values[NS_ARRAY_LENGTH(backgroundValues) +
NS_ARRAY_LENGTH(borderValues) +
1 + // box-shadow
NS_ARRAY_LENGTH(paddingValues)];
if (ruleTypeMask & NS_AUTHOR_SPECIFIED_BACKGROUND) {
@ -5723,11 +5720,6 @@ nsRuleNode::HasAuthorSpecifiedRules(nsStyleContext* aStyleContext,
nValues += NS_ARRAY_LENGTH(borderValues);
}
if (ruleTypeMask & NS_AUTHOR_SPECIFIED_BOX_SHADOW) {
values[nValues] = &firstBoxShadow;
++nValues;
}
if (ruleTypeMask & NS_AUTHOR_SPECIFIED_PADDING) {
memcpy(&values[nValues], paddingValues, NS_ARRAY_LENGTH(paddingValues) * sizeof(nsCSSValue*));
nValues += NS_ARRAY_LENGTH(paddingValues);
@ -5759,13 +5751,6 @@ nsRuleNode::HasAuthorSpecifiedRules(nsStyleContext* aStyleContext,
// Handle background-image being a value list
firstBackgroundImage = colorData.mBackImage->mValue;
}
if ((ruleTypeMask & NS_AUTHOR_SPECIFIED_BOX_SHADOW) &&
marginData.mBoxShadow &&
firstBoxShadow.GetUnit() == eCSSUnit_Null) {
// Handle box-shadow being a value list
firstBoxShadow = marginData.mBoxShadow->mValue;
}
// Do the same nulling out as in GetBorderData, GetBackgroundData
// or GetPaddingData.
// We are sharing with some style rule. It really owns the data.

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

@ -192,8 +192,7 @@ nsNativeTheme::IsWidgetStyled(nsPresContext* aPresContext, nsIFrame* aFrame,
aFrame->GetContent()->IsNodeOfType(nsINode::eHTML) &&
aPresContext->HasAuthorSpecifiedRules(aFrame,
NS_AUTHOR_SPECIFIED_BORDER |
NS_AUTHOR_SPECIFIED_BACKGROUND |
NS_AUTHOR_SPECIFIED_BOX_SHADOW);
NS_AUTHOR_SPECIFIED_BACKGROUND);
}
PRBool