Title: [252393] trunk/Source/WebCore
Revision
252393
Author
[email protected]
Date
2019-11-12 22:51:57 -0800 (Tue, 12 Nov 2019)

Log Message

Move CSSUnitType enum to its own file
https://bugs.webkit.org/show_bug.cgi?id=204139

Reviewed by Antti Koivisto.

Pull CSSUnitType and CSSUnitCategory enums into their own file, since more future
code will use them and not CSSPrimitiveValue.

* Headers.cmake:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* css/CSSPrimitiveValue.cpp:
(WebCore::unitCategory): Deleted.
* css/CSSPrimitiveValue.h:
* css/CSSUnits.cpp: Added.
(WebCore::unitCategory):
* css/CSSUnits.h: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (252392 => 252393)


--- trunk/Source/WebCore/ChangeLog	2019-11-13 04:41:17 UTC (rev 252392)
+++ trunk/Source/WebCore/ChangeLog	2019-11-13 06:51:57 UTC (rev 252393)
@@ -1,5 +1,25 @@
 2019-11-12  Simon Fraser  <[email protected]>
 
+        Move CSSUnitType enum to its own file
+        https://bugs.webkit.org/show_bug.cgi?id=204139
+
+        Reviewed by Antti Koivisto.
+
+        Pull CSSUnitType and CSSUnitCategory enums into their own file, since more future
+        code will use them and not CSSPrimitiveValue.
+
+        * Headers.cmake:
+        * Sources.txt:
+        * WebCore.xcodeproj/project.pbxproj:
+        * css/CSSPrimitiveValue.cpp:
+        (WebCore::unitCategory): Deleted.
+        * css/CSSPrimitiveValue.h:
+        * css/CSSUnits.cpp: Added.
+        (WebCore::unitCategory):
+        * css/CSSUnits.h: Added.
+
+2019-11-12  Simon Fraser  <[email protected]>
+
         Convert CSSPrimitiveValue::UnitType to an enum class, and cleanup
         https://bugs.webkit.org/show_bug.cgi?id=204101
 

Modified: trunk/Source/WebCore/Headers.cmake (252392 => 252393)


--- trunk/Source/WebCore/Headers.cmake	2019-11-13 04:41:17 UTC (rev 252392)
+++ trunk/Source/WebCore/Headers.cmake	2019-11-13 06:51:57 UTC (rev 252393)
@@ -314,6 +314,7 @@
     css/CSSStyleRule.h
     css/CSSStyleSheet.h
     css/CSSToLengthConversionData.h
+    css/CSSUnits.h
     css/CSSUnknownRule.h
     css/CSSValue.h
     css/CSSValueList.h

Modified: trunk/Source/WebCore/Sources.txt (252392 => 252393)


--- trunk/Source/WebCore/Sources.txt	2019-11-13 04:41:17 UTC (rev 252392)
+++ trunk/Source/WebCore/Sources.txt	2019-11-13 06:51:57 UTC (rev 252393)
@@ -740,6 +740,7 @@
 css/CSSToLengthConversionData.cpp
 css/CSSToStyleMap.cpp
 css/CSSUnicodeRangeValue.cpp
+css/CSSUnits.cpp
 css/CSSUnsetValue.cpp
 css/CSSValue.cpp
 css/CSSValueList.cpp

Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (252392 => 252393)


--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2019-11-13 04:41:17 UTC (rev 252392)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2019-11-13 06:51:57 UTC (rev 252393)
@@ -321,6 +321,7 @@
 		0F60F32B1DFBB10700416D6C /* CommonVM.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F60F32A1DFBB10400416D6C /* CommonVM.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		0F6383DE18615B29003E5DB5 /* ThreadedScrollingTree.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F6383DC18615B29003E5DB5 /* ThreadedScrollingTree.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		0F6A12BE1A00923700C6DE72 /* DebugPageOverlays.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F6A12BC1A00923700C6DE72 /* DebugPageOverlays.h */; settings = {ATTRIBUTES = (Private, ); }; };
