Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support :has() pseudo-selector #1106

Open
MattiSG opened this issue Sep 24, 2024 · 0 comments
Open

Support :has() pseudo-selector #1106

MattiSG opened this issue Sep 24, 2024 · 0 comments

Comments

@MattiSG
Copy link
Member

MattiSG commented Sep 24, 2024

For some complex documents layout, the :has() CSS4 relational selector can prove very useful. However, using it in a declaration yields the following error:

Extract failed: unknown pseudo-class selector ':has(>[name=contact-points-for-competent-authorities-in-eu-countries]'

From the following tentative declaration:

{
  "name": "Telegram",
  "documents": {
    "Privacy Policy": {
      "fetch": "https://telegram.org/privacy",
      "select": ".tl_page_container"
    },
    "Terms of Service": {
      "fetch": "https://telegram.org/tos",
      "select": ".tl_page_container"
    },
    "Developer Terms": {
      "fetch": "https://core.telegram.org/api/terms",
      "select": "#dev_page_content_wrap",
      "remove": ".breadcrumb"
    },
    "Imprint": {
      "fetch": "https://telegram.org/faq?setln=en",
      "select": [
        {
          "startBefore": "h4:has(> [name=q-who-are-the-people-behind-telegram])",
          "endBefore": "h4:has(> [name=q-who-are-the-people-behind-telegram]) + h4"
        },
        {
          "startBefore": "h4:has(> [name=q-where-is-telegram-based])",
          "endBefore": "h4:has(> [name=q-where-is-telegram-based]) + h4"
        }
      ]
    },
    "Vulnerability Disclosure Policy": {
      "fetch": "https://core.telegram.org/bug-bounty",
      "select": ".dev_page"
    },
    "Community Guidelines": {
      "fetch": "https://telegram.org/tos/eu-dsa?setln=en",
      "select": ".tl_page_container",
      "remove": [
        {
          "startBefore": "h4:has(> [name=contact-points-for-competent-authorities-in-eu-countries])",
          "endBefore": "h4:has(> [name=contact-points-for-competent-authorities-in-eu-countries]) + h4"
        },
        {
          "startBefore": "h4:has(> [name=average-monthly-active-recipients-of-service-in-the-eu])",
          "endBefore": "h4:has(> [name=average-monthly-active-recipients-of-service-in-the-eu]) + h4"
        }
      ]
    },
    "Law Enforcement Guidelines": {
      "combine": [
        {
          "fetch": "https://telegram.org/tos/eu-dsa?setln=en",
          "select": [
            {
              "startBefore": "h4:has(> [name=contact-points-for-competent-authorities-in-eu-countries]",
              "endBefore": "h4:has(> [name=contact-points-for-competent-authorities-in-eu-countries]) + h4"
            }
          ]
        },
        {
          "fetch": "https://telegram.org/faq?setln=en",
          "select": [
            {
              "startBefore": "h4:has(> [name=q-do-you-process-data-requests])",
              "endBefore": "h4:has(> [name=q-do-you-process-data-requests]) + h4"
            }
          ]
        }
      ]
    },
    "Copyright Claims Policy": {
      "fetch": "https://telegram.org/faq?setln=en",
      "select": [
        {
          "startBefore": "h4:has(> [name=q-a-bot-or-channel-is-infringing-on-my-copyright-what-do-i-do])",
          "endBefore": "h4:has(> [name=q-a-bot-or-channel-is-infringing-on-my-copyright-what-do-i-do]) + h4"
        }
      ]
    },
    "Single Sign-On Policy": {
      "fetch": "https://telegram.org/faq?setln=en",
      "select": [
        {
          "startBefore": "h4:has(> [name=passport])",
          "endBefore": "h4:has(> [name=passport]) + h4"
        }
      ]
    },
    "Complaints Policy": {
      "fetch": "https://telegram.org/faq?setln=en",
      "select": [
        {
          "startBefore": "h4:has(> [name=q-do-you-process-take-down-requests-from-third-parties])",
          "endBefore": "h4:has(> [name=q-do-you-process-take-down-requests-from-third-parties]) + h4"
        }
      ]
    }
  }
}
MattiSG added a commit to OpenTermsArchive/contrib-declarations that referenced this issue Sep 24, 2024
See OpenTermsArchive/engine#1106
This implementation is less stable as it relies on two named selectors
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant