Sat, 03 Jan 2015 20:18:00 +0100
Conditionally enable double key logic according to:
private browsing mode or privacy.thirdparty.isolate preference and
implement in GetCookieStringCommon and FindCookie where it counts...
With some reservations of how to convince FindCookie users to test
condition and pass a nullptr when disabling double key logic.
michael@0 | 1 | <!doctype html> |
michael@0 | 2 | <title>Selection.isCollapsed tests</title> |
michael@0 | 3 | <div id=log></div> |
michael@0 | 4 | <script src=/resources/testharness.js></script> |
michael@0 | 5 | <script src=/resources/testharnessreport.js></script> |
michael@0 | 6 | <script src=common.js></script> |
michael@0 | 7 | <script> |
michael@0 | 8 | "use strict"; |
michael@0 | 9 | |
michael@0 | 10 | test(function() { |
michael@0 | 11 | selection.removeAllRanges(); |
michael@0 | 12 | assert_true(selection.isCollapsed, "isCollapsed must be true if both anchor and focus are null"); |
michael@0 | 13 | }, "Empty selection"); |
michael@0 | 14 | |
michael@0 | 15 | for (var i = 0; i < testRanges.length; i++) { |
michael@0 | 16 | test(function() { |
michael@0 | 17 | selection.removeAllRanges(); |
michael@0 | 18 | var endpoints = eval(testRanges[i]); |
michael@0 | 19 | var range = ownerDocument(endpoints[0]).createRange(); |
michael@0 | 20 | range.setStart(endpoints[0], endpoints[1]); |
michael@0 | 21 | range.setEnd(endpoints[2], endpoints[3]); |
michael@0 | 22 | selection.addRange(range); |
michael@0 | 23 | |
michael@0 | 24 | assert_equals(selection.isCollapsed, |
michael@0 | 25 | endpoints[0] === endpoints[2] && endpoints[1] === endpoints[3], |
michael@0 | 26 | "Value of isCollapsed"); |
michael@0 | 27 | }, "Range " + i + " " + testRanges[i]); |
michael@0 | 28 | } |
michael@0 | 29 | |
michael@0 | 30 | testDiv.style.display = "none"; |
michael@0 | 31 | </script> |