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

Side by Side Diff: third_party/WebKit/Source/core/dom/Element.cpp

Issue 2161313002: ResizeObserver implementation, part 2: lifetime (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: CR fixes Created 4 years, 5 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 2633 matching lines...) Expand 10 before | Expand all | Expand 10 after
2644 if (hasRareData()) 2644 if (hasRareData())
2645 return elementRareData()->intersectionObserverData(); 2645 return elementRareData()->intersectionObserverData();
2646 return nullptr; 2646 return nullptr;
2647 } 2647 }
2648 2648
2649 NodeIntersectionObserverData& Element::ensureIntersectionObserverData() 2649 NodeIntersectionObserverData& Element::ensureIntersectionObserverData()
2650 { 2650 {
2651 return ensureElementRareData().ensureIntersectionObserverData(); 2651 return ensureElementRareData().ensureIntersectionObserverData();
2652 } 2652 }
2653 2653
2654 HeapHashMap<Member<ResizeObserver>, Member<ResizeObservation>>* Element::resizeO bserverData() const
2655 {
2656 if (hasRareData())
2657 return elementRareData()->resizeObserverData();
2658 return nullptr;
2659 }
2660
2661 HeapHashMap<Member<ResizeObserver>, Member<ResizeObservation>>& Element::ensureR esizeObserverData()
2662 {
2663 return ensureElementRareData().ensureResizeObserverData();
2664 }
2665
2654 // Step 1 of http://domparsing.spec.whatwg.org/#insertadjacenthtml() 2666 // Step 1 of http://domparsing.spec.whatwg.org/#insertadjacenthtml()
2655 static Element* contextElementForInsertion(const String& where, Element* element , ExceptionState& exceptionState) 2667 static Element* contextElementForInsertion(const String& where, Element* element , ExceptionState& exceptionState)
2656 { 2668 {
2657 if (equalIgnoringCase(where, "beforeBegin") || equalIgnoringCase(where, "aft erEnd")) { 2669 if (equalIgnoringCase(where, "beforeBegin") || equalIgnoringCase(where, "aft erEnd")) {
2658 Element* parent = element->parentElement(); 2670 Element* parent = element->parentElement();
2659 if (!parent) { 2671 if (!parent) {
2660 exceptionState.throwDOMException(NoModificationAllowedError, "The el ement has no parent."); 2672 exceptionState.throwDOMException(NoModificationAllowedError, "The el ement has no parent.");
2661 return nullptr; 2673 return nullptr;
2662 } 2674 }
2663 return parent; 2675 return parent;
(...skipping 1081 matching lines...) Expand 10 before | Expand all | Expand 10 after
3745 3757
3746 DEFINE_TRACE_WRAPPERS(Element) 3758 DEFINE_TRACE_WRAPPERS(Element)
3747 { 3759 {
3748 if (hasRareData()) { 3760 if (hasRareData()) {
3749 visitor->traceWrappers(elementRareData()); 3761 visitor->traceWrappers(elementRareData());
3750 } 3762 }
3751 ContainerNode::traceWrappers(visitor); 3763 ContainerNode::traceWrappers(visitor);
3752 } 3764 }
3753 3765
3754 } // namespace blink 3766 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/dom/Element.h ('k') | third_party/WebKit/Source/core/dom/ElementRareData.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698