getBoundingClientRect() returns wrong value for td and its descendants for a vertical table
Reported by
yuki.sek...@access-company.com,
Apr 13 2017
|
|||
Issue descriptionUserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.133 Safari/537.36 Steps to reproduce the problem: 1. Open the attached getBoundingClientRect-vertical-under-td-orig.html 2. It should show SUCCESS but shows FAILED with the actual rect. What is the expected behavior? The rect of td is contained by the rect of its tr. What went wrong? The content checks whether the rect of td is contained by the rect of its tr. getBoundingClientRect() returns the rect of td which is very far from the rect of tr. Inspector shows a wrong rect for td as well. Did this work before? No Does this work in other browsers? Yes Chrome version: 57.0.2987.133 Channel: stable OS Version: OS X 10.12.3 Flash Version:
,
Apr 13 2017
The screenshot which the inspector highlights wrong position for td.
,
Apr 13 2017
So WebKit gets it wrong for <tr> while Blink does not. Is that right?
,
Apr 14 2017
Yes, it is. Blink sets a logical location to a LayoutTableRow. This is right. https://cs.chromium.org/chromium/src/third_party/WebKit/Source/core/layout/LayoutTableSection.cpp?q=LayoutTableSection+package:%5Echromium$&dr=CSs&l=1152 WebKit sets a physical location to a RenderTableRow. This is wrong, so I'm fixing it. https://trac.webkit.org/browser/webkit/trunk/Source/WebCore/rendering/RenderTableSection.cpp#L613
,
Apr 18 2017
,
Apr 26 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/5cdd84c272ce41e804a9d4447b288f44d748c6af commit 5cdd84c272ce41e804a9d4447b288f44d748c6af Author: yuki.sekiguchi <yuki.sekiguchi@access-company.com> Date: Wed Apr 26 21:45:25 2017 LayoutTableCell::OffsetFromContainer() should use the flipped offset of its parent. Since LayoutTableCell is relative to LayoutTableSection, it should subtract the offset of the LayoutTableRow. OffsetFromContainer() is flipped value, but LayoutTableCell::OffsetFromContainer() uses LocationOffset() which is an unflipped location. Therefore, the rect of td goes outside of tr. It should use PhysicalLocationOffset() which returns a flipped location. BUG= 711193 Review-Url: https://codereview.chromium.org/2816983002 Cr-Commit-Position: refs/heads/master@{#467467} [modify] https://crrev.com/5cdd84c272ce41e804a9d4447b288f44d748c6af/AUTHORS [add] https://crrev.com/5cdd84c272ce41e804a9d4447b288f44d748c6af/third_party/WebKit/LayoutTests/fast/dom/Element/getBoundingClientRect-vertical-child.html [modify] https://crrev.com/5cdd84c272ce41e804a9d4447b288f44d748c6af/third_party/WebKit/Source/core/layout/LayoutTableCell.cpp
,
Apr 27 2017
Yuki, I think this issue is fixed now. If not, would you mind outlining what else needs to be done?
,
Apr 28 2017
Yes. This is fixed now. I confirmed that getBoundingClientRect-vertical-under-td-orig.html is fixed on ToT. Since I don't have a right to close a bug, could someone close this bug?
,
Apr 28 2017
|
|||
►
Sign in to add a comment |
|||
Comment 1 by yuki.sek...@access-company.com
, Apr 13 2017