Skip to content

Commit

Permalink
Merge pull request #2558 from AnalyticalGraphicsInc/semicolon
Browse files Browse the repository at this point in the history
Fix IE-only test failure
  • Loading branch information
emackey committed Mar 6, 2015
2 parents b4583d4 + 59cfd97 commit d546826
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 3 deletions.
9 changes: 9 additions & 0 deletions Source/Core/Color.js
Original file line number Diff line number Diff line change
Expand Up @@ -2024,5 +2024,14 @@ define([
*/
Color.YELLOWGREEN = freezeObject(Color.fromCssColorString('#9ACD32'));

/**
* An immutable Color instance initialized to CSS transparent.
* <span class="colorSwath" style="background: transparent;"></span>
*
* @constant
* @type {Color}
*/
Color.TRANSPARENT = freezeObject(new Color(0, 0, 0, 0));

return Color;
});
5 changes: 3 additions & 2 deletions Source/Widgets/InfoBox/InfoBox.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,9 @@ click: function () { closeClicked.raiseEvent(this); }');
if (firstElementChild !== null && frameContent.childNodes.length === 1) {
var style = window.getComputedStyle(firstElementChild);
if (style !== null) {
var color = Color.fromCssColorString(style['background-color']);
if (color.alpha !== 0) {
var backgroundColor = style['background-color'];
var color = Color.fromCssColorString(backgroundColor);
if (defined(color) && color.alpha !== 0) {
background = style['background-color'];
}
}
Expand Down
4 changes: 4 additions & 0 deletions Specs/Core/ColorSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,10 @@ defineSuite([
expect(new Color(0.1, 0.2, 0.3, 0.4).toCssColorString()).toEqual('rgba(25,51,76,0.4)');
});

it('fromCssColorString supports transparent', function() {
expect(Color.fromCssColorString('transparent')).toEqual(new Color(0.0, 0.0, 0.0, 0.0));
});

it('fromCssColorString supports the #rgb format', function() {
expect(Color.fromCssColorString('#369')).toEqual(new Color(0.2, 0.4, 0.6, 1.0));
});
Expand Down
2 changes: 1 addition & 1 deletion Specs/Widgets/InfoBox/InfoBoxSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ defineSuite([
});

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

Expand Down

0 comments on commit d546826

Please sign in to comment.