Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(26)

Unified Diff: LayoutTests/fast/selectors/shadow-host-div-with-span.html

Issue 220343006: Fix for ::selection pseudo element to work on input elements (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Adding another Layout Test Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: LayoutTests/fast/selectors/shadow-host-div-with-span.html
diff --git a/LayoutTests/fast/selectors/shadow-host-div-with-span.html b/LayoutTests/fast/selectors/shadow-host-div-with-span.html
new file mode 100644
index 0000000000000000000000000000000000000000..72b7931d092672a948bb0224ba0ba01d75db8abf
--- /dev/null
+++ b/LayoutTests/fast/selectors/shadow-host-div-with-span.html
@@ -0,0 +1,27 @@
+<!DOCTYPE html>
+<style>
+ span::selection { background-color: rgba(63, 128, 33, 0.95); color: yellow; }
+</style>
+<body onload="SelectText()">
+ <div id="container">
+ <span>DOM </span>
+ <div id="shadowDiv" style="display:inline"></div>
+ <span> DOM</span>
+ </div>
+ <div>
+ Above Textual Selection should have Green background and yellow color on "DOM" <br>
+ and Red background, Green color on "Shadow DOM".
+ </div>
+</body>
+<script>
+ var host = document.getElementById('shadowDiv');
+ var root = host.createShadowRoot();
+ root.innerHTML = '<style> span::selection { background-color: rgba(255, 0, 0, 0.95); color: green; } </style>' +
+ '<span>Shadow DOM </span>';
+
+ function SelectText() {
+ var ele = document.getElementById('container');
+ var selection = window.getSelection();
+ selection.selectAllChildren(ele);
+ }
+</script>

Powered by Google App Engine
This is Rietveld 408576698