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 |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 setHasCustomStyleCallbacks(); | 42 setHasCustomStyleCallbacks(); |
43 } | 43 } |
44 | 44 |
45 PassRefPtr<HTMLIFrameElement> HTMLIFrameElement::create(Document& document) | 45 PassRefPtr<HTMLIFrameElement> HTMLIFrameElement::create(Document& document) |
46 { | 46 { |
47 return adoptRef(new HTMLIFrameElement(document)); | 47 return adoptRef(new HTMLIFrameElement(document)); |
48 } | 48 } |
49 | 49 |
50 bool HTMLIFrameElement::isPresentationAttribute(const QualifiedName& name) const | 50 bool HTMLIFrameElement::isPresentationAttribute(const QualifiedName& name) const |
51 { | 51 { |
52 if (name == widthAttr || name == heightAttr || name == alignAttr || name ==
frameborderAttr || name == seamlessAttr) | 52 if (name == widthAttr || name == heightAttr || name == alignAttr || name ==
frameborderAttr) |
53 return true; | 53 return true; |
54 return HTMLFrameElementBase::isPresentationAttribute(name); | 54 return HTMLFrameElementBase::isPresentationAttribute(name); |
55 } | 55 } |
56 | 56 |
57 void HTMLIFrameElement::collectStyleForPresentationAttribute(const QualifiedName
& name, const AtomicString& value, MutableStylePropertySet* style) | 57 void HTMLIFrameElement::collectStyleForPresentationAttribute(const QualifiedName
& name, const AtomicString& value, MutableStylePropertySet* style) |
58 { | 58 { |
59 if (name == widthAttr) | 59 if (name == widthAttr) |
60 addHTMLLengthToStyle(style, CSSPropertyWidth, value); | 60 addHTMLLengthToStyle(style, CSSPropertyWidth, value); |
61 else if (name == heightAttr) | 61 else if (name == heightAttr) |
62 addHTMLLengthToStyle(style, CSSPropertyHeight, value); | 62 addHTMLLengthToStyle(style, CSSPropertyHeight, value); |
(...skipping 17 matching lines...) Expand all Loading... |
80 HTMLDocument& document = toHTMLDocument(this->document()); | 80 HTMLDocument& document = toHTMLDocument(this->document()); |
81 document.removeExtraNamedItem(m_name); | 81 document.removeExtraNamedItem(m_name); |
82 document.addExtraNamedItem(value); | 82 document.addExtraNamedItem(value); |
83 } | 83 } |
84 m_name = value; | 84 m_name = value; |
85 } else if (name == sandboxAttr) { | 85 } else if (name == sandboxAttr) { |
86 String invalidTokens; | 86 String invalidTokens; |
87 setSandboxFlags(value.isNull() ? SandboxNone : parseSandboxPolicy(value,
invalidTokens)); | 87 setSandboxFlags(value.isNull() ? SandboxNone : parseSandboxPolicy(value,
invalidTokens)); |
88 if (!invalidTokens.isNull()) | 88 if (!invalidTokens.isNull()) |
89 document().addConsoleMessage(OtherMessageSource, ErrorMessageLevel,
"Error while parsing the 'sandbox' attribute: " + invalidTokens); | 89 document().addConsoleMessage(OtherMessageSource, ErrorMessageLevel,
"Error while parsing the 'sandbox' attribute: " + invalidTokens); |
90 } else if (name == seamlessAttr) { | 90 } else { |
91 // If we're adding or removing the seamless attribute, we need to force
the content document to recalculate its StyleResolver. | |
92 if (contentDocument()) | |
93 contentDocument()->styleResolverChanged(RecalcStyleDeferred); | |
94 } else | |
95 HTMLFrameElementBase::parseAttribute(name, value); | 91 HTMLFrameElementBase::parseAttribute(name, value); |
| 92 } |
96 } | 93 } |
97 | 94 |
98 bool HTMLIFrameElement::rendererIsNeeded(const RenderStyle& style) | 95 bool HTMLIFrameElement::rendererIsNeeded(const RenderStyle& style) |
99 { | 96 { |
100 return isURLAllowed() && HTMLElement::rendererIsNeeded(style); | 97 return isURLAllowed() && HTMLElement::rendererIsNeeded(style); |
101 } | 98 } |
102 | 99 |
103 RenderObject* HTMLIFrameElement::createRenderer(RenderStyle*) | 100 RenderObject* HTMLIFrameElement::createRenderer(RenderStyle*) |
104 { | 101 { |
105 return new RenderIFrame(this); | 102 return new RenderIFrame(this); |
106 } | 103 } |
107 | 104 |
108 Node::InsertionNotificationRequest HTMLIFrameElement::insertedInto(ContainerNode
* insertionPoint) | 105 Node::InsertionNotificationRequest HTMLIFrameElement::insertedInto(ContainerNode
* insertionPoint) |
109 { | 106 { |
110 InsertionNotificationRequest result = HTMLFrameElementBase::insertedInto(ins
ertionPoint); | 107 InsertionNotificationRequest result = HTMLFrameElementBase::insertedInto(ins
ertionPoint); |
111 if (insertionPoint->inDocument() && document().isHTMLDocument() && !insertio
nPoint->isInShadowTree()) | 108 if (insertionPoint->inDocument() && document().isHTMLDocument() && !insertio
nPoint->isInShadowTree()) |
112 toHTMLDocument(document()).addExtraNamedItem(m_name); | 109 toHTMLDocument(document()).addExtraNamedItem(m_name); |
113 return result; | 110 return result; |
114 } | 111 } |
115 | 112 |
116 void HTMLIFrameElement::removedFrom(ContainerNode* insertionPoint) | 113 void HTMLIFrameElement::removedFrom(ContainerNode* insertionPoint) |
117 { | 114 { |
118 HTMLFrameElementBase::removedFrom(insertionPoint); | 115 HTMLFrameElementBase::removedFrom(insertionPoint); |
119 if (insertionPoint->inDocument() && document().isHTMLDocument() && !insertio
nPoint->isInShadowTree()) | 116 if (insertionPoint->inDocument() && document().isHTMLDocument() && !insertio
nPoint->isInShadowTree()) |
120 toHTMLDocument(document()).removeExtraNamedItem(m_name); | 117 toHTMLDocument(document()).removeExtraNamedItem(m_name); |
121 } | 118 } |
122 | 119 |
123 bool HTMLIFrameElement::shouldDisplaySeamlessly() const | |
124 { | |
125 return contentDocument() && contentDocument()->shouldDisplaySeamlesslyWithPa
rent(); | |
126 } | |
127 | |
128 void HTMLIFrameElement::didRecalcStyle(StyleRecalcChange styleChange) | 120 void HTMLIFrameElement::didRecalcStyle(StyleRecalcChange styleChange) |
129 { | 121 { |
130 if (!shouldDisplaySeamlessly()) | 122 // FIXME: Can we remove this function? |
131 return; | |
132 Document* childDocument = contentDocument(); | |
133 if (shouldRecalcStyle(styleChange, childDocument)) | |
134 contentDocument()->recalcStyle(styleChange); | |
135 } | 123 } |
136 | 124 |
137 bool HTMLIFrameElement::isInteractiveContent() const | 125 bool HTMLIFrameElement::isInteractiveContent() const |
138 { | 126 { |
139 return true; | 127 return true; |
140 } | 128 } |
141 | 129 |
142 } | 130 } |
OLD | NEW |