Fixed #4341 - Domhandler isElement check updates

pull/4353/head
Bahadır Sofuoğlu 2023-08-29 15:28:03 +03:00
parent c57faf3db1
commit 4bf044f484
1 changed files with 4 additions and 4 deletions

View File

@ -183,13 +183,13 @@ export default {
}, },
setAttribute(element, attribute = '', value) { setAttribute(element, attribute = '', value) {
if (element && value !== null && value !== undefined) { if (this.isElement(element) && value !== null && value !== undefined) {
element.setAttribute(attribute, value); element.setAttribute(attribute, value);
} }
}, },
setAttributes(element, attributes = {}) { setAttributes(element, attributes = {}) {
if (element) { if (this.isElement(element)) {
const computedStyles = (rule, value) => { const computedStyles = (rule, value) => {
const styles = element?.$attrs?.[rule] ? [element?.$attrs?.[rule]] : []; const styles = element?.$attrs?.[rule] ? [element?.$attrs?.[rule]] : [];
@ -231,7 +231,7 @@ export default {
}, },
getAttribute(element, name) { getAttribute(element, name) {
if (element) { if (this.isElement(element)) {
const value = element.getAttribute(name); const value = element.getAttribute(name);
if (!isNaN(value)) { if (!isNaN(value)) {
@ -249,7 +249,7 @@ export default {
}, },
isAttributeEquals(element, name, value) { isAttributeEquals(element, name, value) {
return element ? this.getAttribute(element, name) === value : false; return this.isElement(element) ? this.getAttribute(element, name) === value : false;
}, },
isAttributeNotEquals(element, name, value) { isAttributeNotEquals(element, name, value) {