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 * | 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 27 matching lines...) Expand all Loading... |
38 #include "core/loader/FrameLoader.h" | 38 #include "core/loader/FrameLoader.h" |
39 #include "core/page/FocusController.h" | 39 #include "core/page/FocusController.h" |
40 #include "core/page/Page.h" | 40 #include "core/page/Page.h" |
41 | 41 |
42 namespace blink { | 42 namespace blink { |
43 | 43 |
44 using namespace HTMLNames; | 44 using namespace HTMLNames; |
45 | 45 |
46 HTMLFrameElementBase::HTMLFrameElementBase(const QualifiedName& tagName, Documen
t& document) | 46 HTMLFrameElementBase::HTMLFrameElementBase(const QualifiedName& tagName, Documen
t& document) |
47 : HTMLFrameOwnerElement(tagName, document) | 47 : HTMLFrameOwnerElement(tagName, document) |
48 , m_scrolling(ScrollbarAuto) | |
49 , m_marginWidth(-1) | |
50 , m_marginHeight(-1) | |
51 { | 48 { |
52 } | 49 } |
53 | 50 |
54 bool HTMLFrameElementBase::isURLAllowed() const | 51 bool HTMLFrameElementBase::isURLAllowed() const |
55 { | 52 { |
56 if (m_URL.isEmpty()) | 53 if (m_URL.isEmpty()) |
57 return true; | 54 return true; |
58 | 55 |
59 const KURL& completeURL = document().completeURL(m_URL); | 56 const KURL& completeURL = document().completeURL(m_URL); |
60 | 57 |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 } else if (name == idAttr) { | 110 } else if (name == idAttr) { |
114 // Important to call through to base for the id attribute so the hasID b
it gets set. | 111 // Important to call through to base for the id attribute so the hasID b
it gets set. |
115 HTMLFrameOwnerElement::parseAttribute(name, value); | 112 HTMLFrameOwnerElement::parseAttribute(name, value); |
116 m_frameName = value; | 113 m_frameName = value; |
117 } else if (name == nameAttr) { | 114 } else if (name == nameAttr) { |
118 m_frameName = value; | 115 m_frameName = value; |
119 // FIXME: If we are already attached, this doesn't actually change the f
rame's name. | 116 // FIXME: If we are already attached, this doesn't actually change the f
rame's name. |
120 // FIXME: If we are already attached, this doesn't check for frame name | 117 // FIXME: If we are already attached, this doesn't check for frame name |
121 // conflicts and generate a unique frame name. | 118 // conflicts and generate a unique frame name. |
122 } else if (name == marginwidthAttr) { | 119 } else if (name == marginwidthAttr) { |
123 m_marginWidth = value.toInt(); | 120 setMarginWidth(value.toInt()); |
124 // FIXME: If we are already attached, this has no effect. | 121 // FIXME: If we are already attached, this has no effect. |
125 } else if (name == marginheightAttr) { | 122 } else if (name == marginheightAttr) { |
126 m_marginHeight = value.toInt(); | 123 setMarginHeight(value.toInt()); |
127 // FIXME: If we are already attached, this has no effect. | 124 // FIXME: If we are already attached, this has no effect. |
128 } else if (name == scrollingAttr) { | 125 } else if (name == scrollingAttr) { |
129 // Auto and yes both simply mean "allow scrolling." No means "don't allo
w scrolling." | 126 // Auto and yes both simply mean "allow scrolling." No means "don't allo
w scrolling." |
130 if (equalIgnoringCase(value, "auto") || equalIgnoringCase(value, "yes")) | 127 if (equalIgnoringCase(value, "auto") || equalIgnoringCase(value, "yes")) |
131 m_scrolling = ScrollbarAuto; | 128 setScrollingMode(ScrollbarAuto); |
132 else if (equalIgnoringCase(value, "no")) | 129 else if (equalIgnoringCase(value, "no")) |
133 m_scrolling = ScrollbarAlwaysOff; | 130 setScrollingMode(ScrollbarAlwaysOff); |
134 // FIXME: If we are already attached, this has no effect. | 131 // FIXME: If we are already attached, this has no effect. |
135 } else if (name == onbeforeunloadAttr) { | 132 } else if (name == onbeforeunloadAttr) { |
136 // FIXME: should <frame> elements have beforeunload handlers? | 133 // FIXME: should <frame> elements have beforeunload handlers? |
137 setAttributeEventListener(EventTypeNames::beforeunload, createAttributeE
ventListener(this, name, value, eventParameterName())); | 134 setAttributeEventListener(EventTypeNames::beforeunload, createAttributeE
ventListener(this, name, value, eventParameterName())); |
138 } else { | 135 } else { |
139 HTMLFrameOwnerElement::parseAttribute(name, value); | 136 HTMLFrameOwnerElement::parseAttribute(name, value); |
140 } | 137 } |
141 } | 138 } |
142 | 139 |
143 void HTMLFrameElementBase::setNameAndOpenURL() | 140 void HTMLFrameElementBase::setNameAndOpenURL() |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
222 void HTMLFrameElementBase::defaultEventHandler(Event* event) | 219 void HTMLFrameElementBase::defaultEventHandler(Event* event) |
223 { | 220 { |
224 if (contentFrame() && contentFrame()->isRemoteFrame()) { | 221 if (contentFrame() && contentFrame()->isRemoteFrame()) { |
225 toRemoteFrame(contentFrame())->forwardInputEvent(event); | 222 toRemoteFrame(contentFrame())->forwardInputEvent(event); |
226 return; | 223 return; |
227 } | 224 } |
228 HTMLFrameOwnerElement::defaultEventHandler(event); | 225 HTMLFrameOwnerElement::defaultEventHandler(event); |
229 } | 226 } |
230 | 227 |
231 } // namespace blink | 228 } // namespace blink |
OLD | NEW |