Fossil SCM

Revisit [b0188ce122] to improve compatibility with web browsers lacking support for `overflow-y: clip'. It's a bit strange that `overflow-y: hidden' still truncates the box shadows, so this fallback style is only applied temporarily during the accordion panel animations.

florian 2026-01-14 12:57 trunk
Commit 490ddadcfa4a15327b1a9c408c4db7f4ca8d80956e1c9b7f8194a4a8eae710c1
1 file changed +23
--- src/accordion.js
+++ src/accordion.js
@@ -22,10 +22,27 @@
2222
** calculated. That's why setting `maxHeight' to `scrollHeight' is considered
2323
** "good enough" only during animation, but cleared afterwards.
2424
**
2525
** https://fossil-scm.org/forum/forumpost/66d7075f40
2626
** https://fossil-scm.org/home/timeline?r=accordion-fix
27
+**
28
+** To work around the missing support for `overflow-y: clip', this script uses a
29
+** fallback and sets `overflow-y: hidden' during the accordion panel animations.
30
+** That's because if `overflow-y: hidden' is set statically from the stylesheet,
31
+** the shadow of the selected or current timeline entries in the context section
32
+** of `/info' pages is still truncated on the right (which is strange, as that's
33
+** not the "y" direction) in all major browsers. Otherwise, the stylesheet might
34
+** define the fallback using the `@supports(…)' at-rule:
35
+**
36
+** .accordion_panel {
37
+** overflow-y: hidden;
38
+** }
39
+** @supports(overflow-y: clip) {
40
+** .accordion_panel {
41
+** overflow-y: clip;
42
+** }
43
+** }
2744
*/
2845
var acc_svgdata = ["data:image/svg+xml,"+
2946
"%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E"+
3047
"%3Cpath style='fill:black;opacity:0' d='M16,16H0V0h16v16z'/%3E"+
3148
"%3Cpath style='fill:rgb(240,240,240)' d='M14,14H2V2h12v12z'/%3E"+
@@ -52,15 +69,21 @@
5269
var x = this.nextElementSibling;
5370
if( this.classList.contains("accordion_closed") ){
5471
x.style.maxHeight = x.scrollHeight + "px";
5572
setTimeout(function(){
5673
x.style.maxHeight = "";
74
+ if( !window.CSS || !window.CSS.supports("overflow: clip") ){
75
+ x.style.overflowY = "";
76
+ }
5777
},250); // default.css: .accordion_panel { transition-duration }
5878
}else{
5979
x.style.maxHeight = x.scrollHeight + "px";
80
+ if( !window.CSS || !window.CSS.supports("overflow: clip") ){
81
+ x.style.overflowY = "hidden";
82
+ }
6083
setTimeout(function(){
6184
x.style.maxHeight = "0";
6285
},1);
6386
}
6487
this.classList.toggle("accordion_closed");
6588
});
6689
}
6790
--- src/accordion.js
+++ src/accordion.js
@@ -22,10 +22,27 @@
22 ** calculated. That's why setting `maxHeight' to `scrollHeight' is considered
23 ** "good enough" only during animation, but cleared afterwards.
24 **
25 ** https://fossil-scm.org/forum/forumpost/66d7075f40
26 ** https://fossil-scm.org/home/timeline?r=accordion-fix
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
27 */
28 var acc_svgdata = ["data:image/svg+xml,"+
29 "%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E"+
30 "%3Cpath style='fill:black;opacity:0' d='M16,16H0V0h16v16z'/%3E"+
31 "%3Cpath style='fill:rgb(240,240,240)' d='M14,14H2V2h12v12z'/%3E"+
@@ -52,15 +69,21 @@
52 var x = this.nextElementSibling;
53 if( this.classList.contains("accordion_closed") ){
54 x.style.maxHeight = x.scrollHeight + "px";
55 setTimeout(function(){
56 x.style.maxHeight = "";
 
 
 
57 },250); // default.css: .accordion_panel { transition-duration }
58 }else{
59 x.style.maxHeight = x.scrollHeight + "px";
 
 
 
60 setTimeout(function(){
61 x.style.maxHeight = "0";
62 },1);
63 }
64 this.classList.toggle("accordion_closed");
65 });
66 }
67
--- src/accordion.js
+++ src/accordion.js
@@ -22,10 +22,27 @@
22 ** calculated. That's why setting `maxHeight' to `scrollHeight' is considered
23 ** "good enough" only during animation, but cleared afterwards.
24 **
25 ** https://fossil-scm.org/forum/forumpost/66d7075f40
26 ** https://fossil-scm.org/home/timeline?r=accordion-fix
27 **
28 ** To work around the missing support for `overflow-y: clip', this script uses a
29 ** fallback and sets `overflow-y: hidden' during the accordion panel animations.
30 ** That's because if `overflow-y: hidden' is set statically from the stylesheet,
31 ** the shadow of the selected or current timeline entries in the context section
32 ** of `/info' pages is still truncated on the right (which is strange, as that's
33 ** not the "y" direction) in all major browsers. Otherwise, the stylesheet might
34 ** define the fallback using the `@supports(…)' at-rule:
35 **
36 ** .accordion_panel {
37 ** overflow-y: hidden;
38 ** }
39 ** @supports(overflow-y: clip) {
40 ** .accordion_panel {
41 ** overflow-y: clip;
42 ** }
43 ** }
44 */
45 var acc_svgdata = ["data:image/svg+xml,"+
46 "%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E"+
47 "%3Cpath style='fill:black;opacity:0' d='M16,16H0V0h16v16z'/%3E"+
48 "%3Cpath style='fill:rgb(240,240,240)' d='M14,14H2V2h12v12z'/%3E"+
@@ -52,15 +69,21 @@
69 var x = this.nextElementSibling;
70 if( this.classList.contains("accordion_closed") ){
71 x.style.maxHeight = x.scrollHeight + "px";
72 setTimeout(function(){
73 x.style.maxHeight = "";
74 if( !window.CSS || !window.CSS.supports("overflow: clip") ){
75 x.style.overflowY = "";
76 }
77 },250); // default.css: .accordion_panel { transition-duration }
78 }else{
79 x.style.maxHeight = x.scrollHeight + "px";
80 if( !window.CSS || !window.CSS.supports("overflow: clip") ){
81 x.style.overflowY = "hidden";
82 }
83 setTimeout(function(){
84 x.style.maxHeight = "0";
85 },1);
86 }
87 this.classList.toggle("accordion_closed");
88 });
89 }
90

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button