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

Side by Side Diff: Source/core/html/HTMLIFrameElement.cpp

Issue 23591020: Add toHTMLDocument() convenience methods that take a reference (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Improve casting 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/core/html/HTMLDocument.h ('k') | Source/core/html/HTMLObjectElement.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) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2000 Simon Hausmann (hausmann@kde.org) 4 * (C) 2000 Simon Hausmann (hausmann@kde.org)
5 * (C) 2001 Dirk Mueller (mueller@kde.org) 5 * (C) 2001 Dirk Mueller (mueller@kde.org)
6 * Copyright (C) 2004, 2006, 2008, 2009 Apple Inc. All rights reserved. 6 * Copyright (C) 2004, 2006, 2008, 2009 Apple Inc. All rights reserved.
7 * Copyright (C) 2009 Ericsson AB. All rights reserved. 7 * Copyright (C) 2009 Ericsson AB. All rights reserved.
8 * 8 *
9 * This library is free software; you can redistribute it and/or 9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Library General Public 10 * modify it under the terms of the GNU Library General Public
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 addPropertyToPresentationAttributeStyle(style, CSSPropertyBorderWidt h, 0, CSSPrimitiveValue::CSS_PX); 72 addPropertyToPresentationAttributeStyle(style, CSSPropertyBorderWidt h, 0, CSSPrimitiveValue::CSS_PX);
73 } 73 }
74 } else 74 } else
75 HTMLFrameElementBase::collectStyleForPresentationAttribute(name, value, style); 75 HTMLFrameElementBase::collectStyleForPresentationAttribute(name, value, style);
76 } 76 }
77 77
78 void HTMLIFrameElement::parseAttribute(const QualifiedName& name, const AtomicSt ring& value) 78 void HTMLIFrameElement::parseAttribute(const QualifiedName& name, const AtomicSt ring& value)
79 { 79 {
80 if (name == nameAttr) { 80 if (name == nameAttr) {
81 if (inDocument() && document().isHTMLDocument() && !isInShadowTree()) { 81 if (inDocument() && document().isHTMLDocument() && !isInShadowTree()) {
82 HTMLDocument* document = toHTMLDocument(&this->document()); 82 HTMLDocument& document = toHTMLDocument(this->document());
83 document->removeExtraNamedItem(m_name); 83 document.removeExtraNamedItem(m_name);
84 document->addExtraNamedItem(value); 84 document.addExtraNamedItem(value);
85 } 85 }
86 m_name = value; 86 m_name = value;
87 } else if (name == sandboxAttr) { 87 } else if (name == sandboxAttr) {
88 String invalidTokens; 88 String invalidTokens;
89 setSandboxFlags(value.isNull() ? SandboxNone : SecurityContext::parseSan dboxPolicy(value, invalidTokens)); 89 setSandboxFlags(value.isNull() ? SandboxNone : SecurityContext::parseSan dboxPolicy(value, invalidTokens));
90 if (!invalidTokens.isNull()) 90 if (!invalidTokens.isNull())
91 document().addConsoleMessage(OtherMessageSource, ErrorMessageLevel, "Error while parsing the 'sandbox' attribute: " + invalidTokens); 91 document().addConsoleMessage(OtherMessageSource, ErrorMessageLevel, "Error while parsing the 'sandbox' attribute: " + invalidTokens);
92 } else if (name == seamlessAttr) { 92 } else if (name == seamlessAttr) {
93 // If we're adding or removing the seamless attribute, we need to force the content document to recalculate its StyleResolver. 93 // If we're adding or removing the seamless attribute, we need to force the content document to recalculate its StyleResolver.
94 if (contentDocument()) 94 if (contentDocument())
95 contentDocument()->styleResolverChanged(RecalcStyleDeferred); 95 contentDocument()->styleResolverChanged(RecalcStyleDeferred);
96 } else 96 } else
97 HTMLFrameElementBase::parseAttribute(name, value); 97 HTMLFrameElementBase::parseAttribute(name, value);
98 } 98 }
99 99
100 bool HTMLIFrameElement::rendererIsNeeded(const NodeRenderingContext& context) 100 bool HTMLIFrameElement::rendererIsNeeded(const NodeRenderingContext& context)
101 { 101 {
102 return isURLAllowed() && context.style()->display() != NONE; 102 return isURLAllowed() && context.style()->display() != NONE;
103 } 103 }
104 104
105 RenderObject* HTMLIFrameElement::createRenderer(RenderStyle*) 105 RenderObject* HTMLIFrameElement::createRenderer(RenderStyle*)
106 { 106 {
107 return new RenderIFrame(this); 107 return new RenderIFrame(this);
108 } 108 }
109 109
110 Node::InsertionNotificationRequest HTMLIFrameElement::insertedInto(ContainerNode * insertionPoint) 110 Node::InsertionNotificationRequest HTMLIFrameElement::insertedInto(ContainerNode * insertionPoint)
111 { 111 {
112 InsertionNotificationRequest result = HTMLFrameElementBase::insertedInto(ins ertionPoint); 112 InsertionNotificationRequest result = HTMLFrameElementBase::insertedInto(ins ertionPoint);
113 if (insertionPoint->inDocument() && document().isHTMLDocument() && !insertio nPoint->isInShadowTree()) 113 if (insertionPoint->inDocument() && document().isHTMLDocument() && !insertio nPoint->isInShadowTree())
114 toHTMLDocument(&document())->addExtraNamedItem(m_name); 114 toHTMLDocument(document()).addExtraNamedItem(m_name);
115 return result; 115 return result;
116 } 116 }
117 117
118 void HTMLIFrameElement::removedFrom(ContainerNode* insertionPoint) 118 void HTMLIFrameElement::removedFrom(ContainerNode* insertionPoint)
119 { 119 {
120 HTMLFrameElementBase::removedFrom(insertionPoint); 120 HTMLFrameElementBase::removedFrom(insertionPoint);
121 if (insertionPoint->inDocument() && document().isHTMLDocument() && !insertio nPoint->isInShadowTree()) 121 if (insertionPoint->inDocument() && document().isHTMLDocument() && !insertio nPoint->isInShadowTree())
122 toHTMLDocument(&document())->removeExtraNamedItem(m_name); 122 toHTMLDocument(document()).removeExtraNamedItem(m_name);
123 } 123 }
124 124
125 bool HTMLIFrameElement::shouldDisplaySeamlessly() const 125 bool HTMLIFrameElement::shouldDisplaySeamlessly() const
126 { 126 {
127 return contentDocument() && contentDocument()->shouldDisplaySeamlesslyWithPa rent(); 127 return contentDocument() && contentDocument()->shouldDisplaySeamlesslyWithPa rent();
128 } 128 }
129 129
130 void HTMLIFrameElement::didRecalcStyle(StyleChange styleChange) 130 void HTMLIFrameElement::didRecalcStyle(StyleChange styleChange)
131 { 131 {
132 if (!shouldDisplaySeamlessly()) 132 if (!shouldDisplaySeamlessly())
133 return; 133 return;
134 Document* childDocument = contentDocument(); 134 Document* childDocument = contentDocument();
135 if (shouldRecalcStyle(styleChange, childDocument)) 135 if (shouldRecalcStyle(styleChange, childDocument))
136 contentDocument()->recalcStyle(styleChange); 136 contentDocument()->recalcStyle(styleChange);
137 } 137 }
138 138
139 } 139 }
OLDNEW
« no previous file with comments | « Source/core/html/HTMLDocument.h ('k') | Source/core/html/HTMLObjectElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698