1/** 2 * @file stylesheet.js 3 * @module stylesheet 4 */ 5import document from 'global/document'; 6 7/** 8 * Create a DOM syle element given a className for it. 9 * 10 * @param {string} className 11 * The className to add to the created style element. 12 * 13 * @return {Element} 14 * The element that was created. 15 */ 16export const createStyleElement = function(className) { 17 const style = document.createElement('style'); 18 19 style.className = className; 20 21 return style; 22}; 23 24/** 25 * Add text to a DOM element. 26 * 27 * @param {Element} el 28 * The Element to add text content to. 29 * 30 * @param {string} content 31 * The text to add to the element. 32 */ 33export const setTextContent = function(el, content) { 34 if (el.styleSheet) { 35 el.styleSheet.cssText = content; 36 } else { 37 el.textContent = content; 38 } 39};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.