<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[166447] trunk/Source/WebCore</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/166447">166447</a></dd>
<dt>Author</dt> <dd>benjamin@webkit.org</dd>
<dt>Date</dt> <dd>2014-03-28 20:08:59 -0700 (Fri, 28 Mar 2014)</dd>
</dl>
<h3>Log Message</h3>
<pre>Update the code related to SelectorPseudoTypeMap to reflect its new purpose
https://bugs.webkit.org/show_bug.cgi?id=130620
Patch by Benjamin Poulain <bpoulain@apple.com> on 2014-03-28
Reviewed by Andreas Kling.
Since <a href="http://trac.webkit.org/projects/webkit/changeset/166094">r166094</a>, SelectorPseudoTypeMap only contains PseudoClass instances and the 4 compatibility PseudoElement.
This patch rename SelectorPseudoTypeMap to SelectorPseudoClassAndCompatibilityElementMap and update the parsing
to split PseudoClass and PseudoElement.
* CMakeLists.txt:
* DerivedSources.make:
* WebCore.xcodeproj/project.pbxproj:
* css/CSSGrammar.y.in:
* css/CSSParserValues.cpp:
(WebCore::CSSParserSelector::parsePseudoClassAndCompatibilityElementSelector):
(WebCore::CSSParserSelector::setPseudoClassValue):
* css/CSSParserValues.h:
* css/CSSSelector.cpp:
(WebCore::appendPseudoClassFunctionTail):
(WebCore::CSSSelector::selectorText):
* css/SelectorPseudoClassAndCompatibilityElementMap.in: Renamed from Source/WebCore/css/SelectorPseudoTypeMap.in.
* css/SelectorPseudoTypeMap.h:
* css/makeSelectorPseudoClassAndCompatibilityElementMap.py: Renamed from Source/WebCore/css/makeSelectorPseudoTypeMap.py.
(enumerablePseudoType):
(expand_ifdef_condition):</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreCMakeListstxt">trunk/Source/WebCore/CMakeLists.txt</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreDerivedSourcesmake">trunk/Source/WebCore/DerivedSources.make</a></li>
<li><a href="#trunkSourceWebCoreWebCorevcxprojWebCorevcxproj">trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj</a></li>
<li><a href="#trunkSourceWebCoreWebCorevcxprojWebCorevcxprojfilters">trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters</a></li>
<li><a href="#trunkSourceWebCoreWebCorexcodeprojprojectpbxproj">trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceWebCorecssCSSGrammaryin">trunk/Source/WebCore/css/CSSGrammar.y.in</a></li>
<li><a href="#trunkSourceWebCorecssCSSParserValuescpp">trunk/Source/WebCore/css/CSSParserValues.cpp</a></li>
<li><a href="#trunkSourceWebCorecssCSSParserValuesh">trunk/Source/WebCore/css/CSSParserValues.h</a></li>
<li><a href="#trunkSourceWebCorecssCSSSelectorcpp">trunk/Source/WebCore/css/CSSSelector.cpp</a></li>
<li><a href="#trunkSourceWebCorecssSelectorPseudoTypeMaph">trunk/Source/WebCore/css/SelectorPseudoTypeMap.h</a></li>
</ul>
<h3>Added Paths</h3>
<ul>
<li><a href="#trunkSourceWebCorecssSelectorPseudoClassAndCompatibilityElementMapin">trunk/Source/WebCore/css/SelectorPseudoClassAndCompatibilityElementMap.in</a></li>
<li><a href="#trunkSourceWebCorecssmakeSelectorPseudoClassAndCompatibilityElementMappy">trunk/Source/WebCore/css/makeSelectorPseudoClassAndCompatibilityElementMap.py</a></li>
</ul>
<h3>Removed Paths</h3>
<ul>
<li><a href="#trunkSourceWebCorecssSelectorPseudoTypeMapin">trunk/Source/WebCore/css/SelectorPseudoTypeMap.in</a></li>
<li><a href="#trunkSourceWebCorecssmakeSelectorPseudoTypeMappy">trunk/Source/WebCore/css/makeSelectorPseudoTypeMap.py</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreCMakeListstxt"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/CMakeLists.txt (166446 => 166447)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/CMakeLists.txt        2014-03-29 02:46:45 UTC (rev 166446)
+++ trunk/Source/WebCore/CMakeLists.txt        2014-03-29 03:08:59 UTC (rev 166447)
</span><span class="lines">@@ -3131,12 +3131,12 @@
</span><span class="cx">
</span><span class="cx"> # Generate CSS Selector pseudo type name to value maps.
</span><span class="cx"> add_custom_command(
</span><del>- OUTPUT ${DERIVED_SOURCES_WEBCORE_DIR}/SelectorPseudoTypeMap.gperf ${DERIVED_SOURCES_WEBCORE_DIR}/SelectorPseudoTypeMap.cpp
- MAIN_DEPENDENCY ${WEBCORE_DIR}/css/makeSelectorPseudoTypeMap.py
</del><ins>+ OUTPUT ${DERIVED_SOURCES_WEBCORE_DIR}/SelectorPseudoClassAndCompatibilityElementMap.gperf ${DERIVED_SOURCES_WEBCORE_DIR}/SelectorPseudoClassAndCompatibilityElementMap.cpp
+ MAIN_DEPENDENCY ${WEBCORE_DIR}/css/makeSelectorPseudoClassAndCompatibilityElementMap.py
</ins><span class="cx"> WORKING_DIRECTORY ${DERIVED_SOURCES_WEBCORE_DIR}
</span><del>- COMMAND ${PYTHON_EXECUTABLE} ${WEBCORE_DIR}/css/makeSelectorPseudoTypeMap.py ${WEBCORE_DIR}/css/SelectorPseudoTypeMap.in "${FEATURE_DEFINES_WITH_SPACE_SEPARATOR}"
</del><ins>+ COMMAND ${PYTHON_EXECUTABLE} ${WEBCORE_DIR}/css/makeSelectorPseudoClassAndCompatibilityElementMap.py ${WEBCORE_DIR}/css/SelectorPseudoClassAndCompatibilityElementMap.in "${FEATURE_DEFINES_WITH_SPACE_SEPARATOR}"
</ins><span class="cx"> VERBATIM)
</span><del>-list(APPEND WebCore_SOURCES ${DERIVED_SOURCES_WEBCORE_DIR}/SelectorPseudoTypeMap.cpp)
</del><ins>+list(APPEND WebCore_SOURCES ${DERIVED_SOURCES_WEBCORE_DIR}/SelectorPseudoClassAndCompatibilityElementMap.cpp)
</ins><span class="cx"> add_custom_command(
</span><span class="cx"> OUTPUT ${DERIVED_SOURCES_WEBCORE_DIR}/SelectorPseudoElementTypeMap.gperf ${DERIVED_SOURCES_WEBCORE_DIR}/SelectorPseudoElementTypeMap.cpp
</span><span class="cx"> MAIN_DEPENDENCY ${WEBCORE_DIR}/css/makeSelectorPseudoElementsMap.py
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (166446 => 166447)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2014-03-29 02:46:45 UTC (rev 166446)
+++ trunk/Source/WebCore/ChangeLog        2014-03-29 03:08:59 UTC (rev 166447)
</span><span class="lines">@@ -1,3 +1,32 @@
</span><ins>+2014-03-28 Benjamin Poulain <bpoulain@apple.com>
+
+ Update the code related to SelectorPseudoTypeMap to reflect its new purpose
+ https://bugs.webkit.org/show_bug.cgi?id=130620
+
+ Reviewed by Andreas Kling.
+
+ Since r166094, SelectorPseudoTypeMap only contains PseudoClass instances and the 4 compatibility PseudoElement.
+
+ This patch rename SelectorPseudoTypeMap to SelectorPseudoClassAndCompatibilityElementMap and update the parsing
+ to split PseudoClass and PseudoElement.
+
+ * CMakeLists.txt:
+ * DerivedSources.make:
+ * WebCore.xcodeproj/project.pbxproj:
+ * css/CSSGrammar.y.in:
+ * css/CSSParserValues.cpp:
+ (WebCore::CSSParserSelector::parsePseudoClassAndCompatibilityElementSelector):
+ (WebCore::CSSParserSelector::setPseudoClassValue):
+ * css/CSSParserValues.h:
+ * css/CSSSelector.cpp:
+ (WebCore::appendPseudoClassFunctionTail):
+ (WebCore::CSSSelector::selectorText):
+ * css/SelectorPseudoClassAndCompatibilityElementMap.in: Renamed from Source/WebCore/css/SelectorPseudoTypeMap.in.
+ * css/SelectorPseudoTypeMap.h:
+ * css/makeSelectorPseudoClassAndCompatibilityElementMap.py: Renamed from Source/WebCore/css/makeSelectorPseudoTypeMap.py.
+ (enumerablePseudoType):
+ (expand_ifdef_condition):
+
</ins><span class="cx"> 2014-03-28 Stephanie Lewis <slewis@apple.com>
</span><span class="cx">
</span><span class="cx"> Unreviewed build fix.
</span></span></pre></div>
<a id="trunkSourceWebCoreDerivedSourcesmake"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/DerivedSources.make (166446 => 166447)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/DerivedSources.make        2014-03-29 02:46:45 UTC (rev 166446)
+++ trunk/Source/WebCore/DerivedSources.make        2014-03-29 03:08:59 UTC (rev 166447)
</span><span class="lines">@@ -751,8 +751,8 @@
</span><span class="cx"> PlugInsResources.h \
</span><span class="cx"> SVGElementFactory.cpp \
</span><span class="cx"> SVGNames.cpp \
</span><ins>+ SelectorPseudoClassAndCompatibilityElementMap.cpp \
</ins><span class="cx"> SelectorPseudoElementTypeMap.cpp \
</span><del>- SelectorPseudoTypeMap.cpp \
</del><span class="cx"> UserAgentStyleSheets.h \
</span><span class="cx"> WebKitFontFamilyNames.cpp \
</span><span class="cx"> WebKitFontFamilyNames.h \
</span><span class="lines">@@ -797,9 +797,9 @@
</span><span class="cx">
</span><span class="cx"> # CSS Selector pseudo type name to value map.
</span><span class="cx">
</span><del>-WEBCORE_CSS_SELECTOR_PSEUDO_TYPE_MAP_KEYWORDS := $(WebCore)/css/SelectorPseudoTypeMap.in
-SelectorPseudoTypeMap.cpp : $(WebCore)/css/makeSelectorPseudoTypeMap.py $(WEBCORE_CSS_SELECTOR_PSEUDO_TYPE_MAP_KEYWORDS)
-        python "$(WebCore)/css/makeSelectorPseudoTypeMap.py" $(WEBCORE_CSS_SELECTOR_PSEUDO_TYPE_MAP_KEYWORDS) "$(FEATURE_DEFINES)"
</del><ins>+WEBCORE_CSS_SELECTOR_PSEUDO_TYPE_MAP_KEYWORDS := $(WebCore)/css/SelectorPseudoClassAndCompatibilityElementMap.in
+SelectorPseudoClassAndCompatibilityElementMap.cpp : $(WebCore)/css/makeSelectorPseudoClassAndCompatibilityElementMap.py $(WEBCORE_CSS_SELECTOR_PSEUDO_TYPE_MAP_KEYWORDS)
+        python "$(WebCore)/css/makeSelectorPseudoClassAndCompatibilityElementMap.py" $(WEBCORE_CSS_SELECTOR_PSEUDO_TYPE_MAP_KEYWORDS) "$(FEATURE_DEFINES)"
</ins><span class="cx">
</span><span class="cx"> WEBCORE_CSS_SELECTOR_PSEUDO_ELEMENTS_TYPE_MAP_KEYWORDS := $(WebCore)/css/SelectorPseudoElementTypeMap.in
</span><span class="cx"> SelectorPseudoElementTypeMap.cpp : $(WebCore)/css/makeSelectorPseudoElementsMap.py $(WEBCORE_CSS_SELECTOR_PSEUDO_ELEMENTS_TYPE_MAP_KEYWORDS)
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorevcxprojWebCorevcxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj (166446 => 166447)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj        2014-03-29 02:46:45 UTC (rev 166446)
+++ trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj        2014-03-29 03:08:59 UTC (rev 166447)
</span><span class="lines">@@ -290,8 +290,8 @@
</span><span class="cx"> </ClCompile>
</span><span class="cx"> <ClCompile Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\CSSPropertyNames.cpp" />
</span><span class="cx"> <ClCompile Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\CSSValueKeywords.cpp" />
</span><ins>+ <ClCompile Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\SelectorPseudoClassAndCompatibilityElementMap.cpp" />
</ins><span class="cx"> <ClCompile Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\SelectorPseudoElementTypeMap.cpp" />
</span><del>- <ClCompile Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\SelectorPseudoTypeMap.cpp" />
</del><span class="cx"> <ClCompile Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\WebCore\DerivedSources\JSANGLEInstancedArrays.cpp">
</span><span class="cx"> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
</span><span class="cx"> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorevcxprojWebCorevcxprojfilters"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters (166446 => 166447)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters        2014-03-29 02:46:45 UTC (rev 166446)
+++ trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters        2014-03-29 03:08:59 UTC (rev 166447)
</span><span class="lines">@@ -5155,10 +5155,10 @@
</span><span class="cx"> <ClCompile Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\CSSValueKeywords.cpp">
</span><span class="cx"> <Filter>DerivedSources</Filter>
</span><span class="cx"> </ClCompile>
</span><del>- <ClCompile Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\SelectorPseudoElementTypeMap.cpp">
</del><ins>+ <ClCompile Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\SelectorPseudoClassAndCompatibilityElementMap.cpp">
</ins><span class="cx"> <Filter>DerivedSources</Filter>
</span><span class="cx"> </ClCompile>
</span><del>- <ClCompile Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\SelectorPseudoTypeMap.cpp">
</del><ins>+ <ClCompile Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\SelectorPseudoElementTypeMap.cpp">
</ins><span class="cx"> <Filter>DerivedSources</Filter>
</span><span class="cx"> </ClCompile>
</span><span class="cx"> <ClCompile Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\EventFactory.cpp">
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (166446 => 166447)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2014-03-29 02:46:45 UTC (rev 166446)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2014-03-29 03:08:59 UTC (rev 166447)
</span><span class="lines">@@ -1477,7 +1477,7 @@
</span><span class="cx">                 43A625F813B3304000AC94B8 /* SVGAnimatedColor.h in Headers */ = {isa = PBXBuildFile; fileRef = 43A625F613B3304000AC94B8 /* SVGAnimatedColor.h */; };
</span><span class="cx">                 43A625F913B3304000AC94B8 /* SVGAnimatedColor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 43A625F713B3304000AC94B8 /* SVGAnimatedColor.cpp */; };
</span><span class="cx">                 43A6266713B3D11000AC94B8 /* SVGAnimatedString.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 43A6266613B3D11000AC94B8 /* SVGAnimatedString.cpp */; };
</span><del>-                43B85ED418CBEC5200E31AF4 /* SelectorPseudoTypeMap.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 43B85ED218CBEC5200E31AF4 /* SelectorPseudoTypeMap.cpp */; };
</del><ins>+                43B85ED418CBEC5200E31AF4 /* SelectorPseudoClassAndCompatibilityElementMap.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 43B85ED218CBEC5200E31AF4 /* SelectorPseudoClassAndCompatibilityElementMap.cpp */; };
</ins><span class="cx">                 43B9336913B261B1004584BF /* SVGAnimatedPointList.h in Headers */ = {isa = PBXBuildFile; fileRef = 43B9336713B261B1004584BF /* SVGAnimatedPointList.h */; };
</span><span class="cx">                 43B9336A13B261B1004584BF /* SVGAnimatedPointList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 43B9336813B261B1004584BF /* SVGAnimatedPointList.cpp */; };
</span><span class="cx">                 43C092BC12D9E4EE00A989C3 /* RenderSVGForeignObject.h in Headers */ = {isa = PBXBuildFile; fileRef = 43C092BA12D9E4EE00A989C3 /* RenderSVGForeignObject.h */; };
</span><span class="lines">@@ -8419,10 +8419,10 @@
</span><span class="cx">                 43A625F613B3304000AC94B8 /* SVGAnimatedColor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGAnimatedColor.h; sourceTree = "<group>"; };
</span><span class="cx">                 43A625F713B3304000AC94B8 /* SVGAnimatedColor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGAnimatedColor.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 43A6266613B3D11000AC94B8 /* SVGAnimatedString.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGAnimatedString.cpp; sourceTree = "<group>"; };
</span><del>-                43B85ED018CBEACE00E31AF4 /* makeSelectorPseudoTypeMap.py */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.python; path = makeSelectorPseudoTypeMap.py; sourceTree = "<group>"; };
-                43B85ED218CBEC5200E31AF4 /* SelectorPseudoTypeMap.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SelectorPseudoTypeMap.cpp; sourceTree = "<group>"; };
-                43B85ED318CBEC5200E31AF4 /* SelectorPseudoTypeMap.gperf */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = SelectorPseudoTypeMap.gperf; sourceTree = "<group>"; };
-                43B85ED618CBEC9700E31AF4 /* SelectorPseudoTypeMap.in */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = SelectorPseudoTypeMap.in; sourceTree = "<group>"; };
</del><ins>+                43B85ED018CBEACE00E31AF4 /* makeSelectorPseudoClassAndCompatibilityElementMap.py */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.python; path = makeSelectorPseudoClassAndCompatibilityElementMap.py; sourceTree = "<group>"; };
+                43B85ED218CBEC5200E31AF4 /* SelectorPseudoClassAndCompatibilityElementMap.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SelectorPseudoClassAndCompatibilityElementMap.cpp; sourceTree = "<group>"; };
+                43B85ED318CBEC5200E31AF4 /* SelectorPseudoClassAndCompatibilityElementMap.gperf */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file; path = SelectorPseudoClassAndCompatibilityElementMap.gperf; sourceTree = "<group>"; };
+                43B85ED618CBEC9700E31AF4 /* SelectorPseudoClassAndCompatibilityElementMap.in */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = SelectorPseudoClassAndCompatibilityElementMap.in; sourceTree = "<group>"; };
</ins><span class="cx">                 43B9336713B261B1004584BF /* SVGAnimatedPointList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGAnimatedPointList.h; sourceTree = "<group>"; };
</span><span class="cx">                 43B9336813B261B1004584BF /* SVGAnimatedPointList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGAnimatedPointList.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 43C092B912D9E4EE00A989C3 /* RenderSVGForeignObject.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderSVGForeignObject.cpp; sourceTree = "<group>"; };
</span><span class="lines">@@ -15943,10 +15943,10 @@
</span><span class="cx">                                 44A28AAE12DFB8BF00AE923B /* MathMLNames.h */,
</span><span class="cx">                                 71E2183817359FB8006E6E4D /* PlugInsResources.h */,
</span><span class="cx">                                 71E2183917359FB8006E6E4D /* PlugInsResourcesData.cpp */,
</span><ins>+                                43B85ED218CBEC5200E31AF4 /* SelectorPseudoClassAndCompatibilityElementMap.cpp */,
+                                43B85ED318CBEC5200E31AF4 /* SelectorPseudoClassAndCompatibilityElementMap.gperf */,
</ins><span class="cx">                                 26AA0F9D18D2A18B00419381 /* SelectorPseudoElementTypeMap.cpp */,
</span><span class="cx">                                 26AA0F9F18D2A1C100419381 /* SelectorPseudoElementTypeMap.gperf */,
</span><del>-                                43B85ED218CBEC5200E31AF4 /* SelectorPseudoTypeMap.cpp */,
-                                43B85ED318CBEC5200E31AF4 /* SelectorPseudoTypeMap.gperf */,
</del><span class="cx">                                 53EF766A16530A61004CBE49 /* SettingsMacros.h */,
</span><span class="cx">                                 656581E609D1508D000E61D7 /* SVGElementFactory.cpp */,
</span><span class="cx">                                 656581E709D1508D000E61D7 /* SVGElementFactory.h */,
</span><span class="lines">@@ -21702,7 +21702,7 @@
</span><span class="cx">                                 E55F4979151B888000BB67DB /* LengthFunctions.cpp */,
</span><span class="cx">                                 E5BA7D62151437CA00FE1E3F /* LengthFunctions.h */,
</span><span class="cx">                                 26AA0F9918D2973D00419381 /* makeSelectorPseudoElementsMap.py */,
</span><del>-                                43B85ED018CBEACE00E31AF4 /* makeSelectorPseudoTypeMap.py */,
</del><ins>+                                43B85ED018CBEACE00E31AF4 /* makeSelectorPseudoClassAndCompatibilityElementMap.py */,
</ins><span class="cx">                                 93CA4C9A09DF93FA00DF8677 /* make-css-file-arrays.pl */,
</span><span class="cx">                                 93CA4C9B09DF93FA00DF8677 /* makeprop.pl */,
</span><span class="cx">                                 93CA4C9D09DF93FA00DF8677 /* makevalues.pl */,
</span><span class="lines">@@ -21750,7 +21750,7 @@
</span><span class="cx">                                 415071551685067300C3C7B3 /* SelectorFilter.cpp */,
</span><span class="cx">                                 415071561685067300C3C7B3 /* SelectorFilter.h */,
</span><span class="cx">                                 26AA0F9A18D2973D00419381 /* SelectorPseudoElementTypeMap.in */,
</span><del>-                                43B85ED618CBEC9700E31AF4 /* SelectorPseudoTypeMap.in */,
</del><ins>+                                43B85ED618CBEC9700E31AF4 /* SelectorPseudoClassAndCompatibilityElementMap.in */,
</ins><span class="cx">                                 43107BE118CC19DE00CC18E8 /* SelectorPseudoTypeMap.h */,
</span><span class="cx">                                 E47A97CE163059FC005DCD99 /* StyleInvalidationAnalysis.cpp */,
</span><span class="cx">                                 E47A97CF163059FC005DCD99 /* StyleInvalidationAnalysis.h */,
</span><span class="lines">@@ -27216,7 +27216,7 @@
</span><span class="cx">                                 6E67D2A61280E8A4008758F7 /* Extensions3DOpenGL.cpp in Sources */,
</span><span class="cx">                                 44DAB5B115A623580097C1E4 /* Extensions3DOpenGLCommon.cpp in Sources */,
</span><span class="cx">                                 7728694E14F8882500F484DC /* EXTTextureFilterAnisotropic.cpp in Sources */,
</span><del>-                                43B85ED418CBEC5200E31AF4 /* SelectorPseudoTypeMap.cpp in Sources */,
</del><ins>+                                43B85ED418CBEC5200E31AF4 /* SelectorPseudoClassAndCompatibilityElementMap.cpp in Sources */,
</ins><span class="cx">                                 A75E8B880E1DE2D6007F2481 /* FEBlend.cpp in Sources */,
</span><span class="cx">                                 A75E8B8A0E1DE2D6007F2481 /* FEColorMatrix.cpp in Sources */,
</span><span class="cx">                                 A75E8B8C0E1DE2D6007F2481 /* FEComponentTransfer.cpp in Sources */,
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSGrammaryin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSGrammar.y.in (166446 => 166447)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSGrammar.y.in        2014-03-29 02:46:45 UTC (rev 166446)
+++ trunk/Source/WebCore/css/CSSGrammar.y.in        2014-03-29 03:08:59 UTC (rev 166447)
</span><span class="lines">@@ -1196,13 +1196,7 @@
</span><span class="cx">
</span><span class="cx"> pseudo:
</span><span class="cx"> ':' IDENT {
</span><del>- $$ = nullptr;
- auto selector = std::make_unique<CSSParserSelector>();
- selector->setMatch(CSSSelector::PseudoClass);
- $2.lower();
- selector->setPseudoTypeValue($2);
- if (selector->pseudoType() != CSSSelector::PseudoUnknown)
- $$ = selector.release();
</del><ins>+ $$ = CSSParserSelector::parsePseudoClassAndCompatibilityElementSelector($2);
</ins><span class="cx"> }
</span><span class="cx"> | ':' ':' IDENT {
</span><span class="cx"> $$ = CSSParserSelector::parsePseudoElementSelector($3);
</span><span class="lines">@@ -1224,8 +1218,7 @@
</span><span class="cx"> auto selector = std::make_unique<CSSParserSelector>();
</span><span class="cx"> selector->setMatch(CSSSelector::PseudoClass);
</span><span class="cx"> selector->adoptSelectorVector(*std::unique_ptr<Vector<std::unique_ptr<CSSParserSelector>>>($4));
</span><del>- $2.lower();
- selector->setPseudoTypeValue($2);
</del><ins>+ selector->setPseudoClassValue($2);
</ins><span class="cx"> if (selector->pseudoType() == CSSSelector::PseudoAny)
</span><span class="cx"> $$ = selector.release();
</span><span class="cx"> }
</span><span class="lines">@@ -1236,7 +1229,7 @@
</span><span class="cx"> auto selector = std::make_unique<CSSParserSelector>();
</span><span class="cx"> selector->setMatch(CSSSelector::PseudoClass);
</span><span class="cx"> selector->setArgument($4);
</span><del>- selector->setPseudoTypeValue($2);
</del><ins>+ selector->setPseudoClassValue($2);
</ins><span class="cx"> if (selector->pseudoType() != CSSSelector::PseudoUnknown)
</span><span class="cx"> $$ = selector.release();
</span><span class="cx"> }
</span><span class="lines">@@ -1246,7 +1239,7 @@
</span><span class="cx"> auto selector = std::make_unique<CSSParserSelector>();
</span><span class="cx"> selector->setMatch(CSSSelector::PseudoClass);
</span><span class="cx"> selector->setArgument(AtomicString::number($4 * $5));
</span><del>- selector->setPseudoTypeValue($2);
</del><ins>+ selector->setPseudoClassValue($2);
</ins><span class="cx"> if (selector->pseudoType() != CSSSelector::PseudoUnknown)
</span><span class="cx"> $$ = selector.release();
</span><span class="cx"> }
</span><span class="lines">@@ -1255,8 +1248,7 @@
</span><span class="cx"> auto selector = std::make_unique<CSSParserSelector>();
</span><span class="cx"> selector->setMatch(CSSSelector::PseudoClass);
</span><span class="cx"> selector->setArgument($4);
</span><del>- $2.lower();
- selector->setPseudoTypeValue($2);
</del><ins>+ selector->setPseudoClassValue($2);
</ins><span class="cx"> CSSSelector::PseudoType type = selector->pseudoType();
</span><span class="cx"> if (type == CSSSelector::PseudoUnknown)
</span><span class="cx"> selector = nullptr;
</span><span class="lines">@@ -1280,9 +1272,7 @@
</span><span class="cx"> Vector<std::unique_ptr<CSSParserSelector>> selectorVector;
</span><span class="cx"> selectorVector.append(std::move(selector));
</span><span class="cx"> $$->adoptSelectorVector(selectorVector);
</span><del>-
- $2.lower();
- $$->setPseudoTypeValue($2);
</del><ins>+ $$->setPseudoClassValue($2);
</ins><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx"> ;
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSParserValuescpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSParserValues.cpp (166446 => 166447)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSParserValues.cpp        2014-03-29 02:46:45 UTC (rev 166446)
+++ trunk/Source/WebCore/css/CSSParserValues.cpp        2014-03-29 03:08:59 UTC (rev 166447)
</span><span class="lines">@@ -203,6 +203,26 @@
</span><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="cx">
</span><ins>+CSSParserSelector* CSSParserSelector::parsePseudoClassAndCompatibilityElementSelector(CSSParserString& pseudoTypeString)
+{
+ PseudoClassOrCompatibilityPseudoElement pseudoType = parsePseudoClassAndCompatibilityElementString(pseudoTypeString);
+ if (pseudoType.pseudoClass != CSSSelector::PseudoUnknown) {
+ auto selector = std::make_unique<CSSParserSelector>();
+ selector->m_selector->m_match = CSSSelector::PseudoClass;
+ selector->m_selector->m_pseudoType = pseudoType.pseudoClass;
+ return selector.release();
+ }
+ if (pseudoType.compatibilityPseudoElement != CSSSelector::PseudoUnknown) {
+ auto selector = std::make_unique<CSSParserSelector>();
+ selector->m_selector->m_match = CSSSelector::PseudoElement;
+ selector->m_selector->m_pseudoType = pseudoType.compatibilityPseudoElement;
+ AtomicString name = pseudoTypeString;
+ selector->m_selector->setValue(name);
+ return selector.release();
+ }
+ return nullptr;
+}
+
</ins><span class="cx"> CSSParserSelector::CSSParserSelector()
</span><span class="cx"> : m_selector(std::make_unique<CSSSelector>())
</span><span class="cx"> {
</span><span class="lines">@@ -235,112 +255,12 @@
</span><span class="cx"> m_selector->setSelectorList(std::move(selectorList));
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void CSSParserSelector::setPseudoTypeValue(const CSSParserString& pseudoTypeString)
</del><ins>+void CSSParserSelector::setPseudoClassValue(const CSSParserString& pseudoClassString)
</ins><span class="cx"> {
</span><del>- AtomicString name = pseudoTypeString;
- m_selector->setValue(name);
</del><ins>+ ASSERT(m_selector->m_match == CSSSelector::PseudoClass);
</ins><span class="cx">
</span><del>- CSSSelector::PseudoType pseudoType = parsePseudoTypeString(*name.impl());
- bool isCompatibilityElementType = false; // single colon compatbility mode
-
- switch (pseudoType) {
- case CSSSelector::PseudoAfter:
- case CSSSelector::PseudoBefore:
- case CSSSelector::PseudoFirstLetter:
- case CSSSelector::PseudoFirstLine:
- isCompatibilityElementType = true;
- break;
- case CSSSelector::PseudoUnknown:
- case CSSSelector::PseudoEmpty:
- case CSSSelector::PseudoFirstChild:
- case CSSSelector::PseudoFirstOfType:
- case CSSSelector::PseudoLastChild:
- case CSSSelector::PseudoLastOfType:
- case CSSSelector::PseudoOnlyChild:
- case CSSSelector::PseudoOnlyOfType:
- case CSSSelector::PseudoNthChild:
- case CSSSelector::PseudoNthOfType:
- case CSSSelector::PseudoNthLastChild:
- case CSSSelector::PseudoNthLastOfType:
- case CSSSelector::PseudoLink:
- case CSSSelector::PseudoVisited:
- case CSSSelector::PseudoAny:
- case CSSSelector::PseudoAnyLink:
- case CSSSelector::PseudoAutofill:
- case CSSSelector::PseudoHover:
- case CSSSelector::PseudoDrag:
- case CSSSelector::PseudoFocus:
- case CSSSelector::PseudoActive:
- case CSSSelector::PseudoChecked:
- case CSSSelector::PseudoEnabled:
- case CSSSelector::PseudoFullPageMedia:
- case CSSSelector::PseudoDefault:
- case CSSSelector::PseudoDisabled:
- case CSSSelector::PseudoOptional:
- case CSSSelector::PseudoRequired:
- case CSSSelector::PseudoReadOnly:
- case CSSSelector::PseudoReadWrite:
- case CSSSelector::PseudoScope:
- case CSSSelector::PseudoValid:
- case CSSSelector::PseudoInvalid:
- case CSSSelector::PseudoIndeterminate:
- case CSSSelector::PseudoTarget:
- case CSSSelector::PseudoLang:
- case CSSSelector::PseudoNot:
- case CSSSelector::PseudoRoot:
- case CSSSelector::PseudoScrollbarBack:
- case CSSSelector::PseudoScrollbarForward:
- case CSSSelector::PseudoWindowInactive:
- case CSSSelector::PseudoCornerPresent:
- case CSSSelector::PseudoDecrement:
- case CSSSelector::PseudoIncrement:
- case CSSSelector::PseudoHorizontal:
- case CSSSelector::PseudoVertical:
- case CSSSelector::PseudoStart:
- case CSSSelector::PseudoEnd:
- case CSSSelector::PseudoDoubleButton:
- case CSSSelector::PseudoSingleButton:
- case CSSSelector::PseudoNoButton:
-#if ENABLE(FULLSCREEN_API)
- case CSSSelector::PseudoFullScreen:
- case CSSSelector::PseudoFullScreenDocument:
- case CSSSelector::PseudoFullScreenAncestor:
- case CSSSelector::PseudoAnimatingFullScreenTransition:
-#endif
- case CSSSelector::PseudoInRange:
- case CSSSelector::PseudoOutOfRange:
-#if ENABLE(VIDEO_TRACK)
- case CSSSelector::PseudoFuture:
- case CSSSelector::PseudoPast:
-#endif
- break;
-#if ENABLE(VIDEO_TRACK)
- case CSSSelector::PseudoCue:
-#endif
- case CSSSelector::PseudoResizer:
- case CSSSelector::PseudoScrollbar:
- case CSSSelector::PseudoScrollbarCorner:
- case CSSSelector::PseudoScrollbarButton:
- case CSSSelector::PseudoScrollbarThumb:
- case CSSSelector::PseudoScrollbarTrack:
- case CSSSelector::PseudoScrollbarTrackPiece:
- case CSSSelector::PseudoSelection:
- case CSSSelector::PseudoUserAgentCustomElement:
- case CSSSelector::PseudoWebKitCustomElement:
-
- case CSSSelector::PseudoFirst:
- case CSSSelector::PseudoLeft:
- case CSSSelector::PseudoRight:
- ASSERT_NOT_REACHED();
- break;
- }
-
- unsigned matchType = m_selector->m_match;
- if (isCompatibilityElementType)
- matchType = CSSSelector::PseudoElement;
-
- m_selector->m_match = matchType;
- m_selector->m_pseudoType = pseudoType;
</del><ins>+ PseudoClassOrCompatibilityPseudoElement pseudoType = parsePseudoClassAndCompatibilityElementString(pseudoClassString);
+ m_selector->m_pseudoType = pseudoType.pseudoClass;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> bool CSSParserSelector::isSimple() const
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSParserValuesh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSParserValues.h (166446 => 166447)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSParserValues.h        2014-03-29 02:46:45 UTC (rev 166446)
+++ trunk/Source/WebCore/css/CSSParserValues.h        2014-03-29 03:08:59 UTC (rev 166447)
</span><span class="lines">@@ -178,6 +178,7 @@
</span><span class="cx"> static CSSParserSelector* parsePagePseudoSelector(const CSSParserString& pseudoTypeString);
</span><span class="cx"> static CSSParserSelector* parsePseudoElementSelector(CSSParserString& pseudoTypeString);
</span><span class="cx"> static CSSParserSelector* parsePseudoCueFunctionSelector(const CSSParserString& functionIdentifier, Vector<std::unique_ptr<CSSParserSelector>>* selectorVector);
</span><ins>+ static CSSParserSelector* parsePseudoClassAndCompatibilityElementSelector(CSSParserString& pseudoTypeString);
</ins><span class="cx">
</span><span class="cx"> CSSParserSelector();
</span><span class="cx"> explicit CSSParserSelector(const QualifiedName&);
</span><span class="lines">@@ -195,7 +196,7 @@
</span><span class="cx">
</span><span class="cx"> void adoptSelectorVector(Vector<std::unique_ptr<CSSParserSelector>>& selectorVector);
</span><span class="cx">
</span><del>- void setPseudoTypeValue(const CSSParserString& pseudoTypeString);
</del><ins>+ void setPseudoClassValue(const CSSParserString& pseudoClassString);
</ins><span class="cx"> CSSSelector::PseudoType pseudoType() const { return m_selector->pseudoType(); }
</span><span class="cx"> bool isCustomPseudoElement() const { return m_selector->isCustomPseudoElement(); }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSSelectorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSSelector.cpp (166446 => 166447)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSSelector.cpp        2014-03-29 02:46:45 UTC (rev 166446)
+++ trunk/Source/WebCore/css/CSSSelector.cpp        2014-03-29 03:08:59 UTC (rev 166447)
</span><span class="lines">@@ -294,14 +294,9 @@
</span><span class="cx"> return true;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static void appendPseudoTypeTailIfNecessary(StringBuilder& str, const CSSSelector* selector)
</del><ins>+static void appendPseudoClassFunctionTail(StringBuilder& str, const CSSSelector* selector)
</ins><span class="cx"> {
</span><span class="cx"> switch (selector->pseudoType()) {
</span><del>- case CSSSelector::PseudoNot:
- if (const CSSSelectorList* selectorList = selector->selectorList())
- str.append(selectorList->first()->selectorText());
- str.append(')');
- break;
</del><span class="cx"> case CSSSelector::PseudoLang:
</span><span class="cx"> case CSSSelector::PseudoNthChild:
</span><span class="cx"> case CSSSelector::PseudoNthLastChild:
</span><span class="lines">@@ -310,19 +305,10 @@
</span><span class="cx"> str.append(selector->argument());
</span><span class="cx"> str.append(')');
</span><span class="cx"> break;
</span><del>- case CSSSelector::PseudoAny: {
- const CSSSelector* firstSubSelector = selector->selectorList()->first();
- for (const CSSSelector* subSelector = firstSubSelector; subSelector; subSelector = CSSSelectorList::next(subSelector)) {
- if (subSelector != firstSubSelector)
- str.append(',');
- str.append(subSelector->selectorText());
- }
- str.append(')');
- break;
- }
</del><span class="cx"> default:
</span><span class="cx"> break;
</span><span class="cx"> }
</span><ins>+
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> String CSSSelector::selectorText(const String& rightSide) const
</span><span class="lines">@@ -347,22 +333,202 @@
</span><span class="cx"> } else if (cs->m_match == CSSSelector::Class) {
</span><span class="cx"> str.append('.');
</span><span class="cx"> serializeIdentifier(cs->value(), str);
</span><del>- } else if (cs->m_match == CSSSelector::PseudoClass || cs->m_match == CSSSelector::PagePseudoClass) {
</del><ins>+ } else if (cs->m_match == CSSSelector::PseudoClass) {
</ins><span class="cx"> switch (cs->pseudoType()) {
</span><del>- case PseudoFirst:
- str.appendLiteral(":first");
</del><ins>+#if ENABLE(FULLSCREEN_API)
+ case CSSSelector::PseudoAnimatingFullScreenTransition:
+ str.appendLiteral(":-webkit-animating-full-screen-transition");
</ins><span class="cx"> break;
</span><del>- case PseudoLeft:
- str.appendLiteral(":left");
</del><ins>+#endif
+ case CSSSelector::PseudoAny: {
+ str.appendLiteral(":-webkit-any(");
+ const CSSSelector* firstSubSelector = cs->selectorList()->first();
+ for (const CSSSelector* subSelector = firstSubSelector; subSelector; subSelector = CSSSelectorList::next(subSelector)) {
+ if (subSelector != firstSubSelector)
+ str.append(',');
+ str.append(subSelector->selectorText());
+ }
+ str.append(')');
</ins><span class="cx"> break;
</span><del>- case PseudoRight:
- str.appendLiteral(":right");
</del><ins>+ }
+ case CSSSelector::PseudoAnyLink:
+ str.appendLiteral(":-webkit-any-link");
</ins><span class="cx"> break;
</span><ins>+ case CSSSelector::PseudoAutofill:
+ str.appendLiteral(":-webkit-autofill");
+ break;
+ case CSSSelector::PseudoDrag:
+ str.appendLiteral(":-webkit-drag");
+ break;
+ case CSSSelector::PseudoFullPageMedia:
+ str.appendLiteral(":-webkit-full-page-media");
+ break;
+#if ENABLE(FULLSCREEN_API)
+ case CSSSelector::PseudoFullScreen:
+ str.appendLiteral(":-webkit-full-screen");
+ break;
+ case CSSSelector::PseudoFullScreenAncestor:
+ str.appendLiteral(":-webkit-full-screen-ancestor");
+ break;
+ case CSSSelector::PseudoFullScreenDocument:
+ str.appendLiteral(":-webkit-full-screen-document");
+ break;
+#endif
+ case CSSSelector::PseudoActive:
+ str.appendLiteral(":active");
+ break;
+ case CSSSelector::PseudoChecked:
+ str.appendLiteral(":checked");
+ break;
+ case CSSSelector::PseudoCornerPresent:
+ str.appendLiteral(":corner-present");
+ break;
+ case CSSSelector::PseudoDecrement:
+ str.appendLiteral(":decrement");
+ break;
+ case CSSSelector::PseudoDefault:
+ str.appendLiteral(":default");
+ break;
+ case CSSSelector::PseudoDisabled:
+ str.appendLiteral(":disabled");
+ break;
+ case CSSSelector::PseudoDoubleButton:
+ str.appendLiteral(":double-button");
+ break;
+ case CSSSelector::PseudoEmpty:
+ str.appendLiteral(":empty");
+ break;
+ case CSSSelector::PseudoEnabled:
+ str.appendLiteral(":enabled");
+ break;
+ case CSSSelector::PseudoEnd:
+ str.appendLiteral(":end");
+ break;
+ case CSSSelector::PseudoFirstChild:
+ str.appendLiteral(":first-child");
+ break;
+ case CSSSelector::PseudoFirstOfType:
+ str.appendLiteral(":first-of-type");
+ break;
+ case CSSSelector::PseudoFocus:
+ str.appendLiteral(":focus");
+ break;
+#if ENABLE(VIDEO_TRACK)
+ case CSSSelector::PseudoFuture:
+ str.appendLiteral(":future");
+ break;
+#endif
+ case CSSSelector::PseudoHorizontal:
+ str.appendLiteral(":horizontal");
+ break;
+ case CSSSelector::PseudoHover:
+ str.appendLiteral(":hover");
+ break;
+ case CSSSelector::PseudoInRange:
+ str.appendLiteral(":in-range");
+ break;
+ case CSSSelector::PseudoIncrement:
+ str.appendLiteral(":increment");
+ break;
+ case CSSSelector::PseudoIndeterminate:
+ str.appendLiteral(":indeterminate");
+ break;
+ case CSSSelector::PseudoInvalid:
+ str.appendLiteral(":invalid");
+ break;
+ case CSSSelector::PseudoLang:
+ str.appendLiteral(":lang(");
+ appendPseudoClassFunctionTail(str, cs);
+ break;
+ case CSSSelector::PseudoLastChild:
+ str.appendLiteral(":last-child");
+ break;
+ case CSSSelector::PseudoLastOfType:
+ str.appendLiteral(":last-of-type");
+ break;
+ case CSSSelector::PseudoLink:
+ str.appendLiteral(":link");
+ break;
+ case CSSSelector::PseudoNoButton:
+ str.appendLiteral(":no-button");
+ break;
+ case CSSSelector::PseudoNot:
+ str.appendLiteral(":not(");
+ if (const CSSSelectorList* selectorList = cs->selectorList())
+ str.append(selectorList->first()->selectorText());
+ str.append(')');
+ break;
+ case CSSSelector::PseudoNthChild:
+ str.appendLiteral(":nth-child(");
+ appendPseudoClassFunctionTail(str, cs);
+ break;
+ case CSSSelector::PseudoNthLastChild:
+ str.appendLiteral(":nth-last-child(");
+ appendPseudoClassFunctionTail(str, cs);
+ break;
+ case CSSSelector::PseudoNthLastOfType:
+ str.appendLiteral(":nth-last-of-type(");
+ appendPseudoClassFunctionTail(str, cs);
+ break;
+ case CSSSelector::PseudoNthOfType:
+ str.appendLiteral(":nth-of-type(");
+ appendPseudoClassFunctionTail(str, cs);
+ break;
+ case CSSSelector::PseudoOnlyChild:
+ str.appendLiteral(":only-child");
+ break;
+ case CSSSelector::PseudoOnlyOfType:
+ str.appendLiteral(":only-of-type");
+ break;
+ case CSSSelector::PseudoOptional:
+ str.appendLiteral(":optional");
+ break;
+ case CSSSelector::PseudoOutOfRange:
+ str.appendLiteral(":out-of-range");
+ break;
+#if ENABLE(VIDEO_TRACK)
+ case CSSSelector::PseudoPast:
+ str.appendLiteral(":past");
+ break;
+#endif
+ case CSSSelector::PseudoReadOnly:
+ str.appendLiteral(":read-only");
+ break;
+ case CSSSelector::PseudoReadWrite:
+ str.appendLiteral(":read-write");
+ break;
+ case CSSSelector::PseudoRequired:
+ str.appendLiteral(":required");
+ break;
+ case CSSSelector::PseudoRoot:
+ str.appendLiteral(":root");
+ break;
+ case CSSSelector::PseudoScope:
+ str.appendLiteral(":scope");
+ break;
+ case CSSSelector::PseudoSingleButton:
+ str.appendLiteral(":single-button");
+ break;
+ case CSSSelector::PseudoStart:
+ str.appendLiteral(":start");
+ break;
+ case CSSSelector::PseudoTarget:
+ str.appendLiteral(":target");
+ break;
+ case CSSSelector::PseudoValid:
+ str.appendLiteral(":valid");
+ break;
+ case CSSSelector::PseudoVertical:
+ str.appendLiteral(":vertical");
+ break;
+ case CSSSelector::PseudoVisited:
+ str.appendLiteral(":visited");
+ break;
+ case CSSSelector::PseudoWindowInactive:
+ str.appendLiteral(":window-inactive");
+ break;
</ins><span class="cx"> default:
</span><del>- str.append(':');
- str.append(cs->value());
- appendPseudoTypeTailIfNecessary(str, cs);
- break;
</del><ins>+ ASSERT_NOT_REACHED();
</ins><span class="cx"> }
</span><span class="cx"> } else if (cs->m_match == CSSSelector::PseudoElement) {
</span><span class="cx"> str.appendLiteral("::");
</span><span class="lines">@@ -405,7 +571,22 @@
</span><span class="cx"> serializeString(cs->value(), str);
</span><span class="cx"> str.append(']');
</span><span class="cx"> }
</span><ins>+ } else if (cs->m_match == CSSSelector::PagePseudoClass) {
+ switch (cs->pseudoType()) {
+ case PseudoFirst:
+ str.appendLiteral(":first");
+ break;
+ case PseudoLeft:
+ str.appendLiteral(":left");
+ break;
+ case PseudoRight:
+ str.appendLiteral(":right");
+ break;
+ default:
+ ASSERT_NOT_REACHED();
+ }
</ins><span class="cx"> }
</span><ins>+
</ins><span class="cx"> if (cs->relation() != CSSSelector::SubSelector || !cs->tagHistory())
</span><span class="cx"> break;
</span><span class="cx"> cs = cs->tagHistory();
</span></span></pre></div>
<a id="trunkSourceWebCorecssSelectorPseudoClassAndCompatibilityElementMapin"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/css/SelectorPseudoClassAndCompatibilityElementMap.in (0 => 166447)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/SelectorPseudoClassAndCompatibilityElementMap.in         (rev 0)
+++ trunk/Source/WebCore/css/SelectorPseudoClassAndCompatibilityElementMap.in        2014-03-29 03:08:59 UTC (rev 166447)
</span><span class="lines">@@ -0,0 +1,67 @@
</span><ins>+-khtml-drag
+-webkit-any(
+-webkit-any-link
+-webkit-autofill
+-webkit-drag
+-webkit-full-page-media
+active
+after, PseudoUnknown, PseudoAfter
+before, PseudoUnknown, PseudoBefore
+checked
+corner-present
+decrement
+default
+disabled
+double-button
+empty
+enabled
+end
+first-child
+first-letter, PseudoUnknown, PseudoFirstLetter
+first-line, PseudoUnknown, PseudoFirstLine
+first-of-type
+focus
+horizontal
+hover
+in-range
+increment
+indeterminate
+invalid
+lang(
+last-child
+last-of-type
+link
+no-button
+not(
+nth-child(
+nth-last-child(
+nth-last-of-type(
+nth-of-type(
+only-child
+only-of-type
+optional
+out-of-range
+read-only
+read-write
+required
+root
+scope
+single-button
+start
+target
+valid
+vertical
+visited
+window-inactive
+
+#if ENABLE(FULLSCREEN_API)
+-webkit-animating-full-screen-transition
+-webkit-full-screen
+-webkit-full-screen-ancestor
+-webkit-full-screen-document
+#endif
+
+#if ENABLE(VIDEO_TRACK)
+future
+past
+#endif
</ins></span></pre></div>
<a id="trunkSourceWebCorecssSelectorPseudoTypeMaph"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/SelectorPseudoTypeMap.h (166446 => 166447)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/SelectorPseudoTypeMap.h        2014-03-29 02:46:45 UTC (rev 166446)
+++ trunk/Source/WebCore/css/SelectorPseudoTypeMap.h        2014-03-29 03:08:59 UTC (rev 166447)
</span><span class="lines">@@ -31,7 +31,12 @@
</span><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><del>-CSSSelector::PseudoType parsePseudoTypeString(const StringImpl& pseudoTypeString);
</del><ins>+struct PseudoClassOrCompatibilityPseudoElement {
+ CSSSelector::PseudoType pseudoClass;
+ CSSSelector::PseudoType compatibilityPseudoElement;
+};
+
+PseudoClassOrCompatibilityPseudoElement parsePseudoClassAndCompatibilityElementString(const CSSParserString& pseudoTypeString);
</ins><span class="cx"> CSSSelector::PseudoType parsePseudoElementString(const StringImpl& pseudoTypeString);
</span><span class="cx">
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCorecssSelectorPseudoTypeMapin"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/css/SelectorPseudoTypeMap.in (166446 => 166447)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/SelectorPseudoTypeMap.in        2014-03-29 02:46:45 UTC (rev 166446)
+++ trunk/Source/WebCore/css/SelectorPseudoTypeMap.in        2014-03-29 03:08:59 UTC (rev 166447)
</span><span class="lines">@@ -1,67 +0,0 @@
</span><del>--khtml-drag
--webkit-any(
--webkit-any-link
--webkit-autofill
--webkit-drag
--webkit-full-page-media
-active
-after
-before
-checked
-corner-present
-decrement
-default
-disabled
-double-button
-empty
-enabled
-end
-first-child
-first-letter
-first-line
-first-of-type
-focus
-horizontal
-hover
-in-range
-increment
-indeterminate
-invalid
-lang(
-last-child
-last-of-type
-link
-no-button
-not(
-nth-child(
-nth-last-child(
-nth-last-of-type(
-nth-of-type(
-only-child
-only-of-type
-optional
-out-of-range
-read-only
-read-write
-required
-root
-scope
-single-button
-start
-target
-valid
-vertical
-visited
-window-inactive
-
-#if ENABLE(FULLSCREEN_API)
--webkit-animating-full-screen-transition
--webkit-full-screen
--webkit-full-screen-ancestor
--webkit-full-screen-document
-#endif
-
-#if ENABLE(VIDEO_TRACK)
-future
-past
-#endif
</del></span></pre></div>
<a id="trunkSourceWebCorecssmakeSelectorPseudoClassAndCompatibilityElementMappy"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/css/makeSelectorPseudoClassAndCompatibilityElementMap.py (0 => 166447)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/makeSelectorPseudoClassAndCompatibilityElementMap.py         (rev 0)
+++ trunk/Source/WebCore/css/makeSelectorPseudoClassAndCompatibilityElementMap.py        2014-03-29 03:08:59 UTC (rev 166447)
</span><span class="lines">@@ -0,0 +1,215 @@
</span><ins>+#!/usr/bin/env python
+#
+# Copyright (C) 2014 Apple Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+# THE POSSIBILITY OF SUCH DAMAGE.
+
+import os
+import sys
+
+
+def enumerablePseudoType(stringPseudoType):
+ output = ['CSSSelector::Pseudo']
+
+ if stringPseudoType.endswith('('):
+ stringPseudoType = stringPseudoType[:-1]
+
+ webkitPrefix = '-webkit-'
+ if (stringPseudoType.startswith(webkitPrefix)):
+ stringPseudoType = stringPseudoType[len(webkitPrefix):]
+
+ khtmlPrefix = '-khtml-'
+ if (stringPseudoType.startswith(khtmlPrefix)):
+ stringPseudoType = stringPseudoType[len(khtmlPrefix):]
+
+ substring_start = 0
+ next_dash_position = stringPseudoType.find('-')
+ while (next_dash_position != -1):
+ output.append(stringPseudoType[substring_start].upper())
+ output.append(stringPseudoType[substring_start + 1:next_dash_position])
+ substring_start = next_dash_position + 1
+ next_dash_position = stringPseudoType.find('-', substring_start)
+
+ output.append(stringPseudoType[substring_start].upper())
+ output.append(stringPseudoType[substring_start + 1:])
+ return ''.join(output)
+
+
+def expand_ifdef_condition(condition):
+ return condition.replace('(', '_').replace(')', '')
+
+output_file = open('SelectorPseudoClassAndCompatibilityElementMap.gperf', 'w')
+
+output_file.write("""
+%{
+/*
+ * Copyright (C) 2014 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+// This file is automatically generated from SelectorPseudoTypeMap.in by makeprop, do not edit by hand.
+
+#include "config.h"
+#include "SelectorPseudoTypeMap.h"
+
+#if defined(__clang__)
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wunknown-pragmas"
+#pragma clang diagnostic ignored "-Wdeprecated-register"
+#pragma clang diagnostic ignored "-Wimplicit-fallthrough"
+#endif
+
+namespace WebCore {
+
+struct SelectorPseudoClassOrCompatibilityPseudoElementEntry {
+ const char* name;
+ PseudoClassOrCompatibilityPseudoElement pseudoTypes;
+};
+
+%}
+%struct-type
+%define initializer-suffix ,{CSSSelector::PseudoUnknown,CSSSelector::PseudoUnknown}
+%define class-name SelectorPseudoClassAndCompatibilityElementMapHash
+%omit-struct-type
+%language=C++
+%readonly-tables
+%global-table
+%ignore-case
+%compare-strncmp
+%enum
+
+struct SelectorPseudoClassOrCompatibilityPseudoElementEntry;
+
+%%
+""")
+
+webcore_defines = [i.strip() for i in sys.argv[-1].split(' ')]
+
+longest_keyword = 0
+
+ignore_until_endif = False
+input_file = open(sys.argv[1], 'r')
+for line in input_file:
+ line = line.strip()
+ if not line:
+ continue
+
+ if line.startswith('#if '):
+ condition = line[4:].strip()
+ if expand_ifdef_condition(condition) not in webcore_defines:
+ ignore_until_endif = True
+ continue
+
+ if line.startswith('#endif'):
+ ignore_until_endif = False
+ continue
+
+ if ignore_until_endif:
+ continue
+
+ keyword_definition = line.split(',')
+ if len(keyword_definition) == 1:
+ keyword = keyword_definition[0].strip()
+ output_file.write('"%s", {%s, CSSSelector::PseudoUnknown}\n' % (keyword, enumerablePseudoType(keyword)))
+ else:
+ output_file.write('"%s", {CSSSelector::%s, CSSSelector::%s}\n' % (keyword_definition[0].strip(), keyword_definition[1].strip(), keyword_definition[2].strip()))
+
+ longest_keyword = max(longest_keyword, len(keyword))
+
+output_file.write("""%%
+
+static inline const SelectorPseudoClassOrCompatibilityPseudoElementEntry* parsePseudoClassAndCompatibilityElementString(const LChar* characters, unsigned length)
+{
+ return SelectorPseudoClassAndCompatibilityElementMapHash::in_word_set(reinterpret_cast<const char*>(characters), length);
+}""")
+
+output_file.write("""
+
+static inline const SelectorPseudoClassOrCompatibilityPseudoElementEntry* parsePseudoClassAndCompatibilityElementString(const UChar* characters, unsigned length)
+{
+ const unsigned maxKeywordLength = %s;
+ LChar buffer[maxKeywordLength];
+ if (length > maxKeywordLength)
+ return nullptr;
+
+ for (unsigned i = 0; i < length; ++i) {
+ UChar character = characters[i];
+ if (character & ~0xff)
+ return nullptr;
+
+ buffer[i] = static_cast<LChar>(character);
+ }
+ return parsePseudoClassAndCompatibilityElementString(buffer, length);
+}
+""" % longest_keyword)
+
+output_file.write("""
+PseudoClassOrCompatibilityPseudoElement parsePseudoClassAndCompatibilityElementString(const CSSParserString& pseudoTypeString)
+{
+ const SelectorPseudoClassOrCompatibilityPseudoElementEntry* entry;
+ if (pseudoTypeString.is8Bit())
+ entry = parsePseudoClassAndCompatibilityElementString(pseudoTypeString.characters8(), pseudoTypeString.length());
+ else
+ entry = parsePseudoClassAndCompatibilityElementString(pseudoTypeString.characters16(), pseudoTypeString.length());
+
+ if (entry)
+ return entry->pseudoTypes;
+ return { CSSSelector::PseudoUnknown, CSSSelector::PseudoUnknown };
+}
+
+} // namespace WebCore
+
+#if defined(__clang__)
+#pragma clang diagnostic pop
+#endif
+
+""")
+output_file.close()
+
+gperf_command = 'gperf'
+if 'GPERF' in os.environ:
+ gperf_command = os.environ['GPERF']
+
+gperf_return = os.system("%s --key-positions='*' -m 10 -s 2 SelectorPseudoClassAndCompatibilityElementMap.gperf --output-file=SelectorPseudoClassAndCompatibilityElementMap.cpp" % gperf_command)
+if gperf_return != 0:
+ print("Error when generating SelectorPseudoClassAndCompatibilityElementMap.cpp from SelectorPseudoClassAndCompatibilityElementMap.gperf :(")
+ sys.exit(gperf_return)
</ins></span></pre></div>
<a id="trunkSourceWebCorecssmakeSelectorPseudoTypeMappy"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/css/makeSelectorPseudoTypeMap.py (166446 => 166447)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/makeSelectorPseudoTypeMap.py        2014-03-29 02:46:45 UTC (rev 166446)
+++ trunk/Source/WebCore/css/makeSelectorPseudoTypeMap.py        2014-03-29 03:08:59 UTC (rev 166447)
</span><span class="lines">@@ -1,205 +0,0 @@
</span><del>-#!/usr/bin/env python
-#
-# Copyright (C) 2014 Apple Inc. All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-# 1. Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-#
-# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
-# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
-# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
-# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
-# THE POSSIBILITY OF SUCH DAMAGE.
-
-import os
-import sys
-
-
-def enumerablePseudoType(stringPseudoType):
- output = ['CSSSelector::Pseudo']
-
- if stringPseudoType.endswith('('):
- stringPseudoType = stringPseudoType[:-1]
-
- webkitPrefix = '-webkit-'
- if (stringPseudoType.startswith(webkitPrefix)):
- stringPseudoType = stringPseudoType[len(webkitPrefix):]
-
- khtmlPrefix = '-khtml-'
- if (stringPseudoType.startswith(khtmlPrefix)):
- stringPseudoType = stringPseudoType[len(khtmlPrefix):]
-
- substring_start = 0
- next_dash_position = stringPseudoType.find('-')
- while (next_dash_position != -1):
- output.append(stringPseudoType[substring_start].upper())
- output.append(stringPseudoType[substring_start + 1:next_dash_position])
- substring_start = next_dash_position + 1
- next_dash_position = stringPseudoType.find('-', substring_start)
-
- output.append(stringPseudoType[substring_start].upper())
- output.append(stringPseudoType[substring_start + 1:])
- return ''.join(output)
-
-
-def expand_ifdef_condition(condition):
- return condition.replace('(', '_').replace(')', '')
-
-output_file = open('SelectorPseudoTypeMap.gperf', 'w')
-
-output_file.write("""
-%{
-/*
- * Copyright (C) 2014 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-// This file is automatically generated from SelectorPseudoTypeMap.in by makeprop, do not edit by hand.
-
-#include "config.h"
-#include "SelectorPseudoTypeMap.h"
-
-#if defined(__clang__)
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wunknown-pragmas"
-#pragma clang diagnostic ignored "-Wdeprecated-register"
-#pragma clang diagnostic ignored "-Wimplicit-fallthrough"
-#endif
-
-namespace WebCore {
-
-struct SelectorPseudoTypeEntry {
- const char* name;
- CSSSelector::PseudoType type;
-};
-
-%}
-%struct-type
-%define initializer-suffix ,CSSSelector::PseudoUnknown
-%define class-name SelectorPseudoTypeMapHash
-%omit-struct-type
-%language=C++
-%readonly-tables
-%global-table
-%ignore-case
-%compare-strncmp
-%enum
-
-struct SelectorPseudoTypeEntry;
-
-%%
-""")
-
-webcore_defines = [i.strip() for i in sys.argv[-1].split(' ')]
-
-longest_keyword = 0
-
-ignore_until_endif = False
-input_file = open(sys.argv[1], 'r')
-for line in input_file:
- keyword = line.strip()
- if not keyword:
- continue
-
- if keyword.startswith('#if '):
- condition = keyword[4:].strip()
- if expand_ifdef_condition(condition) not in webcore_defines:
- ignore_until_endif = True
- continue
-
- if keyword.startswith('#endif'):
- ignore_until_endif = False
- continue
-
- if ignore_until_endif:
- continue
-
- output_file.write('"%s", %s\n' % (keyword, enumerablePseudoType(keyword)))
- longest_keyword = max(longest_keyword, len(keyword))
-
-output_file.write("""%%
-
-static inline CSSSelector::PseudoType parsePseudoTypeString(const LChar* characters, unsigned length)
-{
- if (const SelectorPseudoTypeEntry* entry = SelectorPseudoTypeMapHash::in_word_set(reinterpret_cast<const char*>(characters), length))
- return entry->type;
- return CSSSelector::PseudoUnknown;
-}""")
-
-output_file.write("""
-
-static inline CSSSelector::PseudoType parsePseudoTypeString(const UChar* characters, unsigned length)
-{
- const unsigned maxKeywordLength = %s;
- LChar buffer[maxKeywordLength];
- if (length > maxKeywordLength)
- return CSSSelector::PseudoUnknown;
-
- for (unsigned i = 0; i < length; ++i) {
- UChar character = characters[i];
- if (character & ~0xff)
- return CSSSelector::PseudoUnknown;
-
- buffer[i] = static_cast<LChar>(character);
- }
- return parsePseudoTypeString(buffer, length);
-}
-""" % longest_keyword)
-
-output_file.write("""
-CSSSelector::PseudoType parsePseudoTypeString(const StringImpl& pseudoTypeString)
-{
- if (pseudoTypeString.is8Bit())
- return parsePseudoTypeString(pseudoTypeString.characters8(), pseudoTypeString.length());
- return parsePseudoTypeString(pseudoTypeString.characters16(), pseudoTypeString.length());
-}
-
-} // namespace WebCore
-
-#if defined(__clang__)
-#pragma clang diagnostic pop
-#endif
-
-""")
-output_file.close()
-
-gperf_command = 'gperf'
-if 'GPERF' in os.environ:
- gperf_command = os.environ['GPERF']
-
-gperf_return = os.system("%s --key-positions='*' -m 10 -s 2 SelectorPseudoTypeMap.gperf --output-file=SelectorPseudoTypeMap.cpp" % gperf_command)
-if gperf_return != 0:
- print("Error when generating SelectorPseudoTypeMap.cpp from SelectorPseudoTypeMap.gperf :(")
- sys.exit(gperf_return)
</del></span></pre>
</div>
</div>
</body>
</html>