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

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

Issue 2005593002: Initial ResizeObserver implementation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Observe content box, not clientWidth 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 Dirk Mueller (mueller@kde.org) 4 * (C) 2001 Dirk Mueller (mueller@kde.org)
5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org) 5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org)
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All r ights reserved. 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All r ights reserved.
7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/) 7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/)
8 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved. 8 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved.
9 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) 9 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
10 * Copyright (C) Research In Motion Limited 2010-2011. All rights reserved. 10 * Copyright (C) Research In Motion Limited 2010-2011. All rights reserved.
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after
180 #include "core/layout/api/LayoutViewItem.h" 180 #include "core/layout/api/LayoutViewItem.h"
181 #include "core/layout/compositing/PaintLayerCompositor.h" 181 #include "core/layout/compositing/PaintLayerCompositor.h"
182 #include "core/loader/CookieJar.h" 182 #include "core/loader/CookieJar.h"
183 #include "core/loader/DocumentLoader.h" 183 #include "core/loader/DocumentLoader.h"
184 #include "core/loader/FrameFetchContext.h" 184 #include "core/loader/FrameFetchContext.h"
185 #include "core/loader/FrameLoader.h" 185 #include "core/loader/FrameLoader.h"
186 #include "core/loader/FrameLoaderClient.h" 186 #include "core/loader/FrameLoaderClient.h"
187 #include "core/loader/ImageLoader.h" 187 #include "core/loader/ImageLoader.h"
188 #include "core/loader/NavigationScheduler.h" 188 #include "core/loader/NavigationScheduler.h"
189 #include "core/loader/appcache/ApplicationCacheHost.h" 189 #include "core/loader/appcache/ApplicationCacheHost.h"
190 #include "core/observer/ResizeObserverController.h"
190 #include "core/page/ChromeClient.h" 191 #include "core/page/ChromeClient.h"
191 #include "core/page/EventWithHitTestResults.h" 192 #include "core/page/EventWithHitTestResults.h"
192 #include "core/page/FocusController.h" 193 #include "core/page/FocusController.h"
193 #include "core/page/FrameTree.h" 194 #include "core/page/FrameTree.h"
194 #include "core/page/Page.h" 195 #include "core/page/Page.h"
195 #include "core/page/PointerLockController.h" 196 #include "core/page/PointerLockController.h"
196 #include "core/page/scrolling/RootScroller.h" 197 #include "core/page/scrolling/RootScroller.h"
197 #include "core/page/scrolling/ScrollingCoordinator.h" 198 #include "core/page/scrolling/ScrollingCoordinator.h"
198 #include "core/page/scrolling/SnapCoordinator.h" 199 #include "core/page/scrolling/SnapCoordinator.h"
199 #include "core/svg/SVGDocumentExtensions.h" 200 #include "core/svg/SVGDocumentExtensions.h"
(...skipping 4982 matching lines...) Expand 10 before | Expand all | Expand 10 after
5182 return *m_intersectionObserverController; 5183 return *m_intersectionObserverController;
5183 } 5184 }
5184 5185
5185 NodeIntersectionObserverData& Document::ensureIntersectionObserverData() 5186 NodeIntersectionObserverData& Document::ensureIntersectionObserverData()
5186 { 5187 {
5187 if (!m_intersectionObserverData) 5188 if (!m_intersectionObserverData)
5188 m_intersectionObserverData = new NodeIntersectionObserverData(); 5189 m_intersectionObserverData = new NodeIntersectionObserverData();
5189 return *m_intersectionObserverData; 5190 return *m_intersectionObserverData;
5190 } 5191 }
5191 5192
5193 ResizeObserverController& Document::ensureResizeObserverController()
5194 {
5195 if (!m_resizeObserverController)
5196 m_resizeObserverController = new ResizeObserverController();
5197 return *m_resizeObserverController;
5198 }
5199
5192 void Document::reportBlockedScriptExecutionToInspector(const String& directiveTe xt) 5200 void Document::reportBlockedScriptExecutionToInspector(const String& directiveTe xt)
5193 { 5201 {
5194 InspectorInstrumentation::scriptExecutionBlockedByCSP(this, directiveText); 5202 InspectorInstrumentation::scriptExecutionBlockedByCSP(this, directiveText);
5195 } 5203 }
5196 5204
5197 void Document::addConsoleMessage(ConsoleMessage* consoleMessage) 5205 void Document::addConsoleMessage(ConsoleMessage* consoleMessage)
5198 { 5206 {
5199 if (!isContextThread()) { 5207 if (!isContextThread()) {
5200 m_taskRunner->postTask(BLINK_FROM_HERE, AddConsoleMessageTask::create(co nsoleMessage->source(), consoleMessage->level(), consoleMessage->message())); 5208 m_taskRunner->postTask(BLINK_FROM_HERE, AddConsoleMessageTask::create(co nsoleMessage->source(), consoleMessage->level(), consoleMessage->message()));
5201 return; 5209 return;
(...skipping 773 matching lines...) Expand 10 before | Expand all | Expand 10 after
5975 visitor->trace(m_templateDocumentHost); 5983 visitor->trace(m_templateDocumentHost);
5976 visitor->trace(m_userActionElements); 5984 visitor->trace(m_userActionElements);
5977 visitor->trace(m_svgExtensions); 5985 visitor->trace(m_svgExtensions);
5978 visitor->trace(m_timeline); 5986 visitor->trace(m_timeline);
5979 visitor->trace(m_compositorPendingAnimations); 5987 visitor->trace(m_compositorPendingAnimations);
5980 visitor->trace(m_contextDocument); 5988 visitor->trace(m_contextDocument);
5981 visitor->trace(m_canvasFontCache); 5989 visitor->trace(m_canvasFontCache);
5982 visitor->trace(m_intersectionObserverController); 5990 visitor->trace(m_intersectionObserverController);
5983 visitor->trace(m_intersectionObserverData); 5991 visitor->trace(m_intersectionObserverData);
5984 visitor->trace(m_snapCoordinator); 5992 visitor->trace(m_snapCoordinator);
5993 visitor->trace(m_resizeObserverController);
5985 Supplementable<Document>::trace(visitor); 5994 Supplementable<Document>::trace(visitor);
5986 TreeScope::trace(visitor); 5995 TreeScope::trace(visitor);
5987 ContainerNode::trace(visitor); 5996 ContainerNode::trace(visitor);
5988 ExecutionContext::trace(visitor); 5997 ExecutionContext::trace(visitor);
5989 SecurityContext::trace(visitor); 5998 SecurityContext::trace(visitor);
5990 } 5999 }
5991 6000
5992 DEFINE_TRACE_WRAPPERS(Document) 6001 DEFINE_TRACE_WRAPPERS(Document)
5993 { 6002 {
5994 visitor->traceWrappers(m_importsController); 6003 visitor->traceWrappers(m_importsController);
(...skipping 18 matching lines...) Expand all
6013 #ifndef NDEBUG 6022 #ifndef NDEBUG
6014 using namespace blink; 6023 using namespace blink;
6015 void showLiveDocumentInstances() 6024 void showLiveDocumentInstances()
6016 { 6025 {
6017 Document::WeakDocumentSet& set = Document::liveDocumentSet(); 6026 Document::WeakDocumentSet& set = Document::liveDocumentSet();
6018 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); 6027 fprintf(stderr, "There are %u documents currently alive:\n", set.size());
6019 for (Document* document : set) 6028 for (Document* document : set)
6020 fprintf(stderr, "- Document %p URL: %s\n", document, document->url().get String().utf8().data()); 6029 fprintf(stderr, "- Document %p URL: %s\n", document, document->url().get String().utf8().data());
6021 } 6030 }
6022 #endif 6031 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698