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

Side by Side Diff: third_party/WebKit/LayoutTests/fast/css/getComputedStyle/invalid-url-double-recalc-serialization.html

Issue 1865603004: Fix crash when setting invalid URL on content (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: pants Created 4 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
1 <script src="../../../resources/testharness.js"></script> 1 <script src="../../../resources/testharness.js"></script>
2 <script src="../../../resources/testharnessreport.js"></script> 2 <script src="../../../resources/testharnessreport.js"></script>
3 <div id="target"> 3 <div id="target"></div>
4 <script> 4 <script>
5 var testCases = [ 5 var testCases = [
6 ['-webkit-box-reflect', 'below 0px url(\"chrome:\") 0 fill / auto / 0px stretc h'], 6 ['-webkit-box-reflect', 'below 0px url("chrome:") 0 fill / auto / 0px stretch' ],
7 ['-webkit-mask-box-image-source', 'url("chrome:")'], 7 ['-webkit-mask-box-image-source', 'url("chrome:")'],
8 ['-webkit-mask-image', 'url("chrome:")'], 8 ['-webkit-mask-image', 'url("chrome:")'],
9 ['background-image', 'url("chrome:")'], 9 ['background-image', 'url("chrome:")'],
10 ['border-image-source', 'url("chrome:")'], 10 ['border-image-source', 'url("chrome:")'],
11 ['list-style-image', 'url("chrome:")'], 11 ['list-style-image', 'url("chrome:")'],
12 ['shape-outside', 'url("chrome:")'], 12 ['shape-outside', 'url("chrome:")'],
13 ]; 13 ];
14 14
15 test(() => { 15 test(() => {
16 for ([property, value] of testCases) { 16 for (const [property, value] of testCases) {
17 target.style[property] = value; 17 target.style[property] = value;
18 } 18 }
19 var computedStyle = getComputedStyle(target); 19 var computedStyle = getComputedStyle(target);
20 for ([property, value] of testCases) { 20 for (const [property, value] of testCases) {
21 assert_equals(computedStyle[property], value, property); 21 assert_equals(computedStyle[property], value, property);
22 } 22 }
23 }, 'Disallowed URL protocols should serialise as their original URL strings'); 23 // Force a second style recalc so that the image gets cached and reused.
24 target.style.left = '0px'; // Force style recalc.
25 for (const [property, value] of testCases) {
26 assert_equals(computedStyle[property], value, property);
27 }
28 }, 'Invalid URL protocols should serialise as their original URL strings after m ultiple recalcs');
24 </script> 29 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698