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, 2009 Apple Inc. All rights reserved. | 6 * Copyright (C) 2004, 2006, 2009 Apple Inc. All rights reserved. |
7 * | 7 * |
8 * This library is free software; you can redistribute it and/or | 8 * This library is free software; you can redistribute it and/or |
9 * modify it under the terms of the GNU Library General Public | 9 * modify it under the terms of the GNU Library General Public |
10 * License as published by the Free Software Foundation; either | 10 * License as published by the Free Software Foundation; either |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 { | 49 { |
50 // For compatibility, frames render even when display: none is set. | 50 // For compatibility, frames render even when display: none is set. |
51 return isURLAllowed(); | 51 return isURLAllowed(); |
52 } | 52 } |
53 | 53 |
54 RenderObject* HTMLFrameElement::createRenderer(RenderStyle*) | 54 RenderObject* HTMLFrameElement::createRenderer(RenderStyle*) |
55 { | 55 { |
56 return new RenderFrame(this); | 56 return new RenderFrame(this); |
57 } | 57 } |
58 | 58 |
59 static inline HTMLFrameSetElement* containingFrameSetElement(Node* node) | |
60 { | |
61 while ((node = node->parentNode())) { | |
62 if (isHTMLFrameSetElement(*node)) | |
63 return toHTMLFrameSetElement(node); | |
64 } | |
65 return 0; | |
66 } | |
67 | |
68 bool HTMLFrameElement::noResize() const | 59 bool HTMLFrameElement::noResize() const |
69 { | 60 { |
70 return hasAttribute(noresizeAttr); | 61 return hasAttribute(noresizeAttr); |
71 } | 62 } |
72 | 63 |
73 void HTMLFrameElement::attach(const AttachContext& context) | 64 void HTMLFrameElement::attach(const AttachContext& context) |
74 { | 65 { |
75 HTMLFrameElementBase::attach(context); | 66 HTMLFrameElementBase::attach(context); |
76 | 67 |
77 if (HTMLFrameSetElement* frameSetElement = containingFrameSetElement(this))
{ | 68 if (HTMLFrameSetElement* frameSetElement = Traversal<HTMLFrameSetElement>::f
irstAncestor(*this)) { |
78 if (!m_frameBorderSet) | 69 if (!m_frameBorderSet) |
79 m_frameBorder = frameSetElement->hasFrameBorder(); | 70 m_frameBorder = frameSetElement->hasFrameBorder(); |
80 } | 71 } |
81 } | 72 } |
82 | 73 |
83 void HTMLFrameElement::parseAttribute(const QualifiedName& name, const AtomicStr
ing& value) | 74 void HTMLFrameElement::parseAttribute(const QualifiedName& name, const AtomicStr
ing& value) |
84 { | 75 { |
85 if (name == frameborderAttr) { | 76 if (name == frameborderAttr) { |
86 m_frameBorder = value.toInt(); | 77 m_frameBorder = value.toInt(); |
87 m_frameBorderSet = !value.isNull(); | 78 m_frameBorderSet = !value.isNull(); |
88 // FIXME: If we are already attached, this has no effect. | 79 // FIXME: If we are already attached, this has no effect. |
89 } else if (name == noresizeAttr) { | 80 } else if (name == noresizeAttr) { |
90 if (renderer()) | 81 if (renderer()) |
91 renderer()->updateFromElement(); | 82 renderer()->updateFromElement(); |
92 } else | 83 } else |
93 HTMLFrameElementBase::parseAttribute(name, value); | 84 HTMLFrameElementBase::parseAttribute(name, value); |
94 } | 85 } |
95 | 86 |
96 } // namespace WebCore | 87 } // namespace WebCore |
OLD | NEW |