-
Notifications
You must be signed in to change notification settings - Fork 709
/
Copy pathOverview.html
1666 lines (1652 loc) · 122 KB
/
Overview.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!doctype html><html lang="en">
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
<title>CSS Round Display Level 1</title>
<meta content="width=device-width, initial-scale=1, shrink-to-fit=no" name="viewport">
<meta content="exploring" name="csswg-work-status">
<meta content="ED" name="w3c-status">
<link href="../default.css" rel="stylesheet" type="text/css">
<link href="../csslogo.ico" rel="shortcut icon" type="image/x-icon">
<style>
body {
background-image: url("https://www.w3.org/StyleSheets/TR/logo-ED");
};
</style>
<meta content="Bikeshed 1.0.0" name="generator">
<style>/* style-md-lists */
/* This is a weird hack for me not yet following the commonmark spec
regarding paragraph and lists. */
[data-md] > :first-child {
margin-top: 0;
}
[data-md] > :last-child {
margin-bottom: 0;
}</style>
<style>/* style-selflinks */
.heading, .issue, .note, .example, li, dt {
position: relative;
}
a.self-link {
position: absolute;
top: 0;
left: calc(-1 * (3.5rem - 26px));
width: calc(3.5rem - 26px);
height: 2em;
text-align: center;
border: none;
transition: opacity .2s;
opacity: .5;
}
a.self-link:hover {
opacity: 1;
}
.heading > a.self-link {
font-size: 83%;
}
li > a.self-link {
left: calc(-1 * (3.5rem - 26px) - 2em);
}
dfn > a.self-link {
top: auto;
left: auto;
opacity: 0;
width: 1.5em;
height: 1.5em;
background: gray;
color: white;
font-style: normal;
transition: opacity .2s, background-color .2s, color .2s;
}
dfn:hover > a.self-link {
opacity: 1;
}
dfn > a.self-link:hover {
color: black;
}
a.self-link::before { content: "¶"; }
.heading > a.self-link::before { content: "§"; }
dfn > a.self-link::before { content: "#"; }</style>
<style>/* style-counters */
body {
counter-reset: example figure issue;
}
.issue {
counter-increment: issue;
}
.issue:not(.no-marker)::before {
content: "Issue " counter(issue);
}
.example {
counter-increment: example;
}
.example:not(.no-marker)::before {
content: "Example " counter(example);
}
.invalid.example:not(.no-marker)::before,
.illegal.example:not(.no-marker)::before {
content: "Invalid Example" counter(example);
}
figure {
counter-increment: figure;
}
figcaption:not(.no-marker)::before {
content: "Figure " counter(figure);
}</style>
<style>/* style-autolinks */
.css.css, .property.property, .descriptor.descriptor {
color: #005a9c;
font-size: inherit;
font-family: inherit;
}
.css::before, .property::before, .descriptor::before {
content: "‘";
}
.css::after, .property::after, .descriptor::after {
content: "’";
}
.property, .descriptor {
/* Don't wrap property and descriptor names */
white-space: nowrap;
}
.type { /* CSS value <type> */
font-style: italic;
}
pre .property::before, pre .property::after {
content: "";
}
[data-link-type="property"]::before,
[data-link-type="propdesc"]::before,
[data-link-type="descriptor"]::before,
[data-link-type="value"]::before,
[data-link-type="function"]::before,
[data-link-type="at-rule"]::before,
[data-link-type="selector"]::before,
[data-link-type="maybe"]::before {
content: "‘";
}
[data-link-type="property"]::after,
[data-link-type="propdesc"]::after,
[data-link-type="descriptor"]::after,
[data-link-type="value"]::after,
[data-link-type="function"]::after,
[data-link-type="at-rule"]::after,
[data-link-type="selector"]::after,
[data-link-type="maybe"]::after {
content: "’";
}
[data-link-type].production::before,
[data-link-type].production::after,
.prod [data-link-type]::before,
.prod [data-link-type]::after {
content: "";
}
[data-link-type=element],
[data-link-type=element-attr] {
font-family: Menlo, Consolas, "DejaVu Sans Mono", monospace;
font-size: .9em;
}
[data-link-type=element]::before { content: "<" }
[data-link-type=element]::after { content: ">" }
[data-link-type=biblio] {
white-space: pre;
}</style>
<style>/* style-dfn-panel */
.dfn-panel {
position: absolute;
z-index: 35;
height: auto;
width: -webkit-fit-content;
width: fit-content;
max-width: 300px;
max-height: 500px;
overflow: auto;
padding: 0.5em 0.75em;
font: small Helvetica Neue, sans-serif, Droid Sans Fallback;
background: #DDDDDD;
color: black;
border: outset 0.2em;
}
.dfn-panel:not(.on) { display: none; }
.dfn-panel * { margin: 0; padding: 0; text-indent: 0; }
.dfn-panel > b { display: block; }
.dfn-panel a { color: black; }
.dfn-panel a:not(:hover) { text-decoration: none !important; border-bottom: none !important; }
.dfn-panel > b + b { margin-top: 0.25em; }
.dfn-panel ul { padding: 0; }
.dfn-panel li { list-style: inside; }
.dfn-panel.activated {
display: inline-block;
position: fixed;
left: .5em;
bottom: 2em;
margin: 0 auto;
max-width: calc(100vw - 1.5em - .4em - .5em);
max-height: 30vh;
}
.dfn-paneled { cursor: pointer; }
</style>
<style>/* style-syntax-highlighting */
.highlight .hll { background-color: #ffffcc }
.highlight { background: #ffffff; }
.highlight .c { color: #708090 } /* Comment */
.highlight .k { color: #990055 } /* Keyword */
.highlight .l { color: #000000 } /* Literal */
.highlight .n { color: #0077aa } /* Name */
.highlight .o { color: #999999 } /* Operator */
.highlight .p { color: #999999 } /* Punctuation */
.highlight .ch { color: #708090 } /* Comment.Hashbang */
.highlight .cm { color: #708090 } /* Comment.Multiline */
.highlight .cp { color: #708090 } /* Comment.Preproc */
.highlight .cpf { color: #708090 } /* Comment.PreprocFile */
.highlight .c1 { color: #708090 } /* Comment.Single */
.highlight .cs { color: #708090 } /* Comment.Special */
.highlight .kc { color: #990055 } /* Keyword.Constant */
.highlight .kd { color: #990055 } /* Keyword.Declaration */
.highlight .kn { color: #990055 } /* Keyword.Namespace */
.highlight .kp { color: #990055 } /* Keyword.Pseudo */
.highlight .kr { color: #990055 } /* Keyword.Reserved */
.highlight .kt { color: #990055 } /* Keyword.Type */
.highlight .ld { color: #000000 } /* Literal.Date */
.highlight .m { color: #000000 } /* Literal.Number */
.highlight .s { color: #a67f59 } /* Literal.String */
.highlight .na { color: #0077aa } /* Name.Attribute */
.highlight .nc { color: #0077aa } /* Name.Class */
.highlight .no { color: #0077aa } /* Name.Constant */
.highlight .nd { color: #0077aa } /* Name.Decorator */
.highlight .ni { color: #0077aa } /* Name.Entity */
.highlight .ne { color: #0077aa } /* Name.Exception */
.highlight .nf { color: #0077aa } /* Name.Function */
.highlight .nl { color: #0077aa } /* Name.Label */
.highlight .nn { color: #0077aa } /* Name.Namespace */
.highlight .py { color: #0077aa } /* Name.Property */
.highlight .nt { color: #669900 } /* Name.Tag */
.highlight .nv { color: #0077aa } /* Name.Variable */
.highlight .ow { color: #999999 } /* Operator.Word */
.highlight .mb { color: #000000 } /* Literal.Number.Bin */
.highlight .mf { color: #000000 } /* Literal.Number.Float */
.highlight .mh { color: #000000 } /* Literal.Number.Hex */
.highlight .mi { color: #000000 } /* Literal.Number.Integer */
.highlight .mo { color: #000000 } /* Literal.Number.Oct */
.highlight .sb { color: #a67f59 } /* Literal.String.Backtick */
.highlight .sc { color: #a67f59 } /* Literal.String.Char */
.highlight .sd { color: #a67f59 } /* Literal.String.Doc */
.highlight .s2 { color: #a67f59 } /* Literal.String.Double */
.highlight .se { color: #a67f59 } /* Literal.String.Escape */
.highlight .sh { color: #a67f59 } /* Literal.String.Heredoc */
.highlight .si { color: #a67f59 } /* Literal.String.Interpol */
.highlight .sx { color: #a67f59 } /* Literal.String.Other */
.highlight .sr { color: #a67f59 } /* Literal.String.Regex */
.highlight .s1 { color: #a67f59 } /* Literal.String.Single */
.highlight .ss { color: #a67f59 } /* Literal.String.Symbol */
.highlight .vc { color: #0077aa } /* Name.Variable.Class */
.highlight .vg { color: #0077aa } /* Name.Variable.Global */
.highlight .vi { color: #0077aa } /* Name.Variable.Instance */
.highlight .il { color: #000000 } /* Literal.Number.Integer.Long */
.highlight { background: hsl(24, 20%, 95%); }
code.highlight { padding: .1em; border-radius: .3em; }
xmp.highlight, pre.highlight, pre > code.highlight { display: block; padding: 1em; margin: .5em 0; overflow: auto; border-radius: 0; }
</style>
<body class="h-entry">
<div class="head">
<p data-fill-with="logo"><a class="logo" href="http://www.w3.org/"> <img alt="W3C" height="48" src="https://www.w3.org/StyleSheets/TR/2016/logos/W3C" width="72"> </a> </p>
<h1 class="p-name no-ref" id="title">CSS Round Display Level 1</h1>
<h2 class="no-num no-toc no-ref heading settled" id="subtitle"><span class="content">Editor’s Draft, <time class="dt-updated" datetime="2016-06-01">1 June 2016</time></span></h2>
<div data-fill-with="spec-metadata">
<dl>
<dt>This version:
<dd><a class="u-url" href="https://drafts.csswg.org/css-round-display/">https://drafts.csswg.org/css-round-display/</a>
<dt>Latest published version:
<dd><a href="https://www.w3.org/TR/css-round-display-1/">https://www.w3.org/TR/css-round-display-1/</a>
<dt>Previous Versions:
<dd><a href="https://www.w3.org/TR/2016/WD-css-round-display-1-20160301/" rel="previous">https://www.w3.org/TR/2016/WD-css-round-display-1-20160301/</a>
<dd><a href="https://www.w3.org/TR/2015/WD-css-round-display-1-20150922/" rel="previous">https://www.w3.org/TR/2015/WD-css-round-display-1-20150922/</a>
<dt>Issue Tracking:
<dd><a href="https://github.com/w3c/csswg-drafts/issues/">GitHub</a>
<dd><a href="#issues-index">Inline In Spec</a>
<dt class="editor">Editors:
<dd class="editor p-author h-card vcard"><a class="p-name fn u-email email" href="mailto:hyojin22.song@lge.com">Hyojin Song</a> (<span class="p-org org">LG Electronics</span>)
<dd class="editor p-author h-card vcard"><a class="p-name fn u-email email" href="mailto:jh.hong@lge.com">Jihye Hong</a> (<span class="p-org org">LG Electronics</span>)
<dt class="editor">Former Editor:
<dd class="editor p-author h-card vcard"><a class="p-name fn u-email email" href="mailto:soonbo.han@lge.com">Soonbo Han</a> (<span class="p-org org">LG Electronics</span>)
</dl>
</div>
<div data-fill-with="warning"></div>
<p class="copyright" data-fill-with="copyright"><a href="http://www.w3.org/Consortium/Legal/ipr-notice#Copyright">Copyright</a> © 2016 <a href="http://www.w3.org/"><abbr title="World Wide Web Consortium">W3C</abbr></a><sup>®</sup> (<a href="http://www.csail.mit.edu/"><abbr title="Massachusetts Institute of Technology">MIT</abbr></a>, <a href="http://www.ercim.eu/"><abbr title="European Research Consortium for Informatics and Mathematics">ERCIM</abbr></a>, <a href="http://www.keio.ac.jp/">Keio</a>, <a href="http://ev.buaa.edu.cn/">Beihang</a>). W3C <a href="http://www.w3.org/Consortium/Legal/ipr-notice#Legal_Disclaimer">liability</a>, <a href="http://www.w3.org/Consortium/Legal/ipr-notice#W3C_Trademarks">trademark</a> and <a href="http://www.w3.org/Consortium/Legal/copyright-documents">document use</a> rules apply. </p>
<hr title="Separator for header">
</div>
<h2 class="no-num no-toc no-ref heading settled" id="abstract"><span class="content">Abstract</span></h2>
<div class="p-summary" data-fill-with="abstract">
<p>This document describes CSS extensions to support a round display. The extensions help web authors to build a web page suitable for a round display.</p>
<a href="http://www.w3.org/TR/CSS/">CSS</a> is a language for describing the rendering of structured documents
(such as HTML and XML)
on screen, on paper, in speech, etc.
</div>
<h2 class="no-num no-toc no-ref heading settled" id="status"><span class="content">Status of this document</span></h2>
<div data-fill-with="status">
<p> This is a public copy of the editors’ draft.
It is provided for discussion only and may change at any moment.
Its publication here does not imply endorsement of its contents by W3C.
Don’t cite this document other than as work in progress. </p>
<p> <a href="https://github.com/w3c/csswg-drafts/issues">GitHub Issues</a> are preferred for discussion of this specification.
When filing an issue, please put the text “css-round-display” in the title,
preferably like this:
“[css-round-display] <em>…summary of comment…</em>”.
All issues and comments are <a href="https://lists.w3.org/Archives/Public/public-css-archive/">archived</a>,
and there is also a <a href="http://lists.w3.org/Archives/Public/www-style/">historical archive</a>. </p>
<p> This document was produced by the <a href="http://www.w3.org/Style/CSS/members">CSS Working Group</a> (part of the <a href="http://www.w3.org/Style/">Style Activity</a>). </p>
<p> This document was produced by a group operating under
the <a href="http://www.w3.org/Consortium/Patent-Policy-20040205/">5 February 2004 W3C Patent Policy</a>.
W3C maintains a <a href="http://www.w3.org/2004/01/pp-impl/32061/status" rel="disclosure">public list of any patent disclosures</a> made in connection with the deliverables of the group;
that page also includes instructions for disclosing a patent.
An individual who has actual knowledge of a patent which the individual believes contains <a href="http://www.w3.org/Consortium/Patent-Policy-20040205/#def-essential">Essential Claim(s)</a> must disclose the information in accordance with <a href="http://www.w3.org/Consortium/Patent-Policy-20040205/#sec-Disclosure">section 6 of the W3C Patent Policy</a>. </p>
<p> This document is governed by the <a href="http://www.w3.org/2015/Process-20150901/" id="w3c_process_revision">1 September 2015 W3C Process Document</a>. </p>
<p></p>
</div>
<div data-fill-with="at-risk"></div>
<nav data-fill-with="table-of-contents" id="toc">
<h2 class="no-num no-toc no-ref" id="contents">Table of Contents</h2>
<ol class="toc" role="directory">
<li><a href="#introduction"><span class="secno">1</span> <span class="content">Introduction</span></a>
<li><a href="#terminology"><span class="secno">2</span> <span class="content">Terminology</span></a>
<li>
<a href="#extending-media-queries"><span class="secno">3</span> <span class="content">Extending Media Queries for a round display</span></a>
<ol class="toc">
<li><a href="#device-radius-media-feature"><span class="secno">3.1</span> <span class="content">The <span class="property">shape</span> media feature</span></a>
</ol>
<li>
<a href="#extending-viewport-rule"><span class="secno">4</span> <span class="content">Extending the @viewport rule</span></a>
<ol class="toc">
<li><a href="#viewport-fit-descriptor"><span class="secno">4.1</span> <span class="content">The <span class="property">viewport-fit</span> descriptor</span></a>
</ol>
<li>
<a href="#aligning-content"><span class="secno">5</span> <span class="content">Aligning content along the display border</span></a>
<ol class="toc">
<li><a href="#shape-inside-property"><span class="secno">5.1</span> <span class="content">The <span class="property">shape-inside</span> property</span></a>
</ol>
<li>
<a href="#drawing-borders"><span class="secno">6</span> <span class="content">Drawing borders around the display border</span></a>
<ol class="toc">
<li><a href="#border-boundary-property"><span class="secno">6.1</span> <span class="content">The <span class="property">border-boundary</span> property</span></a>
</ol>
<li>
<a href="#positioning-content"><span class="secno">7</span> <span class="content">Content positioning using polar coordinate system</span></a>
<ol class="toc">
<li><a href="#polar-angle-property"><span class="secno">7.1</span> <span class="content">The <span class="property">polar-angle</span> property</span></a>
<li><a href="#polar-distance-property"><span class="secno">7.2</span> <span class="content">The <span class="property">polar-distance</span> property</span></a>
<li><a href="#polar-origin-property"><span class="secno">7.3</span> <span class="content">The <span class="property">polar-origin</span> property</span></a>
<li><a href="#polar-anchor-property"><span class="secno">7.4</span> <span class="content">The <span class="property">polar-anchor</span> property</span></a>
<li><a href="#2d-rotation-transform-function"><span class="secno">7.5</span> <span class="content">2D Rotation Transform Function for self-rotating elements in polar coordinates</span></a>
</ol>
<li><a href="#usecases"><span class="secno">8</span> <span class="content"> Use Cases</span></a>
<li>
<a href="#changes"><span class="secno">9</span> <span class="content"> Changes</span></a>
<ol class="toc">
<li><a href="#changes_from_Sep_22_2015"><span class="secno">9.1</span> <span class="content"> Changes from <span>September 22<sup>th</sup> 2015</span> version</span></a>
</ol>
<li><a href="#acks"><span class="secno"></span> <span class="content"> Acknowledgements</span></a>
<li>
<a href="#conformance"><span class="secno"></span> <span class="content"> Conformance</span></a>
<ol class="toc">
<li><a href="#document-conventions"><span class="secno"></span> <span class="content"> Document conventions</span></a>
<li><a href="#conform-classes"><span class="secno"></span> <span class="content"> Conformance classes</span></a>
<li>
<a href="#conform-responsible"><span class="secno"></span> <span class="content"> Requirements for Responsible Implementation of CSS</span></a>
<ol class="toc">
<li><a href="#conform-partial"><span class="secno"></span> <span class="content"> Partial Implementations</span></a>
<li><a href="#conform-future-proofing"><span class="secno"></span> <span class="content"> Implementations of Unstable and Proprietary Features</span></a>
<li><a href="#conform-testing"><span class="secno"></span> <span class="content"> Implementations of CR-level Features</span></a>
</ol>
</ol>
<li>
<a href="#index"><span class="secno"></span> <span class="content">Index</span></a>
<ol class="toc">
<li><a href="#index-defined-here"><span class="secno"></span> <span class="content">Terms defined by this specification</span></a>
<li><a href="#index-defined-elsewhere"><span class="secno"></span> <span class="content">Terms defined by reference</span></a>
</ol>
<li>
<a href="#references"><span class="secno"></span> <span class="content">References</span></a>
<ol class="toc">
<li><a href="#normative"><span class="secno"></span> <span class="content">Normative References</span></a>
<li><a href="#informative"><span class="secno"></span> <span class="content">Informative References</span></a>
</ol>
<li>
<a href="#property-index"><span class="secno"></span> <span class="content">Property Index</span></a>
<ol class="toc">
<li><a href="#media-descriptor-table"><span class="secno"></span> <span class="content"><span>@media</span> Descriptors</span></a>
<li><a href="#viewport-descriptor-table"><span class="secno"></span> <span class="content"><span>@viewport</span> Descriptors</span></a>
</ol>
<li><a href="#issues-index"><span class="secno"></span> <span class="content">Issues Index</span></a>
</ol>
</nav>
<main>
<h2 class="heading settled" data-level="1" id="introduction"><span class="secno">1. </span><span class="content">Introduction</span><a class="self-link" href="#introduction"></a></h2>
<p> Conventionally, web pages have been shown through a rectangular screen such as PC, tablet, and smart phone. The window content area in a web browser is a rectangle. Each HTML element follows the W3C box model and thus is also a rectangle. <br> Nowadays, devices come in varied shapes of the displays.
It needs to consider the shape of the display when implementing web pages on devices.
However, current web standards lack some features to support the devices as follows: </p>
<ol>
<li>Lack of the capability to detect the shape of a display
<li>Lack of layout mechanisms suitable for the shape of a display
</ol>
In order to facilitate the use of the web especially on a round display, there could be some features to support it.
<p></p>
<p> The <a class="property" data-link-type="propdesc">device-radius</a> media feature is added to Media Queries.
Current user agents are not capable of detecting the shape of a display so that authors cannot apply various layouts for a round display. To resolve the issue, <a class="property" data-link-type="propdesc">device-radius</a> informs the web page of the property regarding the shape of the display. <br><br> To apply the shape of a display to content area, we extend the <a class="property" data-link-type="propdesc" href="#propdef-shape-inside" id="ref-for-propdef-shape-inside-1">shape-inside</a> property of CSS Shapes. The position of the element which is overflowed from the display is adjusted inside the display when using this property even if the authors don’t know the exact shape of the display. <br><br> We also add the <a class="property" data-link-type="propdesc" href="#propdef-border-boundary" id="ref-for-propdef-border-boundary-1">border-boundary</a> property to CSS Borders. The borders of the element can be drawn along the edge of the display even if the element is overflowed. <br><br> For the better web design suitable for a round display, we introduce polar positioning.
In conventional positioning method, the Cartesian coordinates, elements are positioned by offsets in x-axis and y-axis. But, we suggest a method to position elements with specifying the distance and angle from the origin point of coordinates. </p>
<p>This module provides features such as:</p>
<ul>
<li data-md="">
<p>Detecting the rounded display</p>
<li data-md="">
<p>Aligning contents in the display’s shape</p>
<li data-md="">
<p>Drawing borders along the display’s edge</p>
<li data-md="">
<p>Positioning elements in polar coordinates</p>
</ul>
<p></p>
<h2 class="heading settled" data-level="2" id="terminology"><span class="secno">2. </span><span class="content">Terminology</span><a class="self-link" href="#terminology"></a></h2>
This specification follows the CSS property definition conventions from <a data-link-type="biblio" href="#biblio-css21">[CSS21]</a>. <br> The detailed description of Media Queries is defined in <a data-link-type="biblio" href="#biblio-mediaqueries-4">[MEDIAQUERIES-4]</a><br> The detailed description of CSS Shapes is defined in <a data-link-type="biblio" href="#biblio-css-shapes-1">[CSS-SHAPES-1]</a><br> The detailed description of Borders is defined in <a data-link-type="biblio" href="#biblio-css3-border">[CSS3-BORDER]</a><br> The detailed description of Positioned Layout is defined in <a data-link-type="biblio" href="#biblio-css3-positioning">[CSS3-POSITIONING]</a><br>
<h2 class="heading settled" data-level="3" id="extending-media-queries"><span class="secno">3. </span><span class="content">Extending Media Queries for a round display</span><a class="self-link" href="#extending-media-queries"></a></h2>
<p> Media Queries <a data-link-type="biblio" href="#biblio-mediaqueries-4">[MEDIAQUERIES-4]</a> define mechanisms to support media-dependent style sheets, tailored for different environments. We propose to extend Media Queries by adding the shape media feature to support various types of displays. This will allow web authors to apply different styles to a web page on the rounded display. </p>
<section>
<h3 class="heading settled" data-level="3.1" id="device-radius-media-feature"><span class="secno">3.1. </span><span class="content">The <a class="property" data-link-type="propdesc" href="#descdef-media-shape" id="ref-for-descdef-media-shape-1">shape</a> media feature</span><a class="self-link" href="#device-radius-media-feature"></a></h3>
To use different style sheets for a rectangle display and for a round display, media queries should support some properties to identify the display shape.
<table class="def descdef mq">
<tbody>
<tr>
<th>Name:
<td><dfn class="dfn-paneled css" data-dfn-for="@media" data-dfn-type="descriptor" data-export="" id="descdef-media-shape">shape</dfn>
<tr>
<th>For:
<td><a class="css" data-link-type="at-rule" href="https://drafts.csswg.org/css-conditional-3/#at-ruledef-media">@media</a>
<tr>
<th>Value:
<td class="prod">rect <a data-link-type="grammar" href="https://drafts.csswg.org/css-values-3/#comb-one">|</a> round
<tr>
<th>Type:
<td>discrete
</table>
<p class="note" role="note"> Note: To define a <a class="property" data-link-type="propdesc">discrete</a> type media feature, the feature is evaluated in a boolean context. </p>
<p>The ‘shape’ media feature describes the general shape of the targeted display area of the output device. It accepts the following values:</p>
<dl>
<dt><dfn class="css" data-dfn-for="@media/shape" data-dfn-type="value" data-export="" id="valdef-media-shape-rect">rect<a class="self-link" href="#valdef-media-shape-rect"></a></dfn>
<dd> The shape is an axis aligned rectangle or square, or a similar shape for which the traditional designs are appropriate.
<dt><dfn class="css" data-dfn-for="@media/shape" data-dfn-type="value" data-export="" id="valdef-media-shape-round">round<a class="self-link" href="#valdef-media-shape-round"></a></dfn>
<dd> The shape is rounded or a similar shape to the circle such as an oval, an ellipse for which distinctively rounded designs are appropriate.
</dl>
<div class="example" id="example-c85d4337">
<a class="self-link" href="#example-c85d4337"></a> The example below shows how a web page looks in the different shapes of displays.
This is a simple clock written in HTML without <a class="property" data-link-type="propdesc" href="#descdef-media-shape" id="ref-for-descdef-media-shape-2">shape</a>.
<pre class="lang-html highlight"><span></span><span class="cp"><!DOCTYPE html></span>
<span class="p"><</span><span class="nt">html</span><span class="p">></span>
<span class="p"><</span><span class="nt">head</span><span class="p">></span>
<span class="p"><</span><span class="nt">link</span> <span class="na">rel</span><span class="o">=</span><span class="s">"stylesheet"</span> <span class="na">href</span><span class="o">=</span><span class="s">"rectangle.css"</span> <span class="p">/></span>
<span class="p"></</span><span class="nt">head</span><span class="p">></span>
<span class="p"><</span><span class="nt">body</span><span class="p">></span>
<span class="p"><</span><span class="nt">div</span> <span class="na">id</span><span class="o">=</span><span class="s">"clockLayer"</span><span class="p">></span>
<span class="p"><</span><span class="nt">div</span> <span class="na">id</span><span class="o">=</span><span class="s">"clockLayer"</span><span class="p">></span>
<span class="p"><</span><span class="nt">div</span> <span class="na">id</span><span class="o">=</span><span class="s">"date"</span><span class="p">></span>2015/02/28 (SAT)<span class="p"></</span><span class="nt">div</span><span class="p">></span>
<span class="p"><</span><span class="nt">div</span> <span class="na">id</span><span class="o">=</span><span class="s">"time"</span><span class="p">></span>10:11<span class="p"></</span><span class="nt">div</span><span class="p">></span>
<span class="p"><</span><span class="nt">div</span> <span class="na">id</span><span class="o">=</span><span class="s">"weather"</span><span class="p">><</span><span class="nt">img</span> <span class="na">src</span><span class="o">=</span><span class="s">"cloudy.png"</span> <span class="p">/></</span><span class="nt">div</span><span class="p">></span>
<span class="p"></</span><span class="nt">div</span><span class="p">></span>
<span class="p"></</span><span class="nt">div</span><span class="p">></span>
<span class="p"></</span><span class="nt">body</span><span class="p">></span>
<span class="p"></</span><span class="nt">html</span><span class="p">></span></pre>
<figure style="width: 700px; text-align:center">
<div>
<div style="float: left; width: 350px;">
<img alt="An image of a rectangle clock within a rectangle display" src="images/device_radius_clock_a.png">
<p>(A) Rectangle Display</p>
</div>
<div style="float: left; ">
<img alt="An image of a round clock within a rectangle display" src="images/device_radius_clock_b.png">
<p>(B) Round Display</p>
</div>
</div>
<figcaption> Devices where the <a class="property" data-link-type="propdesc" href="#descdef-media-shape" id="ref-for-descdef-media-shape-3">shape</a> media feature is not applicable </figcaption>
</figure>
<p>On the other hand, the example below shows how the ‘shape’ media feature works in the different shapes of displays. This is the same as the code above except for media queries usage. The shape media feature can be used as follows:</p>
<pre class="lang-html highlight"><span></span><span class="c"><!-- index.html --></span>
<span class="p"><</span><span class="nt">head</span><span class="p">></span>
<span class="p"><</span><span class="nt">link</span> <span class="na">media</span><span class="o">=</span><span class="s">"screen and (shape: rect)"</span> <span class="na">rel</span><span class="o">=</span><span class="s">"stylesheet"</span> <span class="na">href</span><span class="o">=</span><span class="s">"rectangle.css"</span> <span class="p">/></span>
<span class="p"><</span><span class="nt">link</span> <span class="na">media</span><span class="o">=</span><span class="s">"screen and (shape: round)"</span> <span class="na">rel</span><span class="o">=</span><span class="s">"stylesheet"</span> <span class="na">href</span><span class="o">=</span><span class="s">"round.css"</span> <span class="p">/></span>
<span class="p"></</span><span class="nt">head</span><span class="p">></span></pre>
<p>If this example code is loaded in a round display, 'round.css' will be applied by the media queries mechanism.</p>
<figure style="width: 700px; text-align:center">
<div>
<div style="float: left; width: 350px;">
<img alt="An image of a rectangle clock within a rectangle display" src="images/device_radius_clock_a.png">
<p>(A) Rectangle Display<br>(w/ <code>shape: rect</code>)</p>
</div>
<div style="float: left; ">
<img alt="An image of a round clock within a round display" src="images/device_radius_clock_c.png">
<p>(B) Round Display<br>(w/ <code>shape: round</code>)</p>
</div>
</div>
<figcaption> Devices where the <a class="property" data-link-type="propdesc" href="#descdef-media-shape" id="ref-for-descdef-media-shape-4">shape</a> media feature is applicable </figcaption>
</figure>
</div>
<p class="note" role="note">Note: There are cases when the UA may know the shape even in the absence of OS APIs. For example, when rendering to PDF, the shape is known to be a rectangle, so 'shape: rect' evaluates to <a class="css" data-link-type="maybe" href="https://drafts.csswg.org/mediaqueries-4/#valdef-custom-media-true">true</a> while <a class="css" data-link-type="propdesc" href="#descdef-media-shape" id="ref-for-descdef-media-shape-5">shape: round</a> to <a class="css" data-link-type="maybe" href="https://drafts.csswg.org/mediaqueries-4/#valdef-custom-media-false">false</a> </p>
<p class="note" role="note">Note: For other shapes, such as polygons, we need to extend the media features with additional parameters. The current features have limitations to support the diversity beyond round shapes. How can we express star-shaped polygons? (e.g. SVG syntax, etc.) Of course, there is a trade-off between simplicity and expressiveness. </p>
<h2 class="heading settled" data-level="4" id="extending-viewport-rule"><span class="secno">4. </span><span class="content">Extending the @viewport rule</span><a class="self-link" href="#extending-viewport-rule"></a></h2>
<h3 class="heading settled" data-level="4.1" id="viewport-fit-descriptor"><span class="secno">4.1. </span><span class="content">The <a class="property" data-link-type="propdesc" href="#descdef-viewport-viewport-fit" id="ref-for-descdef-viewport-viewport-fit-1">viewport-fit</a> descriptor</span><a class="self-link" href="#viewport-fit-descriptor"></a></h3>
<p> <a class="property" data-link-type="propdesc" href="#descdef-viewport-viewport-fit" id="ref-for-descdef-viewport-viewport-fit-2">viewport-fit</a> can set the size of the bounding box for the viewport which is the viewing area used to apply the initial viewport. And we can see the actual viewport through the bounding box. </p>
<table class="def descdef">
<tbody>
<tr>
<th>Name:
<td><dfn class="dfn-paneled css" data-dfn-for="@viewport" data-dfn-type="descriptor" data-export="" id="descdef-viewport-viewport-fit">viewport-fit</dfn>
<tr>
<th>For:
<td><a class="css" data-link-type="at-rule" href="https://drafts.csswg.org/css-device-adapt-1/#at-ruledef-viewport">@viewport</a>
<tr>
<th>Value:
<td class="prod">auto <a data-link-type="grammar" href="https://drafts.csswg.org/css-values-3/#comb-one">|</a> contain <a data-link-type="grammar" href="https://drafts.csswg.org/css-values-3/#comb-one">|</a> cover
<tr>
<th>Initial:
<td>auto
<tr>
<th>Percentages:
<td>N/A
<tr>
<th>Media:
<td>visual, continuous
<tr>
<th>Computed value:
<td>as specified
</table>
<p> When setting the size of the bounding box for the viewport on non-rectangular display, we have to consider the factors like below: </p>
<ul>
<li data-md="">
<p>Clipped area which is caused because the area of the viewport bounding box is larger than the area of the display</p>
<li data-md="">
<p>Gap between the bounding box for the viewport and the border of the display</p>
</ul>
<p></p>
<div style="text-align: center">
<div style="display: inline-block; width: 300px;">
<img alt="An image of the clipped area between the viewport bounding box and the device’s border" src="images/viewport_clipped_area.png" style="width: 250px">
<p>(A) Clipped area</p>
</div>
<div style="display: inline-block; width: 300px;">
<img alt="An image of the gap between the viewport bounding box and the device’s border" src="images/viewport_gap.png" style="width: 250px">
<p>(B) Gap</p>
</div>
</div>
<p> The author can decide which factor is more important than another. If it have to be guaranteed that any part of the web page isn’t hidden, avoiding clipping is more important than having a gap between the bounding box of the viewport and the border of the screen. </p>
<p>Values have the following meanings:</p>
<dl>
<dt><dfn class="css" data-dfn-for="viewport-fit" data-dfn-type="value" data-export="" id="valdef-viewport-fit-contain">contain<a class="self-link" href="#valdef-viewport-fit-contain"></a></dfn>
<dd> The bounding box of the viewport is the largest rectangle which is inscribed in the display of the device.
When the actual viewport applied to the bounding box as inscribed rectangle, 'border-boundary: display' and 'shape-inside: display' have no effect.
<dt><dfn class="css" data-dfn-for="viewport-fit" data-dfn-type="value" data-export="" id="valdef-viewport-fit-cover">cover<a class="self-link" href="#valdef-viewport-fit-cover"></a></dfn>
<dd> The bounding box of the viewport is the circumscribed rectangle of the display of the device.
<dt><dfn class="css" data-dfn-for="viewport-fit" data-dfn-type="value" data-export="" id="valdef-viewport-fit-auto">auto<a class="self-link" href="#valdef-viewport-fit-auto"></a></dfn>
<dd> The UA chooses the size of the bounding box for the viewport between <a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css-containment-3/#propdef-contain">contain</a> and <a class="property" data-link-type="propdesc">cover</a>. <a class="property" data-link-type="propdesc">auto</a> is the same as <a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css-containment-3/#propdef-contain">contain</a> when the shape of the display is rectangle or round. And when the shape of the display is the other shapes such as rounded rectangle or star-shape, it works like <a class="property" data-link-type="propdesc">cover</a>.
</dl>
<p></p>
<div class="example" id="example-23321d5b">
<a class="self-link" href="#example-23321d5b"></a>
<p>This example shows the size of the bounding box for the viewport specified with <a class="property" data-link-type="propdesc" href="#descdef-viewport-viewport-fit" id="ref-for-descdef-viewport-viewport-fit-3">viewport-fit</a>.</p>
<p>When the <a class="property" data-link-type="propdesc" href="#descdef-viewport-viewport-fit" id="ref-for-descdef-viewport-viewport-fit-4">viewport-fit</a> is specified with <a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css-containment-3/#propdef-contain">contain</a>, the actual viewport is applied to the largest inscribed rectangle of the display.</p>
<pre class="lang-css highlight"><span></span><span class="n">@viewport</span> <span class="p">(</span>viewport-fit<span class="nt">: contain) </span><span class="p">{</span>
<span class="c">/* CSS for the rectangular design */</span>
<span class="p">}</span></pre>
<figure style="width: 600px; text-align: center">
<img alt="An image about the viewport applied to the bounding box specified with 'viewport-fit: contain'" src="images/viewport_fit_contain.png" style="width: 300px; text-align: center">
<figcaption> With '<code>viewport-fit: contain</code>' </figcaption>
</figure>
<p>When <a class="property" data-link-type="propdesc">cover</a> is given to the <a class="property" data-link-type="propdesc" href="#descdef-viewport-viewport-fit" id="ref-for-descdef-viewport-viewport-fit-5">viewport-fit</a>, the actual viewport is applied to the circumscribed rectangle of the display.</p>
<pre class="lang-css highlight"><span></span><span class="n">@viewport</span> <span class="p">(</span>viewport-fit<span class="nt">: cover) </span><span class="p">{</span>
<span class="c">/* CSS for the rectangular design */</span>
<span class="p">}</span></pre>
<figure style="width: 600px; text-align: center">
<img alt="An image about the viewport applied to the bounding box specified with 'viewport-fit: cover'" src="images/viewport_fit_cover.png" style="width: 300px; text-align: center">
<figcaption> With '<code>viewport-fit: cover</code>' </figcaption>
</figure>
</div>
<h2 class="heading settled" data-level="5" id="aligning-content"><span class="secno">5. </span><span class="content">Aligning content along the display border</span><a class="self-link" href="#aligning-content"></a></h2>
<h3 class="heading settled" data-level="5.1" id="shape-inside-property"><span class="secno">5.1. </span><span class="content">The <a class="property" data-link-type="propdesc" href="#propdef-shape-inside" id="ref-for-propdef-shape-inside-2">shape-inside</a> property</span><a class="self-link" href="#shape-inside-property"></a></h3>
<p> CSS Shapes <a data-link-type="biblio" href="#biblio-css-shapes-1">[CSS-SHAPES-1]</a> define the <a class="property" data-link-type="propdesc" href="#propdef-shape-inside" id="ref-for-propdef-shape-inside-3">shape-inside</a> property that aligns contents along the edge of a possibly non-rectangular wrapping area. Web authors may use this feature to fit contents inside a round display. However, it can be challenging to specify the wrapping area to be identical to the shape of a display. To address such cases, <a class="property" data-link-type="propdesc" href="#propdef-shape-inside" id="ref-for-propdef-shape-inside-4">shape-inside</a> is extended with a new value named '<code>display</code>', such an element having this value will have its content (or contained elements) aligned along the display border automatically. </p>
<table class="def propdef" data-link-for-hint="shape-inside">
<tbody>
<tr>
<th>Name:
<td><dfn class="dfn-paneled css" data-dfn-type="property" data-export="" id="propdef-shape-inside">shape-inside</dfn>
<tr class="value">
<th>Value:
<td class="prod">auto <a data-link-type="grammar" href="https://drafts.csswg.org/css-values-3/#comb-one">|</a> outside-shape <a data-link-type="grammar" href="https://drafts.csswg.org/css-values-3/#comb-one">|</a> [ <a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-shapes-2/#typedef-basic-shape"><basic-shape></a> <a data-link-type="grammar" href="https://drafts.csswg.org/css-values-3/#comb-any">||</a> shape-box ] <a data-link-type="grammar" href="https://drafts.csswg.org/css-values-3/#comb-one">|</a> <a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-images-3/#typedef-image"><image></a> <a data-link-type="grammar" href="https://drafts.csswg.org/css-values-3/#comb-one">|</a> <code>display</code>
<tr>
<th>Initial:
<td>auto
<tr>
<th>Applies to:
<td>block-level elements
<tr>
<th>Inherited:
<td>no
<tr>
<th>Percentages:
<td>n/a
<tr>
<th>Media:
<td>visual
<tr>
<th>Computed value:
<td>computed lengths for <a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-shapes-2/#typedef-basic-shape"><basic-shape></a>, the absolute URI for <a class="production css" data-link-type="type" href="https://drafts.csswg.org/css2/syndata.html#value-def-uri"><uri></a>, otherwise as specified
<tr>
<th>Animatable:
<td>as specified for <a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-shapes-2/#typedef-basic-shape"><basic-shape></a>, otherwise no
</table>
<p> The example below shows how the <a class="property" data-link-type="propdesc" href="#propdef-shape-inside" id="ref-for-propdef-shape-inside-5">shape-inside</a> property works when it is set to '<code>display</code>'. Without using Media Queries, contents can be aligned within the display edge automatically. </p>
<div class="example" id="example-709c9710">
<a class="self-link" href="#example-709c9710"></a>
<pre class="lang-html highlight"><span></span><span class="p"><</span><span class="nt">style</span><span class="p">></span>
<span class="nn">#container</span> <span class="p">{</span>
<span class="n">shape</span><span class="o">-</span><span class="nb">inside</span><span class="o">:</span> <span class="nb">display</span><span class="p">;</span>
<span class="o">//</span> <span class="n">the</span> <span class="n">same</span> <span class="n">as</span> <span class="nb">circle</span><span class="p">(</span><span class="m">50%</span> <span class="n">at</span> <span class="m">50%</span><span class="o">,</span> <span class="m">50%</span><span class="p">)</span> <span class="n">in</span> <span class="n">a</span> <span class="n">regular</span> <span class="n">round</span> <span class="nb">display</span>
<span class="p">}</span>
<span class="nn">#green-box</span> <span class="p">{</span> <span class="nb">float</span><span class="o">:</span> <span class="nb">left</span><span class="p">;</span> <span class="p">}</span>
<span class="nn">#blue-box</span> <span class="p">{</span> <span class="nb">float</span><span class="o">:</span> <span class="nb">right</span><span class="p">;</span> <span class="p">}</span>
<span class="p"></</span><span class="nt">style</span><span class="p">></span>
<span class="p"><</span><span class="nt">div</span> <span class="na">id</span><span class="o">=</span><span class="s">"container"</span><span class="p">></span>
<span class="p"><</span><span class="nt">p</span><span class="p">></span>
Some inline content
<span class="p"><</span><span class="nt">img</span> <span class="na">id</span><span class="o">=</span><span class="s">"green-box"</span> <span class="na">src</span><span class="o">=</span><span class="s">"green-box.jpg"</span> <span class="p">/></span>
with a float left and float right, in a
<span class="p"><</span><span class="nt">img</span> <span class="na">id</span><span class="o">=</span><span class="s">"blue-box"</span> <span class="na">src</span><span class="o">=</span><span class="s">"blue-box.jpg"</span> <span class="p">/></span>
simple box with a circle shape-inside.
<span class="p"></</span><span class="nt">p</span><span class="p">></span>
<span class="p"></</span><span class="nt">div</span><span class="p">></span></pre>
<p><br></p>
<figure style="width: 600px; text-align:center">
<div>
<div style="float: left; width: 300px;">
<img alt="A layout of web contents without shape-inside:display" src="images/shape_inside_watch_a.png" style="width: 230px">
<p>(A) Without '<code>shape-inside</code>'</p>
</div>
<div style="float: left; width: 300px;">
<img alt="A layout of web contents with shape-inside: display" src="images/shape_inside_watch_b.png" style="width: 230px">
<p>(B) With '<code>shape-inside: display</code>'</p>
</div>
</div>
<figcaption> Align the content along the display border </figcaption>
</figure>
</div>
<p> This property is specially useful for complex shapes (e.g. curved, stelliform, polygonal), that wouldn’t be covered by <a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-shapes-2/#typedef-basic-shape"><basic-shape></a> (i.e. circle() or ellipse()), allowing web authors to conveniently align contents with the display edge. </p>
<p> When a containing block is placed on one end of the display and the containing block has 'shape-inside: display', the descendant blocks of the containing block are basically put on the overlapping region between the containing block and the display area. The overlapping region’s shape is mostly complicated shape, so it’s difficult to define the shape using previous method like basic-shape. The figure 4 describes these circumstances as follows. </p>
<div style="width: 500px;">
<img alt="An image of two examples to show the principle of shape-inside: display" src="images/shape_inside_a.png" style="width: 500px">
<p class="caption">Align part of the content along the display border</p>
</div>
<p class="issue" id="issue-8d78506c"><a class="self-link" href="#issue-8d78506c"></a> What if content overflows? Clipping or scrolling? </p>
<h2 class="heading settled" data-level="6" id="drawing-borders"><span class="secno">6. </span><span class="content">Drawing borders around the display border</span><a class="self-link" href="#drawing-borders"></a></h2>
<h3 class="heading settled" data-level="6.1" id="border-boundary-property"><span class="secno">6.1. </span><span class="content">The <a class="property" data-link-type="propdesc" href="#propdef-border-boundary" id="ref-for-propdef-border-boundary-2">border-boundary</a> property</span><a class="self-link" href="#border-boundary-property"></a></h3>
<p> We add the <a class="property" data-link-type="propdesc" href="#propdef-border-boundary" id="ref-for-propdef-border-boundary-3">border-boundary</a> property to set a boundary constraint that affects the borders of an element. </p>
<table class="def propdef" data-link-for-hint="border-boundary">
<tbody>
<tr>
<th>Name:
<td><dfn class="dfn-paneled css" data-dfn-type="property" data-export="" id="propdef-border-boundary">border-boundary</dfn>
<tr class="value">
<th>Value:
<td class="prod">none <a data-link-type="grammar" href="https://drafts.csswg.org/css-values-3/#comb-one">|</a> parent <a data-link-type="grammar" href="https://drafts.csswg.org/css-values-3/#comb-one">|</a> display
<tr>
<th>Initial:
<td>none
<tr>
<th>Applies to:
<td><a href="https://drafts.csswg.org/css-pseudo/#generated-content" title="Includes ::before and ::after pseudo-elements.">all elements</a>
<tr>
<th>Inherited:
<td>yes
<tr>
<th>Percentages:
<td>n/a
<tr>
<th>Media:
<td>visual
<tr>
<th>Computed value:
<td>as specified
<tr>
<th>Animation type:
<td>discrete
</table>
<p> When the <a class="property" data-link-type="propdesc" href="#propdef-border-boundary" id="ref-for-propdef-border-boundary-4">border-boundary</a> property on an element is set to '<code>parent</code>', additional borders of the element could be drawn where the element’s area and the borders of its parent are met. When it is set to '<code>display</code>', additional borders could be drawn where the element’s area and the borders of screen are met. The default value is '<code>none</code>', imposing no boundary constraint on the borders. </p>
<div class="example" id="example-9c14329d">
<a class="self-link" href="#example-9c14329d"></a> The example below shows how the <a class="property" data-link-type="propdesc" href="#propdef-border-boundary" id="ref-for-propdef-border-boundary-5">border-boundary</a> property works on drawing borders. The result is shown in Figure 5B.
<pre class="lang-html highlight"><span></span><span class="p"><</span><span class="nt">style</span><span class="p">></span>
<span class="nn">#container</span> <span class="p">{</span>
<span class="nb">border</span><span class="o">-</span><span class="n">boundary</span><span class="o">:</span> <span class="nb">display</span><span class="p">;</span>
<span class="p">}</span>
<span class="nn">#redBox</span> <span class="p">{</span>
<span class="nb">border</span><span class="o">:</span> <span class="m">5px</span> <span class="nb">red</span> <span class="nb">solid</span><span class="p">;</span>
<span class="p">}</span>
<span class="nn">#greenBox</span> <span class="p">{</span>
<span class="nb">border</span><span class="o">:</span> <span class="m">5px</span> <span class="nb">green</span> <span class="nb">solid</span><span class="p">;</span>
<span class="p">}</span>
<span class="nn">#blueBox</span> <span class="p">{</span>
<span class="nb">border</span><span class="o">:</span> <span class="m">5px</span> <span class="nb">blue</span> <span class="nb">solid</span><span class="p">;</span>
<span class="p">}</span>
<span class="p"></</span><span class="nt">style</span><span class="p">></span>
<span class="p"><</span><span class="nt">div</span> <span class="na">id</span><span class="o">=</span><span class="s">"container"</span><span class="p">></span>
<span class="p"><</span><span class="nt">div</span> <span class="na">id</span><span class="o">=</span><span class="s">"redBox"</span><span class="p">></</span><span class="nt">div</span><span class="p">></span>
<span class="p"><</span><span class="nt">div</span> <span class="na">id</span><span class="o">=</span><span class="s">"greenBox"</span><span class="p">></</span><span class="nt">div</span><span class="p">></span>
<span class="p"><</span><span class="nt">div</span> <span class="na">id</span><span class="o">=</span><span class="s">"blueBox"</span><span class="p">></</span><span class="nt">div</span><span class="p">></span>
<span class="p"></</span><span class="nt">div</span><span class="p">></span></pre>
<p><br></p>
<figure style="width: 600px; text-align:center">
<div>
<div style="float: left; width: 300px;">
<img alt="An image of circle drawing border lines without border-boundary: display" src="images/border_boundary_a.png" style="width: 200px">
<p>(A) Without '<code>border-boundary</code>'</p>
</div>
<div style="float: left; width: 300px;">
<img alt="An image of circle drawing border lines with border-boundary: display" src="images/border_boundary_b.png" style="width: 200px">
<p>(B) With '<code>border-boundary: display</code>'</p>
</div>
</div>
<figcaption> Align the content along the display border </figcaption>
</figure>
</div>
<p class="note" role="note">Note: If the value of <a class="property" data-link-type="propdesc" href="#propdef-border-boundary" id="ref-for-propdef-border-boundary-6">border-boundary</a> is parent or display, border lines of the element are actually just a visual effect. It triggers a layout for rendering in a general way, but in the above cases (border-boundary: parent|display), the layout doesn’t occur and it only draws the border lines inward from the containing block’s borders. With this situation, the borders might hide contents around the display edge. </p>
<h2 class="heading settled" data-level="7" id="positioning-content"><span class="secno">7. </span><span class="content">Content positioning using polar coordinate system</span><a class="self-link" href="#positioning-content"></a></h2>
<p> Polar coordinate system is a two-dimensional coordinate system that describes the position of a point in a plane with a distance from a reference point and an angle from a reference direction. Elements could be placed along a circle or concentric circles, and the polar coordinate system is useful to handle such cases. </p>
<p>This section introduces polar positioning to support layout of elements in the polar coordinate system where the position of an element is determined by a distance from the center point within the containing element and an angle from the Y-axis.</p>
<p>The conventional coordinates used in web is the Cartesian coordinate system, but using <a class="property" data-link-type="propdesc" href="#propdef-polar-distance" id="ref-for-propdef-polar-distance-1">polar-distance</a> or <a class="property" data-link-type="propdesc" href="#propdef-polar-angle" id="ref-for-propdef-polar-angle-1">polar-angle</a> enables positioning an element in the polar coordinate system. The <a class="property" data-link-type="propdesc" href="#propdef-polar-angle" id="ref-for-propdef-polar-angle-2">polar-angle</a> and <a class="property" data-link-type="propdesc" href="#propdef-polar-distance" id="ref-for-propdef-polar-distance-2">polar-distance</a> properties specify the angular value and distance of an element from the origin in polar coordinates.</p>
<p></p>
<div class="example" id="example-d26368f2">
<a class="self-link" href="#example-d26368f2"></a> This example shows a way to align elements within the polar coordinate system.
<pre><body>
<div id="circle1" style="position: absolute; polar-angle: 0deg; polar-distance: 50%"></div>
<div id="circle2" style="position: absolute; polar-angle: 90deg; polar-distance: 20%"></div>
<div id="circle3" style="position: absolute; polar-angle: 225deg; polar-distance: 100%"></div>
</body>
</pre>
<div style="width: 400px; text-align: center">
<img alt="An image of three elements positioned to polar coordinates" src="images/polar_a.png" style="width: 200px; border: 1px #AAA solid; text-align: center">
<p class="caption">An example of polar positioning</p>
</div>
</div>
<p> In conventional coordinate system used for positioning an element in a containing block, the offset of the element is applied depending on the edges of the element’s containing block. </p>
<p>In comparison, the default origin of polar coordinates is positioned at the center point of a containing block. The position for the origin point can be set by <a class="property" data-link-type="propdesc" href="#propdef-polar-origin" id="ref-for-propdef-polar-origin-1">polar-origin</a>.</p>
<p></p>
<h3 class="heading settled" data-level="7.1" id="polar-angle-property"><span class="secno">7.1. </span><span class="content">The <a class="property" data-link-type="propdesc" href="#propdef-polar-angle" id="ref-for-propdef-polar-angle-3">polar-angle</a> property</span><a class="self-link" href="#polar-angle-property"></a></h3>
The <a class="property" data-link-type="propdesc" href="#propdef-polar-angle" id="ref-for-propdef-polar-angle-4">polar-angle</a> property specifies the angle from the Y-axis.
<table class="def propdef" data-link-for-hint="polar-angle">
<tbody>
<tr>
<th>Name:
<td><dfn class="dfn-paneled css" data-dfn-type="property" data-export="" id="propdef-polar-angle">polar-angle</dfn>
<tr class="value">
<th>Value:
<td class="prod"><a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-values-3/#angle-value" title="Expands to: turn | rad | grad | deg"><angle></a>
<tr>
<th>Initial:
<td>0
<tr>
<th>Applies to:
<td><a href="https://drafts.csswg.org/css-pseudo/#generated-content" title="Includes ::before and ::after pseudo-elements.">all elements</a>
<tr>
<th>Inherited:
<td>no
<tr>
<th>Percentages:
<td>N/A
<tr>
<th>Media:
<td>visual
<tr>
<th>Computed value:
<td>as specified
<tr>
<th>Animatable:
<td>as <a href="https://www.w3.org/TR/css3-transitions/#animatable-types">angle</a>
</table>
<p class="note" role="note"> Note: In polar coordinate system, a pole is the reference point and points are described as been a certain distance from it, as also a certain angle from the polar axis. In mathematical theory, the polar axis is commonly defined as the positive direction of the x-axis, but we consider the polar axis as the positive direction of the y-axis position as other CSS specifications usually do. Therefore, when the <a class="property" data-link-type="propdesc" href="#propdef-polar-angle" id="ref-for-propdef-polar-angle-5">polar-angle</a> value of an element is 0, the element is positioned on the y-axis. If the angle value of an element increases in the positive direction from 0, the element moves clockwise. The method to determine a direction using <a class="property" data-link-type="propdesc" href="#propdef-polar-angle" id="ref-for-propdef-polar-angle-6">polar-angle</a> works the same way in <a data-link-type="biblio" href="#biblio-css-values-3">[css-values-3]</a>, <a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-values-3/#angle-value" title="Expands to: turn | rad | grad | deg"><angle></a> value. </p>
<h3 class="heading settled" data-level="7.2" id="polar-distance-property"><span class="secno">7.2. </span><span class="content">The <a class="property" data-link-type="propdesc" href="#propdef-polar-distance" id="ref-for-propdef-polar-distance-3">polar-distance</a> property</span><a class="self-link" href="#polar-distance-property"></a></h3>
The <a class="property" data-link-type="propdesc" href="#propdef-polar-distance" id="ref-for-propdef-polar-distance-4">polar-distance</a> property determines how far elements are positioned from the origin of polar coordinates.
<table class="def propdef" data-link-for-hint="polar-distance">
<tbody>
<tr>
<th>Name:
<td><dfn class="dfn-paneled css" data-dfn-type="property" data-export="" id="propdef-polar-distance">polar-distance</dfn>
<tr class="value">
<th>Value:
<td class="prod">[ <a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-values-3/#length-value" title="Expands to: em | advance measure | ch | vmin | cm | pc | pixel unit | in | rem | q | vh | ex | pt | vw | vmax | mm"><length></a> <a data-link-type="grammar" href="https://drafts.csswg.org/css-values-3/#comb-one">|</a> <a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-values-3/#percentage-value"><percentage></a> <a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-images-3/#typedef-size" title="Expands to: farthest-side | closest-corner | [ <length> | <percentage> ]{2} | <length> | closest-side | farthest-corner"><size></a><a data-link-type="grammar" href="https://drafts.csswg.org/css-values-3/#mult-opt">?</a> ] && contain<a data-link-type="grammar" href="https://drafts.csswg.org/css-values-3/#mult-opt">?</a>
<tr>
<th>Initial:
<td>0
<tr>
<th>Applies to:
<td><a href="https://drafts.csswg.org/css-pseudo/#generated-content" title="Includes ::before and ::after pseudo-elements.">all elements</a>
<tr>
<th>Inherited:
<td>no
<tr>
<th>Percentages:
<td>relative to distance from the origin of polar coordinates to edge of containing block
<tr>
<th>Media:
<td>visual
<tr>
<th>Computed value:
<td>as specified
<tr>
<th>Animatable:
<td>as <a href="https://www.w3.org/TR/css3-transitions/#animtype-lpcalc">length, percentage, or calc</a>
</table>
<p> The <a class="property" data-link-type="propdesc" href="#propdef-polar-distance" id="ref-for-propdef-polar-distance-5">polar-distance</a> specifies the distance between the origin of polar coordinates and the anchor point of the element. <br><br> Values have the following meanings: </p>
<dl>
<dt><var><length></var>
<dd> Gives a fixed length between the origin of polar coordinates and the anchor point of element.
</dl>
<dl>
<dt><var><percentage></var>
<dd> Is relative to the distance between the origin of polar coordinates and the point of contact which is made by the edge of containing block and the gradient-line from the origin of polar coordinates. The value of the gradient of the line is polar angle value.
</dl>
<dl>
<dt><var><size></var>
<dd>
Decides a point used for measuring the distance from the origin point.
<p>It is defined as</p>
<p> <b><size></b> = [ closest-side | closest-corner | farthest-side | farthest-corner ]</p>
<p>If omitted it defaults to <var>closest-side</var>.
When the <b><size></b> is used with <b><percentage></b>, the calculated value of <a class="property" data-link-type="propdesc" href="#propdef-polar-distance" id="ref-for-propdef-polar-distance-6">polar-distance</a> is constant regardless of the value of <a class="property" data-link-type="propdesc" href="#propdef-polar-angle" id="ref-for-propdef-polar-angle-7">polar-angle</a>.</p>
<dl>
<dt><var>closest-side</var>
<dd> The distance is measured between the origin and the closest side of the box from it.
<dt><var>closest-corner</var>
<dd> The distance is measured between the origin and the closest corner of the box from it.
<dt><var>farthest-side</var>
<dd> The distance is measured between the origin and the farthest side of the box from it.
<dt><var>farthest-corner</var>
<dd> The distance is measured between the origin and the farthest corner of the box from it.
</dl>
<p class="note" role="note"> Note: When the origin of polar coordinates is at one of the corners of the containing block, the closest side takes the edge which meets with the origin. Even if the offset given by <a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-values-3/#length-value" title="Expands to: em | advance measure | ch | vmin | cm | pc | pixel unit | in | rem | q | vh | ex | pt | vw | vmax | mm"><length></a> or <a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-values-3/#percentage-value"><percentage></a> changes, the position of the element specified with <a class="property" data-link-type="propdesc">closest-side</a> is the same. </p>
</dl>
<dl>
<dt><var>contain</var>
<dd> Adjust <a class="property" data-link-type="propdesc" href="#propdef-polar-distance" id="ref-for-propdef-polar-distance-7">polar-distance</a> value of the positioned element which overflows shape of the containing block.
The main purpose of this value is avoiding overflow when positioning elements.
When overflowing occurs, the distance between the point of origin of polar coordinates and the anchor point of the element is reduced,
until there are 2 contact points or less between edge of shape of containing block and content block of the element.
</dl>
<p></p>
<div class="example" id="example-0fc21e4b">
<a class="self-link" href="#example-0fc21e4b"></a> When elements are defined like below,
<pre><div style="position: absolute; width: 40px; height: 30px;">
<div id = “circle1” style="position: absolute; width: 4px; height: 4px;"></div>
<div id = “circle2” style="position: absolute; width: 4px; height: 4px;"></div>
</div>
</pre>
<p> Specifying different <size> value for the same <percentage> value makes a difference in the positions of the elements. </p>
<p>The style below is for the (A),</p>
<pre><style>
#circle1 {
polar-origin: 10px 15px;
polar-angle: 0deg;
polar-distance: 100% closest-side;
}
#circle2 {
polar-origin: 10px 15px;
polar-angle: 90deg;
polar-distance: 100% closest-side;
}
</style>
</pre>
<p>And the next definition is for the (B)</p>
<pre><style>
#circle1 {
polar-origin: 10px 15px;
polar-angle: 0deg;
polar-distance: 100% closest-corner;
}
#circle2 {
polar-origin: 10px 15px;
polar-angle: 90deg;
polar-distance: 100% closest-corner;
}
</style>
</pre>
<p><br></p>
<div style="width: 700px; text-align:center">
<div style="float: left; width: 350px;">
<img alt="An example of polar-distance with closest-side" src="images/polar_distance_percentage_a.png" style="width: 300px">
<p>(A) With <code>closest-side</code></p>
</div>
<div style="float: left; width: 350px; ">
<img alt="An example of polar-distance with closest-corner" src="images/polar_distance_percentage_b.png" style="width: 300px">
<p>(B) With <code>closest-corner</code></p>
</div>
</div>
<div style="width: 700px">
<p class="caption">Using <size> with <percentage> for polar-distance</p>
</div>
</div>
<div class="example" id="example-5f4258fe">
<a class="self-link" href="#example-5f4258fe"></a> Here are some examples.
The first example shows positioning elements with polar-distance not using extent keyword value. Some parts of elements are outside the boundary of the containing block’s shape:
<pre><body>
<div style="position: absolute; polar-angle: 45deg; polar-distance: 100%"></div>
<div style="position: absolute; polar-angle: 180deg; polar-distance: 100%"></div>
</body>
</pre>
<div style="width: 500px; text-align: center"> <img alt="An image about elements positioned by polar-distance without contain" src="images/polar_distance_a.png" style="width: 350px;"> </div>
<p>In the second example, <a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css-containment-3/#propdef-contain">contain</a>, the extent keyword value is added to the polar-distance value of each element to avoid overflowing.</p>
<pre><body>
<div style="position: absolute; polar-angle: 45deg; polar-distance: 100% contain"></div>
<div style="position: absolute; polar-angle: 180deg; polar-distance: 100% contain"></div>
</body>
</pre>
<div style="width: 500px; text-align: center"> <img alt="An image about elements positioned by polar-distance with contain" src="images/polar_distance_b.png" style="width: 350px;"> </div>
</div>
<h3 class="heading settled" data-level="7.3" id="polar-origin-property"><span class="secno">7.3. </span><span class="content">The <a class="property" data-link-type="propdesc" href="#propdef-polar-origin" id="ref-for-propdef-polar-origin-2">polar-origin</a> property</span><a class="self-link" href="#polar-origin-property"></a></h3>
<p> The <a class="property" data-link-type="propdesc" href="#propdef-polar-origin" id="ref-for-propdef-polar-origin-3">polar-origin</a> property establishes the point of origin for coordinate system. It sets the horizontal and vertical representative point at which the offset values of the element is applied. <br> </p>
<table class="def propdef" data-link-for-hint="polar-origin">
<tbody>
<tr>
<th>Name:
<td><dfn class="dfn-paneled css" data-dfn-type="property" data-export="" id="propdef-polar-origin">polar-origin</dfn>
<tr class="value">
<th>Value:
<td class="prod">auto <a data-link-type="grammar" href="https://drafts.csswg.org/css-values-3/#comb-one">|</a> <a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-backgrounds-3/#position"><position></a>
<tr>
<th>Initial:
<td>auto
<tr>
<th>Applies to:
<td><a href="https://drafts.csswg.org/css-pseudo/#generated-content" title="Includes ::before and ::after pseudo-elements.">all elements</a>
<tr>
<th>Inherited:
<td>no
<tr>
<th>Percentages:
<td>Refer to the size of containing block
<tr>
<th>Media:
<td>visual
<tr>
<th>Computed value:
<td>as specified
<tr>
<th>Animatable:
<td>as <a href="https://www.w3.org/TR/css3-transitions/#animtype-lpcalc">length, percentage, or calc</a>
</table>
<p> Values are defined as follows: </p>
<dl>
<dt><var>auto</var>
<dd> Computes to <var>center</var> if <a class="property" data-link-type="propdesc" href="#propdef-polar-origin" id="ref-for-propdef-polar-origin-4">polar-origin</a> is used in polar coordinates. But it computes as the box model layout in Cartesian coordinates. <br> In polar coordinates, there are many use cases specifying the position of the origin at the center point of the containing block. Therefore an element is positioned to the horizontally and vertically center in the area of the containing block when auto value is given to the <a class="property" data-link-type="propdesc" href="#propdef-polar-origin" id="ref-for-propdef-polar-origin-5">polar-origin</a>.
But if it is used in conventional coordinate system, the origin of coordinate system is at the upper left corner of the containing block by default. For example, <a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css-position-3/#propdef-top">top</a> and <a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css-position-3/#propdef-left">left</a> are used for positioning the element, auto value makes the same result of giving 'top left' as the value of <a class="property" data-link-type="propdesc" href="#propdef-polar-origin" id="ref-for-propdef-polar-origin-6">polar-origin</a>.
</dl>
<dl>
<dt><a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-backgrounds-3/#position"><position></a>
<dd>
Values of <a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-backgrounds-3/#position"><position></a> are defined like below:
<dl>
<dt><var><percentage></var>
<dd> A percentage for the horizontal offset is relative to the width of the containing block. A percentage for the vertical offset is relative to height of the containing block.
</dl>
<dl>
<dt><var><length></var>
<dd> A length value gives a fixed length as the offset. The value for the horizontal and vertical offset represent an offset from the top left corner of the containing block.
</dl>
<dl>
<dt><var>top</var>
<dd> Computes to 0% for the vertical position.
</dl>
<dl>
<dt><var>right</var>
<dd> Computes to 100% for the horizontal position.
</dl>
<dl>
<dt><var>bottom</var>
<dd> Computes to 100% for the vertical position.
</dl>
<dl>
<dt><var>left</var>
<dd> Computes to 0% for the horizontal position.
</dl>
<dl>
<dt><var>center</var>
<dd> Computes to 50% (left 50%) for the horizontal position if the horizontal position is not otherwise specified, or 50% (top 50%) for the vertical position if it is.
</dl>
</dl>
<p></p>
<div class="example" id="example-525437ec">
<a class="self-link" href="#example-525437ec"></a> This example shows how auto value of polar-origin is calculated differently depending on which coordinate system elements are positioned in.
<pre>#item1 {
polar-origin: auto;
polar-distance: 10px;
polar-angle: 90deg;
}
</pre>
<div style="width: 600px; text-align: center">
<img alt="An image about interpreting auto of polar-origin in polar coordinates" src="images/polar_origin_a.png" style="width: 300px; text-align: center">
<p class="caption">"polar-origin: auto" is the same result with "polar-origin: center"</p>
</div>