OLD | NEW |
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 |
11 * License as published by the Free Software Foundation; either | 11 * License as published by the Free Software Foundation; either |
12 * version 2 of the License, or (at your option) any later version. | 12 * version 2 of the License, or (at your option) any later version. |
13 * | 13 * |
14 * This library is distributed in the hope that it will be useful, | 14 * This library is distributed in the hope that it will be useful, |
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 15 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
17 * Library General Public License for more details. | 17 * Library General Public License for more details. |
18 * | 18 * |
19 * You should have received a copy of the GNU Library General Public License | 19 * You should have received a copy of the GNU Library General Public License |
20 * along with this library; see the file COPYING.LIB. If not, write to | 20 * along with this library; see the file COPYING.LIB. If not, write to |
21 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | 21 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
22 * Boston, MA 02110-1301, USA. | 22 * Boston, MA 02110-1301, USA. |
23 */ | 23 */ |
24 | 24 |
25 #include "config.h" | 25 #include "config.h" |
26 #include "core/html/HTMLIFrameElement.h" | 26 #include "core/html/HTMLIFrameElement.h" |
27 | 27 |
28 #include "CSSPropertyNames.h" | 28 #include "CSSPropertyNames.h" |
29 #include "HTMLNames.h" | 29 #include "HTMLNames.h" |
30 #include "core/dom/NodeRenderingContext.h" | |
31 #include "core/html/HTMLDocument.h" | 30 #include "core/html/HTMLDocument.h" |
32 #include "core/rendering/RenderIFrame.h" | 31 #include "core/rendering/RenderIFrame.h" |
33 | 32 |
34 namespace WebCore { | 33 namespace WebCore { |
35 | 34 |
36 using namespace HTMLNames; | 35 using namespace HTMLNames; |
37 | 36 |
38 inline HTMLIFrameElement::HTMLIFrameElement(const QualifiedName& tagName, Docume
nt& document) | 37 inline HTMLIFrameElement::HTMLIFrameElement(const QualifiedName& tagName, Docume
nt& document) |
39 : HTMLFrameElementBase(tagName, document) | 38 : HTMLFrameElementBase(tagName, document) |
40 , m_didLoadNonEmptyDocument(false) | 39 , m_didLoadNonEmptyDocument(false) |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 if (!invalidTokens.isNull()) | 89 if (!invalidTokens.isNull()) |
91 document().addConsoleMessage(OtherMessageSource, ErrorMessageLevel,
"Error while parsing the 'sandbox' attribute: " + invalidTokens); | 90 document().addConsoleMessage(OtherMessageSource, ErrorMessageLevel,
"Error while parsing the 'sandbox' attribute: " + invalidTokens); |
92 } else if (name == seamlessAttr) { | 91 } 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. | 92 // If we're adding or removing the seamless attribute, we need to force
the content document to recalculate its StyleResolver. |
94 if (contentDocument()) | 93 if (contentDocument()) |
95 contentDocument()->styleResolverChanged(RecalcStyleDeferred); | 94 contentDocument()->styleResolverChanged(RecalcStyleDeferred); |
96 } else | 95 } else |
97 HTMLFrameElementBase::parseAttribute(name, value); | 96 HTMLFrameElementBase::parseAttribute(name, value); |
98 } | 97 } |
99 | 98 |
100 bool HTMLIFrameElement::rendererIsNeeded(const NodeRenderingContext& context) | 99 bool HTMLIFrameElement::rendererIsNeeded(const RenderStyle& style) |
101 { | 100 { |
102 return isURLAllowed() && context.style()->display() != NONE; | 101 return isURLAllowed() && HTMLElement::rendererIsNeeded(style); |
103 } | 102 } |
104 | 103 |
105 RenderObject* HTMLIFrameElement::createRenderer(RenderStyle*) | 104 RenderObject* HTMLIFrameElement::createRenderer(RenderStyle*) |
106 { | 105 { |
107 return new RenderIFrame(this); | 106 return new RenderIFrame(this); |
108 } | 107 } |
109 | 108 |
110 Node::InsertionNotificationRequest HTMLIFrameElement::insertedInto(ContainerNode
* insertionPoint) | 109 Node::InsertionNotificationRequest HTMLIFrameElement::insertedInto(ContainerNode
* insertionPoint) |
111 { | 110 { |
112 InsertionNotificationRequest result = HTMLFrameElementBase::insertedInto(ins
ertionPoint); | 111 InsertionNotificationRequest result = HTMLFrameElementBase::insertedInto(ins
ertionPoint); |
(...skipping 17 matching lines...) Expand all Loading... |
130 void HTMLIFrameElement::didRecalcStyle(StyleRecalcChange styleChange) | 129 void HTMLIFrameElement::didRecalcStyle(StyleRecalcChange styleChange) |
131 { | 130 { |
132 if (!shouldDisplaySeamlessly()) | 131 if (!shouldDisplaySeamlessly()) |
133 return; | 132 return; |
134 Document* childDocument = contentDocument(); | 133 Document* childDocument = contentDocument(); |
135 if (shouldRecalcStyle(styleChange, childDocument)) | 134 if (shouldRecalcStyle(styleChange, childDocument)) |
136 contentDocument()->recalcStyle(styleChange); | 135 contentDocument()->recalcStyle(styleChange); |
137 } | 136 } |
138 | 137 |
139 } | 138 } |
OLD | NEW |