Procházet zdrojové kódy

LibWeb: Port MutationObserver interface from DeprecatedString to String

Shannon Booth před 1 rokem
rodič
revize
0ce5a920f7

+ 1 - 1
Userland/Libraries/LibWeb/DOM/MutationObserver.h

@@ -23,7 +23,7 @@ struct MutationObserverInit {
     bool subtree { false };
     Optional<bool> attribute_old_value;
     Optional<bool> character_data_old_value;
-    Optional<Vector<DeprecatedString>> attribute_filter;
+    Optional<Vector<String>> attribute_filter;
 };
 
 // https://dom.spec.whatwg.org/#mutationobserver

+ 1 - 1
Userland/Libraries/LibWeb/DOM/MutationObserver.idl

@@ -1,7 +1,7 @@
 #import <DOM/MutationRecord.idl>
 #import <DOM/Node.idl>
 
-[Exposed=Window, UseDeprecatedAKString]
+[Exposed=Window]
 interface MutationObserver {
 
     constructor(MutationCallback callback);

+ 1 - 1
Userland/Libraries/LibWeb/DOM/Node.cpp

@@ -1502,7 +1502,7 @@ void Node::queue_mutation_record(FlyString const& type, DeprecatedString attribu
             //    then:
             if (!(node.ptr() != this && !options.subtree)
                 && !(type == MutationType::attributes && (!options.attributes.has_value() || !options.attributes.value()))
-                && !(type == MutationType::attributes && options.attribute_filter.has_value() && (!attribute_namespace.is_null() || !options.attribute_filter->contains_slow(attribute_name)))
+                && !(type == MutationType::attributes && options.attribute_filter.has_value() && (!attribute_namespace.is_null() || !options.attribute_filter->contains_slow(attribute_name.view())))
                 && !(type == MutationType::characterData && (!options.character_data.has_value() || !options.character_data.value()))
                 && !(type == MutationType::childList && !options.child_list)) {
                 // 1. Let mo be registered’s observer.