Fix up -moz-tab-size and unprefix it.
This commit is contained in:
parent
020f796a23
commit
db50b22c68
|
@ -1233,7 +1233,7 @@ exports.CSS_PROPERTIES = {
|
||||||
"-moz-tab-size": {
|
"-moz-tab-size": {
|
||||||
"isInherited": true,
|
"isInherited": true,
|
||||||
"subproperties": [
|
"subproperties": [
|
||||||
"-moz-tab-size"
|
"tab-size"
|
||||||
],
|
],
|
||||||
"supports": [
|
"supports": [
|
||||||
7
|
7
|
||||||
|
@ -3052,7 +3052,7 @@ exports.CSS_PROPERTIES = {
|
||||||
"stroke-opacity",
|
"stroke-opacity",
|
||||||
"stroke-width",
|
"stroke-width",
|
||||||
"-x-system-font",
|
"-x-system-font",
|
||||||
"-moz-tab-size",
|
"tab-size",
|
||||||
"table-layout",
|
"table-layout",
|
||||||
"text-align",
|
"text-align",
|
||||||
"text-align-last",
|
"text-align-last",
|
||||||
|
@ -8650,6 +8650,23 @@ exports.CSS_PROPERTIES = {
|
||||||
"unset"
|
"unset"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
"tab-size": {
|
||||||
|
"isInherited": true,
|
||||||
|
"subproperties": [
|
||||||
|
"tab-size"
|
||||||
|
],
|
||||||
|
"supports": [
|
||||||
|
6,
|
||||||
|
7
|
||||||
|
],
|
||||||
|
"values": [
|
||||||
|
"-moz-calc",
|
||||||
|
"calc",
|
||||||
|
"inherit",
|
||||||
|
"initial",
|
||||||
|
"unset"
|
||||||
|
]
|
||||||
|
},
|
||||||
"table-layout": {
|
"table-layout": {
|
||||||
"isInherited": false,
|
"isInherited": false,
|
||||||
"subproperties": [
|
"subproperties": [
|
||||||
|
|
|
@ -75,11 +75,6 @@ const gMozillaSpecificProperties = {
|
||||||
from: "ignore",
|
from: "ignore",
|
||||||
to: "stretch-to-fit"
|
to: "stretch-to-fit"
|
||||||
},
|
},
|
||||||
"-moz-tab-size": {
|
|
||||||
// https://drafts.csswg.org/css-text-3/#propdef-tab-size
|
|
||||||
from: "1",
|
|
||||||
to: "5"
|
|
||||||
},
|
|
||||||
"-moz-text-size-adjust": {
|
"-moz-text-size-adjust": {
|
||||||
// https://drafts.csswg.org/css-size-adjust/#propdef-text-size-adjust
|
// https://drafts.csswg.org/css-size-adjust/#propdef-text-size-adjust
|
||||||
from: "none",
|
from: "none",
|
||||||
|
|
|
@ -1716,6 +1716,16 @@ GetSpaceWidthAppUnits(const gfxTextRun* aTextRun)
|
||||||
return spaceWidthAppUnits;
|
return spaceWidthAppUnits;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static gfxFloat
|
||||||
|
GetMinTabAdvanceAppUnits(const gfxTextRun* aTextRun)
|
||||||
|
{
|
||||||
|
gfxFloat chWidthAppUnits =
|
||||||
|
NS_round(GetFirstFontMetrics(aTextRun->GetFontGroup(),
|
||||||
|
aTextRun->IsVertical()).zeroOrAveCharWidth *
|
||||||
|
aTextRun->GetAppUnitsPerDevUnit());
|
||||||
|
return 0.5 * chWidthAppUnits;
|
||||||
|
}
|
||||||
|
|
||||||
static nscoord
|
static nscoord
|
||||||
LetterSpacing(nsIFrame* aFrame, const nsStyleText* aStyleText = nullptr)
|
LetterSpacing(nsIFrame* aFrame, const nsStyleText* aStyleText = nullptr)
|
||||||
{
|
{
|
||||||
|
@ -3090,6 +3100,7 @@ public:
|
||||||
mLength(aLength),
|
mLength(aLength),
|
||||||
mWordSpacing(WordSpacing(aFrame, mTextRun, aTextStyle)),
|
mWordSpacing(WordSpacing(aFrame, mTextRun, aTextStyle)),
|
||||||
mLetterSpacing(LetterSpacing(aFrame, aTextStyle)),
|
mLetterSpacing(LetterSpacing(aFrame, aTextStyle)),
|
||||||
|
mMinTabAdvance(-1.0),
|
||||||
mHyphenWidth(-1),
|
mHyphenWidth(-1),
|
||||||
mOffsetFromBlockOriginForTabs(aOffsetFromBlockOriginForTabs),
|
mOffsetFromBlockOriginForTabs(aOffsetFromBlockOriginForTabs),
|
||||||
mReflowing(true),
|
mReflowing(true),
|
||||||
|
@ -3114,6 +3125,7 @@ public:
|
||||||
mLength(aFrame->GetContentLength()),
|
mLength(aFrame->GetContentLength()),
|
||||||
mWordSpacing(WordSpacing(aFrame, mTextRun)),
|
mWordSpacing(WordSpacing(aFrame, mTextRun)),
|
||||||
mLetterSpacing(LetterSpacing(aFrame)),
|
mLetterSpacing(LetterSpacing(aFrame)),
|
||||||
|
mMinTabAdvance(-1.0),
|
||||||
mHyphenWidth(-1),
|
mHyphenWidth(-1),
|
||||||
mOffsetFromBlockOriginForTabs(0),
|
mOffsetFromBlockOriginForTabs(0),
|
||||||
mReflowing(false),
|
mReflowing(false),
|
||||||
|
@ -3176,7 +3188,14 @@ public:
|
||||||
return mFontMetrics;
|
return mFontMetrics;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CalcTabWidths(Range aTransformedRange);
|
void CalcTabWidths(Range aTransformedRange, gfxFloat aTabWidth);
|
||||||
|
|
||||||
|
gfxFloat MinTabAdvance() {
|
||||||
|
if (mMinTabAdvance < 0.0) {
|
||||||
|
mMinTabAdvance = GetMinTabAdvanceAppUnits(mTextRun);
|
||||||
|
}
|
||||||
|
return mMinTabAdvance;
|
||||||
|
}
|
||||||
|
|
||||||
const gfxSkipCharsIterator& GetEndHint() { return mTempIterator; }
|
const gfxSkipCharsIterator& GetEndHint() { return mTempIterator; }
|
||||||
|
|
||||||
|
@ -3210,6 +3229,7 @@ protected:
|
||||||
int32_t mLength; // DOM string length, may be INT32_MAX
|
int32_t mLength; // DOM string length, may be INT32_MAX
|
||||||
gfxFloat mWordSpacing; // space for each whitespace char
|
gfxFloat mWordSpacing; // space for each whitespace char
|
||||||
gfxFloat mLetterSpacing; // space for each letter
|
gfxFloat mLetterSpacing; // space for each letter
|
||||||
|
gfxFloat mMinTabAdvance; // min advance for <tab> char
|
||||||
gfxFloat mHyphenWidth;
|
gfxFloat mHyphenWidth;
|
||||||
gfxFloat mOffsetFromBlockOriginForTabs;
|
gfxFloat mOffsetFromBlockOriginForTabs;
|
||||||
|
|
||||||
|
@ -3362,6 +3382,28 @@ CanAddSpacingAfter(const gfxTextRun* aTextRun, uint32_t aOffset)
|
||||||
aTextRun->IsLigatureGroupStart(aOffset + 1);
|
aTextRun->IsLigatureGroupStart(aOffset + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static gfxFloat
|
||||||
|
ComputeTabWidthAppUnits(nsIFrame* aFrame, gfxTextRun* aTextRun)
|
||||||
|
{
|
||||||
|
const nsStyleText* textStyle = aFrame->StyleText();
|
||||||
|
if (textStyle->mTabSize.GetUnit() != eStyleUnit_Factor) {
|
||||||
|
nscoord w = textStyle->mTabSize.GetCoordValue();
|
||||||
|
MOZ_ASSERT(w >= 0);
|
||||||
|
return w;
|
||||||
|
}
|
||||||
|
|
||||||
|
gfxFloat spaces = textStyle->mTabSize.GetFactorValue();
|
||||||
|
MOZ_ASSERT(spaces >= 0);
|
||||||
|
|
||||||
|
// Round the space width when converting to appunits the same way
|
||||||
|
// textruns do.
|
||||||
|
gfxFloat spaceWidthAppUnits =
|
||||||
|
NS_round(GetFirstFontMetrics(aTextRun->GetFontGroup(),
|
||||||
|
aTextRun->IsVertical()).spaceWidth *
|
||||||
|
aTextRun->GetAppUnitsPerDevUnit());
|
||||||
|
return spaces * spaceWidthAppUnits;
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
PropertyProvider::GetSpacingInternal(Range aRange, Spacing* aSpacing,
|
PropertyProvider::GetSpacingInternal(Range aRange, Spacing* aSpacing,
|
||||||
bool aIgnoreTabs)
|
bool aIgnoreTabs)
|
||||||
|
@ -3409,17 +3451,16 @@ PropertyProvider::GetSpacingInternal(Range aRange, Spacing* aSpacing,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Ignore tab spacing rather than computing it, if the tab size is 0
|
|
||||||
if (!aIgnoreTabs)
|
|
||||||
aIgnoreTabs = mFrame->StyleText()->mTabSize == 0;
|
|
||||||
|
|
||||||
// Now add tab spacing, if there is any
|
// Now add tab spacing, if there is any
|
||||||
if (!aIgnoreTabs) {
|
if (!aIgnoreTabs) {
|
||||||
CalcTabWidths(aRange);
|
gfxFloat tabWidth = ComputeTabWidthAppUnits(mFrame, mTextRun);
|
||||||
if (mTabWidths) {
|
if (tabWidth > 0) {
|
||||||
mTabWidths->ApplySpacing(aSpacing,
|
CalcTabWidths(aRange, tabWidth);
|
||||||
aRange.start - mStart.GetSkippedOffset(),
|
if (mTabWidths) {
|
||||||
aRange.Length());
|
mTabWidths->ApplySpacing(aSpacing,
|
||||||
|
aRange.start - mStart.GetSkippedOffset(),
|
||||||
|
aRange.Length());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3442,33 +3483,22 @@ PropertyProvider::GetSpacingInternal(Range aRange, Spacing* aSpacing,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static gfxFloat
|
|
||||||
ComputeTabWidthAppUnits(nsIFrame* aFrame, const gfxTextRun* aTextRun)
|
|
||||||
{
|
|
||||||
// Get the number of spaces from CSS -moz-tab-size
|
|
||||||
const nsStyleText* textStyle = aFrame->StyleText();
|
|
||||||
|
|
||||||
return textStyle->mTabSize * GetSpaceWidthAppUnits(aTextRun);
|
|
||||||
}
|
|
||||||
|
|
||||||
// aX and the result are in whole appunits.
|
// aX and the result are in whole appunits.
|
||||||
static gfxFloat
|
static gfxFloat
|
||||||
AdvanceToNextTab(gfxFloat aX, nsIFrame* aFrame,
|
AdvanceToNextTab(gfxFloat aX, nsIFrame* aFrame, gfxTextRun* aTextRun,
|
||||||
const gfxTextRun* aTextRun, gfxFloat* aCachedTabWidth)
|
gfxFloat aTabWidth, gfxFloat aMinAdvance)
|
||||||
{
|
{
|
||||||
if (*aCachedTabWidth < 0) {
|
|
||||||
*aCachedTabWidth = ComputeTabWidthAppUnits(aFrame, aTextRun);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Advance aX to the next multiple of *aCachedTabWidth. We must advance
|
// Advance aX to the next multiple of aTabWidth. We must advance
|
||||||
// by at least 1 appunit.
|
// by at least aMinAdvance.
|
||||||
// XXX should we make this 1 CSS pixel?
|
return ceil((aX + aMinAdvance) / aTabWidth) * aTabWidth;
|
||||||
return ceil((aX + 1)/(*aCachedTabWidth))*(*aCachedTabWidth);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
PropertyProvider::CalcTabWidths(Range aRange)
|
PropertyProvider::CalcTabWidths(Range aRange, gfxFloat aTabWidth)
|
||||||
{
|
{
|
||||||
|
MOZ_ASSERT(aTabWidth > 0);
|
||||||
|
|
||||||
if (!mTabWidths) {
|
if (!mTabWidths) {
|
||||||
if (mReflowing && !mLineContainer) {
|
if (mReflowing && !mLineContainer) {
|
||||||
// Intrinsic width computation does its own tab processing. We
|
// Intrinsic width computation does its own tab processing. We
|
||||||
|
@ -3503,7 +3533,6 @@ PropertyProvider::CalcTabWidths(Range aRange)
|
||||||
NS_ASSERTION(mReflowing,
|
NS_ASSERTION(mReflowing,
|
||||||
"We need precomputed tab widths, but don't have enough.");
|
"We need precomputed tab widths, but don't have enough.");
|
||||||
|
|
||||||
gfxFloat tabWidth = -1;
|
|
||||||
for (uint32_t i = tabsEnd; i < aRange.end; ++i) {
|
for (uint32_t i = tabsEnd; i < aRange.end; ++i) {
|
||||||
Spacing spacing;
|
Spacing spacing;
|
||||||
GetSpacingInternal(Range(i, i + 1), &spacing, true);
|
GetSpacingInternal(Range(i, i + 1), &spacing, true);
|
||||||
|
@ -3525,7 +3554,7 @@ PropertyProvider::CalcTabWidths(Range aRange)
|
||||||
mFrame->SetProperty(TabWidthProperty(), mTabWidths);
|
mFrame->SetProperty(TabWidthProperty(), mTabWidths);
|
||||||
}
|
}
|
||||||
double nextTab = AdvanceToNextTab(mOffsetFromBlockOriginForTabs,
|
double nextTab = AdvanceToNextTab(mOffsetFromBlockOriginForTabs,
|
||||||
mFrame, mTextRun, &tabWidth);
|
mFrame, mTextRun, aTabWidth, MinTabAdvance());
|
||||||
mTabWidths->mWidths.AppendElement(TabWidth(i - startOffset,
|
mTabWidths->mWidths.AppendElement(TabWidth(i - startOffset,
|
||||||
NSToIntRound(nextTab - mOffsetFromBlockOriginForTabs)));
|
NSToIntRound(nextTab - mOffsetFromBlockOriginForTabs)));
|
||||||
mOffsetFromBlockOriginForTabs = nextTab;
|
mOffsetFromBlockOriginForTabs = nextTab;
|
||||||
|
@ -8319,9 +8348,12 @@ nsTextFrame::AddInlineMinISizeForFlow(nsRenderingContext *aRenderingContext,
|
||||||
PropertyProvider::Spacing spacing;
|
PropertyProvider::Spacing spacing;
|
||||||
provider.GetSpacing(Range(i, i + 1), &spacing);
|
provider.GetSpacing(Range(i, i + 1), &spacing);
|
||||||
aData->mCurrentLine += nscoord(spacing.mBefore);
|
aData->mCurrentLine += nscoord(spacing.mBefore);
|
||||||
|
if (tabWidth < 0) {
|
||||||
|
tabWidth = ComputeTabWidthAppUnits(this, textRun);
|
||||||
|
}
|
||||||
gfxFloat afterTab =
|
gfxFloat afterTab =
|
||||||
AdvanceToNextTab(aData->mCurrentLine, this,
|
AdvanceToNextTab(aData->mCurrentLine, this, textRun, tabWidth,
|
||||||
textRun, &tabWidth);
|
provider.MinTabAdvance());
|
||||||
aData->mCurrentLine = nscoord(afterTab + spacing.mAfter);
|
aData->mCurrentLine = nscoord(afterTab + spacing.mAfter);
|
||||||
wordStart = i + 1;
|
wordStart = i + 1;
|
||||||
} else if (i < flowEndInTextRun ||
|
} else if (i < flowEndInTextRun ||
|
||||||
|
@ -8478,9 +8510,12 @@ nsTextFrame::AddInlinePrefISizeForFlow(nsRenderingContext *aRenderingContext,
|
||||||
PropertyProvider::Spacing spacing;
|
PropertyProvider::Spacing spacing;
|
||||||
provider.GetSpacing(Range(i, i + 1), &spacing);
|
provider.GetSpacing(Range(i, i + 1), &spacing);
|
||||||
aData->mCurrentLine += nscoord(spacing.mBefore);
|
aData->mCurrentLine += nscoord(spacing.mBefore);
|
||||||
|
if (tabWidth < 0) {
|
||||||
|
tabWidth = ComputeTabWidthAppUnits(this, textRun);
|
||||||
|
}
|
||||||
gfxFloat afterTab =
|
gfxFloat afterTab =
|
||||||
AdvanceToNextTab(aData->mCurrentLine, this,
|
AdvanceToNextTab(aData->mCurrentLine, this, textRun, tabWidth,
|
||||||
textRun, &tabWidth);
|
provider.MinTabAdvance());
|
||||||
aData->mCurrentLine = nscoord(afterTab + spacing.mAfter);
|
aData->mCurrentLine = nscoord(afterTab + spacing.mAfter);
|
||||||
lineStart = i + 1;
|
lineStart = i + 1;
|
||||||
} else if (preformattedNewline) {
|
} else if (preformattedNewline) {
|
||||||
|
|
|
@ -222,6 +222,10 @@ CSS_PROP_ALIAS(-moz-columns,
|
||||||
columns,
|
columns,
|
||||||
MozColumns,
|
MozColumns,
|
||||||
"")
|
"")
|
||||||
|
CSS_PROP_ALIAS(-moz-tab-size,
|
||||||
|
tab_size,
|
||||||
|
MozTabSize,
|
||||||
|
"")
|
||||||
|
|
||||||
#define WEBKIT_PREFIX_PREF "layout.css.prefixes.webkit"
|
#define WEBKIT_PREFIX_PREF "layout.css.prefixes.webkit"
|
||||||
|
|
||||||
|
|
|
@ -3879,16 +3879,16 @@ CSS_PROP_FONT(
|
||||||
eStyleAnimType_None)
|
eStyleAnimType_None)
|
||||||
#endif // CSS_PROP_LIST_EXCLUDE_INTERNAL
|
#endif // CSS_PROP_LIST_EXCLUDE_INTERNAL
|
||||||
CSS_PROP_TEXT(
|
CSS_PROP_TEXT(
|
||||||
-moz-tab-size,
|
tab-size,
|
||||||
_moz_tab_size,
|
tab_size,
|
||||||
CSS_PROP_DOMPROP_PREFIXED(TabSize),
|
TabSize,
|
||||||
CSS_PROPERTY_PARSE_VALUE |
|
CSS_PROPERTY_PARSE_VALUE |
|
||||||
CSS_PROPERTY_VALUE_NONNEGATIVE,
|
CSS_PROPERTY_VALUE_NONNEGATIVE,
|
||||||
"",
|
"",
|
||||||
VARIANT_HI,
|
VARIANT_INHERIT | VARIANT_LNCALC,
|
||||||
nullptr,
|
nullptr,
|
||||||
offsetof(nsStyleText, mTabSize),
|
offsetof(nsStyleText, mTabSize),
|
||||||
eStyleAnimType_Discrete)
|
eStyleAnimType_Coord)
|
||||||
CSS_PROP_TABLE(
|
CSS_PROP_TABLE(
|
||||||
table-layout,
|
table-layout,
|
||||||
table_layout,
|
table_layout,
|
||||||
|
|
|
@ -4013,7 +4013,7 @@ already_AddRefed<CSSValue>
|
||||||
nsComputedDOMStyle::DoGetTabSize()
|
nsComputedDOMStyle::DoGetTabSize()
|
||||||
{
|
{
|
||||||
RefPtr<nsROCSSPrimitiveValue> val = new nsROCSSPrimitiveValue;
|
RefPtr<nsROCSSPrimitiveValue> val = new nsROCSSPrimitiveValue;
|
||||||
val->SetNumber(StyleText()->mTabSize);
|
SetValueToCoord(val, StyleText()->mTabSize, true);
|
||||||
return val.forget();
|
return val.forget();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -228,6 +228,7 @@ COMPUTED_STYLE_PROP(scroll_snap_type_x, ScrollSnapTypeX)
|
||||||
COMPUTED_STYLE_PROP(scroll_snap_type_y, ScrollSnapTypeY)
|
COMPUTED_STYLE_PROP(scroll_snap_type_y, ScrollSnapTypeY)
|
||||||
COMPUTED_STYLE_PROP(shape_outside, ShapeOutside)
|
COMPUTED_STYLE_PROP(shape_outside, ShapeOutside)
|
||||||
//// COMPUTED_STYLE_PROP(size, Size)
|
//// COMPUTED_STYLE_PROP(size, Size)
|
||||||
|
COMPUTED_STYLE_PROP(tab_size, TabSize)
|
||||||
COMPUTED_STYLE_PROP(table_layout, TableLayout)
|
COMPUTED_STYLE_PROP(table_layout, TableLayout)
|
||||||
COMPUTED_STYLE_PROP(text_align, TextAlign)
|
COMPUTED_STYLE_PROP(text_align, TextAlign)
|
||||||
COMPUTED_STYLE_PROP(text_align_last, TextAlignLast)
|
COMPUTED_STYLE_PROP(text_align_last, TextAlignLast)
|
||||||
|
@ -295,7 +296,6 @@ COMPUTED_STYLE_PROP(_moz_outline_radius_bottomRight,OutlineRadiusBottomRight)
|
||||||
COMPUTED_STYLE_PROP(_moz_outline_radius_topLeft, OutlineRadiusTopLeft)
|
COMPUTED_STYLE_PROP(_moz_outline_radius_topLeft, OutlineRadiusTopLeft)
|
||||||
COMPUTED_STYLE_PROP(_moz_outline_radius_topRight, OutlineRadiusTopRight)
|
COMPUTED_STYLE_PROP(_moz_outline_radius_topRight, OutlineRadiusTopRight)
|
||||||
COMPUTED_STYLE_PROP(stack_sizing, StackSizing)
|
COMPUTED_STYLE_PROP(stack_sizing, StackSizing)
|
||||||
COMPUTED_STYLE_PROP(_moz_tab_size, TabSize)
|
|
||||||
COMPUTED_STYLE_PROP(text_size_adjust, TextSizeAdjust)
|
COMPUTED_STYLE_PROP(text_size_adjust, TextSizeAdjust)
|
||||||
COMPUTED_STYLE_PROP(user_focus, UserFocus)
|
COMPUTED_STYLE_PROP(user_focus, UserFocus)
|
||||||
COMPUTED_STYLE_PROP(user_input, UserInput)
|
COMPUTED_STYLE_PROP(user_input, UserInput)
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -3806,10 +3806,10 @@ nsStyleText::nsStyleText(StyleStructContext aContext)
|
||||||
, mControlCharacterVisibility(nsCSSParser::ControlCharVisibilityDefault())
|
, mControlCharacterVisibility(nsCSSParser::ControlCharVisibilityDefault())
|
||||||
, mTextEmphasisStyle(NS_STYLE_TEXT_EMPHASIS_STYLE_NONE)
|
, mTextEmphasisStyle(NS_STYLE_TEXT_EMPHASIS_STYLE_NONE)
|
||||||
, mTextRendering(NS_STYLE_TEXT_RENDERING_AUTO)
|
, mTextRendering(NS_STYLE_TEXT_RENDERING_AUTO)
|
||||||
, mTabSize(NS_STYLE_TABSIZE_INITIAL)
|
|
||||||
, mTextEmphasisColor(StyleComplexColor::CurrentColor())
|
, mTextEmphasisColor(StyleComplexColor::CurrentColor())
|
||||||
, mWebkitTextFillColor(StyleComplexColor::CurrentColor())
|
, mWebkitTextFillColor(StyleComplexColor::CurrentColor())
|
||||||
, mWebkitTextStrokeColor(StyleComplexColor::CurrentColor())
|
, mWebkitTextStrokeColor(StyleComplexColor::CurrentColor())
|
||||||
|
, mTabSize(float(NS_STYLE_TABSIZE_INITIAL), eStyleUnit_Factor)
|
||||||
, mWordSpacing(0, nsStyleCoord::CoordConstructor)
|
, mWordSpacing(0, nsStyleCoord::CoordConstructor)
|
||||||
, mLetterSpacing(eStyleUnit_Normal)
|
, mLetterSpacing(eStyleUnit_Normal)
|
||||||
, mLineHeight(eStyleUnit_Normal)
|
, mLineHeight(eStyleUnit_Normal)
|
||||||
|
@ -3844,10 +3844,10 @@ nsStyleText::nsStyleText(const nsStyleText& aSource)
|
||||||
, mTextEmphasisPosition(aSource.mTextEmphasisPosition)
|
, mTextEmphasisPosition(aSource.mTextEmphasisPosition)
|
||||||
, mTextEmphasisStyle(aSource.mTextEmphasisStyle)
|
, mTextEmphasisStyle(aSource.mTextEmphasisStyle)
|
||||||
, mTextRendering(aSource.mTextRendering)
|
, mTextRendering(aSource.mTextRendering)
|
||||||
, mTabSize(aSource.mTabSize)
|
|
||||||
, mTextEmphasisColor(aSource.mTextEmphasisColor)
|
, mTextEmphasisColor(aSource.mTextEmphasisColor)
|
||||||
, mWebkitTextFillColor(aSource.mWebkitTextFillColor)
|
, mWebkitTextFillColor(aSource.mWebkitTextFillColor)
|
||||||
, mWebkitTextStrokeColor(aSource.mWebkitTextStrokeColor)
|
, mWebkitTextStrokeColor(aSource.mWebkitTextStrokeColor)
|
||||||
|
, mTabSize(aSource.mTabSize)
|
||||||
, mWordSpacing(aSource.mWordSpacing)
|
, mWordSpacing(aSource.mWordSpacing)
|
||||||
, mLetterSpacing(aSource.mLetterSpacing)
|
, mLetterSpacing(aSource.mLetterSpacing)
|
||||||
, mLineHeight(aSource.mLineHeight)
|
, mLineHeight(aSource.mLineHeight)
|
||||||
|
|
|
@ -2087,11 +2087,11 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsStyleText
|
||||||
uint8_t mTextEmphasisPosition; // [inherited] see nsStyleConsts.h
|
uint8_t mTextEmphasisPosition; // [inherited] see nsStyleConsts.h
|
||||||
uint8_t mTextEmphasisStyle; // [inherited] see nsStyleConsts.h
|
uint8_t mTextEmphasisStyle; // [inherited] see nsStyleConsts.h
|
||||||
uint8_t mTextRendering; // [inherited] see nsStyleConsts.h
|
uint8_t mTextRendering; // [inherited] see nsStyleConsts.h
|
||||||
int32_t mTabSize; // [inherited] see nsStyleConsts.h
|
|
||||||
mozilla::StyleComplexColor mTextEmphasisColor; // [inherited]
|
mozilla::StyleComplexColor mTextEmphasisColor; // [inherited]
|
||||||
mozilla::StyleComplexColor mWebkitTextFillColor; // [inherited]
|
mozilla::StyleComplexColor mWebkitTextFillColor; // [inherited]
|
||||||
mozilla::StyleComplexColor mWebkitTextStrokeColor; // [inherited]
|
mozilla::StyleComplexColor mWebkitTextStrokeColor; // [inherited]
|
||||||
|
|
||||||
|
nsStyleCoord mTabSize; // [inherited] coord, factor, calc
|
||||||
nsStyleCoord mWordSpacing; // [inherited] coord, percent, calc
|
nsStyleCoord mWordSpacing; // [inherited] coord, percent, calc
|
||||||
nsStyleCoord mLetterSpacing; // [inherited] coord, normal
|
nsStyleCoord mLetterSpacing; // [inherited] coord, normal
|
||||||
nsStyleCoord mLineHeight; // [inherited] coord, factor, normal
|
nsStyleCoord mLineHeight; // [inherited] coord, factor, normal
|
||||||
|
|
|
@ -2027,13 +2027,22 @@ var gCSSProperties = {
|
||||||
other_values: [ "ignore" ],
|
other_values: [ "ignore" ],
|
||||||
invalid_values: []
|
invalid_values: []
|
||||||
},
|
},
|
||||||
"-moz-tab-size": {
|
"tab-size": {
|
||||||
domProp: "MozTabSize",
|
domProp: "TabSize",
|
||||||
inherited: true,
|
inherited: true,
|
||||||
type: CSS_TYPE_LONGHAND,
|
type: CSS_TYPE_LONGHAND,
|
||||||
initial_values: [ "8" ],
|
initial_values: [ "8" ],
|
||||||
other_values: [ "0", "3", "99", "12000" ],
|
other_values: [ "0", "2.5", "3", "99", "12000", "0px", "1em",
|
||||||
invalid_values: [ "-1", "-808", "3.0", "17.5" ]
|
"calc(1px + 1em)", "calc(1px - 2px)", "calc(1 + 1)", "calc(-2.5)" ],
|
||||||
|
invalid_values: [ "9%", "calc(9% + 1px)", "calc(1 + 1em)", "-1", "-808",
|
||||||
|
"auto" ]
|
||||||
|
},
|
||||||
|
"-moz-tab-size": {
|
||||||
|
domProp: "MozTabSize",
|
||||||
|
inherited: true,
|
||||||
|
type: CSS_TYPE_SHORTHAND_AND_LONGHAND
|
||||||
|
alias_for: "tab-size",
|
||||||
|
subproperties: [ "tab-size" ]
|
||||||
},
|
},
|
||||||
"-moz-text-size-adjust": {
|
"-moz-text-size-adjust": {
|
||||||
domProp: "MozTextSizeAdjust",
|
domProp: "MozTextSizeAdjust",
|
||||||
|
|
|
@ -248,6 +248,8 @@ var supported_properties = {
|
||||||
// test_length_percent_calc_transition.
|
// test_length_percent_calc_transition.
|
||||||
"stroke-width": [ test_length_transition_svg, test_percent_transition,
|
"stroke-width": [ test_length_transition_svg, test_percent_transition,
|
||||||
test_length_clamped_svg, test_percent_clamped ],
|
test_length_clamped_svg, test_percent_clamped ],
|
||||||
|
"tab-size": [ test_float_zeroToOne_transition,
|
||||||
|
test_float_aboveOne_transition, test_length_clamped ],
|
||||||
"text-decoration": [ test_color_shorthand_transition,
|
"text-decoration": [ test_color_shorthand_transition,
|
||||||
test_true_currentcolor_shorthand_transition ],
|
test_true_currentcolor_shorthand_transition ],
|
||||||
"text-decoration-color": [ test_color_transition,
|
"text-decoration-color": [ test_color_transition,
|
||||||
|
|
|
@ -31,7 +31,7 @@ nsHtml5ViewSourceUtils::NewBodyAttributes()
|
||||||
int32_t tabSize = mozilla::Preferences::GetInt("view_source.tab_size", 4);
|
int32_t tabSize = mozilla::Preferences::GetInt("view_source.tab_size", 4);
|
||||||
if (tabSize > 0) {
|
if (tabSize > 0) {
|
||||||
nsString style;
|
nsString style;
|
||||||
style.AssignASCII("-moz-tab-size: ");
|
style.AssignASCII("tab-size: ");
|
||||||
style.AppendInt(tabSize);
|
style.AppendInt(tabSize);
|
||||||
bodyAttrs->addAttribute(
|
bodyAttrs->addAttribute(
|
||||||
nsHtml5AttributeName::ATTR_STYLE, nsHtml5String::FromString(style), -1);
|
nsHtml5AttributeName::ATTR_STYLE, nsHtml5String::FromString(style), -1);
|
||||||
|
|
Loading…
Reference in New Issue