diff options
author | athenian200 <athenian200@outlook.com> | 2020-09-17 16:01:38 -0500 |
---|---|---|
committer | Moonchild <moonchild@palemoon.org> | 2020-09-21 11:05:30 +0000 |
commit | f2866a5420b4645d888fc50b22f7cbdd8a178042 (patch) | |
tree | 0fcf939a8a8bb1da4c57ba154cbe543b5b4dfb63 /layout/style/nsRuleNode.cpp | |
parent | b862145e9c7f0802ea5fa7e02c003744dbca9ec2 (diff) | |
download | UXP-f2866a5420b4645d888fc50b22f7cbdd8a178042.tar UXP-f2866a5420b4645d888fc50b22f7cbdd8a178042.tar.gz UXP-f2866a5420b4645d888fc50b22f7cbdd8a178042.tar.lz UXP-f2866a5420b4645d888fc50b22f7cbdd8a178042.tar.xz UXP-f2866a5420b4645d888fc50b22f7cbdd8a178042.zip |
Issue #1647 - Part 2: Implement VARIANT_OPACITY to correctly serialize.
Even though percentages are already treated as floats internally by the style system for computation purposes, you have to go out of your way to stop them from being read back out as percentages. What I do here amounts to storing the percentage token in the "wrong" container, the one normally used for floats. This allows a value that was read in as a percentage to be read back out as something else, which is normally prevented by the design of the style system.
Diffstat (limited to 'layout/style/nsRuleNode.cpp')
-rw-r--r-- | layout/style/nsRuleNode.cpp | 15 |
1 files changed, 0 insertions, 15 deletions
diff --git a/layout/style/nsRuleNode.cpp b/layout/style/nsRuleNode.cpp index 3863ec292..036d97f86 100644 --- a/layout/style/nsRuleNode.cpp +++ b/layout/style/nsRuleNode.cpp @@ -1579,21 +1579,6 @@ SetFactor(const nsCSSValue& aValue, float& aField, RuleNodeCacheConditions& aCon case eCSSUnit_Null: return; - case eCSSUnit_Percent: - aField = aValue.GetPercentValue(); - if (aFlags & SETFCT_POSITIVE) { - NS_ASSERTION(aField >= 0.0f, "negative value for positive-only property"); - if (aField < 0.0f) - aField = 0.0f; - } - if (aFlags & SETFCT_OPACITY) { - if (aField < 0.0f) - aField = 0.0f; - if (aField > 1.0f) - aField = 1.0f; - } - return; - case eCSSUnit_Number: aField = aValue.GetFloatValue(); if (aFlags & SETFCT_POSITIVE) { |