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

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: Update to master: Vector<WeakMember> no longer ok. Created 4 years, 6 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 2610 matching lines...) Expand 10 before | Expand all | Expand 10 after
2621 if (hasRareData()) 2621 if (hasRareData())
2622 return elementRareData()->intersectionObserverData(); 2622 return elementRareData()->intersectionObserverData();
2623 return nullptr; 2623 return nullptr;
2624 } 2624 }
2625 2625
2626 NodeIntersectionObserverData& Element::ensureIntersectionObserverData() 2626 NodeIntersectionObserverData& Element::ensureIntersectionObserverData()
2627 { 2627 {
2628 return ensureElementRareData().ensureIntersectionObserverData(); 2628 return ensureElementRareData().ensureIntersectionObserverData();
2629 } 2629 }
2630 2630
2631 HeapHashMap<Member<ResizeObserver>, Member<ResizeObservation>>* Element::resizeO bserverData() const
2632 {
2633 if (hasRareData())
2634 return elementRareData()->resizeObserverData();
2635 return nullptr;
2636 }
2637
2638 HeapHashMap<Member<ResizeObserver>, Member<ResizeObservation>>& Element::ensureR esizeObserverData()
2639 {
2640 return ensureElementRareData().ensureResizeObserverData();
2641 }
2642
2631 // Step 1 of http://domparsing.spec.whatwg.org/#insertadjacenthtml() 2643 // Step 1 of http://domparsing.spec.whatwg.org/#insertadjacenthtml()
2632 static Element* contextElementForInsertion(const String& where, Element* element , ExceptionState& exceptionState) 2644 static Element* contextElementForInsertion(const String& where, Element* element , ExceptionState& exceptionState)
2633 { 2645 {
2634 if (equalIgnoringCase(where, "beforeBegin") || equalIgnoringCase(where, "aft erEnd")) { 2646 if (equalIgnoringCase(where, "beforeBegin") || equalIgnoringCase(where, "aft erEnd")) {
2635 Element* parent = element->parentElement(); 2647 Element* parent = element->parentElement();
2636 if (!parent) { 2648 if (!parent) {
2637 exceptionState.throwDOMException(NoModificationAllowedError, "The el ement has no parent."); 2649 exceptionState.throwDOMException(NoModificationAllowedError, "The el ement has no parent.");
2638 return nullptr; 2650 return nullptr;
2639 } 2651 }
2640 return parent; 2652 return parent;
(...skipping 1081 matching lines...) Expand 10 before | Expand all | Expand 10 after
3722 3734
3723 DEFINE_TRACE_WRAPPERS(Element) 3735 DEFINE_TRACE_WRAPPERS(Element)
3724 { 3736 {
3725 if (hasRareData()) { 3737 if (hasRareData()) {
3726 visitor->traceWrappers(elementRareData()); 3738 visitor->traceWrappers(elementRareData());
3727 } 3739 }
3728 ContainerNode::traceWrappers(visitor); 3740 ContainerNode::traceWrappers(visitor);
3729 } 3741 }
3730 3742
3731 } // namespace blink 3743 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698