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

Unified Diff: Source/core/dom/StyleElement.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, 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/SelectorQuery.cpp ('k') | Source/core/dom/Text.cpp » ('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 683a8f293b3f3bd8e4e5ffd5be4a220bf62f0743..08082421924b66449548db1051902ff3cd1d24e1 100644
--- a/Source/core/dom/StyleElement.cpp
+++ b/Source/core/dom/StyleElement.cpp
@@ -124,26 +124,26 @@ void StyleElement::createSheet(Element* e, const String& text)
{
ASSERT(e);
ASSERT(e->inDocument());
- Document* document = e->document();
+ Document& document = e->document();
if (m_sheet) {
if (m_sheet->isLoading())
- document->styleSheetCollections()->removePendingSheet(e);
+ document.styleSheetCollections()->removePendingSheet(e);
clearSheet();
}
// If type is empty or CSS, this is a CSS style sheet.
const AtomicString& type = this->type();
- if (document->contentSecurityPolicy()->allowInlineStyle(e->document()->url(), m_startPosition.m_line) && isCSS(e, type)) {
+ if (document.contentSecurityPolicy()->allowInlineStyle(e->document().url(), m_startPosition.m_line) && isCSS(e, type)) {
RefPtr<MediaQuerySet> mediaQueries = MediaQuerySet::create(media());
MediaQueryEvaluator screenEval("screen", true);
MediaQueryEvaluator printEval("print", true);
if (screenEval.eval(mediaQueries.get()) || printEval.eval(mediaQueries.get())) {
- document->styleSheetCollections()->addPendingSheet();
+ document.styleSheetCollections()->addPendingSheet();
m_loading = true;
TextPosition startPosition = m_startPosition == TextPosition::belowRangePosition() ? TextPosition::minimumPosition() : m_startPosition;
- m_sheet = CSSStyleSheet::createInline(e, KURL(), startPosition, document->inputEncoding());
+ m_sheet = CSSStyleSheet::createInline(e, KURL(), startPosition, document.inputEncoding());
m_sheet->setMediaQueries(mediaQueries.release());
m_sheet->setTitle(e->title());
m_sheet->contents()->parseStringAtPosition(text, startPosition, m_createdByParser);
« no previous file with comments | « Source/core/dom/SelectorQuery.cpp ('k') | Source/core/dom/Text.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698