Summary: | REGRESSION (r20980): Vertical alignment was working, now doesn't always work. | ||
---|---|---|---|
Product: | WebKit | Reporter: | Tom Brown <tom> |
Component: | Layout and Rendering | Assignee: | Dave Hyatt <hyatt> |
Status: | RESOLVED FIXED | ||
Severity: | Major | CC: | bdakin, hyatt, mitz |
Priority: | P1 | Keywords: | HasReduction, InRadar, Regression |
Version: | 523.x (Safari 3) | ||
Hardware: | All | ||
OS: | OS X 10.4 | ||
Attachments: |
Description
Tom Brown
2007-05-03 10:15:44 PDT
Created attachment 14320 [details]
HTML containing problem example
Created attachment 14321 [details]
Image showing broken and unbroken rendering
I'm pretty sure this regressed in <http://trac.webkit.org/projects/webkit/changeset/20980>, because adding a dummy :first-line rule at the beginning fixes the reduction. Mitz is right. The following two lines were added to the top of RenderObject::verticalPositionHint() in that patch: +if (firstLine) // We're only really a first-line style if the document actually uses first-line rules. + firstLine = document()->usesFirstLineRules(); And removing those lines fixes the bug. I hesitate to post a patch before consulting Hyatt, though, because I am confused about those lines...even though I reviewed the patch. /me feels sheepish! Bug happens on line #2. <div> Foo<br> <img src="http://i128.photobucket.com/albums/p168/p3dragonlady/FridayYet.gif" style="vertical-align:middle;outline:1px dotted red;width:9px;height:9px;"> <div style="display:inline-block;vertical-align:middle;outline:1px dotted red;text-align:center;"> Text Goes Here </div> </div> The duality of inline-block is the problem. m_verticalPositionHint being cached is causing both the inside/outside to reference it, and of course it's not right for both. Created attachment 14450 [details]
Test case that illustrates the problem without using any first lines.
This test case illustrates the bug. This test case fails in Safari 2.0 and illustrates that this flaw is not a regression. The cache itself is buggy, and so the regression stems from using the cache more.
Created attachment 14453 [details]
Make sure RenderText doesn't call verticalPositionHint on an inline block.
Don't call verticalPositionHint on an inline-block from inside the inline-block. This code path is actually the only way this could happen.
Fixed. |