title: jasmine + karma - Firefox does not calculate element.height and element.width properly
body: <p>I have a strange problem using jasmine and karma frameworks.
  Basically I just want to make a resize using plain javascript of some img's.</p>
  
  <p>I have the following test : </p>
  
  <pre><code>    it('Should set both the height and width style for the one applicable as being the maximum allowed', function () {
      var images = '&lt;img class="resizableImage" src="" alt="" style="height: 1200px; width: 1000px; visibility: hidden;"&gt;' +
          '&lt;img class="resizableImage" src="" alt="" style="height: 1100px; width: 199px; visibility: visible;"&gt;' +
          '&lt;img class="resizableImage" src="" alt="" style="height: 1990px; width: 200px; visibility: visible;"&gt;';
      setFixtures(images);
  
      var allResizableImages = $('img.resizableImage');
      resizeImagesWidthHeightIfBiggerThan(allResizableImages, 199, 199);
  
      $.each(allResizableImages, function () {
          expect($(this).css('width')).toBe('199px');
          expect($(this).css('height')).toBe('199px');
      });
  });
  </code></pre>
  
  <p>and the function : </p>
  
  <pre><code>function resizeImagesWidthHeightIfBiggerThan(imagesToBeResized, maxWidth, maxHeight) {
  var UNIT = "px";
  var VISIBILITY_SETTINGS = "visible";
  
  for (var i = 0, len = imagesToBeResized.length; i &lt; len; i++) {
      var imgCandidate = imagesToBeResized[i];
  
      if (imgCandidate &amp;&amp; imgCandidate.tagName.toLowerCase() == 'img') {
          if (imgCandidate.width &gt; maxWidth) {
              imgCandidate.style.width = maxWidth + UNIT;
          }
          if (imgCandidate.height &gt; maxHeight) {
              imgCandidate.style.height = maxHeight + UNIT;
          }
      }
  
      imgCandidate.style.visibility = VISIBILITY_SETTINGS;
  }
  </code></pre>
  
  <p>}</p>
  
  <p>With <strong>Chrome</strong>, everythings goes well.
  However, with <strong>Firefox</strong>, the test <em>doesn't</em> pass.
  Though, live (doing testing manually on Firefox), everything goes well.</p>
  
  <p>What could be wrong ?</p>
  
  <p>I am using <strong>Firefox 29.0</strong></p>
  
  <p>Thanks a lot.</p>