Guest User

Untitled

a guest
May 29th, 2018
243
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 26.67 KB | None | 0 0
  1. Index: WebKit/chromium/src/WebEntities.cpp
  2. ===================================================================
  3. --- WebKit/chromium/src/WebEntities.cpp (revision 61692)
  4. +++ WebKit/chromium/src/WebEntities.cpp (working copy)
  5. @@ -31,9 +31,9 @@
  6. #include "config.h"
  7. #include "WebEntities.h"
  8.  
  9. -#include <string.h>
  10. -
  11. +#include "HashTools.h"
  12. #include "PlatformString.h"
  13. +#include <string.h>
  14. #include "StringBuilder.h"
  15. #include <wtf/HashMap.h>
  16.  
  17. @@ -41,15 +41,6 @@
  18.  
  19. using namespace WebCore;
  20.  
  21. -namespace {
  22. -// Note that this file is also included by LegacyHTMLDocumentParser.cpp so we are getting
  23. -// two copies of the data in memory. We can fix this by changing the script
  24. -// that generated the array to create a static const that is its length, but
  25. -// this is low priority since the data is less than 4K. We use anonymous
  26. -// namespace to prevent name collisions.
  27. -#include "HTMLEntityNames.cpp" // NOLINT
  28. -}
  29. -
  30. namespace WebKit {
  31.  
  32. void populateMap(WTF::HashMap<int, WebCore::String>& map,
  33. @@ -91,8 +82,8 @@
  34. false);
  35. else
  36. populateMap(m_entitiesMap,
  37. - wordlist,
  38. - sizeof(wordlist) / sizeof(Entity),
  39. + HTMLEntityHash::wordlist,
  40. + sizeof(HTMLEntityHash::wordlist) / sizeof(Entity),
  41. true);
  42. }
  43.  
  44. Index: WebKit/chromium/ChangeLog
  45. ===================================================================
  46. --- WebKit/chromium/ChangeLog (revision 61693)
  47. +++ WebKit/chromium/ChangeLog (working copy)
  48. @@ -1,3 +1,21 @@
  49. +2010-06-23 Andras Becsi <abecsi@webkit.org>
  50. +
  51. + Reviewed by NOBODY (OOPS!).
  52. +
  53. + Undefined reference errors when linking due to gperf and inlining.
  54. + webkit.org/b/29244
  55. +
  56. + Refactor gperf code generation and usage to fix the debug build with gcc>4.4.
  57. + Hitherto gperf generated C code, these files were included in multiple C++ files across WebCore
  58. + to access the functionality provided. This resulted in debug build failure with newer gcc versions
  59. + because of a behaviour change of gcc, which disables C style inlining in debug mode.
  60. + The make-hash-tools.pl script lets gperf generate C++ code for all gperf files now, which are compiled
  61. + in their own compilation unit.
  62. + The functionality provided by the generated code is wrapped behind HashTools.h, so there is no need
  63. + for multiple inclusions of generated C files to access these functions.
  64. +
  65. + * src/WebEntities.cpp:
  66. +
  67. 2010-06-23 Yuzo Fujishima <yuzo@google.com>
  68.  
  69. Reviewed by Shinichiro Hamaji.
  70. Index: WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp
  71. ===================================================================
  72. --- WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp (revision 61692)
  73. +++ WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp (working copy)
  74. @@ -1322,7 +1322,7 @@
  75. for (unsigned i = 0; i < numqStyleSheetProperties; ++i) {
  76. CSSPropertyID property = qstyleSheetProperties[i];
  77.  
  78. - styleSheet += QString::fromLatin1(::getPropertyName(property));
  79. + styleSheet += QString::fromLatin1(getPropertyName(property));
  80. styleSheet += QLatin1Char(':');
  81. styleSheet += computedStyle(element)->getPropertyValue(property);
  82. styleSheet += QLatin1Char(';');
  83. Index: WebKit/qt/ChangeLog
  84. ===================================================================
  85. --- WebKit/qt/ChangeLog (revision 61693)
  86. +++ WebKit/qt/ChangeLog (working copy)
  87. @@ -1,3 +1,22 @@
  88. +2010-06-23 Andras Becsi <abecsi@webkit.org>
  89. +
  90. + Reviewed by NOBODY (OOPS!).
  91. +
  92. + Undefined reference errors when linking due to gperf and inlining.
  93. + webkit.org/b/29244
  94. +
  95. + Refactor gperf code generation and usage to fix the debug build with gcc>4.4.
  96. + Hitherto gperf generated C code, these files were included in multiple C++ files across WebCore
  97. + to access the functionality provided. This resulted in debug build failure with newer gcc versions
  98. + because of a behaviour change of gcc, which disables C style inlining in debug mode.
  99. + The make-hash-tools.pl script lets gperf generate C++ code for all gperf files now, which are compiled
  100. + in their own compilation unit.
  101. + The functionality provided by the generated code is wrapped behind HashTools.h, so there is no need
  102. + for multiple inclusions of generated C files to access these functions.
  103. +
  104. + * WebCoreSupport/FrameLoaderClientQt.cpp:
  105. + (WebCore::FrameLoaderClientQt::createPlugin):
  106. +
  107. 2010-06-23 David Boddie <dboddie@trolltech.com>
  108.  
  109. Reviewed by Simon Hausmann.
  110. Index: WebCore/WebCore.pri
  111. ===================================================================
  112. --- WebCore/WebCore.pri (revision 61692)
  113. +++ WebCore/WebCore.pri (working copy)
  114. @@ -682,7 +682,7 @@
  115. cssprops.output = $${WC_GENERATED_SOURCES_DIR}/CSSPropertyNames.cpp
  116. cssprops.input = WALDOCSSPROPS
  117. cssprops.commands = perl -ne \"print lc\" ${QMAKE_FILE_NAME} $${DASHBOARDSUPPORTCSSPROPERTIES} $${EXTRACSSPROPERTIES} > $${WC_GENERATED_SOURCES_DIR}/${QMAKE_FILE_BASE}.in && cd $$WC_GENERATED_SOURCES_DIR && perl $$cssprops.wkScript && $(DEL_FILE) ${QMAKE_FILE_BASE}.in ${QMAKE_FILE_BASE}.gperf
  118. -cssprops.depends = ${QMAKE_FILE_NAME} $${DASHBOARDSUPPORTCSSPROPERTIES} $${EXTRACSSPROPERTIES}
  119. +cssprops.depends = ${QMAKE_FILE_NAME} $${DASHBOARDSUPPORTCSSPROPERTIES} $${EXTRACSSPROPERTIES} $$cssprops.wkScript
  120. addExtraCompiler(cssprops)
  121.  
  122. # GENERATOR 6-B:
  123. @@ -690,7 +690,7 @@
  124. cssvalues.output = $${WC_GENERATED_SOURCES_DIR}/CSSValueKeywords.cpp
  125. cssvalues.input = WALDOCSSVALUES
  126. cssvalues.commands = perl -ne \"print lc\" ${QMAKE_FILE_NAME} $$EXTRACSSVALUES > $${WC_GENERATED_SOURCES_DIR}/${QMAKE_FILE_BASE}.in && cd $$WC_GENERATED_SOURCES_DIR && perl $$cssvalues.wkScript && $(DEL_FILE) ${QMAKE_FILE_BASE}.in ${QMAKE_FILE_BASE}.gperf
  127. -cssvalues.depends = ${QMAKE_FILE_NAME} $${EXTRACSSVALUES}
  128. +cssvalues.depends = ${QMAKE_FILE_NAME} $${EXTRACSSVALUES} $$cssvalues.wkScript
  129. cssvalues.clean = ${QMAKE_FILE_OUT} ${QMAKE_VAR_WC_GENERATED_SOURCES_DIR}/${QMAKE_FILE_BASE}.h
  130. addExtraCompiler(cssvalues)
  131.  
  132. Index: WebCore/ChangeLog
  133. ===================================================================
  134. --- WebCore/ChangeLog (revision 61693)
  135. +++ WebCore/ChangeLog (working copy)
  136. @@ -1,3 +1,37 @@
  137. +2010-06-23 Andras Becsi <abecsi@webkit.org>
  138. +
  139. + Reviewed by NOBODY (OOPS!).
  140. +
  141. + Undefined reference errors when linking due to gperf and inlining.
  142. + webkit.org/b/29244
  143. +
  144. + Refactor gperf code generation and usage to fix the debug build with gcc>4.4.
  145. + Hitherto gperf generated C code, these files were included in multiple C++ files across WebCore
  146. + to access the functionality provided. This resulted in debug build failure with newer gcc versions
  147. + because of a behaviour change of gcc, which disables C style inlining in debug mode.
  148. + The make-hash-tools.pl script lets gperf generate C++ code for all gperf files now, which are compiled
  149. + in their own compilation unit.
  150. + The functionality provided by the generated code is wrapped behind HashTools.h, so there is no need
  151. + for multiple inclusions of generated C files to access these functions.
  152. +
  153. + No new functionality added, no new tests needed.
  154. +
  155. + * CMakeLists.txt:
  156. + * WebCore.gyp/WebCore.gyp:
  157. + * WebCore.pri:
  158. + * WebCore.xcodeproj/project.pbxproj:
  159. + * css/CSSParser.cpp:
  160. + * css/makeprop.pl:
  161. + * css/makevalues.pl:
  162. + * html/DocTypeStrings.gperf:
  163. + * html/HTMLDocument.cpp:
  164. + * html/HTMLEntityNames.gperf:
  165. + * html/HTMLEntityParser.cpp:
  166. + * html/LegacyPreloadScanner.cpp:
  167. + * make-hash-tools.pl:
  168. + * platform/ColorData.gperf:
  169. + * platform/graphics/Color.cpp:
  170. +
  171. 2010-06-23 James Robinson <jamesr@chromium.org>
  172.  
  173. Reviewed by Dan Bernstein.
  174. Index: WebCore/WebCore.gyp/WebCore.gyp
  175. ===================================================================
  176. --- WebCore/WebCore.gyp/WebCore.gyp (revision 61692)
  177. +++ WebCore/WebCore.gyp/WebCore.gyp (working copy)
  178. @@ -546,7 +546,6 @@
  179. '<(SHARED_INTERMEDIATE_DIR)/webkit',
  180. '<(RULE_INPUT_PATH)',
  181. ],
  182. - 'process_outputs_as_sources': 0,
  183. },
  184. # Rule to build generated JavaScript (V8) bindings from .idl source.
  185. {
  186. @@ -653,6 +652,13 @@
  187. # Additional .cpp files from the webcore_bindings_sources rules.
  188. '<(SHARED_INTERMEDIATE_DIR)/webkit/CSSGrammar.cpp',
  189. '<(SHARED_INTERMEDIATE_DIR)/webkit/XPathGrammar.cpp',
  190. +
  191. + # Additional .cpp files for HashTools.h
  192. + '<(SHARED_INTERMEDIATE_DIR)/webkit/HTMLEntityNames.cpp',
  193. + '<(SHARED_INTERMEDIATE_DIR)/webkit/DocTypeStrings.cpp',
  194. + '<(SHARED_INTERMEDIATE_DIR)/webkit/ColorData.cpp',
  195. + '<(SHARED_INTERMEDIATE_DIR)/webkit/CSSPropertyNames.cpp',
  196. + '<(SHARED_INTERMEDIATE_DIR)/webkit/CSSValueKeywords.cpp',
  197. ],
  198. 'conditions': [
  199. ['javascript_engine=="v8"', {
  200. Index: WebCore/platform/graphics/Color.cpp
  201. ===================================================================
  202. --- WebCore/platform/graphics/Color.cpp (revision 61692)
  203. +++ WebCore/platform/graphics/Color.cpp (working copy)
  204. @@ -26,13 +26,12 @@
  205. #include "config.h"
  206. #include "Color.h"
  207.  
  208. +#include "HashTools.h"
  209. #include "PlatformString.h"
  210. #include <math.h>
  211. #include <wtf/Assertions.h>
  212. #include <wtf/MathExtras.h>
  213.  
  214. -#include "ColorData.cpp"
  215. -
  216. using namespace std;
  217. using namespace WTF;
  218.  
  219. Index: WebCore/platform/ColorData.gperf
  220. ===================================================================
  221. --- WebCore/platform/ColorData.gperf (revision 61692)
  222. +++ WebCore/platform/ColorData.gperf (working copy)
  223. @@ -1,13 +1,12 @@
  224. %struct-type
  225. -struct NamedColor {
  226. - const char *name;
  227. - int RGBValue;
  228. -};
  229. -%language=ANSI-C
  230. +struct NamedColor;
  231. +%omit-struct-type
  232. +%language=C++
  233. %readonly-tables
  234. %global-table
  235. %compare-strncmp
  236. -%define lookup-function-name findColor
  237. +%define class-name ColorDataHash
  238. +%define lookup-function-name findColorImpl
  239. %define hash-function-name colordata_hash_function
  240. %includes
  241. %enum
  242. Index: WebCore/html/HTMLEntityNames.gperf
  243. ===================================================================
  244. --- WebCore/html/HTMLEntityNames.gperf (revision 61692)
  245. +++ WebCore/html/HTMLEntityNames.gperf (working copy)
  246. @@ -25,16 +25,16 @@
  247. */
  248. %}
  249. %struct-type
  250. -struct Entity {
  251. - const char *name;
  252. - int code;
  253. -};
  254. -%language=ANSI-C
  255. +struct Entity;
  256. +%language=C++
  257. +%omit-struct-type
  258. %readonly-tables
  259. %global-table
  260. %compare-strncmp
  261. -%define lookup-function-name findEntity
  262. +%define class-name HTMLEntityHash
  263. +%define lookup-function-name findEntityImpl
  264. %define hash-function-name entity_hash_function
  265. +%define word-array-name HTMLEntityHash::wordlist
  266. %includes
  267. %enum
  268. %%
  269. Index: WebCore/html/LegacyPreloadScanner.cpp
  270. ===================================================================
  271. --- WebCore/html/LegacyPreloadScanner.cpp (revision 61692)
  272. +++ WebCore/html/LegacyPreloadScanner.cpp (working copy)
  273. @@ -38,25 +38,13 @@
  274. #include "Document.h"
  275. #include "Frame.h"
  276. #include "FrameLoader.h"
  277. +#include "HashTools.h"
  278. #include "HTMLLinkElement.h"
  279. #include "HTMLNames.h"
  280. #include <wtf/text/CString.h>
  281. #include <wtf/CurrentTime.h>
  282. #include <wtf/unicode/Unicode.h>
  283.  
  284. -// Use __GNUC__ instead of PLATFORM(GCC) to stay consistent with the gperf generated c file
  285. -#ifdef __GNUC__
  286. -// The main tokenizer includes this too so we are getting two copies of the data. However, this way the code gets inlined.
  287. -#include "HTMLEntityNames.cpp"
  288. -#else
  289. -// Not inlined for non-GCC compilers
  290. -struct Entity {
  291. - const char* name;
  292. - int code;
  293. -};
  294. -const struct Entity* findEntity(register const char* str, register unsigned int len);
  295. -#endif
  296. -
  297. #define PRELOAD_DEBUG 0
  298.  
  299. using namespace WTF;
  300. Index: WebCore/html/HTMLEntityParser.cpp
  301. ===================================================================
  302. --- WebCore/html/HTMLEntityParser.cpp (revision 61692)
  303. +++ WebCore/html/HTMLEntityParser.cpp (working copy)
  304. @@ -28,21 +28,9 @@
  305. #include "config.h"
  306. #include "HTMLEntityParser.h"
  307.  
  308. +#include "HashTools.h"
  309. #include <wtf/Vector.h>
  310.  
  311. -// Use __GNUC__ instead of PLATFORM(GCC) to stay consistent with the gperf generated c file
  312. -#ifdef __GNUC__
  313. -// The main parser includes this too so we are getting two copies of the data. However, this way the code gets inlined.
  314. -#include "HTMLEntityNames.cpp"
  315. -#else
  316. -// Not inlined for non-GCC compilers
  317. -struct Entity {
  318. - const char* name;
  319. - int code;
  320. -};
  321. -const struct Entity* findEntity(register const char* str, register unsigned int len);
  322. -#endif
  323. -
  324. using namespace WTF;
  325.  
  326. namespace WebCore {
  327. Index: WebCore/html/DocTypeStrings.gperf
  328. ===================================================================
  329. --- WebCore/html/DocTypeStrings.gperf (revision 61692)
  330. +++ WebCore/html/DocTypeStrings.gperf (working copy)
  331. @@ -1,21 +1,13 @@
  332. %struct-type
  333. -struct PubIDInfo {
  334. - enum eMode {
  335. - eQuirks,
  336. - eQuirks3,
  337. - eAlmostStandards
  338. - };
  339. -
  340. - const char* name;
  341. - eMode mode_if_no_sysid;
  342. - eMode mode_if_sysid;
  343. -}
  344. -%language=ANSI-C
  345. +struct PubIDInfo;
  346. +%omit-struct-type
  347. +%language=C++
  348. %readonly-tables
  349. %global-table
  350. %compare-strncmp
  351. +%define class-name DocTypeStringsHash
  352. %define initializer-suffix ,PubIDInfo::eAlmostStandards,PubIDInfo::eAlmostStandards
  353. -%define lookup-function-name findDoctypeEntry
  354. +%define lookup-function-name findDoctypeEntryImpl
  355. %define hash-function-name doctype_hash_function
  356. %includes
  357. %enum
  358. Index: WebCore/html/HTMLDocument.cpp
  359. ===================================================================
  360. --- WebCore/html/HTMLDocument.cpp (revision 61692)
  361. +++ WebCore/html/HTMLDocument.cpp (working copy)
  362. @@ -64,6 +64,7 @@
  363. #include "FrameLoader.h"
  364. #include "FrameTree.h"
  365. #include "FrameView.h"
  366. +#include "HashTools.h"
  367. #include "HTMLDocumentParser.h"
  368. #include "HTMLBodyElement.h"
  369. #include "HTMLElementFactory.h"
  370. @@ -75,8 +76,6 @@
  371. #include "Settings.h"
  372. #include <wtf/text/CString.h>
  373.  
  374. -#include "DocTypeStrings.cpp"
  375. -
  376. namespace WebCore {
  377.  
  378. using namespace HTMLNames;
  379. Index: WebCore/make-hash-tools.pl
  380. ===================================================================
  381. --- WebCore/make-hash-tools.pl (revision 61692)
  382. +++ WebCore/make-hash-tools.pl (working copy)
  383. @@ -26,35 +26,158 @@
  384. my $outdir = $ARGV[0];
  385. shift;
  386. my $option = basename($ARGV[0],".gperf");
  387. +my $hashToolsHeader = "$outdir/HashTools.h";
  388.  
  389. +sub createHashToolsHeader() {
  390. +
  391. +open HEADER, ">$hashToolsHeader" || die "Could not open $hashToolsHeader for writing";
  392. +print HEADER << "EOF";
  393. +/* This file is automatically generated by make-hash-tools.pl, do not edit */
  394. +
  395. +#ifndef HashTools_h
  396. +#define HashTools_h
  397. +
  398. +namespace WebCore {
  399. +
  400. +struct Entity {
  401. + const char* name;
  402. + int code;
  403. +};
  404. +
  405. +struct PubIDInfo {
  406. + enum eMode {
  407. + eQuirks,
  408. + eQuirks3,
  409. + eAlmostStandards
  410. + };
  411. +
  412. + const char* name;
  413. + eMode mode_if_no_sysid;
  414. + eMode mode_if_sysid;
  415. +};
  416. +
  417. +struct NamedColor {
  418. + const char* name;
  419. + int RGBValue;
  420. +};
  421. +
  422. +struct Property {
  423. + const char* name;
  424. + int id;
  425. +};
  426. +
  427. +struct Value {
  428. + const char* name;
  429. + int id;
  430. +};
  431. +
  432. +const Entity* findEntity(register const char* str, register unsigned int len);
  433. +const PubIDInfo* findDoctypeEntry(register const char* str, register unsigned int len);
  434. +const NamedColor* findColor(register const char* str, register unsigned int len);
  435. +const Property* findProperty(register const char* str, register unsigned int len);
  436. +const Value* findValue(register const char* str, register unsigned int len);
  437. +
  438. +}
  439. +
  440. +#endif // HashTools_h
  441. +
  442. +EOF
  443. +close HEADER;
  444. +
  445. +}
  446. +
  447. +
  448. +
  449. switch ($option) {
  450.  
  451. case "HTMLEntityNames" {
  452.  
  453. - my $htmlEntityNamesGenerated = "$outdir/HTMLEntityNames.cpp";
  454. + createHashToolsHeader();
  455. +
  456. + my $htmlEntityNamesImpl = "$outdir/HTMLEntityNames.cpp";
  457. + my $htmlEntityNamesGenerated = "$outdir/HTMLEntityNamesHash.h";
  458. my $htmlEntityNamesGperf = $ARGV[0];
  459. shift;
  460.  
  461. + open ENTITIES, ">$htmlEntityNamesImpl" || die "Could not open $htmlEntityNamesImpl for writing";
  462. + print ENTITIES << "EOF";
  463. +/* This file is automatically generated by make-hash-tools.pl, do not edit */
  464. +
  465. +#include "HashTools.h"
  466. +
  467. +namespace WebCore {
  468. +#include "HTMLEntityNamesHash.h"
  469. +
  470. +const Entity* findEntity(register const char* str, register unsigned int len)
  471. +{
  472. + return HTMLEntityHash::findEntityImpl(str, len);
  473. +}
  474. +
  475. +}
  476. +
  477. +EOF
  478. + close ENTITIES;
  479. +
  480. system("gperf --key-positions=\"*\" -D -s 2 $htmlEntityNamesGperf > $htmlEntityNamesGenerated") == 0 || die "calling gperf failed: $?";
  481.  
  482. } # case "HTMLEntityNames"
  483.  
  484. case "DocTypeStrings" {
  485.  
  486. - my $docTypeStringsGenerated = "$outdir/DocTypeStrings.cpp";
  487. + my $docTypeStringsImpl = "$outdir/DocTypeStrings.cpp";
  488. + my $docTypeStringsGenerated = "$outdir/DocTypeStringsHash.h";
  489. my $docTypeStringsGperf = $ARGV[0];
  490. shift;
  491.  
  492. + open DOCTYPESTRINGS, ">$docTypeStringsImpl" || die "Could not open $docTypeStringsImpl for writing";
  493. + print DOCTYPESTRINGS << "EOF";
  494. +/* This file is automatically generated by make-hash-tools.pl, do not edit */
  495. +
  496. +#include "HashTools.h"
  497. +
  498. +namespace WebCore {
  499. +#include "DocTypeStringsHash.h"
  500. +
  501. +const PubIDInfo* findDoctypeEntry (register const char* str, register unsigned int len)
  502. +{
  503. + return DocTypeStringsHash::findDoctypeEntryImpl(str, len);
  504. +}
  505. +
  506. +}
  507. +
  508. +EOF
  509. + close DOCTYPESTRINGS;
  510. +
  511. system("gperf --key-positions=\"*\" -s 2 $docTypeStringsGperf > $docTypeStringsGenerated") == 0 || die "calling gperf failed: $?";
  512.  
  513. } # case "DocTypeStrings"
  514.  
  515. case "ColorData" {
  516.  
  517. - my $colorDataGenerated = "$outdir/ColorData.cpp";
  518. - my $colorDataGperf = $ARGV[0];
  519. + my $colorDataImpl = "$outdir/ColorData.cpp";
  520. + my $colorDataGenerated = "$outdir/ColorDataHash.h";
  521. + my $colorDataGperf = $ARGV[0];
  522. shift;
  523.  
  524. + open COLORDATA, ">$colorDataImpl" || die "Could not open $colorDataImpl for writing";
  525. + print COLORDATA << "EOF";
  526. +/* This file is automatically generated by make-hash-tools.pl, do not edit */
  527. +
  528. +#include "HashTools.h"
  529. +
  530. +namespace WebCore {
  531. +#include "ColorDataHash.h"
  532. +
  533. +const struct NamedColor* findColor (register const char* str, register unsigned int len)
  534. +{
  535. + return ColorDataHash::findColorImpl(str, len);
  536. +}
  537. +
  538. +}
  539. +
  540. +EOF
  541. + close COLORDATA;
  542. +
  543. system("gperf --key-positions=\"*\" -D -s 2 $colorDataGperf > $colorDataGenerated") == 0 || die "calling gperf failed: $?";
  544.  
  545. } # case "ColorData"
  546. Index: WebCore/CMakeLists.txt
  547. ===================================================================
  548. --- WebCore/CMakeLists.txt (revision 61692)
  549. +++ WebCore/CMakeLists.txt (working copy)
  550. @@ -516,6 +516,10 @@
  551. ${DERIVED_SOURCES_DIR}/CSSGrammar.cpp
  552. ${DERIVED_SOURCES_DIR}/HTMLElementFactory.cpp
  553. ${DERIVED_SOURCES_DIR}/HTMLEntityNames.cpp
  554. + ${DERIVED_SOURCES_DIR}/DocTypeStrings.cpp
  555. + ${DERIVED_SOURCES_DIR}/CSSValueKeywords.cpp
  556. + ${DERIVED_SOURCES_DIR}/CSSPropertyNames.cpp
  557. + ${DERIVED_SOURCES_DIR}/ColorData.cpp
  558. ${DERIVED_SOURCES_DIR}/HTMLNames.cpp
  559. ${DERIVED_SOURCES_DIR}/JSHTMLElementWrapperFactory.cpp
  560. ${DERIVED_SOURCES_DIR}/UserAgentStyleSheetsData.cpp
  561. Index: WebCore/WebCore.xcodeproj/project.pbxproj
  562. ===================================================================
  563. --- WebCore/WebCore.xcodeproj/project.pbxproj (revision 61692)
  564. +++ WebCore/WebCore.xcodeproj/project.pbxproj (working copy)
  565. @@ -458,6 +458,11 @@
  566. 1AB7FC860A8B92EC00D9D37B /* XPathValue.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AB7FC650A8B92EC00D9D37B /* XPathValue.h */; };
  567. 1AB7FC870A8B92EC00D9D37B /* XPathVariableReference.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AB7FC660A8B92EC00D9D37B /* XPathVariableReference.cpp */; };
  568. 1AB7FC880A8B92EC00D9D37B /* XPathVariableReference.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AB7FC670A8B92EC00D9D37B /* XPathVariableReference.h */; };
  569. + 1ABA76C911D20E47004C201C /* ColorData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E406F3FB1198307D009D59D6 /* ColorData.cpp */; };
  570. + 1ABA76CA11D20E50004C201C /* CSSPropertyNames.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E41EA038119836DB00710BC5 /* CSSPropertyNames.cpp */; };
  571. + 1ABA76CB11D20E57004C201C /* CSSValueKeywords.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E41EA0391198374900710BC5 /* CSSValueKeywords.cpp */; };
  572. + 1ABA76CC11D20E5B004C201C /* DocTypeStrings.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E406F3FA1198304D009D59D6 /* DocTypeStrings.cpp */; };
  573. + 1ABA77FD11D21031004C201C /* HTMLEntityNames.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E406F4021198329A009D59D6 /* HTMLEntityNames.cpp */; };
  574. 1ABFE7530CD968D000FE4834 /* SQLTransaction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1ABFE7520CD968D000FE4834 /* SQLTransaction.cpp */; };
  575. 1AC2260C0DB69F190089B669 /* JSDOMApplicationCache.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AC2260A0DB69F190089B669 /* JSDOMApplicationCache.cpp */; };
  576. 1AC2260D0DB69F190089B669 /* JSDOMApplicationCache.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AC2260B0DB69F190089B669 /* JSDOMApplicationCache.h */; };
  577. @@ -21845,6 +21850,11 @@
  578. 1AD8F81C11CAB9E900E93E54 /* PlatformStrategies.cpp in Sources */,
  579. B525A96611CA2340003A23A8 /* JSSQLException.cpp in Sources */,
  580. A8E6A78211D1661B00311F4A /* HTMLParserScheduler.cpp in Sources */,
  581. + 1ABA76C911D20E47004C201C /* ColorData.cpp in Sources */,
  582. + 1ABA76CA11D20E50004C201C /* CSSPropertyNames.cpp in Sources */,
  583. + 1ABA76CB11D20E57004C201C /* CSSValueKeywords.cpp in Sources */,
  584. + 1ABA76CC11D20E5B004C201C /* DocTypeStrings.cpp in Sources */,
  585. + 1ABA77FD11D21031004C201C /* HTMLEntityNames.cpp in Sources */,
  586. );
  587. runOnlyForDeploymentPostprocessing = 0;
  588. };
  589. Index: WebCore/css/CSSParser.cpp
  590. ===================================================================
  591. --- WebCore/css/CSSParser.cpp (revision 61692)
  592. +++ WebCore/css/CSSParser.cpp (working copy)
  593. @@ -61,6 +61,7 @@
  594. #include "FloatConversion.h"
  595. #include "FontFamilyValue.h"
  596. #include "FontValue.h"
  597. +#include "HashTools.h"
  598. #include "MediaList.h"
  599. #include "MediaQueryExp.h"
  600. #include "Pair.h"
  601. @@ -88,9 +89,6 @@
  602. using namespace std;
  603. using namespace WTF;
  604.  
  605. -#include "CSSPropertyNames.cpp"
  606. -#include "CSSValueKeywords.cpp"
  607. -
  608. namespace WebCore {
  609.  
  610. static const unsigned INVALID_NUM_PARSED_PROPERTIES = UINT_MAX;
  611. Index: WebCore/css/makeprop.pl
  612. ===================================================================
  613. --- WebCore/css/makeprop.pl (revision 61692)
  614. +++ WebCore/css/makeprop.pl (working copy)
  615. @@ -41,15 +41,14 @@
  616. #include \"CSSPropertyNames.h\"
  617. %}
  618. %struct-type
  619. -struct Property {
  620. - const char* name;
  621. - int id;
  622. -};
  623. -%language=ANSI-C
  624. +struct Property;
  625. +%omit-struct-type
  626. +%language=C++
  627. %readonly-tables
  628. %global-table
  629. %compare-strncmp
  630. -%define lookup-function-name findProperty
  631. +%define class-name CSSPropertyNamesHash
  632. +%define lookup-function-name findPropertyImpl
  633. %define hash-function-name propery_hash_function
  634. %define word-array-name property_wordlist
  635. %includes
  636. @@ -72,6 +71,10 @@
  637. #ifndef CSSPropertyNames_h
  638. #define CSSPropertyNames_h
  639.  
  640. +#include <string.h>
  641. +
  642. +namespace WebCore {
  643. +
  644. enum CSSPropertyID {
  645. CSSPropertyInvalid = 0,
  646. EOF
  647. @@ -99,15 +102,17 @@
  648.  
  649. const char* getPropertyName(CSSPropertyID);
  650.  
  651. +} // namespace WebCore
  652. +
  653. #endif // CSSPropertyNames_h
  654.  
  655. EOF
  656.  
  657. close HEADER;
  658.  
  659. -system("gperf --key-positions=\"*\" -D -n -s 2 CSSPropertyNames.gperf > CSSPropertyNames.cpp") == 0 || die "calling gperf failed: $?";
  660. +system("gperf --key-positions=\"*\" -D -n -s 2 CSSPropertyNames.gperf > CSSPropertyNamesHash.hpp") == 0 || die "calling gperf failed: $?";
  661.  
  662. -open C, ">>CSSPropertyNames.cpp" || die "Could not open CSSPropertyNames.cpp for writing";
  663. +open C, ">>CSSPropertyNamesHash.hpp" || die "Could not open CSSPropertyNamesHash.hpp for writing";
  664. print C "static const char * const propertyNameStrings[$num] = {\n";
  665.  
  666. foreach my $name (@names) {
  667. @@ -116,6 +121,29 @@
  668.  
  669. print C << "EOF";
  670. };
  671. +
  672. +EOF
  673. +
  674. +close C;
  675. +
  676. +my $propertyNamesImpl = "CSSPropertyNames.cpp";
  677. +
  678. +open PROPERTYNAMES, ">$propertyNamesImpl" || die "Could not open $propertyNamesImpl for writing";
  679. +print PROPERTYNAMES << "EOF";
  680. +/* This file is automatically generated by make-hash-tools.pl, do not edit */
  681. +
  682. +
  683. +#include "CSSPropertyNames.h"
  684. +#include "HashTools.h"
  685. +
  686. +namespace WebCore {
  687. +#include "CSSPropertyNamesHash.hpp"
  688. +
  689. +const Property* findProperty (register const char* str, register unsigned int len)
  690. +{
  691. + return CSSPropertyNamesHash::findPropertyImpl(str, len);
  692. +}
  693. +
  694. const char* getPropertyName(CSSPropertyID id)
  695. {
  696. if (id < firstCSSProperty)
  697. @@ -125,7 +153,10 @@
  698. return 0;
  699. return propertyNameStrings[index];
  700. }
  701. +
  702. +} // namespace WebCore
  703. +
  704. EOF
  705.  
  706. -close C;
  707. +close PROPERTYNAMES;
  708.  
  709. Index: WebCore/css/makevalues.pl
  710. ===================================================================
  711. --- WebCore/css/makevalues.pl (revision 61692)
  712. +++ WebCore/css/makevalues.pl (working copy)
  713. @@ -42,14 +42,13 @@
  714. #include \"CSSValueKeywords.h\"
  715. %}
  716. %struct-type
  717. -struct Value {
  718. - const char* name;
  719. - int id;
  720. -};
  721. -%language=ANSI-C
  722. +struct Value;
  723. +%omit-struct-type
  724. +%language=C++
  725. %readonly-tables
  726. %compare-strncmp
  727. -%define lookup-function-name findValue
  728. +%define class-name CSSValueKeywordsHash
  729. +%define lookup-function-name findValueImpl
  730. %define hash-function-name value_hash_function
  731. %define word-array-name value_word_list
  732. %includes
  733. @@ -72,6 +71,10 @@
  734. #ifndef CSSValueKeywords_h
  735. #define CSSValueKeywords_h
  736.  
  737. +#include <string.h>
  738. +
  739. +namespace WebCore {
  740. +
  741. const int CSSValueInvalid = 0;
  742. EOF
  743.  
  744. @@ -92,13 +95,16 @@
  745.  
  746. const char* getValueName(unsigned short id);
  747.  
  748. +} // namespace WebCore
  749. +
  750. #endif // CSSValueKeywords_h
  751. +
  752. EOF
  753. close HEADER;
  754.  
  755. -system("gperf --key-positions=\"*\" -D -n -s 2 CSSValueKeywords.gperf > CSSValueKeywords.cpp") == 0 || die "calling gperf failed: $?";
  756. +system("gperf --key-positions=\"*\" -D -n -s 2 CSSValueKeywords.gperf > CSSValueKeywordsHash.hpp") == 0 || die "calling gperf failed: $?";
  757.  
  758. -open C, ">>CSSValueKeywords.cpp" || die "Could not open CSSValueKeywords.cpp for writing";
  759. +open C, ">>CSSValueKeywordsHash.hpp" || die "Could not open CSSValueKeywordsHash.hpp for writing";
  760. print C "static const char * const valueList[] = {\n";
  761. print C "\"\",\n";
  762. foreach my $name (@names) {
  763. @@ -107,12 +113,38 @@
  764. print C << "EOF";
  765. 0
  766. };
  767. +
  768. +EOF
  769. +
  770. +close C;
  771. +
  772. +my $valueKeywordsImpl = "CSSValueKeywords.cpp";
  773. +
  774. +open VALUEKEYWORDS, ">$valueKeywordsImpl" || die "Could not open $valueKeywordsImpl for writing";
  775. +print VALUEKEYWORDS << "EOF";
  776. +/* This file is automatically generated by make-hash-tools.pl, do not edit */
  777. +
  778. +#include "CSSValueKeywords.h"
  779. +#include "HashTools.h"
  780. +
  781. +namespace WebCore {
  782. +#include "CSSValueKeywordsHash.hpp"
  783. +
  784. +const Value* findValue (register const char* str, register unsigned int len)
  785. +{
  786. + return CSSValueKeywordsHash::findValueImpl(str, len);
  787. +}
  788. +
  789. const char* getValueName(unsigned short id)
  790. {
  791. if (id >= numCSSValueKeywords || id <= 0)
  792. return 0;
  793. return valueList[id];
  794. }
  795. +
  796. +} // namespace WebCore
  797. +
  798. EOF
  799.  
  800. -close C;
  801. +close VALUEKEYWORDS;
  802. +
Add Comment
Please, Sign In to add comment