Backout the CSS parts of bug 72747 to see if that fixes the Tp regression.

This commit is contained in:
dbaron%dbaron.org 2004-08-26 22:35:38 +00:00
Родитель a58c184dbf
Коммит c1681a238f
49 изменённых файлов: 199 добавлений и 537 удалений

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

@ -2614,55 +2614,16 @@ nsRuleNode::ComputeDisplayData(nsStyleStruct* aStartStruct,
display->mFloats = parentDisplay->mFloats;
}
// overflow-x: enum, auto, inherit
if (eCSSUnit_Enumerated == displayData.mOverflowX.GetUnit()) {
display->mOverflowX = displayData.mOverflowX.GetIntValue();
// overflow: enum, auto, inherit
if (eCSSUnit_Enumerated == displayData.mOverflow.GetUnit()) {
display->mOverflow = displayData.mOverflow.GetIntValue();
}
else if (eCSSUnit_Auto == displayData.mOverflowX.GetUnit()) {
display->mOverflowX = NS_STYLE_OVERFLOW_AUTO;
else if (eCSSUnit_Auto == displayData.mOverflow.GetUnit()) {
display->mOverflow = NS_STYLE_OVERFLOW_AUTO;
}
else if (eCSSUnit_Inherit == displayData.mOverflowX.GetUnit()) {
else if (eCSSUnit_Inherit == displayData.mOverflow.GetUnit()) {
inherited = PR_TRUE;
display->mOverflowX = parentDisplay->mOverflowX;
}
// overflow-y: enum, auto, inherit
if (eCSSUnit_Enumerated == displayData.mOverflowY.GetUnit()) {
display->mOverflowY = displayData.mOverflowY.GetIntValue();
}
else if (eCSSUnit_Auto == displayData.mOverflowY.GetUnit()) {
display->mOverflowY = NS_STYLE_OVERFLOW_AUTO;
}
else if (eCSSUnit_Inherit == displayData.mOverflowY.GetUnit()) {
inherited = PR_TRUE;
display->mOverflowY = parentDisplay->mOverflowY;
}
// CSS3 overflow-x and overflow-y require some fixup as well in some
// cases. NS_STYLE_OVERFLOW_VISIBLE and NS_STYLE_OVERFLOW_CLIP are
// meaningful only when used in both dimensions.
if (display->mOverflowX != display->mOverflowY &&
(display->mOverflowX == NS_STYLE_OVERFLOW_VISIBLE ||
display->mOverflowX == NS_STYLE_OVERFLOW_CLIP ||
display->mOverflowY == NS_STYLE_OVERFLOW_VISIBLE ||
display->mOverflowY == NS_STYLE_OVERFLOW_CLIP)) {
// We can't store in the rule tree since a more specific rule might
// change these conditions.
inherited = PR_TRUE;
// NS_STYLE_OVERFLOW_CLIP is a deprecated value, so if it's specified
// in only one dimension, convert it to NS_STYLE_OVERFLOW_HIDDEN.
if (display->mOverflowX == NS_STYLE_OVERFLOW_CLIP)
display->mOverflowX = NS_STYLE_OVERFLOW_HIDDEN;
if (display->mOverflowY == NS_STYLE_OVERFLOW_CLIP)
display->mOverflowY = NS_STYLE_OVERFLOW_HIDDEN;
// If 'visible' is specified but doesn't match the other dimension, it
// turns into 'auto'.
if (display->mOverflowX == NS_STYLE_OVERFLOW_VISIBLE)
display->mOverflowX = NS_STYLE_OVERFLOW_AUTO;
if (display->mOverflowY == NS_STYLE_OVERFLOW_VISIBLE)
display->mOverflowY = NS_STYLE_OVERFLOW_AUTO;
display->mOverflow = parentDisplay->mOverflow;
}
// clip property: length, auto, inherit

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

@ -740,7 +740,7 @@ void nsStyleContext::DumpRegressionData(nsPresContext* aPresContext, FILE* out,
// DISPLAY
IndentBy(out,aIndent);
const nsStyleDisplay* disp = GetStyleDisplay();
fprintf(out, "<display data=\"%d %d %f %d %d %d %d %d %d %d %ld %ld %ld %ld %s\" />\n",
fprintf(out, "<display data=\"%d %d %f %d %d %d %d %d %d %ld %ld %ld %ld %s\" />\n",
(int)disp->mPosition,
(int)disp->mDisplay,
(float)disp->mOpacity,
@ -748,8 +748,7 @@ void nsStyleContext::DumpRegressionData(nsPresContext* aPresContext, FILE* out,
(int)disp->mBreakType,
(int)disp->mBreakBefore,
(int)disp->mBreakAfter,
(int)disp->mOverflowX,
(int)disp->mOverflowY,
(int)disp->mOverflow,
(int)disp->mClipFlags,
(long)disp->mClip.x,
(long)disp->mClip.y,

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

@ -3028,39 +3028,34 @@ nsGenericHTMLElement::MapScrollingAttributeInto(const nsMappedAttributes* aAttri
return;
// scrolling
nsCSSValue* overflowValues[2] = {
&aData->mDisplayData->mOverflowX,
&aData->mDisplayData->mOverflowY,
};
for (PRInt32 i = 0; i < NS_ARRAY_LENGTH(overflowValues); ++i) {
if (overflowValues[i]->GetUnit() == eCSSUnit_Null) {
const nsAttrValue* value = aAttributes->GetAttr(nsHTMLAtoms::scrolling);
if (value && value->Type() == nsAttrValue::eEnum) {
PRInt32 mappedValue;
switch (value->GetEnumValue()) {
case NS_STYLE_FRAME_ON:
case NS_STYLE_FRAME_SCROLL:
case NS_STYLE_FRAME_YES:
mappedValue = NS_STYLE_OVERFLOW_SCROLL;
break;
if (aData->mDisplayData->mOverflow.GetUnit() == eCSSUnit_Null) {
const nsAttrValue* value = aAttributes->GetAttr(nsHTMLAtoms::scrolling);
if (value && value->Type() == nsAttrValue::eEnum) {
PRInt32 mappedValue;
switch (value->GetEnumValue()) {
case NS_STYLE_FRAME_ON:
case NS_STYLE_FRAME_SCROLL:
case NS_STYLE_FRAME_YES:
mappedValue = NS_STYLE_OVERFLOW_SCROLL;
break;
case NS_STYLE_FRAME_OFF:
case NS_STYLE_FRAME_NOSCROLL:
case NS_STYLE_FRAME_NO:
mappedValue = NS_STYLE_OVERFLOW_HIDDEN;
break;
case NS_STYLE_FRAME_AUTO:
mappedValue = NS_STYLE_OVERFLOW_AUTO;
break;
case NS_STYLE_FRAME_OFF:
case NS_STYLE_FRAME_NOSCROLL:
case NS_STYLE_FRAME_NO:
mappedValue = NS_STYLE_OVERFLOW_HIDDEN;
break;
case NS_STYLE_FRAME_AUTO:
mappedValue = NS_STYLE_OVERFLOW_AUTO;
break;
default:
NS_NOTREACHED("unexpected value");
mappedValue = NS_STYLE_OVERFLOW_AUTO;
break;
}
overflowValues[i]->SetIntValue(mappedValue, eCSSUnit_Enumerated);
default:
NS_NOTREACHED("unexpected value");
mappedValue = NS_STYLE_OVERFLOW_AUTO;
break;
}
aData->mDisplayData->mOverflow.SetIntValue(mappedValue,
eCSSUnit_Enumerated);
}
}
}

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

@ -630,14 +630,6 @@ nsCSSDeclaration::GetValue(nsCSSProperty aProperty,
aValue.Append(PRUnichar(' '));
AppendValueToString(eCSSProperty_list_style_image, aValue);
break;
case eCSSProperty_overflow: {
nsCSSValue xValue, yValue;
GetValueOrImportantValue(eCSSProperty_overflow_x, xValue);
GetValueOrImportantValue(eCSSProperty_overflow_y, yValue);
if (xValue == yValue)
AppendValueToString(eCSSProperty_overflow_x, aValue);
break;
}
case eCSSProperty_pause: {
if (AppendValueToString(eCSSProperty_pause_after, aValue)) {
aValue.Append(PRUnichar(' '));
@ -977,27 +969,6 @@ nsCSSDeclaration::UseBackgroundPosition(nsAString & aString,
aBgPositionY = 0;
}
void
nsCSSDeclaration::TryOverflowShorthand(nsAString & aString,
PRInt32 & aOverflowX,
PRInt32 & aOverflowY) const
{
PRBool isImportant;
if (aOverflowX && aOverflowY &&
AllPropertiesSameImportance(aOverflowX, aOverflowY,
0, 0, 0, 0, isImportant)) {
nsCSSValue xValue, yValue;
GetValueOrImportantValue(eCSSProperty_overflow_x, xValue);
GetValueOrImportantValue(eCSSProperty_overflow_y, yValue);
if (xValue == yValue) {
AppendCSSValueToString(eCSSProperty_overflow_x, xValue, aString);
AppendImportanceToString(isImportant, aString);
aString.AppendLiteral("; ");
aOverflowX = aOverflowY = 0;
}
}
}
#define NS_CASE_OUTPUT_PROPERTY_VALUE(_prop, _index) \
case _prop: \
if (_index) { \
@ -1042,7 +1013,6 @@ nsCSSDeclaration::ToString(nsAString& aString) const
PRInt32 paddingTop = 0, paddingBottom = 0, paddingLeft = 0, paddingRight = 0;
PRInt32 bgColor = 0, bgImage = 0, bgRepeat = 0, bgAttachment = 0;
PRInt32 bgPositionX = 0, bgPositionY = 0;
PRInt32 overflowX = 0, overflowY = 0;
PRUint32 borderPropertiesSet = 0, finalBorderPropertiesToSet = 0;
for (index = 0; index < count; index++) {
nsCSSProperty property = OrderValueAt(index);
@ -1103,9 +1073,6 @@ nsCSSDeclaration::ToString(nsAString& aString) const
case eCSSProperty_background_x_position: bgPositionX = index+1; break;
case eCSSProperty_background_y_position: bgPositionY = index+1; break;
case eCSSProperty_overflow_x: overflowX = index+1; break;
case eCSSProperty_overflow_y: overflowY = index+1; break;
default: break;
}
}
@ -1174,7 +1141,6 @@ nsCSSDeclaration::ToString(nsAString& aString) const
TryBackgroundShorthand(aString,
bgColor, bgImage, bgRepeat, bgAttachment,
bgPositionX, bgPositionY);
TryOverflowShorthand(aString, overflowX, overflowY);
for (index = 0; index < count; index++) {
nsCSSProperty property = OrderValueAt(index);
@ -1250,9 +1216,6 @@ nsCSSDeclaration::ToString(nsAString& aString) const
break;
}
NS_CASE_OUTPUT_PROPERTY_VALUE(eCSSProperty_overflow_x, overflowX)
NS_CASE_OUTPUT_PROPERTY_VALUE(eCSSProperty_overflow_y, overflowY)
case eCSSProperty_margin_left_ltr_source:
case eCSSProperty_margin_left_rtl_source:
case eCSSProperty_margin_right_ltr_source:

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

@ -190,8 +190,6 @@ private:
void UseBackgroundPosition(nsAString & aString,
PRInt32 & aBgPositionX,
PRInt32 & aBgPositionY) const;
void TryOverflowShorthand(nsAString & aString,
PRInt32 & aOverflowX, PRInt32 & aOverflowY) const;
PRBool AllPropertiesSameImportance(PRInt32 aFirst, PRInt32 aSecond,
PRInt32 aThird, PRInt32 aFourth,

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

@ -261,7 +261,6 @@ protected:
#ifdef ENABLE_OUTLINE
PRBool ParseOutline(nsresult& aErrorCode);
#endif
PRBool ParseOverflow(nsresult& aErrorCode);
PRBool ParsePadding(nsresult& aErrorCode);
PRBool ParsePause(nsresult& aErrorCode);
PRBool ParsePlayDuring(nsresult& aErrorCode);
@ -4025,8 +4024,6 @@ PRBool CSSParserImpl::ParseProperty(nsresult& aErrorCode,
case eCSSProperty__moz_outline:
return ParseOutline(aErrorCode);
#endif
case eCSSProperty_overflow:
return ParseOverflow(aErrorCode);
case eCSSProperty_padding:
return ParsePadding(aErrorCode);
case eCSSProperty_padding_end:
@ -4160,7 +4157,6 @@ PRBool CSSParserImpl::ParseSingleValueProperty(nsresult& aErrorCode,
case eCSSProperty__moz_outline:
case eCSSProperty__moz_outline_radius:
#endif
case eCSSProperty_overflow:
case eCSSProperty_padding:
case eCSSProperty_padding_end:
case eCSSProperty_padding_left:
@ -4447,10 +4443,9 @@ PRBool CSSParserImpl::ParseSingleValueProperty(nsresult& aErrorCode,
return ParseVariant(aErrorCode, aValue, VARIANT_HKL,
nsCSSProps::kBorderWidthKTable);
#endif
case eCSSProperty_overflow_x:
case eCSSProperty_overflow_y:
case eCSSProperty_overflow:
return ParseVariant(aErrorCode, aValue, VARIANT_AHK,
nsCSSProps::kOverflowSubKTable);
nsCSSProps::kOverflowKTable);
case eCSSProperty_padding_bottom:
case eCSSProperty_padding_end_value: // for internal use
case eCSSProperty_padding_left_value: // for internal use
@ -5559,33 +5554,6 @@ PRBool CSSParserImpl::ParseOutline(nsresult& aErrorCode)
}
#endif
PRBool CSSParserImpl::ParseOverflow(nsresult& aErrorCode)
{
nsCSSValue overflow;
if (!ParseVariant(aErrorCode, overflow, VARIANT_AHK,
nsCSSProps::kOverflowKTable) ||
!ExpectEndProperty(aErrorCode, PR_TRUE))
return PR_FALSE;
nsCSSValue overflowX(overflow);
nsCSSValue overflowY(overflow);
if (eCSSUnit_Enumerated == overflow.GetUnit())
switch(overflow.GetIntValue()) {
case NS_STYLE_OVERFLOW_SCROLLBARS_HORIZONTAL:
overflowX.SetIntValue(NS_STYLE_OVERFLOW_SCROLL, eCSSUnit_Enumerated);
overflowY.SetIntValue(NS_STYLE_OVERFLOW_HIDDEN, eCSSUnit_Enumerated);
break;
case NS_STYLE_OVERFLOW_SCROLLBARS_VERTICAL:
overflowX.SetIntValue(NS_STYLE_OVERFLOW_HIDDEN, eCSSUnit_Enumerated);
overflowY.SetIntValue(NS_STYLE_OVERFLOW_SCROLL, eCSSUnit_Enumerated);
break;
}
AppendValue(eCSSProperty_overflow_x, overflowX);
AppendValue(eCSSProperty_overflow_y, overflowY);
aErrorCode = NS_OK;
return PR_TRUE;
}
PRBool CSSParserImpl::ParsePadding(nsresult& aErrorCode)
{
static const nsCSSProperty kPaddingSideIDs[] = {

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

@ -487,8 +487,7 @@ nsCSSDisplay::nsCSSDisplay(const nsCSSDisplay& aCopy)
mFloat(aCopy.mFloat),
mClear(aCopy.mClear),
mClip(aCopy.mClip),
mOverflowX(aCopy.mOverflowX),
mOverflowY(aCopy.mOverflowY),
mOverflow(aCopy.mOverflow),
mVisibility(aCopy.mVisibility),
mOpacity(aCopy.mOpacity),
// temp fix for bug 24000
@ -524,8 +523,7 @@ void nsCSSDisplay::List(FILE* out, PRInt32 aIndent) const
fputs(NS_LossyConvertUCS2toASCII(buffer).get(), out);
mClip.List(out, eCSSProperty_clip);
buffer.SetLength(0);
mOverflowX.AppendToString(buffer, eCSSProperty_overflow_x);
mOverflowY.AppendToString(buffer, eCSSProperty_overflow_y);
mOverflow.AppendToString(buffer, eCSSProperty_overflow);
fputs(NS_LossyConvertUCS2toASCII(buffer).get(), out);
}
#endif

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

@ -234,8 +234,7 @@ struct nsCSSDisplay : public nsCSSStruct {
nsCSSValue mFloat;
nsCSSValue mClear;
nsCSSRect mClip;
nsCSSValue mOverflowX;
nsCSSValue mOverflowY;
nsCSSValue mOverflow;
nsCSSValue mVisibility;
nsCSSValue mOpacity;

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

@ -2344,56 +2344,10 @@ nsComputedDOMStyle::GetOverflow(nsIFrame *aFrame,
const nsStyleDisplay* display = nsnull;
GetStyleData(eStyleStruct_Display, (const nsStyleStruct*&)display, aFrame);
if (display && display->mOverflowX == display->mOverflowY) {
if (display->mOverflowX != NS_STYLE_OVERFLOW_AUTO) {
const nsAFlatCString& overflow =
nsCSSProps::SearchKeywordTable(display->mOverflowX,
nsCSSProps::kOverflowKTable);
val->SetIdent(overflow);
} else {
val->SetIdent(nsLayoutAtoms::autoAtom);
}
} // XXX else what?
return CallQueryInterface(val, aValue);
}
nsresult
nsComputedDOMStyle::GetOverflowX(nsIFrame *aFrame,
nsIDOMCSSValue** aValue)
{
nsROCSSPrimitiveValue* val = GetROCSSPrimitiveValue();
NS_ENSURE_TRUE(val, NS_ERROR_OUT_OF_MEMORY);
const nsStyleDisplay* display = nsnull;
GetStyleData(eStyleStruct_Display, (const nsStyleStruct*&)display, aFrame);
if (display && display->mOverflowX != NS_STYLE_OVERFLOW_AUTO) {
if (display && display->mOverflow != NS_STYLE_OVERFLOW_AUTO) {
const nsAFlatCString& overflow =
nsCSSProps::SearchKeywordTable(display->mOverflowX,
nsCSSProps::kOverflowSubKTable);
val->SetIdent(overflow);
} else {
val->SetIdent(nsLayoutAtoms::autoAtom);
}
return CallQueryInterface(val, aValue);
}
nsresult
nsComputedDOMStyle::GetOverflowY(nsIFrame *aFrame,
nsIDOMCSSValue** aValue)
{
nsROCSSPrimitiveValue* val = GetROCSSPrimitiveValue();
NS_ENSURE_TRUE(val, NS_ERROR_OUT_OF_MEMORY);
const nsStyleDisplay* display = nsnull;
GetStyleData(eStyleStruct_Display, (const nsStyleStruct*&)display, aFrame);
if (display && display->mOverflowY != NS_STYLE_OVERFLOW_AUTO) {
const nsAFlatCString& overflow =
nsCSSProps::SearchKeywordTable(display->mOverflowY,
nsCSSProps::kOverflowSubKTable);
nsCSSProps::SearchKeywordTable(display->mOverflow,
nsCSSProps::kOverflowKTable);
val->SetIdent(overflow);
} else {
val->SetIdent(nsLayoutAtoms::autoAtom);
@ -3579,8 +3533,6 @@ nsComputedDOMStyle::GetQueryablePropertyMap(PRUint32* aLength)
// COMPUTED_STYLE_MAP_ENTRY(outline_style, OutlineStyle),
// COMPUTED_STYLE_MAP_ENTRY(outline_width, OutlineWidth),
COMPUTED_STYLE_MAP_ENTRY(overflow, Overflow),
COMPUTED_STYLE_MAP_ENTRY(overflow_x, OverflowX),
COMPUTED_STYLE_MAP_ENTRY(overflow_y, OverflowY),
//// COMPUTED_STYLE_MAP_ENTRY(padding, Padding),
COMPUTED_STYLE_MAP_ENTRY(padding_bottom, PaddingBottom),
COMPUTED_STYLE_MAP_ENTRY(padding_left, PaddingLeft),

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

@ -272,8 +272,6 @@ private:
nsresult GetPosition(nsIFrame *aFrame, nsIDOMCSSValue** aValue);
nsresult GetClip(nsIFrame *aFrame, nsIDOMCSSValue** aValue);
nsresult GetOverflow(nsIFrame *aFrame, nsIDOMCSSValue** aValue);
nsresult GetOverflowX(nsIFrame *aFrame, nsIDOMCSSValue** aValue);
nsresult GetOverflowY(nsIFrame *aFrame, nsIDOMCSSValue** aValue);
/* User interface properties */
nsresult GetCursor(nsIFrame *aFrame, nsIDOMCSSValue** aValue);

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

@ -184,8 +184,7 @@ CSSDisablePropsRule::CommonMapRuleInfoInto(nsRuleData* aData)
aData->mDisplayData->mPosition = staticposition;
nsCSSValue visible(NS_STYLE_OVERFLOW_VISIBLE, eCSSUnit_Enumerated);
aData->mDisplayData->mOverflowX = visible;
aData->mDisplayData->mOverflowY = visible;
aData->mDisplayData->mOverflow = visible;
// Nobody will care about 'break-before' or 'break-after', since
// they only apply to blocks (assuming we implement them correctly).

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

@ -406,9 +406,7 @@ CSS_PROP_SHORTHAND(-moz-outline, _moz_outline, MozOutline) // XXX This is tempo
CSS_PROP_OUTLINE(-moz-outline-color, _moz_outline_color, MozOutlineColor, Margin, mOutlineColor, eCSSType_Value, PR_FALSE, kOutlineColorKTable) // XXX bug 48973
CSS_PROP_OUTLINE(-moz-outline-style, _moz_outline_style, MozOutlineStyle, Margin, mOutlineStyle, eCSSType_Value, PR_FALSE, kBorderStyleKTable) // XXX bug 48973
CSS_PROP_OUTLINE(-moz-outline-width, _moz_outline_width, MozOutlineWidth, Margin, mOutlineWidth, eCSSType_Value, PR_TRUE, kBorderWidthKTable) // XXX bug 48973
CSS_PROP_SHORTHAND(overflow, overflow, Overflow)
CSS_PROP_DISPLAY(overflow-x, overflow_x, OverflowX, Display, mOverflowX, eCSSType_Value, PR_FALSE, kOverflowSubKTable)
CSS_PROP_DISPLAY(overflow-y, overflow_y, OverflowY, Display, mOverflowY, eCSSType_Value, PR_FALSE, kOverflowSubKTable)
CSS_PROP_DISPLAY(overflow, overflow, Overflow, Display, mOverflow, eCSSType_Value, PR_FALSE, kOverflowKTable)
CSS_PROP_SHORTHAND(padding, padding, Padding)
CSS_PROP_PADDING(padding-bottom, padding_bottom, PaddingBottom, Margin, mPadding.mBottom, eCSSType_Value, PR_TRUE, nsnull)
CSS_PROP_SHORTHAND(-moz-padding-end, padding_end, MozPaddingEnd)

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

@ -149,7 +149,6 @@ public:
static const PRInt32 kListStyleKTable[];
static const PRInt32 kOutlineColorKTable[];
static const PRInt32 kOverflowKTable[];
static const PRInt32 kOverflowSubKTable[];
static const PRInt32 kPageBreakKTable[];
static const PRInt32 kPageBreakInsideKTable[];
static const PRInt32 kPageMarksKTable[];

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

@ -731,8 +731,7 @@ struct nsStyleDisplay : public nsStyleStruct {
PRUint8 mBreakType; // [reset] see nsStyleConsts.h NS_STYLE_CLEAR_*
PRPackedBool mBreakBefore; // [reset]
PRPackedBool mBreakAfter; // [reset]
PRUint8 mOverflowX; // [reset] see nsStyleConsts.h
PRUint8 mOverflowY; // [reset] see nsStyleConsts.h
PRUint8 mOverflow; // [reset] see nsStyleConsts.h
PRUint8 mClipFlags; // [reset] see nsStyleConsts.h
PRBool IsBlockLevel() const {return (NS_STYLE_DISPLAY_BLOCK == mDisplay) ||
@ -750,18 +749,15 @@ struct nsStyleDisplay : public nsStyleStruct {
(NS_STYLE_POSITION_RELATIVE == mPosition);}
PRBool IsScrollableOverflow() const {
// mOverflowX and mOverflowY always match when one of them is
// NS_STYLE_OVERFLOW_VISIBLE or NS_STYLE_OVERFLOW_CLIP.
return mOverflowX != NS_STYLE_OVERFLOW_VISIBLE &&
mOverflowX != NS_STYLE_OVERFLOW_CLIP;
return mOverflow != NS_STYLE_OVERFLOW_VISIBLE &&
mOverflow != NS_STYLE_OVERFLOW_CLIP;
}
// For table elements that don't support scroll frame creation, we
// support 'overflow: hidden' to mean 'overflow: -moz-hidden-unscrollable'.
PRBool IsTableClip() const {
return mOverflowX == NS_STYLE_OVERFLOW_CLIP ||
(mOverflowX == NS_STYLE_OVERFLOW_HIDDEN &&
mOverflowY == NS_STYLE_OVERFLOW_HIDDEN);
return mOverflow == NS_STYLE_OVERFLOW_CLIP ||
mOverflow == NS_STYLE_OVERFLOW_HIDDEN;
}
};

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

@ -679,7 +679,6 @@ const PRInt32 nsCSSProps::kOverflowKTable[] = {
eCSSKeyword_visible, NS_STYLE_OVERFLOW_VISIBLE,
eCSSKeyword_hidden, NS_STYLE_OVERFLOW_HIDDEN,
eCSSKeyword_scroll, NS_STYLE_OVERFLOW_SCROLL,
// Deprecated:
eCSSKeyword__moz_scrollbars_none, NS_STYLE_OVERFLOW_HIDDEN,
eCSSKeyword__moz_scrollbars_horizontal, NS_STYLE_OVERFLOW_SCROLLBARS_HORIZONTAL,
eCSSKeyword__moz_scrollbars_vertical, NS_STYLE_OVERFLOW_SCROLLBARS_VERTICAL,
@ -687,15 +686,6 @@ const PRInt32 nsCSSProps::kOverflowKTable[] = {
-1,-1
};
const PRInt32 nsCSSProps::kOverflowSubKTable[] = {
eCSSKeyword_visible, NS_STYLE_OVERFLOW_VISIBLE,
eCSSKeyword_hidden, NS_STYLE_OVERFLOW_HIDDEN,
eCSSKeyword_scroll, NS_STYLE_OVERFLOW_SCROLL,
// Deprecated:
eCSSKeyword__moz_hidden_unscrollable, NS_STYLE_OVERFLOW_CLIP,
-1,-1
};
const PRInt32 nsCSSProps::kPageBreakKTable[] = {
eCSSKeyword_always, NS_STYLE_PAGE_BREAK_ALWAYS,
eCSSKeyword_avoid, NS_STYLE_PAGE_BREAK_AVOID,
@ -1326,12 +1316,6 @@ static const nsCSSProperty gMozOutlineSubpropTable[] = {
eCSSProperty_UNKNOWN
};
static const nsCSSProperty gOverflowSubpropTable[] = {
eCSSProperty_overflow_x,
eCSSProperty_overflow_y,
eCSSProperty_UNKNOWN
};
static const nsCSSProperty gPaddingSubpropTable[] = {
// Code relies on these being in top-right-bottom-left order.
eCSSProperty_padding_top,

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

@ -1102,8 +1102,7 @@ nsStyleDisplay::nsStyleDisplay()
mBreakType = NS_STYLE_CLEAR_NONE;
mBreakBefore = PR_FALSE;
mBreakAfter = PR_FALSE;
mOverflowX = NS_STYLE_OVERFLOW_VISIBLE;
mOverflowY = NS_STYLE_OVERFLOW_VISIBLE;
mOverflow = NS_STYLE_OVERFLOW_VISIBLE;
mClipFlags = NS_STYLE_CLIP_AUTO;
mClip.SetRect(0,0,0,0);
mOpacity = 1.0f;
@ -1120,8 +1119,7 @@ nsStyleDisplay::nsStyleDisplay(const nsStyleDisplay& aSource)
mBreakType = aSource.mBreakType;
mBreakBefore = aSource.mBreakBefore;
mBreakAfter = aSource.mBreakAfter;
mOverflowX = aSource.mOverflowX;
mOverflowY = aSource.mOverflowY;
mOverflow = aSource.mOverflow;
mClipFlags = aSource.mClipFlags;
mClip = aSource.mClip;
mOpacity = aSource.mOpacity;
@ -1135,8 +1133,7 @@ nsChangeHint nsStyleDisplay::CalcDifference(const nsStyleDisplay& aOther) const
|| mPosition != aOther.mPosition
|| mDisplay != aOther.mDisplay
|| (mFloats == NS_STYLE_FLOAT_NONE) != (aOther.mFloats == NS_STYLE_FLOAT_NONE)
|| mOverflowX != aOther.mOverflowX
|| mOverflowY != aOther.mOverflowY
|| mOverflow != aOther.mOverflow
// might need to create a view to handle change from 1.0 to partial opacity
|| (mOpacity != aOther.mOpacity
&& ((mOpacity < 1.0) != (aOther.mOpacity < 1.0))))

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

@ -563,11 +563,4 @@ interface nsIDOMNSCSS2Properties : nsIDOMCSS2Properties
attribute DOMString opacity;
// raises(DOMException) on setting
/* Mozilla extensions */
attribute DOMString overflowX;
// raises(DOMException) on setting
attribute DOMString overflowY;
// raises(DOMException) on setting
};

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

@ -3344,15 +3344,13 @@ nsCSSFrameConstructor::ConstructDocElementTableFrame(nsIPresShell* aPresS
static PRBool CheckOverflow(nsPresContext* aPresContext,
const nsStyleDisplay* aDisplay)
{
if (aDisplay->mOverflowX == NS_STYLE_OVERFLOW_VISIBLE)
if (aDisplay->mOverflow == NS_STYLE_OVERFLOW_VISIBLE)
return PR_FALSE;
if (aDisplay->mOverflowX == NS_STYLE_OVERFLOW_CLIP)
aPresContext->SetViewportOverflowOverride(NS_STYLE_OVERFLOW_HIDDEN,
NS_STYLE_OVERFLOW_HIDDEN);
if (aDisplay->mOverflow == NS_STYLE_OVERFLOW_CLIP)
aPresContext->SetViewportOverflowOverride(NS_STYLE_OVERFLOW_HIDDEN);
else
aPresContext->SetViewportOverflowOverride(aDisplay->mOverflowX,
aDisplay->mOverflowY);
aPresContext->SetViewportOverflowOverride(aDisplay->mOverflow);
return PR_TRUE;
}
@ -3369,8 +3367,7 @@ nsIContent*
nsCSSFrameConstructor::PropagateScrollToViewport(nsPresContext* aPresContext)
{
// Set default
aPresContext->SetViewportOverflowOverride(NS_STYLE_OVERFLOW_AUTO,
NS_STYLE_OVERFLOW_AUTO);
aPresContext->SetViewportOverflowOverride(NS_STYLE_OVERFLOW_AUTO);
// We never mess with the viewport scroll state
// when printing or in print preview

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

@ -140,7 +140,7 @@ static NS_DEFINE_CID(kSelectionImageService, NS_SELECTIONIMAGESERVICE_CID);
nsPresContext::nsPresContext(nsPresContextType aType)
: mType(aType),
mViewportStyleOverflow(NS_STYLE_OVERFLOW_AUTO, NS_STYLE_OVERFLOW_AUTO),
mViewportStyleOverflow(NS_STYLE_OVERFLOW_AUTO),
mCompatibilityMode(eCompatibility_FullStandards),
mImageAnimationModePref(imgIContainer::kNormalAnimMode),
mDefaultVariableFont("serif", NS_FONT_STYLE_NORMAL, NS_FONT_VARIANT_NORMAL,

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

@ -438,12 +438,11 @@ public:
ScrollbarStyles(PRUint8 h, PRUint8 v) : mHorizontal(h), mVertical(v) {}
ScrollbarStyles() {}
};
void SetViewportOverflowOverride(PRUint8 aX, PRUint8 aY)
void SetViewportOverflowOverride(PRUint8 aOverflow)
{
mViewportStyleOverflow.mHorizontal = aX;
mViewportStyleOverflow.mVertical = aY;
mViewportStyleOverflow = aOverflow;
}
ScrollbarStyles GetViewportOverflowOverride()
PRUint8 GetViewportOverflowOverride()
{
return mViewportStyleOverflow;
}
@ -655,7 +654,7 @@ protected:
nscolor mFocusBackgroundColor;
nscolor mFocusTextColor;
ScrollbarStyles mViewportStyleOverflow;
PRUint8 mViewportStyleOverflow;
PRUint8 mFocusRingWidth;
nsCompatibility mCompatibilityMode;

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

@ -438,12 +438,11 @@ public:
ScrollbarStyles(PRUint8 h, PRUint8 v) : mHorizontal(h), mVertical(v) {}
ScrollbarStyles() {}
};
void SetViewportOverflowOverride(PRUint8 aX, PRUint8 aY)
void SetViewportOverflowOverride(PRUint8 aOverflow)
{
mViewportStyleOverflow.mHorizontal = aX;
mViewportStyleOverflow.mVertical = aY;
mViewportStyleOverflow = aOverflow;
}
ScrollbarStyles GetViewportOverflowOverride()
PRUint8 GetViewportOverflowOverride()
{
return mViewportStyleOverflow;
}
@ -655,7 +654,7 @@ protected:
nscolor mFocusBackgroundColor;
nscolor mFocusTextColor;
ScrollbarStyles mViewportStyleOverflow;
PRUint8 mViewportStyleOverflow;
PRUint8 mFocusRingWidth;
nsCompatibility mCompatibilityMode;

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

@ -140,7 +140,7 @@ static NS_DEFINE_CID(kSelectionImageService, NS_SELECTIONIMAGESERVICE_CID);
nsPresContext::nsPresContext(nsPresContextType aType)
: mType(aType),
mViewportStyleOverflow(NS_STYLE_OVERFLOW_AUTO, NS_STYLE_OVERFLOW_AUTO),
mViewportStyleOverflow(NS_STYLE_OVERFLOW_AUTO),
mCompatibilityMode(eCompatibility_FullStandards),
mImageAnimationModePref(imgIContainer::kNormalAnimMode),
mDefaultVariableFont("serif", NS_FONT_STYLE_NORMAL, NS_FONT_VARIANT_NORMAL,

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

@ -1637,8 +1637,8 @@ nsTextControlFrame::CreateAnonymousContent(nsPresContext* aPresContext,
// setting -moz-hidden-unscrollable overflow (NS_STYLE_OVERFLOW_CLIP)
// doesn't paint the caret for some reason.
const nsStyleDisplay* disp = GetStyleDisplay();
if (disp->mOverflowX != NS_STYLE_OVERFLOW_VISIBLE &&
disp->mOverflowX != NS_STYLE_OVERFLOW_CLIP) {
if (disp->mOverflow != NS_STYLE_OVERFLOW_VISIBLE &&
disp->mOverflow != NS_STYLE_OVERFLOW_CLIP) {
rv = divContent->SetAttr(kNameSpaceID_None, nsHTMLAtoms::style,
NS_LITERAL_STRING("overflow: inherit;"),
PR_FALSE);

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

@ -910,7 +910,7 @@ nsBlockFrame::Reflow(nsPresContext* aPresContext,
}
if (NS_FRAME_IS_NOT_COMPLETE(state.mReflowStatus)) {
if (NS_STYLE_OVERFLOW_CLIP == aReflowState.mStyleDisplay->mOverflowX) {
if (NS_STYLE_OVERFLOW_CLIP == aReflowState.mStyleDisplay->mOverflow) {
state.mReflowStatus = NS_FRAME_COMPLETE;
}
else {
@ -1382,7 +1382,7 @@ nsBlockFrame::ComputeCombinedArea(const nsHTMLReflowState& aReflowState,
// XXX_perf: This can be done incrementally. It is currently one of
// the things that makes incremental reflow O(N^2).
nsRect area(0, 0, aMetrics.width, aMetrics.height);
if (NS_STYLE_OVERFLOW_CLIP != aReflowState.mStyleDisplay->mOverflowX) {
if (NS_STYLE_OVERFLOW_CLIP != aReflowState.mStyleDisplay->mOverflow) {
for (line_iterator line = begin_lines(), line_end = end_lines();
line != line_end;
++line) {
@ -5326,7 +5326,7 @@ nsBlockFrame::Paint(nsPresContext* aPresContext,
// If overflow is hidden then set the clip rect so that children don't
// leak out of us. Note that because overflow'-clip' only applies to
// the content area we do this after painting the border and background
if (NS_STYLE_OVERFLOW_CLIP == disp->mOverflowX) {
if (NS_STYLE_OVERFLOW_CLIP == disp->mOverflow) {
aRenderingContext.PushState();
SetOverflowClipRect(aRenderingContext);
}
@ -5340,7 +5340,7 @@ nsBlockFrame::Paint(nsPresContext* aPresContext,
PaintDecorationsAndChildren(aPresContext, aRenderingContext,
aDirtyRect, aWhichLayer, PR_TRUE);
if (NS_STYLE_OVERFLOW_CLIP == disp->mOverflowX)
if (NS_STYLE_OVERFLOW_CLIP == disp->mOverflow)
aRenderingContext.PopState();
#if 0

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

@ -650,7 +650,7 @@ SyncFrameViewGeometryDependentProperties(nsPresContext* aPresContext,
const nsStyleVisibility* vis = aStyleContext->GetStyleVisibility();
if ((nsViewVisibility_kShow == aView->GetVisibility()
&& NS_STYLE_VISIBILITY_HIDDEN == vis->mVisible)
|| (NS_STYLE_OVERFLOW_VISIBLE == display->mOverflowX
|| (NS_STYLE_OVERFLOW_VISIBLE == display->mOverflow
&& (kidState & NS_FRAME_OUTSIDE_CHILDREN) != 0)) {
viewHasTransparentContent = PR_TRUE;
}
@ -671,7 +671,7 @@ SyncFrameViewGeometryDependentProperties(nsPresContext* aPresContext,
// in the style context...
PRBool isBlockLevel = display->IsBlockLevel() || (kidState & NS_FRAME_OUT_OF_FLOW);
PRBool hasClip = display->IsAbsolutelyPositioned() && (display->mClipFlags & NS_STYLE_CLIP_RECT);
PRBool hasOverflowClip = isBlockLevel && (display->mOverflowX == NS_STYLE_OVERFLOW_CLIP);
PRBool hasOverflowClip = isBlockLevel && (display->mOverflow == NS_STYLE_OVERFLOW_CLIP);
if (hasClip || hasOverflowClip) {
nsSize frameSize = aFrame->GetSize();
nsRect clipRect;
@ -922,7 +922,7 @@ nsContainerFrame::FrameNeedsView(nsIFrame* aFrame)
// block-level, but we can't trust that the style context 'display' value is
// set correctly
if ((display->IsBlockLevel() || display->IsFloating()) &&
(display->mOverflowX == NS_STYLE_OVERFLOW_CLIP)) {
(display->mOverflow == NS_STYLE_OVERFLOW_CLIP)) {
// XXX Check for the frame being a block frame and only force a view
// in that case, because adding a view for box frames seems to cause
// problems for XUL...

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

@ -659,11 +659,25 @@ nsSubDocumentFrame::ShowDocShell()
nsCOMPtr<nsIScrollable> sc(do_QueryInterface(docShell));
if (sc) {
const nsStyleDisplay *disp = GetStyleDisplay();
nsPresContext::ScrollbarStyles pref;
PRUint8 overflow = GetStyleDisplay()->mOverflow;
switch (overflow) {
case NS_STYLE_OVERFLOW_SCROLLBARS_VERTICAL:
pref.mHorizontal = NS_STYLE_OVERFLOW_HIDDEN;
pref.mVertical = NS_STYLE_OVERFLOW_SCROLL;
break;
case NS_STYLE_OVERFLOW_SCROLLBARS_HORIZONTAL:
pref.mHorizontal = NS_STYLE_OVERFLOW_SCROLL;
pref.mVertical = NS_STYLE_OVERFLOW_HIDDEN;
break;
default:
pref.mHorizontal = overflow;
pref.mVertical = overflow;
}
sc->SetDefaultScrollbarPreferences(nsIScrollable::ScrollOrientation_X,
ConvertOverflow(disp->mOverflowX));
ConvertOverflow(pref.mHorizontal));
sc->SetDefaultScrollbarPreferences(nsIScrollable::ScrollOrientation_Y,
ConvertOverflow(disp->mOverflowY));
ConvertOverflow(pref.mVertical));
}
PRInt32 itemType = nsIDocShellTreeItem::typeContent;

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

@ -1157,6 +1157,26 @@ static void HandleScrollPref(nsIScrollable *aScrollable, PRInt32 aOrientation,
}
}
static nsGfxScrollFrameInner::ScrollbarStyles
ConvertOverflow(PRUint8 aOverflow)
{
nsGfxScrollFrameInner::ScrollbarStyles result;
switch (aOverflow) {
case NS_STYLE_OVERFLOW_SCROLLBARS_VERTICAL:
result.mHorizontal = NS_STYLE_OVERFLOW_HIDDEN;
result.mVertical = NS_STYLE_OVERFLOW_SCROLL;
break;
case NS_STYLE_OVERFLOW_SCROLLBARS_HORIZONTAL:
result.mHorizontal = NS_STYLE_OVERFLOW_SCROLL;
result.mVertical = NS_STYLE_OVERFLOW_HIDDEN;
break;
default:
result.mHorizontal = aOverflow;
result.mVertical = aOverflow;
}
return result;
}
nsGfxScrollFrameInner::ScrollbarStyles
nsGfxScrollFrameInner::GetScrollbarStylesFromFrame() const
{
@ -1167,7 +1187,7 @@ nsGfxScrollFrameInner::GetScrollbarStylesFromFrame() const
parent->GetFirstChild(nsnull) ==
NS_STATIC_CAST(const nsIFrame*, mOuter)) {
nsPresContext *presContext = mOuter->GetPresContext();
result = presContext->GetViewportOverflowOverride();
result = ConvertOverflow(presContext->GetViewportOverflowOverride());
nsCOMPtr<nsISupports> container = presContext->GetContainer();
nsCOMPtr<nsIScrollable> scrollable = do_QueryInterface(container);
@ -1176,9 +1196,7 @@ nsGfxScrollFrameInner::GetScrollbarStylesFromFrame() const
HandleScrollPref(scrollable, nsIScrollable::ScrollOrientation_Y,
result.mVertical);
} else {
const nsStyleDisplay *disp = mOuter->GetStyleDisplay();
result.mHorizontal = disp->mOverflowX;
result.mVertical = disp->mOverflowY;
result = ConvertOverflow(mOuter->GetStyleDisplay()->mOverflow);
}
NS_ASSERTION(result.mHorizontal != NS_STYLE_OVERFLOW_VISIBLE &&

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

@ -910,7 +910,7 @@ nsBlockFrame::Reflow(nsPresContext* aPresContext,
}
if (NS_FRAME_IS_NOT_COMPLETE(state.mReflowStatus)) {
if (NS_STYLE_OVERFLOW_CLIP == aReflowState.mStyleDisplay->mOverflowX) {
if (NS_STYLE_OVERFLOW_CLIP == aReflowState.mStyleDisplay->mOverflow) {
state.mReflowStatus = NS_FRAME_COMPLETE;
}
else {
@ -1382,7 +1382,7 @@ nsBlockFrame::ComputeCombinedArea(const nsHTMLReflowState& aReflowState,
// XXX_perf: This can be done incrementally. It is currently one of
// the things that makes incremental reflow O(N^2).
nsRect area(0, 0, aMetrics.width, aMetrics.height);
if (NS_STYLE_OVERFLOW_CLIP != aReflowState.mStyleDisplay->mOverflowX) {
if (NS_STYLE_OVERFLOW_CLIP != aReflowState.mStyleDisplay->mOverflow) {
for (line_iterator line = begin_lines(), line_end = end_lines();
line != line_end;
++line) {
@ -5326,7 +5326,7 @@ nsBlockFrame::Paint(nsPresContext* aPresContext,
// If overflow is hidden then set the clip rect so that children don't
// leak out of us. Note that because overflow'-clip' only applies to
// the content area we do this after painting the border and background
if (NS_STYLE_OVERFLOW_CLIP == disp->mOverflowX) {
if (NS_STYLE_OVERFLOW_CLIP == disp->mOverflow) {
aRenderingContext.PushState();
SetOverflowClipRect(aRenderingContext);
}
@ -5340,7 +5340,7 @@ nsBlockFrame::Paint(nsPresContext* aPresContext,
PaintDecorationsAndChildren(aPresContext, aRenderingContext,
aDirtyRect, aWhichLayer, PR_TRUE);
if (NS_STYLE_OVERFLOW_CLIP == disp->mOverflowX)
if (NS_STYLE_OVERFLOW_CLIP == disp->mOverflow)
aRenderingContext.PopState();
#if 0

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

@ -650,7 +650,7 @@ SyncFrameViewGeometryDependentProperties(nsPresContext* aPresContext,
const nsStyleVisibility* vis = aStyleContext->GetStyleVisibility();
if ((nsViewVisibility_kShow == aView->GetVisibility()
&& NS_STYLE_VISIBILITY_HIDDEN == vis->mVisible)
|| (NS_STYLE_OVERFLOW_VISIBLE == display->mOverflowX
|| (NS_STYLE_OVERFLOW_VISIBLE == display->mOverflow
&& (kidState & NS_FRAME_OUTSIDE_CHILDREN) != 0)) {
viewHasTransparentContent = PR_TRUE;
}
@ -671,7 +671,7 @@ SyncFrameViewGeometryDependentProperties(nsPresContext* aPresContext,
// in the style context...
PRBool isBlockLevel = display->IsBlockLevel() || (kidState & NS_FRAME_OUT_OF_FLOW);
PRBool hasClip = display->IsAbsolutelyPositioned() && (display->mClipFlags & NS_STYLE_CLIP_RECT);
PRBool hasOverflowClip = isBlockLevel && (display->mOverflowX == NS_STYLE_OVERFLOW_CLIP);
PRBool hasOverflowClip = isBlockLevel && (display->mOverflow == NS_STYLE_OVERFLOW_CLIP);
if (hasClip || hasOverflowClip) {
nsSize frameSize = aFrame->GetSize();
nsRect clipRect;
@ -922,7 +922,7 @@ nsContainerFrame::FrameNeedsView(nsIFrame* aFrame)
// block-level, but we can't trust that the style context 'display' value is
// set correctly
if ((display->IsBlockLevel() || display->IsFloating()) &&
(display->mOverflowX == NS_STYLE_OVERFLOW_CLIP)) {
(display->mOverflow == NS_STYLE_OVERFLOW_CLIP)) {
// XXX Check for the frame being a block frame and only force a view
// in that case, because adding a view for box frames seems to cause
// problems for XUL...

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

@ -1157,6 +1157,26 @@ static void HandleScrollPref(nsIScrollable *aScrollable, PRInt32 aOrientation,
}
}
static nsGfxScrollFrameInner::ScrollbarStyles
ConvertOverflow(PRUint8 aOverflow)
{
nsGfxScrollFrameInner::ScrollbarStyles result;
switch (aOverflow) {
case NS_STYLE_OVERFLOW_SCROLLBARS_VERTICAL:
result.mHorizontal = NS_STYLE_OVERFLOW_HIDDEN;
result.mVertical = NS_STYLE_OVERFLOW_SCROLL;
break;
case NS_STYLE_OVERFLOW_SCROLLBARS_HORIZONTAL:
result.mHorizontal = NS_STYLE_OVERFLOW_SCROLL;
result.mVertical = NS_STYLE_OVERFLOW_HIDDEN;
break;
default:
result.mHorizontal = aOverflow;
result.mVertical = aOverflow;
}
return result;
}
nsGfxScrollFrameInner::ScrollbarStyles
nsGfxScrollFrameInner::GetScrollbarStylesFromFrame() const
{
@ -1167,7 +1187,7 @@ nsGfxScrollFrameInner::GetScrollbarStylesFromFrame() const
parent->GetFirstChild(nsnull) ==
NS_STATIC_CAST(const nsIFrame*, mOuter)) {
nsPresContext *presContext = mOuter->GetPresContext();
result = presContext->GetViewportOverflowOverride();
result = ConvertOverflow(presContext->GetViewportOverflowOverride());
nsCOMPtr<nsISupports> container = presContext->GetContainer();
nsCOMPtr<nsIScrollable> scrollable = do_QueryInterface(container);
@ -1176,9 +1196,7 @@ nsGfxScrollFrameInner::GetScrollbarStylesFromFrame() const
HandleScrollPref(scrollable, nsIScrollable::ScrollOrientation_Y,
result.mVertical);
} else {
const nsStyleDisplay *disp = mOuter->GetStyleDisplay();
result.mHorizontal = disp->mOverflowX;
result.mVertical = disp->mOverflowY;
result = ConvertOverflow(mOuter->GetStyleDisplay()->mOverflow);
}
NS_ASSERTION(result.mHorizontal != NS_STYLE_OVERFLOW_VISIBLE &&

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

@ -659,11 +659,25 @@ nsSubDocumentFrame::ShowDocShell()
nsCOMPtr<nsIScrollable> sc(do_QueryInterface(docShell));
if (sc) {
const nsStyleDisplay *disp = GetStyleDisplay();
nsPresContext::ScrollbarStyles pref;
PRUint8 overflow = GetStyleDisplay()->mOverflow;
switch (overflow) {
case NS_STYLE_OVERFLOW_SCROLLBARS_VERTICAL:
pref.mHorizontal = NS_STYLE_OVERFLOW_HIDDEN;
pref.mVertical = NS_STYLE_OVERFLOW_SCROLL;
break;
case NS_STYLE_OVERFLOW_SCROLLBARS_HORIZONTAL:
pref.mHorizontal = NS_STYLE_OVERFLOW_SCROLL;
pref.mVertical = NS_STYLE_OVERFLOW_HIDDEN;
break;
default:
pref.mHorizontal = overflow;
pref.mVertical = overflow;
}
sc->SetDefaultScrollbarPreferences(nsIScrollable::ScrollOrientation_X,
ConvertOverflow(disp->mOverflowX));
ConvertOverflow(pref.mHorizontal));
sc->SetDefaultScrollbarPreferences(nsIScrollable::ScrollOrientation_Y,
ConvertOverflow(disp->mOverflowY));
ConvertOverflow(pref.mVertical));
}
PRInt32 itemType = nsIDocShellTreeItem::typeContent;

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

@ -1637,8 +1637,8 @@ nsTextControlFrame::CreateAnonymousContent(nsPresContext* aPresContext,
// setting -moz-hidden-unscrollable overflow (NS_STYLE_OVERFLOW_CLIP)
// doesn't paint the caret for some reason.
const nsStyleDisplay* disp = GetStyleDisplay();
if (disp->mOverflowX != NS_STYLE_OVERFLOW_VISIBLE &&
disp->mOverflowX != NS_STYLE_OVERFLOW_CLIP) {
if (disp->mOverflow != NS_STYLE_OVERFLOW_VISIBLE &&
disp->mOverflow != NS_STYLE_OVERFLOW_CLIP) {
rv = divContent->SetAttr(kNameSpaceID_None, nsHTMLAtoms::style,
NS_LITERAL_STRING("overflow: inherit;"),
PR_FALSE);

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

@ -3344,15 +3344,13 @@ nsCSSFrameConstructor::ConstructDocElementTableFrame(nsIPresShell* aPresS
static PRBool CheckOverflow(nsPresContext* aPresContext,
const nsStyleDisplay* aDisplay)
{
if (aDisplay->mOverflowX == NS_STYLE_OVERFLOW_VISIBLE)
if (aDisplay->mOverflow == NS_STYLE_OVERFLOW_VISIBLE)
return PR_FALSE;
if (aDisplay->mOverflowX == NS_STYLE_OVERFLOW_CLIP)
aPresContext->SetViewportOverflowOverride(NS_STYLE_OVERFLOW_HIDDEN,
NS_STYLE_OVERFLOW_HIDDEN);
if (aDisplay->mOverflow == NS_STYLE_OVERFLOW_CLIP)
aPresContext->SetViewportOverflowOverride(NS_STYLE_OVERFLOW_HIDDEN);
else
aPresContext->SetViewportOverflowOverride(aDisplay->mOverflowX,
aDisplay->mOverflowY);
aPresContext->SetViewportOverflowOverride(aDisplay->mOverflow);
return PR_TRUE;
}
@ -3369,8 +3367,7 @@ nsIContent*
nsCSSFrameConstructor::PropagateScrollToViewport(nsPresContext* aPresContext)
{
// Set default
aPresContext->SetViewportOverflowOverride(NS_STYLE_OVERFLOW_AUTO,
NS_STYLE_OVERFLOW_AUTO);
aPresContext->SetViewportOverflowOverride(NS_STYLE_OVERFLOW_AUTO);
// We never mess with the viewport scroll state
// when printing or in print preview

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

@ -630,14 +630,6 @@ nsCSSDeclaration::GetValue(nsCSSProperty aProperty,
aValue.Append(PRUnichar(' '));
AppendValueToString(eCSSProperty_list_style_image, aValue);
break;
case eCSSProperty_overflow: {
nsCSSValue xValue, yValue;
GetValueOrImportantValue(eCSSProperty_overflow_x, xValue);
GetValueOrImportantValue(eCSSProperty_overflow_y, yValue);
if (xValue == yValue)
AppendValueToString(eCSSProperty_overflow_x, aValue);
break;
}
case eCSSProperty_pause: {
if (AppendValueToString(eCSSProperty_pause_after, aValue)) {
aValue.Append(PRUnichar(' '));
@ -977,27 +969,6 @@ nsCSSDeclaration::UseBackgroundPosition(nsAString & aString,
aBgPositionY = 0;
}
void
nsCSSDeclaration::TryOverflowShorthand(nsAString & aString,
PRInt32 & aOverflowX,
PRInt32 & aOverflowY) const
{
PRBool isImportant;
if (aOverflowX && aOverflowY &&
AllPropertiesSameImportance(aOverflowX, aOverflowY,
0, 0, 0, 0, isImportant)) {
nsCSSValue xValue, yValue;
GetValueOrImportantValue(eCSSProperty_overflow_x, xValue);
GetValueOrImportantValue(eCSSProperty_overflow_y, yValue);
if (xValue == yValue) {
AppendCSSValueToString(eCSSProperty_overflow_x, xValue, aString);
AppendImportanceToString(isImportant, aString);
aString.AppendLiteral("; ");
aOverflowX = aOverflowY = 0;
}
}
}
#define NS_CASE_OUTPUT_PROPERTY_VALUE(_prop, _index) \
case _prop: \
if (_index) { \
@ -1042,7 +1013,6 @@ nsCSSDeclaration::ToString(nsAString& aString) const
PRInt32 paddingTop = 0, paddingBottom = 0, paddingLeft = 0, paddingRight = 0;
PRInt32 bgColor = 0, bgImage = 0, bgRepeat = 0, bgAttachment = 0;
PRInt32 bgPositionX = 0, bgPositionY = 0;
PRInt32 overflowX = 0, overflowY = 0;
PRUint32 borderPropertiesSet = 0, finalBorderPropertiesToSet = 0;
for (index = 0; index < count; index++) {
nsCSSProperty property = OrderValueAt(index);
@ -1103,9 +1073,6 @@ nsCSSDeclaration::ToString(nsAString& aString) const
case eCSSProperty_background_x_position: bgPositionX = index+1; break;
case eCSSProperty_background_y_position: bgPositionY = index+1; break;
case eCSSProperty_overflow_x: overflowX = index+1; break;
case eCSSProperty_overflow_y: overflowY = index+1; break;
default: break;
}
}
@ -1174,7 +1141,6 @@ nsCSSDeclaration::ToString(nsAString& aString) const
TryBackgroundShorthand(aString,
bgColor, bgImage, bgRepeat, bgAttachment,
bgPositionX, bgPositionY);
TryOverflowShorthand(aString, overflowX, overflowY);
for (index = 0; index < count; index++) {
nsCSSProperty property = OrderValueAt(index);
@ -1250,9 +1216,6 @@ nsCSSDeclaration::ToString(nsAString& aString) const
break;
}
NS_CASE_OUTPUT_PROPERTY_VALUE(eCSSProperty_overflow_x, overflowX)
NS_CASE_OUTPUT_PROPERTY_VALUE(eCSSProperty_overflow_y, overflowY)
case eCSSProperty_margin_left_ltr_source:
case eCSSProperty_margin_left_rtl_source:
case eCSSProperty_margin_right_ltr_source:

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

@ -190,8 +190,6 @@ private:
void UseBackgroundPosition(nsAString & aString,
PRInt32 & aBgPositionX,
PRInt32 & aBgPositionY) const;
void TryOverflowShorthand(nsAString & aString,
PRInt32 & aOverflowX, PRInt32 & aOverflowY) const;
PRBool AllPropertiesSameImportance(PRInt32 aFirst, PRInt32 aSecond,
PRInt32 aThird, PRInt32 aFourth,

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

@ -261,7 +261,6 @@ protected:
#ifdef ENABLE_OUTLINE
PRBool ParseOutline(nsresult& aErrorCode);
#endif
PRBool ParseOverflow(nsresult& aErrorCode);
PRBool ParsePadding(nsresult& aErrorCode);
PRBool ParsePause(nsresult& aErrorCode);
PRBool ParsePlayDuring(nsresult& aErrorCode);
@ -4025,8 +4024,6 @@ PRBool CSSParserImpl::ParseProperty(nsresult& aErrorCode,
case eCSSProperty__moz_outline:
return ParseOutline(aErrorCode);
#endif
case eCSSProperty_overflow:
return ParseOverflow(aErrorCode);
case eCSSProperty_padding:
return ParsePadding(aErrorCode);
case eCSSProperty_padding_end:
@ -4160,7 +4157,6 @@ PRBool CSSParserImpl::ParseSingleValueProperty(nsresult& aErrorCode,
case eCSSProperty__moz_outline:
case eCSSProperty__moz_outline_radius:
#endif
case eCSSProperty_overflow:
case eCSSProperty_padding:
case eCSSProperty_padding_end:
case eCSSProperty_padding_left:
@ -4447,10 +4443,9 @@ PRBool CSSParserImpl::ParseSingleValueProperty(nsresult& aErrorCode,
return ParseVariant(aErrorCode, aValue, VARIANT_HKL,
nsCSSProps::kBorderWidthKTable);
#endif
case eCSSProperty_overflow_x:
case eCSSProperty_overflow_y:
case eCSSProperty_overflow:
return ParseVariant(aErrorCode, aValue, VARIANT_AHK,
nsCSSProps::kOverflowSubKTable);
nsCSSProps::kOverflowKTable);
case eCSSProperty_padding_bottom:
case eCSSProperty_padding_end_value: // for internal use
case eCSSProperty_padding_left_value: // for internal use
@ -5559,33 +5554,6 @@ PRBool CSSParserImpl::ParseOutline(nsresult& aErrorCode)
}
#endif
PRBool CSSParserImpl::ParseOverflow(nsresult& aErrorCode)
{
nsCSSValue overflow;
if (!ParseVariant(aErrorCode, overflow, VARIANT_AHK,
nsCSSProps::kOverflowKTable) ||
!ExpectEndProperty(aErrorCode, PR_TRUE))
return PR_FALSE;
nsCSSValue overflowX(overflow);
nsCSSValue overflowY(overflow);
if (eCSSUnit_Enumerated == overflow.GetUnit())
switch(overflow.GetIntValue()) {
case NS_STYLE_OVERFLOW_SCROLLBARS_HORIZONTAL:
overflowX.SetIntValue(NS_STYLE_OVERFLOW_SCROLL, eCSSUnit_Enumerated);
overflowY.SetIntValue(NS_STYLE_OVERFLOW_HIDDEN, eCSSUnit_Enumerated);
break;
case NS_STYLE_OVERFLOW_SCROLLBARS_VERTICAL:
overflowX.SetIntValue(NS_STYLE_OVERFLOW_HIDDEN, eCSSUnit_Enumerated);
overflowY.SetIntValue(NS_STYLE_OVERFLOW_SCROLL, eCSSUnit_Enumerated);
break;
}
AppendValue(eCSSProperty_overflow_x, overflowX);
AppendValue(eCSSProperty_overflow_y, overflowY);
aErrorCode = NS_OK;
return PR_TRUE;
}
PRBool CSSParserImpl::ParsePadding(nsresult& aErrorCode)
{
static const nsCSSProperty kPaddingSideIDs[] = {

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

@ -406,9 +406,7 @@ CSS_PROP_SHORTHAND(-moz-outline, _moz_outline, MozOutline) // XXX This is tempo
CSS_PROP_OUTLINE(-moz-outline-color, _moz_outline_color, MozOutlineColor, Margin, mOutlineColor, eCSSType_Value, PR_FALSE, kOutlineColorKTable) // XXX bug 48973
CSS_PROP_OUTLINE(-moz-outline-style, _moz_outline_style, MozOutlineStyle, Margin, mOutlineStyle, eCSSType_Value, PR_FALSE, kBorderStyleKTable) // XXX bug 48973
CSS_PROP_OUTLINE(-moz-outline-width, _moz_outline_width, MozOutlineWidth, Margin, mOutlineWidth, eCSSType_Value, PR_TRUE, kBorderWidthKTable) // XXX bug 48973
CSS_PROP_SHORTHAND(overflow, overflow, Overflow)
CSS_PROP_DISPLAY(overflow-x, overflow_x, OverflowX, Display, mOverflowX, eCSSType_Value, PR_FALSE, kOverflowSubKTable)
CSS_PROP_DISPLAY(overflow-y, overflow_y, OverflowY, Display, mOverflowY, eCSSType_Value, PR_FALSE, kOverflowSubKTable)
CSS_PROP_DISPLAY(overflow, overflow, Overflow, Display, mOverflow, eCSSType_Value, PR_FALSE, kOverflowKTable)
CSS_PROP_SHORTHAND(padding, padding, Padding)
CSS_PROP_PADDING(padding-bottom, padding_bottom, PaddingBottom, Margin, mPadding.mBottom, eCSSType_Value, PR_TRUE, nsnull)
CSS_PROP_SHORTHAND(-moz-padding-end, padding_end, MozPaddingEnd)

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

@ -679,7 +679,6 @@ const PRInt32 nsCSSProps::kOverflowKTable[] = {
eCSSKeyword_visible, NS_STYLE_OVERFLOW_VISIBLE,
eCSSKeyword_hidden, NS_STYLE_OVERFLOW_HIDDEN,
eCSSKeyword_scroll, NS_STYLE_OVERFLOW_SCROLL,
// Deprecated:
eCSSKeyword__moz_scrollbars_none, NS_STYLE_OVERFLOW_HIDDEN,
eCSSKeyword__moz_scrollbars_horizontal, NS_STYLE_OVERFLOW_SCROLLBARS_HORIZONTAL,
eCSSKeyword__moz_scrollbars_vertical, NS_STYLE_OVERFLOW_SCROLLBARS_VERTICAL,
@ -687,15 +686,6 @@ const PRInt32 nsCSSProps::kOverflowKTable[] = {
-1,-1
};
const PRInt32 nsCSSProps::kOverflowSubKTable[] = {
eCSSKeyword_visible, NS_STYLE_OVERFLOW_VISIBLE,
eCSSKeyword_hidden, NS_STYLE_OVERFLOW_HIDDEN,
eCSSKeyword_scroll, NS_STYLE_OVERFLOW_SCROLL,
// Deprecated:
eCSSKeyword__moz_hidden_unscrollable, NS_STYLE_OVERFLOW_CLIP,
-1,-1
};
const PRInt32 nsCSSProps::kPageBreakKTable[] = {
eCSSKeyword_always, NS_STYLE_PAGE_BREAK_ALWAYS,
eCSSKeyword_avoid, NS_STYLE_PAGE_BREAK_AVOID,
@ -1326,12 +1316,6 @@ static const nsCSSProperty gMozOutlineSubpropTable[] = {
eCSSProperty_UNKNOWN
};
static const nsCSSProperty gOverflowSubpropTable[] = {
eCSSProperty_overflow_x,
eCSSProperty_overflow_y,
eCSSProperty_UNKNOWN
};
static const nsCSSProperty gPaddingSubpropTable[] = {
// Code relies on these being in top-right-bottom-left order.
eCSSProperty_padding_top,

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

@ -149,7 +149,6 @@ public:
static const PRInt32 kListStyleKTable[];
static const PRInt32 kOutlineColorKTable[];
static const PRInt32 kOverflowKTable[];
static const PRInt32 kOverflowSubKTable[];
static const PRInt32 kPageBreakKTable[];
static const PRInt32 kPageBreakInsideKTable[];
static const PRInt32 kPageMarksKTable[];

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

@ -487,8 +487,7 @@ nsCSSDisplay::nsCSSDisplay(const nsCSSDisplay& aCopy)
mFloat(aCopy.mFloat),
mClear(aCopy.mClear),
mClip(aCopy.mClip),
mOverflowX(aCopy.mOverflowX),
mOverflowY(aCopy.mOverflowY),
mOverflow(aCopy.mOverflow),
mVisibility(aCopy.mVisibility),
mOpacity(aCopy.mOpacity),
// temp fix for bug 24000
@ -524,8 +523,7 @@ void nsCSSDisplay::List(FILE* out, PRInt32 aIndent) const
fputs(NS_LossyConvertUCS2toASCII(buffer).get(), out);
mClip.List(out, eCSSProperty_clip);
buffer.SetLength(0);
mOverflowX.AppendToString(buffer, eCSSProperty_overflow_x);
mOverflowY.AppendToString(buffer, eCSSProperty_overflow_y);
mOverflow.AppendToString(buffer, eCSSProperty_overflow);
fputs(NS_LossyConvertUCS2toASCII(buffer).get(), out);
}
#endif

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

@ -234,8 +234,7 @@ struct nsCSSDisplay : public nsCSSStruct {
nsCSSValue mFloat;
nsCSSValue mClear;
nsCSSRect mClip;
nsCSSValue mOverflowX;
nsCSSValue mOverflowY;
nsCSSValue mOverflow;
nsCSSValue mVisibility;
nsCSSValue mOpacity;

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

@ -2344,56 +2344,10 @@ nsComputedDOMStyle::GetOverflow(nsIFrame *aFrame,
const nsStyleDisplay* display = nsnull;
GetStyleData(eStyleStruct_Display, (const nsStyleStruct*&)display, aFrame);
if (display && display->mOverflowX == display->mOverflowY) {
if (display->mOverflowX != NS_STYLE_OVERFLOW_AUTO) {
const nsAFlatCString& overflow =
nsCSSProps::SearchKeywordTable(display->mOverflowX,
nsCSSProps::kOverflowKTable);
val->SetIdent(overflow);
} else {
val->SetIdent(nsLayoutAtoms::autoAtom);
}
} // XXX else what?
return CallQueryInterface(val, aValue);
}
nsresult
nsComputedDOMStyle::GetOverflowX(nsIFrame *aFrame,
nsIDOMCSSValue** aValue)
{
nsROCSSPrimitiveValue* val = GetROCSSPrimitiveValue();
NS_ENSURE_TRUE(val, NS_ERROR_OUT_OF_MEMORY);
const nsStyleDisplay* display = nsnull;
GetStyleData(eStyleStruct_Display, (const nsStyleStruct*&)display, aFrame);
if (display && display->mOverflowX != NS_STYLE_OVERFLOW_AUTO) {
if (display && display->mOverflow != NS_STYLE_OVERFLOW_AUTO) {
const nsAFlatCString& overflow =
nsCSSProps::SearchKeywordTable(display->mOverflowX,
nsCSSProps::kOverflowSubKTable);
val->SetIdent(overflow);
} else {
val->SetIdent(nsLayoutAtoms::autoAtom);
}
return CallQueryInterface(val, aValue);
}
nsresult
nsComputedDOMStyle::GetOverflowY(nsIFrame *aFrame,
nsIDOMCSSValue** aValue)
{
nsROCSSPrimitiveValue* val = GetROCSSPrimitiveValue();
NS_ENSURE_TRUE(val, NS_ERROR_OUT_OF_MEMORY);
const nsStyleDisplay* display = nsnull;
GetStyleData(eStyleStruct_Display, (const nsStyleStruct*&)display, aFrame);
if (display && display->mOverflowY != NS_STYLE_OVERFLOW_AUTO) {
const nsAFlatCString& overflow =
nsCSSProps::SearchKeywordTable(display->mOverflowY,
nsCSSProps::kOverflowSubKTable);
nsCSSProps::SearchKeywordTable(display->mOverflow,
nsCSSProps::kOverflowKTable);
val->SetIdent(overflow);
} else {
val->SetIdent(nsLayoutAtoms::autoAtom);
@ -3579,8 +3533,6 @@ nsComputedDOMStyle::GetQueryablePropertyMap(PRUint32* aLength)
// COMPUTED_STYLE_MAP_ENTRY(outline_style, OutlineStyle),
// COMPUTED_STYLE_MAP_ENTRY(outline_width, OutlineWidth),
COMPUTED_STYLE_MAP_ENTRY(overflow, Overflow),
COMPUTED_STYLE_MAP_ENTRY(overflow_x, OverflowX),
COMPUTED_STYLE_MAP_ENTRY(overflow_y, OverflowY),
//// COMPUTED_STYLE_MAP_ENTRY(padding, Padding),
COMPUTED_STYLE_MAP_ENTRY(padding_bottom, PaddingBottom),
COMPUTED_STYLE_MAP_ENTRY(padding_left, PaddingLeft),

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

@ -272,8 +272,6 @@ private:
nsresult GetPosition(nsIFrame *aFrame, nsIDOMCSSValue** aValue);
nsresult GetClip(nsIFrame *aFrame, nsIDOMCSSValue** aValue);
nsresult GetOverflow(nsIFrame *aFrame, nsIDOMCSSValue** aValue);
nsresult GetOverflowX(nsIFrame *aFrame, nsIDOMCSSValue** aValue);
nsresult GetOverflowY(nsIFrame *aFrame, nsIDOMCSSValue** aValue);
/* User interface properties */
nsresult GetCursor(nsIFrame *aFrame, nsIDOMCSSValue** aValue);

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

@ -184,8 +184,7 @@ CSSDisablePropsRule::CommonMapRuleInfoInto(nsRuleData* aData)
aData->mDisplayData->mPosition = staticposition;
nsCSSValue visible(NS_STYLE_OVERFLOW_VISIBLE, eCSSUnit_Enumerated);
aData->mDisplayData->mOverflowX = visible;
aData->mDisplayData->mOverflowY = visible;
aData->mDisplayData->mOverflow = visible;
// Nobody will care about 'break-before' or 'break-after', since
// they only apply to blocks (assuming we implement them correctly).

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

@ -2614,55 +2614,16 @@ nsRuleNode::ComputeDisplayData(nsStyleStruct* aStartStruct,
display->mFloats = parentDisplay->mFloats;
}
// overflow-x: enum, auto, inherit
if (eCSSUnit_Enumerated == displayData.mOverflowX.GetUnit()) {
display->mOverflowX = displayData.mOverflowX.GetIntValue();
// overflow: enum, auto, inherit
if (eCSSUnit_Enumerated == displayData.mOverflow.GetUnit()) {
display->mOverflow = displayData.mOverflow.GetIntValue();
}
else if (eCSSUnit_Auto == displayData.mOverflowX.GetUnit()) {
display->mOverflowX = NS_STYLE_OVERFLOW_AUTO;
else if (eCSSUnit_Auto == displayData.mOverflow.GetUnit()) {
display->mOverflow = NS_STYLE_OVERFLOW_AUTO;
}
else if (eCSSUnit_Inherit == displayData.mOverflowX.GetUnit()) {
else if (eCSSUnit_Inherit == displayData.mOverflow.GetUnit()) {
inherited = PR_TRUE;
display->mOverflowX = parentDisplay->mOverflowX;
}
// overflow-y: enum, auto, inherit
if (eCSSUnit_Enumerated == displayData.mOverflowY.GetUnit()) {
display->mOverflowY = displayData.mOverflowY.GetIntValue();
}
else if (eCSSUnit_Auto == displayData.mOverflowY.GetUnit()) {
display->mOverflowY = NS_STYLE_OVERFLOW_AUTO;
}
else if (eCSSUnit_Inherit == displayData.mOverflowY.GetUnit()) {
inherited = PR_TRUE;
display->mOverflowY = parentDisplay->mOverflowY;
}
// CSS3 overflow-x and overflow-y require some fixup as well in some
// cases. NS_STYLE_OVERFLOW_VISIBLE and NS_STYLE_OVERFLOW_CLIP are
// meaningful only when used in both dimensions.
if (display->mOverflowX != display->mOverflowY &&
(display->mOverflowX == NS_STYLE_OVERFLOW_VISIBLE ||
display->mOverflowX == NS_STYLE_OVERFLOW_CLIP ||
display->mOverflowY == NS_STYLE_OVERFLOW_VISIBLE ||
display->mOverflowY == NS_STYLE_OVERFLOW_CLIP)) {
// We can't store in the rule tree since a more specific rule might
// change these conditions.
inherited = PR_TRUE;
// NS_STYLE_OVERFLOW_CLIP is a deprecated value, so if it's specified
// in only one dimension, convert it to NS_STYLE_OVERFLOW_HIDDEN.
if (display->mOverflowX == NS_STYLE_OVERFLOW_CLIP)
display->mOverflowX = NS_STYLE_OVERFLOW_HIDDEN;
if (display->mOverflowY == NS_STYLE_OVERFLOW_CLIP)
display->mOverflowY = NS_STYLE_OVERFLOW_HIDDEN;
// If 'visible' is specified but doesn't match the other dimension, it
// turns into 'auto'.
if (display->mOverflowX == NS_STYLE_OVERFLOW_VISIBLE)
display->mOverflowX = NS_STYLE_OVERFLOW_AUTO;
if (display->mOverflowY == NS_STYLE_OVERFLOW_VISIBLE)
display->mOverflowY = NS_STYLE_OVERFLOW_AUTO;
display->mOverflow = parentDisplay->mOverflow;
}
// clip property: length, auto, inherit

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

@ -740,7 +740,7 @@ void nsStyleContext::DumpRegressionData(nsPresContext* aPresContext, FILE* out,
// DISPLAY
IndentBy(out,aIndent);
const nsStyleDisplay* disp = GetStyleDisplay();
fprintf(out, "<display data=\"%d %d %f %d %d %d %d %d %d %d %ld %ld %ld %ld %s\" />\n",
fprintf(out, "<display data=\"%d %d %f %d %d %d %d %d %d %ld %ld %ld %ld %s\" />\n",
(int)disp->mPosition,
(int)disp->mDisplay,
(float)disp->mOpacity,
@ -748,8 +748,7 @@ void nsStyleContext::DumpRegressionData(nsPresContext* aPresContext, FILE* out,
(int)disp->mBreakType,
(int)disp->mBreakBefore,
(int)disp->mBreakAfter,
(int)disp->mOverflowX,
(int)disp->mOverflowY,
(int)disp->mOverflow,
(int)disp->mClipFlags,
(long)disp->mClip.x,
(long)disp->mClip.y,

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

@ -1102,8 +1102,7 @@ nsStyleDisplay::nsStyleDisplay()
mBreakType = NS_STYLE_CLEAR_NONE;
mBreakBefore = PR_FALSE;
mBreakAfter = PR_FALSE;
mOverflowX = NS_STYLE_OVERFLOW_VISIBLE;
mOverflowY = NS_STYLE_OVERFLOW_VISIBLE;
mOverflow = NS_STYLE_OVERFLOW_VISIBLE;
mClipFlags = NS_STYLE_CLIP_AUTO;
mClip.SetRect(0,0,0,0);
mOpacity = 1.0f;
@ -1120,8 +1119,7 @@ nsStyleDisplay::nsStyleDisplay(const nsStyleDisplay& aSource)
mBreakType = aSource.mBreakType;
mBreakBefore = aSource.mBreakBefore;
mBreakAfter = aSource.mBreakAfter;
mOverflowX = aSource.mOverflowX;
mOverflowY = aSource.mOverflowY;
mOverflow = aSource.mOverflow;
mClipFlags = aSource.mClipFlags;
mClip = aSource.mClip;
mOpacity = aSource.mOpacity;
@ -1135,8 +1133,7 @@ nsChangeHint nsStyleDisplay::CalcDifference(const nsStyleDisplay& aOther) const
|| mPosition != aOther.mPosition
|| mDisplay != aOther.mDisplay
|| (mFloats == NS_STYLE_FLOAT_NONE) != (aOther.mFloats == NS_STYLE_FLOAT_NONE)
|| mOverflowX != aOther.mOverflowX
|| mOverflowY != aOther.mOverflowY
|| mOverflow != aOther.mOverflow
// might need to create a view to handle change from 1.0 to partial opacity
|| (mOpacity != aOther.mOpacity
&& ((mOpacity < 1.0) != (aOther.mOpacity < 1.0))))

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

@ -731,8 +731,7 @@ struct nsStyleDisplay : public nsStyleStruct {
PRUint8 mBreakType; // [reset] see nsStyleConsts.h NS_STYLE_CLEAR_*
PRPackedBool mBreakBefore; // [reset]
PRPackedBool mBreakAfter; // [reset]
PRUint8 mOverflowX; // [reset] see nsStyleConsts.h
PRUint8 mOverflowY; // [reset] see nsStyleConsts.h
PRUint8 mOverflow; // [reset] see nsStyleConsts.h
PRUint8 mClipFlags; // [reset] see nsStyleConsts.h
PRBool IsBlockLevel() const {return (NS_STYLE_DISPLAY_BLOCK == mDisplay) ||
@ -750,18 +749,15 @@ struct nsStyleDisplay : public nsStyleStruct {
(NS_STYLE_POSITION_RELATIVE == mPosition);}
PRBool IsScrollableOverflow() const {
// mOverflowX and mOverflowY always match when one of them is
// NS_STYLE_OVERFLOW_VISIBLE or NS_STYLE_OVERFLOW_CLIP.
return mOverflowX != NS_STYLE_OVERFLOW_VISIBLE &&
mOverflowX != NS_STYLE_OVERFLOW_CLIP;
return mOverflow != NS_STYLE_OVERFLOW_VISIBLE &&
mOverflow != NS_STYLE_OVERFLOW_CLIP;
}
// For table elements that don't support scroll frame creation, we
// support 'overflow: hidden' to mean 'overflow: -moz-hidden-unscrollable'.
PRBool IsTableClip() const {
return mOverflowX == NS_STYLE_OVERFLOW_CLIP ||
(mOverflowX == NS_STYLE_OVERFLOW_HIDDEN &&
mOverflowY == NS_STYLE_OVERFLOW_HIDDEN);
return mOverflow == NS_STYLE_OVERFLOW_CLIP ||
mOverflow == NS_STYLE_OVERFLOW_HIDDEN;
}
};

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

@ -1630,7 +1630,7 @@ nsBoxFrame::PaintChildren(nsPresContext* aPresContext,
// If overflow is hidden then set the clip rect so that children
// don't leak out of us
if (NS_STYLE_OVERFLOW_CLIP == disp->mOverflowX) {
if (NS_STYLE_OVERFLOW_CLIP == disp->mOverflow) {
nsMargin im(0,0,0,0);
GetInset(im);
r.Deflate(im);
@ -1643,7 +1643,7 @@ nsBoxFrame::PaintChildren(nsPresContext* aPresContext,
nsIFrame* frame = nsnull;
kid->GetFrame(&frame);
if (!hasClipped && NS_STYLE_OVERFLOW_CLIP == disp->mOverflowX) {
if (!hasClipped && NS_STYLE_OVERFLOW_CLIP == disp->mOverflow) {
// if we haven't already clipped and we should
// check to see if the child is in out bounds. If not then
// we begin clipping.
@ -1672,7 +1672,7 @@ nsBoxFrame::PaintChildren(nsPresContext* aPresContext,
nscoord onePixel = aPresContext->IntScaledPixelsToTwips(1);
GetContentRect(r);
if (NS_STYLE_OVERFLOW_CLIP == disp->mOverflowX) {
if (NS_STYLE_OVERFLOW_CLIP == disp->mOverflow) {
GetDebugMargin(debugMargin);
PixelMarginToTwips(aPresContext, debugMargin);
r.Deflate(debugMargin);
@ -1682,7 +1682,7 @@ nsBoxFrame::PaintChildren(nsPresContext* aPresContext,
GetChildBox(&kid);
while (nsnull != kid) {
if (!hasClipped && NS_STYLE_OVERFLOW_CLIP == disp->mOverflowX) {
if (!hasClipped && NS_STYLE_OVERFLOW_CLIP == disp->mOverflow) {
// if we haven't already clipped and we should
// check to see if the child is in out bounds. If not then
// we begin clipping.