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

Unified Diff: Source/core/dom/StyleElement.cpp

Issue 23847002: Have StyleElement API take Document as a reference (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/dom/StyleElement.h ('k') | Source/core/html/HTMLStyleElement.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/StyleElement.cpp
diff --git a/Source/core/dom/StyleElement.cpp b/Source/core/dom/StyleElement.cpp
index 08082421924b66449548db1051902ff3cd1d24e1..8f8a1518b43896b38433bdbe0984e4d36a1fdf92 100644
--- a/Source/core/dom/StyleElement.cpp
+++ b/Source/core/dom/StyleElement.cpp
@@ -55,22 +55,20 @@ StyleElement::~StyleElement()
clearSheet();
}
-void StyleElement::processStyleSheet(Document* document, Element* element)
+void StyleElement::processStyleSheet(Document& document, Element* element)
{
- ASSERT(document);
ASSERT(element);
- document->styleSheetCollections()->addStyleSheetCandidateNode(element, m_createdByParser);
+ document.styleSheetCollections()->addStyleSheetCandidateNode(element, m_createdByParser);
if (m_createdByParser)
return;
process(element);
}
-void StyleElement::removedFromDocument(Document* document, Element* element, ContainerNode* scopingNode)
+void StyleElement::removedFromDocument(Document& document, Element* element, ContainerNode* scopingNode)
{
- ASSERT(document);
ASSERT(element);
- document->styleSheetCollections()->removeStyleSheetCandidateNode(element, scopingNode);
+ document.styleSheetCollections()->removeStyleSheetCandidateNode(element, scopingNode);
RefPtr<StyleSheet> removedSheet = m_sheet;
@@ -78,17 +76,17 @@ void StyleElement::removedFromDocument(Document* document, Element* element, Con
clearSheet();
// If we're in document teardown, then we don't need to do any notification of our sheet's removal.
- if (document->renderer())
- document->removedStyleSheet(removedSheet.get());
+ if (document.renderer())
+ document.removedStyleSheet(removedSheet.get());
}
-void StyleElement::clearDocumentData(Document* document, Element* element)
+void StyleElement::clearDocumentData(Document& document, Element* element)
{
if (m_sheet)
m_sheet->clearOwnerNode();
if (element->inDocument())
- document->styleSheetCollections()->removeStyleSheetCandidateNode(element, isHTMLStyleElement(element) ? toHTMLStyleElement(element)->scopingNode() : 0);
+ document.styleSheetCollections()->removeStyleSheetCandidateNode(element, isHTMLStyleElement(element) ? toHTMLStyleElement(element)->scopingNode() : 0);
}
void StyleElement::childrenChanged(Element* element)
@@ -163,20 +161,18 @@ bool StyleElement::isLoading() const
return m_sheet ? m_sheet->isLoading() : false;
}
-bool StyleElement::sheetLoaded(Document* document)
+bool StyleElement::sheetLoaded(Document& document)
{
- ASSERT(document);
if (isLoading())
return false;
- document->styleSheetCollections()->removePendingSheet(m_sheet->ownerNode());
+ document.styleSheetCollections()->removePendingSheet(m_sheet->ownerNode());
return true;
}
-void StyleElement::startLoadingDynamicSheet(Document* document)
+void StyleElement::startLoadingDynamicSheet(Document& document)
{
- ASSERT(document);
- document->styleSheetCollections()->addPendingSheet();
+ document.styleSheetCollections()->addPendingSheet();
}
}
« no previous file with comments | « Source/core/dom/StyleElement.h ('k') | Source/core/html/HTMLStyleElement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698