Skip to content

Commit

Permalink
Add groupdata for URL Fragment Text Directives spec (mdn#35682)
Browse files Browse the repository at this point in the history
  • Loading branch information
Josh-Cena authored Sep 2, 2024
1 parent fcb01c3 commit f80d2bd
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 2 deletions.
2 changes: 1 addition & 1 deletion files/en-us/web/api/document/fragmentdirective/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ status:
browser-compat: api.Document.fragmentDirective
---

{{APIRef}}{{SeeCompatTable}}
{{APIRef("URL Fragment Text Directives")}}{{SeeCompatTable}}

The **`fragmentDirective`** read-only property of the {{domxref("Document")}} interface returns the {{domxref("FragmentDirective")}} for the current document.

Expand Down
2 changes: 1 addition & 1 deletion files/en-us/web/api/fragmentdirective/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ status:
browser-compat: api.FragmentDirective
---

{{SeeCompatTable}}
{{APIRef("URL Fragment Text Directives")}}{{SeeCompatTable}}

The **`FragmentDirective`** interface is an object exposed for feature detectability, that is, whether or not a browser supports text fragments.

Expand Down
42 changes: 42 additions & 0 deletions files/en-us/web/api/url_fragment_text_directives/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
---
title: URL Fragment Text Directives
slug: Web/API/URL_Fragment_Text_Directives
page-type: web-api-overview
browser-compat:
- html.elements.a.text_fragments
- api.Document.fragmentDirective
- api.FragmentDirective
- css.selectors.target-text
---

{{DefaultAPISidebar("URL Fragment Text Directives")}}{{SeeCompatTable}}

The **URL fragment text directives** API allows web apps to interact with _text fragments_ in the URL. [Text fragments](/en-US/docs/Web/URI/Fragment/Text_fragments) allow linking directly to a specific portion of text in a web document, without requiring the author to annotate it with an ID, using a particular syntax in the URL fragment.

## Interfaces

- {{domxref("FragmentDirective")}}
- : A (currently) empty object.
The existence of an object of this type in {{domxref("document.fragmentDirective")}} is used for feature detection.

## Extensions to other interfaces

- {{domxref("Document.fragmentDirective")}}
- : A property that returns a `FragmentDirective` object for the current document. Currently only used for feature detection.

## CSS selectors

- {{cssxref("::target-text")}}
- : Represents the text that has been scrolled to. It allows authors to choose how to highlight that section of text.

## Specifications

{{Specifications}}

## Browser compatibility

{{Compat}}

## See also

- [URI fragment](/en-US/docs/Web/URI/Fragment)
7 changes: 7 additions & 0 deletions files/jsondata/GroupData.json
Original file line number Diff line number Diff line change
Expand Up @@ -1721,6 +1721,13 @@
"properties": [],
"events": []
},
"URL Fragment Text Directives": {
"overview": ["URL Fragment Text Directives"],
"guides": ["/en-US/docs/Web/URI/Fragment/Text_fragments"],
"interfaces": ["FragmentDirective"],
"methods": [],
"properties": ["Document.fragmentDirective"]
},
"URL Pattern API": {
"overview": ["URL Pattern API"],
"interfaces": ["URLPattern"],
Expand Down

0 comments on commit f80d2bd

Please sign in to comment.