| 26968 | // Value may contain space. |
| 26969 | var styleRegex = /([^\s:;]+)\s*:\s*([^:;]+)/g; |
| 26970 | function parseStyleAttribute(xmlNode) { |
| 26971 | var style = xmlNode.getAttribute('style'); |
| 26972 | var result = {}; |
| 26973 | |
| 26974 | if (!style) { |
| 26975 | return result; |
| 26976 | } |
| 26977 | |
| 26978 | var styleList = {}; |
| 26979 | styleRegex.lastIndex = 0; |
| 26980 | var styleRegResult; |
| 26981 | while ((styleRegResult = styleRegex.exec(style)) != null) { |
| 26982 | styleList[styleRegResult[1]] = styleRegResult[2]; |
| 26983 | } |
| 26984 | |
| 26985 | for (var svgAttrName in attributesMap) { |
| 26986 | if (attributesMap.hasOwnProperty(svgAttrName) && styleList[svgAttrName] != null) { |
| 26987 | result[attributesMap[svgAttrName]] = styleList[svgAttrName]; |
| 26988 | } |
| 26989 | } |
| 26990 | |
| 26991 | return result; |
| 26992 | } |
| 26993 | |
| 26994 | /** |
| 26995 | * @param {Array.<number>} viewBoxRect |