Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
tools:shepherd:specs [2014/12/09 15:48] – external edit 127.0.0.1tools:shepherd:specs [2018/04/21 10:30] (current) plinss
Line 10: Line 10:
  
 Shepherd recognizes any of the following as a definition anchor: Shepherd recognizes any of the following as a definition anchor:
-  * a <dfn> element with an id’ attribute +  * a <dfn> element with an 'idattribute 
-  * an <a> element with a name’ or id’ attribute that contains a <dfn> +  * an <a> element with a 'nameor 'idattribute that contains a <dfn> 
-  * a <dt> element with an id’ that contains a <dfn> +  * a <dt> element with an 'idthat contains a <dfn> 
-  * a <dfn> inside a section heading that has an id’ with the value: the-*-element’ (HTML5 compat)+  * a <dfn> inside a section heading that has an 'idwith the value: 'the-*-element(HTML5 compat)
  
 In addition to the default 'dfn' anchor type, definition anchors are clasified as one of the following types: In addition to the default 'dfn' anchor type, definition anchors are clasified as one of the following types:
-  ; CSS : 'property', 'value', 'at-rule', 'descriptor', 'type', 'function', 'selector', token' +  ; CSS : 'property', 'value', 'at-rule', 'descriptor', 'type', 'function', 'selector', 'grammar', 'token' 
-  ; HTML/SVG : 'element', 'element-attr +  ; HTML/SVG : 'element', 'element-attr', 'element-state', 'attr-value' 
-  ; WebIDL : 'event', 'interface', 'constructor', 'method', 'argument', 'attribute', 'iterator', 'serializer', 'stringifier', 'callback', 'dictionary', 'dict-member', 'exception', 'except-field', 'enum', 'const', 'typedef'+  ; WebIDL : 'event', 'interface', 'constructor', 'method', 'argument', 'attribute', 'extended-attribute', 'iterator', 'maplike', 'setlike', 'serializer', 'stringifier', 'callback', 'dictionary', 'dict-member', 'enum', 'enum-value', 'const', 'typedef', 'exception', 'except-field', 'except-code' 
 +  ; Other : 'concept', 'abstract-op', 'state', 'mode', 'context', 'facet', 'http-header', 'scheme'
  
  
Line 25: Line 26:
 Shepherd classifies definition anchors according to the following logic (first match wins): Shepherd classifies definition anchors according to the following logic (first match wins):
  
