haikuwebkit/LayoutTests/fast/backgrounds/selection-background-color-...

18 lines
391 B
HTML
Raw Permalink Normal View History

Fill list style background with same color with that of list background. https://bugs.webkit.org/show_bug.cgi?id=143483 Reviewed by Simon Fraser. Source/WebCore: LayoutListMarker does not have a node so its selectionBackgroundColor alway returns the default theme color for selection. We can make it more natural by filling the same color with that of LayoutListItem into it. Tests: fast/backgrounds/selection-background-color-of-image-list-style.html fast/backgrounds/selection-background-color-of-list-style.html * rendering/RenderListMarker.cpp: (WebCore::RenderListMarker::paint): LayoutTests: * fast/backgrounds/selection-background-color-of-image-list-style.html: Added. * fast/backgrounds/selection-background-color-of-list-style.html: Added. * platform/gtk/fast/backgrounds/selection-background-color-of-image-list-style-expected.png: Added. * platform/gtk/fast/backgrounds/selection-background-color-of-image-list-style-expected.txt: Added. * platform/gtk/fast/backgrounds/selection-background-color-of-list-style-expected.png: Added. * platform/gtk/fast/backgrounds/selection-background-color-of-list-style-expected.txt: Added. * platform/mac/fast/backgrounds/selection-background-color-of-image-list-style-expected.png: Added. * platform/mac/fast/backgrounds/selection-background-color-of-image-list-style-expected.txt: Added. * platform/mac/fast/backgrounds/selection-background-color-of-list-style-expected.png: Added. * platform/mac/fast/backgrounds/selection-background-color-of-list-style-expected.txt: Added. Canonical link: https://commits.webkit.org/161549@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@182546 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2015-04-08 17:14:07 +00:00
<!DOCTYPE html>
<style>
ul { list-style-image: url('./resources/diamond.png'); }
ul>li::selection { background: yellow; }
</style>
<div>
Test pass if background of image list style in ul is yellow.
<ul>
<li>One</li>
<li>Two</li>
</ul>
</div>
<script>
var range = document.createRange();
range.selectNode(document.querySelector('ul'));
getSelection().addRange(range);
</script>