<style> a { display: none; } a:after { content: "bar"; } div:hover a { display: inline-block } </style> <div>foo<a></a></div>
<rdar://problem/16977696>
Created attachment 231834 [details] patch
Comment on attachment 231834 [details] patch View in context: https://bugs.webkit.org/attachment.cgi?id=231834&action=review Looks great. > Source/WebCore/rendering/RenderBlockFlow.cpp:3423 > const SimpleLineLayout::Layout* RenderBlockFlow::simpleLineLayout() const > { > - if (m_lineLayoutPath == UndeterminedPath) > - const_cast<RenderBlockFlow&>(*this).m_lineLayoutPath = SimpleLineLayout::canUseFor(*this) ? SimpleLinesPath : LineBoxesPath; > - > - if (m_lineLayoutPath == SimpleLinesPath) > - return m_simpleLineLayout.get(); > - > - const_cast<RenderBlockFlow&>(*this).createLineBoxes(); > - return nullptr; > + ASSERT(m_lineLayoutPath <= SimpleLinesPath || !m_simpleLineLayout); > + return m_simpleLineLayout.get(); > } Maybe we should move this back to the header file and make it an inline function again. I don’t think the assertion is strong enough. It’s seems like it’s not OK to get a non-nullptr value if m_lineLayoutPath is UndeterminedPath. But maybe we can’t put the stronger assertion in because we still need to get at m_simpleLineLayout in the time window before we determine whether to use it or not.
Created attachment 231839 [details] patch 2
> I don’t think the assertion is strong enough. It’s seems like it’s not OK to get a non-nullptr value if m_lineLayoutPath is UndeterminedPath. But maybe we can’t put the stronger assertion in because we still need to get at m_simpleLineLayout in the time window before we determine whether to use it or not. You are right. I tightened the assert and now drop the simple line layout on path invalidation.
https://trac.webkit.org/r169189