Change in ovirt-engine[master]: webadmin, userportal: Fix IE image size quirk

awels at redhat.com awels at redhat.com
Fri Sep 25 17:29:24 UTC 2015


Alexander Wels has submitted this change and it was merged.

Change subject: webadmin,userportal: Fix IE image size quirk
......................................................................


webadmin,userportal: Fix IE image size quirk

IE automatically adds "width" and "height" attributes, with
values taken from "src" image data, when an <img> element is
created via Image constructor function. For example:

  var img = new Image();
  img.src = "foo.png";
  // adds "width" and "height" automatically
  document.body.appendChild(img);

This causes render issues for images that use "src" attribute
for initial placeholder image and CSS styling for the actual
image. For example:

  <style>
    .fooImage {
      background: url("foo.png");
      width: 400px;
      height: 200px;
    }
  </style>

  <img src="clear.cache.gif" class="fooImage">

In IE, above <img> element would have "width" and "height"
attributes, with values from "clear.cache.gif" placeholder
image, added automatically:

  <img src="clear.cache.gif"
       width="1" height="1" class="fooStyle">

To fix this quirk, "width" and "height" attributes of such
images are set to value "auto":

  <img src="clear.cache.gif"
       width="auto" height="auto" class="fooStyle">

Change-Id: Ia17eb684cb08c0cb2cd610e38974bc9992e48285
Bug-Url: https://bugzilla.redhat.com/1255428
Signed-off-by: Vojtech Szocs <vszocs at redhat.com>
---
M frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/gin/BaseSystemModule.java
A frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/system/BrowserHacks.java
M frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/uicommon/ClientAgentType.java
3 files changed, 85 insertions(+), 2 deletions(-)

Approvals:
  Alexander Wels: Verified; Looks good to me, approved
  Jenkins CI: Passed CI tests
  Greg Sheremeta: Looks good to me, approved



-- 
To view, visit https://gerrit.ovirt.org/46377
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ia17eb684cb08c0cb2cd610e38974bc9992e48285
Gerrit-PatchSet: 2
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Vojtech Szocs <vszocs at redhat.com>
Gerrit-Reviewer: Alexander Wels <awels at redhat.com>
Gerrit-Reviewer: Einav Cohen <ecohen at redhat.com>
Gerrit-Reviewer: Greg Sheremeta <gshereme at redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Vojtech Szocs <vszocs at redhat.com>
Gerrit-Reviewer: automation at ovirt.org



More information about the Engine-commits mailing list