1313 * limitations under the License.
1414 */
1515
16- import { MathClamp } from "pdfjs-lib" ;
17-
1816const DEFAULT_SCALE_VALUE = "auto" ;
1917const DEFAULT_SCALE = 1.0 ;
2018const DEFAULT_SCALE_DELTA = 1.1 ;
@@ -78,11 +76,8 @@ const AutoPrintRegExp = /\bprint\s*\(/;
7876 * specifying the offset from the top left edge.
7977 * @param {number } [spot.left]
8078 * @param {number } [spot.top]
81- * @param {boolean } [scrollMatches] - When scrolling search results into view,
82- * ignore elements that either: Contains marked content identifiers,
83- * or have the CSS-rule `overflow: hidden;` set. The default value is `false`.
8479 */
85- function scrollIntoView ( element , spot , scrollMatches = false ) {
80+ function scrollIntoView ( element , spot ) {
8681 // Assuming offsetParent is available (it's not available when viewer is in
8782 // hidden iframe or object). We have to scroll: if the offsetParent is not set
8883 // producing the error. See also animationStarted.
@@ -94,11 +89,8 @@ function scrollIntoView(element, spot, scrollMatches = false) {
9489 let offsetY = element . offsetTop + element . clientTop ;
9590 let offsetX = element . offsetLeft + element . clientLeft ;
9691 while (
97- ( parent . clientHeight === parent . scrollHeight &&
98- parent . clientWidth === parent . scrollWidth ) ||
99- ( scrollMatches &&
100- ( parent . classList . contains ( "markedContent" ) ||
101- getComputedStyle ( parent ) . overflow === "hidden" ) )
92+ parent . clientHeight === parent . scrollHeight &&
93+ parent . clientWidth === parent . scrollWidth
10294 ) {
10395 offsetY += parent . offsetTop ;
10496 offsetX += parent . offsetLeft ;
@@ -113,17 +105,7 @@ function scrollIntoView(element, spot, scrollMatches = false) {
113105 offsetY += spot . top ;
114106 }
115107 if ( spot . left !== undefined ) {
116- if ( scrollMatches ) {
117- const elementWidth = element . getBoundingClientRect ( ) . width ;
118- const padding = MathClamp (
119- ( parent . clientWidth - elementWidth ) / 2 ,
120- 20 ,
121- 400
122- ) ;
123- offsetX += spot . left - padding ;
124- } else {
125- offsetX += spot . left ;
126- }
108+ offsetX += spot . left ;
127109 parent . scrollLeft = offsetX ;
128110 }
129111 }
0 commit comments