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

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: Yet another rebase 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 1382 matching lines...) Expand 10 before | Expand all | Expand 10 after
1500 ElementRareData* data = elementRareData(); 1501 ElementRareData* data = elementRareData();
1501 1502
1502 data->clearRestyleFlags(); 1503 data->clearRestyleFlags();
1503 1504
1504 if (ElementAnimations* elementAnimations = data->elementAnimations()) 1505 if (ElementAnimations* elementAnimations = data->elementAnimations())
1505 elementAnimations->cssAnimations().cancel(); 1506 elementAnimations->cssAnimations().cancel();
1506 1507
1507 if (data->intersectionObserverData()) 1508 if (data->intersectionObserverData())
1508 data->intersectionObserverData()->deactivateAllIntersectionObservers (*this); 1509 data->intersectionObserverData()->deactivateAllIntersectionObservers (*this);
1509 } 1510 }
1511
1512 if (document().frame())
1513 document().frame()->eventHandler().elementRemoved(this);
1510 } 1514 }
1511 1515
1512 void Element::attach(const AttachContext& context) 1516 void Element::attach(const AttachContext& context)
1513 { 1517 {
1514 ASSERT(document().inStyleRecalc()); 1518 ASSERT(document().inStyleRecalc());
1515 1519
1516 // We've already been through detach when doing an attach, but we might 1520 // We've already been through detach when doing an attach, but we might
1517 // need to clear any state that's been added since then. 1521 // need to clear any state that's been added since then.
1518 if (hasRareData() && getStyleChangeType() == NeedsReattachStyleChange) { 1522 if (hasRareData() && getStyleChangeType() == NeedsReattachStyleChange) {
1519 ElementRareData* data = elementRareData(); 1523 ElementRareData* data = elementRareData();
(...skipping 1111 matching lines...) Expand 10 before | Expand all | Expand 10 after
2631 RefPtrWillBeRawPtr<Element> contextElement = contextElementForInsertion(wher e, this, exceptionState); 2635 RefPtrWillBeRawPtr<Element> contextElement = contextElementForInsertion(wher e, this, exceptionState);
2632 if (!contextElement) 2636 if (!contextElement)
2633 return; 2637 return;
2634 2638
2635 RefPtrWillBeRawPtr<DocumentFragment> fragment = createFragmentForInnerOuterH TML(markup, contextElement.get(), AllowScriptingContent, "insertAdjacentHTML", e xceptionState); 2639 RefPtrWillBeRawPtr<DocumentFragment> fragment = createFragmentForInnerOuterH TML(markup, contextElement.get(), AllowScriptingContent, "insertAdjacentHTML", e xceptionState);
2636 if (!fragment) 2640 if (!fragment)
2637 return; 2641 return;
2638 insertAdjacent(where, fragment.get(), exceptionState); 2642 insertAdjacent(where, fragment.get(), exceptionState);
2639 } 2643 }
2640 2644
2645 void Element::setPointerCapture(int pointerId, ExceptionState& exceptionState)
2646 {
2647 if (document().frame()) {
2648 if (!document().frame()->eventHandler().isPointerEventActive(pointerId))
2649 exceptionState.throwDOMException(InvalidPointerId, "InvalidPointerId ");
2650 else if (!inDocument())
2651 exceptionState.throwDOMException(InvalidStateError, "InvalidStateErr or");
2652 else
2653 document().frame()->eventHandler().setPointerCapture(pointerId, this );
2654 }
2655 }
2656
2657 void Element::releasePointerCapture(int pointerId, ExceptionState& exceptionStat e)
2658 {
2659 if (document().frame()) {
2660 if (!document().frame()->eventHandler().isPointerEventActive(pointerId))
2661 exceptionState.throwDOMException(InvalidPointerId, "InvalidPointerId ");
2662 else
2663 document().frame()->eventHandler().releasePointerCapture(pointerId, this);
2664 }
2665 }
2666
2641 String Element::innerText() 2667 String Element::innerText()
2642 { 2668 {
2643 // We need to update layout, since plainText uses line boxes in the layout t ree. 2669 // We need to update layout, since plainText uses line boxes in the layout t ree.
2644 document().updateLayoutIgnorePendingStylesheets(); 2670 document().updateLayoutIgnorePendingStylesheets();
2645 2671
2646 if (!layoutObject()) 2672 if (!layoutObject())
2647 return textContent(true); 2673 return textContent(true);
2648 2674
2649 return plainText(EphemeralRange::rangeOfContents(*this), TextIteratorForInne rText); 2675 return plainText(EphemeralRange::rangeOfContents(*this), TextIteratorForInne rText);
2650 } 2676 }
(...skipping 989 matching lines...) Expand 10 before | Expand all | Expand 10 after
3640 { 3666 {
3641 #if ENABLE(OILPAN) 3667 #if ENABLE(OILPAN)
3642 if (hasRareData()) 3668 if (hasRareData())
3643 visitor->trace(elementRareData()); 3669 visitor->trace(elementRareData());
3644 visitor->trace(m_elementData); 3670 visitor->trace(m_elementData);
3645 #endif 3671 #endif
3646 ContainerNode::trace(visitor); 3672 ContainerNode::trace(visitor);
3647 } 3673 }
3648 3674
3649 } // namespace blink 3675 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698