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 | <html> |
michael@0 | 3 | <!-- |
michael@0 | 4 | https://bugzilla.mozilla.org/show_bug.cgi?id=921191 |
michael@0 | 5 | Bug 921191 - allow inspection/editing of SVG elements' CSS properties |
michael@0 | 6 | --> |
michael@0 | 7 | <head> |
michael@0 | 8 | <meta charset="utf-8"> |
michael@0 | 9 | <title>Test for Bug </title> |
michael@0 | 10 | |
michael@0 | 11 | <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script> |
michael@0 | 12 | <link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css"> |
michael@0 | 13 | <script type="application/javascript;version=1.8" src="inspector-helpers.js"></script> |
michael@0 | 14 | <script type="application/javascript;version=1.8"> |
michael@0 | 15 | Components.utils.import("resource://gre/modules/devtools/Loader.jsm"); |
michael@0 | 16 | const {Promise: promise} = Components.utils.import("resource://gre/modules/Promise.jsm", {}); |
michael@0 | 17 | |
michael@0 | 18 | const inspector = devtools.require("devtools/server/actors/inspector"); |
michael@0 | 19 | |
michael@0 | 20 | window.onload = function() { |
michael@0 | 21 | SimpleTest.waitForExplicitFinish(); |
michael@0 | 22 | runNextTest(); |
michael@0 | 23 | } |
michael@0 | 24 | |
michael@0 | 25 | var gWalker = null; |
michael@0 | 26 | var gStyles = null; |
michael@0 | 27 | var gClient = null; |
michael@0 | 28 | |
michael@0 | 29 | addTest(function setup() { |
michael@0 | 30 | let url = document.getElementById("inspectorContent").href; |
michael@0 | 31 | attachURL(url, function(err, client, tab, doc) { |
michael@0 | 32 | let {InspectorFront} = devtools.require("devtools/server/actors/inspector"); |
michael@0 | 33 | let inspector = InspectorFront(client, tab); |
michael@0 | 34 | promiseDone(inspector.getWalker().then(walker => { |
michael@0 | 35 | ok(walker, "getWalker() should return an actor."); |
michael@0 | 36 | gClient = client; |
michael@0 | 37 | gWalker = walker; |
michael@0 | 38 | return inspector.getPageStyle(); |
michael@0 | 39 | }).then(styles => { |
michael@0 | 40 | gStyles = styles; |
michael@0 | 41 | }).then(runNextTest)); |
michael@0 | 42 | }); |
michael@0 | 43 | }); |
michael@0 | 44 | |
michael@0 | 45 | addTest(function inheritedUserStyles() { |
michael@0 | 46 | let node = node; |
michael@0 | 47 | promiseDone(gWalker.querySelector(gWalker.rootNode, "#svgcontent rect").then(node => { |
michael@0 | 48 | return gStyles.getApplied(node, { inherited: true, filter: "user" }); |
michael@0 | 49 | }).then(applied => { |
michael@0 | 50 | is(applied.length, 3, "Should have 3 rules"); |
michael@0 | 51 | is(applied[1].rule.cssText, "fill: rgb(1, 2, 3);", "cssText is right"); |
michael@0 | 52 | }).then(runNextTest)); |
michael@0 | 53 | }); |
michael@0 | 54 | |
michael@0 | 55 | addTest(function cleanup() { |
michael@0 | 56 | delete gStyles; |
michael@0 | 57 | delete gWalker; |
michael@0 | 58 | delete gClient; |
michael@0 | 59 | runNextTest(); |
michael@0 | 60 | }); |
michael@0 | 61 | |
michael@0 | 62 | </script> |
michael@0 | 63 | </head> |
michael@0 | 64 | <body> |
michael@0 | 65 | <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=921191">Mozilla Bug 921191</a> |
michael@0 | 66 | <a id="inspectorContent" target="_blank" href="inspector-styles-data.html">Test Document</a> |
michael@0 | 67 | <p id="display"></p> |
michael@0 | 68 | <div id="content" style="display: none"> |
michael@0 | 69 | |
michael@0 | 70 | </div> |
michael@0 | 71 | <pre id="test"> |
michael@0 | 72 | </pre> |
michael@0 | 73 | </body> |
michael@0 | 74 | </html> |