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

Side by Side Diff: Source/web/WebNode.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, 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
« no previous file with comments | « Source/web/WebMediaPlayerClientImpl.cpp ('k') | Source/web/WebPageSerializer.cpp » ('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) 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2009 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 } 100 }
101 101
102 bool WebNode::setNodeValue(const WebString& value) 102 bool WebNode::setNodeValue(const WebString& value)
103 { 103 {
104 m_private->setNodeValue(value); 104 m_private->setNodeValue(value);
105 return true; 105 return true;
106 } 106 }
107 107
108 WebDocument WebNode::document() const 108 WebDocument WebNode::document() const
109 { 109 {
110 return WebDocument(m_private->document()); 110 return WebDocument(&m_private->document());
111 } 111 }
112 112
113 WebNode WebNode::firstChild() const 113 WebNode WebNode::firstChild() const
114 { 114 {
115 return WebNode(m_private->firstChild()); 115 return WebNode(m_private->firstChild());
116 } 116 }
117 117
118 WebNode WebNode::lastChild() const 118 WebNode WebNode::lastChild() const
119 { 119 {
120 return WebNode(m_private->lastChild()); 120 return WebNode(m_private->lastChild());
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 152
153 bool WebNode::isTextNode() const 153 bool WebNode::isTextNode() const
154 { 154 {
155 return m_private->isTextNode(); 155 return m_private->isTextNode();
156 } 156 }
157 157
158 bool WebNode::isFocusable() const 158 bool WebNode::isFocusable() const
159 { 159 {
160 if (!m_private->isElementNode()) 160 if (!m_private->isElementNode())
161 return false; 161 return false;
162 m_private->document()->updateLayoutIgnorePendingStylesheets(); 162 m_private->document().updateLayoutIgnorePendingStylesheets();
163 return toElement(m_private.get())->isFocusable(); 163 return toElement(m_private.get())->isFocusable();
164 } 164 }
165 165
166 bool WebNode::isContentEditable() const 166 bool WebNode::isContentEditable() const
167 { 167 {
168 return m_private->isContentEditable(); 168 return m_private->isContentEditable();
169 } 169 }
170 170
171 bool WebNode::isElementNode() const 171 bool WebNode::isElementNode() const
172 { 172 {
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
222 222
223 bool WebNode::remove() 223 bool WebNode::remove()
224 { 224 {
225 TrackExceptionState es; 225 TrackExceptionState es;
226 m_private->remove(es); 226 m_private->remove(es);
227 return !es.hadException(); 227 return !es.hadException();
228 } 228 }
229 229
230 bool WebNode::hasNonEmptyBoundingBox() const 230 bool WebNode::hasNonEmptyBoundingBox() const
231 { 231 {
232 m_private->document()->updateLayoutIgnorePendingStylesheets(); 232 m_private->document().updateLayoutIgnorePendingStylesheets();
233 return m_private->hasNonEmptyBoundingBox(); 233 return m_private->hasNonEmptyBoundingBox();
234 } 234 }
235 235
236 WebPluginContainer* WebNode::pluginContainer() const 236 WebPluginContainer* WebNode::pluginContainer() const
237 { 237 {
238 if (isNull()) 238 if (isNull())
239 return 0; 239 return 0;
240 const Node* coreNode = constUnwrap<Node>(); 240 const Node* coreNode = constUnwrap<Node>();
241 if (coreNode->hasTagName(HTMLNames::objectTag) || coreNode->hasTagName(HTMLN ames::embedTag)) { 241 if (coreNode->hasTagName(HTMLNames::objectTag) || coreNode->hasTagName(HTMLN ames::embedTag)) {
242 RenderObject* object = coreNode->renderer(); 242 RenderObject* object = coreNode->renderer();
(...skipping 24 matching lines...) Expand all
267 m_private = node; 267 m_private = node;
268 return *this; 268 return *this;
269 } 269 }
270 270
271 WebNode::operator PassRefPtr<Node>() const 271 WebNode::operator PassRefPtr<Node>() const
272 { 272 {
273 return m_private.get(); 273 return m_private.get();
274 } 274 }
275 275
276 } // namespace WebKit 276 } // namespace WebKit
OLDNEW
« no previous file with comments | « Source/web/WebMediaPlayerClientImpl.cpp ('k') | Source/web/WebPageSerializer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698