In r184116 I added if-domain and unless-domain to control whether a rule applies
based on the domain of the main document URL. I'm expanding this by adding if-top-url
and unless-top-url that run regular expressions on the entire main document URL so that
example.com/user1content can be distinguished from example.com/user2content.
To not add to the number of passes we make on the URLs for each load and to maintain JSON
backwards compatibility, I've made it so that if-top-url and unless-top-url can be used
instead of if-domain and unless-domain (which continue to work) but the two condition types
cannot be used together since running regular expressions on the entire main document URL
is strictly more powerful than checking the domain and subdomains.
As a minor detail, content extension regexes are by default ASCII-case-insensitive, so I've
done the same with top URL regexes, adding top-url-filter-is-case-sensitive to mirror the existing
url-filter-is-case-sensitive if the JSON author decides to make regexes case sensitive.

Covered by new API tests.

* contentextensions/CompiledContentExtension.h:
* contentextensions/ContentExtension.cpp:
(WebCore::ContentExtensions::ContentExtension::populateConditionCacheIfNeeded):
(WebCore::ContentExtensions::ContentExtension::topURLActions):
(WebCore::ContentExtensions::ContentExtension::cachedConditionedActions): Deleted.
* contentextensions/ContentExtension.h:
* contentextensions/ContentExtensionCompiler.cpp:
(WebCore::ContentExtensions::addUniversalActionsToDFA):
(WebCore::ContentExtensions::compileToBytecode):
We had three copies of compiling to bytecode that were almost the same and would've been made into three copies of the same code.
I moved them to one helper function that is called three times.
(WebCore::ContentExtensions::compileRuleList):
* contentextensions/ContentExtensionCompiler.h:
* contentextensions/ContentExtensionError.cpp:
(WebCore::ContentExtensions::contentExtensionErrorCategory):
Add the new error type for JSON that tries to use if-top-url and unless-top-url with if-domain and unless-domain.
* contentextensions/ContentExtensionError.h:
* contentextensions/ContentExtensionParser.cpp:
(WebCore::ContentExtensions::loadTrigger):
Parse the new values if-top-url, unless-top-url, and top-url-filter-is-case-sensitive.
* contentextensions/ContentExtensionRule.h:
(WebCore::ContentExtensions::Trigger::~Trigger):
* contentextensions/ContentExtensionsBackend.cpp:
(WebCore::ContentExtensions::ContentExtensionsBackend::actionsForResourceLoad):
* contentextensions/DFABytecodeInterpreter.cpp:
(WebCore::ContentExtensions::DFABytecodeInterpreter::interpretAppendAction):
(WebCore::ContentExtensions::DFABytecodeInterpreter::interpretTestFlagsAndAppendAction):
(WebCore::ContentExtensions::DFABytecodeInterpreter::interpretWithConditions):
* contentextensions/DFABytecodeInterpreter.h:

Source/WebKit2:

Rename conditionedFilters to topURLFilters to reflect the fact that they are the filters
that are run on the top URL, and possibly just the domain of the top url.
I was a bit too aggressive when renaming domain* to condition* in r213533.