File tree 4 files changed +43
-9
lines changed
src/librustdoc/html/static/css
4 files changed +43
-9
lines changed Original file line number Diff line number Diff line change @@ -1081,15 +1081,9 @@ so that we can apply CSS-filters to change the arrow color in themes */
1081
1081
}
1082
1082
1083
1083
.item-info .stab {
1084
- /* This min-height is needed to unify the height of the stab elements because some of them
1085
- have emojis.
1086
- */
1087
- min-height : 36px ;
1088
- display : flex;
1084
+ display : block;
1089
1085
padding : 3px ;
1090
1086
margin-bottom : 5px ;
1091
- align-items : center;
1092
- vertical-align : text-bottom;
1093
1087
}
1094
1088
.item-name .stab {
1095
1089
margin-left : 0.3125em ;
@@ -1112,17 +1106,26 @@ so that we can apply CSS-filters to change the arrow color in themes */
1112
1106
color : var (--stab-code-color );
1113
1107
}
1114
1108
1115
- .stab .emoji {
1109
+ .stab .emoji , . item-info . stab :: before {
1116
1110
font-size : 1.25rem ;
1111
+ }
1112
+ .stab .emoji {
1117
1113
margin-right : 0.3rem ;
1118
1114
}
1115
+ .item-info .stab ::before {
1116
+ /* ensure badges with emoji and without it have same height */
1117
+ content : "\0" ;
1118
+ width : 0 ;
1119
+ display : inline-block;
1120
+ color : transparent;
1121
+ }
1119
1122
1120
1123
/* Black one-pixel outline around emoji shapes */
1121
1124
.emoji {
1122
1125
text-shadow :
1123
1126
1px 0 0 black,
1124
1127
-1px 0 0 black,
1125
- 0 1px 0 black,
1128
+ 0 1px 0 black,
1126
1129
0 -1px 0 black;
1127
1130
}
1128
1131
Original file line number Diff line number Diff line change @@ -8,7 +8,22 @@ assert-size: (".item-info", {"width": 840})
8
8
assert-size: (".item-info .stab", {"width": 289})
9
9
assert-position: (".item-info .stab", {"x": 245})
10
10
11
+ // We check that the display of the feature elements is not broken. It serves as regression
12
+ // test for <https://github.com/rust-lang/rust/issues/118615>.
13
+ set-window-size: (850, 800)
14
+ store-position: (
15
+ "//*[@class='stab portability']//code[text()='Win32_System']",
16
+ {"x": first_line_x, "y": first_line_y},
17
+ )
18
+ store-position: (
19
+ "//*[@class='stab portability']//code[text()='Win32_System_Diagnostics']",
20
+ {"x": second_line_x, "y": second_line_y},
21
+ )
22
+ assert: |first_line_x| != |second_line_x| && |first_line_x| == 516 && |second_line_x| == 272
23
+ assert: |first_line_y| != |second_line_y| && |first_line_y| == 688 && |second_line_y| == 711
24
+
11
25
// Now we ensure that they're not rendered on the same line.
26
+ set-window-size: (1100, 800)
12
27
go-to: "file://" + |DOC_PATH| + "/lib2/trait.Trait.html"
13
28
// We first ensure that there are two item info on the trait.
14
29
assert-count: ("#main-content > .item-info .stab", 2)
Original file line number Diff line number Diff line change @@ -6,6 +6,13 @@ edition = "2018"
6
6
[lib ]
7
7
path = " lib.rs"
8
8
9
+ [features ]
10
+ Win32 = [" Win32_System" ]
11
+ Win32_System = [" Win32_System_Diagnostics" ]
12
+ Win32_System_Diagnostics = [" Win32_System_Diagnostics_Debug" ]
13
+ Win32_System_Diagnostics_Debug = []
14
+ default = [" Win32" ]
15
+
9
16
[dependencies ]
10
17
implementors = { path = " ./implementors" }
11
18
http = { path = " ./http" }
Original file line number Diff line number Diff line change 1
1
// ignore-tidy-linelength
2
2
3
3
#![ feature( doc_cfg) ]
4
+ #![ feature( doc_auto_cfg) ]
4
5
5
6
pub mod another_folder;
6
7
pub mod another_mod;
@@ -28,6 +29,14 @@ impl Foo {
28
29
/// Some documentation
29
30
/// # A Heading
30
31
pub fn a_method ( & self ) { }
32
+
33
+ #[ cfg( all(
34
+ feature = "Win32" ,
35
+ feature = "Win32_System" ,
36
+ feature = "Win32_System_Diagnostics" ,
37
+ feature = "Win32_System_Diagnostics_Debug"
38
+ ) ) ]
39
+ pub fn lot_of_features ( ) { }
31
40
}
32
41
33
42
#[ doc( cfg( feature = "foo-method" ) ) ]
You can’t perform that action at this time.
0 commit comments