#include "third_party/blink/renderer/core/speculation_rules/document_rule_predicate.h"
#include "base/containers/contains.h"
#include "third_party/blink/renderer/bindings/core/v8/v8_union_urlpatterninit_usvstring.h"
#include "third_party/blink/renderer/bindings/core/v8/v8_url_pattern_init.h"
#include "third_party/blink/renderer/core/css/parser/css_parser.h"
#include "third_party/blink/renderer/core/css/style_rule.h"
#include "third_party/blink/renderer/core/display_lock/display_lock_utilities.h"
#include "third_party/blink/renderer/core/dom/element.h"
#include "third_party/blink/renderer/core/dom/node_computed_style.h"
#include "third_party/blink/renderer/core/execution_context/execution_context.h"
#include "third_party/blink/renderer/core/frame/web_feature.h"
#include "third_party/blink/renderer/core/html/html_anchor_element.h"
#include "third_party/blink/renderer/core/url_pattern/url_pattern.h"
#include "third_party/blink/renderer/platform/heap/collection_support/heap_vector.h"
#include "third_party/blink/renderer/platform/heap/member.h"
#include "third_party/blink/renderer/platform/instrumentation/use_counter.h"
#include "third_party/blink/renderer/platform/json/json_values.h"
#include "third_party/blink/renderer/platform/weborigin/kurl.h"
#include "third_party/blink/renderer/platform/wtf/text/string_builder.h"
namespace blink {
namespace {
class Conjunction : public DocumentRulePredicate { … };
class Disjunction : public DocumentRulePredicate { … };
class Negation : public DocumentRulePredicate { … };
}
class URLPatternPredicate : public DocumentRulePredicate { … };
class CSSSelectorPredicate : public DocumentRulePredicate { … };
namespace {
void SetParseErrorMessage(String* out_error, String message) { … }
URLPattern* ParseRawPattern(v8::Isolate* isolate,
JSONValue* raw_pattern,
const KURL& base_url,
ExceptionState& exception_state,
String* out_error) { … }
String GetPredicateType(JSONObject* input, String* out_error) { … }
}
DocumentRulePredicate* DocumentRulePredicate::Parse(
JSONObject* input,
const KURL& ruleset_base_url,
ExecutionContext* execution_context,
ExceptionState& exception_state,
String* out_error) { … }
DocumentRulePredicate* DocumentRulePredicate::MakeDefaultPredicate() { … }
HeapVector<Member<DocumentRulePredicate>>
DocumentRulePredicate::GetSubPredicatesForTesting() const { … }
HeapVector<Member<URLPattern>> DocumentRulePredicate::GetURLPatternsForTesting()
const { … }
HeapVector<Member<StyleRule>> DocumentRulePredicate::GetStyleRulesForTesting()
const { … }
void DocumentRulePredicate::Trace(Visitor*) const { … }
}