haikuwebkit/LayoutTests/fast/css/nth-child-style-sharing-odd...

48 lines
1.5 KiB
HTML
Raw Permalink Normal View History

Remove the style marking from :nth-child() https://bugs.webkit.org/show_bug.cgi?id=137055 Patch by Benjamin Poulain <bpoulain@apple.com> on 2014-09-24 Reviewed by Andreas Kling. Source/WebCore: Previously, :nth-child() had to mark the RenderStyle as unique in order to prevent it from being used for style sharing. After r173229, :nth-child() use the more generic element marking "StyleIsAffectedByPreviousSibling". In StyleResolver::canShareStyleWithElement(), StyleIsAffectedByPreviousSibling is already used to prevent style sharing of those elements, making the "Unique" flag redundant. Since it is now useless, remove the style marking from SelectorChecker and the CSS JIT. Tests: fast/css/nth-child-style-sharing-even.html fast/css/nth-child-style-sharing-fixed-integer.html fast/css/nth-child-style-sharing-odd.html * css/SelectorChecker.cpp: (WebCore::SelectorChecker::checkOne): * cssjit/SelectorCompiler.cpp: (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsNthChild): (WebCore::SelectorCompiler::setElementChildIndexAndUpdateStyle): Deleted. * rendering/style/RenderStyle.h: LayoutTests: Add basic tests for style sharing with :nth-child(). * fast/css/nth-child-style-sharing-even-expected.html: Added. * fast/css/nth-child-style-sharing-even.html: Added. * fast/css/nth-child-style-sharing-fixed-integer-expected.html: Added. * fast/css/nth-child-style-sharing-fixed-integer.html: Added. * fast/css/nth-child-style-sharing-odd-expected.html: Added. * fast/css/nth-child-style-sharing-odd.html: Added. Canonical link: https://commits.webkit.org/154883@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@173910 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-09-24 07:56:52 +00:00
<!doctype html>
<html>
<head>
<style>
div {
background-color: white;
}
</style>
</head>
<body>
<section>
<p><!-- To avoid styling the description. --></p>
<p>This tests basic style sharing with :nth-child(odd). If the test pass, lines with the text "green" should have a green background.</p>
<div style="background-color: lime">Green</div>
<div>White</div>
<div style="background-color: lime">Green</div>
<div>White</div>
<div style="background-color: lime">Green</div>
<div>
<div style="background-color: lime">Green</div>
<div>White</div>
<div style="background-color: lime">Green</div>
</div>
<div style="background-color: lime">
<div style="background-color: lime">Green</div>
<div>White</div>
<div style="background-color: lime">Green</div>
<div>White</div>
<div style="background-color: lime">Green</div>
</div>
</section>
<section>
<div style="background-color: lime">Green</div>
<div>White</div>
<div style="background-color: lime">Green</div>
<div>
<div style="background-color: lime">Green</div>
<div>White</div>
<div style="background-color: lime">Green</div>
<div>White</div>
<div style="background-color: lime">Green</div>
<div>White</div>
</div>
</section>
</body>
</html>