当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript DOM.isKeyframesRule方法代码示例

本文整理汇总了TypeScript中angular2/src/dom/dom_adapter.DOM.isKeyframesRule方法的典型用法代码示例。如果您正苦于以下问题:TypeScript DOM.isKeyframesRule方法的具体用法?TypeScript DOM.isKeyframesRule怎么用?TypeScript DOM.isKeyframesRule使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在angular2/src/dom/dom_adapter.DOM的用法示例。


在下文中一共展示了DOM.isKeyframesRule方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1: _scopeRules

 _scopeRules(cssRules, scopeSelector, hostSelector) {
   var cssText = '';
   if (isPresent(cssRules)) {
     for (var i = 0; i < cssRules.length; i++) {
       var rule = cssRules[i];
       if (DOM.isStyleRule(rule) || DOM.isPageRule(rule)) {
         cssText += this._scopeSelector(rule.selectorText, scopeSelector, hostSelector, this.strictStyling) + ' {\n';
         cssText += this._propertiesFromRule(rule) + '\n}\n\n';
       } else if (DOM.isMediaRule(rule)) {
         cssText += '@media ' + rule.media.mediaText + ' {\n';
         cssText += this._scopeRules(rule.cssRules, scopeSelector, hostSelector);
         cssText += '\n}\n\n';
       } else {
         try {
           if (isPresent(rule.cssText)) {
             cssText += rule.cssText + '\n\n';
           }
         } catch (x) {
           if (DOM.isKeyframesRule(rule) && isPresent(rule.cssRules)) {
             cssText += this._ieSafeCssTextFromKeyFrameRule(rule);
           }
         }
       }
     }
   }
   return cssText;
 }
开发者ID:gdi2290,项目名称:sample-Angular2,代码行数:27,代码来源:shadow_css.ts

示例2: _scopeRules

 // change a selector like 'div' to 'name div'
 _scopeRules(cssRules, scopeSelector: string, hostSelector: string): string {
   var cssText = '';
   if (isPresent(cssRules)) {
     for (var i = 0; i < cssRules.length; i++) {
       var rule = cssRules[i];
       if (DOM.isStyleRule(rule) || DOM.isPageRule(rule)) {
         cssText += this._scopeSelector(rule.selectorText, scopeSelector, hostSelector,
                                        this.strictStyling) +
                    ' {\n';
         cssText += this._propertiesFromRule(rule) + '\n}\n\n';
       } else if (DOM.isMediaRule(rule)) {
         cssText += '@media ' + rule.media.mediaText + ' {\n';
         cssText += this._scopeRules(rule.cssRules, scopeSelector, hostSelector);
         cssText += '\n}\n\n';
       } else {
         // KEYFRAMES_RULE in IE throws when we query cssText
         // when it contains a -webkit- property.
         // if this happens, we fallback to constructing the rule
         // from the CSSRuleSet
         // https://connect.microsoft.com/IE/feedbackdetail/view/955703/accessing-csstext-of-a-keyframe-rule-that-contains-a-webkit-property-via-cssom-generates-exception
         try {
           if (isPresent(rule.cssText)) {
             cssText += rule.cssText + '\n\n';
           }
         } catch (x) {
           if (DOM.isKeyframesRule(rule) && isPresent(rule.cssRules)) {
             cssText += this._ieSafeCssTextFromKeyFrameRule(rule);
           }
         }
       }
     }
   }
   return cssText;
 }
开发者ID:188799958,项目名称:angular,代码行数:35,代码来源:shadow_css.ts


注:本文中的angular2/src/dom/dom_adapter.DOM.isKeyframesRule方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。