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

Side by Side Diff: Tools/GardeningServer/ui/ct-results-comparison.html

Issue 403983002: Port pixelzoomer.js/css to ct-results-comparison. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: make component. add tests. Created 6 years, 5 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 | Annotate | Revision Log
OLDNEW
1 <!-- 1 <!--
2 Copyright 2014 The Chromium Authors. All rights reserved. 2 Copyright 2014 The Chromium Authors. All rights reserved.
3 Use of this source code is governed by a BSD-style license that can be 3 Use of this source code is governed by a BSD-style license that can be
4 found in the LICENSE file. 4 found in the LICENSE file.
5 --> 5 -->
6 6
7 <link rel="import" href="ct-results-comparison-zoomer.html">
7 <link rel="import" href="ct-test-output.html"> 8 <link rel="import" href="ct-test-output.html">
8 9
9 <polymer-element name="ct-results-comparison" attributes="type expectedUrl actua lUrl diffUrl" noscript> 10 <polymer-element name="ct-results-comparison" attributes="type expectedUrl actua lUrl diffUrl">
10 <template> 11 <template>
11 <style> 12 <style>
12 :host { 13 .main-content {
13 display: flex; 14 display: flex;
14 flex-wrap: wrap; 15 flex-wrap: wrap;
15 width: 100%; 16 width: 100%;
16 } 17 }
17 .container {
18 flex: 1;
19 min-width: 300px;
20 }
21 </style>
22 18
23 <div class="container"> 19 .main-content > * {
24 <h2>Expected</h2> 20 flex: 1;
25 <ct-test-output type="{{type}}" url="{{expectedUrl}}"></ct-test-outp ut> 21 min-width: 300px;
26 </div> 22 }
27 <div class="container"> 23 </style>
28 <h2>Actual</h2> 24
29 <ct-test-output type="{{type}}" url="{{actualUrl}}"></ct-test-output > 25 <div class="main-content">
30 </div> 26 <div>
31 <div class="container"> 27 <h2>Expected</h2>
32 <h2>Diff</h2> 28 <ct-test-output type="{{ type }}" url="{{ expectedUrl }}"
33 <ct-test-output type="{{type}}" url="{{diffUrl}}"></ct-test-output> 29 on-mouseout="{{ _handleMouseOut }}" on-mousemove="{{ _handleMouseMo ve }}"></ct-test-output>
34 </div> 30 </div>
31 <div>
32 <h2>Actual</h2>
33 <ct-test-output type="{{ type }}" url="{{ actualUrl }}"
34 on-mouseout="{{ _handleMouseOut }}" on-mousemove="{{ _handleMouseMo ve }}"></ct-test-output>
35 </div>
36 <div>
37 <h2>Diff</h2>
38 <ct-test-output type="{{ type }}" url="{{ diffUrl }}"
39 on-mouseout="{{ _handleMouseOut }}" on-mousemove="{{ _handleMouseMo ve }}"></ct-test-output>
40 </div>
41 </div>
42
43 <template if="{{ _zoomPosition }}">
44 <ct-results-comparison-zoomer
45 expectedUrl="{{ expectedUrl }}"
46 actualUrl="{{ actualUrl }}"
47 diffUrl="{{ diffUrl }}"
48 position="{{ _zoomPosition }}"></ct-results-comparison-zoomer>
35 </template> 49 </template>
50 </template>
51 <script>
52 Polymer({
53 type: '',
54 expectedUrl: '',
55 actualUrl: '',
56 diffUrl: '',
57 _zoomPosition: null,
58
59 typeChanged: function() {
60 this._zoomPosition = null;
61 },
62
63 _handleMouseOut: function(e) {
64 this._zoomPosition = null;
65 },
66
67 _handleMouseMove: function(e) {
68 if (this.type != 'image')
69 return;
70
71 // FIXME: This assumes that the ct-test-output only contains an image.
72 var targetLocation = e.target.getBoundingClientRect();
73 // FIXME: Use a proper model class instead of a dumb object.
74 this._zoomPosition = {
75 x: (e.clientX - targetLocation.left) / targetLocation.width,
76 y: (e.clientY - targetLocation.top) / targetLocation.height,
77 };
78 },
79 });
80 </script>
36 </polymer-element> 81 </polymer-element>
OLDNEW
« no previous file with comments | « Tools/GardeningServer/run-unittests.html ('k') | Tools/GardeningServer/ui/ct-results-comparison-tests.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698