0

我正在关注Dojox/Mobile - TweetView的移动教程系列,我注意到在启动一个非常基本的应用程序期间(即使该应用程序看起来应该如此),控制台会打印出许多警告,例如“无效的 CSS 属性价值”。

我正在使用 Chrome(版本 29.0.1547.57)和 WebStorm IDE,警告出现在 IDE 的控制台上。

所以问题是,我应该忽略这些警告,还是我做错了什么?

HTML页面:

<!DOCTYPE html>
<html>
    <head>
        <title></title>
        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,minimum-scale=1,user-scalable=no"/>
        <meta name="apple-mobile-web-app-capable" content="yes" />
        <meta http-equiv="cache-control" content="no-cache">
        <meta http-equiv="pragma" content="no-cache">

        <script src="dojo/dojo.js" data-dojo-config="async: true"></script>
    </head>

    <body>

        <div data-dojo-type="dojox.mobile.View">
            <h1 data-dojo-type="dojox.mobile.Heading">About</h1>
            <h2 data-dojo-type="dojox.mobile.RoundRectCategory">Generic Mobile Device</h2>
            <ul data-dojo-type="dojox.mobile.RoundRectList">
                <li data-dojo-type="dojox.mobile.ListItem" data-dojo-props="rightText:'AcmePhone'">
                    Network
                </li>
            </ul>
        </div>

        <script type="text/javascript">
            require(["dojox/mobile/parser", "dojox/mobile/deviceTheme", "dojox/mobile"
            ],
                    function(parser, deviceTheme){
                        // startup the application
                        parser.parse();
                    });
        </script>
    </body>

</html>

Webstorm 控制台警告:

Invalid CSS property name: transform-origin C:/Users/Alon/Desktop/dj/dojox/mobile/themes/iphone/CheckBox.css:42
Invalid CSS property name: animation-duration   C:/Users/Alon/Desktop/dj/dojox/mobile/themes/iphone/IconContainer.css:65
Invalid CSS property name: animation-timing-function    C:/Users/Alon/Desktop/dj/dojox/mobile/themes/iphone/IconContainer.css:67
Invalid CSS property name: animation-iteration-count    C:/Users/Alon/Desktop/dj/dojox/mobile/themes/iphone/IconContainer.css:69
Invalid CSS property name: animation-name   C:/Users/Alon/Desktop/dj/dojox/mobile/themes/iphone/IconContainer.css:71
Invalid CSS property name: animation-duration   C:/Users/Alon/Desktop/dj/dojox/mobile/themes/iphone/IconContainer.css:77
Invalid CSS property name: animation-timing-function    C:/Users/Alon/Desktop/dj/dojox/mobile/themes/iphone/IconContainer.css:79
Invalid CSS property name: animation-name   C:/Users/Alon/Desktop/dj/dojox/mobile/themes/iphone/IconContainer.css:81
Invalid CSS property name: animation-name   C:/Users/Alon/Desktop/dj/dojox/mobile/themes/iphone/IconContainer.css:87
Invalid CSS property name: animation-name   C:/Users/Alon/Desktop/dj/dojox/mobile/themes/iphone/IconContainer.css:91
Invalid CSS property name: animation-name   C:/Users/Alon/Desktop/dj/dojox/mobile/themes/iphone/IconContainer.css:95
Invalid CSS property name: animation-name   C:/Users/Alon/Desktop/dj/dojox/mobile/themes/iphone/IconContainer.css:99
Invalid CSS property name: transform-origin C:/Users/Alon/Desktop/dj/dojox/mobile/themes/iphone/RadioButton.css:38
Invalid CSS property name: transform-origin C:/Users/Alon/Desktop/dj/dojox/mobile/themes/iphone/ToggleButton.css:46
Invalid CSS property value: radial-gradient(6 at center, #17df25 0%, #1ba51c 100%)  C:/Users/Alon/Desktop/dj/dojox/mobile/themes/common/domButtons/DomButtonSilverCircleGreenButton.css:29
Invalid CSS property value: radial-gradient(6 at center, #ff7a07 0%, #e66b03 100%)  C:/Users/Alon/Desktop/dj/dojox/mobile/themes/common/domButtons/DomButtonSilverCircleOrangeButton.css:29
Invalid CSS property name: transform-origin C:/Users/Alon/Desktop/dj/dojox/mobile/themes/iphone/ProgressIndicator.css:23
Invalid CSS property name: transform-origin C:/Users/Alon/Desktop/dj/dojox/mobile/themes/iphone/ProgressIndicator.css:34
Invalid CSS property name: animation-duration   C:/Users/Alon/Desktop/dj/dojox/mobile/themes/common/transitions/dissolve.css:3
Invalid CSS property name: animation-name   C:/Users/Alon/Desktop/dj/dojox/mobile/themes/common/transitions/dissolve.css:5
Invalid CSS property name: animation-timing-function    C:/Users/Alon/Desktop/dj/dojox/mobile/themes/common/transitions/dissolve.css:7
Invalid CSS property name: animation-duration   C:/Users/Alon/Desktop/dj/dojox/mobile/themes/common/transitions/dissolve.css:11
Invalid CSS property name: animation-name   C:/Users/Alon/Desktop/dj/dojox/mobile/themes/common/transitions/dissolve.css:13
Invalid CSS property name: animation-timing-function    C:/Users/Alon/Desktop/dj/dojox/mobile/themes/common/transitions/dissolve.css:15
Invalid CSS property value: transform   C:/Users/Alon/Desktop/dj/dojox/mobile/themes/common/transitions/cover.css:9
Invalid CSS property value: transform   C:/Users/Alon/Desktop/dj/dojox/mobile/themes/common/transitions/reveal.css:9
Invalid CSS property name: animation-duration   C:/Users/Alon/Desktop/dj/dojox/mobile/themes/common/transitions/cube.css:3
Invalid CSS property name: animation-timing-function    C:/Users/Alon/Desktop/dj/dojox/mobile/themes/common/transitions/cube.css:5
Invalid CSS property name: animation-name   C:/Users/Alon/Desktop/dj/dojox/mobile/themes/common/transitions/cube.css:9
Invalid CSS property name: transform-origin C:/Users/Alon/Desktop/dj/dojox/mobile/themes/common/transitions/cube.css:11
Invalid CSS property name: animation-name   C:/Users/Alon/Desktop/dj/dojox/mobile/themes/common/transitions/cube.css:15
Invalid CSS property name: transform-origin C:/Users/Alon/Desktop/dj/dojox/mobile/themes/common/transitions/cube.css:17
Invalid CSS property name: animation-name   C:/Users/Alon/Desktop/dj/dojox/mobile/themes/common/transitions/cube.css:65
Invalid CSS property name: transform-origin C:/Users/Alon/Desktop/dj/dojox/mobile/themes/common/transitions/cube.css:67
Invalid CSS property name: animation-name   C:/Users/Alon/Desktop/dj/dojox/mobile/themes/common/transitions/cube.css:71
Invalid CSS property name: transform-origin C:/Users/Alon/Desktop/dj/dojox/mobile/themes/common/transitions/cube.css:73
Invalid CSS property name: animation-name   C:/Users/Alon/Desktop/dj/dojox/mobile/themes/common/transitions/cube.css:124
Invalid CSS property name: transform-origin C:/Users/Alon/Desktop/dj/dojox/mobile/themes/common/transitions/cube.css:126
Invalid CSS property name: animation-name   C:/Users/Alon/Desktop/dj/dojox/mobile/themes/common/transitions/cube.css:130
Invalid CSS property name: transform-origin C:/Users/Alon/Desktop/dj/dojox/mobile/themes/common/transitions/cube.css:132
Invalid CSS property name: animation-name   C:/Users/Alon/Desktop/dj/dojox/mobile/themes/common/transitions/cube.css:168
Invalid CSS property name: transform-origin C:/Users/Alon/Desktop/dj/dojox/mobile/themes/common/transitions/cube.css:170
Invalid CSS property name: animation-name   C:/Users/Alon/Desktop/dj/dojox/mobile/themes/common/transitions/cube.css:174
Invalid CSS property name: transform-origin C:/Users/Alon/Desktop/dj/dojox/mobile/themes/common/transitions/cube.css:176
Invalid CSS property name: animation-name   C:/Users/Alon/Desktop/dj/dojox/mobile/themes/common/transitions/cube.css:212
Invalid CSS property name: transform-origin C:/Users/Alon/Desktop/dj/dojox/mobile/themes/common/transitions/cube.css:214
Invalid CSS property name: animation-name   C:/Users/Alon/Desktop/dj/dojox/mobile/themes/common/transitions/cube.css:218
Invalid CSS property name: transform-origin C:/Users/Alon/Desktop/dj/dojox/mobile/themes/common/transitions/cube.css:220
Invalid CSS property name: animation-name   C:/Users/Alon/Desktop/dj/dojox/mobile/themes/common/transitions/cube.css:256
Invalid CSS property name: transform-origin C:/Users/Alon/Desktop/dj/dojox/mobile/themes/common/transitions/cube.css:258
Invalid CSS property name: animation-name   C:/Users/Alon/Desktop/dj/dojox/mobile/themes/common/transitions/cube.css:262
Invalid CSS property name: transform-origin C:/Users/Alon/Desktop/dj/dojox/mobile/themes/common/transitions/cube.css:264
Invalid CSS property name: animation-name   C:/Users/Alon/Desktop/dj/dojox/mobile/themes/common/transitions/cube.css:300
Invalid CSS property name: transform-origin C:/Users/Alon/Desktop/dj/dojox/mobile/themes/common/transitions/cube.css:302
Invalid CSS property name: animation-name   C:/Users/Alon/Desktop/dj/dojox/mobile/themes/common/transitions/cube.css:306
Invalid CSS property name: transform-origin C:/Users/Alon/Desktop/dj/dojox/mobile/themes/common/transitions/cube.css:308
Invalid CSS property name: animation-name   C:/Users/Alon/Desktop/dj/dojox/mobile/themes/common/transitions/cube.css:344
Invalid CSS property name: transform-origin C:/Users/Alon/Desktop/dj/dojox/mobile/themes/common/transitions/cube.css:346
Invalid CSS property name: animation-name   C:/Users/Alon/Desktop/dj/dojox/mobile/themes/common/transitions/cube.css:350
Invalid CSS property name: transform-origin C:/Users/Alon/Desktop/dj/dojox/mobile/themes/common/transitions/cube.css:352
Invalid CSS property name: animation-name   C:/Users/Alon/Desktop/dj/dojox/mobile/themes/common/transitions/cube.css:388
Invalid CSS property name: transform-origin C:/Users/Alon/Desktop/dj/dojox/mobile/themes/common/transitions/cube.css:390
Invalid CSS property name: animation-name   C:/Users/Alon/Desktop/dj/dojox/mobile/themes/common/transitions/cube.css:394
Invalid CSS property name: transform-origin C:/Users/Alon/Desktop/dj/dojox/mobile/themes/common/transitions/cube.css:396
Invalid CSS property name: animation-name   C:/Users/Alon/Desktop/dj/dojox/mobile/themes/common/transitions/cube.css:432
Invalid CSS property name: transform-origin C:/Users/Alon/Desktop/dj/dojox/mobile/themes/common/transitions/cube.css:434
Invalid CSS property name: animation-name   C:/Users/Alon/Desktop/dj/dojox/mobile/themes/common/transitions/cube.css:438
Invalid CSS property name: transform-origin C:/Users/Alon/Desktop/dj/dojox/mobile/themes/common/transitions/cube.css:440
Invalid CSS property value: transform   C:/Users/Alon/Desktop/dj/dojox/mobile/themes/common/transitions/slidev.css:9
Invalid CSS property value: transform   C:/Users/Alon/Desktop/dj/dojox/mobile/themes/common/transitions/coverv.css:9
Invalid CSS property value: transform   C:/Users/Alon/Desktop/dj/dojox/mobile/themes/common/transitions/revealv.css:9
Invalid CSS property name: animation-duration   C:/Users/Alon/Desktop/dj/dojox/mobile/themes/common/transitions/swirl.css:3
Invalid CSS property name: animation-name   C:/Users/Alon/Desktop/dj/dojox/mobile/themes/common/transitions/swirl.css:5
Invalid CSS property name: animation-timing-function    C:/Users/Alon/Desktop/dj/dojox/mobile/themes/common/transitions/swirl.css:7
Invalid CSS property name: animation-duration   C:/Users/Alon/Desktop/dj/dojox/mobile/themes/common/transitions/swirl.css:12
Invalid CSS property name: animation-name   C:/Users/Alon/Desktop/dj/dojox/mobile/themes/common/transitions/swirl.css:14
Invalid CSS property name: animation-timing-function    C:/Users/Alon/Desktop/dj/dojox/mobile/themes/common/transitions/swirl.css:16
Invalid CSS property name: animation-name   C:/Users/Alon/Desktop/dj/dojox/mobile/themes/common/transitions/swirl.css:20
Invalid CSS property name: animation-duration   C:/Users/Alon/Desktop/dj/dojox/mobile/themes/common/transitions/scaleOut.css:3
Invalid CSS property name: animation-name   C:/Users/Alon/Desktop/dj/dojox/mobile/themes/common/transitions/scaleOut.css:5
Invalid CSS property name: animation-timing-function    C:/Users/Alon/Desktop/dj/dojox/mobile/themes/common/transitions/scaleOut.css:7
Invalid CSS property name: animation-name   C:/Users/Alon/Desktop/dj/dojox/mobile/themes/common/transitions/scaleOut.css:11
Invalid CSS property name: animation-duration   C:/Users/Alon/Desktop/dj/dojox/mobile/themes/common/transitions/scaleOut.css:16
Invalid CSS property name: animation-name   C:/Users/Alon/Desktop/dj/dojox/mobile/themes/common/transitions/scaleOut.css:18
Invalid CSS property name: animation-timing-function    C:/Users/Alon/Desktop/dj/dojox/mobile/themes/common/transitions/scaleOut.css:20
Invalid CSS property name: animation-duration   C:/Users/Alon/Desktop/dj/dojox/mobile/themes/common/transitions/swap.css:3
Invalid CSS property name: animation-timing-function    C:/Users/Alon/Desktop/dj/dojox/mobile/themes/common/transitions/swap.css:5
Invalid CSS property name: animation-name   C:/Users/Alon/Desktop/dj/dojox/mobile/themes/common/transitions/swap.css:9
Invalid CSS property name: animation-name   C:/Users/Alon/Desktop/dj/dojox/mobile/themes/common/transitions/swap.css:13
Invalid CSS property name: animation-name   C:/Users/Alon/Desktop/dj/dojox/mobile/themes/common/transitions/swap.css:17
Invalid CSS property name: animation-name   C:/Users/Alon/Desktop/dj/dojox/mobile/themes/common/transitions/swap.css:21
Invalid CSS property name: animation-duration   C:/Users/Alon/Desktop/dj/dojox/mobile/themes/common/transitions/scaleIn.css:4
Invalid CSS property name: animation-name   C:/Users/Alon/Desktop/dj/dojox/mobile/themes/common/transitions/scaleIn.css:6
Invalid CSS property name: animation-timing-function    C:/Users/Alon/Desktop/dj/dojox/mobile/themes/common/transitions/scaleIn.css:8
Invalid CSS property name: animation-duration   C:/Users/Alon/Desktop/dj/dojox/mobile/themes/common/transitions/scaleIn.css:12
Invalid CSS property name: animation-name   C:/Users/Alon/Desktop/dj/dojox/mobile/themes/common/transitions/scaleIn.css:14
Invalid CSS property name: animation-timing-function    C:/Users/Alon/Desktop/dj/dojox/mobile/themes/common/transitions/scaleIn.css:16
Invalid CSS property name: animation-name   C:/Users/Alon/Desktop/dj/dojox/mobile/themes/common/transitions/scaleIn.css:20
Invalid CSS property name: animation-duration   C:/Users/Alon/Desktop/dj/dojox/mobile/themes/common/transitions/zoomIn.css:4
Invalid CSS property name: animation-name   C:/Users/Alon/Desktop/dj/dojox/mobile/themes/common/transitions/zoomIn.css:6
Invalid CSS property name: animation-timing-function    C:/Users/Alon/Desktop/dj/dojox/mobile/themes/common/transitions/zoomIn.css:8
Invalid CSS property name: animation-duration   C:/Users/Alon/Desktop/dj/dojox/mobile/themes/common/transitions/zoomIn.css:12
Invalid CSS property name: animation-name   C:/Users/Alon/Desktop/dj/dojox/mobile/themes/common/transitions/zoomIn.css:14
Invalid CSS property name: animation-timing-function    C:/Users/Alon/Desktop/dj/dojox/mobile/themes/common/transitions/zoomIn.css:16
Invalid CSS property name: animation-name   C:/Users/Alon/Desktop/dj/dojox/mobile/themes/common/transitions/zoomIn.css:20
Invalid CSS property name: animation-duration   C:/Users/Alon/Desktop/dj/dojox/mobile/themes/common/transitions/zoomOut.css:3
Invalid CSS property name: animation-name   C:/Users/Alon/Desktop/dj/dojox/mobile/themes/common/transitions/zoomOut.css:5
Invalid CSS property name: animation-timing-function    C:/Users/Alon/Desktop/dj/dojox/mobile/themes/common/transitions/zoomOut.css:7
Invalid CSS property name: animation-name   C:/Users/Alon/Desktop/dj/dojox/mobile/themes/common/transitions/zoomOut.css:11
Invalid CSS property name: animation-duration   C:/Users/Alon/Desktop/dj/dojox/mobile/themes/common/transitions/zoomOut.css:16
Invalid CSS property name: animation-name   C:/Users/Alon/Desktop/dj/dojox/mobile/themes/common/transitions/zoomOut.css:18
Invalid CSS property name: animation-timing-function    C:/Users/Alon/Desktop/dj/dojox/mobile/themes/common/transitions/zoomOut.css:20
Invalid CSS property value: transform   C:/Users/Alon/Desktop/dj/dojox/mobile/themes/common/transitions/coverv.css:9
Invalid CSS property value: transform   C:/Users/Alon/Desktop/dj/dojox/mobile/themes/common/transitions/revealv.css:9
Invalid CSS property value: transform   C:/Users/Alon/Desktop/dj/dojox/mobile/themes/common/transitions/slide.css:9
4

1 回答 1

1

我认为无效的 CSS 属性并不重要,我也得到了很多。我通常将日志级别设置为高于警告的级别。通常这些无效属性存在,因为在某些浏览器中它们受支持,而在其他浏览器中它们可能无效。例如,许多 UI 相关框架使用供应商特定的前缀,如-o-, -webkit-, -moz-, ... 。它们只适用于特定的浏览器,但会被其他浏览器忽略(或者它们可以给你一个警告)。

例如(这是zoomIn.css您从中获取错误的文件的一部分):

.mblZoomIn.mblIn {
    -webkit-animation-duration: 0.5s;
    animation-duration: 0.5s;
    -webkit-animation-name: mblZoomInIn;
    animation-name: mblZoomInIn;
    -webkit-animation-timing-function: ease-out;
    animation-timing-function: ease-out;
}

您收到 的警告animation-duration,但您的浏览器 (chrome) 可以识别-webkit-animation-duration,因此没有问题。

但是在本教程的后期阶段,您可能会遇到一些问题。本TweetView教程基于 Twitter v1.0 API,该 API 已弃用一年多(如果我没记错的话),并于 2013 年 6 月某处被删除。

不过,本教程可能会为您提供有关如何使用 Dojo 创建移动应用程序的基本概念。

于 2013-08-27T13:18:06.803 回答