+		0F6B707A237BC36D0052CA47 /* CSSUnits.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F6B7077237BC12F0052CA47 /* CSSUnits.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		0F73B769222B3A0C00805316 /* ScrollingTreeOverflowScrollingNodeMac.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FC0516A219B5EBE0031C39E /* ScrollingTreeOverflowScrollingNodeMac.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		0F7D07331884C56C00B4AF86 /* PlatformTextTrack.h in Headers */ = {isa = PBXBuildFile; fileRef = 072847E216EBC5B00043CFA4 /* PlatformTextTrack.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		0F850FE31ED7C18300FB77A7 /* PerformanceLoggingClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F850FE21ED7C18300FB77A7 /* PerformanceLoggingClient.h */; settings = {ATTRIBUTES = (Private, ); }; };
@@ -5737,6 +5738,8 @@
 		0F69F2B7228B98FF008D3565 /* LayerOverlapMap.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = LayerOverlapMap.cpp; sourceTree = "<group>"; };
 		0F6A12BB1A00923700C6DE72 /* DebugPageOverlays.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DebugPageOverlays.cpp; sourceTree = "<group>"; };
 		0F6A12BC1A00923700C6DE72 /* DebugPageOverlays.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DebugPageOverlays.h; sourceTree = "<group>"; };
+		0F6B7077237BC12F0052CA47 /* CSSUnits.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CSSUnits.h; sourceTree = "<group>"; };
+		0F6B7079237BC12F0052CA47 /* CSSUnits.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = CSSUnits.cpp; sourceTree = "<group>"; };
 		0F70495D211B524200369968 /* ActivityState.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = ActivityState.cpp; sourceTree = "<group>"; };
 		0F73B765222B327F00805316 /* ScrollingStateScrollingNodeMac.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = ScrollingStateScrollingNodeMac.mm; sourceTree = "<group>"; };
 		0F7DF1471E2BF1A60095951B /* WebCoreJSClientData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebCoreJSClientData.cpp; sourceTree = "<group>"; };
@@ -6474,8 +6477,8 @@
 		1CFAE3220A6D6A3F0032593D /* libobjc.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libobjc.dylib; path = /usr/lib/libobjc.dylib; sourceTree = "<absolute>"; };
 		1D0026A22374D62300CA6CDF /* JSPictureInPictureWindow.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSPictureInPictureWindow.h; sourceTree = "<group>"; };
 		1D0026A32374D62400CA6CDF /* JSPictureInPictureWindow.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSPictureInPictureWindow.cpp; sourceTree = "<group>"; };
-		1D0026A82374F9D900CA6CDF /* JSEnterPictureInPictureEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = JSEnterPictureInPictureEvent.h; path = JSEnterPictureInPictureEvent.h; sourceTree = "<group>"; };
-		1D0026A92374F9D900CA6CDF /* JSEnterPictureInPictureEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = JSEnterPictureInPictureEvent.cpp; path = JSEnterPictureInPictureEvent.cpp; sourceTree = "<group>"; };
+		1D0026A82374F9D900CA6CDF /* JSEnterPictureInPictureEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSEnterPictureInPictureEvent.h; sourceTree = "<group>"; };
+		1D0026A92374F9D900CA6CDF /* JSEnterPictureInPictureEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSEnterPictureInPictureEvent.cpp; sourceTree = "<group>"; };
 		1D2C82B6236A3F6A0055D6C5 /* PictureInPictureSupport.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PictureInPictureSupport.h; sourceTree = "<group>"; };
 		1DBC1B552347B3D200B901AF /* PictureInPictureObserver.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PictureInPictureObserver.h; sourceTree = "<group>"; };
 		1DC553FD211BA12A004B780E /* NavigatorShare.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = NavigatorShare.idl; sourceTree = "<group>"; };
@@ -27322,6 +27325,8 @@
 				A882DA221593848D000115ED /* CSSToStyleMap.h */,
 				371F53E80D2704F900ECE0D5 /* CSSUnicodeRangeValue.cpp */,
 				371F53E70D2704F900ECE0D5 /* CSSUnicodeRangeValue.h */,
