Title: [125368] trunk/Source/WebCore
Revision
125368
Author
[email protected]
Date
2012-08-12 03:39:20 -0700 (Sun, 12 Aug 2012)

Log Message

Move CSS's propertyNameStrings[] to from the header to the cpp file
https://bugs.webkit.org/show_bug.cgi?id=93771

Reviewed by Eric Seidel.

The names of propertyNameStrings[] should never be accessed directly. The function getPropertyName()
return the correct string of propertyNameStrings.

To ensure the values are not accessed by mistake, move them from the header to the implementation.

* css/makeprop.pl:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (125367 => 125368)


--- trunk/Source/WebCore/ChangeLog	2012-08-12 10:37:15 UTC (rev 125367)
+++ trunk/Source/WebCore/ChangeLog	2012-08-12 10:39:20 UTC (rev 125368)
@@ -1,5 +1,19 @@
 2012-08-12  Benjamin Poulain  <[email protected]>
 
+        Move CSS's propertyNameStrings[] to from the header to the cpp file
+        https://bugs.webkit.org/show_bug.cgi?id=93771
+
+        Reviewed by Eric Seidel.
+
+        The names of propertyNameStrings[] should never be accessed directly. The function getPropertyName()
+        return the correct string of propertyNameStrings.
+
+        To ensure the values are not accessed by mistake, move them from the header to the implementation.
+
+        * css/makeprop.pl:
+
+2012-08-12  Benjamin Poulain  <[email protected]>
+
         CSSComputedStyleDeclaration::cssText() should use StringBuilder
         https://bugs.webkit.org/show_bug.cgi?id=93776
 

Modified: trunk/Source/WebCore/css/makeprop.pl (125367 => 125368)


--- trunk/Source/WebCore/css/makeprop.pl	2012-08-12 10:37:15 UTC (rev 125367)
+++ trunk/Source/WebCore/css/makeprop.pl	2012-08-12 10:39:20 UTC (rev 125368)
@@ -73,6 +73,15 @@
 #include <wtf/text/WTFString.h>
 
 namespace WebCore {
+EOF
+
+print GPERF "const char* const propertyNameStrings[numCSSProperties] = {\n";
+foreach my $name (@names) {
+  print GPERF "    \"$name\",\n";
+}
+print GPERF "};\n\n";
+
+print GPERF << "EOF";
 %}
 %struct-type
 struct Property;
@@ -190,12 +199,6 @@
 print HEADER "const int lastCSSProperty = $last;\n";
 print HEADER "const size_t maxCSSPropertyNameLength = $maxLen;\n";
 
-print HEADER "const char* const propertyNameStrings[$num] = {\n";
-foreach my $name (@names) {
-  print HEADER "\"$name\",\n";
-}
-print HEADER "};\n";
-
 print HEADER << "EOF";
 
 const char* getPropertyName(CSSPropertyID);
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to