Extend :lang()'s selector checker to handle ranges with '*' properly and perform matching within the ASCII range
https://bugs.webkit.org/show_bug.cgi?id=139340

Patch by Dhi Aurrahman <diorahman@rockybars.com> on 2014-12-15
Reviewed by Benjamin Poulain.

Source/WebCore:

Asterisk is considered as a valid subtag of a language range to express wildcard matching
in :lang()'s extended filtering procedure. The matching rules introduced by language
range with '*' is outlined in [1].

The matching of subtags is performed case-insensitively within the ASCII range[2].

[1] www.ietf.org/rfc/rfc4647.txt
[2] http://dev.w3.org/csswg/selectors4/#the-lang-pseudo

Test: fast/selectors/lang-equal-ignoring-case.html
      fast/selectors/lang-valid-extended-filtering.html

* css/SelectorCheckerTestFunctions.h:
(WebCore::equalIgnoringCaseWithinASCIIRange): Handle matching case-insensitively within the ASCII range.
(WebCore::containslanguageSubtagMatchingRange):
(WebCore::matchesLangPseudoClass):

LayoutTests:

* fast/selectors/lang-equal-ignoring-ascii-case-expected.txt: Added.
* fast/selectors/lang-equal-ignoring-ascii-case.html: Added.
* fast/selectors/lang-extended-filtering-expected.txt: Updated.
* fast/selectors/lang-extended-filtering.html: Updated.
* fast/selectors/lang-valid-extended-filtering-expected.txt: Added.
* fast/selectors/lang-valid-extended-filtering.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@177333 268f45cc-cd09-0410-ab3c-d52691b4dbfc