+				0F6B7079237BC12F0052CA47 /* CSSUnits.cpp */,
+				0F6B7077237BC12F0052CA47 /* CSSUnits.h */,
 				A80E6CCE0A1989CA007FB8C5 /* CSSUnknownRule.h */,
 				85C56CAD0AA89FE000D95755 /* CSSUnknownRule.idl */,
 				BC7D8FED1BD03B6400FFE540 /* CSSUnsetValue.cpp */,
@@ -29269,7 +29274,6 @@
 				5721A98B1ECE57040081295A /* CryptoAlgorithmRsaPssParams.h in Headers */,
 				E1BD331A182D8DDD00C05D9F /* CryptoAlgorithmRSASSA_PKCS1_v1_5.h in Headers */,
 				E125F82C1822CFEC00D84CD9 /* CryptoAlgorithmSHA1.h in Headers */,
-				E45BA6B6237622A3004DFC07 /* StyleAdjuster.h in Headers */,
 				E19AC3EF1824DC7900349426 /* CryptoAlgorithmSHA224.h in Headers */,
 				E19AC3F11824DC7900349426 /* CryptoAlgorithmSHA256.h in Headers */,
 				E19AC3F31824DC7900349426 /* CryptoAlgorithmSHA384.h in Headers */,
@@ -29391,6 +29395,7 @@
 				A882DA231593848D000115ED /* CSSToStyleMap.h in Headers */,
 				715AD7212050513F00D592DC /* CSSTransition.h in Headers */,
 				371F53E90D2704F900ECE0D5 /* CSSUnicodeRangeValue.h in Headers */,
+				0F6B707A237BC36D0052CA47 /* CSSUnits.h in Headers */,
 				DD7CDF250A23CF9800069928 /* CSSUnknownRule.h in Headers */,
 				BC7D8FF01BD03B6400FFE540 /* CSSUnsetValue.h in Headers */,
 				A80E6CEE0A1989CA007FB8C5 /* CSSValue.h in Headers */,
@@ -32219,6 +32224,7 @@
 				9B6C41531344949000085B62 /* StringWithDirection.h in Headers */,
 				849F77760EFEC6200090849D /* StrokeStyleApplier.h in Headers */,
 				414B82051D6DF0E50077EBE3 /* StructuredClone.h in Headers */,
+				E45BA6B6237622A3004DFC07 /* StyleAdjuster.h in Headers */,
 				BC5EB6A30E81DC4F00B25965 /* StyleBackgroundData.h in Headers */,
 				BC5EB67B0E81D3BE00B25965 /* StyleBoxData.h in Headers */,
 				E4ABAC06236B016D00FA4345 /* StyleBuilder.h in Headers */,

Modified: trunk/Source/WebCore/css/CSSPrimitiveValue.cpp (252392 => 252393)


--- trunk/Source/WebCore/css/CSSPrimitiveValue.cpp	2019-11-13 04:41:17 UTC (rev 252392)
+++ trunk/Source/WebCore/css/CSSPrimitiveValue.cpp	2019-11-13 06:51:57 UTC (rev 252393)
@@ -178,43 +178,6 @@
 
 #endif // !ASSERT_DISABLED
 
