From 3e4734283e5bb4115fdca44dc1477902b2f9850e Mon Sep 17 00:00:00 2001 From: Anthony Fang Date: Tue, 18 Aug 2020 00:04:04 -0400 Subject: [PATCH 1/5] fix: add null check for element --- ie11CustomProperties.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ie11CustomProperties.js b/ie11CustomProperties.js index d703ffc..bfa99f8 100644 --- a/ie11CustomProperties.js +++ b/ie11CustomProperties.js @@ -544,7 +544,7 @@ if (inheritingKeywords[value] || !register[property] || register[property].inherits) { //let el = this.pseudoElt ? this.computedFor : this.computedFor.parentNode; let el = this.computedFor.parentNode; - while (el.nodeType === 1) { + while (el && el.nodeType === 1) { // without, it affects performance: 1000 els inside 100 parents: 1000ms (instead of 600ms) is it acceptable? // would also remove complexity, because i can remove the ieCP_setters property //if (el.ieCP_setters && el.ieCP_setters[property]) { From 60ccc405af03c9c9526e2f35f495704938118ff3 Mon Sep 17 00:00:00 2001 From: Anthony Fang Date: Tue, 18 Aug 2020 17:25:18 -0400 Subject: [PATCH 2/5] Revert "fix: add null check for element" This reverts commit 3e4734283e5bb4115fdca44dc1477902b2f9850e. --- ie11CustomProperties.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ie11CustomProperties.js b/ie11CustomProperties.js index bfa99f8..d703ffc 100644 --- a/ie11CustomProperties.js +++ b/ie11CustomProperties.js @@ -544,7 +544,7 @@ if (inheritingKeywords[value] || !register[property] || register[property].inherits) { //let el = this.pseudoElt ? this.computedFor : this.computedFor.parentNode; let el = this.computedFor.parentNode; - while (el && el.nodeType === 1) { + while (el.nodeType === 1) { // without, it affects performance: 1000 els inside 100 parents: 1000ms (instead of 600ms) is it acceptable? // would also remove complexity, because i can remove the ieCP_setters property //if (el.ieCP_setters && el.ieCP_setters[property]) { From 384b69adfb1865d17cf5ae5e96133b49bc8b854a Mon Sep 17 00:00:00 2001 From: Anthony Fang Date: Tue, 18 Aug 2020 17:27:16 -0400 Subject: [PATCH 3/5] Revert "Revert "fix: add null check for element"" This reverts commit 60ccc405af03c9c9526e2f35f495704938118ff3. --- ie11CustomProperties.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ie11CustomProperties.js b/ie11CustomProperties.js index d703ffc..bfa99f8 100644 --- a/ie11CustomProperties.js +++ b/ie11CustomProperties.js @@ -544,7 +544,7 @@ if (inheritingKeywords[value] || !register[property] || register[property].inherits) { //let el = this.pseudoElt ? this.computedFor : this.computedFor.parentNode; let el = this.computedFor.parentNode; - while (el.nodeType === 1) { + while (el && el.nodeType === 1) { // without, it affects performance: 1000 els inside 100 parents: 1000ms (instead of 600ms) is it acceptable? // would also remove complexity, because i can remove the ieCP_setters property //if (el.ieCP_setters && el.ieCP_setters[property]) { From 2e7c496e64217614691252eeaf7df97f0274b792 Mon Sep 17 00:00:00 2001 From: Anthony Fang Date: Tue, 18 Aug 2020 17:28:50 -0400 Subject: [PATCH 4/5] Revert "Revert "Revert "fix: add null check for element""" This reverts commit 384b69adfb1865d17cf5ae5e96133b49bc8b854a. --- ie11CustomProperties.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ie11CustomProperties.js b/ie11CustomProperties.js index bfa99f8..d703ffc 100644 --- a/ie11CustomProperties.js +++ b/ie11CustomProperties.js @@ -544,7 +544,7 @@ if (inheritingKeywords[value] || !register[property] || register[property].inherits) { //let el = this.pseudoElt ? this.computedFor : this.computedFor.parentNode; let el = this.computedFor.parentNode; - while (el && el.nodeType === 1) { + while (el.nodeType === 1) { // without, it affects performance: 1000 els inside 100 parents: 1000ms (instead of 600ms) is it acceptable? // would also remove complexity, because i can remove the ieCP_setters property //if (el.ieCP_setters && el.ieCP_setters[property]) { From 7429a1cdc6a8887b5a95c0122d9f9061d4a4efc0 Mon Sep 17 00:00:00 2001 From: Anthony Fang Date: Tue, 18 Aug 2020 17:34:13 -0400 Subject: [PATCH 5/5] fix: Ensure element is finished drawing --- ie11CustomProperties.js | 1 + 1 file changed, 1 insertion(+) diff --git a/ie11CustomProperties.js b/ie11CustomProperties.js index d703ffc..66ef94d 100644 --- a/ie11CustomProperties.js +++ b/ie11CustomProperties.js @@ -362,6 +362,7 @@ drawing = false; }) }) + drawing = false; // Sometimes drawing is not finished in the setTimeout due to timing this ensures it is set done at the end } var uniqueCounter = 0;