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

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

Issue 2204503002: ResizeObserver pt6: integration (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Restore missing code that was blown away by rebase Created 4 years, 4 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 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 #include "core/html/HTMLSlotElement.h" 110 #include "core/html/HTMLSlotElement.h"
111 #include "core/html/HTMLTableRowsCollection.h" 111 #include "core/html/HTMLTableRowsCollection.h"
112 #include "core/html/HTMLTemplateElement.h" 112 #include "core/html/HTMLTemplateElement.h"
113 #include "core/html/parser/HTMLParserIdioms.h" 113 #include "core/html/parser/HTMLParserIdioms.h"
114 #include "core/input/EventHandler.h" 114 #include "core/input/EventHandler.h"
115 #include "core/inspector/InspectorInstrumentation.h" 115 #include "core/inspector/InspectorInstrumentation.h"
116 #include "core/layout/LayoutTextFragment.h" 116 #include "core/layout/LayoutTextFragment.h"
117 #include "core/layout/api/LayoutBoxItem.h" 117 #include "core/layout/api/LayoutBoxItem.h"
118 #include "core/layout/api/LayoutViewItem.h" 118 #include "core/layout/api/LayoutViewItem.h"
119 #include "core/loader/DocumentLoader.h" 119 #include "core/loader/DocumentLoader.h"
120 #include "core/observer/ResizeObservation.h"
120 #include "core/page/ChromeClient.h" 121 #include "core/page/ChromeClient.h"
121 #include "core/page/FocusController.h" 122 #include "core/page/FocusController.h"
122 #include "core/page/Page.h" 123 #include "core/page/Page.h"
123 #include "core/page/PointerLockController.h" 124 #include "core/page/PointerLockController.h"
124 #include "core/page/SpatialNavigation.h" 125 #include "core/page/SpatialNavigation.h"
125 #include "core/page/scrolling/RootScrollerController.h" 126 #include "core/page/scrolling/RootScrollerController.h"
126 #include "core/page/scrolling/ScrollCustomizationCallbacks.h" 127 #include "core/page/scrolling/ScrollCustomizationCallbacks.h"
127 #include "core/page/scrolling/ScrollState.h" 128 #include "core/page/scrolling/ScrollState.h"
128 #include "core/page/scrolling/ScrollStateCallback.h" 129 #include "core/page/scrolling/ScrollStateCallback.h"
129 #include "core/paint/PaintLayer.h" 130 #include "core/paint/PaintLayer.h"
(...skipping 1501 matching lines...) Expand 10 before | Expand all | Expand 10 after
1631 document().activeChainNodeDetached(*this); 1632 document().activeChainNodeDetached(*this);
1632 document().userActionElements().didDetach(*this); 1633 document().userActionElements().didDetach(*this);
1633 } 1634 }
1634 1635
1635 if (context.clearInvalidation) 1636 if (context.clearInvalidation)
1636 document().styleEngine().styleInvalidator().clearInvalidation(*this); 1637 document().styleEngine().styleInvalidator().clearInvalidation(*this);
1637 1638
1638 if (svgFilterNeedsLayerUpdate()) 1639 if (svgFilterNeedsLayerUpdate())
1639 document().unscheduleSVGFilterLayerUpdateHack(*this); 1640 document().unscheduleSVGFilterLayerUpdateHack(*this);
1640 1641
1642 setNeedsResizeObserverUpdate();
1643
1641 DCHECK(needsAttach()); 1644 DCHECK(needsAttach());
1642 } 1645 }
1643 1646
1644 bool Element::pseudoStyleCacheIsInvalid(const ComputedStyle* currentStyle, Compu tedStyle* newStyle) 1647 bool Element::pseudoStyleCacheIsInvalid(const ComputedStyle* currentStyle, Compu tedStyle* newStyle)
1645 { 1648 {
1646 DCHECK_EQ(currentStyle, computedStyle()); 1649 DCHECK_EQ(currentStyle, computedStyle());
1647 DCHECK(layoutObject()); 1650 DCHECK(layoutObject());
1648 1651
1649 if (!currentStyle) 1652 if (!currentStyle)
1650 return false; 1653 return false;
(...skipping 1035 matching lines...) Expand 10 before | Expand all | Expand 10 after
2686 if (hasRareData()) 2689 if (hasRareData())
2687 return elementRareData()->resizeObserverData(); 2690 return elementRareData()->resizeObserverData();
2688 return nullptr; 2691 return nullptr;
2689 } 2692 }
2690 2693
2691 HeapHashMap<Member<ResizeObserver>, Member<ResizeObservation>>& Element::ensureR esizeObserverData() 2694 HeapHashMap<Member<ResizeObserver>, Member<ResizeObservation>>& Element::ensureR esizeObserverData()
2692 { 2695 {
2693 return ensureElementRareData().ensureResizeObserverData(); 2696 return ensureElementRareData().ensureResizeObserverData();
2694 } 2697 }
2695 2698
2699 void Element::setNeedsResizeObserverUpdate()
2700 {
2701 if (auto* data = resizeObserverData()) {
2702 for (auto& observation : data->values())
2703 observation->elementSizeChanged();
2704 }
2705 }
2706
2696 // Step 1 of http://domparsing.spec.whatwg.org/#insertadjacenthtml() 2707 // Step 1 of http://domparsing.spec.whatwg.org/#insertadjacenthtml()
2697 static Element* contextElementForInsertion(const String& where, Element* element , ExceptionState& exceptionState) 2708 static Element* contextElementForInsertion(const String& where, Element* element , ExceptionState& exceptionState)
2698 { 2709 {
2699 if (equalIgnoringCase(where, "beforeBegin") || equalIgnoringCase(where, "aft erEnd")) { 2710 if (equalIgnoringCase(where, "beforeBegin") || equalIgnoringCase(where, "aft erEnd")) {
2700 Element* parent = element->parentElement(); 2711 Element* parent = element->parentElement();
2701 if (!parent) { 2712 if (!parent) {
2702 exceptionState.throwDOMException(NoModificationAllowedError, "The el ement has no parent."); 2713 exceptionState.throwDOMException(NoModificationAllowedError, "The el ement has no parent.");
2703 return nullptr; 2714 return nullptr;
2704 } 2715 }
2705 return parent; 2716 return parent;
(...skipping 1098 matching lines...) Expand 10 before | Expand all | Expand 10 after
3804 3815
3805 DEFINE_TRACE_WRAPPERS(Element) 3816 DEFINE_TRACE_WRAPPERS(Element)
3806 { 3817 {
3807 if (hasRareData()) { 3818 if (hasRareData()) {
3808 visitor->traceWrappers(elementRareData()); 3819 visitor->traceWrappers(elementRareData());
3809 } 3820 }
3810 ContainerNode::traceWrappers(visitor); 3821 ContainerNode::traceWrappers(visitor);
3811 } 3822 }
3812 3823
3813 } // namespace blink 3824 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/dom/Element.h ('k') | third_party/WebKit/Source/core/frame/FrameView.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698