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

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, 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
« no previous file with comments | « third_party/WebKit/Source/core/dom/Element.h ('k') | third_party/WebKit/Source/core/dom/Element.idl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 2641196365dc0a6bc82318e49ddac52a4689f373..146186174cfed06c4d6ce9d8755825523e920ec6 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"
@@ -1509,6 +1510,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)
@@ -2640,6 +2644,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.
« no previous file with comments | « third_party/WebKit/Source/core/dom/Element.h ('k') | third_party/WebKit/Source/core/dom/Element.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698