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