【问题标题】:GWT 2.7 super dev mode does not work with CssResource.style=obfGWT 2.7 超级开发模式不适用于 CssResource.style=obf
【发布时间】:2015-11-20 08:09:29
【问题描述】:

直到 GWT 2.5,默认情况下所有的 css 类都被混淆了,但是在 GWT 2.7 中,在超级开发模式下运行时,它会在类名中附加完整的包。我在下面尝试过,但它不起作用。

我没有混淆 css 样式,而是打印 com-google-gwt-user-cellview-client-CellTable-Style-cellTableCell 之类的名称。

【问题讨论】:

    标签: gwt


    【解决方案1】:

    这是on purpose。代码中有一条注释解释了原因:

      // CSSResourceGenerator needs to produce stable, unique naming for its input.
      // Currently on default settings CssResourceGenerator's obfuscation depends on
      // whole world knowledge and thus will produce collision in obfuscated mode, since in
      // incremental compiles that information is not available.
    

    连同 TODO 一起最终修复 CSSResourceGenerator

    但是,如果我可能会问,非混淆样式名称有什么问题?

    【讨论】:

    • 谢谢托马斯。我们为 celltable 和其他一些小部件添加了一些自定义 css 样式。最初 css 名称被混淆,它变成了类似 GPBYFDEPC 或 GPBYFDEPD 的东西,基于此我们添加了 css 样式,如 - tr.GPBYFDEPC td, tr.GPBYFDEPD td,{ border-bottom: 1px solid #d3d3d3;边框顶部:无;左边框:无;右边界:无;现在由于 css 类生成为 com-google-gwt-user-cellview-client-CellTable-Style-cellTableCell 而不是 GPBYFDEPD,所有的屏幕看起来都很丑。
    • 使用混淆名称是在自找麻烦。有一些方法可以自定义 celltable 等的样式。利用 CssResource;那么为什么要依赖一个易碎的混淆名称呢?
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-09-07
    • 2013-08-22
    • 1970-01-01
    • 1970-01-01
    • 2014-11-28
    相关资源
    最近更新 更多