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

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: Yet another rebase Created 4 years, 10 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 53f79f17c4adc0595dfb52e20d5efb9f1b326e54..1addebe3227a112d1b88eb8949449db5a7d69fd0 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"
@@ -1507,6 +1508,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)
@@ -2638,6 +2642,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