-CSSUnitCategory unitCategory(CSSUnitType type)
-{
-    switch (type) {
-    case CSSUnitType::CSS_NUMBER:
-        return CSSUnitCategory::Number;
-    case CSSUnitType::CSS_PERCENTAGE:
-        return CSSUnitCategory::Percent;
-    case CSSUnitType::CSS_PX:
-    case CSSUnitType::CSS_CM:
-    case CSSUnitType::CSS_MM:
-    case CSSUnitType::CSS_IN:
-    case CSSUnitType::CSS_PT:
-    case CSSUnitType::CSS_PC:
-    case CSSUnitType::CSS_Q:
-        return CSSUnitCategory::Length;
-    case CSSUnitType::CSS_MS:
-    case CSSUnitType::CSS_S:
-        return CSSUnitCategory::Time;
-    case CSSUnitType::CSS_DEG:
-    case CSSUnitType::CSS_RAD:
-    case CSSUnitType::CSS_GRAD:
-    case CSSUnitType::CSS_TURN:
-        return CSSUnitCategory::Angle;
-    case CSSUnitType::CSS_HZ:
-    case CSSUnitType::CSS_KHZ:
-        return CSSUnitCategory::Frequency;
-#if ENABLE(CSS_IMAGE_RESOLUTION) || ENABLE(RESOLUTION_MEDIA_QUERY)
-    case CSSUnitType::CSS_DPPX:
-    case CSSUnitType::CSS_DPI:
-    case CSSUnitType::CSS_DPCM:
-        return CSSUnitCategory::Resolution;
-#endif
-    default:
-        return CSSUnitCategory::Other;
-    }
-}
-
 typedef HashMap<const CSSPrimitiveValue*, String> CSSTextCache;
 static CSSTextCache& cssTextCache()
 {

Modified: trunk/Source/WebCore/css/CSSPrimitiveValue.h (252392 => 252393)


--- trunk/Source/WebCore/css/CSSPrimitiveValue.h	2019-11-13 04:41:17 UTC (rev 252392)
+++ trunk/Source/WebCore/css/CSSPrimitiveValue.h	2019-11-13 06:51:57 UTC (rev 252393)
@@ -22,6 +22,7 @@
 #pragma once
 
 #include "CSSPropertyNames.h"
+#include "CSSUnits.h"
 #include "CSSValue.h"
 #include "CSSValueKeywords.h"
 #include "Color.h"
@@ -72,90 +73,6 @@
     return static_cast<float>(value);
 }
 
