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

Side by Side Diff: Source/core/dom/Document.h

Issue 1323243002: WIP - Rough draft of style observation in style of apply hooks. Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 3 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
« no previous file with comments | « Source/core/core.gypi ('k') | Source/core/dom/Document.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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, 2010, 2012 Apple Inc. All r ights reserved. 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 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) 2010 Nokia Corporation and/or its subsidiary(-ies) 8 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
9 * Copyright (C) 2011 Google Inc. All rights reserved. 9 * Copyright (C) 2011 Google Inc. All rights reserved.
10 * 10 *
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 #include "core/dom/UserActionElementSet.h" 47 #include "core/dom/UserActionElementSet.h"
48 #include "core/dom/ViewportDescription.h" 48 #include "core/dom/ViewportDescription.h"
49 #include "core/dom/custom/CustomElement.h" 49 #include "core/dom/custom/CustomElement.h"
50 #include "core/fetch/ClientHintsPreferences.h" 50 #include "core/fetch/ClientHintsPreferences.h"
51 #include "core/frame/DOMTimerCoordinator.h" 51 #include "core/frame/DOMTimerCoordinator.h"
52 #include "core/frame/LocalDOMWindow.h" 52 #include "core/frame/LocalDOMWindow.h"
53 #include "core/frame/OriginsUsingFeatures.h" 53 #include "core/frame/OriginsUsingFeatures.h"
54 #include "core/html/CollectionType.h" 54 #include "core/html/CollectionType.h"
55 #include "core/html/parser/ParserSynchronizationPolicy.h" 55 #include "core/html/parser/ParserSynchronizationPolicy.h"
56 #include "core/page/PageVisibilityState.h" 56 #include "core/page/PageVisibilityState.h"
57 #include "core/style/StyleObserver.h"
57 #include "platform/Length.h" 58 #include "platform/Length.h"
58 #include "platform/Timer.h" 59 #include "platform/Timer.h"
59 #include "platform/heap/Handle.h" 60 #include "platform/heap/Handle.h"
60 #include "platform/weborigin/KURL.h" 61 #include "platform/weborigin/KURL.h"
61 #include "platform/weborigin/ReferrerPolicy.h" 62 #include "platform/weborigin/ReferrerPolicy.h"
62 #include "public/platform/WebFocusType.h" 63 #include "public/platform/WebFocusType.h"
63 #include "wtf/HashSet.h" 64 #include "wtf/HashSet.h"
64 #include "wtf/OwnPtr.h" 65 #include "wtf/OwnPtr.h"
65 #include "wtf/PassOwnPtr.h" 66 #include "wtf/PassOwnPtr.h"
66 #include "wtf/PassRefPtr.h" 67 #include "wtf/PassRefPtr.h"
(...skipping 928 matching lines...) Expand 10 before | Expand all | Expand 10 after
995 996
996 void updateSecurityOrigin(PassRefPtr<SecurityOrigin>); 997 void updateSecurityOrigin(PassRefPtr<SecurityOrigin>);
997 998
998 void setHasViewportUnits() { m_hasViewportUnits = true; } 999 void setHasViewportUnits() { m_hasViewportUnits = true; }
999 bool hasViewportUnits() const { return m_hasViewportUnits; } 1000 bool hasViewportUnits() const { return m_hasViewportUnits; }
1000 void notifyResizeForViewportUnits(); 1001 void notifyResizeForViewportUnits();
1001 1002
1002 void registerVisibilityObserver(DocumentVisibilityObserver*); 1003 void registerVisibilityObserver(DocumentVisibilityObserver*);
1003 void unregisterVisibilityObserver(DocumentVisibilityObserver*); 1004 void unregisterVisibilityObserver(DocumentVisibilityObserver*);
1004 1005
1006 bool hasStyleObserver();
1007 void notifyStyleObservers(const Element*, const ComputedStyle* oldStyle, con st ComputedStyle* newStyle);
1008 void registerStyleObserver(StyleObserver*);
1009 void unregisterStyleObserver(StyleObserver*);
1010
1005 void updateStyleInvalidationIfNeeded(); 1011 void updateStyleInvalidationIfNeeded();
1006 1012
1007 DECLARE_VIRTUAL_TRACE(); 1013 DECLARE_VIRTUAL_TRACE();
1008 1014
1009 bool hasSVGFilterElementsRequiringLayerUpdate() const { return m_layerUpdate SVGFilterElements.size(); } 1015 bool hasSVGFilterElementsRequiringLayerUpdate() const { return m_layerUpdate SVGFilterElements.size(); }
1010 void didRecalculateStyleForElement() { ++m_styleRecalcElementCounter; } 1016 void didRecalculateStyleForElement() { ++m_styleRecalcElementCounter; }
1011 1017
1012 AtomicString convertLocalName(const AtomicString&); 1018 AtomicString convertLocalName(const AtomicString&);
1013 1019
1014 void platformColorsChanged(); 1020 void platformColorsChanged();
(...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after
1359 1365
1360 Timer<Document> m_didAssociateFormControlsTimer; 1366 Timer<Document> m_didAssociateFormControlsTimer;
1361 WillBeHeapHashSet<RefPtrWillBeMember<Element>> m_associatedFormControls; 1367 WillBeHeapHashSet<RefPtrWillBeMember<Element>> m_associatedFormControls;
1362 1368
1363 WillBeHeapHashSet<RawPtrWillBeMember<SVGUseElement>> m_useElementsNeedingUpd ate; 1369 WillBeHeapHashSet<RawPtrWillBeMember<SVGUseElement>> m_useElementsNeedingUpd ate;
1364 WillBeHeapHashSet<RawPtrWillBeMember<Element>> m_layerUpdateSVGFilterElement s; 1370 WillBeHeapHashSet<RawPtrWillBeMember<Element>> m_layerUpdateSVGFilterElement s;
1365 1371
1366 DOMTimerCoordinator m_timers; 1372 DOMTimerCoordinator m_timers;
1367 1373
1368 bool m_hasViewportUnits; 1374 bool m_hasViewportUnits;
1375 using StyleObserverSet = WillBeHeapHashSet<RawPtrWillBeWeakMember<StyleObser ver>>;
1376 StyleObserverSet m_styleObservers;
1369 1377
1370 using DocumentVisibilityObserverSet = WillBeHeapHashSet<RawPtrWillBeWeakMemb er<DocumentVisibilityObserver>>; 1378 using DocumentVisibilityObserverSet = WillBeHeapHashSet<RawPtrWillBeWeakMemb er<DocumentVisibilityObserver>>;
1371 DocumentVisibilityObserverSet m_visibilityObservers; 1379 DocumentVisibilityObserverSet m_visibilityObservers;
1372 1380
1373 int m_styleRecalcElementCounter; 1381 int m_styleRecalcElementCounter;
1374 1382
1375 ParserSynchronizationPolicy m_parserSyncPolicy; 1383 ParserSynchronizationPolicy m_parserSyncPolicy;
1376 1384
1377 OriginsUsingFeatures::Value m_originsUsingFeaturesValue; 1385 OriginsUsingFeatures::Value m_originsUsingFeaturesValue;
1378 1386
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
1423 DEFINE_TYPE_CASTS(TreeScope, Document, document, true, true); 1431 DEFINE_TYPE_CASTS(TreeScope, Document, document, true, true);
1424 1432
1425 } // namespace blink 1433 } // namespace blink
1426 1434
1427 #ifndef NDEBUG 1435 #ifndef NDEBUG
1428 // Outside the WebCore namespace for ease of invocation from gdb. 1436 // Outside the WebCore namespace for ease of invocation from gdb.
1429 CORE_EXPORT void showLiveDocumentInstances(); 1437 CORE_EXPORT void showLiveDocumentInstances();
1430 #endif 1438 #endif
1431 1439
1432 #endif // Document_h 1440 #endif // Document_h
OLDNEW
« no previous file with comments | « Source/core/core.gypi ('k') | Source/core/dom/Document.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698