- Fix: Avoid errors occurring in Chrome now for supportsGoodTextCharPos
- Linting: Avoid Jamilih file in doc linting - Testing: Add testcafe (ESLint plugin/rules, accessibility test (failing), ui test beginnings (passing)) - Docs: Add "Testing" prefix to contributing file - npm: Bump to 3.0.0-rc.3
This commit is contained in:
@@ -71,7 +71,7 @@ try {
|
||||
return false;
|
||||
}());
|
||||
|
||||
// text character positioning (for IE9)
|
||||
// text character positioning (for IE9 and now Chrome)
|
||||
const supportsGoodTextCharPos_ = (function () {
|
||||
const svgroot = document.createElementNS(NS.SVG, 'svg');
|
||||
const svgcontent = document.createElementNS(NS.SVG, 'svg');
|
||||
@@ -81,9 +81,14 @@ svgroot.append(svgcontent);
|
||||
const text = document.createElementNS(NS.SVG, 'text');
|
||||
text.textContent = 'a';
|
||||
svgcontent.append(text);
|
||||
const pos = text.getStartPositionOfChar(0).x;
|
||||
svgroot.remove();
|
||||
return (pos === 0);
|
||||
try { // Chrome now fails here
|
||||
const pos = text.getStartPositionOfChar(0).x;
|
||||
return (pos === 0);
|
||||
} catch (err) {
|
||||
return false;
|
||||
} finally {
|
||||
svgroot.remove();
|
||||
}
|
||||
}());
|
||||
|
||||
const supportsPathBBox_ = (function () {
|
||||
|
||||
@@ -2669,7 +2669,7 @@
|
||||
} catch (err) {}
|
||||
|
||||
return false;
|
||||
}(); // text character positioning (for IE9)
|
||||
}(); // text character positioning (for IE9 and now Chrome)
|
||||
|
||||
|
||||
var supportsGoodTextCharPos_ = function () {
|
||||
@@ -2681,9 +2681,16 @@
|
||||
var text = document.createElementNS(NS.SVG, 'text');
|
||||
text.textContent = 'a';
|
||||
svgcontent.append(text);
|
||||
var pos = text.getStartPositionOfChar(0).x;
|
||||
svgroot.remove();
|
||||
return pos === 0;
|
||||
|
||||
try {
|
||||
// Chrome now fails here
|
||||
var pos = text.getStartPositionOfChar(0).x;
|
||||
return pos === 0;
|
||||
} catch (err) {
|
||||
return false;
|
||||
} finally {
|
||||
svgroot.remove();
|
||||
}
|
||||
}();
|
||||
|
||||
var supportsPathBBox_ = function () {
|
||||
|
||||
Reference in New Issue
Block a user