From 10236552ca91a399c7c7c8906f7c9684f28ae163 Mon Sep 17 00:00:00 2001 From: Raymond Hill Date: Sat, 22 Jun 2019 10:00:25 -0400 Subject: [PATCH] Add test pages for procedural filters Procedural cosmetic filters: https://gorhill.github.io/uBlock/tests/procedural-cosmetic-filters.html Procedural HTML filters: https://gorhill.github.io/uBlock/tests/procedural-html-filters.html --- docs/tests/index.html | 2 + docs/tests/procedural-cosmetic-filters.html | 147 ++++++++++++++++++++ docs/tests/procedural-html-filters.html | 132 ++++++++++++++++++ 3 files changed, 281 insertions(+) create mode 100644 docs/tests/procedural-cosmetic-filters.html create mode 100644 docs/tests/procedural-html-filters.html diff --git a/docs/tests/index.html b/docs/tests/index.html index 125716138..3817d34a5 100644 --- a/docs/tests/index.html +++ b/docs/tests/index.html @@ -12,6 +12,8 @@
  • HNTrie: tests
  • HNTrie, small (2) to medium (~1000) set: benchmarks
  • HNTrie, small (2) to large (40,000+) set: benchmarks +
  • Procedural cosmetic filters +
  • Procedural HTML filters diff --git a/docs/tests/procedural-cosmetic-filters.html b/docs/tests/procedural-cosmetic-filters.html new file mode 100644 index 000000000..36da2cda3 --- /dev/null +++ b/docs/tests/procedural-cosmetic-filters.html @@ -0,0 +1,147 @@ + + + +Procedural cosmetic filters + + + +

    Procedural cosmetic filters

    +

    Filters

    +
    + +

    Tests

    +
    + +
    +
    + #pcf #a1 .fail:has(b) +
    + +
    +
    + #pcf #a2 .fail:has(> a > b) +
    + +
    +
    + #pcf #a3 .fail:not(:has(c)) +
    + +
    + + #pcf #a4 .fail:has-text(needle) +
    + +
    + + #pcf #a5 .fail:has-text(/NEEDLE/i) +
    + +
    + + #pcf #a6 .fail:not(:has-text(haystack)) +
    + +
    +
    + #pcf #a7 .fail:matches-css(position: absolute) +
    + +
    +
    + #pcf #a8 .fail:has(a:matches-css-before(opacity: 0)) +
    + +
    +
    + #pcf #a9 .fail:has(b:matches-css-after(opacity: 0)) +
    + +
    +
    + #pcf #a10 .fail > a > b:nth-ancestor(2) +
    + +
    +
    + #pcf #a11:xpath(.//b/../..) +
    + + + +
    + + + + diff --git a/docs/tests/procedural-html-filters.html b/docs/tests/procedural-html-filters.html new file mode 100644 index 000000000..748cc5a5d --- /dev/null +++ b/docs/tests/procedural-html-filters.html @@ -0,0 +1,132 @@ + + + +Procedural HTML filters + + + +

    Procedural HTML filters

    +

    Filters

    +
    + +

    Tests

    +
    + +
    +
    + ^#phf #a1 .fail:has(b) +
    + +
    +
    + ^#phf #a2 .fail:has(> a > b) +
    + +
    +
    + ^#phf #a3 .fail:not(:has(c)) +
    + +
    + + ^#phf #a4 .fail:has-text(needle) +
    + +
    + + ^#phf #a5 .fail:has-text(/NEEDLE/i) +
    + +
    + + ^#phf #a6 .fail:not(:has-text(haystack)) +
    + +
    +
    + ^#phf #a7 .fail > a > b:nth-ancestor(2) +
    + +
    +
    + ^#phf #a8:xpath(.//b/../..) +
    + + + +
    + + + +