WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
9314
Relative positioned block size doesnt update root layer size
https://bugs.webkit.org/show_bug.cgi?id=9314
Summary
Relative positioned block size doesnt update root layer size
Sriram
Reported
2006-06-05 10:04:51 PDT
If a render block is relative positioned, the root layer doesnt get the correct size. As a result, if the browser window is too small, some of the content is clipped. To run this test case, reduce the Safari browser window size and load the page. A scroll bar should appear allowing the user to see the entire content. The original webpage (espn.com)works because espn does browser sniffing and for Safari, it doesnt include the rel positioned div element. The fix is most probably in RenderLayer::updateLayerPosition(). When the child layer position gets updated, the parent layer size needs to be updated. The bug regarding content clipping exists in IE too, but works on Firefox.
Attachments
Reduced test case for the espn rel postioning issue
(139 bytes, text/html)
2006-06-05 10:07 PDT
,
Sriram
no flags
Details
This fix resizes the parent layer after children have been positioned
(1.52 KB, patch)
2006-06-05 12:50 PDT
,
Sriram
hyatt
: review-
Details
Formatted Diff
Diff
refined test case
(371 bytes, text/html)
2006-06-10 21:17 PDT
,
Antti Koivisto
no flags
Details
patch
(2.85 KB, patch)
2006-06-10 21:24 PDT
,
Antti Koivisto
no flags
Details
Formatted Diff
Diff
patch
(2.45 KB, patch)
2006-06-10 22:22 PDT
,
Antti Koivisto
hyatt
: review-
Details
Formatted Diff
Diff
Test case that needs to be addressed via leftmost/Rightmost/lowestPosition changes.
(246 bytes, text/html)
2006-06-11 03:06 PDT
,
Dave Hyatt
no flags
Details
Second test case that uses a floating image instead of an in-flow image.
(257 bytes, text/html)
2006-06-11 03:07 PDT
,
Dave Hyatt
no flags
Details
Test Case that shows the opposite problem (does not have to be fixed to land).
(389 bytes, text/html)
2006-06-11 03:13 PDT
,
Dave Hyatt
no flags
Details
updated patch
(6.91 KB, patch)
2006-06-12 15:36 PDT
,
Antti Koivisto
no flags
Details
Formatted Diff
Diff
Another test case that is broken.
(259 bytes, text/html)
2006-06-12 19:24 PDT
,
Dave Hyatt
no flags
Details
Show Obsolete
(2)
View All
Add attachment
proposed patch, testcase, etc.
Sriram
Comment 1
2006-06-05 10:07:42 PDT
Created
attachment 8715
[details]
Reduced test case for the espn rel postioning issue
Sriram
Comment 2
2006-06-05 12:50:06 PDT
Created
attachment 8718
[details]
This fix resizes the parent layer after children have been positioned
Dave Hyatt
Comment 3
2006-06-06 02:10:20 PDT
Comment on
attachment 8718
[details]
This fix resizes the parent layer after children have been positioned This change would increase the sizes of layers even when the child is out of flow. That is incorrect and will lead to layers being way larger than they need to be. The correct place to patch would be the rightmost/lowest/leftmostPosition methods that are used to determine your scrollable area.
Antti Koivisto
Comment 4
2006-06-10 21:17:32 PDT
Created
attachment 8802
[details]
refined test case
Antti Koivisto
Comment 5
2006-06-10 21:24:46 PDT
Created
attachment 8803
[details]
patch - Take relative positioning into account in leftmost/rightmost/lowestPosition() - Ignore zero width/height elements when calculating extremes. This matches firefox behavior (and prevent this patch from breaking any layout tests).
Antti Koivisto
Comment 6
2006-06-10 22:22:12 PDT
Created
attachment 8804
[details]
patch updated patch, do relative for leftmostPosition() as well
Dave Hyatt
Comment 7
2006-06-11 02:36:19 PDT
Comment on
attachment 8804
[details]
patch r=me
Dave Hyatt
Comment 8
2006-06-11 02:38:42 PDT
Comment on
attachment 8804
[details]
patch Actually hold up. I think there's a better way to do this. There are more mistakes than just the scroll position being wrong. Basically the overflowWidth/Height/Left/Top members of RenderBlock are all wrong. When these values are computed, they don't account for relative positioning. This means we incorrectly think relpositioned objects might overflow (when they don't) and vice versa. Rather than patching leftmost/rightmost/lowestPosition, I think we should patch the computation of m_overflowLeft/Top/Width/Height to factor in relative position offsets when examining children.
Dave Hyatt
Comment 9
2006-06-11 02:42:54 PDT
This overflow-patching approach would also deal correctly with relative-positioned elements other than RenderFlows (like images).
Dave Hyatt
Comment 10
2006-06-11 02:46:42 PDT
cc'ing mitz. We basically need test cases for relative positioned elements that cause overflow (incorrectly) in the untranslated position but not in their translated position and vice versa. We should have tests where the relative positioned objects are both inline and block and flows vs. replaced content. We'll need to make sure that if we change the definition of overflow to account for relative positioning that the incremental repaint code still works properly when repainting the relpositioned child layers as a result of ancestor movement.
Dave Hyatt
Comment 11
2006-06-11 02:59:06 PDT
Even if we don't patch overflowLeft/Top/Width/Height, the leftmost/Rightmost/LowestPosition calls have to be patched in basically all the places they grab kids and look at their x/y positions, and I think it's more important to fix this case where we don't show scrollbars when we should then to get all the edge cases right. (The case where we show scrollbars when we shouldn't seems much more unlikely to occur in practice.) So you could adjust your patch to apply the relativePositionOffset at the floating objects walk (have to account for floating objects like images being relatively positioned) in RenderBlock.cpp and the child walks in RenderFlow.cpp. I would r+ a patch that is very similar to what you posted as long as it accounts for non-RenderFlow relative-positioned objects. (Patch the places in leftmost/rightmost/lowestPosition that fetch children, rather than the RenderFlow return chokepoint.)
Dave Hyatt
Comment 12
2006-06-11 03:06:40 PDT
Created
attachment 8805
[details]
Test case that needs to be addressed via leftmost/Rightmost/lowestPosition changes. Test case that shows the same problem (not showing scrollbars when we need to) when an image is relative positioned.
Dave Hyatt
Comment 13
2006-06-11 03:07:58 PDT
Created
attachment 8806
[details]
Second test case that uses a floating image instead of an in-flow image. Here's the same example, but with a floating image.
Dave Hyatt
Comment 14
2006-06-11 03:13:44 PDT
Created
attachment 8807
[details]
Test Case that shows the opposite problem (does not have to be fixed to land). Here's the reason that overflowWidth/Height/Left/Top have to be patched. In this case we show scrollbars when we didn't need to. Even if we patch left/right/lowest position, as long as overflowWidth/Height/LEft/Top are wrong, this bug will persist. Note, though, that this bug is much less severe and in fact Firefox gets it wrong too. It's unclear to me whether it even *is* wrong, since maybe you are supposed to go ahead and leave "space" for the spot in which the element participated untranslated in the layout of the object.
Antti Koivisto
Comment 15
2006-06-12 15:36:11 PDT
Created
attachment 8831
[details]
updated patch Moved the relative position correction to renderbox so it gets applied to all elements. I also split relativePositionOffset() to x and y coordinats since thats how it is mostly used.
Dave Hyatt
Comment 16
2006-06-12 19:19:47 PDT
For this... - int bottom = RenderContainer::lowestPosition(includeOverflowInterior, includeSelf); + int bottom = includeSelf && m_width > 0 ? m_height : 0; Won't calling the base class work?
Dave Hyatt
Comment 17
2006-06-12 19:21:28 PDT
Comment on
attachment 8831
[details]
updated patch Ok, this is ready. Just need test cases and results included and then I can +.
Dave Hyatt
Comment 18
2006-06-12 19:24:32 PDT
Created
attachment 8832
[details]
Another test case that is broken. Here's another test case that would be fixed if overflowWidth/Height were patched. No need to fix it before landing, but getting it attached for future work on this bug.
Dave Hyatt
Comment 19
2006-06-13 02:17:34 PDT
Comment on
attachment 8831
[details]
updated patch Antti will commit tests to go with this, so marking r+.
Antti Koivisto
Comment 20
2006-06-13 16:21:03 PDT
Commited. Overflow fix is still needed.
David Kilzer (:ddkilzer)
Comment 21
2006-06-14 19:45:34 PDT
(In reply to
comment #20
)
> Commited. Overflow fix is still needed.
Committed as
r14847
.
Timothy Hatcher
Comment 22
2006-06-21 20:39:21 PDT
Should this be open still for the other issues?
Darin Adler
Comment 23
2006-06-24 20:23:55 PDT
Comment on
attachment 8831
[details]
updated patch Clearing the review flag so this won't show up as a patch that needs to be landed.
Laszlo Gombos
Comment 24
2009-10-02 02:37:26 PDT
Changing the status to FIXED as I belie the fix has been landed a while ago.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug