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

Side by Side Diff: LayoutTests/fast/shapes/resources/multi-segment-polygon.js

Issue 772523003: Remove unused shape test resources (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years 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
« no previous file with comments | « no previous file | LayoutTests/fast/shapes/resources/simple-polygon.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 function generatePolygon(width, height, fontSize, points, content, elementId) {
2 var div = createOrInsert(elementId);
3 var polygon = points.map(function(elem, index, array) {
4 return elem.toString() + 'px' + (index < array.length - 1 && index % 2 = = 1 ? ',' : '');
5 }).join(' ');
6 polygon = 'polygon(' + polygon + ')';
7 div.style.setProperty('shape-inside', polygon);
8 div.style.setProperty('width', width + 'px');
9 div.style.setProperty('height', height + 'px');
10 div.style.setProperty('font', fontSize + 'px/1 Ahem, sans-serif');
11 div.style.setProperty('color', 'green');
12 div.style.setProperty('word-wrap', 'break-word');
13 div.innerHTML = content;
14 }
15
16 function simulateWithText(width, height, fontSize, content, elementId) {
17 var div = createOrInsert(elementId);
18 div.style.setProperty('width', width + 'px');
19 div.style.setProperty('height', height + 'px');
20 div.style.setProperty('font', fontSize + 'px/1 Ahem, sans-serif');
21 div.style.setProperty('color', 'green');
22 if (content instanceof Array) {
23 div.style.setProperty('white-space', 'pre');
24 content = content.join('\n');
25 }
26 div.innerHTML = content;
27 }
28
29 function createOrInsert(elementId) {
30 if (elementId)
31 return document.getElementById(elementId);
32
33 var div = document.createElement('div');
34 if (document.body.childNodes.length)
35 docuemnt.body.insertBefore(div, document.body.childNodes[0]);
36 else
37 document.body.appendChild(div);
38 return div;
39 }
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/fast/shapes/resources/simple-polygon.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698