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

Unified Diff: third_party/WebKit/Source/core/dom/Element.cpp

Issue 1635863006: Pointerevent capture APIs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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/core/dom/Element.cpp
diff --git a/third_party/WebKit/Source/core/dom/Element.cpp b/third_party/WebKit/Source/core/dom/Element.cpp
index 3a09355d61c796e0833f719d4d19cf9a74a89941..eee8328153d836c3608c56b4afc95489344997f2 100644
--- a/third_party/WebKit/Source/core/dom/Element.cpp
+++ b/third_party/WebKit/Source/core/dom/Element.cpp
@@ -105,6 +105,7 @@
#include "core/html/HTMLTableRowsCollection.h"
#include "core/html/HTMLTemplateElement.h"
#include "core/html/parser/HTMLParserIdioms.h"
+#include "core/input/EventHandler.h"
#include "core/inspector/InspectorInstrumentation.h"
#include "core/layout/LayoutTextFragment.h"
#include "core/layout/LayoutView.h"
@@ -1550,6 +1551,9 @@ void Element::removedFrom(ContainerNode* insertionPoint)
if (data->intersectionObserverData())
data->intersectionObserverData()->deactivateAllIntersectionObservers(*this);
}
+
+ if (document().frame())
+ document().frame()->eventHandler().elementRemoved(this);
}
void Element::attach(const AttachContext& context)
@@ -2652,6 +2656,28 @@ void Element::insertAdjacentHTML(const String& where, const String& markup, Exce
insertAdjacent(where, fragment.get(), exceptionState);
}
+void Element::setPointerCapture(int pointerId, ExceptionState& exceptionState)
+{
+ if (document().frame()) {
+ if (!document().frame()->eventHandler().isPointerEventActive(pointerId))
+ exceptionState.throwDOMException(InvalidPointerId, "InvalidPointerId");
+ else if (!inDocument())
+ exceptionState.throwDOMException(InvalidStateError, "InvalidStateError");
+ else
+ document().frame()->eventHandler().setPointerCapture(pointerId, this);
+ }
+}
+
+void Element::releasePointerCapture(int pointerId, ExceptionState& exceptionState)
+{
+ if (document().frame()) {
+ if (!document().frame()->eventHandler().isPointerEventActive(pointerId))
+ exceptionState.throwDOMException(InvalidPointerId, "InvalidPointerId");
+ else
+ document().frame()->eventHandler().releasePointerCapture(pointerId, this);
+ }
+}
+
String Element::innerText()
{
// We need to update layout, since plainText uses line boxes in the layout tree.

Powered by Google App Engine
This is Rietveld 408576698