Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/WebCore/Android.derived.mk b/WebCore/Android.derived.mk
- index c678e60..9ee2eb0 100644
- --- a/WebCore/Android.derived.mk
- +++ b/WebCore/Android.derived.mk
- @@ -55,9 +55,10 @@ LOCAL_GENERATED_SOURCES += $(GEN)
- # DOCTYPE strings
- -GEN := $(intermediates)/html/DocTypeStrings.cpp
- -$(GEN): PRIVATE_CUSTOM_TOOL = gperf -CEot -L ANSI-C -k "*" -N findDoctypeEntry -F ,PubIDInfo::eAlmostStandards,PubIDInfo::eAlmostStandards $< > $@
- +GEN := $(intermediates)/html/DocTypeStringsImpl.cpp
- +$(GEN): PRIVATE_CUSTOM_TOOL = perl $(LOCAL_PATH)/make-hash-tools.pl doctype $(dir $@) $(LOCAL_PATH)/html/DocTypeStrings.gperf
- $(GEN): $(LOCAL_PATH)/html/DocTypeStrings.gperf
- +$(GEN): SCRIPT := $(LOCAL_PATH)/make-hash-tools.pl
- $(transform-generated-source)
- # we have to do this dep by hand:
- $(intermediates)/html/HTMLDocument.o : $(GEN)
- @@ -65,18 +66,20 @@ $(intermediates)/html/HTMLDocument.o : $(GEN)
- # HTML entity names
- -GEN := $(intermediates)/html/HTMLEntityNames.c
- -$(GEN): PRIVATE_CUSTOM_TOOL = gperf -a -L ANSI-C -C -G -c -o -t -k '*' -N findEntity -D -s 2 $< > $@
- +GEN := $(intermediates)/html/HTMLEntityNamesImpl.cpp
- +$(GEN): PRIVATE_CUSTOM_TOOL = perl $(LOCAL_PATH)/make-hash-tools.pl entities $(dir $@) $(LOCAL_PATH)/html/HTMLEntityNames.gperf
- $(GEN): $(LOCAL_PATH)/html/HTMLEntityNames.gperf
- +$(GEN): SCRIPT := $(LOCAL_PATH)/make-hash-tools.pl
- $(transform-generated-source)
- LOCAL_GENERATED_SOURCES += $(GEN)
- # color names
- -GEN := $(intermediates)/platform/ColorData.c
- -$(GEN): PRIVATE_CUSTOM_TOOL = gperf -CDEot -L ANSI-C -k '*' -N findColor -D -s 2 $< > $@
- +GEN := $(intermediates)/platform/ColorDataImpl.cpp
- +$(GEN): PRIVATE_CUSTOM_TOOL = perl $(LOCAL_PATH)/make-hash-tools.pl colordata $(dir $@) $(LOCAL_PATH)/platform/ColorData.gperf
- $(GEN): $(LOCAL_PATH)/platform/ColorData.gperf
- +$(GEN): SCRIPT := $(LOCAL_PATH)/make-hash-tools.pl
- $(transform-generated-source)
- LOCAL_GENERATED_SOURCES += $(GEN)
- diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
- index 370c987..e465dc3 100644
- --- a/WebCore/ChangeLog
- +++ b/WebCore/ChangeLog
- @@ -1,3 +1,50 @@
- +2010-05-11 Andras Becsi <abecsi@inf.u-szeged.hu>
- +
- + Reviewed by NOBODY (OOPS!).
- +
- + Refactor gperf code generation and usage to fix the debug build with gcc>4.4.
- + webkit.org/b/29244
- +
- + Gperf code generation is done by a new script called WebCore/make-hash-tools.pl now,
- + and the generation options were moved into the gperf files, to make the options more understandable
- + and the generation process less redundant across the various ports.
- + Hitherto gperf generated C code, these files were included in multiple C++ files across WebCore
- + to access the functionality provided. This resulted in debug build failure with newer gcc versions
- + because of a new feature of gcc, which disables C style inlining in debug mode.
- + The make-hash-tools.pl script lets gperf generate C++ code for all gperf files now, which are compiled
- + in their own compilation unit.
- + The functionality provided by the generated code is wrapped behind HashTools.h, so there is no need
- + for multiple inclusions of generated C files to access these functions.
- +
- + No new functionality added, no new tests needed.
- +
- + * Android.derived.mk:
- + * DerivedSources.make:
- + * GNUmakefile.am:
- + * WebCore.gyp/scripts/rule_gperf.py:
- + * WebCore.gyp/WebCore.gyp:
- + * WebCore.pri:
- + * WebCore.xcodeproj/project.pbxproj:
- + * css/CSSComputedStyleDeclaration.cpp:
- + * css/CSSMutableStyleDeclaration.cpp:
- + * css/CSSParser.cpp:
- + (WebCore::cssPropertyID):
- + (WebCore::cssValueKeywordID):
- + * css/CSSPrimitiveValue.cpp:
- + * css/CSSProperty.cpp:
- + * css/CSSStyleDeclaration.cpp:
- + * css/makeprop.pl:
- + * css/makevalues.pl:
- + * html/DocTypeStrings.gperf:
- + * html/HTMLDocument.cpp:
- + * html/HTMLEntityNames.gperf:
- + * html/HTMLTokenizer.cpp:
- + * html/PreloadScanner.cpp:
- + * make-hash-tools.pl: Added.
- + * page/animation/ImplicitAnimation.cpp:
- + * platform/ColorData.gperf:
- + * platform/graphics/Color.cpp:
- +
- 2010-05-11 Benjamin Poulain <benjamin.poulain@nokia.com>
- Reviewed by Kenneth Rohde Christiansen.
- diff --git a/WebCore/DerivedSources.make b/WebCore/DerivedSources.make
- index c267a6e..839e328 100644
- --- a/WebCore/DerivedSources.make
- +++ b/WebCore/DerivedSources.make
- @@ -462,10 +462,10 @@ all : \
- CSSGrammar.cpp \
- CSSPropertyNames.h \
- CSSValueKeywords.h \
- - ColorData.c \
- - DocTypeStrings.cpp \
- + ColorDataImpl.cpp \
- + DocTypeStringsImpl.cpp \
- HTMLElementFactory.cpp \
- - HTMLEntityNames.c \
- + HTMLEntityNamesImpl.cpp \
- HTMLNames.cpp \
- WMLElementFactory.cpp \
- WMLNames.cpp \
- @@ -553,22 +553,22 @@ CSSValueKeywords.h : $(WEBCORE_CSS_VALUE_KEYWORDS) css/makevalues.pl
- # DOCTYPE strings
- -DocTypeStrings.cpp : html/DocTypeStrings.gperf
- - gperf -CEot -L ANSI-C -k "*" -N findDoctypeEntry -F ,PubIDInfo::eAlmostStandards,PubIDInfo::eAlmostStandards $< > $@
- +DocTypeStringsImpl.cpp : html/DocTypeStrings.gperf $(WebCore)/make-hash-tools.pl
- + perl $(WebCore)/make-hash-tools.pl doctype . $(WebCore)/html/DocTypeStrings.gperf
- # --------
- # HTML entity names
- -HTMLEntityNames.c : html/HTMLEntityNames.gperf
- - gperf -a -L ANSI-C -C -G -c -o -t -k '*' -N findEntity -D -s 2 $< > $@
- +HTMLEntityNamesImpl.cpp : html/HTMLEntityNames.gperf $(WebCore)/make-hash-tools.pl
- + perl $(WebCore)/make-hash-tools.pl entities . $(WebCore)/html/HTMLEntityNames.gperf
- # --------
- # color names
- -ColorData.c : platform/ColorData.gperf
- - gperf -CDEot -L ANSI-C -k '*' -N findColor -D -s 2 $< > $@
- +ColorDataImpl.cpp : platform/ColorData.gperf $(WebCore)/make-hash-tools.pl
- + perl $(WebCore)/make-hash-tools.pl colordata . $(WebCore)/platform/ColorData.gperf
- # --------
- diff --git a/WebCore/GNUmakefile.am b/WebCore/GNUmakefile.am
- index 4882e82..63d06c2 100644
- --- a/WebCore/GNUmakefile.am
- +++ b/WebCore/GNUmakefile.am
- @@ -79,9 +79,9 @@ webcoregtk_cppflags += \
- -I$(srcdir)/WebCore/platform/network/soup
- webcore_built_nosources += \
- - DerivedSources/DocTypeStrings.cpp \
- + DerivedSources/DocTypeStringsImpl.cpp \
- DerivedSources/tokenizer.cpp \
- - DerivedSources/ColorData.c \
- + DerivedSources/ColorDataImpl.cpp \
- DerivedSources/webkit/webkitdomdummy.c
- webcore_built_sources += \
- @@ -90,7 +90,7 @@ webcore_built_sources += \
- DerivedSources/CSSPropertyNames.h \
- DerivedSources/CSSValueKeywords.h \
- DerivedSources/HTMLElementFactory.cpp \
- - DerivedSources/HTMLEntityNames.c \
- + DerivedSources/HTMLEntityNamesImpl.cpp \
- DerivedSources/HTMLNames.cpp \
- DerivedSources/JSHTMLElementWrapperFactory.cpp \
- DerivedSources/UserAgentStyleSheets.h \
- @@ -3677,27 +3677,30 @@ DerivedSources/CSSPropertyNames.h: $(WEBCORE_CSS_PROPERTY_NAMES) $(WebCore)/css/
- if sort $(WEBCORE_CSS_PROPERTY_NAMES) | uniq -d | grep -E '^[^#]'; then echo 'Duplicate value!'; exit 1; fi
- cat $(WEBCORE_CSS_PROPERTY_NAMES) > CSSPropertyNames.in
- $(PERL) "$(WebCore)/css/makeprop.pl"
- - mv CSSPropertyNames.* $(GENSOURCES)
- + mv CSSPropertyNames.h $(GENSOURCES)
- + mv CSSPropertyNamesImpl.cpp $(GENSOURCES)
- + mv CSSPropertyNamesHash.hpp $(GENSOURCES)
- # Lower case all the values, as CSS values are case-insensitive
- DerivedSources/CSSValueKeywords.h : $(WEBCORE_CSS_VALUE_KEYWORDS) $(WebCore)/css/makevalues.pl
- $(PERL) -ne 'print lc' $(WEBCORE_CSS_VALUE_KEYWORDS) > CSSValueKeywords.in
- if sort CSSValueKeywords.in | uniq -d | grep -E '^[^#]'; then echo 'Duplicate value!'; exit 1; fi
- $(PERL) "$(WebCore)/css/makevalues.pl"
- - mv CSSValueKeywords.* $(GENSOURCES)
- + mv CSSValueKeywords.h $(GENSOURCES)
- + mv CSSValueKeywordsImpl.cpp $(GENSOURCES)
- + mv CSSValueKeywordsHash.hpp $(GENSOURCES)
- # DOCTYPE strings
- -DerivedSources/DocTypeStrings.cpp : $(WebCore)/html/DocTypeStrings.gperf
- - $(AM_V_GEN)$(GPERF) -CEot -I -L ANSI-C -k "*" -N findDoctypeEntry -F ,PubIDInfo::eAlmostStandards,PubIDInfo::eAlmostStandards $(WebCore)/html/DocTypeStrings.gperf > $@
- +DerivedSources/DocTypeStringsImpl.cpp : $(WebCore)/html/DocTypeStrings.gperf $(WebCore)/make-hash-tools.pl
- + $(PERL) $(WebCore)/make-hash-tools.pl doctype $(GENSOURCES) $(WebCore)/html/DocTypeStrings.gperf
- # HTML entity names
- -DerivedSources/HTMLEntityNames.c : $(WebCore)/html/HTMLEntityNames.gperf
- - $(AM_V_GEN)$(GPERF) -a -I -L ANSI-C -C -G -c -o -t -k '*' -N findEntity -D -s 2 \
- - $(WebCore)/html/HTMLEntityNames.gperf > $@
- +DerivedSources/HTMLEntityNamesImpl.cpp : $(WebCore)/html/HTMLEntityNames.gperf $(WebCore)/make-hash-tools.pl
- + $(PERL) $(WebCore)/make-hash-tools.pl entities $(GENSOURCES) $(WebCore)/html/HTMLEntityNames.gperf
- # color names
- -DerivedSources/ColorData.c: $(WebCore)/platform/ColorData.gperf
- - $(AM_V_GEN)$(GPERF) -CDEot -L ANSI-C -k '*' -N findColor -D -s 2 $< > $@
- +DerivedSources/ColorDataImpl.cpp: $(WebCore)/platform/ColorData.gperf $(WebCore)/make-hash-tools.pl
- + $(PERL) $(WebCore)/make-hash-tools.pl colordata $(GENSOURCES) $(WebCore)/platform/ColorData.gperf
- # CSS tokenizer
- DerivedSources/tokenizer.cpp : $(WebCore)/css/tokenizer.flex $(WebCore)/css/maketokenizer
- diff --git a/WebCore/WebCore.gyp/WebCore.gyp b/WebCore/WebCore.gyp/WebCore.gyp
- index adf6d94..b577f72 100644
- --- a/WebCore/WebCore.gyp/WebCore.gyp
- +++ b/WebCore/WebCore.gyp/WebCore.gyp
- @@ -288,7 +288,8 @@
- '../css/CSSPropertyNames.in',
- ],
- 'outputs': [
- - '<(SHARED_INTERMEDIATE_DIR)/webkit/CSSPropertyNames.cpp',
- + '<(SHARED_INTERMEDIATE_DIR)/webkit/CSSPropertyNames.hpp',
- + '<(SHARED_INTERMEDIATE_DIR)/webkit/CSSPropertyNamesImpl.cpp',
- '<(SHARED_INTERMEDIATE_DIR)/webkit/CSSPropertyNames.h',
- ],
- 'action': [
- @@ -313,7 +314,8 @@
- '../css/CSSValueKeywords.in',
- ],
- 'outputs': [
- - '<(SHARED_INTERMEDIATE_DIR)/webkit/CSSValueKeywords.c',
- + '<(SHARED_INTERMEDIATE_DIR)/webkit/CSSValueKeywords.hpp',
- + '<(SHARED_INTERMEDIATE_DIR)/webkit/CSSValueKeywordsImpl.cpp',
- '<(SHARED_INTERMEDIATE_DIR)/webkit/CSSValueKeywords.h',
- ],
- 'action': [
- @@ -530,18 +532,11 @@
- {
- 'rule_name': 'gperf',
- 'extension': 'gperf',
- - # gperf output is only ever #included by other source files. As
- - # such, process_outputs_as_sources is off. Some gperf output is
- - # #included as *.c and some as *.cpp. Since there's no way to tell
- - # which one will be needed in a rule definition, declare both as
- - # outputs. The harness script will generate one file and copy it to
- - # the other.
- #
- - # This rule places outputs in SHARED_INTERMEDIATE_DIR because glue
- - # needs access to HTMLEntityNames.c.
- + # gperf outputs are generated by WebCore/make-hash-tools.pl
- + #
- 'outputs': [
- - '<(SHARED_INTERMEDIATE_DIR)/webkit/<(RULE_INPUT_ROOT).c',
- - '<(SHARED_INTERMEDIATE_DIR)/webkit/<(RULE_INPUT_ROOT).cpp',
- + '<(SHARED_INTERMEDIATE_DIR)/webkit/<(RULE_INPUT_ROOT)Impl.cpp',
- ],
- 'action': [
- 'python',
- @@ -549,7 +544,6 @@
- '<(RULE_INPUT_PATH)',
- '<(SHARED_INTERMEDIATE_DIR)/webkit'
- ],
- - 'process_outputs_as_sources': 0,
- },
- # Rule to build generated JavaScript (V8) bindings from .idl source.
- {
- diff --git a/WebCore/WebCore.gyp/scripts/action_csspropertynames.py b/WebCore/WebCore.gyp/scripts/action_csspropertynames.py
- index 60314d7..0196ae3 100644
- --- a/WebCore/WebCore.gyp/scripts/action_csspropertynames.py
- +++ b/WebCore/WebCore.gyp/scripts/action_csspropertynames.py
- @@ -33,8 +33,8 @@
- #
- # usage: action_makenames.py OUTPUTS -- INPUTS
- #
- -# Exactly two outputs must be specified: a path to each of CSSPropertyNames.cpp
- -# and CSSPropertyNames.h.
- +# Exactly three outputs must be specified: a path to each of CSSPropertyNamesImpl.cpp,
- +# CSSPropertyNames.hpp and CSSPropertyNames.h.
- #
- # Multiple inputs may be specified. One input must have a basename of
- # makeprop.pl; this is taken as the path to makeprop.pl. All other inputs are
- diff --git a/WebCore/WebCore.gyp/scripts/action_cssvaluekeywords.py b/WebCore/WebCore.gyp/scripts/action_cssvaluekeywords.py
- index ebf895b..398d74b 100644
- --- a/WebCore/WebCore.gyp/scripts/action_cssvaluekeywords.py
- +++ b/WebCore/WebCore.gyp/scripts/action_cssvaluekeywords.py
- @@ -37,8 +37,8 @@
- #
- # usage: action_cssvaluekeywords.py OUTPUTS -- INPUTS
- #
- -# Exactly two outputs must be specified: a path to each of CSSValueKeywords.c
- -# and CSSValueKeywords.h.
- +# Exactly three outputs must be specified: a path to each of CSSValueKeywordsImpl.cpp,
- +# CSSValueKeywords.hpp, and CSSValueKeywords.h.
- #
- # Multiple inputs may be specified. One input must have a basename of
- # makevalues.pl; this is taken as the path to makevalues.pl. All other inputs
- diff --git a/WebCore/WebCore.gyp/scripts/rule_gperf.py b/WebCore/WebCore.gyp/scripts/rule_gperf.py
- index e76ed6f..ceeeab3 100644
- --- a/WebCore/WebCore.gyp/scripts/rule_gperf.py
- +++ b/WebCore/WebCore.gyp/scripts/rule_gperf.py
- @@ -40,7 +40,6 @@
- # to .c when done.
- import posixpath
- -import shutil
- import subprocess
- import sys
- @@ -50,36 +49,23 @@ inputFile = sys.argv[1]
- outputDir = sys.argv[2]
- gperfCommands = {
- - 'DocTypeStrings.gperf': [
- - '-CEot', '-L', 'ANSI-C', '-k*', '-N', 'findDoctypeEntry',
- - '-F', ',PubIDInfo::eAlmostStandards,PubIDInfo::eAlmostStandards'
- - ],
- - 'HTMLEntityNames.gperf': [
- - '-a', '-L', 'ANSI-C', '-C', '-G', '-c', '-o', '-t', '-k*',
- - '-N', 'findEntity', '-D', '-s', '2'
- - ],
- - 'ColorData.gperf': [
- - '-CDEot', '-L', 'ANSI-C', '-k*', '-N', 'findColor', '-D', '-s', '2'
- - ],
- + 'DocTypeStrings.gperf': doctype,
- + 'HTMLEntityNames.gperf': entities,
- + 'ColorData.gperf': colordata,
- }
- inputName = posixpath.basename(inputFile)
- assert inputName in gperfCommands
- (inputRoot, inputExt) = posixpath.splitext(inputName)
- -outputCpp = posixpath.join(outputDir, inputRoot + '.cpp')
- -#command = ['gperf', '--output-file', outputCpp]
- -command = ['gperf']
- -command.extend(gperfCommands[inputName])
- +command = ['perl']
- +command.append(gperfCommands[inputName])
- +command.append(outputDir)
- command.append(inputFile)
- -ofile = open(outputCpp, 'w')
- -
- # Do it. check_call is new in 2.5, so simulate its behavior with call and
- # assert.
- -returnCode = subprocess.call(command, stdout=ofile.fileno())
- +returnCode = subprocess.call(command)
- assert returnCode == 0
- -outputC = posixpath.join(outputDir, inputRoot + '.c')
- -shutil.copyfile(outputCpp, outputC)
- diff --git a/WebCore/WebCore.pri b/WebCore/WebCore.pri
- index ee69994..8f4a3d4 100644
- --- a/WebCore/WebCore.pri
- +++ b/WebCore/WebCore.pri
- @@ -177,7 +177,7 @@ XLINK_NAMES = $$PWD/svg/xlinkattrs.in
- TOKENIZER = $$PWD/css/tokenizer.flex
- -DOCTYPESTRINGS = $$PWD/html/DocTypeStrings.gperf
- +DOCTYPESTRINGS_GPERF = $$PWD/html/DocTypeStrings.gperf
- CSSBISON = $$PWD/css/CSSGrammar.y
- @@ -189,7 +189,7 @@ XMLNS_NAMES = $$PWD/xml/xmlnsattrs.in
- ENTITIES_GPERF = $$PWD/html/HTMLEntityNames.gperf
- -COLORDAT_GPERF = $$PWD/platform/ColorData.gperf
- +COLORDATA_GPERF = $$PWD/platform/ColorData.gperf
- WALDOCSSPROPS = $$PWD/css/CSSPropertyNames.in
- @@ -646,17 +646,17 @@ xlinknames.input = XLINK_NAMES
- addExtraCompiler(xlinknames)
- # GENERATOR 6-A:
- -cssprops.output = $${WC_GENERATED_SOURCES_DIR}/${QMAKE_FILE_BASE}.cpp
- -cssprops.input = WALDOCSSPROPS
- cssprops.wkScript = $$PWD/css/makeprop.pl
- +cssprops.output = $${WC_GENERATED_SOURCES_DIR}/CSSPropertyNamesImpl.cpp
- +cssprops.input = WALDOCSSPROPS
- 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
- cssprops.depends = ${QMAKE_FILE_NAME} $${DASHBOARDSUPPORTCSSPROPERTIES} $${EXTRACSSPROPERTIES}
- addExtraCompiler(cssprops)
- # GENERATOR 6-B:
- -cssvalues.output = $${WC_GENERATED_SOURCES_DIR}/${QMAKE_FILE_BASE}.c
- -cssvalues.input = WALDOCSSVALUES
- cssvalues.wkScript = $$PWD/css/makevalues.pl
- +cssvalues.output = $${WC_GENERATED_SOURCES_DIR}/CSSValueKeywordsImpl.cpp
- +cssvalues.input = WALDOCSSVALUES
- 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
- cssvalues.depends = ${QMAKE_FILE_NAME} $${EXTRACSSVALUES}
- cssvalues.clean = ${QMAKE_FILE_OUT} ${QMAKE_VAR_WC_GENERATED_SOURCES_DIR}/${QMAKE_FILE_BASE}.h
- @@ -712,24 +712,28 @@ xmlnames.wkScript = $$PWD/dom/make_names.pl
- xmlnames.commands = perl -I$$PWD/bindings/scripts $$xmlnames.wkScript --attrs $$PWD/xml/xmlattrs.in --preprocessor \"$${QMAKE_MOC} -E\" --outputDir $$WC_GENERATED_SOURCES_DIR
- addExtraCompiler(xmlnames)
- -# GENERATOR 8-A:
- -entities.output = $${WC_GENERATED_SOURCES_DIR}/HTMLEntityNames.c
- +# GENERATOR 8-entities:
- +entities.wkScript = $$PWD/make-hash-tools.pl
- +entities.output = $${WC_GENERATED_SOURCES_DIR}/HTMLEntityNamesImpl.cpp
- entities.input = ENTITIES_GPERF
- -entities.commands = gperf -a -L ANSI-C -C -G -c -o -t --includes --key-positions="*" -N findEntity -D -s 2 < $$PWD/html/HTMLEntityNames.gperf > $${WC_GENERATED_SOURCES_DIR}/HTMLEntityNames.c
- +entities.commands = perl $$entities.wkScript entities $${WC_GENERATED_SOURCES_DIR} $$ENTITIES_GPERF
- entities.clean = ${QMAKE_FILE_OUT}
- addExtraCompiler(entities)
- -# GENERATOR 8-B:
- -doctypestrings.output = $${WC_GENERATED_SOURCES_DIR}/${QMAKE_FILE_BASE}.cpp
- -doctypestrings.input = DOCTYPESTRINGS
- -doctypestrings.commands = gperf -CEot -L ANSI-C --includes --key-positions="*" -N findDoctypeEntry -F ,PubIDInfo::eAlmostStandards,PubIDInfo::eAlmostStandards < ${QMAKE_FILE_NAME} >> ${QMAKE_FILE_OUT}
- -doctypestrings.clean = ${QMAKE_FILE_OUT}
- -addExtraCompiler(doctypestrings)
- -
- -# GENERATOR 8-C:
- -colordata.output = $${WC_GENERATED_SOURCES_DIR}/ColorData.c
- -colordata.input = COLORDAT_GPERF
- -colordata.commands = gperf -CDEot -L ANSI-C --includes --key-positions="*" -N findColor -D -s 2 < ${QMAKE_FILE_NAME} >> ${QMAKE_FILE_OUT}
- +# GENERATOR 8-doctype:
- +doctype.wkScript = $$PWD/make-hash-tools.pl
- +doctype.output = $${WC_GENERATED_SOURCES_DIR}/DocTypeStringsImpl.cpp
- +doctype.input = DOCTYPESTRINGS_GPERF
- +doctype.commands = perl $$doctype.wkScript doctype $${WC_GENERATED_SOURCES_DIR} $$DOCTYPESTRINGS_GPERF
- +doctype.clean = ${QMAKE_FILE_OUT}
- +addExtraCompiler(doctype)
- +
- +# GENERATOR 8-colordata:
- +colordata.wkScript = $$PWD/make-hash-tools.pl
- +colordata.output = $${WC_GENERATED_SOURCES_DIR}/ColorDataImpl.cpp
- +colordata.input = COLORDATA_GPERF
- +colordata.commands = perl $$colordata.wkScript colordata $${WC_GENERATED_SOURCES_DIR} $$COLORDATA_GPERF
- +colordata.clean = ${QMAKE_FILE_OUT}
- addExtraCompiler(colordata)
- # GENERATOR 9:
- diff --git a/WebCore/WebCore.xcodeproj/project.pbxproj b/WebCore/WebCore.xcodeproj/project.pbxproj
- index a8f1b3b..3a5360e 100644
- --- a/WebCore/WebCore.xcodeproj/project.pbxproj
- +++ b/WebCore/WebCore.xcodeproj/project.pbxproj
- @@ -4903,8 +4903,13 @@
- E1F1E8300C3C2BB9006DB391 /* XSLTExtensions.h in Headers */ = {isa = PBXBuildFile; fileRef = E1F1E82E0C3C2BB9006DB391 /* XSLTExtensions.h */; };
- E1FF57A30F01255B00891EBB /* ThreadGlobalData.h in Headers */ = {isa = PBXBuildFile; fileRef = E1FF57A20F01255B00891EBB /* ThreadGlobalData.h */; settings = {ATTRIBUTES = (Private, ); }; };
- E1FF57A60F01256B00891EBB /* ThreadGlobalData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E1FF57A50F01256B00891EBB /* ThreadGlobalData.cpp */; };
- + E406F3FC1198313C009D59D6 /* ColorDataImpl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E406F3FB1198307D009D59D6 /* ColorDataImpl.cpp */; };
- + E406F3FD1198313F009D59D6 /* DocTypeStringsImpl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E406F3FA1198304D009D59D6 /* DocTypeStringsImpl.cpp */; };
- + E406F403119832A5009D59D6 /* HTMLEntityNamesImpl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E406F4021198329A009D59D6 /* HTMLEntityNamesImpl.cpp */; };
- E415F1690D9A165D0033CE97 /* DOMElementTimeControl.h in Headers */ = {isa = PBXBuildFile; fileRef = E415F1680D9A165D0033CE97 /* DOMElementTimeControl.h */; };
- E415F1840D9A1A830033CE97 /* ElementTimeControl.h in Headers */ = {isa = PBXBuildFile; fileRef = E415F1830D9A1A830033CE97 /* ElementTimeControl.h */; };
- + E41EA03A1198377300710BC5 /* CSSPropertyNamesImpl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E41EA038119836DB00710BC5 /* CSSPropertyNamesImpl.cpp */; };
- + E41EA03B1198377900710BC5 /* CSSValueKeywordsImpl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E41EA0391198374900710BC5 /* CSSValueKeywordsImpl.cpp */; };
- E44613A10CD6331000FADA75 /* HTMLAudioElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E446138F0CD6331000FADA75 /* HTMLAudioElement.cpp */; };
- E44613A20CD6331000FADA75 /* HTMLAudioElement.h in Headers */ = {isa = PBXBuildFile; fileRef = E44613900CD6331000FADA75 /* HTMLAudioElement.h */; };
- E44613A40CD6331000FADA75 /* HTMLMediaElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E44613920CD6331000FADA75 /* HTMLMediaElement.cpp */; };
- @@ -6784,18 +6789,13 @@
- 65653F2A0D9727D200CA9723 /* SVGAltGlyphElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGAltGlyphElement.cpp; sourceTree = "<group>"; };
- 65653F2B0D9727D200CA9723 /* SVGAltGlyphElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGAltGlyphElement.h; sourceTree = "<group>"; };
- 65653F2C0D9727D200CA9723 /* SVGAltGlyphElement.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = SVGAltGlyphElement.idl; sourceTree = "<group>"; };
- - 656580ED09D12B20000E61D7 /* CSSPropertyNames.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = CSSPropertyNames.cpp; sourceTree = "<group>"; };
- 656580EE09D12B20000E61D7 /* CSSPropertyNames.gperf */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = CSSPropertyNames.gperf; sourceTree = "<group>"; };
- 656580EF09D12B20000E61D7 /* CSSPropertyNames.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = CSSPropertyNames.h; sourceTree = "<group>"; };
- - 6565811C09D12DB2000E61D7 /* DocTypeStrings.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = DocTypeStrings.cpp; sourceTree = "<group>"; };
- 6565814409D13043000E61D7 /* CSSGrammar.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = CSSGrammar.cpp; sourceTree = "<group>"; };
- - 6565814609D13043000E61D7 /* CSSValueKeywords.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = CSSValueKeywords.c; sourceTree = "<group>"; };
- 6565814709D13043000E61D7 /* CSSValueKeywords.gperf */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = CSSValueKeywords.gperf; sourceTree = "<group>"; };
- 6565814809D13043000E61D7 /* CSSValueKeywords.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = CSSValueKeywords.h; sourceTree = "<group>"; };
- - 6565814B09D13043000E61D7 /* HTMLEntityNames.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = HTMLEntityNames.c; sourceTree = "<group>"; };
- 6565814C09D13043000E61D7 /* tokenizer.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = tokenizer.cpp; sourceTree = "<group>"; };
- 656581AC09D14EE6000E61D7 /* CharsetData.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = CharsetData.cpp; sourceTree = "<group>"; };
- - 656581AD09D14EE6000E61D7 /* ColorData.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = ColorData.c; sourceTree = "<group>"; };
- 656581AE09D14EE6000E61D7 /* UserAgentStyleSheets.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = UserAgentStyleSheets.h; sourceTree = "<group>"; };
- 656581AF09D14EE6000E61D7 /* UserAgentStyleSheetsData.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = UserAgentStyleSheetsData.cpp; sourceTree = "<group>"; };
- 656581E609D1508D000E61D7 /* SVGElementFactory.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = SVGElementFactory.cpp; sourceTree = "<group>"; };
- @@ -10365,9 +10365,14 @@
- E1F1E82E0C3C2BB9006DB391 /* XSLTExtensions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XSLTExtensions.h; sourceTree = "<group>"; };
- E1FF57A20F01255B00891EBB /* ThreadGlobalData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ThreadGlobalData.h; sourceTree = "<group>"; };
- E1FF57A50F01256B00891EBB /* ThreadGlobalData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ThreadGlobalData.cpp; sourceTree = "<group>"; };
- + E406F3FA1198304D009D59D6 /* DocTypeStringsImpl.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DocTypeStringsImpl.cpp; path = ../WebKitBuild/Release/DerivedSources/WebCore/DocTypeStringsImpl.cpp; sourceTree = SOURCE_ROOT; };
- + E406F3FB1198307D009D59D6 /* ColorDataImpl.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ColorDataImpl.cpp; path = ../WebKitBuild/Release/DerivedSources/WebCore/ColorDataImpl.cpp; sourceTree = SOURCE_ROOT; };
- + E406F4021198329A009D59D6 /* HTMLEntityNamesImpl.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = HTMLEntityNamesImpl.cpp; path = ../WebKitBuild/Release/DerivedSources/WebCore/HTMLEntityNamesImpl.cpp; sourceTree = SOURCE_ROOT; };
- E415F10C0D9A05870033CE97 /* ElementTimeControl.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = ElementTimeControl.idl; sourceTree = "<group>"; };
- E415F1680D9A165D0033CE97 /* DOMElementTimeControl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DOMElementTimeControl.h; sourceTree = "<group>"; };
- E415F1830D9A1A830033CE97 /* ElementTimeControl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ElementTimeControl.h; sourceTree = "<group>"; };
- + E41EA038119836DB00710BC5 /* CSSPropertyNamesImpl.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CSSPropertyNamesImpl.cpp; path = ../WebKitBuild/Release/DerivedSources/WebCore/CSSPropertyNamesImpl.cpp; sourceTree = SOURCE_ROOT; };
- + E41EA0391198374900710BC5 /* CSSValueKeywordsImpl.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CSSValueKeywordsImpl.cpp; path = ../WebKitBuild/Release/DerivedSources/WebCore/CSSValueKeywordsImpl.cpp; sourceTree = SOURCE_ROOT; };
- E446138F0CD6331000FADA75 /* HTMLAudioElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HTMLAudioElement.cpp; sourceTree = "<group>"; };
- E44613900CD6331000FADA75 /* HTMLAudioElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HTMLAudioElement.h; sourceTree = "<group>"; };
- E44613910CD6331000FADA75 /* HTMLAudioElement.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = HTMLAudioElement.idl; sourceTree = "<group>"; };
- @@ -11634,20 +11639,20 @@
- 656580EC09D12B20000E61D7 /* Derived Sources */ = {
- isa = PBXGroup;
- children = (
- + E41EA0391198374900710BC5 /* CSSValueKeywordsImpl.cpp */,
- + E41EA038119836DB00710BC5 /* CSSPropertyNamesImpl.cpp */,
- + E406F4021198329A009D59D6 /* HTMLEntityNamesImpl.cpp */,
- + E406F3FB1198307D009D59D6 /* ColorDataImpl.cpp */,
- + E406F3FA1198304D009D59D6 /* DocTypeStringsImpl.cpp */,
- 656581AC09D14EE6000E61D7 /* CharsetData.cpp */,
- - 656581AD09D14EE6000E61D7 /* ColorData.c */,
- 6565814409D13043000E61D7 /* CSSGrammar.cpp */,
- 650F53DB09D15DDA00C9B0C8 /* CSSGrammar.h */,
- - 656580ED09D12B20000E61D7 /* CSSPropertyNames.cpp */,
- 656580EE09D12B20000E61D7 /* CSSPropertyNames.gperf */,
- 656580EF09D12B20000E61D7 /* CSSPropertyNames.h */,
- - 6565814609D13043000E61D7 /* CSSValueKeywords.c */,
- 6565814709D13043000E61D7 /* CSSValueKeywords.gperf */,
- 6565814809D13043000E61D7 /* CSSValueKeywords.h */,
- - 6565811C09D12DB2000E61D7 /* DocTypeStrings.cpp */,
- A17C81200F2A5CF7005DAAEB /* HTMLElementFactory.cpp */,
- A17C81210F2A5CF7005DAAEB /* HTMLElementFactory.h */,
- - 6565814B09D13043000E61D7 /* HTMLEntityNames.c */,
- A8D06B380A265DCD005E7203 /* HTMLNames.cpp */,
- A8D06B370A265DCD005E7203 /* HTMLNames.h */,
- 938E65F609F0985D008A48EC /* JSHTMLElementWrapperFactory.cpp */,
- @@ -21405,6 +21410,11 @@
- C5F4F40C119306AC00FDFADD /* JSIDBRequest.cpp in Sources */,
- C5F4F410119306C000FDFADD /* JSIndexedDatabaseRequest.cpp in Sources */,
- C5956678119324C600FDCE47 /* JSIDBRequestCustom.cpp in Sources */,
- + E406F3FC1198313C009D59D6 /* ColorDataImpl.cpp in Sources */,
- + E406F3FD1198313F009D59D6 /* DocTypeStringsImpl.cpp in Sources */,
- + E406F403119832A5009D59D6 /* HTMLEntityNamesImpl.cpp in Sources */,
- + E41EA03A1198377300710BC5 /* CSSPropertyNamesImpl.cpp in Sources */,
- + E41EA03B1198377900710BC5 /* CSSValueKeywordsImpl.cpp in Sources */,
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
- diff --git a/WebCore/css/CSSComputedStyleDeclaration.cpp b/WebCore/css/CSSComputedStyleDeclaration.cpp
- index ba503b8..b72ece6 100644
- --- a/WebCore/css/CSSComputedStyleDeclaration.cpp
- +++ b/WebCore/css/CSSComputedStyleDeclaration.cpp
- @@ -36,6 +36,7 @@
- #include "CSSValueList.h"
- #include "Document.h"
- #include "ExceptionCode.h"
- +#include "HashTools.h"
- #include "Rect.h"
- #include "RenderBox.h"
- #include "RenderLayer.h"
- diff --git a/WebCore/css/CSSMutableStyleDeclaration.cpp b/WebCore/css/CSSMutableStyleDeclaration.cpp
- index 7c09f91..738cf7b 100644
- --- a/WebCore/css/CSSMutableStyleDeclaration.cpp
- +++ b/WebCore/css/CSSMutableStyleDeclaration.cpp
- @@ -31,6 +31,7 @@
- #include "CSSValueList.h"
- #include "Document.h"
- #include "ExceptionCode.h"
- +#include "HashTools.h"
- #include "StyledElement.h"
- using namespace std;
- diff --git a/WebCore/css/CSSParser.cpp b/WebCore/css/CSSParser.cpp
- index 6f7cf12..3296370 100644
- --- a/WebCore/css/CSSParser.cpp
- +++ b/WebCore/css/CSSParser.cpp
- @@ -61,6 +61,7 @@
- #include "FloatConversion.h"
- #include "FontFamilyValue.h"
- #include "FontValue.h"
- +#include "HashTools.h"
- #include "MediaList.h"
- #include "MediaQueryExp.h"
- #include "Pair.h"
- @@ -88,9 +89,6 @@ extern int cssyyparse(void* parser);
- using namespace std;
- using namespace WTF;
- -#include "CSSPropertyNames.cpp"
- -#include "CSSValueKeywords.c"
- -
- namespace WebCore {
- static const unsigned INVALID_NUM_PARSED_PROPERTIES = UINT_MAX;
- @@ -5526,7 +5524,7 @@ static int cssPropertyID(const UChar* propertyName, unsigned length)
- }
- }
- - const props* hashTableEntry = findProp(name, length);
- + const Property* hashTableEntry = findProperty(name, length);
- return hashTableEntry ? hashTableEntry->id : 0;
- }
- @@ -5568,7 +5566,7 @@ int cssValueKeywordID(const CSSParserString& string)
- }
- }
- - const css_value* hashTableEntry = findValue(buffer, length);
- + const Value* hashTableEntry = findValue(buffer, length);
- return hashTableEntry ? hashTableEntry->id : 0;
- }
- diff --git a/WebCore/css/CSSPrimitiveValue.cpp b/WebCore/css/CSSPrimitiveValue.cpp
- index 210d6f5..337f0c5 100644
- --- a/WebCore/css/CSSPrimitiveValue.cpp
- +++ b/WebCore/css/CSSPrimitiveValue.cpp
- @@ -29,6 +29,7 @@
- #include "Color.h"
- #include "Counter.h"
- #include "ExceptionCode.h"
- +#include "HashTools.h"
- #include "Node.h"
- #include "Pair.h"
- #include "RGBColor.h"
- diff --git a/WebCore/css/CSSProperty.cpp b/WebCore/css/CSSProperty.cpp
- index d7f2175..9c8a51a 100644
- --- a/WebCore/css/CSSProperty.cpp
- +++ b/WebCore/css/CSSProperty.cpp
- @@ -22,6 +22,7 @@
- #include "CSSProperty.h"
- #include "CSSPropertyNames.h"
- +#include "HashTools.h"
- #include "PlatformString.h"
- namespace WebCore {
- diff --git a/WebCore/css/CSSStyleDeclaration.cpp b/WebCore/css/CSSStyleDeclaration.cpp
- index 404a978..e45d2ff 100644
- --- a/WebCore/css/CSSStyleDeclaration.cpp
- +++ b/WebCore/css/CSSStyleDeclaration.cpp
- @@ -26,6 +26,7 @@
- #include "CSSProperty.h"
- #include "CSSPropertyNames.h"
- #include "CSSRule.h"
- +#include "HashTools.h"
- #include <wtf/ASCIICType.h>
- using namespace WTF;
- diff --git a/WebCore/css/makeprop.pl b/WebCore/css/makeprop.pl
- index 115969f..ef6a277 100644
- --- a/WebCore/css/makeprop.pl
- +++ b/WebCore/css/makeprop.pl
- @@ -5,6 +5,7 @@
- # Copyright (C) 1999 Waldo Bastian (bastian@kde.org)
- # Copyright (C) 2007, 2008 Apple Inc. All rights reserved.
- # Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
- +# Copyright (C) 2010 Andras Becsi (abecsi@inf.u-szeged.hu), University of Szeged
- #
- # This library is free software; you can redistribute it and/or
- # modify it under the terms of the GNU Library General Public
- @@ -37,12 +38,19 @@ open GPERF, ">CSSPropertyNames.gperf" || die "Could not open CSSPropertyNames.gp
- print GPERF << "EOF";
- %{
- /* This file is automatically generated from CSSPropertyNames.in by makeprop, do not edit */
- -#include \"CSSPropertyNames.h\"
- %}
- -struct props {
- - const char* name;
- - int id;
- -};
- +%struct-type
- +struct Property;
- +%omit-struct-type
- +%language=C++
- +%readonly-tables
- +%global-table
- +%compare-strncmp
- +%define class-name CSSPropertyNamesHash
- +%define lookup-function-name findPropertyImpl
- +%define hash-function-name propery_hash_function
- +%includes
- +%enum
- %%
- EOF
- @@ -57,6 +65,7 @@ close GPERF;
- open HEADER, ">CSSPropertyNames.h" || die "Could not open CSSPropertyNames.h for writing";
- print HEADER << "EOF";
- /* This file is automatically generated from CSSPropertyNames.in by makeprop, do not edit */
- +#include "wtf/text/CString.h"
- #ifndef CSSPropertyNames_h
- #define CSSPropertyNames_h
- @@ -86,16 +95,14 @@ print HEADER "const size_t maxCSSPropertyNameLength = $maxLen;\n";
- print HEADER << "EOF";
- -const char* getPropertyName(CSSPropertyID);
- -
- -#endif
- +#endif // CSSPropertyNames_h
- EOF
- close HEADER;
- -system("gperf -a -L ANSI-C -E -C -c -o -t --key-positions=\"*\" -NfindProp -Hhash_prop -Wwordlist_prop -D -s 2 CSSPropertyNames.gperf > CSSPropertyNames.cpp") == 0 || die "calling gperf failed: $?";
- +system("gperf --key-positions=\"*\" -D -s 2 CSSPropertyNames.gperf > CSSPropertyNamesHash.hpp") == 0 || die "calling gperf failed: $?";
- -open C, ">>CSSPropertyNames.cpp" || die "Could not open CSSPropertyNames.cpp for writing";
- +open C, ">>CSSPropertyNamesHash.hpp" || die "Could not open CSSPropertyNamesHash.hpp for writing";
- print C "static const char * const propertyNameStrings[$num] = {\n";
- foreach my $name (@names) {
- @@ -104,6 +111,28 @@ foreach my $name (@names) {
- print C << "EOF";
- };
- +
- +EOF
- +
- +close C;
- +
- +my $propertyNamesImpl = "CSSPropertyNamesImpl.cpp";
- +
- +open PROPERTYNAMES, ">$propertyNamesImpl" || die "Could not open $propertyNamesImpl for writing";
- +print PROPERTYNAMES << "EOF";
- +/* This file is automatically generated by make-hash-tools.pl, do not edit */
- +
- +#include "config.h"
- +#include "HashTools.h"
- +
- +namespace WebCore {
- +#include "CSSPropertyNamesHash.hpp"
- +
- +const Property* findProperty (register const char* str, register unsigned int len)
- +{
- + return CSSPropertyNamesHash::findPropertyImpl(str, len);
- +}
- +
- const char* getPropertyName(CSSPropertyID id)
- {
- if (id < firstCSSProperty)
- @@ -113,7 +142,9 @@ const char* getPropertyName(CSSPropertyID id)
- return 0;
- return propertyNameStrings[index];
- }
- -EOF
- -close C;
- +}
- +
- +EOF
- +close PROPERTYNAMES;
- diff --git a/WebCore/css/makevalues.pl b/WebCore/css/makevalues.pl
- index e49981d..6880de7 100644
- --- a/WebCore/css/makevalues.pl
- +++ b/WebCore/css/makevalues.pl
- @@ -5,6 +5,7 @@
- # Copyright (C) 1999 Waldo Bastian (bastian@kde.org)
- # Copyright (C) 2007 Apple Inc. All rights reserved.
- # Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
- +# Copyright (C) 2010 Andras Becsi (abecsi@inf.u-szeged.hu), University of Szeged
- #
- # This library is free software; you can redistribute it and/or
- # modify it under the terms of the GNU Library General Public
- @@ -37,13 +38,19 @@ open GPERF, ">CSSValueKeywords.gperf" || die "Could not open CSSValueKeywords.gp
- print GPERF << "EOF";
- %{
- /* This file is automatically generated from CSSValueKeywords.in by makevalues, do not edit */
- -
- -#include \"CSSValueKeywords.h\"
- %}
- -struct css_value {
- - const char* name;
- - int id;
- -};
- +%struct-type
- +struct Value;
- +%omit-struct-type
- +%language=C++
- +%readonly-tables
- +%global-table
- +%compare-strncmp
- +%define class-name CSSValueKeywordsHash
- +%define lookup-function-name findValueImpl
- +%define hash-function-name value_hash_function
- +%includes
- +%enum
- %%
- EOF
- @@ -58,9 +65,10 @@ close GPERF;
- open HEADER, ">CSSValueKeywords.h" || die "Could not open CSSValueKeywords.h for writing";
- print HEADER << "EOF";
- /* This file is automatically generated from CSSValueKeywords.in by makevalues, do not edit */
- +#include "wtf/text/CString.h"
- -#ifndef CSSValues_h
- -#define CSSValues_h
- +#ifndef CSSValueKeywords_h
- +#define CSSValueKeywords_h
- const int CSSValueInvalid = 0;
- EOF
- @@ -80,15 +88,14 @@ print HEADER "const int numCSSValueKeywords = " . $i . ";\n";
- print HEADER "const size_t maxCSSValueKeywordLength = " . $maxLen . ";\n";
- print HEADER << "EOF";
- -const char* getValueName(unsigned short id);
- -#endif
- +#endif // CSSValueKeywords_h
- EOF
- close HEADER;
- -system("gperf -L ANSI-C -E -C -n -o -t --key-positions=\"*\" -NfindValue -Hhash_val -Wwordlist_value -D CSSValueKeywords.gperf > CSSValueKeywords.c") == 0 || die "calling gperf failed: $?";
- +system("gperf --key-positions=\"*\" -D -s 2 CSSValueKeywords.gperf > CSSValueKeywordsHash.hpp") == 0 || die "calling gperf failed: $?";
- -open C, ">>CSSValueKeywords.c" || die "Could not open CSSValueKeywords.c for writing";
- +open C, ">>CSSValueKeywordsHash.hpp" || die "Could not open CSSValueKeywordsHash.hpp for writing";
- print C "static const char * const valueList[] = {\n";
- print C "\"\",\n";
- foreach my $name (@names) {
- @@ -97,12 +104,35 @@ foreach my $name (@names) {
- print C << "EOF";
- 0
- };
- +
- +EOF
- +
- +close C;
- +
- +my $valueKeywordsImpl = "CSSValueKeywordsImpl.cpp";
- +
- +open VALUEKEYWORDS, ">$valueKeywordsImpl" || die "Could not open $valueKeywordsImpl for writing";
- +print VALUEKEYWORDS << "EOF";
- +/* This file is automatically generated by make-hash-tools.pl, do not edit */
- +
- +#include "config.h"
- +#include "HashTools.h"
- +
- +namespace WebCore {
- +#include "CSSValueKeywordsHash.hpp"
- +
- +const Value* findValue (register const char* str, register unsigned int len)
- +{
- + return CSSValueKeywordsHash::findValueImpl(str, len);
- +}
- +
- const char* getValueName(unsigned short id)
- {
- if (id >= numCSSValueKeywords || id <= 0)
- return 0;
- return valueList[id];
- }
- -EOF
- -close C;
- +}
- +
- +EOF
- diff --git a/WebCore/html/DocTypeStrings.gperf b/WebCore/html/DocTypeStrings.gperf
- index 398626e..1c7411d 100644
- --- a/WebCore/html/DocTypeStrings.gperf
- +++ b/WebCore/html/DocTypeStrings.gperf
- @@ -1,14 +1,16 @@
- -struct PubIDInfo {
- - enum eMode {
- - eQuirks,
- - eQuirks3,
- - eAlmostStandards
- - };
- -
- - const char* name;
- - eMode mode_if_no_sysid;
- - eMode mode_if_sysid;
- -}
- +%struct-type
- +struct PubIDInfo;
- +%omit-struct-type
- +%language=C++
- +%readonly-tables
- +%global-table
- +%compare-strncmp
- +%define initializer-suffix ,PubIDInfo::eAlmostStandards,PubIDInfo::eAlmostStandards
- +%define class-name DocTypeStringsHash
- +%define lookup-function-name findDoctypeEntryImpl
- +%define hash-function-name doctype_hash_function
- +%includes
- +%enum
- %%
- "+//silmaril//dtd html pro v0r11 19970101//en", PubIDInfo::eQuirks3, PubIDInfo::eQuirks3
- "-//advasoft ltd//dtd html 3.0 aswedit + extensions//en", PubIDInfo::eQuirks3, PubIDInfo::eQuirks3
- diff --git a/WebCore/html/HTMLDocument.cpp b/WebCore/html/HTMLDocument.cpp
- index 3048ee9..a6c7e6e 100644
- --- a/WebCore/html/HTMLDocument.cpp
- +++ b/WebCore/html/HTMLDocument.cpp
- @@ -64,6 +64,7 @@
- #include "FrameLoader.h"
- #include "FrameTree.h"
- #include "FrameView.h"
- +#include "HashTools.h"
- #include "HTMLBodyElement.h"
- #include "HTMLElementFactory.h"
- #include "HTMLNames.h"
- @@ -73,8 +74,6 @@
- #include "Page.h"
- #include <wtf/text/CString.h>
- -#include "DocTypeStrings.cpp"
- -
- namespace WebCore {
- using namespace HTMLNames;
- diff --git a/WebCore/html/HTMLEntityNames.gperf b/WebCore/html/HTMLEntityNames.gperf
- index b16b3d8..d63d133 100644
- --- a/WebCore/html/HTMLEntityNames.gperf
- +++ b/WebCore/html/HTMLEntityNames.gperf
- @@ -2,6 +2,7 @@
- /*
- Copyright (C) 1999 Lars Knoll (knoll@mpi-hd.mpg.de)
- Copyright (C) 2002, 2003, 2004, 2005 Apple Inc. All rights reserved.
- + Copyright (C) 2010 Andras Becsi (abecsi@inf.u-szeged.hu), University of Szeged
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public
- @@ -21,15 +22,21 @@
- ----------------------------------------------------------------------------
- HTMLEntityNames.gperf: input file to generate a hash table for entities
- - HTMLEntityNames.c: DO NOT EDIT! generated by the command
- - "gperf -a -L "ANSI-C" -C -G -c -o -t -k '*' -NfindEntity -D -s 2 HTMLEntityNames.gperf > entities.c"
- - from HTMLEntityNames.gperf
- + HTMLEntityNames.hpp: DO NOT EDIT! generated by WebCore/make_hash_tools.pl
- */
- %}
- -struct Entity {
- - const char *name;
- - int code;
- -};
- +%struct-type
- +struct Entity;
- +%omit-struct-type
- +%language=C++
- +%readonly-tables
- +%global-table
- +%compare-strncmp
- +%define class-name HTMLEntityHash
- +%define lookup-function-name findEntityImpl
- +%define hash-function-name entity_hash_function
- +%includes
- +%enum
- %%
- AElig, 0x00c6
- AMP, 38
- diff --git a/WebCore/html/HTMLTokenizer.cpp b/WebCore/html/HTMLTokenizer.cpp
- index c807a4f..a53cdf9 100644
- --- a/WebCore/html/HTMLTokenizer.cpp
- +++ b/WebCore/html/HTMLTokenizer.cpp
- @@ -38,6 +38,7 @@
- #include "Frame.h"
- #include "FrameLoader.h"
- #include "FrameView.h"
- +#include "HashTools.h"
- #include "HTMLElement.h"
- #include "HTMLNames.h"
- #include "HTMLParser.h"
- @@ -55,8 +56,6 @@
- #include <wtf/ASCIICType.h>
- #include <wtf/CurrentTime.h>
- -#include "HTMLEntityNames.c"
- -
- #define PRELOAD_SCANNER_ENABLED 1
- // #define INSTRUMENT_LAYOUT_SCHEDULING 1
- diff --git a/WebCore/html/PreloadScanner.cpp b/WebCore/html/PreloadScanner.cpp
- index cd84b20..eefa46f 100644
- --- a/WebCore/html/PreloadScanner.cpp
- +++ b/WebCore/html/PreloadScanner.cpp
- @@ -38,24 +38,13 @@
- #include "Document.h"
- #include "Frame.h"
- #include "FrameLoader.h"
- +#include "HashTools.h"
- #include "HTMLLinkElement.h"
- #include "HTMLNames.h"
- #include <wtf/text/CString.h>
- #include <wtf/CurrentTime.h>
- #include <wtf/unicode/Unicode.h>
- -// Use __GNUC__ instead of PLATFORM(GCC) to stay consistent with the gperf generated c file
- -#ifdef __GNUC__
- -// The main tokenizer includes this too so we are getting two copies of the data. However, this way the code gets inlined.
- -#include "HTMLEntityNames.c"
- -#else
- -// Not inlined for non-GCC compilers
- -struct Entity {
- - const char* name;
- - int code;
- -};
- -const struct Entity* findEntity(register const char* str, register unsigned int len);
- -#endif
- #define PRELOAD_DEBUG 0
- diff --git a/WebCore/make-hash-tools.pl b/WebCore/make-hash-tools.pl
- new file mode 100644
- index 0000000..05c5a17
- --- /dev/null
- +++ b/WebCore/make-hash-tools.pl
- @@ -0,0 +1,191 @@
- +#! /usr/bin/perl
- +#
- +# This file is part of the WebKit project
- +#
- +# Copyright (C) 2010 Andras Becsi (abecsi@inf.u-szeged.hu), University of Szeged
- +#
- +# 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.
- +
- +use strict;
- +use Switch;
- +
- +my $option = $ARGV[0];
- +shift;
- +my $outdir = $ARGV[0];
- +shift;
- +
- +my $hashToolsHeader = "$outdir/HashTools.h";
- +
- +sub createHashToolsHeader() {
- +
- +open HEADER, ">$hashToolsHeader" || die "Could not open $hashToolsHeader for writing";
- +print HEADER << "EOF";
- +/* This file is automatically generated by make-hash-tools.pl, do not edit */
- +
- +#include "CSSValueKeywords.h"
- +#include "CSSPropertyNames.h"
- +
- +#ifndef HashTools_h
- +#define HashTools_h
- +
- +namespace WebCore {
- +
- +struct Entity {
- + const char* name;
- + int code;
- +};
- +
- +struct PubIDInfo {
- + enum eMode {
- + eQuirks,
- + eQuirks3,
- + eAlmostStandards
- + };
- +
- + const char* name;
- + eMode mode_if_no_sysid;
- + eMode mode_if_sysid;
- +};
- +
- +struct NamedColor {
- + const char* name;
- + int RGBValue;
- +};
- +
- +struct Property {
- + const char* name;
- + int id;
- +};
- +
- +struct Value {
- + const char* name;
- + int id;
- +};
- +
- +const Entity* findEntity(register const char* str, register unsigned int len);
- +const PubIDInfo* findDoctypeEntry(register const char* str, register unsigned int len);
- +const NamedColor* findColor(register const char* str, register unsigned int len);
- +const Property* findProperty(register const char* str, register unsigned int len);
- +const Value* findValue(register const char* str, register unsigned int len);
- +
- +const char* getPropertyName(CSSPropertyID);
- +const char* getValueName(unsigned short id);
- +
- +}
- +
- +#endif // HashTools_h
- +
- +EOF
- +close HEADER;
- +
- +}
- +
- +switch ($option) {
- +
- +case "entities" {
- +
- +# Create the following once in the HTMLEntityNames creation phase
- +createHashToolsHeader();
- +
- +my $htmlEntityNamesImpl = "$outdir/HTMLEntityNamesImpl.cpp";
- +my $htmlEntityNamesGenerated = "$outdir/HTMLEntityNamesHash.hpp";
- +my $htmlEntityNamesGperf = $ARGV[0];
- +shift;
- +
- +open ENTITIES, ">$htmlEntityNamesImpl" || die "Could not open $htmlEntityNamesImpl for writing";
- +print ENTITIES << "EOF";
- +/* This file is automatically generated by make-hash-tools.pl, do not edit */
- +
- +#include "config.h"
- +#include "HashTools.h"
- +
- +namespace WebCore {
- +#include "HTMLEntityNamesHash.hpp"
- +
- +const Entity* findEntity(register const char* str, register unsigned int len)
- +{
- + return HTMLEntityHash::findEntityImpl(str, len);
- +}
- +
- +}
- +
- +EOF
- +close ENTITIES;
- +system("gperf --key-positions=\"*\" -D -s 2 $htmlEntityNamesGperf > $htmlEntityNamesGenerated") == 0 || die "calling gperf failed: $?";
- +
- +} # case "entities"
- +
- +case "doctype" {
- +
- +my $docTypeStringsImpl = "$outdir/DocTypeStringsImpl.cpp";
- +my $docTypeStringsGenerated = "$outdir/DocTypeStringsHash.hpp";
- +my $docTypeStringsGperf = $ARGV[0];
- +shift;
- +
- +open DOCTYPESTRINGS, ">$docTypeStringsImpl" || die "Could not open $docTypeStringsImpl for writing";
- +print DOCTYPESTRINGS << "EOF";
- +/* This file is automatically generated by make-hash-tools.pl, do not edit */
- +
- +#include "config.h"
- +#include "HashTools.h"
- +
- +namespace WebCore {
- +#include "DocTypeStringsHash.hpp"
- +
- +const PubIDInfo* findDoctypeEntry (register const char* str, register unsigned int len)
- +{
- + return DocTypeStringsHash::findDoctypeEntryImpl(str, len);
- +}
- +
- +}
- +
- +EOF
- +close DOCTYPESTRINGS;
- +system("gperf --key-positions=\"*\" -s 2 $docTypeStringsGperf > $docTypeStringsGenerated") == 0 || die "calling gperf failed: $?";
- +
- +} # case "doctype"
- +
- +case "colordata" {
- +
- +my $colorDataImpl = "$outdir/ColorDataImpl.cpp";
- +my $colorDataGenerated = "$outdir/ColorDataHash.hpp";
- +my $colorDataGperf = $ARGV[0];
- +shift;
- +
- +open COLORDATA, ">$colorDataImpl" || die "Could not open $colorDataImpl for writing";
- +print COLORDATA << "EOF";
- +/* This file is automatically generated by make-hash-tools.pl, do not edit */
- +
- +#include "config.h"
- +#include "HashTools.h"
- +
- +namespace WebCore {
- +#include "ColorDataHash.hpp"
- +
- +const struct NamedColor* findColor (register const char* str, register unsigned int len)
- +{
- + return ColorDataHash::findColorImpl(str, len);
- +}
- +
- +}
- +
- +EOF
- +close COLORDATA;
- +system("gperf --key-positions=\"*\" -D -s 2 $colorDataGperf > $colorDataGenerated") == 0 || die "calling gperf failed: $?";
- +
- +} # case "colordata"
- +
- +} # switch ($option)
- diff --git a/WebCore/page/animation/ImplicitAnimation.cpp b/WebCore/page/animation/ImplicitAnimation.cpp
- index 328fe0e..ceaebda 100644
- --- a/WebCore/page/animation/ImplicitAnimation.cpp
- +++ b/WebCore/page/animation/ImplicitAnimation.cpp
- @@ -32,6 +32,7 @@
- #include "CompositeAnimation.h"
- #include "CSSPropertyNames.h"
- #include "EventNames.h"
- +#include "HashTools.h"
- #include "ImplicitAnimation.h"
- #include "KeyframeAnimation.h"
- #include "RenderLayer.h"
- diff --git a/WebCore/platform/ColorData.gperf b/WebCore/platform/ColorData.gperf
- index 8a54916..d684cb9 100644
- --- a/WebCore/platform/ColorData.gperf
- +++ b/WebCore/platform/ColorData.gperf
- @@ -1,4 +1,15 @@
- -struct NamedColor { const char *name; int RGBValue; };
- +%struct-type
- +struct NamedColor;
- +%omit-struct-type
- +%language=C++
- +%readonly-tables
- +%global-table
- +%compare-strncmp
- +%define class-name ColorDataHash
- +%define lookup-function-name findColorImpl
- +%define hash-function-name colordata_hash_function
- +%includes
- +%enum
- %%
- aliceblue, 0xf0f8ff
- antiquewhite, 0xfaebd7
- diff --git a/WebCore/platform/graphics/Color.cpp b/WebCore/platform/graphics/Color.cpp
- index d98b202..a87dafd 100644
- --- a/WebCore/platform/graphics/Color.cpp
- +++ b/WebCore/platform/graphics/Color.cpp
- @@ -26,13 +26,12 @@
- #include "config.h"
- #include "Color.h"
- +#include "HashTools.h"
- #include "PlatformString.h"
- #include <math.h>
- #include <wtf/Assertions.h>
- #include <wtf/MathExtras.h>
- -#include "ColorData.c"
- -
- using namespace std;
- using namespace WTF;
- diff --git a/WebKit/chromium/ChangeLog b/WebKit/chromium/ChangeLog
- index 474572e..611ffc9 100644
- --- a/WebKit/chromium/ChangeLog
- +++ b/WebKit/chromium/ChangeLog
- @@ -1,3 +1,23 @@
- +2010-05-11 Andras Becsi <abecsi@inf.u-szeged.hu>
- +
- + Reviewed by NOBODY (OOPS!).
- +
- + Refactor gperf code generation and usage to fix the debug build with gcc>4.4.
- + webkit.org/b/29244
- +
- + Gperf code generation is done by a new script called WebCore/make-hash-tools.pl now,
- + and the generation options were moved into the gperf files, to make the options more understandable
- + and the generation process less redundant across the various ports.
- + Hitherto gperf generated C code, these files were included in multiple C++ files across WebCore
- + to access the functionality provided. This resulted in debug build failure with newer gcc versions
- + because of a new feature of gcc, which disables C style inlining in debug mode.
- + The make-hash-tools.pl script lets gperf generate C++ code for all gperf files now, which are compiled
- + in their own compilation unit.
- + The functionality provided by the generated code is wrapped behind HashTools.h, so there is no need
- + for multiple inclusions of generated C files to access these functions.
- +
- + * src/WebEntities.cpp:
- +
- 2010-05-10 Tony Chang <tony@chromium.org>
- Reviewed by Kent Tamura.
- diff --git a/WebKit/chromium/src/WebEntities.cpp b/WebKit/chromium/src/WebEntities.cpp
- index b9143d9..a880671 100644
- --- a/WebKit/chromium/src/WebEntities.cpp
- +++ b/WebKit/chromium/src/WebEntities.cpp
- @@ -33,6 +33,7 @@
- #include <string.h>
- +#include "HashTools.h"
- #include "PlatformString.h"
- #include "StringBuilder.h"
- #include <wtf/HashMap.h>
- @@ -41,15 +42,6 @@
- using namespace WebCore;
- -namespace {
- -// Note that this file is also included by HTMLTokenizer.cpp so we are getting
- -// two copies of the data in memory. We can fix this by changing the script
- -// that generated the array to create a static const that is its length, but
- -// this is low priority since the data is less than 4K. We use anonymous
- -// namespace to prevent name collisions.
- -#include "HTMLEntityNames.c" // NOLINT
- -}
- -
- namespace WebKit {
- void populateMap(WTF::HashMap<int, WebCore::String>& map,
- diff --git a/WebKit/qt/ChangeLog b/WebKit/qt/ChangeLog
- index 385d581..6aac739 100644
- --- a/WebKit/qt/ChangeLog
- +++ b/WebKit/qt/ChangeLog
- @@ -1,3 +1,24 @@
- +2010-05-11 Andras Becsi <abecsi@inf.u-szeged.hu>
- +
- + Reviewed by NOBODY (OOPS!).
- +
- + Refactor gperf code generation and usage to fix the debug build with gcc>4.4.
- + webkit.org/b/29244
- +
- + Gperf code generation is done by a new script called WebCore/make-hash-tools.pl now,
- + and the generation options were moved into the gperf files, to make the options more understandable
- + and the generation process less redundant across the various ports.
- + Hitherto gperf generated C code, these files were included in multiple C++ files across WebCore
- + to access the functionality provided. This resulted in debug build failure with newer gcc versions
- + because of a new feature of gcc, which disables C style inlining in debug mode.
- + The make-hash-tools.pl script lets gperf generate C++ code for all gperf files now, which are compiled
- + in their own compilation unit.
- + The functionality provided by the generated code is wrapped behind HashTools.h, so there is no need
- + for multiple inclusions of generated C files to access these functions.
- +
- + * WebCoreSupport/FrameLoaderClientQt.cpp:
- + (WebCore::FrameLoaderClientQt::createPlugin):
- +
- 2010-05-09 Noam Rosenthal <noam.rosenthal@nokia.com>
- Reviewed by Kenneth Rohde Christiansen.
- diff --git a/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp b/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp
- index a0b06fb..bab1d04 100644
- --- a/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp
- +++ b/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp
- @@ -32,7 +32,6 @@
- #include "config.h"
- #include "CSSComputedStyleDeclaration.h"
- -#include "CSSPropertyNames.h"
- #include "FormState.h"
- #include "FrameLoaderClientQt.h"
- #include "FrameTree.h"
- @@ -46,6 +45,7 @@
- #include "ProgressTracker.h"
- #include "RenderPart.h"
- #include "ResourceRequest.h"
- +#include "HashTools.h"
- #include "HistoryItem.h"
- #include "HTMLAppletElement.h"
- #include "HTMLFormElement.h"
- @@ -1333,7 +1333,7 @@ PassRefPtr<Widget> FrameLoaderClientQt::createPlugin(const IntSize& pluginSize,
- for (unsigned i = 0; i < numqStyleSheetProperties; ++i) {
- CSSPropertyID property = qstyleSheetProperties[i];
- - styleSheet += QString::fromLatin1(::getPropertyName(property));
- + styleSheet += QString::fromLatin1(getPropertyName(property));
- styleSheet += QLatin1Char(':');
- styleSheet += computedStyle(element)->getPropertyValue(property);
- styleSheet += QLatin1Char(';');
Add Comment
Please, Sign In to add comment