Blame view

bower_components/iron-list/test/smoke/avg-worst-case.html 2.85 KB
f748e9cf   Luigi Serra   new controllet an...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
  <!--

  @license

  Copyright (c) 2015 The Polymer Project Authors. All rights reserved.

  This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt

  The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt

  The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt

  Code distributed by Google as part of the polymer project is also

  subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt

  -->

  

  <!doctype html>

  <html>

  <head>

  

    <title>avg worst case</title>

  

    <meta charset="utf-8">

    <meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1, user-scalable=yes">

    <meta name="mobile-web-app-capable" content="yes">

    <meta name="apple-mobile-web-app-capable" content="yes">

  

    <script src="../../../webcomponentsjs/webcomponents-lite.js"></script>

  

    <link rel="import" href="../../../polymer/polymer.html">

f748e9cf   Luigi Serra   new controllet an...
25
26
27
    <link rel="import" href="../../iron-list.html">

  

    <style is="custom-style">

a1a3bc73   Luigi Serra   graphs updates
28
29
30
31
      body {

        @apply(--layout-fullbleed);

      }

      

f748e9cf   Luigi Serra   new controllet an...
32
33
34
35
36
37
38
39
40
      iron-list {

        width: 500px;

        height: 400px;

        float: left;

        margin: 10px;

      }

  

      .item {

        background-color: green;

a1a3bc73   Luigi Serra   graphs updates
41
        border-bottom: 1px solid white;

f748e9cf   Luigi Serra   new controllet an...
42
43
44
45
46
      }

  

    </style>

  

  </head>

a1a3bc73   Luigi Serra   graphs updates
47
  <body unresolved>

f748e9cf   Luigi Serra   new controllet an...
48
49
  

    <template is="dom-bind">

a1a3bc73   Luigi Serra   graphs updates
50
51
  

      <h1>The physical average is not useful in this situations</h1>

f748e9cf   Luigi Serra   new controllet an...
52
53
54
      <p>The list is correct if it can render all the items without empty spaces.</p>

      <iron-list id="list" items="[791, 671]" as="item" style="width: 300px; height: 300px;">

        <template>

a1a3bc73   Luigi Serra   graphs updates
55
          <div class="item" style$="[[_getStyle(item)]]"><span>[[index]]</span> height: <span>[[item]]</span>

f748e9cf   Luigi Serra   new controllet an...
56
57
58
59
60
61
          </div>

        </template>

      </iron-list>

  

      <iron-list id="list2" items="[791, 671]" as="item" style="width: 710px; height: 453px;">

        <template>

a1a3bc73   Luigi Serra   graphs updates
62
          <div class="item" style$="[[_getStyle(item)]]"><span>[[index]]</span> height: <span>[[item]]</span>

f748e9cf   Luigi Serra   new controllet an...
63
64
65
66
67
68
          </div>

        </template>

      </iron-list>

  

      <iron-list items="[512, 256, 128, 64, 16, 16, 16, 16, 16, 16, 8, 4]" as="item" style="height: 256px;">

        <template>

a1a3bc73   Luigi Serra   graphs updates
69
          <div class="item" style$="[[_getStyle(item)]]"><span>[[index]]</span> height: <span>[[item]]</span>

f748e9cf   Luigi Serra   new controllet an...
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
          </div>

        </template>

      </iron-list>

    </template>

  

    <script>

      HTMLImports.whenReady(function() {

        document.querySelector('template[is=dom-bind]')._getStyle = function(item) {

          return 'height:' + item + 'px; ';

        };

  

        setTimeout(function() {

          document.querySelector('#list').push('items', 251, 191, 151, 191, 51, 51, 51);

        }, 100);

  

         setTimeout(function() {

          document.querySelector('#list2').push('items', 251, 191, 151, 191, 51, 51, 51);

        }, 300);

      });

    </script>

  </body>

  </html>