Bug 187524 - getClientRects and getBoundingClientRect don't follow the spec for tables
Summary: getClientRects and getBoundingClientRect don't follow the spec for tables
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: FromImplementor, InRadar
Depends on:
Blocks:
 
Reported: 2018-07-10 09:20 PDT by Boris Zbarsky
Modified: 2022-07-26 15:15 PDT (History)
8 users (show)

See Also:


Attachments
Testcase (219 bytes, text/html)
2018-07-10 09:20 PDT, Boris Zbarsky
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
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!