OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 Google Inc. All rights reserved. |
3 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved. | 3 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved. |
4 * Copyright (C) 2008 Matt Lilek <webkit@mattlilek.com> | 4 * Copyright (C) 2008 Matt Lilek <webkit@mattlilek.com> |
5 * Copyright (C) 2009 Joseph Pecoraro | 5 * Copyright (C) 2009 Joseph Pecoraro |
6 * | 6 * |
7 * Redistribution and use in source and binary forms, with or without | 7 * Redistribution and use in source and binary forms, with or without |
8 * modification, are permitted provided that the following conditions | 8 * modification, are permitted provided that the following conditions |
9 * are met: | 9 * are met: |
10 * | 10 * |
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
182 /** | 182 /** |
183 * @param {?SDK.Resource} resource | 183 * @param {?SDK.Resource} resource |
184 * @return {boolean} | 184 * @return {boolean} |
185 */ | 185 */ |
186 function isImageResource(resource) { | 186 function isImageResource(resource) { |
187 return !!resource && resource.resourceType() === Common.resourceTypes.Image; | 187 return !!resource && resource.resourceType() === Common.resourceTypes.Image; |
188 } | 188 } |
189 | 189 |
190 function buildContent() { | 190 function buildContent() { |
191 var container = createElement('table'); | 191 var container = createElement('table'); |
| 192 UI.appendStyle(container, 'components/imagePreview.css'); |
192 container.className = 'image-preview-container'; | 193 container.className = 'image-preview-container'; |
193 var naturalWidth = precomputedFeatures ? precomputedFeatures.naturalWidth :
imageElement.naturalWidth; | 194 var naturalWidth = precomputedFeatures ? precomputedFeatures.naturalWidth :
imageElement.naturalWidth; |
194 var naturalHeight = precomputedFeatures ? precomputedFeatures.naturalHeight
: imageElement.naturalHeight; | 195 var naturalHeight = precomputedFeatures ? precomputedFeatures.naturalHeight
: imageElement.naturalHeight; |
195 var offsetWidth = precomputedFeatures ? precomputedFeatures.offsetWidth : na
turalWidth; | 196 var offsetWidth = precomputedFeatures ? precomputedFeatures.offsetWidth : na
turalWidth; |
196 var offsetHeight = precomputedFeatures ? precomputedFeatures.offsetHeight :
naturalHeight; | 197 var offsetHeight = precomputedFeatures ? precomputedFeatures.offsetHeight :
naturalHeight; |
197 var description; | 198 var description; |
198 if (showDimensions) { | 199 if (showDimensions) { |
199 if (offsetHeight === naturalHeight && offsetWidth === naturalWidth) { | 200 if (offsetHeight === naturalHeight && offsetWidth === naturalWidth) { |
200 description = Common.UIString('%d \xd7 %d pixels', offsetWidth, offsetHe
ight); | 201 description = Common.UIString('%d \xd7 %d pixels', offsetWidth, offsetHe
ight); |
201 } else { | 202 } else { |
(...skipping 438 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
640 | 641 |
641 /** | 642 /** |
642 * @override | 643 * @override |
643 * @param {!SDK.DOMNode} node | 644 * @param {!SDK.DOMNode} node |
644 * @return {?{title: string, color: string}} | 645 * @return {?{title: string, color: string}} |
645 */ | 646 */ |
646 decorate(node) { | 647 decorate(node) { |
647 return {title: this._title, color: this._color}; | 648 return {title: this._title, color: this._color}; |
648 } | 649 } |
649 }; | 650 }; |
OLD | NEW |