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

Unified Diff: Source/core/css/resolver/StyleResolver.h

Issue 23601011: Have StyleResolver / StyleResolverState deal with Document references, not pointers (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Update StyleResolverState as well 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/css/resolver/StyleBuilderCustom.cpp ('k') | Source/core/css/resolver/StyleResolver.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/css/resolver/StyleResolver.h
diff --git a/Source/core/css/resolver/StyleResolver.h b/Source/core/css/resolver/StyleResolver.h
index 2ce8755d4f2636fb10e19a53b64e1ff555d2b222..def50bcfc3ed7b1b4b84bf380f3f6a91ca7162fb 100644
--- a/Source/core/css/resolver/StyleResolver.h
+++ b/Source/core/css/resolver/StyleResolver.h
@@ -172,7 +172,7 @@ struct CSSPropertyValue {
class StyleResolver {
WTF_MAKE_NONCOPYABLE(StyleResolver); WTF_MAKE_FAST_ALLOCATED;
public:
- StyleResolver(Document*, bool matchAuthorAndUserStyles);
+ StyleResolver(Document&, bool matchAuthorAndUserStyles);
~StyleResolver();
// FIXME: StyleResolver should not be keeping tree-walk state.
@@ -202,11 +202,11 @@ public:
PassRefPtr<RenderStyle> defaultStyleForElement();
PassRefPtr<RenderStyle> styleForText(Text*);
- static PassRefPtr<RenderStyle> styleForDocument(const Document*, CSSFontSelector* = 0);
+ static PassRefPtr<RenderStyle> styleForDocument(const Document&, CSSFontSelector* = 0);
// FIXME: This only has 5 callers and should be removed. Callers should be explicit about
// their dependency on Document* instead of grabbing one through StyleResolver.
- Document* document() { return m_document; }
+ Document& document() { return m_document; }
// FIXME: It could be better to call m_ruleSets.appendAuthorStyleSheets() directly after we factor StyleRsolver further.
// https://bugs.webkit.org/show_bug.cgi?id=108890
@@ -224,7 +224,7 @@ public:
ScopedStyleResolver* ensureScopedStyleResolver(const ContainerNode* scope)
{
- return m_styleTree.ensureScopedStyleResolver(scope ? scope : document());
+ return m_styleTree.ensureScopedStyleResolver(scope ? scope : &document());
}
// FIXME: Used by SharingStyleFinder, but should be removed.
@@ -310,7 +310,7 @@ private:
void matchPageRules(MatchResult&, RuleSet*, bool isLeftPage, bool isFirstPage, const String& pageName);
void matchPageRulesForList(Vector<StyleRulePage*>& matchedRules, const Vector<StyleRulePage*>&, bool isLeftPage, bool isFirstPage, const String& pageName);
void collectViewportRules();
- Settings* documentSettings() { return m_document->settings(); }
+ Settings* documentSettings() { return m_document.settings(); }
bool isLeftPage(int pageIndex) const;
bool isRightPage(int pageIndex) const { return !isLeftPage(pageIndex); }
@@ -332,7 +332,7 @@ private:
OwnPtr<MediaQueryEvaluator> m_medium;
RefPtr<RenderStyle> m_rootDefaultStyle;
- Document* m_document;
+ Document& m_document;
SelectorFilter m_selectorFilter;
bool m_matchAuthorAndUserStyles;
« no previous file with comments | « Source/core/css/resolver/StyleBuilderCustom.cpp ('k') | Source/core/css/resolver/StyleResolver.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698