| 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 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 113 if (!value.isNull()) { | 113 if (!value.isNull()) { |
| 114 setLocation(srcdocURL().getString()); | 114 setLocation(srcdocURL().getString()); |
| 115 } else { | 115 } else { |
| 116 const AtomicString& srcValue = fastGetAttribute(srcAttr); | 116 const AtomicString& srcValue = fastGetAttribute(srcAttr); |
| 117 if (!srcValue.isNull()) | 117 if (!srcValue.isNull()) |
| 118 setLocation(stripLeadingAndTrailingHTMLSpaces(srcValue)); | 118 setLocation(stripLeadingAndTrailingHTMLSpaces(srcValue)); |
| 119 } | 119 } |
| 120 } else if (name == srcAttr && !fastHasAttribute(srcdocAttr)) { | 120 } else if (name == srcAttr && !fastHasAttribute(srcdocAttr)) { |
| 121 setLocation(stripLeadingAndTrailingHTMLSpaces(value)); | 121 setLocation(stripLeadingAndTrailingHTMLSpaces(value)); |
| 122 } else if (name == idAttr) { | 122 } else if (name == idAttr) { |
| 123 // Important to call through to base for the id attribute so the hasID bit g
ets set. | 123 // Important to call through to base for the id attribute so the hasID bit |
| 124 // gets set. |
| 124 HTMLFrameOwnerElement::parseAttribute(name, oldValue, value); | 125 HTMLFrameOwnerElement::parseAttribute(name, oldValue, value); |
| 125 m_frameName = value; | 126 m_frameName = value; |
| 126 } else if (name == nameAttr) { | 127 } else if (name == nameAttr) { |
| 127 m_frameName = value; | 128 m_frameName = value; |
| 128 // FIXME: If we are already attached, this doesn't actually change the frame
's name. | 129 // FIXME: If we are already attached, this doesn't actually change the |
| 130 // frame's name. |
| 129 // FIXME: If we are already attached, this doesn't check for frame name | 131 // FIXME: If we are already attached, this doesn't check for frame name |
| 130 // conflicts and generate a unique frame name. | 132 // conflicts and generate a unique frame name. |
| 131 } else if (name == marginwidthAttr) { | 133 } else if (name == marginwidthAttr) { |
| 132 setMarginWidth(value.toInt()); | 134 setMarginWidth(value.toInt()); |
| 133 // FIXME: If we are already attached, this has no effect. | 135 // FIXME: If we are already attached, this has no effect. |
| 134 } else if (name == marginheightAttr) { | 136 } else if (name == marginheightAttr) { |
| 135 setMarginHeight(value.toInt()); | 137 setMarginHeight(value.toInt()); |
| 136 // FIXME: If we are already attached, this has no effect. | 138 // FIXME: If we are already attached, this has no effect. |
| 137 } else if (name == scrollingAttr) { | 139 } else if (name == scrollingAttr) { |
| 138 // Auto and yes both simply mean "allow scrolling." No means "don't allow sc
rolling." | 140 // Auto and yes both simply mean "allow scrolling." No means "don't allow |
| 141 // scrolling." |
| 139 if (equalIgnoringCase(value, "auto") || equalIgnoringCase(value, "yes")) | 142 if (equalIgnoringCase(value, "auto") || equalIgnoringCase(value, "yes")) |
| 140 setScrollingMode(ScrollbarAuto); | 143 setScrollingMode(ScrollbarAuto); |
| 141 else if (equalIgnoringCase(value, "no")) | 144 else if (equalIgnoringCase(value, "no")) |
| 142 setScrollingMode(ScrollbarAlwaysOff); | 145 setScrollingMode(ScrollbarAlwaysOff); |
| 143 // FIXME: If we are already attached, this has no effect. | 146 // FIXME: If we are already attached, this has no effect. |
| 144 } else if (name == onbeforeunloadAttr) { | 147 } else if (name == onbeforeunloadAttr) { |
| 145 // FIXME: should <frame> elements have beforeunload handlers? | 148 // FIXME: should <frame> elements have beforeunload handlers? |
| 146 setAttributeEventListener( | 149 setAttributeEventListener( |
| 147 EventTypeNames::beforeunload, | 150 EventTypeNames::beforeunload, |
| 148 createAttributeEventListener(this, name, value, eventParameterName())); | 151 createAttributeEventListener(this, name, value, eventParameterName())); |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 192 openURL(false); | 195 openURL(false); |
| 193 } | 196 } |
| 194 | 197 |
| 195 bool HTMLFrameElementBase::supportsFocus() const { | 198 bool HTMLFrameElementBase::supportsFocus() const { |
| 196 return true; | 199 return true; |
| 197 } | 200 } |
| 198 | 201 |
| 199 void HTMLFrameElementBase::setFocus(bool received) { | 202 void HTMLFrameElementBase::setFocus(bool received) { |
| 200 HTMLFrameOwnerElement::setFocus(received); | 203 HTMLFrameOwnerElement::setFocus(received); |
| 201 if (Page* page = document().page()) { | 204 if (Page* page = document().page()) { |
| 202 if (received) | 205 if (received) { |
| 203 page->focusController().setFocusedFrame(contentFrame()); | 206 page->focusController().setFocusedFrame(contentFrame()); |
| 204 else if ( | 207 } else if (page->focusController().focusedFrame() == contentFrame()) { |
| 205 page->focusController().focusedFrame() == | 208 // Focus may have already been given to another frame, don't take it away. |
| 206 contentFrame()) // Focus may have already been given to another frame,
don't take it away. | |
| 207 page->focusController().setFocusedFrame(nullptr); | 209 page->focusController().setFocusedFrame(nullptr); |
| 210 } |
| 208 } | 211 } |
| 209 } | 212 } |
| 210 | 213 |
| 211 bool HTMLFrameElementBase::isURLAttribute(const Attribute& attribute) const { | 214 bool HTMLFrameElementBase::isURLAttribute(const Attribute& attribute) const { |
| 212 return attribute.name() == longdescAttr || attribute.name() == srcAttr || | 215 return attribute.name() == longdescAttr || attribute.name() == srcAttr || |
| 213 HTMLFrameOwnerElement::isURLAttribute(attribute); | 216 HTMLFrameOwnerElement::isURLAttribute(attribute); |
| 214 } | 217 } |
| 215 | 218 |
| 216 bool HTMLFrameElementBase::hasLegalLinkAttribute( | 219 bool HTMLFrameElementBase::hasLegalLinkAttribute( |
| 217 const QualifiedName& name) const { | 220 const QualifiedName& name) const { |
| (...skipping 25 matching lines...) Expand all Loading... |
| 243 m_marginWidth = marginWidth; | 246 m_marginWidth = marginWidth; |
| 244 frameOwnerPropertiesChanged(); | 247 frameOwnerPropertiesChanged(); |
| 245 } | 248 } |
| 246 | 249 |
| 247 void HTMLFrameElementBase::setMarginHeight(int marginHeight) { | 250 void HTMLFrameElementBase::setMarginHeight(int marginHeight) { |
| 248 m_marginHeight = marginHeight; | 251 m_marginHeight = marginHeight; |
| 249 frameOwnerPropertiesChanged(); | 252 frameOwnerPropertiesChanged(); |
| 250 } | 253 } |
| 251 | 254 |
| 252 } // namespace blink | 255 } // namespace blink |
| OLD | NEW |