summaryrefslogtreecommitdiffstats
path: root/layout/style/nsCSSProps.h
diff options
context:
space:
mode:
authorathenian200 <athenian200@outlook.com>2020-09-17 16:01:38 -0500
committerathenian200 <athenian200@outlook.com>2020-09-17 16:01:38 -0500
commitb5c9f8e24e6ce368532f893fbd9a517b79096839 (patch)
tree103df6df754ae5d6dc93a432aeb54254777834b1 /layout/style/nsCSSProps.h
parent51764ac7228e723054bf304a381cc83d9067f10a (diff)
downloadUXP-b5c9f8e24e6ce368532f893fbd9a517b79096839.tar
UXP-b5c9f8e24e6ce368532f893fbd9a517b79096839.tar.gz
UXP-b5c9f8e24e6ce368532f893fbd9a517b79096839.tar.lz
UXP-b5c9f8e24e6ce368532f893fbd9a517b79096839.tar.xz
UXP-b5c9f8e24e6ce368532f893fbd9a517b79096839.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/nsCSSProps.h')
-rw-r--r--layout/style/nsCSSProps.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/layout/style/nsCSSProps.h b/layout/style/nsCSSProps.h
index aabbac07a..34d457c08 100644
--- a/layout/style/nsCSSProps.h
+++ b/layout/style/nsCSSProps.h
@@ -43,6 +43,7 @@
#define VARIANT_IDENTIFIER 0x002000 // D
#define VARIANT_IDENTIFIER_NO_INHERIT 0x004000 // like above, but excluding
// 'inherit' and 'initial'
+#define VARIANT_OPACITY 0x008000 // Take floats and percents as input, output float.
#define VARIANT_AUTO 0x010000 // A
#define VARIANT_INHERIT 0x020000 // H eCSSUnit_Initial, eCSSUnit_Inherit, eCSSUnit_Unset
#define VARIANT_NONE 0x040000 // O