This patch makes CSS property |user-select:none| not to affect editability as IE and FireFox.
However, selection behavior different among browsers:
- Chrome: selection works as |user-select:text|.
- FireFox: selection works as |user-select:text| for text input and textarea. In other elements, selection can be extended by cursor key. Mouse click always set caret to start of text.
- IE: Selection can not be extended neither cursor key nor mouse click.
* editing/selection/4866671.html: Replaced with editing/selection/user-select-none-in-editable.html
* editing/selection/5779984-1.html: Replaced with editing/selection/user-select-none-in-editable.html and user-select-js-property.html, for style.webkitUserSelect property.
* fast/events/standalone-image-drag-to-editable.html: Convert to text test instead of pixel test for updating reference images, since the final image is colored with selection color.
BUG=105876
Review URL: https://chromiumcodereview.appspot.com/17225002
git-svn-id: svn://svn.chromium.org/blink/trunk@152753 bbb929c8-8fbe-4397-9dbb-9b2b20218538
diff --git a/LayoutTests/editing/selection/4866671-expected.txt b/LayoutTests/editing/selection/4866671-expected.txt
deleted file mode 100644
index 97a6277..0000000
--- a/LayoutTests/editing/selection/4866671-expected.txt
+++ /dev/null
@@ -1,23 +0,0 @@
-layer at (0,0) size 800x600
- RenderView at (0,0) size 800x600
-layer at (0,0) size 800x600
- RenderBlock {HTML} at (0,0) size 800x600
- RenderBody {BODY} at (8,8) size 784x584
- RenderBlock {P} at (0,0) size 784x18
- RenderText {#text} at (0,0) size 612x18
- text run at (0,0) width 432: "This tests caret movement through -webkit-user-select:none content. "
- text run at (432,0) width 180: "The caret should move over "
- RenderInline {B} at (0,0) size 24x18
- RenderText {#text} at (612,0) size 24x18
- text run at (612,0) width 24: "yyy"
- RenderText {#text} at (636,0) size 4x18
- text run at (636,0) width 4: "."
- RenderBlock {DIV} at (0,34) size 784x18
- RenderText {#text} at (0,0) size 8x18
- text run at (0,0) width 8: "x"
- RenderInline {SPAN} at (0,0) size 24x18
- RenderText {#text} at (8,0) size 24x18
- text run at (8,0) width 24: "yyy"
- RenderText {#text} at (32,0) size 8x18
- text run at (32,0) width 8: "x"
-caret: position 0 of child 2 {#text} of child 2 {DIV} of body
diff --git a/LayoutTests/editing/selection/4866671.html b/LayoutTests/editing/selection/4866671.html
deleted file mode 100644
index 4975886..0000000
--- a/LayoutTests/editing/selection/4866671.html
+++ /dev/null
@@ -1,11 +0,0 @@
-<p>This tests caret movement through -webkit-user-select:none content. The caret should move over <b>yyy</b>.</p>
-<div id="div" contenteditable="true">x<span style="font-weight:bold; -webkit-user-select:none;">yyy</span>x</div>
-
-<script>
-var div = document.getElementById("div");
-var sel = window.getSelection();
-
-sel.setPosition(div, 0);
-sel.modify("move", "forward", "character");
-sel.modify("move", "forward", "character");
-</script>
diff --git a/LayoutTests/editing/selection/5779984-1-expected.txt b/LayoutTests/editing/selection/5779984-1-expected.txt
deleted file mode 100644
index 206bd8e..0000000
--- a/LayoutTests/editing/selection/5779984-1-expected.txt
+++ /dev/null
@@ -1,3 +0,0 @@
-This tests setting the WebkitUserSelect property on a CSSStyleDeclaration.
-This text should not be selectable.
-This test passed if you see no failure messages.
diff --git a/LayoutTests/editing/selection/5779984-1.html b/LayoutTests/editing/selection/5779984-1.html
deleted file mode 100644
index 08431ab..0000000
--- a/LayoutTests/editing/selection/5779984-1.html
+++ /dev/null
@@ -1,18 +0,0 @@
-<div id="description">This tests setting the WebkitUserSelect property on a CSSStyleDeclaration.</div>
-<div contenteditable="true" id="test">This text should not be selectable.</div>
-
-<script>
-if (window.testRunner)
- window.testRunner.dumpAsText();
-div = document.getElementById("test");
-text = div.firstChild;
-if (div.style.WebkitUserSelect == undefined)
- document.write("FAILURE: CSSStyleDeclaration::WebkitUserSelect was undefined.<br>");
-div.style.WebkitUserSelect = "none";
-s = window.getSelection();
-s.setBaseAndExtent(text, 1, text, 2);
-if (s.type != "None")
- document.write("FAILURE: Setting -webkit-user-select to none did not have the expected effect. Setting the selection did not fail.<br>");
-
-document.write("This test passed if you see no failure messages.")
-</script>
diff --git a/LayoutTests/editing/selection/user-select-js-property-expected.txt b/LayoutTests/editing/selection/user-select-js-property-expected.txt
new file mode 100644
index 0000000..a6c1a76
--- /dev/null
+++ b/LayoutTests/editing/selection/user-select-js-property-expected.txt
@@ -0,0 +1,6 @@
+PASS selection.type is "Range"
+PASS selection.type is "None"
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/editing/selection/user-select-js-property.html b/LayoutTests/editing/selection/user-select-js-property.html
new file mode 100644
index 0000000..8d8a496
--- /dev/null
+++ b/LayoutTests/editing/selection/user-select-js-property.html
@@ -0,0 +1,34 @@
+<script src="../../fast/js/resources/js-test-pre.js"></script>
+<div id="container">
+<p id="description"></p>
+<div id="sample1" contenteditable="true">editable</div>
+<div id="sample2" contenteditable="false">uneditable</div>
+</div>
+</div>
+<script>
+function $(id) { return document.getElementById(id); }
+description('Test setting CSSStyleDeclaration.webkitUserStyle');
+
+var selection = window.getSelection();
+function setSelection(node)
+{
+ var range = document.createRange();
+ range.selectNodeContents(node);
+ selection.empty();
+ selection.addRange(range);
+}
+
+// user-select:none in editable element
+$('sample1').style.webkitUserSelect = 'none';
+setSelection($('sample1'));
+shouldBeEqualToString('selection.type', 'Range');
+
+// user-select:none in uneditable element
+$('sample2').style.webkitUserSelect = 'none';
+setSelection($('sample2'));
+shouldBeEqualToString('selection.type', 'None');
+
+if (window.testRunner)
+ $('container').outerHTML = '';
+</script>
+<script src="../../fast/js/resources/js-test-post.js"></script>
diff --git a/LayoutTests/editing/selection/user-select-none-in-editable-expected.txt b/LayoutTests/editing/selection/user-select-none-in-editable-expected.txt
new file mode 100644
index 0000000..665d75e
--- /dev/null
+++ b/LayoutTests/editing/selection/user-select-none-in-editable-expected.txt
@@ -0,0 +1,6 @@
+PASS selection.focusNode is sample2.firstChild
+PASS selection.focusOffset is 2
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/editing/selection/user-select-none-in-editable.html b/LayoutTests/editing/selection/user-select-none-in-editable.html
new file mode 100644
index 0000000..dc9552e
--- /dev/null
+++ b/LayoutTests/editing/selection/user-select-none-in-editable.html
@@ -0,0 +1,40 @@
+<style>
+.user-select-none {
+ -webkit-user-select: none;
+ -khtml-user-select: none;
+ -moz-user-select: none;
+ -ms-user-select: none;
+ -o-user-select: none;
+ user-select: none;
+}
+</style>
+<script src="../../fast/js/resources/js-test-pre.js"></script>
+<div id="container">
+<p id="description"></p>
+Manual step:
+<ol>
+<li>Move caret after "c"</li>
+<li>Hit right arrow key twice</li>
+<li>Caret should be after "Y"</li>
+</ol>
+<div id="sample1" contenteditable="true">
+abc<span id="sample2" class="user-select-none">XYZ</span>def
+</div>
+</div>
+<script>
+function $(id) { return document.getElementById(id); }
+description('Test caret movement into user-select:none content.');
+
+var sample1 = $('sample1');
+var sample2 = $('sample2');
+var selection = window.getSelection();
+selection.setPosition(sample1, 1);
+selection.modify('move', 'forward', 'character');
+selection.modify('move', 'forward', 'character');
+shouldBe('selection.focusNode', 'sample2.firstChild');
+shouldBe('selection.focusOffset', '2');
+
+if (window.testRunner)
+ $('container').outerHTML = '';
+</script>
+<script src="../../fast/js/resources/js-test-post.js"></script>
diff --git a/LayoutTests/fast/events/resources/standalone-image-drag-to-editable-frame.html b/LayoutTests/fast/events/resources/standalone-image-drag-to-editable-frame.html
index 668da4a..138d08f 100644
--- a/LayoutTests/fast/events/resources/standalone-image-drag-to-editable-frame.html
+++ b/LayoutTests/fast/events/resources/standalone-image-drag-to-editable-frame.html
@@ -3,6 +3,11 @@
<a href='rdar://problem/5021127'>rdar://problem/5021127</a>
</div></body>
<script>
+function finish()
+{
+ window.parent.finish();
+}
+
function waitForImageLoad()
{
if (!window.testRunner)
@@ -10,10 +15,10 @@
var img = document.body.getElementsByTagName("img")[0];
if (img.width != 0)
- testRunner.notifyDone();
+ finish();
else {
img.addEventListener("load", function() {
- testRunner.notifyDone();
+ finish();
}, false);
}
}
diff --git a/LayoutTests/fast/events/standalone-image-drag-to-editable-expected.txt b/LayoutTests/fast/events/standalone-image-drag-to-editable-expected.txt
index 08e76a2..7ef22e9 100644
--- a/LayoutTests/fast/events/standalone-image-drag-to-editable-expected.txt
+++ b/LayoutTests/fast/events/standalone-image-drag-to-editable-expected.txt
@@ -1,26 +1 @@
-layer at (0,0) size 800x600
- RenderView at (0,0) size 800x600
-layer at (0,0) size 800x600
- RenderBlock {HTML} at (0,0) size 800x600
- RenderFrameSet {FRAMESET} at (0,0) size 800x600
- RenderFrame {FRAME} at (0,0) size 800x100
- layer at (0,0) size 785x102
- RenderView at (0,0) size 785x100
- layer at (0,0) size 785x102
- RenderBlock {HTML} at (0,0) size 785x102
- RenderBody {BODY} at (0,0) size 785x102
- RenderBlock {DIV} at (0,0) size 785x102 [border: (1px solid #000000)]
- RenderText {#text} at (1,1) size 689x18
- text run at (1,1) width 689: "This layout test is checks that we don't crash when a stand alone image is dragged into a content editable div. "
- RenderBR {BR} at (690,15) size 0x0
- RenderInline {A} at (0,0) size 149x18 [color=#0000EE]
- RenderText {#text} at (1,30) size 149x18
- text run at (1,30) width 149: "rdar://problem/5021127"
- RenderImage {IMG} at (150,19) size 25x25
- RenderFrame {FRAME} at (0,106) size 800x100
- layer at (0,0) size 800x100
- RenderView at (0,0) size 800x100
- layer at (0,0) size 800x100
- RenderBlock {HTML} at (0,0) size 800x100
- RenderBody {BODY} at (0,0) size 800x100
- RenderImage {IMG} at (0,0) size 25x25
+PASS
diff --git a/LayoutTests/fast/events/standalone-image-drag-to-editable.html b/LayoutTests/fast/events/standalone-image-drag-to-editable.html
index 1956be3..0b02cee 100644
--- a/LayoutTests/fast/events/standalone-image-drag-to-editable.html
+++ b/LayoutTests/fast/events/standalone-image-drag-to-editable.html
@@ -1,5 +1,10 @@
<html>
<script>
+ function finish()
+ {
+ document.body.outerHTML = 'PASS';
+ testRunner.notifyDone();
+ }
function runTest()
{
if (!window.eventSender)
@@ -18,8 +23,10 @@
if (++numFramesLoaded == 2)
runTest();
}
- if (window.testRunner)
+ if (window.testRunner) {
+ testRunner.dumpAsText();
testRunner.waitUntilDone();
+ }
</script>
<frameset rows="100px, 100px, *">
<frame onload="frameLoaded()" src="resources/standalone-image-drag-to-editable-frame.html">
diff --git a/LayoutTests/fast/forms/input-select-webkit-user-select-none-expected.txt b/LayoutTests/fast/forms/input-select-webkit-user-select-none-expected.txt
index 9259ecc..eb7f4d9 100644
--- a/LayoutTests/fast/forms/input-select-webkit-user-select-none-expected.txt
+++ b/LayoutTests/fast/forms/input-select-webkit-user-select-none-expected.txt
@@ -1,5 +1,6 @@
-Tests behavior of select() in case "-webkit-user-select: none" attribute is specified to the input element. The field should not be selected.
+PASS sample.selectionStart is 0
+PASS sample.selectionEnd is sample.value.length
+PASS successfullyParsed is true
+TEST COMPLETE
-
-PASS
diff --git a/LayoutTests/fast/forms/input-select-webkit-user-select-none.html b/LayoutTests/fast/forms/input-select-webkit-user-select-none.html
index 4859ec9..9ef8258 100644
--- a/LayoutTests/fast/forms/input-select-webkit-user-select-none.html
+++ b/LayoutTests/fast/forms/input-select-webkit-user-select-none.html
@@ -1,26 +1,34 @@
-<html>
<head>
-<script>
-function test() {
- if (window.testRunner)
- testRunner.dumpAsText();
- var tf = document.getElementById('tf');
- tf.select();
- if (tf.selectionStart == 0 && tf.selectionEnd == 0) { // ;
- document.getElementById("result").innerHTML = "PASS";
- } else {
- document.getElementById("result").innerHTML = "FAIL: selection start is "
- + tf.selectionStart + " and end is " + tf.selectionEnd + ".";
- }
+<style>
+#sample {
+ -webkit-user-select: none;
+ user-select: none;
}
-</script>
+</style>
</head>
-<body onload="test()">
-<p>
-Tests behavior of select() in case "-webkit-user-select: none"
-attribute is specified to the input element. The field should not be selected.
-</p>
-<p><input type="text" id="tf" value="input text" style="-webkit-user-select: none"></input></p>
-<p id="result">TEST NOT RUN YET</p>
+<body>
+<script src="../js/resources/js-test-pre.js"></script>
+<div id="container">
+<p id="description"></p>
+Manual step
+<ol>
+ <li>Click text input to focus it</li>
+ <li>Hit Ctrl+A to select contents of text input</li>
+</ol>
+<input id="sample" value="foobar">
+</div>
+<script>
+description('Tests user-select:none doesn\'t affect select()');
+function $(id) { return document.getElementById(id); }
+
+var sample = $('sample');
+sample.focus();
+sample.select();
+shouldBe('sample.selectionStart', '0');
+shouldBe('sample.selectionEnd', 'sample.value.length');
+
+if (window.testRunner)
+ $('container').outerHTML = '';
+</script>
+<script src="../js/resources/js-test-post.js"></script>
</body>
-</html>
diff --git a/LayoutTests/fast/forms/input-user-select-none-expected.txt b/LayoutTests/fast/forms/input-user-select-none-expected.txt
new file mode 100644
index 0000000..9aea35b
--- /dev/null
+++ b/LayoutTests/fast/forms/input-user-select-none-expected.txt
@@ -0,0 +1,6 @@
+PASS sample.value is "wxy"
+PASS sample.value is "wxy"
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/fast/forms/input-user-select-none.html b/LayoutTests/fast/forms/input-user-select-none.html
new file mode 100644
index 0000000..b261bd3
--- /dev/null
+++ b/LayoutTests/fast/forms/input-user-select-none.html
@@ -0,0 +1,42 @@
+<head>
+<style>
+.sample {
+ -webkit-user-select: none;
+ user-select: none;
+}
+</style>
+</head>
+<body>
+<script src="../js/resources/js-test-pre.js"></script>
+<div id="container">
+<p id="description"></p>
+Manual step
+<ol>
+ <li>Click text input/textarea</li>
+ <li>Type text</li>
+</ol>
+<input class="sample" placeholder="edit me!" value=""><br>
+<textarea class="sample" placeholder="edit me!" ></textarea>
+</div>
+<script>
+description('Tests user-select:none doesn\'t affect editing');
+function $(id) { return document.getElementById(id); }
+
+var sample;
+var expectedText = 'wxy';
+var samples = document.querySelectorAll('.sample');
+for (var i = 0; i < samples.length; ++i) {
+ sample = samples[i];
+ sample.focus();
+ if (window.eventSender) {
+ for (var j = 0; j < expectedText.length; ++j)
+ eventSender.keyDown(expectedText[j]);
+ shouldBeEqualToString('sample.value', expectedText);
+ }
+}
+
+if (window.testRunner)
+ $('container').outerHTML = '';
+</script>
+<script src="../js/resources/js-test-post.js"></script>
+</body>
diff --git a/LayoutTests/platform/chromium-android/fast/events/standalone-image-drag-to-editable-expected.png b/LayoutTests/platform/chromium-android/fast/events/standalone-image-drag-to-editable-expected.png
deleted file mode 100644
index 147c652..0000000
--- a/LayoutTests/platform/chromium-android/fast/events/standalone-image-drag-to-editable-expected.png
+++ /dev/null
Binary files differ
diff --git a/LayoutTests/platform/chromium-android/fast/events/standalone-image-drag-to-editable-expected.txt b/LayoutTests/platform/chromium-android/fast/events/standalone-image-drag-to-editable-expected.txt
deleted file mode 100644
index 27161a4..0000000
--- a/LayoutTests/platform/chromium-android/fast/events/standalone-image-drag-to-editable-expected.txt
+++ /dev/null
@@ -1,26 +0,0 @@
-layer at (0,0) size 800x600
- RenderView at (0,0) size 800x600
-layer at (0,0) size 800x600
- RenderBlock {HTML} at (0,0) size 800x600
- RenderFrameSet {FRAMESET} at (0,0) size 800x600
- RenderFrame {FRAME} at (0,0) size 800x100
- layer at (0,0) size 800x102
- RenderView at (0,0) size 800x100
- layer at (0,0) size 800x102
- RenderBlock {HTML} at (0,0) size 800x102
- RenderBody {BODY} at (0,0) size 800x102
- RenderBlock {DIV} at (0,0) size 800x102 [border: (1px solid #000000)]
- RenderText {#text} at (1,1) size 657x19
- text run at (1,1) width 657: "This layout test is checks that we don't crash when a stand alone image is dragged into a content editable div. "
- RenderBR {BR} at (658,16) size 0x0
- RenderInline {A} at (0,0) size 146x19 [color=#0000EE]
- RenderText {#text} at (1,31) size 146x19
- text run at (1,31) width 146: "rdar://problem/5021127"
- RenderImage {IMG} at (147,21) size 25x25
- RenderFrame {FRAME} at (0,106) size 800x100
- layer at (0,0) size 800x100
- RenderView at (0,0) size 800x100
- layer at (0,0) size 800x100
- RenderBlock {HTML} at (0,0) size 800x100
- RenderBody {BODY} at (0,0) size 800x100
- RenderImage {IMG} at (0,0) size 25x25
diff --git a/LayoutTests/platform/chromium-linux/fast/events/standalone-image-drag-to-editable-expected.png b/LayoutTests/platform/chromium-linux/fast/events/standalone-image-drag-to-editable-expected.png
deleted file mode 100644
index d175abe..0000000
--- a/LayoutTests/platform/chromium-linux/fast/events/standalone-image-drag-to-editable-expected.png
+++ /dev/null
Binary files differ
diff --git a/LayoutTests/platform/chromium-mac-lion/fast/events/standalone-image-drag-to-editable-expected.png b/LayoutTests/platform/chromium-mac-lion/fast/events/standalone-image-drag-to-editable-expected.png
deleted file mode 100644
index 00abdab..0000000
--- a/LayoutTests/platform/chromium-mac-lion/fast/events/standalone-image-drag-to-editable-expected.png
+++ /dev/null
Binary files differ
diff --git a/LayoutTests/platform/chromium-mac-snowleopard/fast/events/standalone-image-drag-to-editable-expected.png b/LayoutTests/platform/chromium-mac-snowleopard/fast/events/standalone-image-drag-to-editable-expected.png
deleted file mode 100644
index 906bb07..0000000
--- a/LayoutTests/platform/chromium-mac-snowleopard/fast/events/standalone-image-drag-to-editable-expected.png
+++ /dev/null
Binary files differ
diff --git a/LayoutTests/platform/chromium-mac/fast/events/standalone-image-drag-to-editable-expected.png b/LayoutTests/platform/chromium-mac/fast/events/standalone-image-drag-to-editable-expected.png
deleted file mode 100644
index 1e1705e..0000000
--- a/LayoutTests/platform/chromium-mac/fast/events/standalone-image-drag-to-editable-expected.png
+++ /dev/null
Binary files differ
diff --git a/LayoutTests/platform/chromium-win/fast/events/standalone-image-drag-to-editable-expected.png b/LayoutTests/platform/chromium-win/fast/events/standalone-image-drag-to-editable-expected.png
deleted file mode 100644
index 78a38a8..0000000
--- a/LayoutTests/platform/chromium-win/fast/events/standalone-image-drag-to-editable-expected.png
+++ /dev/null
Binary files differ
diff --git a/LayoutTests/platform/chromium-win/fast/events/standalone-image-drag-to-editable-expected.txt b/LayoutTests/platform/chromium-win/fast/events/standalone-image-drag-to-editable-expected.txt
deleted file mode 100644
index c43ca2c..0000000
--- a/LayoutTests/platform/chromium-win/fast/events/standalone-image-drag-to-editable-expected.txt
+++ /dev/null
@@ -1,26 +0,0 @@
-layer at (0,0) size 800x600
- RenderView at (0,0) size 800x600
-layer at (0,0) size 800x600
- RenderBlock {HTML} at (0,0) size 800x600
- RenderFrameSet {FRAMESET} at (0,0) size 800x600
- RenderFrame {FRAME} at (0,0) size 800x100
- layer at (0,0) size 785x102
- RenderView at (0,0) size 785x100
- layer at (0,0) size 785x102
- RenderBlock {HTML} at (0,0) size 785x102
- RenderBody {BODY} at (0,0) size 785x102
- RenderBlock {DIV} at (0,0) size 785x102 [border: (1px solid #000000)]
- RenderText {#text} at (1,1) size 657x19
- text run at (1,1) width 657: "This layout test is checks that we don't crash when a stand alone image is dragged into a content editable div. "
- RenderBR {BR} at (658,16) size 0x0
- RenderInline {A} at (0,0) size 146x19 [color=#0000EE]
- RenderText {#text} at (1,31) size 146x19
- text run at (1,31) width 146: "rdar://problem/5021127"
- RenderImage {IMG} at (147,21) size 25x25
- RenderFrame {FRAME} at (0,106) size 800x100
- layer at (0,0) size 800x100
- RenderView at (0,0) size 800x100
- layer at (0,0) size 800x100
- RenderBlock {HTML} at (0,0) size 800x100
- RenderBody {BODY} at (0,0) size 800x100
- RenderImage {IMG} at (0,0) size 25x25
diff --git a/Source/core/dom/Position.cpp b/Source/core/dom/Position.cpp
index 21f5080..32dffe7 100644
--- a/Source/core/dom/Position.cpp
+++ b/Source/core/dom/Position.cpp
@@ -843,7 +843,7 @@
bool Position::nodeIsUserSelectNone(Node* node)
{
- return node && node->renderer() && node->renderer()->style()->userSelect() == SELECT_NONE;
+ return node && node->renderer() && node->renderer()->style()->userSelect() == SELECT_NONE && node->renderer()->style()->userModify() == READ_ONLY;
}
ContainerNode* Position::findParent(const Node* node)
diff --git a/Source/core/rendering/RenderObject.cpp b/Source/core/rendering/RenderObject.cpp
index da52773..44edf1c 100644
--- a/Source/core/rendering/RenderObject.cpp
+++ b/Source/core/rendering/RenderObject.cpp
@@ -1643,10 +1643,15 @@
#endif // NDEBUG
+static bool shouldUseSelectionColor(const RenderStyle& style)
+{
+ return style.userSelect() != SELECT_NONE || style.userModify() != READ_ONLY;
+}
+
Color RenderObject::selectionBackgroundColor() const
{
Color color;
- if (style()->userSelect() != SELECT_NONE) {
+ if (shouldUseSelectionColor(*style())) {
RefPtr<RenderStyle> pseudoStyle = getUncachedPseudoStyle(PseudoStyleRequest(SELECTION));
if (pseudoStyle && pseudoStyle->visitedDependentColor(CSSPropertyBackgroundColor).isValid())
color = pseudoStyle->visitedDependentColor(CSSPropertyBackgroundColor).blendWithWhite();
@@ -1664,7 +1669,7 @@
Color color;
// If the element is unselectable, or we are only painting the selection,
// don't override the foreground color with the selection foreground color.
- if (style()->userSelect() == SELECT_NONE
+ if (!shouldUseSelectionColor(*style())
|| (frame()->view()->paintBehavior() & PaintBehaviorSelectionOnly))
return color;