New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 685927 link

Starred by 1 user

Issue metadata

Status: Fixed
Merged: issue 571978
Owner:
NOT IN USE
Closed: Mar 2017
Components:
EstimatedDays: ----
NextAction: ----
OS: Windows
Pri: 3
Type: Bug-Regression



Sign in to add a comment

getClientRects() incorrectly clipped by multicol ancestor

Reported by punit.gu...@comprotechnologies.com, Jan 27 2017

Issue description

UserAgent: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 Safari/537.36

Steps to reproduce the problem:
Please refer: https://jsfiddle.net/r2k1ng1t/5/

1. Make a div and use column-count property.
2. Make its child element.
3. Give position: relative to the child and then give left: -ve value.

What is the expected behavior?
Child element should not crop and the offset left value should decrement with left: -ve value

What went wrong?
In the case of multiple columns, parent element is cropping the child.

Due to this left offset value is also coming wrong.
It was fine in chrome version 54

Did this work before? Yes 54

Does this work in other browsers? Yes

Chrome version: 55.0.2883.87  Channel: n/a
OS Version: 10.0
Flash Version: Shockwave Flash 24.0 r0

Please refer: https://jsfiddle.net/r2k1ng1t/5/
    OR
https://output.jsbin.com/jewivo
 
issue.png
27.6 KB View Download
Components: Blink>Layout>MultiCol
Status: Untriaged (was: Unconfirmed)
Reproduced using the latest stable (56) and canary (58.0.2994.0) on Windows 7.

Comment 2 by e...@chromium.org, Jan 30 2017

Labels: -Pri-2 Pri-3
Owner: msten...@opera.com
Status: Available (was: Untriaged)

Comment 3 by msten...@opera.com, Feb 2 2017

Mergedinto: 571978
Status: Duplicate (was: Available)

Comment 4 by msten...@opera.com, Mar 14 2017

Status: Assigned (was: Duplicate)
Summary: Unexpected result for jQuery position().left and offset().left on relatively positioned multicol child (was: Multiple columns, parent is cropping its childs)
Needs a framework-less test case (i.e. get rid of jQuery).

Comment 5 by msten...@opera.com, Mar 14 2017

(the initially reported cropping was fixed by the fix for  bug 571978 , but there appears to be more things failing in that fiddle)

Comment 6 by msten...@opera.com, Mar 15 2017

Summary: getClientRects() incorrectly clipped by multicol ancestor (was: Unexpected result for jQuery position().left and offset().left on relatively positioned multicol child)
jQuery gone.

Relative positioning isn't necessary, after all. Any overflow/underflow situation will do. Looks like getClientRects() on a child will intersect with the content-box of the multicol container, or column, or something like that, which leads to over-clipped results.

offsetLeft and offsetTop work just fine, FWIW.
tc.html
663 bytes View Download
Project Member

Comment 7 by bugdroid1@chromium.org, Mar 20 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/350e4e8fb42a8010e96506fc8bbcab6ca75b5639

commit 350e4e8fb42a8010e96506fc8bbcab6ca75b5639
Author: mstensho <mstensho@opera.com>
Date: Mon Mar 20 17:26:38 2017

getClientRects() shouldn't clip against any ancestors.

Inside multicol we used to clip against the column box of each fragment. Since
fragments don't really exist in our implementation (we rather have this tall
flow thread which we slice into columns, when appropriate), we still need to
clip in the block direction, to properly fake the fragments.

Removed fragmentainerInFlowThread(), since it's no longer used. Added a
parameter to the clip rectangle calculation code, to be able to only limit the
clip rectangles in the block direction.

BUG= 685927 

Review-Url: https://codereview.chromium.org/2750153002
Cr-Commit-Position: refs/heads/master@{#458109}

[add] https://crrev.com/350e4e8fb42a8010e96506fc8bbcab6ca75b5639/third_party/WebKit/LayoutTests/fast/multicol/client-rect-overflowing-multicol-2-columns.html
[add] https://crrev.com/350e4e8fb42a8010e96506fc8bbcab6ca75b5639/third_party/WebKit/LayoutTests/fast/multicol/client-rect-overflowing-multicol.html
[modify] https://crrev.com/350e4e8fb42a8010e96506fc8bbcab6ca75b5639/third_party/WebKit/Source/core/layout/FragmentainerIterator.cpp
[modify] https://crrev.com/350e4e8fb42a8010e96506fc8bbcab6ca75b5639/third_party/WebKit/Source/core/layout/FragmentainerIterator.h
[modify] https://crrev.com/350e4e8fb42a8010e96506fc8bbcab6ca75b5639/third_party/WebKit/Source/core/layout/LayoutFlowThread.cpp
[modify] https://crrev.com/350e4e8fb42a8010e96506fc8bbcab6ca75b5639/third_party/WebKit/Source/core/layout/MultiColumnFragmentainerGroup.cpp
[modify] https://crrev.com/350e4e8fb42a8010e96506fc8bbcab6ca75b5639/third_party/WebKit/Source/core/layout/MultiColumnFragmentainerGroup.h

Comment 8 by msten...@opera.com, Mar 20 2017

Status: Fixed (was: Assigned)

Sign in to add a comment