Bug 187524

Summary: getClientRects and getBoundingClientRect don't follow the spec for tables
Product: WebKit Reporter: Boris Zbarsky <bzbarsky>
Component: DOMAssignee: Nobody <webkit-unassigned>
Status: NEW ---    
Severity: Normal CC: ahmad.saleem792, ap, bfulgham, cdumez, rniwa, simon.fraser, webkit-bug-importer, zalan
Priority: P2 Keywords: FromImplementor, InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Testcase none

Description Boris Zbarsky 2018-07-10 09:20:21 PDT
VERSION: Safari TP 57

STEPS TO REPRODUCE: Load attached testcase.

EXPECTED BEHAVIOR: Alert shows a list with two rects in it.

ACTUAL BEHAVIOR: Alert shows a list with only one rect.

ADDITIONAL INFORMATION: https://drafts.csswg.org/cssom-view/#dom-element-getclientrects says:

  If the element on which the method was invoked has a
  computed value for the display property of table or
  inline-table include both the table box and the caption
  box, if any, but not the anonymous container box.

but WebKit seems to be returning only the anonymous container box.

Gecko follows the spec here, fwiw.
Comment 1 Boris Zbarsky 2018-07-10 09:20:59 PDT
Created attachment 344704 [details]
Testcase
Comment 2 Radar WebKit Bug Importer 2018-07-10 11:35:56 PDT
<rdar://problem/42033168>
Comment 3 Ahmad Saleem 2022-07-26 15:15:16 PDT
Chrome Canary 106:

{"0":{"x":8,"y":8,"width":200,"height":37,"top":8,"right":208,"bottom":45,"left":8}}

Firefox Nightly 104:

{"0":{"x":8,"y":25,"width":100,"height":20,"top":25,"right":108,"bottom":45,"left":8},"1":{"x":8,"y":8,"width":200,"height":17,"top":8,"right":208,"bottom":25,"left":8}}

Safari 15.6 on macOS 12.5:

{"0":{"x":8,"y":8,"width":200,"height":37,"top":8,"right":208,"bottom":45,"left":8}}

______

I a not sure on expected behavior but it seems Safari and Chrome are only showing single rect rather than two like Firefox. Thanks!