Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8844657
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T11:32:32+00:00 2026-06-14T11:32:32+00:00

In order to scale elements in my div, I’m using this css ( JSFiddle

  • 0

In order to scale elements in my div, I’m using this css (JSFiddle Example here):

.scaled {
    transform: scale(0.5);
    -ms-transform: scale(0.5); /* IE 9 */
    -webkit-transform: scale(0.5); /* Safari and Chrome */
    -o-transform: scale(0.5); /* Opera */
    -moz-transform: scale(0.5); /* Firefox */
    filter: progid:DXImageTransform.Microsoft.Matrix(sizingMethod='auto expand',
        M11=0.5, M12=0,
        M21=0, M22=0.5);
}

This is supported by all major browsers (including IE8).

Now when I try to apply this css dynamically in GWT:

public void setZoom(double val) {
    if (val != 1) {
        surface.getElement().getStyle().setProperty("transform", "scale(" + val + ")");
        surface.getElement().getStyle().setProperty("-ms-transform", "scale(" + val + ")");
        surface.getElement().getStyle().setProperty("-webkit-transform", "scale(" + val + ")");
        surface.getElement().getStyle().setProperty("-o-transform", "scale(" + val + ")");
        surface.getElement().getStyle().setProperty("-moz-transform", "scale(" + val + ")");
        surface.getElement().getStyle()
                .setProperty("filter", "progid:DXImageTransform.Microsoft.Matrix(sizingMethod='auto expand',M11=" + val + ", M12=0,M21=0, M22=" + val + ")");
    }

}

I get the following error:

Caused by: java.lang.AssertionError: The style name '-ms-transform' should be in camelCase format
    at com.google.gwt.dom.client.Style$.assertCamelCase$(Style.java:1603)
    at com.google.gwt.dom.client.Style$.setProperty$(Style.java:1512)

How can I set these browser dependent styles dynamically in GWT? (especially IE’s filter..)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T11:32:34+00:00Added an answer on June 14, 2026 at 11:32 am

    You can use value function in CSS ResourceBundle or conditional CSS:

    https://developers.google.com/web-toolkit/doc/latest/DevGuideClientBundle#Value_function

    But I don’t understand from your code why you need to use transform: scale at all. You can simply set the size of this element directly, like

    surface.setSize("100px", "200px")
    

    If you set size relative to something, you can first measure that something (window or element), and calculate the size you need. This solution works in all browsers and you don’t have to rely on CSS3 being supported.

    EDIT:

    You can have a div (“surface” in your example) which does not change its size. This div will include another div (for example, “wrapper”), which contains all internal content. All content can be set in either percents or em relative to the wrapper div. When you need to scale your content, you simply change the size of the wrapper div – and all of its contents will scale accordingly.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following css rules: -webkit-transform: scale(0.5); /* Saf3.1+, Chrome */ -moz-transform: scale(0.5);
We need to think big and our applications need to scale in order to
In order to achieve spriting by compass according to the documentation I wrote this:
I'm trying to scale/translate a java.awt. Shape with AffineTransform in order to draw it
I'm considering using IronWorker a project so that I can scale it easily (high
How can I select multiple elements using a WHERE...IN... type of clause as in
I'm using the strucchange package in order to determine where my curve model segments.
I am using AS2 and I'm looking for a way to scale an MC
In scala, why does toSet() method mix up the order of elements in a
I have been working through a very small-scale WPF project in order to familiarize

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.