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

Side by Side Diff: Source/core/dom/DocumentStyleSheetCollection.cpp

Issue 23819007: Have Node::document() return a reference instead of a pointer (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase on master Created 7 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/dom/DocumentFragment.cpp ('k') | Source/core/dom/DocumentType.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) 2013 Google Inc. All rights reserved. 9 * Copyright (C) 2013 Google Inc. All rights reserved.
10 * 10 *
(...skipping 30 matching lines...) Expand all
41 #include "core/page/Settings.h" 41 #include "core/page/Settings.h"
42 #include "core/svg/SVGStyleElement.h" 42 #include "core/svg/SVGStyleElement.h"
43 43
44 namespace WebCore { 44 namespace WebCore {
45 45
46 using namespace HTMLNames; 46 using namespace HTMLNames;
47 47
48 DocumentStyleSheetCollection::DocumentStyleSheetCollection(TreeScope* treeScope) 48 DocumentStyleSheetCollection::DocumentStyleSheetCollection(TreeScope* treeScope)
49 : StyleSheetCollection(treeScope) 49 : StyleSheetCollection(treeScope)
50 { 50 {
51 ASSERT(treeScope->rootNode() == treeScope->rootNode()->document()); 51 ASSERT(treeScope->rootNode() == &treeScope->rootNode()->document());
52 } 52 }
53 53
54 void DocumentStyleSheetCollection::collectStyleSheets(StyleSheetCollections* col lections, Vector<RefPtr<StyleSheet> >& styleSheets, Vector<RefPtr<CSSStyleSheet> >& activeSheets) 54 void DocumentStyleSheetCollection::collectStyleSheets(StyleSheetCollections* col lections, Vector<RefPtr<StyleSheet> >& styleSheets, Vector<RefPtr<CSSStyleSheet> >& activeSheets)
55 { 55 {
56 if (document()->settings() && !document()->settings()->authorAndUserStylesEn abled()) 56 if (document()->settings() && !document()->settings()->authorAndUserStylesEn abled())
57 return; 57 return;
58 58
59 DocumentOrderedList::iterator begin = m_styleSheetCandidateNodes.begin(); 59 DocumentOrderedList::iterator begin = m_styleSheetCandidateNodes.begin();
60 DocumentOrderedList::iterator end = m_styleSheetCandidateNodes.end(); 60 DocumentOrderedList::iterator end = m_styleSheetCandidateNodes.end();
61 for (DocumentOrderedList::iterator it = begin; it != end; ++it) { 61 for (DocumentOrderedList::iterator it = begin; it != end; ++it) {
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 if (activeSheet) 136 if (activeSheet)
137 activeSheets.append(activeSheet); 137 activeSheets.append(activeSheet);
138 } 138 }
139 } 139 }
140 140
141 static void collectActiveCSSStyleSheetsFromSeamlessParents(Vector<RefPtr<CSSStyl eSheet> >& sheets, Document* document) 141 static void collectActiveCSSStyleSheetsFromSeamlessParents(Vector<RefPtr<CSSStyl eSheet> >& sheets, Document* document)
142 { 142 {
143 HTMLIFrameElement* seamlessParentIFrame = document->seamlessParentIFrame(); 143 HTMLIFrameElement* seamlessParentIFrame = document->seamlessParentIFrame();
144 if (!seamlessParentIFrame) 144 if (!seamlessParentIFrame)
145 return; 145 return;
146 sheets.append(seamlessParentIFrame->document()->styleSheetCollections()->act iveAuthorStyleSheets()); 146 sheets.append(seamlessParentIFrame->document().styleSheetCollections()->acti veAuthorStyleSheets());
147 } 147 }
148 148
149 bool DocumentStyleSheetCollection::updateActiveStyleSheets(StyleSheetCollections * collections, StyleResolverUpdateMode updateMode) 149 bool DocumentStyleSheetCollection::updateActiveStyleSheets(StyleSheetCollections * collections, StyleResolverUpdateMode updateMode)
150 { 150 {
151 Vector<RefPtr<StyleSheet> > styleSheets; 151 Vector<RefPtr<StyleSheet> > styleSheets;
152 Vector<RefPtr<CSSStyleSheet> > activeCSSStyleSheets; 152 Vector<RefPtr<CSSStyleSheet> > activeCSSStyleSheets;
153 activeCSSStyleSheets.append(collections->injectedAuthorStyleSheets()); 153 activeCSSStyleSheets.append(collections->injectedAuthorStyleSheets());
154 activeCSSStyleSheets.append(collections->documentAuthorStyleSheets()); 154 activeCSSStyleSheets.append(collections->documentAuthorStyleSheets());
155 collectActiveCSSStyleSheetsFromSeamlessParents(activeCSSStyleSheets, documen t()); 155 collectActiveCSSStyleSheetsFromSeamlessParents(activeCSSStyleSheets, documen t());
156 collectStyleSheets(collections, styleSheets, activeCSSStyleSheets); 156 collectStyleSheets(collections, styleSheets, activeCSSStyleSheets);
(...skipping 20 matching lines...) Expand all
177 } 177 }
178 m_scopingNodesForStyleScoped.didRemoveScopingNodes(); 178 m_scopingNodesForStyleScoped.didRemoveScopingNodes();
179 m_activeAuthorStyleSheets.swap(activeCSSStyleSheets); 179 m_activeAuthorStyleSheets.swap(activeCSSStyleSheets);
180 m_styleSheetsForStyleSheetList.swap(styleSheets); 180 m_styleSheetsForStyleSheetList.swap(styleSheets);
181 updateUsesRemUnits(); 181 updateUsesRemUnits();
182 182
183 return requiresFullStyleRecalc; 183 return requiresFullStyleRecalc;
184 } 184 }
185 185
186 } 186 }
OLDNEW
« no previous file with comments | « Source/core/dom/DocumentFragment.cpp ('k') | Source/core/dom/DocumentType.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698