Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Drawing bbox fix for window scroll #1683

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
May 16, 2017
Prev Previous commit
Next Next commit
don't expose DOMParser instance on svg utils module object
  • Loading branch information
etpinard committed May 16, 2017
commit e0050f73c57c54755a6131584b152151bf0c7c06
10 changes: 6 additions & 4 deletions 10 src/lib/svg_text_utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,14 @@ var Lib = require('../lib');
var xmlnsNamespaces = require('../constants/xmlns_namespaces');
var stringMappings = require('../constants/string_mappings');

var DOM_PARSER;

exports.getDOMParser = function() {
if(exports.domParser) {
return exports.domParser;
if(DOM_PARSER) {
return DOM_PARSER;
} else if(window.DOMParser) {
exports.domParser = new window.DOMParser();
return exports.domParser;
DOM_PARSER = new window.DOMParser();
return DOM_PARSER;
} else {
throw new Error('Cannot initialize DOMParser');
}
Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.