Text-combine erroneously draws vertically after non-layout-causing style change
Created attachment 250248 [details] Patch
<rdar://problem/19285490>
Comment on attachment 250248 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=250248&action=review Worth considering finding a less fragile fix. > Source/WebCore/rendering/RenderCombineText.cpp:46 > + if (m_isCombined && (!oldStyle || diff > StyleDifferenceRepaintLayer)) { > + // Layouts cause the text to be recombined; therefore, only only un-combine when the style diff causes a layout. It seems like a problem that this logic here about when layout will be caused is here and has to be kept in sync with the code that triggers the layout. Reading the code in RenderText::styleDidChange, that function checks diff == StyleDifferenceLayout so these two are already not matching! I suggest considering checking selfNeedsLayout() instead, which is more direct. Or maybe something even more direct, doing this work inside the layout logic instead of trying to predict layout here in the styleDidChange function.
Comment on attachment 250248 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=250248&action=review > LayoutTests/fast/text/text-combine-style-change-no-layout-expected.html:6 > + <div id="word" style="-webkit-text-combine: horizontal; color: red;">39</div> Red is not good for a passing test.
Comment on attachment 250248 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=250248&action=review >> Source/WebCore/rendering/RenderCombineText.cpp:46 >> + // Layouts cause the text to be recombined; therefore, only only un-combine when the style diff causes a layout. > > It seems like a problem that this logic here about when layout will be caused is here and has to be kept in sync with the code that triggers the layout. Reading the code in RenderText::styleDidChange, that function checks diff == StyleDifferenceLayout so these two are already not matching! > > I suggest considering checking selfNeedsLayout() instead, which is more direct. Or maybe something even more direct, doing this work inside the layout logic instead of trying to predict layout here in the styleDidChange function. I think selfNeedsLayout() is the best solution - it unequivocally determines if a subsequent layout will occur.
Created attachment 250397 [details] Patch for landing
Comment on attachment 250397 [details] Patch for landing Clearing flags on attachment: 250397 Committed r182609: <http://trac.webkit.org/changeset/182609>