Skip to content

Commit d546826

Browse files
committed
Merge pull request #2558 from AnalyticalGraphicsInc/semicolon
Fix IE-only test failure
2 parents b4583d4 + 59cfd97 commit d546826

File tree

4 files changed

+17
-3
lines changed

4 files changed

+17
-3
lines changed

Source/Core/Color.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2024,5 +2024,14 @@ define([
20242024
*/
20252025
Color.YELLOWGREEN = freezeObject(Color.fromCssColorString('#9ACD32'));
20262026

2027+
/**
2028+
* An immutable Color instance initialized to CSS transparent.
2029+
* <span class="colorSwath" style="background: transparent;"></span>
2030+
*
2031+
* @constant
2032+
* @type {Color}
2033+
*/
2034+
Color.TRANSPARENT = freezeObject(new Color(0, 0, 0, 0));
2035+
20272036
return Color;
20282037
});

Source/Widgets/InfoBox/InfoBox.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,8 +123,9 @@ click: function () { closeClicked.raiseEvent(this); }');
123123
if (firstElementChild !== null && frameContent.childNodes.length === 1) {
124124
var style = window.getComputedStyle(firstElementChild);
125125
if (style !== null) {
126-
var color = Color.fromCssColorString(style['background-color']);
127-
if (color.alpha !== 0) {
126+
var backgroundColor = style['background-color'];
127+
var color = Color.fromCssColorString(backgroundColor);
128+
if (defined(color) && color.alpha !== 0) {
128129
background = style['background-color'];
129130
}
130131
}

Specs/Core/ColorSpec.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,10 @@ defineSuite([
161161
expect(new Color(0.1, 0.2, 0.3, 0.4).toCssColorString()).toEqual('rgba(25,51,76,0.4)');
162162
});
163163

164+
it('fromCssColorString supports transparent', function() {
165+
expect(Color.fromCssColorString('transparent')).toEqual(new Color(0.0, 0.0, 0.0, 0.0));
166+
});
167+
164168
it('fromCssColorString supports the #rgb format', function() {
165169
expect(Color.fromCssColorString('#369')).toEqual(new Color(0.2, 0.4, 0.6, 1.0));
166170
});

Specs/Widgets/InfoBox/InfoBoxSpec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ defineSuite([
5353
});
5454

5555
runs(function() {
56-
infoBox.viewModel.description = '<div style="background-color: rgb(255, 255, 255)">Please do not crash</div>';
56+
infoBox.viewModel.description = '<div style="background-color: rgb(255, 255, 255);">Please do not crash</div>';
5757
expect(infoElement.style['background-color']).toEqual('rgb(255, 255, 255)');
5858
});
5959

0 commit comments

Comments
 (0)