File tree 1 file changed +3
-5
lines changed
src/librustdoc/html/static/js
1 file changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -1114,8 +1114,7 @@ function preLoadCss(cssUrl) {
1114
1114
wrapper . style . left = 0 ;
1115
1115
wrapper . style . right = "auto" ;
1116
1116
wrapper . style . visibility = "hidden" ;
1117
- const body = document . getElementsByTagName ( "body" ) [ 0 ] ;
1118
- body . appendChild ( wrapper ) ;
1117
+ document . body . appendChild ( wrapper ) ;
1119
1118
const wrapperPos = wrapper . getBoundingClientRect ( ) ;
1120
1119
// offset so that the arrow points at the center of the "(i)"
1121
1120
const finalPos = pos . left + window . scrollX - wrapperPos . width + 24 ;
@@ -1234,8 +1233,7 @@ function preLoadCss(cssUrl) {
1234
1233
}
1235
1234
window . CURRENT_TOOLTIP_ELEMENT . TOOLTIP_BASE . TOOLTIP_FORCE_VISIBLE = false ;
1236
1235
}
1237
- const body = document . getElementsByTagName ( "body" ) [ 0 ] ;
1238
- body . removeChild ( window . CURRENT_TOOLTIP_ELEMENT ) ;
1236
+ document . body . removeChild ( window . CURRENT_TOOLTIP_ELEMENT ) ;
1239
1237
clearTooltipHoverTimeout ( window . CURRENT_TOOLTIP_ELEMENT ) ;
1240
1238
window . CURRENT_TOOLTIP_ELEMENT = null ;
1241
1239
}
@@ -1832,7 +1830,7 @@ href="https://doc.rust-lang.org/${channel}/rustdoc/read-documentation/search.htm
1832
1830
let elem = event . target ;
1833
1831
while ( ! hasClass ( elem , "example-wrap" ) ) {
1834
1832
elem = elem . parentElement ;
1835
- if ( elem . tagName === " body" || hasClass ( elem , "docblock" ) ) {
1833
+ if ( elem === document . body || hasClass ( elem , "docblock" ) ) {
1836
1834
return null ;
1837
1835
}
1838
1836
}
You can’t perform that action at this time.
0 commit comments