Skip to content

Commit

Permalink
Ensure that constructor() gets tagged as dfn-type=constructor, and re…
Browse files Browse the repository at this point in the history
…base test accordingly.
  • Loading branch information
tabatkins committed Sep 19, 2019
1 parent e81b6e2 commit 7b13078
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions bikeshed/idl.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,9 +128,12 @@ def markupName(self, text, construct):
if construct.idlType not in config.idlTypes:
return (None, None)

idlType = construct.idlType
extraParameters = ''
idlTitle = construct.normalName
if idlTitle.startswith("constructor("):
idlType = "constructor"
else:
idlType = construct.idlType
extraParameters = ''
refType = "idl"
if idlType in config.functionishTypes:
idlTitle = '|'.join(self.methodLinkingTexts(construct))
Expand Down
2 changes: 1 addition & 1 deletion tests/idl005.html
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ <h2 class="no-num no-toc no-ref" id="contents">Table of Contents</h2>
</nav>
<main>
<pre class="idl highlight def"><c- b>interface</c-> <dfn class="idl-code" data-dfn-type="interface" data-export id="foo"><code><c- g>Foo</c-></code><a class="self-link" href="#foo"></a></dfn> {
<dfn class="dfn-paneled idl-code" data-dfn-for="Foo" data-dfn-type="method" data-export data-lt="Foo(bar, baz)|constructor(bar, baz)|Foo(bar)|constructor(bar)" id="dom-foo-foo"><code><c- g>constructor</c-></code></dfn>(<a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-long" id="ref-for-idl-long"><c- b>long</c-></a> <dfn class="idl-code" data-dfn-for="Foo/constructor(bar, baz), Foo/constructor(bar)" data-dfn-type="argument" data-export id="dom-foo-constructor-bar-baz-bar"><code><c- g>bar</c-></code><a class="self-link" href="#dom-foo-constructor-bar-baz-bar"></a></dfn>, <c- b>optional</c-> <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-DOMString" id="ref-for-idl-DOMString"><c- b>DOMString</c-></a> <dfn class="dfn-paneled idl-code" data-dfn-for="Foo/constructor(bar, baz), Foo/constructor(bar)" data-dfn-type="argument" data-export id="dom-foo-constructor-bar-baz-baz"><code><c- g>baz</c-></code></dfn>);
<dfn class="dfn-paneled idl-code" data-dfn-for="Foo" data-dfn-type="constructor" data-export data-lt="Foo(bar, baz)|constructor(bar, baz)|Foo(bar)|constructor(bar)" id="dom-foo-foo"><code><c- g>constructor</c-></code></dfn>(<a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-long" id="ref-for-idl-long"><c- b>long</c-></a> <dfn class="idl-code" data-dfn-for="Foo/constructor(bar, baz), Foo/constructor(bar)" data-dfn-type="argument" data-export id="dom-foo-constructor-bar-baz-bar"><code><c- g>bar</c-></code><a class="self-link" href="#dom-foo-constructor-bar-baz-bar"></a></dfn>, <c- b>optional</c-> <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-DOMString" id="ref-for-idl-DOMString"><c- b>DOMString</c-></a> <dfn class="dfn-paneled idl-code" data-dfn-for="Foo/constructor(bar, baz), Foo/constructor(bar)" data-dfn-type="argument" data-export id="dom-foo-constructor-bar-baz-baz"><code><c- g>baz</c-></code></dfn>);
<a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-boolean" id="ref-for-idl-boolean"><c- b>boolean</c-></a> <dfn class="idl-code" data-dfn-for="Foo" data-dfn-type="method" data-export data-lt="method(bar, baz)|method(bar)" id="dom-foo-method"><code><c- g>method</c-></code><a class="self-link" href="#dom-foo-method"></a></dfn>(<a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-long" id="ref-for-idl-long①"><c- b>long</c-></a> <dfn class="idl-code" data-dfn-for="Foo/method(bar, baz), Foo/method(bar)" data-dfn-type="argument" data-export id="dom-foo-method-bar-baz-bar"><code><c- g>bar</c-></code><a class="self-link" href="#dom-foo-method-bar-baz-bar"></a></dfn>, <c- b>optional</c-> <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-DOMString" id="ref-for-idl-DOMString①"><c- b>DOMString</c-></a> <dfn class="idl-code" data-dfn-for="Foo/method(bar, baz), Foo/method(bar)" data-dfn-type="argument" data-export id="dom-foo-method-bar-baz-baz"><code><c- g>baz</c-></code><a class="self-link" href="#dom-foo-method-bar-baz-baz"></a></dfn>);
<c- b>attribute</c-> <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-short" id="ref-for-idl-short"><c- b>short</c-></a> <dfn class="idl-code" data-dfn-for="Foo" data-dfn-type="attribute" data-export data-type="short" id="dom-foo-baz"><code><c- g>baz</c-></code><a class="self-link" href="#dom-foo-baz"></a></dfn>;
};
Expand Down

0 comments on commit 7b13078

Please sign in to comment.