182182 <!-- User Profile Section -->
183183 <div class =" section user-profile" data-testid =" user-profile" >
184184 <h2 >User Profile</h2 >
185- <img src =" data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAwIiBoZWlnaHQ9IjEwMCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KICA8Y2lyY2xlIGN4PSI1MCIgY3k9IjUwIiByPSI0MCIgZmlsbD0iIzY2NzMiLz4KICA8dGV4dCB4PSI1MCIgeT0iNTUiIGZvbnQtZmFtaWx5PSJBcmlhbCIgZm9udC1zaXplPSIxNCIgZmlsbD0id2hpdGUiIHRleHQtYW5jaG9yPSJtaWRkbGUiPlVzZXI8L3RleHQ +Cjwvc3ZnPgo="
185+ <img src =" data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAwIiBoZWlnaHQ9IjEwMCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KICA8Y2lyY2xlIGN4PSI1MCIgY3k9IjUwIiByPSI0MCIgZmlsbD0iIzY2NzMiLz4KICA8dGV4dCB4PSI1MCIgeT0iNTUiIGZvcnQtZmFtaWx5PSJBcmlhbCIgZm9udC1zaXplPSIxNCIgZmlsbD0id2hpdGUiIHRleHQtYW5jaG9yPSJtaWRkbGUiPlVzZXI8L3RleHQ +Cjwvc3ZnPgo="
186186 alt =" Profile Picture"
187187 class =" profile-picture" />
188188
@@ -284,7 +284,58 @@ class="profile-picture" />
284284 <div data-testid =" scroll-target" style =" margin-top : 500px ;" >
285285 This element is far down the page for scroll testing
286286 </div >
287- </div > <script >
287+ </div >
288+
289+ <!-- Edge case elements that might return malformed bounding box data -->
290+ <div class =" section" >
291+ <h2 >Edge Case Elements for Bounding Box Testing</h2 >
292+
293+ <!-- Elements with unusual CSS properties -->
294+ <div data-testid =" zero-width-element" style =" width : 0 ; height : 0 ; overflow : hidden ;" >Zero dimensions element
295+ </div >
296+ <div data-testid =" negative-margin-element" style =" margin : -100px ; width : 50px ; height : 50px ;" >Negative margin element
297+ </div >
298+ <div data-testid =" transform-element" style =" transform : scale (0 ); width : 100px ; height : 100px ;" >Scaled to zero element
299+ </div >
300+ <div data-testid =" position-absolute-element" style =" position : absolute ; left : -9999px ; top : -9999px ;" >Off-screen absolute element
301+ </div >
302+
303+ <!-- Elements that might cause bounding box calculation issues -->
304+ <div data-testid =" float-element" style =" float : left ; width : 0.1px ; height : 0.1px ;" >Tiny float element</div >
305+ <div data-testid =" inline-block-element" style =" display : inline-block ; width : 0 ; height : 0 ;" >Inline block zero size
306+ </div >
307+
308+ <!-- SVG elements that might have edge cases -->
309+ <svg width =" 0" height =" 0" data-testid =" zero-svg" >
310+ <rect width =" 0" height =" 0" data-testid =" zero-rect" />
311+ </svg >
312+
313+ <!-- Table elements with edge cases -->
314+ <table data-testid =" empty-table" style =" border-collapse : collapse ;" >
315+ <tr data-testid =" empty-row" >
316+ <td data-testid =" empty-cell" style =" padding : 0 ; margin : 0 ; width : 0 ; height : 0 ;" ></td >
317+ </tr >
318+ </table >
319+
320+ <!-- Elements with CSS that might cause calculation errors -->
321+ <div data-testid =" overflow-hidden-element" style =" overflow : hidden ; width : 0 ; height : 0 ;" >
322+ <div style =" width : 100px ; height : 100px ;" >Hidden content</div >
323+ </div >
324+
325+ <!-- Element with complex transform that might break calculations -->
326+ <div data-testid =" complex-transform-element" style =" transform : matrix (0 , 0 , 0 , 0 , 0 , 0 ); width : 100px ; height : 100px ;" >Matrix transform zero
327+ </div >
328+
329+ <!-- Element with visibility hidden but dimensions -->
330+ <div data-testid =" visibility-hidden-element" style =" visibility : hidden ; width : 100px ; height : 100px ;" >Visibility hidden element
331+ </div >
332+
333+ <!-- Element with opacity 0 -->
334+ <div data-testid =" opacity-zero-element" style =" opacity : 0 ; width : 100px ; height : 100px ;" >Opacity zero element
335+ </div >
336+ </div >
337+
338+ <script >
288339 // Counter for click testing
289340 let clickCounter = 0 ;
290341
@@ -318,46 +369,46 @@ function trackHover(elementId) {
318369 }
319370
320371 // Add some basic interactivity for testing
321- document .addEventListener (' DOMContentLoaded' , function () {
372+ document .addEventListener (' DOMContentLoaded' , function () {
322373 // Event button click handler
323374 const eventButton = document .getElementById (' event-button' );
324375 const eventResult = document .getElementById (' event-result' );
325376
326377 if (eventButton && eventResult) {
327- eventButton .addEventListener (' click' , function () {
378+ eventButton .addEventListener (' click' , function () {
328379 eventResult .textContent = ' Button was clicked!' ;
329380 });
330381 }
331382
332383 // Add focus tracking event listeners
333- document .getElementById (' focus-target' ).addEventListener (' focus' , function () {
384+ document .getElementById (' focus-target' ).addEventListener (' focus' , function () {
334385 trackFocus (' focus-target' );
335386 });
336- document .getElementById (' username' ).addEventListener (' focus' , function () {
387+ document .getElementById (' username' ).addEventListener (' focus' , function () {
337388 trackFocus (' username' );
338389 });
339- document .getElementById (' password' ).addEventListener (' focus' , function () {
390+ document .getElementById (' password' ).addEventListener (' focus' , function () {
340391 trackFocus (' password' );
341392 });
342- document .getElementById (' search' ).addEventListener (' focus' , function () {
393+ document .getElementById (' search' ).addEventListener (' focus' , function () {
343394 trackFocus (' search' );
344395 });
345- document .getElementById (' comments' ).addEventListener (' focus' , function () {
396+ document .getElementById (' comments' ).addEventListener (' focus' , function () {
346397 trackFocus (' comments' );
347398 });
348399
349400 // Hover tracking
350401 const hoverTarget = document .getElementById (' hover-target' );
351402 if (hoverTarget) {
352403 [' mouseenter' , ' mouseover' , ' pointerenter' ].forEach (event => {
353- hoverTarget .addEventListener (event , function () {
404+ hoverTarget .addEventListener (event , function () {
354405 trackHover (' hover-target' );
355406 });
356407 });
357408 }
358409
359410 // Add global hover detection for Playwright compatibility
360- document .addEventListener (' mousemove' , function (e ) {
411+ document .addEventListener (' mousemove' , function (e ) {
361412 if (e .target .id === ' hover-target' ) {
362413 trackHover (' hover-target' );
363414 }
@@ -366,7 +417,7 @@ function trackHover(elementId) {
366417 // Make forms more interactive
367418 const usernameInput = document .getElementById (' username' );
368419 if (usernameInput) {
369- usernameInput .addEventListener (' input' , function () {
420+ usernameInput .addEventListener (' input' , function () {
370421 console .log (' Username changed to:' , this .value );
371422 });
372423 }
0 commit comments