<!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>[176902] trunk</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/176902">176902</a></dd>
<dt>Author</dt> <dd>commit-queue@webkit.org</dd>
<dt>Date</dt> <dd>2014-12-05 21:09:11 -0800 (Fri, 05 Dec 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>Implement parser for :lang pseudo class selector arguments that contain wildcard '*' subtags
https://bugs.webkit.org/show_bug.cgi?id=139014

Patch by Dhi Aurrahman &lt;diorahman@rockybars.com&gt; on 2014-12-05
Reviewed by Benjamin Poulain.

Source/WebCore:

Consider each language range in :lang() that consists of an asterisk
immediately followed by an identifier beginning with an ASCII hyphen
as a valid input for the selector as specified in [1].

[1] http://dev.w3.org/csswg/selectors4/#the-lang-pseudo

Test: fast/css/parsing-css-lang.html

* css/CSSGrammar.y.in:
* css/CSSParser.cpp:
(WebCore::CSSParser::realLex):

LayoutTests:

* fast/css/css-selector-text-expected.txt: Updated for asterisk containing input.
* fast/css/css-selector-text.html: Updated for asterisk containing input.
* fast/css/parsing-css-lang-expected.txt: Added.
* fast/css/parsing-css-lang.html: Added.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsfastcsscssselectortextexpectedtxt">trunk/LayoutTests/fast/css/css-selector-text-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastcsscssselectortexthtml">trunk/LayoutTests/fast/css/css-selector-text.html</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorecssCSSGrammaryin">trunk/Source/WebCore/css/CSSGrammar.y.in</a></li>
<li><a href="#trunkSourceWebCorecssCSSParsercpp">trunk/Source/WebCore/css/CSSParser.cpp</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsfastcssparsingcsslangexpectedtxt">trunk/LayoutTests/fast/css/parsing-css-lang-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastcssparsingcsslanghtml">trunk/LayoutTests/fast/css/parsing-css-lang.html</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (176901 => 176902)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2014-12-06 02:04:13 UTC (rev 176901)
+++ trunk/LayoutTests/ChangeLog        2014-12-06 05:09:11 UTC (rev 176902)
</span><span class="lines">@@ -1,3 +1,15 @@
</span><ins>+2014-12-05  Dhi Aurrahman  &lt;diorahman@rockybars.com&gt;
+
+        Implement parser for :lang pseudo class selector arguments that contain wildcard '*' subtags
+        https://bugs.webkit.org/show_bug.cgi?id=139014
+
+        Reviewed by Benjamin Poulain.
+
+        * fast/css/css-selector-text-expected.txt: Updated for asterisk containing input.
+        * fast/css/css-selector-text.html: Updated for asterisk containing input.
+        * fast/css/parsing-css-lang-expected.txt: Added.
+        * fast/css/parsing-css-lang.html: Added.
+
</ins><span class="cx"> 2014-12-05  Benjamin Poulain  &lt;bpoulain@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Fix style sharing with the &quot;type&quot; and &quot;readonly&quot; attributes
</span></span></pre></div>
<a id="trunkLayoutTestsfastcsscssselectortextexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/css/css-selector-text-expected.txt (176901 => 176902)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/css-selector-text-expected.txt        2014-12-06 02:04:13 UTC (rev 176901)
+++ trunk/LayoutTests/fast/css/css-selector-text-expected.txt        2014-12-06 05:09:11 UTC (rev 176902)
</span><span class="lines">@@ -47,6 +47,16 @@
</span><span class="cx"> PASS parseThenSerializeRule(':target { }') is ':target { }'
</span><span class="cx"> PASS parseThenSerializeRule(':visited { }') is ':visited { }'
</span><span class="cx"> 
</span><ins>+PASS parseThenSerializeRule(':lang(*-) { }') is ':lang(*-) { }'
+PASS parseThenSerializeRule(':lang(*--) { }') is ':lang(*--) { }'
+PASS parseThenSerializeRule(':lang(*---) { }') is ':lang(*---) { }'
+PASS parseThenSerializeRule(':lang(*----) { }') is ':lang(*----) { }'
+
+PASS parseThenSerializeRule(':lang(*-ab) { }') is ':lang(*-ab) { }'
+PASS parseThenSerializeRule(':lang(*-ab-) { }') is ':lang(*-ab-) { }'
+PASS parseThenSerializeRule(':lang(*-1996) { }') is ':lang(*-1996) { }'
+PASS parseThenSerializeRule(':lang(*-DE-1996) { }') is ':lang(*-DE-1996) { }'
+
</ins><span class="cx"> PASS parseThenSerializeRule(':lang(a) { }') is ':lang(a) { }'
</span><span class="cx"> PASS parseThenSerializeRule(':lang(a, b, c) { }') is ':lang(a, b, c) { }'
</span><span class="cx"> PASS parseThenSerializeRule(':lang(fr, de, en, id) { }') is ':lang(fr, de, en, id) { }'
</span><span class="lines">@@ -294,6 +304,76 @@
</span><span class="cx"> PASS parseThenSerializeRule(':lang(    en    ,    en    ,   en    ) { }') is ':lang(en, en, en) { }'
</span><span class="cx"> PASS parseThenSerializeRule(':lang(    en,en,en    ) { }') is ':lang(en, en, en) { }'
</span><span class="cx"> 
</span><ins>+PASS parseThenSerializeRule(':lang(*-DE, *-CH, *-EN) { }') is ':lang(*-DE, *-CH, *-EN) { }'
+PASS parseThenSerializeRule(':lang(*-DE,*-CH,*-EN) { }') is ':lang(*-DE, *-CH, *-EN) { }'
+PASS parseThenSerializeRule(':lang(   *-DE  ,  *-CH  ,  *-EN  ) { }') is ':lang(*-DE, *-CH, *-EN) { }'
+
+PASS parseThenSerializeRule(':lang(\\*) { }') is ':lang(*) { }'
+PASS parseThenSerializeRule(':lang(*-\\*) { }') is ':lang(*-*) { }'
+PASS parseThenSerializeRule(':lang(*-\\*-\\*) { }') is ':lang(*-*-*) { }'
+PASS parseThenSerializeRule(':lang(*-\\*-\\*-\\*) { }') is ':lang(*-*-*-*) { }'
+
+PASS parseThenSerializeRule(':lang(ab-\\*) { }') is ':lang(ab-*) { }'
+PASS parseThenSerializeRule(':lang(*-ab-\\*) { }') is ':lang(*-ab-*) { }'
+PASS parseThenSerializeRule(':lang(*-ab-\\*-) { }') is ':lang(*-ab-*-) { }'
+PASS parseThenSerializeRule(':lang(*-foo-\\3A) { }') is ':lang(*-foo-:) { }'
+PASS parseThenSerializeRule(':lang(*-foo-\\3A\\`\\)) { }') is ':lang(*-foo-:`)) { }'
+PASS parseThenSerializeRule(':lang(*-foo-\\*) { }') is ':lang(*-foo-*) { }'
+PASS parseThenSerializeRule(':lang(*-foo-\\0072 aisin) { }') is ':lang(*-foo-raisin) { }'
+PASS parseThenSerializeRule(':lang(*-foo-\\0062 \\0061 r) { }') is ':lang(*-foo-bar) { }'
+PASS parseThenSerializeRule(':lang(*-foo-col\\6Fr) { }') is ':lang(*-foo-color) { }'
+
+PASS parseThenSerializeRule(':lang(\\*    ) { }') is ':lang(*) { }'
+PASS parseThenSerializeRule(':lang(*-    ) { }') is ':lang(*-) { }'
+PASS parseThenSerializeRule(':lang(*-en    ) { }') is ':lang(*-en) { }'
+PASS parseThenSerializeRule(':lang(*-en-\\*    ) { }') is ':lang(*-en-*) { }'
+PASS parseThenSerializeRule(':lang(*-en-\\*-fr    ) { }') is ':lang(*-en-*-fr) { }'
+PASS parseThenSerializeRule(':lang(*-en-\\*-fr,br    ) { }') is ':lang(*-en-*-fr, br) { }'
+PASS parseThenSerializeRule(':lang(*-en-\\*-fr, br    ) { }') is ':lang(*-en-*-fr, br) { }'
+PASS parseThenSerializeRule(':lang(*-en-\\*-fr,   br    ) { }') is ':lang(*-en-*-fr, br) { }'
+PASS parseThenSerializeRule(':lang(  *-en-\\*-fr,   br    ) { }') is ':lang(*-en-*-fr, br) { }'
+PASS parseThenSerializeRule(':lang(    *-en-\\*-fr,   br    ) { }') is ':lang(*-en-*-fr, br) { }'
+PASS parseThenSerializeRule(':lang(    *-en-\\*-fr  ,   br    ) { }') is ':lang(*-en-*-fr, br) { }'
+PASS parseThenSerializeRule(':lang(*-en-\\*-fr,*-br-zh    ) { }') is ':lang(*-en-*-fr, *-br-zh) { }'
+PASS parseThenSerializeRule(':lang(*-en-\\*-fr, *-br-zh    ) { }') is ':lang(*-en-*-fr, *-br-zh) { }'
+PASS parseThenSerializeRule(':lang(*-en-\\*-fr,   *-br-zh    ) { }') is ':lang(*-en-*-fr, *-br-zh) { }'
+PASS parseThenSerializeRule(':lang(*-en-\\*-fr,     *-br-zh    ) { }') is ':lang(*-en-*-fr, *-br-zh) { }'
+PASS parseThenSerializeRule(':lang(*-en-\\*-fr,       *-br-zh    ) { }') is ':lang(*-en-*-fr, *-br-zh) { }'
+
+PASS parseThenSerializeRule(':lang(*-en-\\*-fr,br-\\*-zh    ) { }') is ':lang(*-en-*-fr, br-*-zh) { }'
+PASS parseThenSerializeRule(':lang(*-en-\\*-fr, br-\\*-zh    ) { }') is ':lang(*-en-*-fr, br-*-zh) { }'
+PASS parseThenSerializeRule(':lang(*-en-\\*-fr,   br-\\*-zh    ) { }') is ':lang(*-en-*-fr, br-*-zh) { }'
+PASS parseThenSerializeRule(':lang(*-en-\\*-fr,      br-\\*-zh    ) { }') is ':lang(*-en-*-fr, br-*-zh) { }'
+PASS parseThenSerializeRule(':lang(  *-en-\\*-fr,      br-\\*-zh    ) { }') is ':lang(*-en-*-fr, br-*-zh) { }'
+PASS parseThenSerializeRule(':lang(  *-en-\\*-fr ,      br-\\*-zh    ) { }') is ':lang(*-en-*-fr, br-*-zh) { }'
+PASS parseThenSerializeRule(':lang(  *-en-\\*-fr  ,      br-\\*-zh    ) { }') is ':lang(*-en-*-fr, br-*-zh) { }'
+
+PASS parseThenSerializeRule(':lang(\\*) { }') is ':lang(*) { }'
+PASS parseThenSerializeRule(':lang(\\* ) { }') is ':lang(*) { }'
+PASS parseThenSerializeRule(':lang(\\*   ) { }') is ':lang(*) { }'
+PASS parseThenSerializeRule(':lang( \\*   ) { }') is ':lang(*) { }'
+PASS parseThenSerializeRule(':lang(  \\*) { }') is ':lang(*) { }'
+PASS parseThenSerializeRule(':lang(   \\*   ) { }') is ':lang(*) { }'
+
+PASS parseThenSerializeRule(':lang(   \\*,id-\\*-sumatra   ) { }') is ':lang(*, id-*-sumatra) { }'
+PASS parseThenSerializeRule(':lang(   \\* ,id-\\*-sumatra) { }') is ':lang(*, id-*-sumatra) { }'
+PASS parseThenSerializeRule(':lang(   \\*  ,  id-\\*-sumatra  ) { }') is ':lang(*, id-*-sumatra) { }'
+PASS parseThenSerializeRule(':lang(   \\*   ,    id-\\*-sumatra  ) { }') is ':lang(*, id-*-sumatra) { }'
+
+PASS parseThenSerializeRule(':lang(*-1996) { }') is ':lang(*-1996) { }'
+PASS parseThenSerializeRule(':lang(*-1996, *-1997) { }') is ':lang(*-1996, *-1997) { }'
+PASS parseThenSerializeRule(':lang(*-1996, *-1997 ) { }') is ':lang(*-1996, *-1997) { }'
+PASS parseThenSerializeRule(':lang(   *-1996   ,  *-1997   ) { }') is ':lang(*-1996, *-1997) { }'
+PASS parseThenSerializeRule(':lang(   *-1996   ,*-1997   ) { }') is ':lang(*-1996, *-1997) { }'
+PASS parseThenSerializeRule(':lang(   *-1996,*-1997   ) { }') is ':lang(*-1996, *-1997) { }'
+
+PASS parseThenSerializeRule(':lang(en-\\*) { }') is ':lang(en-*) { }'
+PASS parseThenSerializeRule(':lang(en-\\*, fr-\\*) { }') is ':lang(en-*, fr-*) { }'
+PASS parseThenSerializeRule(':lang(en-\\*, fr-\\* ) { }') is ':lang(en-*, fr-*) { }'
+PASS parseThenSerializeRule(':lang(   en-\\*   ,  fr-\\*   ) { }') is ':lang(en-*, fr-*) { }'
+PASS parseThenSerializeRule(':lang(   en-\\*   ,fr-\\*   ) { }') is ':lang(en-*, fr-*) { }'
+PASS parseThenSerializeRule(':lang(   en-\\*,fr-\\*   ) { }') is ':lang(en-*, fr-*) { }'
+
</ins><span class="cx"> PASS parseThenSerializeRule(':lang() { }') threw exception TypeError: undefined is not an object (evaluating 'styleElement.sheet.cssRules[0].cssText').
</span><span class="cx"> PASS parseThenSerializeRule(':lang(12, b, c) { }') threw exception TypeError: undefined is not an object (evaluating 'styleElement.sheet.cssRules[0].cssText').
</span><span class="cx"> PASS parseThenSerializeRule(':lang(a, 12, c) { }') threw exception TypeError: undefined is not an object (evaluating 'styleElement.sheet.cssRules[0].cssText').
</span><span class="lines">@@ -316,6 +396,27 @@
</span><span class="cx"> PASS parseThenSerializeRule(':lang([) { }') threw exception TypeError: undefined is not an object (evaluating 'styleElement.sheet.cssRules[0].cssText').
</span><span class="cx"> PASS parseThenSerializeRule(':lang([]) { }') threw exception TypeError: undefined is not an object (evaluating 'styleElement.sheet.cssRules[0].cssText').
</span><span class="cx"> PASS parseThenSerializeRule(':lang(@media screen {}) { }') threw exception TypeError: undefined is not an object (evaluating 'styleElement.sheet.cssRules[0].cssText').
</span><ins>+PASS parseThenSerializeRule(':lang(*)') threw exception TypeError: undefined is not an object (evaluating 'styleElement.sheet.cssRules[0].cssText').
+PASS parseThenSerializeRule(':lang(**)') threw exception TypeError: undefined is not an object (evaluating 'styleElement.sheet.cssRules[0].cssText').
+PASS parseThenSerializeRule(':lang(-*-)') threw exception TypeError: undefined is not an object (evaluating 'styleElement.sheet.cssRules[0].cssText').
+PASS parseThenSerializeRule(':lang(*-*) { }') threw exception TypeError: undefined is not an object (evaluating 'styleElement.sheet.cssRules[0].cssText').
+PASS parseThenSerializeRule(':lang(de-*)') threw exception TypeError: undefined is not an object (evaluating 'styleElement.sheet.cssRules[0].cssText').
+PASS parseThenSerializeRule(':lang(*-en-*) { }') threw exception TypeError: undefined is not an object (evaluating 'styleElement.sheet.cssRules[0].cssText').
+PASS parseThenSerializeRule(':lang(*-en-fr-*) { }') threw exception TypeError: undefined is not an object (evaluating 'styleElement.sheet.cssRules[0].cssText').
+PASS parseThenSerializeRule(':lang(*-en-*fr) { }') threw exception TypeError: undefined is not an object (evaluating 'styleElement.sheet.cssRules[0].cssText').
+PASS parseThenSerializeRule(':lang(*-*en-fr) { }') threw exception TypeError: undefined is not an object (evaluating 'styleElement.sheet.cssRules[0].cssText').
+PASS parseThenSerializeRule(':lang(*-1997)') threw exception TypeError: undefined is not an object (evaluating 'styleElement.sheet.cssRules[0].cssText').
+PASS parseThenSerializeRule(':lang(*-1997-*)') threw exception TypeError: undefined is not an object (evaluating 'styleElement.sheet.cssRules[0].cssText').
+PASS parseThenSerializeRule(':lang(*a*) { }') threw exception TypeError: undefined is not an object (evaluating 'styleElement.sheet.cssRules[0].cssText').
+PASS parseThenSerializeRule(':lang(*a) { }') threw exception TypeError: undefined is not an object (evaluating 'styleElement.sheet.cssRules[0].cssText').
+PASS parseThenSerializeRule(':lang(a*) { }') threw exception TypeError: undefined is not an object (evaluating 'styleElement.sheet.cssRules[0].cssText').
+PASS parseThenSerializeRule(':lang(*-a, a*) { }') threw exception TypeError: undefined is not an object (evaluating 'styleElement.sheet.cssRules[0].cssText').
+PASS parseThenSerializeRule(':lang(*-a, a**) { }') threw exception TypeError: undefined is not an object (evaluating 'styleElement.sheet.cssRules[0].cssText').
+PASS parseThenSerializeRule(':lang(*-a, *a) { }') threw exception TypeError: undefined is not an object (evaluating 'styleElement.sheet.cssRules[0].cssText').
+PASS parseThenSerializeRule(':lang(*-a, **a) { }') threw exception TypeError: undefined is not an object (evaluating 'styleElement.sheet.cssRules[0].cssText').
+PASS parseThenSerializeRule(':lang(*- a*) { }') threw exception TypeError: undefined is not an object (evaluating 'styleElement.sheet.cssRules[0].cssText').
+PASS parseThenSerializeRule(':lang(*-a, br fr) { }') threw exception TypeError: undefined is not an object (evaluating 'styleElement.sheet.cssRules[0].cssText').
+PASS parseThenSerializeRule(':lang(*-a, br fr en *) { }') threw exception TypeError: undefined is not an object (evaluating 'styleElement.sheet.cssRules[0].cssText').
</ins><span class="cx"> 
</span><span class="cx"> PASS parseThenSerializeRule(':role(a) { }') is ':role(a) { }'
</span><span class="cx"> PASS parseThenSerializeRule(':role(button) { }') is ':role(button) { }'
</span></span></pre></div>
<a id="trunkLayoutTestsfastcsscssselectortexthtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/css/css-selector-text.html (176901 => 176902)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/css-selector-text.html        2014-12-06 02:04:13 UTC (rev 176901)
+++ trunk/LayoutTests/fast/css/css-selector-text.html        2014-12-06 05:09:11 UTC (rev 176902)
</span><span class="lines">@@ -80,6 +80,20 @@
</span><span class="cx"> 
</span><span class="cx"> debug('');
</span><span class="cx"> 
</span><ins>+testSelectorRoundTrip(&quot;:lang(*-)&quot;);
+testSelectorRoundTrip(&quot;:lang(*--)&quot;);
+testSelectorRoundTrip(&quot;:lang(*---)&quot;);
+testSelectorRoundTrip(&quot;:lang(*----)&quot;);
+
+debug('');
+
+testSelectorRoundTrip(&quot;:lang(*-ab)&quot;);
+testSelectorRoundTrip(&quot;:lang(*-ab-)&quot;);
+testSelectorRoundTrip(&quot;:lang(*-1996)&quot;);
+testSelectorRoundTrip(&quot;:lang(*-DE-1996)&quot;);
+
+debug('');
+
</ins><span class="cx"> testSelectorRoundTrip(&quot;:lang(a)&quot;);
</span><span class="cx"> testSelectorRoundTrip(&quot;:lang(a, b, c)&quot;);
</span><span class="cx"> testSelectorRoundTrip(&quot;:lang(fr, de, en, id)&quot;);
</span><span class="lines">@@ -88,7 +102,7 @@
</span><span class="cx"> testSelectorRoundTrip(&quot;:lang(de-CH, it-CH, fr-CH, rm-CH)&quot;);
</span><span class="cx"> testSelectorRoundTrip(&quot;:lang(de-DE, de-DE-1996, de-Latn-DE, de-Latf-DE, de-Latn-DE-1996, de-CH, it-CH, fr-CH, rm-CH)&quot;);
</span><span class="cx"> 
</span><del>-debug('')
</del><ins>+debug('');
</ins><span class="cx"> 
</span><span class="cx"> testSelectorRoundTrip(&quot;:lang(a, a, a)&quot;);
</span><span class="cx"> testSelectorRoundTrip(&quot;:lang(en, en, en)&quot;);
</span><span class="lines">@@ -375,6 +389,96 @@
</span><span class="cx"> 
</span><span class="cx"> debug('');
</span><span class="cx"> 
</span><ins>+shouldBe(&quot;parseThenSerializeRule(':lang(*-DE, *-CH, *-EN) { }')&quot;, &quot;':lang(*-DE, *-CH, *-EN) { }'&quot;);
+shouldBe(&quot;parseThenSerializeRule(':lang(*-DE,*-CH,*-EN) { }')&quot;, &quot;':lang(*-DE, *-CH, *-EN) { }'&quot;);
+shouldBe(&quot;parseThenSerializeRule(':lang(   *-DE  ,  *-CH  ,  *-EN  ) { }')&quot;, &quot;':lang(*-DE, *-CH, *-EN) { }'&quot;);
+
+debug('');
+
+shouldBe(&quot;parseThenSerializeRule(':lang(\\\\*) { }')&quot;, &quot;':lang(*) { }'&quot;);
+shouldBe(&quot;parseThenSerializeRule(':lang(*-\\\\*) { }')&quot;, &quot;':lang(*-*) { }'&quot;);
+shouldBe(&quot;parseThenSerializeRule(':lang(*-\\\\*-\\\\*) { }')&quot;, &quot;':lang(*-*-*) { }'&quot;);
+shouldBe(&quot;parseThenSerializeRule(':lang(*-\\\\*-\\\\*-\\\\*) { }')&quot;, &quot;':lang(*-*-*-*) { }'&quot;);
+
+debug('');
+
+shouldBe(&quot;parseThenSerializeRule(':lang(ab-\\\\*) { }')&quot;, &quot;':lang(ab-*) { }'&quot;);
+shouldBe(&quot;parseThenSerializeRule(':lang(*-ab-\\\\*) { }')&quot;, &quot;':lang(*-ab-*) { }'&quot;);
+shouldBe(&quot;parseThenSerializeRule(':lang(*-ab-\\\\*-) { }')&quot;, &quot;':lang(*-ab-*-) { }'&quot;);
+
+shouldBe(&quot;parseThenSerializeRule(':lang(*-foo-\\\\3A) { }')&quot;, &quot;':lang(*-foo-:) { }'&quot;);
+shouldBe(&quot;parseThenSerializeRule(':lang(*-foo-\\\\3A\\\\`\\\\)) { }')&quot;, &quot;':lang(*-foo-:`)) { }'&quot;);
+shouldBe(&quot;parseThenSerializeRule(':lang(*-foo-\\\\*) { }')&quot;, &quot;':lang(*-foo-*) { }'&quot;);
+
+shouldBe(&quot;parseThenSerializeRule(':lang(*-foo-\\\\0072 aisin) { }')&quot;, &quot;':lang(*-foo-raisin) { }'&quot;);
+shouldBe(&quot;parseThenSerializeRule(':lang(*-foo-\\\\0062 \\\\0061 r) { }')&quot;, &quot;':lang(*-foo-bar) { }'&quot;);
+shouldBe(&quot;parseThenSerializeRule(':lang(*-foo-col\\\\6Fr) { }')&quot;, &quot;':lang(*-foo-color) { }'&quot;);
+
+debug('');
+
+shouldBe(&quot;parseThenSerializeRule(':lang(\\\\*    ) { }')&quot;, &quot;':lang(*) { }'&quot;);
+shouldBe(&quot;parseThenSerializeRule(':lang(*-    ) { }')&quot;, &quot;':lang(*-) { }'&quot;);
+shouldBe(&quot;parseThenSerializeRule(':lang(*-en    ) { }')&quot;, &quot;':lang(*-en) { }'&quot;);
+shouldBe(&quot;parseThenSerializeRule(':lang(*-en-\\\\*    ) { }')&quot;, &quot;':lang(*-en-*) { }'&quot;);
+shouldBe(&quot;parseThenSerializeRule(':lang(*-en-\\\\*-fr    ) { }')&quot;, &quot;':lang(*-en-*-fr) { }'&quot;);
+shouldBe(&quot;parseThenSerializeRule(':lang(*-en-\\\\*-fr,br    ) { }')&quot;, &quot;':lang(*-en-*-fr, br) { }'&quot;);
+shouldBe(&quot;parseThenSerializeRule(':lang(*-en-\\\\*-fr, br    ) { }')&quot;, &quot;':lang(*-en-*-fr, br) { }'&quot;);
+shouldBe(&quot;parseThenSerializeRule(':lang(*-en-\\\\*-fr,   br    ) { }')&quot;, &quot;':lang(*-en-*-fr, br) { }'&quot;);
+shouldBe(&quot;parseThenSerializeRule(':lang(  *-en-\\\\*-fr,   br    ) { }')&quot;, &quot;':lang(*-en-*-fr, br) { }'&quot;);
+shouldBe(&quot;parseThenSerializeRule(':lang(    *-en-\\\\*-fr,   br    ) { }')&quot;, &quot;':lang(*-en-*-fr, br) { }'&quot;);
+shouldBe(&quot;parseThenSerializeRule(':lang(    *-en-\\\\*-fr  ,   br    ) { }')&quot;, &quot;':lang(*-en-*-fr, br) { }'&quot;);
+shouldBe(&quot;parseThenSerializeRule(':lang(*-en-\\\\*-fr,*-br-zh    ) { }')&quot;, &quot;':lang(*-en-*-fr, *-br-zh) { }'&quot;);
+shouldBe(&quot;parseThenSerializeRule(':lang(*-en-\\\\*-fr, *-br-zh    ) { }')&quot;, &quot;':lang(*-en-*-fr, *-br-zh) { }'&quot;);
+shouldBe(&quot;parseThenSerializeRule(':lang(*-en-\\\\*-fr,   *-br-zh    ) { }')&quot;, &quot;':lang(*-en-*-fr, *-br-zh) { }'&quot;);
+shouldBe(&quot;parseThenSerializeRule(':lang(*-en-\\\\*-fr,     *-br-zh    ) { }')&quot;, &quot;':lang(*-en-*-fr, *-br-zh) { }'&quot;);
+shouldBe(&quot;parseThenSerializeRule(':lang(*-en-\\\\*-fr,       *-br-zh    ) { }')&quot;, &quot;':lang(*-en-*-fr, *-br-zh) { }'&quot;);
+
+debug('');
+
+shouldBe(&quot;parseThenSerializeRule(':lang(*-en-\\\\*-fr,br-\\\\*-zh    ) { }')&quot;, &quot;':lang(*-en-*-fr, br-*-zh) { }'&quot;);
+shouldBe(&quot;parseThenSerializeRule(':lang(*-en-\\\\*-fr, br-\\\\*-zh    ) { }')&quot;, &quot;':lang(*-en-*-fr, br-*-zh) { }'&quot;);
+shouldBe(&quot;parseThenSerializeRule(':lang(*-en-\\\\*-fr,   br-\\\\*-zh    ) { }')&quot;, &quot;':lang(*-en-*-fr, br-*-zh) { }'&quot;);
+shouldBe(&quot;parseThenSerializeRule(':lang(*-en-\\\\*-fr,      br-\\\\*-zh    ) { }')&quot;, &quot;':lang(*-en-*-fr, br-*-zh) { }'&quot;);
+shouldBe(&quot;parseThenSerializeRule(':lang(  *-en-\\\\*-fr,      br-\\\\*-zh    ) { }')&quot;, &quot;':lang(*-en-*-fr, br-*-zh) { }'&quot;);
+shouldBe(&quot;parseThenSerializeRule(':lang(  *-en-\\\\*-fr ,      br-\\\\*-zh    ) { }')&quot;, &quot;':lang(*-en-*-fr, br-*-zh) { }'&quot;);
+shouldBe(&quot;parseThenSerializeRule(':lang(  *-en-\\\\*-fr  ,      br-\\\\*-zh    ) { }')&quot;, &quot;':lang(*-en-*-fr, br-*-zh) { }'&quot;);
+
+debug('');
+
+shouldBe(&quot;parseThenSerializeRule(':lang(\\\\*) { }')&quot;, &quot;':lang(*) { }'&quot;);
+shouldBe(&quot;parseThenSerializeRule(':lang(\\\\* ) { }')&quot;, &quot;':lang(*) { }'&quot;);
+shouldBe(&quot;parseThenSerializeRule(':lang(\\\\*   ) { }')&quot;, &quot;':lang(*) { }'&quot;);
+shouldBe(&quot;parseThenSerializeRule(':lang( \\\\*   ) { }')&quot;, &quot;':lang(*) { }'&quot;);
+shouldBe(&quot;parseThenSerializeRule(':lang(  \\\\*) { }')&quot;, &quot;':lang(*) { }'&quot;);
+shouldBe(&quot;parseThenSerializeRule(':lang(   \\\\*   ) { }')&quot;, &quot;':lang(*) { }'&quot;);
+
+debug('');
+
+shouldBe(&quot;parseThenSerializeRule(':lang(   \\\\*,id-\\\\*-sumatra   ) { }')&quot;, &quot;':lang(*, id-*-sumatra) { }'&quot;);
+shouldBe(&quot;parseThenSerializeRule(':lang(   \\\\* ,id-\\\\*-sumatra) { }')&quot;, &quot;':lang(*, id-*-sumatra) { }'&quot;);
+shouldBe(&quot;parseThenSerializeRule(':lang(   \\\\*  ,  id-\\\\*-sumatra  ) { }')&quot;, &quot;':lang(*, id-*-sumatra) { }'&quot;);
+shouldBe(&quot;parseThenSerializeRule(':lang(   \\\\*   ,    id-\\\\*-sumatra  ) { }')&quot;, &quot;':lang(*, id-*-sumatra) { }'&quot;);
+
+debug('');
+
+shouldBe(&quot;parseThenSerializeRule(':lang(*-1996) { }')&quot;, &quot;':lang(*-1996) { }'&quot;);
+shouldBe(&quot;parseThenSerializeRule(':lang(*-1996, *-1997) { }')&quot;, &quot;':lang(*-1996, *-1997) { }'&quot;);
+shouldBe(&quot;parseThenSerializeRule(':lang(*-1996, *-1997 ) { }')&quot;, &quot;':lang(*-1996, *-1997) { }'&quot;);
+shouldBe(&quot;parseThenSerializeRule(':lang(   *-1996   ,  *-1997   ) { }')&quot;, &quot;':lang(*-1996, *-1997) { }'&quot;);
+shouldBe(&quot;parseThenSerializeRule(':lang(   *-1996   ,*-1997   ) { }')&quot;, &quot;':lang(*-1996, *-1997) { }'&quot;);
+shouldBe(&quot;parseThenSerializeRule(':lang(   *-1996,*-1997   ) { }')&quot;, &quot;':lang(*-1996, *-1997) { }'&quot;);
+
+debug('');
+
+shouldBe(&quot;parseThenSerializeRule(':lang(en-\\\\*) { }')&quot;, &quot;':lang(en-*) { }'&quot;);
+shouldBe(&quot;parseThenSerializeRule(':lang(en-\\\\*, fr-\\\\*) { }')&quot;, &quot;':lang(en-*, fr-*) { }'&quot;);
+shouldBe(&quot;parseThenSerializeRule(':lang(en-\\\\*, fr-\\\\* ) { }')&quot;, &quot;':lang(en-*, fr-*) { }'&quot;);
+shouldBe(&quot;parseThenSerializeRule(':lang(   en-\\\\*   ,  fr-\\\\*   ) { }')&quot;, &quot;':lang(en-*, fr-*) { }'&quot;);
+shouldBe(&quot;parseThenSerializeRule(':lang(   en-\\\\*   ,fr-\\\\*   ) { }')&quot;, &quot;':lang(en-*, fr-*) { }'&quot;);
+shouldBe(&quot;parseThenSerializeRule(':lang(   en-\\\\*,fr-\\\\*   ) { }')&quot;, &quot;':lang(en-*, fr-*) { }'&quot;);
+
+debug('');
+
</ins><span class="cx"> shouldThrow(&quot;parseThenSerializeRule(':lang() { }')&quot;);
</span><span class="cx"> shouldThrow(&quot;parseThenSerializeRule(':lang(12, b, c) { }')&quot;);
</span><span class="cx"> shouldThrow(&quot;parseThenSerializeRule(':lang(a, 12, c) { }')&quot;);
</span><span class="lines">@@ -398,6 +502,28 @@
</span><span class="cx"> shouldThrow(&quot;parseThenSerializeRule(':lang([]) { }')&quot;);
</span><span class="cx"> shouldThrow(&quot;parseThenSerializeRule(':lang(@media screen {}) { }')&quot;);
</span><span class="cx"> 
</span><ins>+shouldThrow(&quot;parseThenSerializeRule(':lang(*)')&quot;);
+shouldThrow(&quot;parseThenSerializeRule(':lang(**)')&quot;);
+shouldThrow(&quot;parseThenSerializeRule(':lang(-*-)')&quot;);
+shouldThrow(&quot;parseThenSerializeRule(':lang(*-*) { }')&quot;);
+shouldThrow(&quot;parseThenSerializeRule(':lang(de-*)')&quot;);
+shouldThrow(&quot;parseThenSerializeRule(':lang(*-en-*) { }')&quot;);
+shouldThrow(&quot;parseThenSerializeRule(':lang(*-en-fr-*) { }')&quot;);
+shouldThrow(&quot;parseThenSerializeRule(':lang(*-en-*fr) { }')&quot;);
+shouldThrow(&quot;parseThenSerializeRule(':lang(*-*en-fr) { }')&quot;);
+shouldThrow(&quot;parseThenSerializeRule(':lang(*-1997)')&quot;);
+shouldThrow(&quot;parseThenSerializeRule(':lang(*-1997-*)')&quot;);
+shouldThrow(&quot;parseThenSerializeRule(':lang(*a*) { }')&quot;);
+shouldThrow(&quot;parseThenSerializeRule(':lang(*a) { }')&quot;);
+shouldThrow(&quot;parseThenSerializeRule(':lang(a*) { }')&quot;);
+shouldThrow(&quot;parseThenSerializeRule(':lang(*-a, a*) { }')&quot;);
+shouldThrow(&quot;parseThenSerializeRule(':lang(*-a, a**) { }')&quot;);
+shouldThrow(&quot;parseThenSerializeRule(':lang(*-a, *a) { }')&quot;);
+shouldThrow(&quot;parseThenSerializeRule(':lang(*-a, **a) { }')&quot;);
+shouldThrow(&quot;parseThenSerializeRule(':lang(*- a*) { }')&quot;);
+shouldThrow(&quot;parseThenSerializeRule(':lang(*-a, br fr) { }')&quot;);
+shouldThrow(&quot;parseThenSerializeRule(':lang(*-a, br fr en *) { }')&quot;);
+
</ins><span class="cx"> debug('');
</span><span class="cx"> 
</span><span class="cx"> testSelectorRoundTrip(&quot;:role(a)&quot;);
</span></span></pre></div>
<a id="trunkLayoutTestsfastcssparsingcsslangexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/css/parsing-css-lang-expected.txt (0 => 176902)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/parsing-css-lang-expected.txt                                (rev 0)
+++ trunk/LayoutTests/fast/css/parsing-css-lang-expected.txt        2014-12-06 05:09:11 UTC (rev 176902)
</span><span class="lines">@@ -0,0 +1,286 @@
</span><ins>+Test the parsing of :lang(stringList) for querySelector and style.
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+valid language ranges
+PASS document.querySelector(&quot;:lang(e)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:lang(e)&quot;
+PASS document.querySelector(&quot;:lang(e    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:lang(e)&quot;
+PASS document.querySelector(&quot;:lang(en)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:lang(en)&quot;
+PASS document.querySelector(&quot;:lang(en    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:lang(en)&quot;
+PASS document.querySelector(&quot;:lang(en-)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:lang(en-)&quot;
+PASS document.querySelector(&quot;:lang(en-    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:lang(en-)&quot;
+PASS document.querySelector(&quot;:lang(en--)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:lang(en--)&quot;
+PASS document.querySelector(&quot;:lang(en--    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:lang(en--)&quot;
+PASS document.querySelector(&quot;:lang(en---)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:lang(en---)&quot;
+PASS document.querySelector(&quot;:lang(en---    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:lang(en---)&quot;
+PASS document.querySelector(&quot;:lang(en-fr)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:lang(en-fr)&quot;
+PASS document.querySelector(&quot;:lang(en-fr    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:lang(en-fr)&quot;
+PASS document.querySelector(&quot;:lang(en-fr-)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:lang(en-fr-)&quot;
+PASS document.querySelector(&quot;:lang(en-fr-    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:lang(en-fr-)&quot;
+PASS document.querySelector(&quot;:lang(en-fr--)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:lang(en-fr--)&quot;
+PASS document.querySelector(&quot;:lang(en-fr--    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:lang(en-fr--)&quot;
+PASS document.querySelector(&quot;:lang(en--fr)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:lang(en--fr)&quot;
+PASS document.querySelector(&quot;:lang(en--fr    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:lang(en--fr)&quot;
+PASS document.querySelector(&quot;:lang(en---fr)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:lang(en---fr)&quot;
+PASS document.querySelector(&quot;:lang(en---fr    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:lang(en---fr)&quot;
+PASS document.querySelector(&quot;:lang(en---fr---)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:lang(en---fr---)&quot;
+PASS document.querySelector(&quot;:lang(en---fr---    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:lang(en---fr---)&quot;
+PASS document.querySelector(&quot;:lang(de-DE)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:lang(de-DE)&quot;
+PASS document.querySelector(&quot;:lang(de-DE    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:lang(de-DE)&quot;
+PASS document.querySelector(&quot;:lang(de-DE-1996)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:lang(de-DE-1996)&quot;
+PASS document.querySelector(&quot;:lang(de-DE-1996    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:lang(de-DE-1996)&quot;
+PASS document.querySelector(&quot;:lang(de-Latn-DE)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:lang(de-Latn-DE)&quot;
+PASS document.querySelector(&quot;:lang(de-Latn-DE    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:lang(de-Latn-DE)&quot;
+PASS document.querySelector(&quot;:lang(de-Latf-DE)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:lang(de-Latf-DE)&quot;
+PASS document.querySelector(&quot;:lang(de-Latf-DE    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:lang(de-Latf-DE)&quot;
+PASS document.querySelector(&quot;:lang(de-Latn-DE-1996)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:lang(de-Latn-DE-1996)&quot;
+PASS document.querySelector(&quot;:lang(de-Latn-DE-1996    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:lang(de-Latn-DE-1996)&quot;
+PASS document.querySelector(&quot;:lang(de-CH)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:lang(de-CH)&quot;
+PASS document.querySelector(&quot;:lang(de-CH    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:lang(de-CH)&quot;
+PASS document.querySelector(&quot;:lang(it-CH)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:lang(it-CH)&quot;
+PASS document.querySelector(&quot;:lang(it-CH    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:lang(it-CH)&quot;
+PASS document.querySelector(&quot;:lang(fr-CH)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:lang(fr-CH)&quot;
+PASS document.querySelector(&quot;:lang(fr-CH    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:lang(fr-CH)&quot;
+PASS document.querySelector(&quot;:lang(rm-CH)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:lang(rm-CH)&quot;
+PASS document.querySelector(&quot;:lang(rm-CH    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:lang(rm-CH)&quot;
+PASS document.querySelector(&quot;:lang(*-)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:lang(*-)&quot;
+PASS document.querySelector(&quot;:lang(*-    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:lang(*-)&quot;
+PASS document.querySelector(&quot;:lang(*--)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:lang(*--)&quot;
+PASS document.querySelector(&quot;:lang(*--    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:lang(*--)&quot;
+PASS document.querySelector(&quot;:lang(*---)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:lang(*---)&quot;
+PASS document.querySelector(&quot;:lang(*---    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:lang(*---)&quot;
+PASS document.querySelector(&quot;:lang(*----)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:lang(*----)&quot;
+PASS document.querySelector(&quot;:lang(*----    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:lang(*----)&quot;
+PASS document.querySelector(&quot;:lang(*-CH)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:lang(*-CH)&quot;
+PASS document.querySelector(&quot;:lang(*-CH    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:lang(*-CH)&quot;
+PASS document.querySelector(&quot;:lang(*-DE-1996)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:lang(*-DE-1996)&quot;
+PASS document.querySelector(&quot;:lang(*-DE-1996    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:lang(*-DE-1996)&quot;
+PASS document.querySelector(&quot;:lang(*-1996)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:lang(*-1996)&quot;
+PASS document.querySelector(&quot;:lang(*-1996    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:lang(*-1996)&quot;
+PASS document.querySelector(&quot;:lang(*-br-zh)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:lang(*-br-zh)&quot;
+PASS document.querySelector(&quot;:lang(*-br-zh    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:lang(*-br-zh)&quot;
+PASS document.querySelector(&quot;:lang(id-\\*-sumatra)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:lang(id-*-sumatra)&quot;
+PASS document.querySelector(&quot;:lang(id-\\*-sumatra    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:lang(id-*-sumatra)&quot;
+PASS document.querySelector(&quot;:lang(*-en-\\*-fr)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:lang(*-en-*-fr)&quot;
+PASS document.querySelector(&quot;:lang(*-en-\\*-fr    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:lang(*-en-*-fr)&quot;
+PASS document.querySelector(&quot;:lang(*-en-\\*-\\*)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:lang(*-en-*-*)&quot;
+PASS document.querySelector(&quot;:lang(*-en-\\*-\\*    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:lang(*-en-*-*)&quot;
+PASS document.querySelector(&quot;:lang(\\*)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:lang(*)&quot;
+PASS document.querySelector(&quot;:lang(\\*    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:lang(*)&quot;
+PASS document.querySelector(&quot;:lang(*-\\*)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:lang(*-*)&quot;
+PASS document.querySelector(&quot;:lang(*-\\*    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:lang(*-*)&quot;
+PASS document.querySelector(&quot;:lang(*-\\*-\\*)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:lang(*-*-*)&quot;
+PASS document.querySelector(&quot;:lang(*-\\*-\\*    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:lang(*-*-*)&quot;
+PASS document.querySelector(&quot;:lang(*-\\*-\\*)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:lang(*-*-*)&quot;
+PASS document.querySelector(&quot;:lang(*-\\*-\\*    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:lang(*-*-*)&quot;
+PASS document.querySelector(&quot;:lang(ab-\\*)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:lang(ab-*)&quot;
+PASS document.querySelector(&quot;:lang(ab-\\*    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:lang(ab-*)&quot;
+PASS document.querySelector(&quot;:lang(*-ab-\\*)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:lang(*-ab-*)&quot;
+PASS document.querySelector(&quot;:lang(*-ab-\\*    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:lang(*-ab-*)&quot;
+PASS document.querySelector(&quot;:lang(*-ab-\\*-)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:lang(*-ab-*-)&quot;
+PASS document.querySelector(&quot;:lang(*-ab-\\*-    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:lang(*-ab-*-)&quot;
+PASS document.querySelector(&quot;:lang(*-ab-\\*--)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:lang(*-ab-*--)&quot;
+PASS document.querySelector(&quot;:lang(*-ab-\\*--    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:lang(*-ab-*--)&quot;
+PASS document.querySelector(&quot;:lang(*-ab-\\*---)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:lang(*-ab-*---)&quot;
+PASS document.querySelector(&quot;:lang(*-ab-\\*---    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:lang(*-ab-*---)&quot;
+PASS document.querySelector(&quot;:lang(*-foo-\\:)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:lang(*-foo-:)&quot;
+PASS document.querySelector(&quot;:lang(*-foo-\\:    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:lang(*-foo-:)&quot;
+PASS document.querySelector(&quot;:lang(*-foo-\\:)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:lang(*-foo-:)&quot;
+PASS document.querySelector(&quot;:lang(*-foo-\\:    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:lang(*-foo-:)&quot;
+PASS document.querySelector(&quot;:lang(*-foo-\\:\\`\\))&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:lang(*-foo-:`))&quot;
+PASS document.querySelector(&quot;:lang(*-foo-\\:\\`\\)    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:lang(*-foo-:`))&quot;
+PASS document.querySelector(&quot;:lang(*-foo-\\:\\*)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:lang(*-foo-:*)&quot;
+PASS document.querySelector(&quot;:lang(*-foo-\\:\\*    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:lang(*-foo-:*)&quot;
+PASS document.querySelector(&quot;:lang(en-\\*)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:lang(en-*)&quot;
+PASS document.querySelector(&quot;:lang(en-\\*    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:lang(en-*)&quot;
+PASS document.querySelector(&quot;:lang(fr-\\*)&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:lang(fr-*)&quot;
+PASS document.querySelector(&quot;:lang(fr-\\*    )&quot;) did not throw exception.
+PASS document.getElementById('style-container').sheet.cssRules.length is 1
+PASS document.getElementById('style-container').sheet.cssRules[0].selectorText is &quot;:lang(fr-*)&quot;
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestsfastcssparsingcsslanghtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/css/parsing-css-lang.html (0 => 176902)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/parsing-css-lang.html                                (rev 0)
+++ trunk/LayoutTests/fast/css/parsing-css-lang.html        2014-12-06 05:09:11 UTC (rev 176902)
</span><span class="lines">@@ -0,0 +1,91 @@
</span><ins>+&lt;!doctype html&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;script src=&quot;../../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
+&lt;style id=&quot;style-container&quot;&gt;
+&lt;/style&gt;
+&lt;/head&gt;
+&lt;body&gt;
+&lt;/body&gt;
+&lt;script&gt;
+description('Test the parsing of :lang(stringList) for querySelector and style.');
+
+function testValidLanguageRange(languageRangeString, expectedSerializedLanguageRange) {
+    shouldNotThrow('document.querySelector(&quot;:lang(' + languageRangeString.replace(/\\/g, '\\\\') + ')&quot;)', '&quot;Error: SyntaxError: DOM Exception 12&quot;');
+
+    var styleContainer = document.getElementById('style-container');
+    styleContainer.innerHTML = ':lang(' + languageRangeString + ') { }';
+    shouldBe(&quot;document.getElementById('style-container').sheet.cssRules.length&quot;, &quot;1&quot;);
+    if (!expectedSerializedLanguageRange)
+        expectedSerializedLanguageRange = languageRangeString;
+    shouldBeEqualToString(&quot;document.getElementById('style-container').sheet.cssRules[0].selectorText&quot;, ':lang(' + expectedSerializedLanguageRange.replace(/\\/g, '') + ')');
+    styleContainer.innerHTML = '';
+}
+
+var validLanguageRanges = [
+    
+    &quot;e&quot;,
+    &quot;en&quot;,
+    &quot;en-&quot;,
+    &quot;en--&quot;,
+    &quot;en---&quot;,
+    &quot;en-fr&quot;,
+    &quot;en-fr-&quot;,
+    &quot;en-fr--&quot;,
+    &quot;en--fr&quot;,
+    &quot;en---fr&quot;,
+    &quot;en---fr---&quot;,
+
+    &quot;de-DE&quot;,
+    &quot;de-DE-1996&quot;, 
+    &quot;de-Latn-DE&quot;, 
+    &quot;de-Latf-DE&quot;, 
+    &quot;de-Latn-DE-1996&quot;, 
+    &quot;de-CH&quot;, 
+    &quot;it-CH&quot;, 
+    &quot;fr-CH&quot;, 
+    &quot;rm-CH&quot;,
+
+    &quot;*-&quot;,
+    &quot;*--&quot;,
+    &quot;*---&quot;,
+    &quot;*----&quot;,
+
+    &quot;*-CH&quot;,
+    &quot;*-DE-1996&quot;,
+    &quot;*-1996&quot;,
+    &quot;*-br-zh&quot;,
+    &quot;id-\\*-sumatra&quot;,
+    &quot;*-en-\\*-fr&quot;,
+    &quot;*-en-\\*-\\*&quot;,
+
+    &quot;\\*&quot;,
+    &quot;*-\\*&quot;,
+    &quot;*-\\*-\\*&quot;,
+    &quot;*-\\*-\\*&quot;,
+
+    &quot;ab-\\*&quot;,
+    &quot;*-ab-\\*&quot;,
+    &quot;*-ab-\\*-&quot;,
+    &quot;*-ab-\\*--&quot;,
+    &quot;*-ab-\\*---&quot;,
+
+    &quot;*-foo-\\:&quot;,
+    &quot;*-foo-\\:&quot;,
+    &quot;*-foo-\\:\\`\\)&quot;,
+    &quot;*-foo-\\:\\*&quot;,
+
+    &quot;en-\\*&quot;,
+    &quot;fr-\\*&quot;
+];
+
+debug(&quot;valid language ranges&quot;);
+for (var i = 0; i &lt; validLanguageRanges.length; ++i) {
+    var languageRangeString = validLanguageRanges[i];
+    testValidLanguageRange(languageRangeString);
+    testValidLanguageRange(languageRangeString + &quot;    &quot;, languageRangeString);
+}
+
+&lt;/script&gt;
+&lt;script src=&quot;../../resources/js-test-post.js&quot;&gt;&lt;/script&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (176901 => 176902)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2014-12-06 02:04:13 UTC (rev 176901)
+++ trunk/Source/WebCore/ChangeLog        2014-12-06 05:09:11 UTC (rev 176902)
</span><span class="lines">@@ -1,3 +1,22 @@
</span><ins>+2014-12-05  Dhi Aurrahman  &lt;diorahman@rockybars.com&gt;
+
+        Implement parser for :lang pseudo class selector arguments that contain wildcard '*' subtags
+        https://bugs.webkit.org/show_bug.cgi?id=139014
+
+        Reviewed by Benjamin Poulain.
+
+        Consider each language range in :lang() that consists of an asterisk 
+        immediately followed by an identifier beginning with an ASCII hyphen 
+        as a valid input for the selector as specified in [1].
+
+        [1] http://dev.w3.org/csswg/selectors4/#the-lang-pseudo 
+
+        Test: fast/css/parsing-css-lang.html
+
+        * css/CSSGrammar.y.in:
+        * css/CSSParser.cpp:
+        (WebCore::CSSParser::realLex):
+
</ins><span class="cx"> 2014-12-05  Simon Fraser  &lt;simon.fraser@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Programmatic scrolling and content changes are not always synchronized
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSGrammaryin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSGrammar.y.in (176901 => 176902)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSGrammar.y.in        2014-12-06 02:04:13 UTC (rev 176901)
+++ trunk/Source/WebCore/css/CSSGrammar.y.in        2014-12-06 05:09:11 UTC (rev 176902)
</span><span class="lines">@@ -234,6 +234,7 @@
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE_CSS_SELECTORS_LEVEL4
</span><span class="cx"> %token &lt;string&gt; DIRFUNCTION
</span><ins>+%token &lt;string&gt; LANGRANGE
</ins><span class="cx"> %token &lt;string&gt; LANGFUNCTION
</span><span class="cx"> %token &lt;string&gt; ROLEFUNCTION
</span><span class="cx"> #endif
</span><span class="lines">@@ -335,9 +336,10 @@
</span><span class="cx"> %destructor { delete $$; } calc_func_expr calc_func_expr_list calc_func_paren_expr expr key_list maybe_media_value valid_calc_func_expr valid_expr
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE_CSS_SELECTORS_LEVEL4
</span><ins>+%type &lt;string&gt; lang_range
</ins><span class="cx"> %union { Vector&lt;CSSParserString&gt;* stringList; }
</span><del>-%type &lt;stringList&gt; comma_separated_identifiers
-%destructor { delete $$; } comma_separated_identifiers
</del><ins>+%type &lt;stringList&gt; comma_separated_lang_ranges
+%destructor { delete $$; } comma_separated_lang_ranges
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> %type &lt;string&gt; min_or_max
</span><span class="lines">@@ -1102,17 +1104,19 @@
</span><span class="cx">     ;
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE_CSS_SELECTORS_LEVEL4
</span><del>-comma_separated_identifiers:
-    IDENT %prec UNIMPORTANT_TOK {
</del><ins>+lang_range: LANGRANGE | IDENT 
+
+comma_separated_lang_ranges:
+    lang_range %prec UNIMPORTANT_TOK {
</ins><span class="cx">         $$ = new Vector&lt;CSSParserString&gt;;
</span><span class="cx">         $$-&gt;append($1);
</span><span class="cx">     }
</span><del>-    | comma_separated_identifiers maybe_space ',' maybe_space IDENT %prec UNIMPORTANT_TOK {
</del><ins>+    | comma_separated_lang_ranges maybe_space ',' maybe_space lang_range %prec UNIMPORTANT_TOK {
</ins><span class="cx">         $$ = $1;
</span><span class="cx">         if ($$)
</span><span class="cx">             $1-&gt;append($5);
</span><span class="cx">     }
</span><del>-    | comma_separated_identifiers error {
</del><ins>+    | comma_separated_lang_ranges error {
</ins><span class="cx">         $$ = nullptr;
</span><span class="cx">         delete $1;
</span><span class="cx">     }
</span><span class="lines">@@ -1388,7 +1392,7 @@
</span><span class="cx">             $$ = selector.release();
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    | ':' LANGFUNCTION maybe_space comma_separated_identifiers maybe_space ')' {
</del><ins>+    | ':' LANGFUNCTION maybe_space comma_separated_lang_ranges maybe_space ')' {
</ins><span class="cx">         $$ = nullptr;
</span><span class="cx">         if ($4) {
</span><span class="cx">           auto selector = std::make_unique&lt;CSSParserSelector&gt;();
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSParsercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSParser.cpp (176901 => 176902)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSParser.cpp        2014-12-06 02:04:13 UTC (rev 176901)
+++ trunk/Source/WebCore/css/CSSParser.cpp        2014-12-06 05:09:11 UTC (rev 176902)
</span><span class="lines">@@ -11486,6 +11486,18 @@
</span><span class="cx">         if (*currentCharacter&lt;SrcCharacterType&gt;() == '=') {
</span><span class="cx">             ++currentCharacter&lt;SrcCharacterType&gt;();
</span><span class="cx">             m_token = CONTAINS;
</span><ins>+        } else if (*currentCharacter&lt;SrcCharacterType&gt;() == '-') {
+            result = currentCharacter&lt;SrcCharacterType&gt;();
+
+            CSSParserString parsedIdentifier;
+            parseIdentifier(result, parsedIdentifier, hasEscape);
+
+            StringBuilder parsedLangRange;
+            parsedLangRange.append('*');
+            parsedLangRange.append(parsedIdentifier);
+
+            m_token = LANGRANGE;
+            yylval-&gt;string.init(parsedLangRange.toString());
</ins><span class="cx">         }
</span><span class="cx">         break;
</span><span class="cx"> 
</span></span></pre>
</div>
</div>

</body>
</html>