Skip to content

Commit 1d87475

Browse files
committed
Apply to the Library Fundamentals TS Working Paper the Proposed Wording from N3921 string_view library.
1 parent 56434d5 commit 1d87475

14 files changed

+2155
-195
lines changed

cxx11_index.json

+7-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
{
22
"dcl.constexpr": "7.1.5",
33
"library": "17",
4-
"unord.hash": "20.8.12"
4+
"utility.swap": "20.2.2",
5+
"unord.hash": "20.8.12",
6+
"strings.general": "21.1",
7+
"char.traits": "21.2",
8+
"container.requirements": "23.2",
9+
"iterator.range": "24.6.5",
10+
"futures.task.nonmembers": "30.6.9.2"
511
}

base.css renamed to elements/base.css

+4-5
Original file line numberDiff line numberDiff line change
@@ -66,15 +66,11 @@ p:first-child, ul, ol {margin-top: 0}
6666
[para_num]::before { content: attr(para_num); float: left;
6767
font-size: 70%; margin-left: -2.5em; width: 1.5em; text-align: right; }
6868

69-
aside { float: right; max-width: 40%;
70-
margin: 1ex;
71-
border: 1px solid black;
72-
padding: 1ex; }
73-
7469
del {text-decoration: line-through; color: #8B0040;}
7570
ins {text-decoration: underline; color: #005100;}
7671

7772
pre { margin-left: 1em; }
73+
pre > code { display: inline-block; }
7874

7975
/* This is here rather than inside elements/toc.html because browsers
8076
don't understand leader() or target-counter(), so they drop them
@@ -83,4 +79,7 @@ pre { margin-left: 1em; }
8379
/* Generate page numbers in the table of contents. */
8480
cxx-toc ^ a[href]::after { content: leader(" . ") target-counter(attr(href), page); }
8581
cxx-toc a[href]::after { content: leader(" . ") target-counter(attr(href), page); }
82+
83+
cxx-footnote ^ aside { float: footnote; footnote-policy: line; }
84+
cxx-footnote aside { float: footnote; footnote-policy: line; }
8685
}

elements/ednote.html

+5-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,11 @@
22
<template>
33
<style>
44
:host { display: block; }
5-
aside { background-color: #eee; border-color: #888; border-style: dashed }
5+
aside { float: right; max-width: 40%;
6+
margin: 1ex;
7+
border: 1px dashed #888;
8+
padding: 1ex;
9+
background-color: #eee; }
610
</style>
711
<aside><strong>Editor's note:</strong> <content></content></aside>
812
</template>

elements/footnote.html

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<polymer-element name="cxx-footnote">
2+
<template><style>
3+
:host { font-family: serif; white-space: normal;
4+
text-indent: initial; }
5+
@media screen {
6+
aside { float: right; max-width: 30%;
7+
margin-left: 1em; }
8+
}
9+
@media print {
10+
sup, .marker { display: none; }
11+
aside { float: footnote; }
12+
}
13+
</style><!--
14+
Be sure not to introduce whitespace here, as it appears around the footnote.
15+
--><sup id="footnote-call-{{foot_num}}"><a href="#footnote-body-{{foot_num}}">{{foot_num}}</a></sup><aside class="footnote" id="footnote-body-{{foot_num}}"><span class="marker"><a href="#footnote-call-{{foot_num}}">{{foot_num}}</a>) </span><content/></aside></template>
16+
17+
<script>
18+
(function() {
19+
var footnote_count = 0;
20+
Polymer('cxx-footnote', {
21+
'created': function() {
22+
this.foot_num = ++footnote_count;
23+
},
24+
})
25+
})();
26+
</script>
27+
</polymer-element>

elements/framework.html

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<link rel="stylesheet" href="base.css"/>
2+
<script src="promise-0.1.1.min.js"></script>
3+
<link rel="import" href="../bower_components/polymer/polymer.html"/>
4+
<link rel="import" href="function.html"/>
5+
<link rel="import" href="section.html"/>
6+
<link rel="import" href="clause.html"/>
7+
<link rel="import" href="table.html"/>
8+
<link rel="import" href="definition-section.html"/>
9+
<link rel="import" href="toc.html"/>
10+
<link rel="import" href="ref.html"/>
11+
<link rel="import" href="foreign-index.html"/>
12+
<link rel="import" href="titlepage.html"/>
13+
<link rel="import" href="email.html"/>
14+
<link rel="import" href="ednote.html"/>
15+
<link rel="import" href="note.html"/>
16+
<link rel="import" href="footnote.html"/>
17+
<link rel="import" href="example.html"/>
18+
<link rel="import" href="publish.html"/>
19+
<link rel="import" href="range.html"/>

elements/function.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<pre><code><content select="cxx-signature"/></code></pre>
1010

1111
<dl>
12-
<content select="cxx-requires,cxx-effects,cxx-synchronization,cxx-postconditions,cxx-returns,cxx-throws,cxx-exception-safety,cxx-remarks,cxx-error-conditions,cxx-notes"/>
12+
<content select="p,cxx-requires,cxx-effects,cxx-synchronization,cxx-postconditions,cxx-returns,cxx-throws,cxx-exception-safety,cxx-remarks,cxx-error-conditions,cxx-notes,table"/>
1313
</dl>
1414
</template>
1515
<script>
File renamed without changes.

elements/range.html

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<polymer-element name="cxx-range" attributes="begin end" noscript>
2+
<template>[<code>{{begin}}</code>, <code>{{end}}</code>)</template>
3+
</polymer-element>

elements/ref.html

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!--
2-
The 'to' attribute is the id of a <cxx-section> element (or subclass).
2+
The 'to' attribute is the id of a <cxx-section> or <cxx-table> element (or subclass).
33
44
The 'insynopsis' attribute should be present if the reference is from
55
within a comment in a header or class synopsis. This will append ", <title>"
@@ -14,10 +14,12 @@
1414
<template
1515
><template id="target_num"
1616
><template if="{{in_elem.index}}">{{in_elem.name}} &#xa7;{{in_elem.index[to]}}</template
17-
><template if="{{!in}}"><a href="#{{to}}">{{to_elem.sec_num}}</a></template
17+
><template if="{{!in}}"><a href="#{{to}}"
18+
><template if="{{to_elem.sec_num}}">{{to_elem.sec_num}}</template
19+
><template if="{{to_elem.table_num}}">Table {{to_elem.table_num}}</template></a></template
1820
></template
1921
><template if="{{insynopsis}}">// <i><template bind="" ref="target_num"></template>, {{to_elem.title_element.textContent}}</i></template
20-
><template if="{{!insynopsis}}">(<template bind="" ref="target_num"></template>)</template
22+
><template if="{{!insynopsis}}"><template bind="" ref="target_num"></template></template
2123
></template>
2224
<script src="ref.js"></script>
2325
</polymer-element>

elements/ref.js

+10-4
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,17 @@
2323
this.to_elem = document.getElementById(this.to);
2424
if (!this.to_elem) {
2525
console.error("Broken link", this.to, "from", this);
26+
return;
2627
}
27-
if (!this.to_elem instanceof CxxSectionElement) {
28-
console.error("Reference from", this,
29-
"refers to non-section element", this.to_elem);
30-
}
28+
this.async(function() {
29+
// Async makes sure the to_elem is upgraded.
30+
if (!(this.to_elem instanceof CxxSectionElement ||
31+
this.to_elem instanceof CxxTableElement)) {
32+
console.error("Reference from", this,
33+
"refers to non-section, non-table element",
34+
this.to_elem);
35+
}
36+
});
3137
}
3238
},
3339

