Upstream version 7.36.149.0
[platform/framework/web/crosswalk.git] / src / third_party / trace-viewer / third_party / tvcm / src / tvcm / ui / dom_helpers.js
index 462c835..f2b0899 100644 (file)
@@ -18,6 +18,8 @@ tvcm.exportTo('tvcm.ui', function() {
         spanEl.textContent = opt_dictionary.textContent;
       if (opt_dictionary.parent)
         opt_dictionary.parent.appendChild(spanEl);
+      if (opt_dictionary.bold)
+        spanEl.style.fontWeight = 'bold';
     }
     return spanEl;
   };
@@ -145,11 +147,19 @@ tvcm.exportTo('tvcm.ui', function() {
     return spanEl;
   }
 
+  function isElementAttachedToDocument(el) {
+    var cur = el;
+    while (cur.parentNode)
+      cur = cur.parentNode;
+    return cur == el.ownerDocument;
+  }
+
   return {
     createSpan: createSpan,
     createDiv: createDiv,
     createScopedStyle: createScopedStyle,
     createSelector: createSelector,
-    createCheckBox: createCheckBox
+    createCheckBox: createCheckBox,
+    isElementAttachedToDocument: isElementAttachedToDocument
   };
 });