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

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

Issue 2005593002: Initial ResizeObserver implementation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix global-interface-listing test 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 2626 matching lines...) Expand 10 before | Expand all | Expand 10 after
2637 if (hasRareData()) 2637 if (hasRareData())
2638 return elementRareData()->intersectionObserverData(); 2638 return elementRareData()->intersectionObserverData();
2639 return nullptr; 2639 return nullptr;
2640 } 2640 }
2641 2641
2642 NodeIntersectionObserverData& Element::ensureIntersectionObserverData() 2642 NodeIntersectionObserverData& Element::ensureIntersectionObserverData()
2643 { 2643 {
2644 return ensureElementRareData().ensureIntersectionObserverData(); 2644 return ensureElementRareData().ensureIntersectionObserverData();
2645 } 2645 }
2646 2646
2647 HeapHashMap<Member<ResizeObserver>, Member<ResizeObservation>>* Element::resizeO bserverData() const
2648 {
2649 if (hasRareData())
2650 return elementRareData()->resizeObserverData();
2651 return nullptr;
2652 }
2653
2654 HeapHashMap<Member<ResizeObserver>, Member<ResizeObservation>>& Element::ensureR esizeObserverData()
2655 {
2656 return ensureElementRareData().ensureResizeObserverData();
2657 }
2658
2647 // Step 1 of http://domparsing.spec.whatwg.org/#insertadjacenthtml() 2659 // Step 1 of http://domparsing.spec.whatwg.org/#insertadjacenthtml()
2648 static Element* contextElementForInsertion(const String& where, Element* element , ExceptionState& exceptionState) 2660 static Element* contextElementForInsertion(const String& where, Element* element , ExceptionState& exceptionState)
2649 { 2661 {
2650 if (equalIgnoringCase(where, "beforeBegin") || equalIgnoringCase(where, "aft erEnd")) { 2662 if (equalIgnoringCase(where, "beforeBegin") || equalIgnoringCase(where, "aft erEnd")) {
2651 Element* parent = element->parentElement(); 2663 Element* parent = element->parentElement();
2652 if (!parent) { 2664 if (!parent) {
2653 exceptionState.throwDOMException(NoModificationAllowedError, "The el ement has no parent."); 2665 exceptionState.throwDOMException(NoModificationAllowedError, "The el ement has no parent.");
2654 return nullptr; 2666 return nullptr;
2655 } 2667 }
2656 return parent; 2668 return parent;
(...skipping 1081 matching lines...) Expand 10 before | Expand all | Expand 10 after
3738 3750
3739 DEFINE_TRACE_WRAPPERS(Element) 3751 DEFINE_TRACE_WRAPPERS(Element)
3740 { 3752 {
3741 if (hasRareData()) { 3753 if (hasRareData()) {
3742 visitor->traceWrappers(elementRareData()); 3754 visitor->traceWrappers(elementRareData());
3743 } 3755 }
3744 ContainerNode::traceWrappers(visitor); 3756 ContainerNode::traceWrappers(visitor);
3745 } 3757 }
3746 3758
3747 } // namespace blink 3759 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698