NEW 9774
Element Position is incorrect with regards to the ancestor box
https://bugs.webkit.org/show_bug.cgi?id=9774
Summary Element Position is incorrect with regards to the ancestor box
Will Stoutin
Reported 2006-07-06 20:48:11 PDT
On the homepage "Lion's Eye" logo covers up much text. Click on "Current Students" near the top of the page and the header text "Useful" appears on the wrong side and higher up on the page than it should be. Some pages (including current students) have links for "larger text" and "print this page" which should be in the right hand corner of the white area but appear to the left in webkit. Problems exist in Safari, Omniweb, Shiira, but all pages render fine in Camino and Firefox.
Attachments
reduced test case (1.38 KB, text/html)
2006-07-07 06:35 PDT, Sam Weinig
no flags
Slightly more reduced test case (1.20 KB, text/html)
2006-07-09 04:14 PDT, jonathanjohnsson
no flags
Patch, including layout test and change log (25.86 KB, patch)
2006-07-11 11:25 PDT, mitz
mitz: review-
updated patch (26.22 KB, patch)
2006-11-13 10:55 PST, Sam Weinig
mitz: review-
patch with new ChangeLog (26.21 KB, patch)
2006-11-13 14:28 PST, Sam Weinig
mitz: review-
screenshot of rendering error (146.46 KB, image/png)
2007-05-18 21:38 PDT, Carla Hufstedler
no flags
rendering in safari, firefox, chromering (157.45 KB, image/png)
2024-07-04 02:20 PDT, Karl Dubost
no flags
Sam Weinig
Comment 1 2006-07-07 06:35:32 PDT
Created attachment 9246 [details] reduced test case Adding a reduced test case to illustrate the difference between ToT and Firefox.
jonathanjohnsson
Comment 2 2006-07-09 04:11:26 PDT
I see this too. Reporter, you should file one bug report for each issue you see, unless you are certain they all have the same root cause. Since Sam Weinig already added a test case for the wrong logo placement, I think it would be good to only track that bug here, and that you should file new bugs for the other issues.
jonathanjohnsson
Comment 3 2006-07-09 04:14:32 PDT
Created attachment 9291 [details] Slightly more reduced test case I reduced Sam's reduction slightly, without removing the issue.
mitz
Comment 4 2006-07-11 11:25:14 PDT
Created attachment 9373 [details] Patch, including layout test and change log
David Kilzer (:ddkilzer)
Comment 5 2006-07-11 11:30:25 PDT
Is this a regression from production Safari? If so, it needs to be P1 and have a NeedsRadar keyword added.
Sam Weinig
Comment 6 2006-07-11 14:14:37 PDT
This issue is present in the current production safari (for 10.4.7, 419.3), so this is not a regression. Leaving it at P2.
mitz
Comment 7 2006-11-13 00:14:37 PST
Comment on attachment 9373 [details] Patch, including layout test and change log This patch is actually wrong. You should pass nonAnonymousContainingBlock()->contentHeight() to calcValue() instead of containingBlockHeight().
Sam Weinig
Comment 8 2006-11-13 10:55:06 PST
Created attachment 11504 [details] updated patch This updates mitz's patch based on his comments.
mitz
Comment 9 2006-11-13 11:12:07 PST
Comment on attachment 11504 [details] updated patch r- due to some ChangeLog issues I discussed with Sam on IRC.
Sam Weinig
Comment 10 2006-11-13 14:28:44 PST
Created attachment 11511 [details] patch with new ChangeLog Updated patch. Someone should really test this before landing as my computer is rather on the fritz and the results have been rather inconsistent.
mitz
Comment 11 2006-11-13 22:23:54 PST
(In reply to comment #10) > Someone should really test this before landing as my computer > is rather on the fritz and the results have been rather inconsistent. > I applied the patch to my tree and verified that there are no layout test regressions (and that the new test passes).
Dave Hyatt
Comment 12 2006-11-14 01:43:47 PST
I'm not so sure about this. Why should anonymous blocks be skipped?
mitz
Comment 13 2006-11-14 03:33:42 PST
(In reply to comment #12) > I'm not so sure about this. Why should anonymous blocks be skipped? > We talked about it on IRC. The spec doesn't say anything about it, but Firefox and Opera do it even in strict mode. However, the patch is incomplete since it addresses percentage 'top' and 'bottom' but not percentage 'height' (the latter skips anonymous blocks in quirks mode, but only because it skips all block with height: auto in that mode); starting from the nonAnonymousContainingBlock in calcPercentageHeight should solve that. The layout test should cover percentage height.
mitz
Comment 14 2006-11-14 03:35:52 PST
Comment on attachment 11511 [details] patch with new ChangeLog r- due to the above
Carla Hufstedler
Comment 15 2007-05-18 21:38:15 PDT
Created attachment 14619 [details] screenshot of rendering error showing the error reported as of build 420+
Carla Hufstedler
Comment 16 2007-05-18 21:50:48 PDT
I'm not so certain this is a WebKit bug, per se, since I just validated the webpage in question, and it failed with 140 XHTML errors (http://validator.w3.org/check?uri=http%3A//www.exeter.edu/). There are also several CSS errors (http://jigsaw.w3.org/css-validator/validator?uri=http%3A//www.exeter.edu/), including the repeated substitution of "font-name" for "font-family".
mitz
Comment 17 2007-06-01 08:37:18 PDT
(In reply to comment #13) > The spec doesn't say anything about it Actually, I think the spec is pretty clear: "if the element's position is 'relative' or 'static', the containing block is formed by the content edge of the nearest *block-level*, table cell or inline-block ancestor box" (<http://www.w3.org/TR/2006/WD-CSS21-20061106/visudet.html#containing-block-details>). Generating an anonymous block box doesn't make you a block-level element. I think containingBlock() should just be changed to not return anonymous blocks in this case. The problem is that some callers expect the current behavior, so I think containingBlock() could have an allowAnonymousBlocks parameter that defaults to false, and callers that need to see anonymous boxes could be changed to pass true for that parameter. A slightly less risky approach for now would be to make the default 'true' and just patch the few callers that we know that need to skip anonymous blocks (currently relativePositionOffsetY and calcPercentageHeight).
Brent Fulgham
Comment 18 2022-07-06 14:29:48 PDT
This continues to be an issue in Safari 16.
Radar WebKit Bug Importer
Comment 19 2022-07-06 14:30:04 PDT
Karl Dubost
Comment 20 2024-07-04 02:20:32 PDT
Created attachment 471813 [details] rendering in safari, firefox, chromering The website has changed, but the issue is still happening with the test case.
Note You need to log in before you can comment on or make changes to this bug.