| 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, 2007, 2008, 2009, 2010 Apple Inc. All rights reserv
ed. | 6 * Copyright (C) 2004, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserv
ed. |
| 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 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 152 { | 152 { |
| 153 HTMLElement::insertedInto(insertionPoint); | 153 HTMLElement::insertedInto(insertionPoint); |
| 154 return InsertionShouldCallDidNotifySubtreeInsertions; | 154 return InsertionShouldCallDidNotifySubtreeInsertions; |
| 155 } | 155 } |
| 156 | 156 |
| 157 void HTMLBodyElement::didNotifySubtreeInsertionsToDocument() | 157 void HTMLBodyElement::didNotifySubtreeInsertionsToDocument() |
| 158 { | 158 { |
| 159 // FIXME: It's surprising this is web compatible since it means a | 159 // FIXME: It's surprising this is web compatible since it means a |
| 160 // marginwidth and marginheight attribute can magically appear on the <body> | 160 // marginwidth and marginheight attribute can magically appear on the <body> |
| 161 // of all documents embedded through <iframe> or <frame>. | 161 // of all documents embedded through <iframe> or <frame>. |
| 162 HTMLFrameOwnerElement* ownerElement = document().ownerElement(); | 162 if (document().frame() && document().frame()->owner()) { |
| 163 if (!isHTMLFrameElementBase(ownerElement)) | 163 int marginWidth = document().frame()->owner()->marginWidth(); |
| 164 return; | 164 int marginHeight = document().frame()->owner()->marginHeight(); |
| 165 HTMLFrameElementBase& ownerFrameElement = toHTMLFrameElementBase(*ownerEleme
nt); | 165 if (marginWidth != -1) |
| 166 int marginWidth = ownerFrameElement.marginWidth(); | 166 setIntegralAttribute(marginwidthAttr, marginWidth); |
| 167 int marginHeight = ownerFrameElement.marginHeight(); | 167 if (marginHeight != -1) |
| 168 if (marginWidth != -1) | 168 setIntegralAttribute(marginheightAttr, marginHeight); |
| 169 setIntegralAttribute(marginwidthAttr, marginWidth); | 169 } |
| 170 if (marginHeight != -1) | |
| 171 setIntegralAttribute(marginheightAttr, marginHeight); | |
| 172 } | 170 } |
| 173 | 171 |
| 174 bool HTMLBodyElement::isURLAttribute(const Attribute& attribute) const | 172 bool HTMLBodyElement::isURLAttribute(const Attribute& attribute) const |
| 175 { | 173 { |
| 176 return attribute.name() == backgroundAttr || HTMLElement::isURLAttribute(att
ribute); | 174 return attribute.name() == backgroundAttr || HTMLElement::isURLAttribute(att
ribute); |
| 177 } | 175 } |
| 178 | 176 |
| 179 bool HTMLBodyElement::hasLegalLinkAttribute(const QualifiedName& name) const | 177 bool HTMLBodyElement::hasLegalLinkAttribute(const QualifiedName& name) const |
| 180 { | 178 { |
| 181 return name == backgroundAttr || HTMLElement::hasLegalLinkAttribute(name); | 179 return name == backgroundAttr || HTMLElement::hasLegalLinkAttribute(name); |
| 182 } | 180 } |
| 183 | 181 |
| 184 const QualifiedName& HTMLBodyElement::subResourceAttributeName() const | 182 const QualifiedName& HTMLBodyElement::subResourceAttributeName() const |
| 185 { | 183 { |
| 186 return backgroundAttr; | 184 return backgroundAttr; |
| 187 } | 185 } |
| 188 | 186 |
| 189 bool HTMLBodyElement::supportsFocus() const | 187 bool HTMLBodyElement::supportsFocus() const |
| 190 { | 188 { |
| 191 // This override is needed because the inherited method bails if the parent
is editable. | 189 // This override is needed because the inherited method bails if the parent
is editable. |
| 192 // The <body> should be focusable even if <html> is editable. | 190 // The <body> should be focusable even if <html> is editable. |
| 193 return hasEditableStyle() || HTMLElement::supportsFocus(); | 191 return hasEditableStyle() || HTMLElement::supportsFocus(); |
| 194 } | 192 } |
| 195 | 193 |
| 196 } // namespace blink | 194 } // namespace blink |
| OLD | NEW |