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

Unified Diff: Source/core/html/HTMLObjectElement.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/html/HTMLMeterElement.cpp ('k') | Source/core/html/HTMLOptGroupElement.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/HTMLObjectElement.cpp
diff --git a/Source/core/html/HTMLObjectElement.cpp b/Source/core/html/HTMLObjectElement.cpp
index 01d8b11ffa2d3fc40cd93f3d55b60bdc08ff64f9..80c065f6a0d3956cf4d684039510238d9abe222d 100644
--- a/Source/core/html/HTMLObjectElement.cpp
+++ b/Source/core/html/HTMLObjectElement.cpp
@@ -201,7 +201,7 @@ void HTMLObjectElement::parametersForPlugin(Vector<String>& paramNames, Vector<S
// resource's URL to be given by a param named "src", "movie", "code" or "url"
// if we know that resource points to a plug-in.
if (url.isEmpty() && !urlParameter.isEmpty()) {
- KURL completedURL = document()->completeURL(urlParameter);
+ KURL completedURL = document().completeURL(urlParameter);
bool useFallback;
if (shouldUsePlugin(completedURL, serviceType, false, useFallback))
url = urlParameter;
@@ -230,13 +230,13 @@ bool HTMLObjectElement::shouldAllowQuickTimeClassIdQuirk()
// 'generator' meta tag is present. Only apply this quirk if there is no
// fallback content, which ensures the quirk will disable itself if Wiki
// Server is updated to generate an alternate embed tag as fallback content.
- if (!document()->page()
- || !document()->page()->settings().needsSiteSpecificQuirks()
+ if (!document().page()
+ || !document().page()->settings().needsSiteSpecificQuirks()
|| hasFallbackContent()
|| !equalIgnoringCase(classId(), "clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B"))
return false;
- RefPtr<NodeList> metaElements = document()->getElementsByTagName(HTMLNames::metaTag.localName());
+ RefPtr<NodeList> metaElements = document().getElementsByTagName(HTMLNames::metaTag.localName());
unsigned length = metaElements->length();
for (unsigned i = 0; i < length; ++i) {
ASSERT(metaElements->item(i)->isHTMLElement());
@@ -315,7 +315,7 @@ void HTMLObjectElement::updateWidget(PluginCreationOption pluginCreationOption)
bool HTMLObjectElement::rendererIsNeeded(const NodeRenderingContext& context)
{
// FIXME: This check should not be needed, detached documents never render!
- Frame* frame = document()->frame();
+ Frame* frame = document().frame();
if (!frame)
return false;
@@ -360,7 +360,7 @@ void HTMLObjectElement::reattachFallbackContent()
{
// This can happen inside of attach() in the middle of a recalcStyle so we need to
// reattach synchronously here.
- if (document()->inStyleRecalc())
+ if (document().inStyleRecalc())
reattach();
else
lazyReattach();
@@ -437,8 +437,8 @@ void HTMLObjectElement::updateDocNamedItem()
isNamedItem = false;
child = child->nextSibling();
}
- if (isNamedItem != wasNamedItem && document()->isHTMLDocument()) {
- HTMLDocument* document = toHTMLDocument(this->document());
+ if (isNamedItem != wasNamedItem && document().isHTMLDocument()) {
+ HTMLDocument* document = toHTMLDocument(&this->document());
if (isNamedItem) {
document->addNamedItem(getNameAttribute());
document->addExtraNamedItem(getIdAttribute());
@@ -473,13 +473,13 @@ void HTMLObjectElement::addSubresourceAttributeURLs(ListHashSet<KURL>& urls) con
{
HTMLPlugInImageElement::addSubresourceAttributeURLs(urls);
- addSubresourceURL(urls, document()->completeURL(getAttribute(dataAttr)));
+ addSubresourceURL(urls, document().completeURL(getAttribute(dataAttr)));
// FIXME: Passing a string that starts with "#" to the completeURL function does
// not seem like it would work. The image element has similar but not identical code.
const AtomicString& useMap = getAttribute(usemapAttr);
if (useMap.startsWith('#'))
- addSubresourceURL(urls, document()->completeURL(useMap));
+ addSubresourceURL(urls, document().completeURL(useMap));
}
void HTMLObjectElement::didMoveToNewDocument(Document* oldDocument)
« no previous file with comments | « Source/core/html/HTMLMeterElement.cpp ('k') | Source/core/html/HTMLOptGroupElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698