You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@weex.apache.org by so...@apache.org on 2017/04/26 06:56:26 UTC

[04/50] [abbrv] incubator-weex git commit: * [html5] fix removing stylesheet links.

* [html5] fix removing stylesheet links.


Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/f13c4534
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/f13c4534
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/f13c4534

Branch: refs/heads/dev
Commit: f13c4534fe99c70ef3d998f68f9001be946b7c31
Parents: a38e289
Author: MrRaindrop <te...@gmail.com>
Authored: Wed Apr 19 12:14:06 2017 +0800
Committer: MrRaindrop <te...@gmail.com>
Committed: Wed Apr 19 12:14:06 2017 +0800

----------------------------------------------------------------------
 html5/render/vue/core/style.js | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/f13c4534/html5/render/vue/core/style.js
----------------------------------------------------------------------
diff --git a/html5/render/vue/core/style.js b/html5/render/vue/core/style.js
index 5383ff9..b324cde 100644
--- a/html5/render/vue/core/style.js
+++ b/html5/render/vue/core/style.js
@@ -42,9 +42,11 @@ export function getHeadStyleMap () {
        * because weex's components defined non-standard style attributes, which is
        * auto ignored when access rule.cssText.
        */
-      if (!styleSheet.cssRules) {
+      if (!styleSheet.cssRules
+        || (styleSheet.ownerNode.tagName.toLowerCase() === 'link')
+        || !styleSheet.ownerNode.textContent) {
         /**
-         * no rules. just ignore this. probably a link stylesheet.
+         * no rules, or in a link. just ignore this. probably a link stylesheet.
          */
         return pre
       }