-  - A data-dfn-type’ attribute on the <dfn> with a valid type <code><dfn id=“image-element” data-dfn-type=“element”>image</dfn></code> +  - A 'data-dfn-typeattribute on the <dfn> with a valid type <code><dfn id=“image-element” data-dfn-type=“element”>image</dfn></code> 
-  - An id’ on the <dfn> (or container <a> or <dt> with the id) that has one of the following prefixes: <code><dfn id=“elementdef-image”>image</dfn></code> +  - An 'idon the <dfn> (or container <a> or <dt> with the 'id') that has one of the following prefixes: <code><dfn id=“elementdef-image”>image</dfn></code> 
-    * 'propdef-‘ -> 'property' +    * 'propdef--> 'property' 
-    * 'valuedef-‘ -> 'value' +    * 'valuedef-' -> 'value' 
-    *  'at-ruledef-‘ -> 'at-rule' +    * 'valdef-' -> 'value' 
-    * 'descdef-‘ -> 'descriptor' +    * 'vdef-' -> 'value' 
-    * 'typedef-‘ -> 'type' +    * 'at-ruledef--> 'at-rule' 
-    * 'funcdef-‘ -> 'function' +    * 'descdef--> 'descriptor' 
-    * 'selectordef-‘ -> 'selector' +    * 'typedef--> 'type' 
-    * 'tokendef-‘ -> 'token+    * 'funcdef--> 'function' 
-    * 'elementdef-‘ -> 'element' +    * 'selectordef--> 'selector' 
-    * 'element-attrdef-‘ -> 'element-attr' +    * 'grammardef--> 'grammar' 
-    * 'eventdef-‘ -> 'event' +    * 'conceptdef-' -> 'concept' 
-    * 'interfacedef-‘ -> 'interface' +    * 'abstract-opdef-' -> 'abstract-op' 
-    * 'constructordef-‘ -> 'constructor' +    * 'statedef-' -> 'state' 
-    * 'methoddef-‘ -> 'method' +    * 'modedef-' -> 'mode' 
-    * 'argdef-‘ -> 'argument' +    * 'contextdef-' -> 'context' 
-    * 'attrdef-‘ -> 'attribute' +    * 'facetdef-' -> 'facet
-    * 'iterdef-‘ -> 'iterator' +    * 'elementdef--> 'element' 
-    * 'serialdef-‘ -> 'serializer' +    * 'element-attrdef--> 'element-attr
-    * 'stringdef-‘ -> 'stringifier' +    * 'element-statedef-' -> 'element-state' 
-    * 'callbackdef-‘ -> 'callback' +    * 'attr-valuedef-' -> 'attr-value
-    * 'dictdef-‘ -> 'dictionary' +    * 'eventdef--> 'event' 
-    * 'dict-memberdef-‘ -> 'dict-member' +    * 'interfacedef--> 'interface' 
-    * 'exceptdef-‘ -> 'exception' +    * 'constructordef--> 'constructor' 
-    * 'except-fielddef-‘ -> 'except-field' +    * 'methoddef--> 'method' 
-    * 'enumdef-‘ -> 'enum+    * 'argdef--> 'argument' 
-    * 'constdef-‘ -> 'const+    * 'attrdef--> 'attribute' 
-    * 'typedefdef-‘ -> 'typedef+    * 'extendedattrdef-' -> 'extended-attribute' 
-  - If the <dfn>id’ has one of the following “magic” prefixes (for legacy support, not recommended for use in new specs): +    * 'iterdef--> 'iterator
-    * attr-‘ -> attribute +    * 'mapdef-' -> 'maplike' 
-    * interface-‘ -> interface +    * 'setdef-' -> 'setlike
-    * dom-‘ -> some IDL construct - WebIDL found in the specification will be searched for a construct having the same name as the text contents of the <dfn>, if not found, then use the heuristics: +    * 'serialdef--> 'serializer' 
-      - if the <dfn> content starts with an uppercase letter -> interface +    * 'stringdef--> 'stringifier' 
-      - if it looks like a function <nowiki>(match '^[^ ]+\([^\(]*\)$)</nowiki> -> method +    * 'callbackdef--> 'callback' 
-      - otherwise -> attribute+    * 'dictdef--> 'dictionary' 
 +    * 'dict-memberdef--> 'dict-member' 
 +    * 'enumdef-' -> 'enum' 
 +    * 'enum-valuedef-' -> 'enum-value' 
 +    * 'constdef-' -> 'const' 
 +    * 'typedefdef-' -> 'typedef', 
 +    * 'exceptdef--> 'exception' 
 +    * 'except-fielddef--> 'except-field' 
 +    * 'except-codedef-' -> 'except-code
 +    * 'http-headerdef-' -> 'http-header
 +    * 'schemedef--> 'scheme
 +  - If the <dfn>''idhas one of the following “magic” prefixes (for legacy support, not recommended for use in new specs): 
 +    * 'attr--> 'attribute', 'attr-value', or 'element-state' 
 +    * 'interface--> 'interface' 
 +    * 'dom--> some IDL construct - WebIDL found in the specification will be searched for a construct having the same name as the text contents of the <dfn>, if not found, then use the heuristics: 
 +      - if the <dfn> content starts with an uppercase letter -> 'interface' 
 +      - if it looks like a function <nowiki>(match '^[^ ]+\([^\(]*\)$')</nowiki> -> 'method' 
 +      - otherwise -> 'attribute'
   - Search WebIDL found in the specification for a construct having the same name as the text, if found, use that type   - Search WebIDL found in the specification for a construct having the same name as the text, if found, use that type
-  - Look for the nearest ancestor with a valid data-dfn-type’ attribute, or one of the following classes:+  - Look for the nearest ancestor with a valid 'data-dfn-typeattribute, or one of the following classes:
     * 'propdef' -> 'property'     * 'propdef' -> 'property'
     * 'valuedef' -> 'value'     * 'valuedef' -> 'value'
 +    * 'valdef' -> 'value'
 +    * 'vdef' -> 'value'
     * 'at-ruledef' -> 'at-rule'     * 'at-ruledef' -> 'at-rule'
     * 'descdef' -> 'descriptor'     * 'descdef' -> 'descriptor'
Line 70: Line 90:
     * 'funcdef' -> 'function'     * 'funcdef' -> 'function'
     * 'selectordef' -> 'selector'     * 'selectordef' -> 'selector'
-    * 'tokendef' -> 'token'+    * 'grammardef' -> 'grammar' 
 +    * 'conceptdef' -> 'concept' 
 +    * 'abstract-opdef' -> 'abstract-op' 
 +    * 'statedef' -> 'state' 
 +    * 'modedef' -> 'mode' 
 +    * 'contextdef' -> 'context' 
 +    * 'facetdef' -> 'facet'
     * 'elementdef' -> 'element'     * 'elementdef' -> 'element'
     * 'element-attrdef' -> 'element-attr'     * 'element-attrdef' -> 'element-attr'
 +    * 'element-statedef' -> 'element-state'
 +    * 'attr-valuedef' -> 'attr-value'
     * 'eventdef' -> 'event'     * 'eventdef' -> 'event'
     * 'interfacedef' -> 'interface'     * 'interfacedef' -> 'interface'
Line 79: Line 107:
     * 'argdef' -> 'argument'     * 'argdef' -> 'argument'
     * 'attrdef' -> 'attribute'     * 'attrdef' -> 'attribute'
 +    * 'extendedattrdef' -> 'extended-attribute'
     * 'iterdef' -> 'iterator'     * 'iterdef' -> 'iterator'
 +    * 'mapdef' -> 'maplike'
 +    * 'setdef' -> 'setlike'
     * 'serialdef' -> 'serializer'     * 'serialdef' -> 'serializer'
     * 'stringdef' -> 'stringifier'     * 'stringdef' -> 'stringifier'
Line 85: Line 116:
     * 'dictdef' -> 'dictionary'     * 'dictdef' -> 'dictionary'
     * 'dict-memberdef' -> 'dict-member'     * 'dict-memberdef' -> 'dict-member'
-    * 'exceptdef' -> 'exception' 
-    * 'except-fielddef' -> 'except-field' 
     * 'enumdef' -> 'enum'     * 'enumdef' -> 'enum'
 +    * 'enum-valuedef' -> 'enum-value'
     * 'constdef' -> 'const'     * 'constdef' -> 'const'
-    * 'typedefdef' -> 'typedef'+    * 'typedefdef' -> 'typedef', 
 +    * 'exceptdef' -> 'exception' 
 +    * 'except-fielddef' -> 'except-field' 
 +    * 'except-codedef' -> 'except-code' 
 +    * 'http-headerdef' -> 'http-header' 
 +    * 'schemedef' -> 'scheme'
   - Look at the text content of the <dfn> and use the following heuristics:   - Look at the text content of the <dfn> and use the following heuristics:
-    - If the <dfn> content starts with @‘ -> at-rule’ <code><dfn>@foo</dfn></code> +    - If the <dfn> content starts with '@-> 'at-rule<code><dfn>@foo</dfn></code> 
-    - If the <dfn> content is quoted, e.g.: <nowiki>"foo", 'foo', “foo”, or foo</nowiki> -> value’ <code><dfn>"foo"</dfn></code> +    - If the <dfn> content is quoted, e.g.: <nowiki>"foo", 'foo', “foo”, or 'foo'</nowiki> -> 'value<code><dfn>"foo"</dfn></code> 
-    - If the <dfn> content starts with <‘ and ends with >’ -> type’ <code><dfn>&lt;foo&gt;</dfn></code> +    - If the <dfn> content starts with '<and ends with '>-> 'type<code><dfn>&lt;foo&gt;</dfn></code> 
-    - If the <dfn> content starts with :’ -> selector’ <code><dfn>:foo</dfn></code> +    - If the <dfn> content starts with ':-> 'selector<code><dfn>:foo</dfn></code> 
-    - If the <dfn> content looks like a function and the id’ does not start with dom-‘ -> function’ <code><dfn>foo(bar)</dfn></code>+    - If the <dfn> content looks like a function and the 'iddoes not start with 'dom--> 'function<code><dfn>foo(bar)</dfn></code> 
 + 
 +In addition there are special rules for legacy SVG specs: 
 + 
 +  - For <p>, <dt>, and section heading elements that are anchors, if the element contains a <span> that is not an anchor and has a 'class' attribute 
 +    - if one of the classes is one of the above definition classes plus '-title', use that definition type 
 +    - if one of the classes is 'adef' -> 'element-attr' 
 +    - if one of the classes is 'SVG-TermDefine' -> 'concept' 
 +    - if the element is a section heading and one of the classes is 'prop-name' -> 'property' 
 +    - if the element is a section heading and one of the classes is 'element-name' -> 'element', 
 +  - For section headings, if the anchor name and the section name both start with 'Interface' -> 'interface'  
  
 ==== Anchor Relationships ==== ==== Anchor Relationships ====
Line 101: Line 147:
 Shepherd also attempts to determine the relationship between anchors, e.g. which element is an attribute defined for. The logic for determining that is as follows (first match wins): Shepherd also attempts to determine the relationship between anchors, e.g. which element is an attribute defined for. The logic for determining that is as follows (first match wins):
  
-  - Use the value of the <dfn>'data-dfn-for’ attribute <code><dfn id=“image-width” data-dfn-type=“element-attr” data-dfn-for=“image”>width</dfn></code>+  - Use the value of the <dfn>''data-dfn-forattribute <code><dfn id=“image-width” data-dfn-type=“element-attr” data-dfn-for=“image”>width</dfn></code>
   - If the <dfn> is an IDL construct, determine the relationship from the IDL   - If the <dfn> is an IDL construct, determine the relationship from the IDL
-  - Look for the nearest element ancestor with a data-dfn-for’ attribute <code><div data-dfn-for=“image” data-dfn-type=“element-attr”>+  - Look for the nearest element ancestor with a 'data-dfn-forattribute <code><div data-dfn-for=“image” data-dfn-type=“element-attr”>
   <dfn id=“image-width”>width</dfn>   <dfn id=“image-width”>width</dfn>
   <dfn id=“image-hieght”>height</dfn>   <dfn id=“image-hieght”>height</dfn>
 <div></code> <div></code>
- 
 
tools/shepherd/specs.txt · Last modified: 2018/04/21 10:30 by plinss
Recent changes RSS feed Valid XHTML 1.0 Valid CSS Driven by DokuWiki