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

Side by Side Diff: third_party/WebKit/LayoutTests/external/wpt/content-security-policy/style-src/style-src-inline-style-allowed.html

Issue 2784543003: Fixed wpt content-security-policy/style-src tests (Closed)
Patch Set: CR changes Created 3 years, 8 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 unified diff | Download patch
OLDNEW
(Empty)
1 <!doctype html>
2 <html>
3 <head>
4 <meta http-equiv="Content-Security-Policy" content="style-src 'unsafe-inline ';">
5 <script src="/resources/testharness.js"></script>
6 <script src="/resources/testharnessreport.js"></script>
7
8 <script>
9 var t = async_test("Inline style should apply with 'unsafe-inline'");
10 document.addEventListener("securitypolicyviolation", t.unreached_func("Sho uld not trigger a security policy violation"));
11 </script>
12
13 <style>
14 #content {
15 margin-left: 2px;
16 }
17 </style>
18 </head>
19 <body>
20 <div id='log'></div>
21
22 <div id="content">Lorem ipsum</div>
23
24 <script>
25 t.step(function() {
26 var contentEl = document.getElementById("content");
27 var marginLeftVal = getComputedStyle(contentEl).getPropertyValue('margin -left');
28 assert_true(marginLeftVal == "2px");
29 t.done();
30 }, "Inline style should not be applied");
31 </script>
32
33 </body>
34 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698