Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(468)

Unified Diff: third_party/WebKit/Source/web/WebDocument.cpp

Issue 2865233003: Use an MutationObserver to check when a password form disappears after XHR (Closed)
Patch Set: updates Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/web/WebDocument.cpp
diff --git a/third_party/WebKit/Source/web/WebDocument.cpp b/third_party/WebKit/Source/web/WebDocument.cpp
index 110117fbe358318db101657537c71f416e974150..9e65b38221b76c1f7cc27639e084ea3201e53776 100644
--- a/third_party/WebKit/Source/web/WebDocument.cpp
+++ b/third_party/WebKit/Source/web/WebDocument.cpp
@@ -39,6 +39,7 @@
#include "core/dom/DocumentStatisticsCollector.h"
#include "core/dom/DocumentType.h"
#include "core/dom/Element.h"
+#include "core/dom/FormElementObserver.h"
#include "core/dom/StyleEngine.h"
#include "core/events/Event.h"
#include "core/frame/WebLocalFrameBase.h"
@@ -48,6 +49,7 @@
#include "core/html/HTMLElement.h"
#include "core/html/HTMLFormElement.h"
#include "core/html/HTMLHeadElement.h"
+#include "core/html/HTMLInputElement.h"
#include "core/html/HTMLLinkElement.h"
#include "core/layout/LayoutObject.h"
#include "core/layout/api/LayoutAPIShim.h"
@@ -65,6 +67,8 @@
#include "public/web/WebElement.h"
#include "public/web/WebElementCollection.h"
#include "public/web/WebFormElement.h"
+#include "public/web/WebFormElementObserverCallback.h"
+#include "public/web/WebInputElement.h"
#include "v8/include/v8.h"
namespace blink {
@@ -289,6 +293,20 @@ WebDistillabilityFeatures WebDocument::DistillabilityFeatures() {
return DocumentStatisticsCollector::CollectStatistics(*Unwrap<Document>());
}
+void WebDocument::ObserveFormElement(
+ WebFormElement& element,
+ std::unique_ptr<WebFormElementObserverCallback> callback) {
+ Unwrap<Document>()->GetFormElementObserver()->Observe(
+ *element.Unwrap<HTMLFormElement>(), std::move(callback));
+}
+
+void WebDocument::ObserveFormElement(
+ WebInputElement& element,
+ std::unique_ptr<WebFormElementObserverCallback> callback) {
+ Unwrap<Document>()->GetFormElementObserver()->Observe(
+ *element.Unwrap<HTMLInputElement>(), std::move(callback));
+}
+
WebDocument::WebDocument(Document* elem) : WebNode(elem) {}
DEFINE_WEB_NODE_TYPE_CASTS(WebDocument, ConstUnwrap<Node>()->IsDocumentNode());

Powered by Google App Engine
This is Rietveld 408576698