diff options
author | athenian200 <athenian200@outlook.com> | 2020-10-23 19:45:52 -0500 |
---|---|---|
committer | athenian200 <athenian200@outlook.com> | 2020-10-28 14:17:02 -0500 |
commit | 7c2bcc48c455d4e4441b12834c3bd4c5bb33c9ba (patch) | |
tree | 57de1c4a48f24c57b36610d5e3a60ef639f5f8a0 | |
parent | 49765b53af01284a5d5479dfb8bb56da0ba87ca5 (diff) | |
download | uxp-7c2bcc48c455d4e4441b12834c3bd4c5bb33c9ba.tar.gz |
Issue #1673 - Part 2: Make tab-size animatable and fix typos.
There were a few typos in the previous patch and this patch also makes tab-size animatable which didn't really require much of a change at all.
-rw-r--r-- | dom/animation/test/mozilla/file_discrete-animations.html | 5 | ||||
-rw-r--r-- | layout/generic/nsTextFrame.cpp | 6 | ||||
-rw-r--r-- | layout/style/nsCSSPropList.h | 2 | ||||
-rw-r--r-- | layout/style/nsRuleNode.cpp | 2 | ||||
-rw-r--r-- | layout/style/test/test_transitions_per_property.html | 2 |
5 files changed, 7 insertions, 10 deletions
diff --git a/dom/animation/test/mozilla/file_discrete-animations.html b/dom/animation/test/mozilla/file_discrete-animations.html index 35e818a909..eeaaa33c4e 100644 --- a/dom/animation/test/mozilla/file_discrete-animations.html +++ b/dom/animation/test/mozilla/file_discrete-animations.html @@ -75,11 +75,6 @@ const gMozillaSpecificProperties = { from: "ignore", 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": { // https://drafts.csswg.org/css-size-adjust/#propdef-text-size-adjust from: "none", diff --git a/layout/generic/nsTextFrame.cpp b/layout/generic/nsTextFrame.cpp index 663002ba13..0aab2717f3 100644 --- a/layout/generic/nsTextFrame.cpp +++ b/layout/generic/nsTextFrame.cpp @@ -3435,7 +3435,7 @@ PropertyProvider::GetSpacingInternal(Range aRange, Spacing* aSpacing, if (!aIgnoreTabs) { gfxFloat tabWidth = ComputeTabWidthAppUnits(mFrame, mTextRun); if (tabWidth > 0) { - CalcTabWidths(aRange); + CalcTabWidths(aRange, tabWidth); if (mTabWidths) { mTabWidths->ApplySpacing(aSpacing, aRange.start - mStart.GetSkippedOffset(), @@ -3466,13 +3466,13 @@ PropertyProvider::GetSpacingInternal(Range aRange, Spacing* aSpacing, // aX and the result are in whole appunits. static gfxFloat AdvanceToNextTab(gfxFloat aX, nsIFrame* aFrame, - gfxTextRun* aTextRun, gfxFloat* aTabWidth) + gfxTextRun* aTextRun, gfxFloat aTabWidth) { // Advance aX to the next multiple of *aCachedTabWidth. We must advance // by at least 1 appunit. // XXX should we make this 1 CSS pixel? - return ceil((aX + 1)/ aTabWidth) * aTabWidth; + return NS_round((aX + 1) / aTabWidth) * aTabWidth; } void diff --git a/layout/style/nsCSSPropList.h b/layout/style/nsCSSPropList.h index 5c5cfcda1c..53bc845476 100644 --- a/layout/style/nsCSSPropList.h +++ b/layout/style/nsCSSPropList.h @@ -3888,7 +3888,7 @@ CSS_PROP_TEXT( VARIANT_INHERIT | VARIANT_LNCALC, nullptr, offsetof(nsStyleText, mTabSize), - eStyleAnimType_Discrete) + eStyleAnimType_Coord) CSS_PROP_TABLE( table-layout, table_layout, diff --git a/layout/style/nsRuleNode.cpp b/layout/style/nsRuleNode.cpp index e41857db76..6a6407e8f5 100644 --- a/layout/style/nsRuleNode.cpp +++ b/layout/style/nsRuleNode.cpp @@ -4509,7 +4509,7 @@ TruncateStringToSingleGrapheme(nsAString& aStr) struct LengthNumberCalcObj { - float LengthNumberCalcObj; + float mValue; bool mIsNumber; }; diff --git a/layout/style/test/test_transitions_per_property.html b/layout/style/test/test_transitions_per_property.html index f188f4f6fb..b7659adb7d 100644 --- a/layout/style/test/test_transitions_per_property.html +++ b/layout/style/test/test_transitions_per_property.html @@ -248,6 +248,8 @@ var supported_properties = { // test_length_percent_calc_transition. "stroke-width": [ test_length_transition_svg, test_percent_transition, test_length_clamped_svg, test_percent_clamped ], + "-moz-tab-size": [ test_float_zeroToOne_transition, + test_float_aboveOne_transition, test_length_clamped ], "text-decoration": [ test_color_shorthand_transition, test_true_currentcolor_shorthand_transition ], "text-decoration-color": [ test_color_transition, |