Add the initial matching implementation for attribute selectors with case-insensitive...
authorbenjamin@webkit.org <benjamin@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 15 Feb 2015 06:11:51 +0000 (06:11 +0000)
committerbenjamin@webkit.org <benjamin@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 15 Feb 2015 06:11:51 +0000 (06:11 +0000)
commit67bd7047a68212b6b6b41d4c03f394fc5342e978
tree4a836d7a02dc74128608bb7b6cde2bd2d5711461
parentce2813604a85d9e67e23bb18f1369b52cba64b77
Add the initial matching implementation for attribute selectors with case-insensitive value
https://bugs.webkit.org/show_bug.cgi?id=141615

Reviewed by Andreas Kling.

Source/WebCore:

Tests: fast/css/case-insensitive-attribute-selector-specificity.html
       fast/css/case-insensitive-attribute-selector-styling-html-1.html
       fast/css/case-insensitive-attribute-selector-styling-html-2.html
       fast/css/case-insensitive-attribute-selector-styling-html-3.html
       fast/css/case-insensitive-attribute-selector-styling-xhtml-1.xhtml
       fast/css/case-insensitive-attribute-selector-styling-xhtml-2.xhtml
       fast/css/case-insensitive-attribute-selector-styling-xhtml-3.xhtml
       fast/selectors/case-insensitive-attribute-bascis.html
       fast/selectors/case-insensitive-attribute-matching-style-attribute.html
       fast/selectors/case-insensitive-attribute-style-update.html
       fast/selectors/case-insensitive-attribute-with-case-sensitive-name.html

* css/SelectorChecker.cpp:
(WebCore::SelectorChecker::checkOne):
We already had case-insensitive value matching due to some legacy HTML
behaviors where some attribute values would be matched case-insensitively
depending on the attribute name.

For this patch, I just re-use the same mechanism. I used branches to try
to convey the idea that matching is case sensitive by default unless
the selector has a flag or we are in the weird HTML exception.

* cssjit/SelectorCompiler.cpp:
(WebCore::SelectorCompiler::constructFragmentsInternal):
Disable that case in the CSS JIT for now, I'll implement it later.

LayoutTests:

This covers the basics. I will add some more cases as I do the follow up patches.

I avoided the problem of non-ASCII characters, this will need its own follow up
patch that fixes all attribute matching.

* fast/css/case-insensitive-attribute-selector-specificity-expected.html: Added.
* fast/css/case-insensitive-attribute-selector-specificity.html: Added.
* fast/css/case-insensitive-attribute-selector-styling-html-1-expected.html: Added.
* fast/css/case-insensitive-attribute-selector-styling-html-1.html: Added.
* fast/css/case-insensitive-attribute-selector-styling-html-2-expected.html: Added.
* fast/css/case-insensitive-attribute-selector-styling-html-2.html: Added.
* fast/css/case-insensitive-attribute-selector-styling-html-3-expected.html: Added.
* fast/css/case-insensitive-attribute-selector-styling-html-3.html: Added.
* fast/css/case-insensitive-attribute-selector-styling-xhtml-1-expected.html: Added.
* fast/css/case-insensitive-attribute-selector-styling-xhtml-1.xhtml: Added.
* fast/css/case-insensitive-attribute-selector-styling-xhtml-2-expected.html: Added.
* fast/css/case-insensitive-attribute-selector-styling-xhtml-2.xhtml: Added.
* fast/css/case-insensitive-attribute-selector-styling-xhtml-3-expected.html: Added.
* fast/css/case-insensitive-attribute-selector-styling-xhtml-3.xhtml: Added.
* fast/selectors/case-insensitive-attribute-bascis-expected.txt: Added.
* fast/selectors/case-insensitive-attribute-bascis.html: Added.
* fast/selectors/case-insensitive-attribute-matching-style-attribute-expected.txt: Added.
* fast/selectors/case-insensitive-attribute-matching-style-attribute.html: Added.
* fast/selectors/case-insensitive-attribute-style-update-expected.txt: Added.
* fast/selectors/case-insensitive-attribute-style-update.html: Added.
* fast/selectors/case-insensitive-attribute-with-case-sensitive-name-expected.txt: Added.
* fast/selectors/case-insensitive-attribute-with-case-sensitive-name.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@180123 268f45cc-cd09-0410-ab3c-d52691b4dbfc
26 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/css/case-insensitive-attribute-selector-specificity-expected.html [new file with mode: 0644]
LayoutTests/fast/css/case-insensitive-attribute-selector-specificity.html [new file with mode: 0644]
LayoutTests/fast/css/case-insensitive-attribute-selector-styling-html-1-expected.html [new file with mode: 0644]
LayoutTests/fast/css/case-insensitive-attribute-selector-styling-html-1.html [new file with mode: 0644]
LayoutTests/fast/css/case-insensitive-attribute-selector-styling-html-2-expected.html [new file with mode: 0644]
LayoutTests/fast/css/case-insensitive-attribute-selector-styling-html-2.html [new file with mode: 0644]
LayoutTests/fast/css/case-insensitive-attribute-selector-styling-html-3-expected.html [new file with mode: 0644]
LayoutTests/fast/css/case-insensitive-attribute-selector-styling-html-3.html [new file with mode: 0644]
LayoutTests/fast/css/case-insensitive-attribute-selector-styling-xhtml-1-expected.html [new file with mode: 0644]
LayoutTests/fast/css/case-insensitive-attribute-selector-styling-xhtml-1.xhtml [new file with mode: 0644]
LayoutTests/fast/css/case-insensitive-attribute-selector-styling-xhtml-2-expected.html [new file with mode: 0644]
LayoutTests/fast/css/case-insensitive-attribute-selector-styling-xhtml-2.xhtml [new file with mode: 0644]
LayoutTests/fast/css/case-insensitive-attribute-selector-styling-xhtml-3-expected.html [new file with mode: 0644]
LayoutTests/fast/css/case-insensitive-attribute-selector-styling-xhtml-3.xhtml [new file with mode: 0644]
LayoutTests/fast/selectors/case-insensitive-attribute-bascis-expected.txt [new file with mode: 0644]
LayoutTests/fast/selectors/case-insensitive-attribute-bascis.html [new file with mode: 0644]
LayoutTests/fast/selectors/case-insensitive-attribute-matching-style-attribute-expected.txt [new file with mode: 0644]
LayoutTests/fast/selectors/case-insensitive-attribute-matching-style-attribute.html [new file with mode: 0644]
LayoutTests/fast/selectors/case-insensitive-attribute-style-update-expected.txt [new file with mode: 0644]
LayoutTests/fast/selectors/case-insensitive-attribute-style-update.html [new file with mode: 0644]
LayoutTests/fast/selectors/case-insensitive-attribute-with-case-sensitive-name-expected.txt [new file with mode: 0644]
LayoutTests/fast/selectors/case-insensitive-attribute-with-case-sensitive-name.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/css/SelectorChecker.cpp
Source/WebCore/cssjit/SelectorCompiler.cpp