dom/tests/js/id.html

Sat, 03 Jan 2015 20:18:00 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Sat, 03 Jan 2015 20:18:00 +0100
branch
TOR_BUG_3246
changeset 7
129ffea94266
permissions
-rw-r--r--

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 <HTML>
michael@0 2 <HEAD>
michael@0 3 <STYLE>
michael@0 4 #first { display: inline; color: green; }
michael@0 5 #second { display: block; color: red; }
michael@0 6 </STYLE>
michael@0 7 <SCRIPT>
michael@0 8 var id = "first";
michael@0 9 function toggleId() {
michael@0 10 var node = document.getElementById(id);
michael@0 11 if (id == "first") {
michael@0 12 id = "second";
michael@0 13 }
michael@0 14 else {
michael@0 15 id = "first";
michael@0 16 }
michael@0 17 node.id = id;
michael@0 18 }
michael@0 19 </SCRIPT>
michael@0 20 </HEAD>
michael@0 21 <BODY>
michael@0 22 <H1>Changing ID test</H1>
michael@0 23 <P>Clicking on the button that follows this paragraph
michael@0 24 should change the layout of <SPAN ID="first">these words</SPAN>
michael@0 25 with respect to the rest of the flow.</P>
michael@0 26 <FORM>
michael@0 27 <INPUT TYPE="button" VALUE="Toggle ID" onClick="toggleId(); return true;">
michael@0 28 </FORM>
michael@0 29 </BODY>
michael@0 30 </HTML>

mercurial