In certain circumstances, vertical alignment no longer works as it did before. The attached example stopped working between nightly 20961 and 20988.
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.
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
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.