haikuwebkit/LayoutTests/fast/css-generated-content/svg-use-crash.html

14 lines
294 B
HTML
Raw Permalink Normal View History

Resolve ::before and ::after pseudo elements during style resolution https://bugs.webkit.org/show_bug.cgi?id=178339 Source/WebCore: Reviewed by Ryosuke Niwa. They are currently resolved during render tree building which creates problems with display:contents and animations. * dom/PseudoElement.cpp: (WebCore::PseudoElement::PseudoElement): Call InspectorInstrumentation from constructor. * style/RenderTreeUpdater.cpp: (WebCore::RenderTreeUpdater::Parent::Parent): (WebCore::RenderTreeUpdater::updateRenderTree): (WebCore::RenderTreeUpdater::pushParent): Push the full update to the parent stack. (WebCore::RenderTreeUpdater::popParent): (WebCore::RenderTreeUpdater::updateBeforeDescendants): (WebCore::RenderTreeUpdater::updateAfterDescendants): (WebCore::RenderTreeUpdater::invalidateWhitespaceOnlyTextSiblingsAfterAttachIfNeeded): * style/RenderTreeUpdater.h: * style/RenderTreeUpdaterGeneratedContent.cpp: (WebCore::RenderTreeUpdater::GeneratedContent::updatePseudoElement): No need to resolve pseudo style, we have it already. (WebCore::RenderTreeUpdater::GeneratedContent::needsPseudoElement): (WebCore::RenderTreeUpdater::GeneratedContent::updateBeforePseudoElement): Deleted. (WebCore::RenderTreeUpdater::GeneratedContent::updateAfterPseudoElement): Deleted. * style/RenderTreeUpdaterGeneratedContent.h: * style/StyleTreeResolver.cpp: (WebCore::Style::TreeResolver::resolveElement): (WebCore::Style::TreeResolver::resolvePseudoStyle): Resolve pseudos. (WebCore::Style::TreeResolver::createAnimatedElementUpdate): Make a private member function. (WebCore::Style::TreeResolver::resolveComposedTree): * style/StyleTreeResolver.h: * style/StyleUpdate.cpp: (WebCore::Style::Update::elementUpdates const): (WebCore::Style::Update::elementUpdates): Bundle the style update for an element and the associated before/after pseudos. (WebCore::Style::Update::elementStyle const): (WebCore::Style::Update::elementStyle): (WebCore::Style::Update::addElement): (WebCore::Style::Update::elementUpdate const): Deleted. (WebCore::Style::Update::elementUpdate): Deleted. * style/StyleUpdate.h: LayoutTests: <rdar://problem/35025601> Reviewed by Ryosuke Niwa. Add a test verifying a crash noticed with earlier version of this patch. * fast/css-generated-content/svg-use-crash-expected.html: Added. * fast/css-generated-content/svg-use-crash.html: Added. Canonical link: https://commits.webkit.org/194658@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@223604 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-10-18 13:41:04 +00:00
This test passes if it doesn't crash.
<svg width="100" height="100">
<style>
circle::before { content: "foo" }
circle::after { content: "bar" }
</style>
<defs>
<g id="c">
<circle cx="50" cy="50" r="40" stroke="green" stroke-width="4" fill="yellow" />
</g>
</defs>
<use xlink:href="#c"/>
</svg>