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

Side by Side Diff: Source/core/css/resolver/ElementResolveContext.h

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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved. 3 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved.
4 * 4 *
5 * This library is free software; you can redistribute it and/or 5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public 6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either 7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version. 8 * version 2 of the License, or (at your option) any later version.
9 * 9 *
10 * This library is distributed in the hope that it will be useful, 10 * This library is distributed in the hope that it will be useful,
(...skipping 29 matching lines...) Expand all
40 , m_parentNode(0) 40 , m_parentNode(0)
41 , m_rootElementStyle(0) 41 , m_rootElementStyle(0)
42 , m_elementLinkState(NotInsideLink) 42 , m_elementLinkState(NotInsideLink)
43 , m_distributedToInsertionPoint(false) 43 , m_distributedToInsertionPoint(false)
44 , m_resetStyleInheritance(false) 44 , m_resetStyleInheritance(false)
45 { 45 {
46 } 46 }
47 47
48 explicit ElementResolveContext(Element*); 48 explicit ElementResolveContext(Element*);
49 49
50 // FIXME: This should return a reference. 50 Document& document() const { return m_element->document(); }
51 Document* document() const { return m_element->document(); } 51 bool isDocumentElement() const { return m_element && m_element == m_element- >document().documentElement(); }
52 bool isDocumentElement() const { return m_element && m_element == m_element- >document()->documentElement(); }
53 52
54 Element* element() const { return m_element; } 53 Element* element() const { return m_element; }
55 const ContainerNode* parentNode() const { return m_parentNode; } 54 const ContainerNode* parentNode() const { return m_parentNode; }
56 RenderStyle* rootElementStyle() const { return m_rootElementStyle; } 55 RenderStyle* rootElementStyle() const { return m_rootElementStyle; }
57 EInsideLink elementLinkState() const { return m_elementLinkState; } 56 EInsideLink elementLinkState() const { return m_elementLinkState; }
58 bool distributedToInsertionPoint() const { return m_distributedToInsertionPo int; } 57 bool distributedToInsertionPoint() const { return m_distributedToInsertionPo int; }
59 bool resetStyleInheritance() const { return m_resetStyleInheritance; } 58 bool resetStyleInheritance() const { return m_resetStyleInheritance; }
60 59
61 private: 60 private:
62 Element* m_element; 61 Element* m_element;
63 ContainerNode* m_parentNode; 62 ContainerNode* m_parentNode;
64 RenderStyle* m_rootElementStyle; 63 RenderStyle* m_rootElementStyle;
65 EInsideLink m_elementLinkState; 64 EInsideLink m_elementLinkState;
66 bool m_distributedToInsertionPoint; 65 bool m_distributedToInsertionPoint;
67 bool m_resetStyleInheritance; 66 bool m_resetStyleInheritance;
68 }; 67 };
69 68
70 } // namespace WebCore 69 } // namespace WebCore
71 70
72 #endif // ElementResolveContext_h 71 #endif // ElementResolveContext_h
OLDNEW
« no previous file with comments | « Source/core/css/StyleSheetContents.cpp ('k') | Source/core/css/resolver/ElementResolveContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698