Invalid CSS Selector for Content Blockers invalidates others
authorachristensen@apple.com <achristensen@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 6 Oct 2015 02:47:38 +0000 (02:47 +0000)
committerachristensen@apple.com <achristensen@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 6 Oct 2015 02:47:38 +0000 (02:47 +0000)
commit6d2d7d4b47d380b5743f634946ec5585a743d86d
tree9a1d0df0e7f0e7cb5cd195975fd26a3543488722
parent47b9ac8a1af3df4d0ef6fffe0db68ad5f1c5e858
Invalid CSS Selector for Content Blockers invalidates others
https://bugs.webkit.org/show_bug.cgi?id=148446
rdar://problem/22918235

Reviewed by Benjamin Poulain.

Source/WebCore:

Test: http/tests/contentextensions/invalid-selector.html

* contentextensions/ContentExtensionParser.cpp:
(WebCore::ContentExtensions::loadTrigger):
(WebCore::ContentExtensions::isValidSelector):
(WebCore::ContentExtensions::loadAction):
(WebCore::ContentExtensions::loadRule):
Add a check to see if a selector is valid before adding it.

LayoutTests:

* http/tests/contentextensions/invalid-selector-expected.txt: Added.
* http/tests/contentextensions/invalid-selector.html: Added.
* http/tests/contentextensions/invalid-selector.html.json: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@190602 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/http/tests/contentextensions/invalid-selector-expected.html [new file with mode: 0644]
LayoutTests/http/tests/contentextensions/invalid-selector.html [new file with mode: 0644]
LayoutTests/http/tests/contentextensions/invalid-selector.html.json [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/contentextensions/ContentExtensionParser.cpp