From 1cbdecfa9fc428ac2d8aca0fa91c9580b3d57353 Mon Sep 17 00:00:00 2001 From: The Android Open Source Project Date: Wed, 17 Dec 2008 18:05:15 -0800 Subject: Code drop from //branches/cupcake/...@124589 --- WebCore/html/HTMLIFrameElement.cpp | 37 ++++++++++++++++--------------------- 1 file changed, 16 insertions(+), 21 deletions(-) (limited to 'WebCore/html/HTMLIFrameElement.cpp') diff --git a/WebCore/html/HTMLIFrameElement.cpp b/WebCore/html/HTMLIFrameElement.cpp index c52587d..4a071bf 100644 --- a/WebCore/html/HTMLIFrameElement.cpp +++ b/WebCore/html/HTMLIFrameElement.cpp @@ -1,11 +1,9 @@ -/** - * This file is part of the DOM implementation for KDE. - * +/* * Copyright (C) 1999 Lars Knoll (knoll@kde.org) * (C) 1999 Antti Koivisto (koivisto@kde.org) * (C) 2000 Simon Hausmann (hausmann@kde.org) * (C) 2001 Dirk Mueller (mueller@kde.org) - * Copyright (C) 2004, 2006 Apple Computer, Inc. + * Copyright (C) 2004, 2006, 2008 Apple Inc. All rights reserved. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public @@ -22,6 +20,7 @@ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ + #include "config.h" #include "HTMLIFrameElement.h" @@ -60,28 +59,28 @@ bool HTMLIFrameElement::mapToEntry(const QualifiedName& attrName, MappedAttribut return HTMLFrameElementBase::mapToEntry(attrName, result); } -void HTMLIFrameElement::parseMappedAttribute(MappedAttribute *attr) +void HTMLIFrameElement::parseMappedAttribute(MappedAttribute* attr) { if (attr->name() == widthAttr) - addCSSLength(attr, CSS_PROP_WIDTH, attr->value()); + addCSSLength(attr, CSSPropertyWidth, attr->value()); else if (attr->name() == heightAttr) - addCSSLength(attr, CSS_PROP_HEIGHT, attr->value()); + addCSSLength(attr, CSSPropertyHeight, attr->value()); else if (attr->name() == alignAttr) addHTMLAlignment(attr); else if (attr->name() == nameAttr) { - String newNameAttr = attr->value(); + const AtomicString& newName = attr->value(); if (inDocument() && document()->isHTMLDocument()) { - HTMLDocument* doc = static_cast(document()); - doc->removeDocExtraNamedItem(oldNameAttr); - doc->addDocExtraNamedItem(newNameAttr); + HTMLDocument* document = static_cast(this->document()); + document->removeExtraNamedItem(m_name); + document->addExtraNamedItem(newName); } - oldNameAttr = newNameAttr; + m_name = newName; } else if (attr->name() == frameborderAttr) { // Frame border doesn't really match the HTML4 spec definition for iframes. It simply adds // a presentational hint that the border should be off if set to zero. if (!attr->isNull() && !attr->value().toInt()) // Add a rule that nulls out our border width. - addCSSLength(attr, CSS_PROP_BORDER_WIDTH, "0"); + addCSSLength(attr, CSSPropertyBorderWidth, "0"); } else HTMLFrameElementBase::parseMappedAttribute(attr); } @@ -98,20 +97,16 @@ RenderObject* HTMLIFrameElement::createRenderer(RenderArena* arena, RenderStyle* void HTMLIFrameElement::insertedIntoDocument() { - if (document()->isHTMLDocument()) { - HTMLDocument* doc = static_cast(document()); - doc->addDocExtraNamedItem(oldNameAttr); - } + if (document()->isHTMLDocument()) + static_cast(document())->addExtraNamedItem(m_name); HTMLFrameElementBase::insertedIntoDocument(); } void HTMLIFrameElement::removedFromDocument() { - if (document()->isHTMLDocument()) { - HTMLDocument* doc = static_cast(document()); - doc->removeDocExtraNamedItem(oldNameAttr); - } + if (document()->isHTMLDocument()) + static_cast(document())->removeExtraNamedItem(m_name); HTMLFrameElementBase::removedFromDocument(); } -- cgit v1.1