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

Unified Diff: appengine/sheriff_o_matic/ui/ct-results-comparison.html

Issue 1315693002: SoM: upgrade Polymer from 0.5 to 1.0 Base URL: https://chromium.googlesource.com/infra/infra.git@master
Patch Set: get bower_components from polymer_1.0.4 Created 5 years, 4 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 side-by-side diff with in-line comments
Download patch
Index: appengine/sheriff_o_matic/ui/ct-results-comparison.html
diff --git a/appengine/sheriff_o_matic/ui/ct-results-comparison.html b/appengine/sheriff_o_matic/ui/ct-results-comparison.html
index 60431e005b685f962d41d01e2f8b65489cb2582a..b46f8f410c54417e60bf83d2f6c17ceb0e36e29e 100644
--- a/appengine/sheriff_o_matic/ui/ct-results-comparison.html
+++ b/appengine/sheriff_o_matic/ui/ct-results-comparison.html
@@ -2,14 +2,11 @@
Copyright 2014 The Chromium Authors. All rights reserved.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.
--->
-
-<link rel="import" href="ct-results-comparison-zoomer.html">
+--><html><head><link rel="import" href="ct-results-comparison-zoomer.html">
<link rel="import" href="ct-test-output.html">
-<polymer-element name="ct-results-comparison" attributes="type expectedUrl actualUrl diffUrl">
- <template>
- <style>
+<dom-module id="ct-results-comparison">
+ <style>
.main-content {
display: flex;
flex-wrap: wrap;
@@ -21,61 +18,71 @@ found in the LICENSE file.
min-width: 300px;
}
</style>
+ <template>
<div class="main-content">
<div>
<h2>Expected</h2>
- <ct-test-output type="{{ type }}" url="{{ expectedUrl }}"
- on-mouseout="{{ _handleMouseOut }}" on-mousemove="{{ _handleMouseMove }}"></ct-test-output>
+ <ct-test-output type="{{ type }}" url="{{ expectedUrl }}" on-mouseout=" _handleMouseOut " on-mousemove=" _handleMouseMove "></ct-test-output>
</div>
<div>
<h2>Actual</h2>
- <ct-test-output type="{{ type }}" url="{{ actualUrl }}"
- on-mouseout="{{ _handleMouseOut }}" on-mousemove="{{ _handleMouseMove }}"></ct-test-output>
+ <ct-test-output type="{{ type }}" url="{{ actualUrl }}" on-mouseout=" _handleMouseOut " on-mousemove=" _handleMouseMove "></ct-test-output>
</div>
<div>
<h2>Diff</h2>
- <ct-test-output type="{{ type }}" url="{{ diffUrl }}"
- on-mouseout="{{ _handleMouseOut }}" on-mousemove="{{ _handleMouseMove }}"></ct-test-output>
+ <ct-test-output type="{{ type }}" url="{{ diffUrl }}" on-mouseout=" _handleMouseOut " on-mousemove=" _handleMouseMove "></ct-test-output>
</div>
</div>
- <template if="{{ _zoomPosition }}">
- <ct-results-comparison-zoomer
- expectedUrl="{{ expectedUrl }}"
- actualUrl="{{ actualUrl }}"
- diffUrl="{{ diffUrl }}"
- position="{{ _zoomPosition }}"></ct-results-comparison-zoomer>
+ <template is="dom-if" if="{{ _zoomPosition }}">
+ <ct-results-comparison-zoomer expectedurl="{{ expectedUrl }}" actualurl="{{ actualUrl }}" diffurl="{{ diffUrl }}" position="{{ _zoomPosition }}"></ct-results-comparison-zoomer>
</template>
</template>
<script>
Polymer({
- type: '',
- expectedUrl: '',
- actualUrl: '',
- diffUrl: '',
- _zoomPosition: null,
-
- typeChanged: function() {
+ is: 'ct-results-comparison',
+ properties: {
+ _zoomPosition: { value: null },
+ actualUrl: {
+ type: String,
+ value: '',
+ notify: true
+ },
+ diffUrl: {
+ type: String,
+ value: '',
+ notify: true
+ },
+ expectedUrl: {
+ type: String,
+ value: '',
+ notify: true
+ },
+ type: {
+ type: String,
+ value: '',
+ notify: true,
+ observer: 'typeChanged'
+ }
+ },
+ typeChanged: function () {
this._zoomPosition = null;
},
-
- _handleMouseOut: function(e) {
+ _handleMouseOut: function (e) {
this._zoomPosition = null;
},
-
- _handleMouseMove: function(e) {
+ _handleMouseMove: function (e) {
if (this.type != 'image')
return;
-
// FIXME: This assumes that the ct-test-output only contains an image.
var targetLocation = e.target.getBoundingClientRect();
// FIXME: Use a proper model class instead of a dumb object.
this._zoomPosition = {
x: (e.clientX - targetLocation.left) / targetLocation.width,
- y: (e.clientY - targetLocation.top) / targetLocation.height,
+ y: (e.clientY - targetLocation.top) / targetLocation.height
};
- },
+ }
});
</script>
-</polymer-element>
+</dom-module>

Powered by Google App Engine
This is Rietveld 408576698