mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-22 16:18:08 +02:00
Merge pull request #8056 from Snuffleupagus/ChildNode.remove
Use `ChildNode.remove` instead of `ChildNode.ParentNode.removeChild` in a couple of places (bug 1334831, issue 8008)
This commit is contained in:
commit
466760efca
3 changed files with 19 additions and 10 deletions
|
@ -59,13 +59,10 @@ FontLoader.prototype = {
|
|||
},
|
||||
|
||||
clear: function fontLoaderClear() {
|
||||
var styleElement = this.styleElement;
|
||||
if (styleElement) {
|
||||
if (styleElement.parentNode) {
|
||||
// Prevent "TypeError: styleElement.parentNode is null" during testing.
|
||||
styleElement.parentNode.removeChild(styleElement);
|
||||
}
|
||||
styleElement = this.styleElement = null;
|
||||
if (this.styleElement) {
|
||||
// Note: ChildNode.remove doesn't throw if the parentNode is undefined.
|
||||
this.styleElement.remove();
|
||||
this.styleElement = null;
|
||||
}
|
||||
if (typeof PDFJSDev === 'undefined' || !PDFJSDev.test('MOZCENTRAL')) {
|
||||
this.nativeFontFaces.forEach(function(nativeFontFace) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue