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

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

Issue 148703004: Have TreeScopeStyleSheetCollection::document() return a reference. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 10 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 | « no previous file | Source/core/dom/TreeScopeStyleSheetCollection.h » ('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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
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) {
62 Node* n = *it; 62 Node* n = *it;
63 StyleSheetCandidate candidate(*n); 63 StyleSheetCandidate candidate(*n);
64 64
65 if (candidate.isXSL()) { 65 if (candidate.isXSL()) {
66 // Processing instruction (XML documents only). 66 // Processing instruction (XML documents only).
67 // We don't support linking to embedded CSS stylesheets, see <https: //bugs.webkit.org/show_bug.cgi?id=49281> for discussion. 67 // We don't support linking to embedded CSS stylesheets, see <https: //bugs.webkit.org/show_bug.cgi?id=49281> for discussion.
68 // Don't apply XSL transforms to already transformed documents -- <r dar://problem/4132806> 68 // Don't apply XSL transforms to already transformed documents -- <r dar://problem/4132806>
69 if (RuntimeEnabledFeatures::xsltEnabled() && !document()->transformS ourceDocument()) { 69 if (RuntimeEnabledFeatures::xsltEnabled() && !document().transformSo urceDocument()) {
70 ProcessingInstruction* pi = toProcessingInstruction(n); 70 ProcessingInstruction* pi = toProcessingInstruction(n);
71 // Don't apply XSL transforms until loading is finished. 71 // Don't apply XSL transforms until loading is finished.
72 if (!document()->parsing() && !pi->isLoading()) 72 if (!document().parsing() && !pi->isLoading())
73 document()->applyXSLTransform(pi); 73 document().applyXSLTransform(pi);
74 return; 74 return;
75 } 75 }
76 76
77 continue; 77 continue;
78 } 78 }
79 79
80 if (candidate.isImport()) { 80 if (candidate.isImport()) {
81 Document* document = candidate.importedDocument(); 81 Document* document = candidate.importedDocument();
82 if (!document) 82 if (!document)
83 continue; 83 continue;
(...skipping 15 matching lines...) Expand all
99 if (candidate.hasPreferrableName(engine->preferredStylesheetSetName())) 99 if (candidate.hasPreferrableName(engine->preferredStylesheetSetName()))
100 engine->selectStylesheetSetName(candidate.title()); 100 engine->selectStylesheetSetName(candidate.title());
101 collector.appendSheetForList(sheet); 101 collector.appendSheetForList(sheet);
102 if (candidate.canBeActivated(engine->preferredStylesheetSetName())) 102 if (candidate.canBeActivated(engine->preferredStylesheetSetName()))
103 collector.appendActiveStyleSheet(toCSSStyleSheet(sheet)); 103 collector.appendActiveStyleSheet(toCSSStyleSheet(sheet));
104 } 104 }
105 } 105 }
106 106
107 void DocumentStyleSheetCollection::collectStyleSheets(StyleEngine* engine, Docum entStyleSheetCollector& collector) 107 void DocumentStyleSheetCollection::collectStyleSheets(StyleEngine* engine, Docum entStyleSheetCollector& collector)
108 { 108 {
109 ASSERT(document()->styleEngine() == engine); 109 ASSERT(document().styleEngine() == engine);
110 collector.appendActiveStyleSheets(engine->injectedAuthorStyleSheets()); 110 collector.appendActiveStyleSheets(engine->injectedAuthorStyleSheets());
111 collector.appendActiveStyleSheets(engine->documentAuthorStyleSheets()); 111 collector.appendActiveStyleSheets(engine->documentAuthorStyleSheets());
112 collectStyleSheetsFromCandidates(engine, collector); 112 collectStyleSheetsFromCandidates(engine, collector);
113 } 113 }
114 114
115 bool DocumentStyleSheetCollection::updateActiveStyleSheets(StyleEngine* engine, StyleResolverUpdateMode updateMode) 115 bool DocumentStyleSheetCollection::updateActiveStyleSheets(StyleEngine* engine, StyleResolverUpdateMode updateMode)
116 { 116 {
117 StyleSheetCollection collection; 117 StyleSheetCollection collection;
118 ActiveDocumentStyleSheetCollector collector(collection); 118 ActiveDocumentStyleSheetCollector collector(collection);
119 collectStyleSheets(engine, collector); 119 collectStyleSheets(engine, collector);
(...skipping 24 matching lines...) Expand all
144 m_scopingNodesForStyleScoped.didRemoveScopingNodes(); 144 m_scopingNodesForStyleScoped.didRemoveScopingNodes();
145 145
146 collection.swap(*this); 146 collection.swap(*this);
147 147
148 updateUsesRemUnits(); 148 updateUsesRemUnits();
149 149
150 return change.requiresFullStyleRecalc; 150 return change.requiresFullStyleRecalc;
151 } 151 }
152 152
153 } 153 }
OLDNEW
« no previous file with comments | « no previous file | Source/core/dom/TreeScopeStyleSheetCollection.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698