-enum class CSSUnitType : uint8_t {
-    CSS_UNKNOWN = 0,
-    CSS_NUMBER = 1,
-    CSS_PERCENTAGE = 2,
-    CSS_EMS = 3,
-    CSS_EXS = 4,
-    CSS_PX = 5,
-    CSS_CM = 6,
-    CSS_MM = 7,
-    CSS_IN = 8,
-    CSS_PT = 9,
-    CSS_PC = 10,
-    CSS_DEG = 11,
-    CSS_RAD = 12,
-    CSS_GRAD = 13,
-    CSS_MS = 14,
-    CSS_S = 15,
-    CSS_HZ = 16,
-    CSS_KHZ = 17,
-    CSS_DIMENSION = 18,
-    CSS_STRING = 19,
-    CSS_URI = 20,
-    CSS_IDENT = 21,
-    CSS_ATTR = 22,
-    CSS_COUNTER = 23,
-    CSS_RECT = 24,
-    CSS_RGBCOLOR = 25,
-    CSS_VW = 26,
-    CSS_VH = 27,
-    CSS_VMIN = 28,
-    CSS_VMAX = 29,
-    CSS_DPPX = 30,
-    CSS_DPI = 31,
-    CSS_DPCM = 32,
-    CSS_FR = 33,
-    CSS_Q = 34,
-    CSS_PAIR = 100, // We envision this being exposed as a means of getting computed style values for pairs (border-spacing/radius, background-position, etc.)
-    CSS_UNICODE_RANGE = 102,
-    CSS_TURN = 107,
-    CSS_REMS = 108,
-    CSS_CHS = 109,
-
-    // This is used internally for counter names (as opposed to counter values)
-    CSS_COUNTER_NAME = 110,
-
-    CSS_SHAPE = 111,
-
-    // Used by border images.
-    CSS_QUAD = 112,
-
-    CSS_CALC = 113,
-    CSS_CALC_PERCENTAGE_WITH_NUMBER = 114,
-    CSS_CALC_PERCENTAGE_WITH_LENGTH = 115,
-
-    CSS_FONT_FAMILY = 116,
-
-    CSS_PROPERTY_ID = 117,
-    CSS_VALUE_ID = 118,
-    
-    // This value is used to handle quirky margins in reflow roots (body, td, and th) like WinIE.
-    // The basic idea is that a stylesheet can use the value __qem (for quirky em) instead of em.
-    // When the quirky value is used, if you're in quirks mode, the margin will collapse away
-    // inside a table cell. This quirk is specified in the HTML spec but our impl is different.
-    CSS_QUIRKY_EMS = 120
-    
-    // Note that CSSValue allocates 7 bits for m_primitiveUnitType, so there can be no value here > 127.
-};
-
-// This enum follows the CSSParser::Units enum augmented with UNIT_FREQUENCY for frequencies.
-enum class CSSUnitCategory : uint8_t {
-    Number,
-    Percent,
-    Length,
-    Angle,
-    Time,
-    Frequency,
-#if ENABLE(CSS_IMAGE_RESOLUTION) || ENABLE(RESOLUTION_MEDIA_QUERY)
-    Resolution,
-#endif
-    Other
-};
-
-CSSUnitCategory unitCategory(CSSUnitType);
-
 class CSSPrimitiveValue final : public CSSValue {
 public:
 

Added: trunk/Source/WebCore/css/CSSUnits.cpp (0 => 252393)


--- trunk/Source/WebCore/css/CSSUnits.cpp	                        (rev 0)
+++ trunk/Source/WebCore/css/CSSUnits.cpp	2019-11-13 06:51:57 UTC (rev 252393)
@@ -0,0 +1,63 @@
+/*
+ * (C) 1999-2003 Lars Knoll ([email protected])
+ * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2012, 2013, 2019 Apple Inc. All rights reserved.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#include "config.h"
+#include "CSSUnits.h"
+
+namespace WebCore {
+
+CSSUnitCategory unitCategory(CSSUnitType type)
+{
+    switch (type) {
+    case CSSUnitType::CSS_NUMBER:
+        return CSSUnitCategory::Number;
+    case CSSUnitType::CSS_PERCENTAGE:
+        return CSSUnitCategory::Percent;
+    case CSSUnitType::CSS_PX:
+    case CSSUnitType::CSS_CM:
+    case CSSUnitType::CSS_MM:
+    case CSSUnitType::CSS_IN:
+    case CSSUnitType::CSS_PT:
+    case CSSUnitType::CSS_PC:
+    case CSSUnitType::CSS_Q:
+        return CSSUnitCategory::Length;
+    case CSSUnitType::CSS_MS:
+    case CSSUnitType::CSS_S:
+        return CSSUnitCategory::Time;
+    case CSSUnitType::CSS_DEG:
+    case CSSUnitType::CSS_RAD:
+    case CSSUnitType::CSS_GRAD:
+    case CSSUnitType::CSS_TURN:
+        return CSSUnitCategory::Angle;
+    case CSSUnitType::CSS_HZ:
+    case CSSUnitType::CSS_KHZ:
+        return CSSUnitCategory::Frequency;
+#if ENABLE(CSS_IMAGE_RESOLUTION) || ENABLE(RESOLUTION_MEDIA_QUERY)
+    case CSSUnitType::CSS_DPPX:
+    case CSSUnitType::CSS_DPI:
+    case CSSUnitType::CSS_DPCM:
+        return CSSUnitCategory::Resolution;
+#endif
+    default:
+        return CSSUnitCategory::Other;
+    }
+}
+
+} // namespace WebCore

Added: trunk/Source/WebCore/css/CSSUnits.h (0 => 252393)


--- trunk/Source/WebCore/css/CSSUnits.h	                        (rev 0)
+++ trunk/Source/WebCore/css/CSSUnits.h	2019-11-13 06:51:57 UTC (rev 252393)
@@ -0,0 +1,110 @@
+/*
+ * (C) 1999-2003 Lars Knoll ([email protected])
+ * Copyright (C) 2004, 2005, 2006, 2008, 2019 Apple Inc. All rights reserved.
+ * Copyright (C) 2007 Alexey Proskuryakov <[email protected]>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#pragma once
+
+namespace WebCore {
+
+enum class CSSUnitType : uint8_t {
+    CSS_UNKNOWN = 0,
+    CSS_NUMBER = 1,
+    CSS_PERCENTAGE = 2,
+    CSS_EMS = 3,
+    CSS_EXS = 4,
+    CSS_PX = 5,
+    CSS_CM = 6,
+    CSS_MM = 7,
+    CSS_IN = 8,
+    CSS_PT = 9,
+    CSS_PC = 10,
+    CSS_DEG = 11,
+    CSS_RAD = 12,
+    CSS_GRAD = 13,
+    CSS_MS = 14,
+    CSS_S = 15,
+    CSS_HZ = 16,
+    CSS_KHZ = 17,
+    CSS_DIMENSION = 18,
+    CSS_STRING = 19,
+    CSS_URI = 20,
+    CSS_IDENT = 21,
+    CSS_ATTR = 22,
+    CSS_COUNTER = 23,
+    CSS_RECT = 24,
+    CSS_RGBCOLOR = 25,
+    CSS_VW = 26,
+    CSS_VH = 27,
+    CSS_VMIN = 28,
+    CSS_VMAX = 29,
+    CSS_DPPX = 30,
+    CSS_DPI = 31,
+    CSS_DPCM = 32,
+    CSS_FR = 33,
+    CSS_Q = 34,
+    CSS_PAIR = 100, // We envision this being exposed as a means of getting computed style values for pairs (border-spacing/radius, background-position, etc.)
+    CSS_UNICODE_RANGE = 102,
+    CSS_TURN = 107,
+    CSS_REMS = 108,
+    CSS_CHS = 109,
+
+    // This is used internally for counter names (as opposed to counter values)
+    CSS_COUNTER_NAME = 110,
+
+    CSS_SHAPE = 111,
+
+    // Used by border images.
+    CSS_QUAD = 112,
+
+    CSS_CALC = 113,
+    CSS_CALC_PERCENTAGE_WITH_NUMBER = 114,
+    CSS_CALC_PERCENTAGE_WITH_LENGTH = 115,
+
+    CSS_FONT_FAMILY = 116,
+
+    CSS_PROPERTY_ID = 117,
+    CSS_VALUE_ID = 118,
+    
+    // This value is used to handle quirky margins in reflow roots (body, td, and th) like WinIE.
+    // The basic idea is that a stylesheet can use the value __qem (for quirky em) instead of em.
+    // When the quirky value is used, if you're in quirks mode, the margin will collapse away
+    // inside a table cell. This quirk is specified in the HTML spec but our impl is different.
+    CSS_QUIRKY_EMS = 120
+    
+    // Note that CSSValue allocates 7 bits for m_primitiveUnitType, so there can be no value here > 127.
+};
+
+enum class CSSUnitCategory : uint8_t {
+    Number,
+    Percent,
+    Length,
+    Angle,
+    Time,
+    Frequency,
+#if ENABLE(CSS_IMAGE_RESOLUTION) || ENABLE(RESOLUTION_MEDIA_QUERY)
+    Resolution,
+#endif
+    Other
+};
+
+CSSUnitCategory unitCategory(CSSUnitType);
+
+} // namespace WebCore
+
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to