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

Unified Diff: LayoutTests/fast/forms/date-multiple-fields/date-clearbutton-preventdefault-mousecapture-status.html

Issue 594093002: Fix for mouse capture and release on ClearButtonElement (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 2 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
« no previous file with comments | « no previous file | LayoutTests/fast/forms/date-multiple-fields/date-clearbutton-preventdefault-mousecapture-status-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/fast/forms/date-multiple-fields/date-clearbutton-preventdefault-mousecapture-status.html
diff --git a/LayoutTests/fast/forms/date-multiple-fields/date-clearbutton-preventdefault-mousecapture-status.html b/LayoutTests/fast/forms/date-multiple-fields/date-clearbutton-preventdefault-mousecapture-status.html
new file mode 100644
index 0000000000000000000000000000000000000000..5c6b07b3bb56c9d3a2452521a0bb40a4628bdc48
--- /dev/null
+++ b/LayoutTests/fast/forms/date-multiple-fields/date-clearbutton-preventdefault-mousecapture-status.html
@@ -0,0 +1,39 @@
+<!DOCTYPE>
+<html>
+<head>
+<script src="../resources/common.js"></script>
+<script src="../../../resources/js-test.js"></script>
+</head>
+<body>
+
+<input id="input" type="date" style="font-family:ahem; font-size:16px;">
+<button id="js-btn-test" type="button"></button>
+
+<script>
+description('Tests, after clicking mouse on clearInputButton of date input type, will release mouse capture in case of preventdefault.');
+
+var input = document.getElementById('input');
+input.value = '2345-07-19';
+
+var btn = document.getElementById('js-btn-test');
+var output = '';
+
+btn.addEventListener('click', function ()
+{
+ output = 'Clicked';
+});
+
+document.addEventListener('mouseup', function (evt)
+{
+ evt.preventDefault();
+});
+
+var clearButton = getElementByPseudoId(internals.oldestShadowRoot(input),'-webkit-clear-button');
+clickElement(clearButton);
+shouldBeEqualToString('input.value', '');
+
+clickElement(btn);
+shouldBeEqualToString('output', 'Clicked');
+</script>
+</body>
+</html>
« no previous file with comments | « no previous file | LayoutTests/fast/forms/date-multiple-fields/date-clearbutton-preventdefault-mousecapture-status-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698