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

Side by Side Diff: Source/web/WebNode.cpp

Issue 200723002: Use new is*Element() helper functions more in web/ code (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Use same assertion as in operator->() Created 6 years, 9 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/WebInputElement.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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 #include "WebPluginContainer.h" 43 #include "WebPluginContainer.h"
44 #include "WebPluginContainerImpl.h" 44 #include "WebPluginContainerImpl.h"
45 #include "bindings/v8/ExceptionState.h" 45 #include "bindings/v8/ExceptionState.h"
46 #include "core/dom/Document.h" 46 #include "core/dom/Document.h"
47 #include "core/dom/Element.h" 47 #include "core/dom/Element.h"
48 #include "core/dom/Node.h" 48 #include "core/dom/Node.h"
49 #include "core/dom/NodeList.h" 49 #include "core/dom/NodeList.h"
50 #include "core/editing/markup.h" 50 #include "core/editing/markup.h"
51 #include "core/events/Event.h" 51 #include "core/events/Event.h"
52 #include "core/html/HTMLCollection.h" 52 #include "core/html/HTMLCollection.h"
53 #include "core/html/HTMLElement.h"
53 #include "core/rendering/RenderObject.h" 54 #include "core/rendering/RenderObject.h"
54 #include "core/rendering/RenderWidget.h" 55 #include "core/rendering/RenderWidget.h"
55 #include "platform/Widget.h" 56 #include "platform/Widget.h"
56 #include "public/platform/WebString.h" 57 #include "public/platform/WebString.h"
57 #include "public/platform/WebVector.h" 58 #include "public/platform/WebVector.h"
58 59
59 using namespace WebCore; 60 using namespace WebCore;
60 61
61 namespace blink { 62 namespace blink {
62 63
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
229 bool WebNode::hasNonEmptyBoundingBox() const 230 bool WebNode::hasNonEmptyBoundingBox() const
230 { 231 {
231 m_private->document().updateLayoutIgnorePendingStylesheets(); 232 m_private->document().updateLayoutIgnorePendingStylesheets();
232 return m_private->hasNonEmptyBoundingBox(); 233 return m_private->hasNonEmptyBoundingBox();
233 } 234 }
234 235
235 WebPluginContainer* WebNode::pluginContainer() const 236 WebPluginContainer* WebNode::pluginContainer() const
236 { 237 {
237 if (isNull()) 238 if (isNull())
238 return 0; 239 return 0;
239 const Node* coreNode = constUnwrap<Node>(); 240 const Node& coreNode = *constUnwrap<Node>();
240 if (coreNode->hasTagName(HTMLNames::objectTag) || coreNode->hasTagName(HTMLN ames::embedTag)) { 241 if (isHTMLObjectElement(coreNode) || isHTMLEmbedElement(coreNode)) {
241 RenderObject* object = coreNode->renderer(); 242 RenderObject* object = coreNode.renderer();
242 if (object && object->isWidget()) { 243 if (object && object->isWidget()) {
243 Widget* widget = WebCore::toRenderWidget(object)->widget(); 244 Widget* widget = WebCore::toRenderWidget(object)->widget();
244 if (widget && widget->isPluginContainer()) 245 if (widget && widget->isPluginContainer())
245 return toWebPluginContainerImpl(widget); 246 return toWebPluginContainerImpl(widget);
246 } 247 }
247 } 248 }
248 return 0; 249 return 0;
249 } 250 }
250 251
251 WebElement WebNode::shadowHost() const 252 WebElement WebNode::shadowHost() const
(...skipping 14 matching lines...) Expand all
266 m_private = node; 267 m_private = node;
267 return *this; 268 return *this;
268 } 269 }
269 270
270 WebNode::operator PassRefPtr<Node>() const 271 WebNode::operator PassRefPtr<Node>() const
271 { 272 {
272 return m_private.get(); 273 return m_private.get();
273 } 274 }
274 275
275 } // namespace blink 276 } // namespace blink
OLDNEW
« no previous file with comments | « Source/web/WebInputElement.cpp ('k') | Source/web/WebPageSerializer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698