elements/section.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@
4141
child = child.nextElementSibling) {
4242
if (child instanceof CxxSectionElement)
4343
return para_num;
44-
else if (child instanceof HTMLParagraphElement)
44+
else if (child instanceof HTMLParagraphElement &&
45+
!child.classList.contains('cont'))
4546
this.numberParagraph(para_num++, child);
4647
else if (child instanceof CxxFunctionElement) {
4748
this.numberParagraph(para_num++, child);

elements/table.html

+11-4
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,24 @@
33
the <caption>. Use this as <table is="cxx-table">, unlike the other custom
44
elements.
55
-->
6-
<polymer-element name="cxx-table" extends="table">
6+
<polymer-element name="cxx-table" extends="table" constructor="CxxTableElement">
77
<template>
88
<style>
9-
:host { border: thin solid black;
10-
margin-left: auto; margin-right: auto; }
9+
:host { margin-left: auto; margin-right: auto;
10+
border-collapse: collapse;
11+
border: thin solid black; }
1112
caption { white-space: nowrap; }
1213
/* @polyfill caption caption */
1314
::content caption { display: inline; }
15+
16+
th, td { border-style: solid none; border-color: black;
17+
border-width: thin; }
18+
th { border-bottom: double medium; }
19+
:host(.center) td { text-align: center; }
20+
:host(.list) td { border: none; }
1421
</style>
1522

16-
<caption>Table {{table_num}} — <content select="caption"></content></caption>
23+
<caption>Table {{table_num}} — <wbr><content select="caption"></content></caption>
1724
<content></content>
1825
</template>
1926
<script>

0 commit comments

Comments
 (0)