-
Notifications
You must be signed in to change notification settings - Fork 323
Add Marker interface #1447
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
Draft
foolip
wants to merge
4
commits into
main
Choose a base branch
from
foolip/markers
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Add Marker interface #1447
Changes from 1 commit
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4421,6 +4421,7 @@ interface Node : EventTarget { | |
| const unsigned short DOCUMENT_TYPE_NODE = 10; | ||
| const unsigned short DOCUMENT_FRAGMENT_NODE = 11; | ||
| const unsigned short NOTATION_NODE = 12; // legacy | ||
| const unsigned short MARKER_NODE = 13; | ||
| readonly attribute unsigned short nodeType; | ||
| readonly attribute DOMString nodeName; | ||
|
|
||
|
|
@@ -4520,6 +4521,9 @@ get a direct instance of it. | |
|
|
||
| <dt>{{DocumentFragment}} | ||
| <dd><code>{{Node}} . {{Node/DOCUMENT_FRAGMENT_NODE}}</code> (11). | ||
|
|
||
| <dt>{{Marker}} | ||
| <dd><code>{{Node}} . {{Node/MARKER_NODE}}</code> (13). | ||
| </dl> | ||
|
|
||
| <dt><code><var>node</var> . {{Node/nodeName}}</code> | ||
|
|
@@ -4586,6 +4590,9 @@ statement, switching on the interface <a>this</a> <a>implements</a>: | |
|
|
||
| <dt>{{DocumentFragment}} | ||
| <dd><dfn const for=Node>DOCUMENT_FRAGMENT_NODE</dfn> (11). | ||
|
|
||
| <dt>{{Marker}} | ||
| <dd><dfn const for=Node>MARKER_NODE</dfn> (13). | ||
| </dl> | ||
|
|
||
| <p>The <dfn attribute for=Node>nodeName</dfn> getter steps are to return the first matching | ||
|
|
@@ -8550,6 +8557,42 @@ constructor steps are to set <a>this</a>'s <a for=CharacterData>data</a> to <var | |
| </div> | ||
|
|
||
|
|
||
| <h3 id=interface-marker>Interface {{Marker}}</h3> | ||
|
|
||
| <pre class=idl> | ||
| enum MarkerType { "marker", "start", "end" }; | ||
|
|
||
| [Exposed=Window] | ||
| interface Marker : Node { | ||
| constructor(MarkerType type, optional DOMString name = ""); | ||
|
|
||
| readonly attribute MarkerType type; | ||
| readonly attribute DOMString name; | ||
| }; | ||
| </pre> | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should also include mixin There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
|
|
||
| <dl class=domintro> | ||
| <dt><code><var ignore>marker</var> = new <a constructor lt="Marker()">Marker(<var>type</var> [, <var>name</var> = ""])</a></code> | ||
| <dd>Returns a new {{Marker}} <a for=/>node</a> whose <a for=Marker>type</a> is <var>type</var> and | ||
| <a for=Marker>name</a> is <var>name</var>. | ||
| </dl> | ||
|
|
||
| <p>{{Marker}} <a for=/>nodes</a> are simply known as | ||
| <dfn export id=concept-marker lt="marker">markers</dfn>. | ||
|
|
||
| <p><a>Markers</a> have an associated | ||
| <dfn export id=concept-marker-type for=Marker>type</dfn> and | ||
| <dfn export id=concept-marker-name for=Marker>name</dfn>. | ||
|
|
||
| <div algorithm> | ||
| <p>The <dfn constructor for=Marker lt="Marker(type)"><code>new Marker(<var>type</var>, <var>name</var>)</code></dfn> | ||
| constructor steps are to set <a>this</a>'s <a for=Marker>type</a> to <var>type</var>, <a>this</a>'s | ||
| <a for=Marker>name</a> to <var>name</var>, and <a>this</a>'s <a for=Node>node document</a> to | ||
| <a>current global object</a>'s <a>associated <code>Document</code></a>. | ||
| </div> | ||
|
|
||
|
|
||
|
|
||
|
|
||
| <h2 id=ranges>Ranges</h2> | ||
|
|
||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
love it, happy to provide a polyfill around this too, in case nobody else is already working on it
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
example:
now, I've no idea how people out there are supposed to distinguish
<!marker>from<!--marker-->, as example, but the polyfill would take those starting content for granted and produce a Marker node already.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
forgot the devtools result: