File tree Expand file tree Collapse file tree 1 file changed +3
-5
lines changed
src/librustdoc/html/static/js Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -1114,8 +1114,7 @@ function preLoadCss(cssUrl) {
11141114 wrapper . style . left = 0 ;
11151115 wrapper . style . right = "auto" ;
11161116 wrapper . style . visibility = "hidden" ;
1117- const body = document . getElementsByTagName ( "body" ) [ 0 ] ;
1118- body . appendChild ( wrapper ) ;
1117+ document . body . appendChild ( wrapper ) ;
11191118 const wrapperPos = wrapper . getBoundingClientRect ( ) ;
11201119 // offset so that the arrow points at the center of the "(i)"
11211120 const finalPos = pos . left + window . scrollX - wrapperPos . width + 24 ;
@@ -1234,8 +1233,7 @@ function preLoadCss(cssUrl) {
12341233 }
12351234 window . CURRENT_TOOLTIP_ELEMENT . TOOLTIP_BASE . TOOLTIP_FORCE_VISIBLE = false ;
12361235 }
1237- const body = document . getElementsByTagName ( "body" ) [ 0 ] ;
1238- body . removeChild ( window . CURRENT_TOOLTIP_ELEMENT ) ;
1236+ document . body . removeChild ( window . CURRENT_TOOLTIP_ELEMENT ) ;
12391237 clearTooltipHoverTimeout ( window . CURRENT_TOOLTIP_ELEMENT ) ;
12401238 window . CURRENT_TOOLTIP_ELEMENT = null ;
12411239 }
@@ -1832,7 +1830,7 @@ href="https://doc.rust-lang.org/${channel}/rustdoc/read-documentation/search.htm
18321830 let elem = event . target ;
18331831 while ( ! hasClass ( elem , "example-wrap" ) ) {
18341832 elem = elem . parentElement ;
1835- if ( elem . tagName === " body" || hasClass ( elem , "docblock" ) ) {
1833+ if ( elem === document . body || hasClass ( elem , "docblock" ) ) {
18361834 return null ;
18371835 }
18381836 }
You can’t perform that action at this time.
0 commit comments