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

Side by Side 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, 9 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2001 Peter Kelly (pmk@post.com) 4 * (C) 2001 Peter Kelly (pmk@post.com)
5 * (C) 2001 Dirk Mueller (mueller@kde.org) 5 * (C) 2001 Dirk Mueller (mueller@kde.org)
6 * (C) 2007 David Smith (catfish.man@gmail.com) 6 * (C) 2007 David Smith (catfish.man@gmail.com)
7 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012, 2013 Apple Inc. All rights reserved. 7 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012, 2013 Apple Inc. All rights reserved.
8 * (C) 2007 Eric Seidel (eric@webkit.org) 8 * (C) 2007 Eric Seidel (eric@webkit.org)
9 * 9 *
10 * This library is free software; you can redistribute it and/or 10 * This library is free software; you can redistribute it and/or
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 #include "core/html/HTMLDocument.h" 98 #include "core/html/HTMLDocument.h"
99 #include "core/html/HTMLElement.h" 99 #include "core/html/HTMLElement.h"
100 #include "core/html/HTMLFormControlsCollection.h" 100 #include "core/html/HTMLFormControlsCollection.h"
101 #include "core/html/HTMLFrameElementBase.h" 101 #include "core/html/HTMLFrameElementBase.h"
102 #include "core/html/HTMLFrameOwnerElement.h" 102 #include "core/html/HTMLFrameOwnerElement.h"
103 #include "core/html/HTMLOptionsCollection.h" 103 #include "core/html/HTMLOptionsCollection.h"
104 #include "core/html/HTMLPlugInElement.h" 104 #include "core/html/HTMLPlugInElement.h"
105 #include "core/html/HTMLTableRowsCollection.h" 105 #include "core/html/HTMLTableRowsCollection.h"
106 #include "core/html/HTMLTemplateElement.h" 106 #include "core/html/HTMLTemplateElement.h"
107 #include "core/html/parser/HTMLParserIdioms.h" 107 #include "core/html/parser/HTMLParserIdioms.h"
108 #include "core/input/EventHandler.h"
108 #include "core/inspector/InspectorInstrumentation.h" 109 #include "core/inspector/InspectorInstrumentation.h"
109 #include "core/layout/LayoutTextFragment.h" 110 #include "core/layout/LayoutTextFragment.h"
110 #include "core/layout/LayoutView.h" 111 #include "core/layout/LayoutView.h"
111 #include "core/layout/api/LayoutBoxItem.h" 112 #include "core/layout/api/LayoutBoxItem.h"
112 #include "core/loader/DocumentLoader.h" 113 #include "core/loader/DocumentLoader.h"
113 #include "core/page/ChromeClient.h" 114 #include "core/page/ChromeClient.h"
114 #include "core/page/FocusController.h" 115 #include "core/page/FocusController.h"
115 #include "core/page/Page.h" 116 #include "core/page/Page.h"
116 #include "core/page/PointerLockController.h" 117 #include "core/page/PointerLockController.h"
117 #include "core/page/SpatialNavigation.h" 118 #include "core/page/SpatialNavigation.h"
(...skipping 1384 matching lines...) Expand 10 before | Expand all | Expand 10 after
1502 ElementRareData* data = elementRareData(); 1503 ElementRareData* data = elementRareData();
1503 1504
1504 data->clearRestyleFlags(); 1505 data->clearRestyleFlags();
1505 1506
1506 if (ElementAnimations* elementAnimations = data->elementAnimations()) 1507 if (ElementAnimations* elementAnimations = data->elementAnimations())
1507 elementAnimations->cssAnimations().cancel(); 1508 elementAnimations->cssAnimations().cancel();
1508 1509
1509 if (data->intersectionObserverData()) 1510 if (data->intersectionObserverData())
1510 data->intersectionObserverData()->deactivateAllIntersectionObservers (*this); 1511 data->intersectionObserverData()->deactivateAllIntersectionObservers (*this);
1511 } 1512 }
1513
1514 if (document().frame())
1515 document().frame()->eventHandler().elementRemoved(this);
1512 } 1516 }
1513 1517
1514 void Element::attach(const AttachContext& context) 1518 void Element::attach(const AttachContext& context)
1515 { 1519 {
1516 ASSERT(document().inStyleRecalc()); 1520 ASSERT(document().inStyleRecalc());
1517 1521
1518 // We've already been through detach when doing an attach, but we might 1522 // We've already been through detach when doing an attach, but we might
1519 // need to clear any state that's been added since then. 1523 // need to clear any state that's been added since then.
1520 if (hasRareData() && getStyleChangeType() == NeedsReattachStyleChange) { 1524 if (hasRareData() && getStyleChangeType() == NeedsReattachStyleChange) {
1521 ElementRareData* data = elementRareData(); 1525 ElementRareData* data = elementRareData();
(...skipping 1111 matching lines...) Expand 10 before | Expand all | Expand 10 after
2633 RefPtrWillBeRawPtr<Element> contextElement = contextElementForInsertion(wher e, this, exceptionState); 2637 RefPtrWillBeRawPtr<Element> contextElement = contextElementForInsertion(wher e, this, exceptionState);
2634 if (!contextElement) 2638 if (!contextElement)
2635 return; 2639 return;
2636 2640
2637 RefPtrWillBeRawPtr<DocumentFragment> fragment = createFragmentForInnerOuterH TML(markup, contextElement.get(), AllowScriptingContent, "insertAdjacentHTML", e xceptionState); 2641 RefPtrWillBeRawPtr<DocumentFragment> fragment = createFragmentForInnerOuterH TML(markup, contextElement.get(), AllowScriptingContent, "insertAdjacentHTML", e xceptionState);
2638 if (!fragment) 2642 if (!fragment)
2639 return; 2643 return;
2640 insertAdjacent(where, fragment.get(), exceptionState); 2644 insertAdjacent(where, fragment.get(), exceptionState);
2641 } 2645 }
2642 2646
2647 void Element::setPointerCapture(int pointerId, ExceptionState& exceptionState)
2648 {
2649 if (document().frame()) {
2650 if (!document().frame()->eventHandler().isPointerEventActive(pointerId))
2651 exceptionState.throwDOMException(InvalidPointerId, "InvalidPointerId ");
2652 else if (!inDocument())
2653 exceptionState.throwDOMException(InvalidStateError, "InvalidStateErr or");
2654 else
2655 document().frame()->eventHandler().setPointerCapture(pointerId, this );
2656 }
2657 }
2658
2659 void Element::releasePointerCapture(int pointerId, ExceptionState& exceptionStat e)
2660 {
2661 if (document().frame()) {
2662 if (!document().frame()->eventHandler().isPointerEventActive(pointerId))
2663 exceptionState.throwDOMException(InvalidPointerId, "InvalidPointerId ");
2664 else
2665 document().frame()->eventHandler().releasePointerCapture(pointerId, this);
2666 }
2667 }
2668
2643 String Element::innerText() 2669 String Element::innerText()
2644 { 2670 {
2645 // We need to update layout, since plainText uses line boxes in the layout t ree. 2671 // We need to update layout, since plainText uses line boxes in the layout t ree.
2646 document().updateLayoutIgnorePendingStylesheets(); 2672 document().updateLayoutIgnorePendingStylesheets();
2647 2673
2648 if (!layoutObject()) 2674 if (!layoutObject())
2649 return textContent(true); 2675 return textContent(true);
2650 2676
2651 return plainText(EphemeralRange::rangeOfContents(*this), TextIteratorForInne rText); 2677 return plainText(EphemeralRange::rangeOfContents(*this), TextIteratorForInne rText);
2652 } 2678 }
(...skipping 989 matching lines...) Expand 10 before | Expand all | Expand 10 after
3642 { 3668 {
3643 #if ENABLE(OILPAN) 3669 #if ENABLE(OILPAN)
3644 if (hasRareData()) 3670 if (hasRareData())
3645 visitor->trace(elementRareData()); 3671 visitor->trace(elementRareData());
3646 visitor->trace(m_elementData); 3672 visitor->trace(m_elementData);
3647 #endif 3673 #endif
3648 ContainerNode::trace(visitor); 3674 ContainerNode::trace(visitor);
3649 } 3675 }
3650 3676
3651 } // namespace blink 3677 } // namespace blink
OLDNEW
« 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