Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(261)

Side by Side Diff: third_party/WebKit/Source/core/html/HTMLFrameElementBase.cpp

Issue 2623513005: Introduce Element::AttributeModificationParams (Closed)
Patch Set: Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 .executeScriptIfJavaScriptURL(scriptURL, this); 123 .executeScriptIfJavaScriptURL(scriptURL, this);
124 } 124 }
125 125
126 void HTMLFrameElementBase::frameOwnerPropertiesChanged() { 126 void HTMLFrameElementBase::frameOwnerPropertiesChanged() {
127 // Don't notify about updates if contentFrame() is null, for example when 127 // Don't notify about updates if contentFrame() is null, for example when
128 // the subframe hasn't been created yet. 128 // the subframe hasn't been created yet.
129 if (contentFrame()) 129 if (contentFrame())
130 document().frame()->loader().client()->didChangeFrameOwnerProperties(this); 130 document().frame()->loader().client()->didChangeFrameOwnerProperties(this);
131 } 131 }
132 132
133 void HTMLFrameElementBase::parseAttribute(const QualifiedName& name, 133 void HTMLFrameElementBase::parseAttribute(
134 const AtomicString& oldValue, 134 const AttributeModificationParams& params) {
135 const AtomicString& value) { 135 const QualifiedName& name = params.name;
136 const AtomicString& value = params.newValue;
136 if (name == srcdocAttr) { 137 if (name == srcdocAttr) {
137 if (!value.isNull()) { 138 if (!value.isNull()) {
138 setLocation(srcdocURL().getString()); 139 setLocation(srcdocURL().getString());
139 } else { 140 } else {
140 const AtomicString& srcValue = fastGetAttribute(srcAttr); 141 const AtomicString& srcValue = fastGetAttribute(srcAttr);
141 if (!srcValue.isNull()) 142 if (!srcValue.isNull())
142 setLocation(stripLeadingAndTrailingHTMLSpaces(srcValue)); 143 setLocation(stripLeadingAndTrailingHTMLSpaces(srcValue));
143 } 144 }
144 } else if (name == srcAttr && !fastHasAttribute(srcdocAttr)) { 145 } else if (name == srcAttr && !fastHasAttribute(srcdocAttr)) {
145 setLocation(stripLeadingAndTrailingHTMLSpaces(value)); 146 setLocation(stripLeadingAndTrailingHTMLSpaces(value));
146 } else if (name == idAttr) { 147 } else if (name == idAttr) {
147 // Important to call through to base for the id attribute so the hasID bit 148 // Important to call through to base for the id attribute so the hasID bit
148 // gets set. 149 // gets set.
149 HTMLFrameOwnerElement::parseAttribute(name, oldValue, value); 150 HTMLFrameOwnerElement::parseAttribute(params);
150 m_frameName = value; 151 m_frameName = value;
151 } else if (name == nameAttr) { 152 } else if (name == nameAttr) {
152 m_frameName = value; 153 m_frameName = value;
153 } else if (name == marginwidthAttr) { 154 } else if (name == marginwidthAttr) {
154 setMarginWidth(value.toInt()); 155 setMarginWidth(value.toInt());
155 } else if (name == marginheightAttr) { 156 } else if (name == marginheightAttr) {
156 setMarginHeight(value.toInt()); 157 setMarginHeight(value.toInt());
157 } else if (name == scrollingAttr) { 158 } else if (name == scrollingAttr) {
158 // Auto and yes both simply mean "allow scrolling." No means "don't allow 159 // Auto and yes both simply mean "allow scrolling." No means "don't allow
159 // scrolling." 160 // scrolling."
160 if (equalIgnoringCase(value, "auto") || equalIgnoringCase(value, "yes")) 161 if (equalIgnoringCase(value, "auto") || equalIgnoringCase(value, "yes"))
161 setScrollingMode(ScrollbarAuto); 162 setScrollingMode(ScrollbarAuto);
162 else if (equalIgnoringCase(value, "no")) 163 else if (equalIgnoringCase(value, "no"))
163 setScrollingMode(ScrollbarAlwaysOff); 164 setScrollingMode(ScrollbarAlwaysOff);
164 } else if (name == onbeforeunloadAttr) { 165 } else if (name == onbeforeunloadAttr) {
165 // FIXME: should <frame> elements have beforeunload handlers? 166 // FIXME: should <frame> elements have beforeunload handlers?
166 setAttributeEventListener( 167 setAttributeEventListener(
167 EventTypeNames::beforeunload, 168 EventTypeNames::beforeunload,
168 createAttributeEventListener(this, name, value, eventParameterName())); 169 createAttributeEventListener(this, name, value, eventParameterName()));
169 } else { 170 } else {
170 HTMLFrameOwnerElement::parseAttribute(name, oldValue, value); 171 HTMLFrameOwnerElement::parseAttribute(params);
171 } 172 }
172 } 173 }
173 174
174 void HTMLFrameElementBase::setNameAndOpenURL() { 175 void HTMLFrameElementBase::setNameAndOpenURL() {
175 m_frameName = getNameAttribute(); 176 m_frameName = getNameAttribute();
176 openURL(); 177 openURL();
177 } 178 }
178 179
179 Node::InsertionNotificationRequest HTMLFrameElementBase::insertedInto( 180 Node::InsertionNotificationRequest HTMLFrameElementBase::insertedInto(
180 ContainerNode* insertionPoint) { 181 ContainerNode* insertionPoint) {
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
288 289
289 if (contentDocument()) { 290 if (contentDocument()) {
290 contentDocument()->willChangeFrameOwnerProperties( 291 contentDocument()->willChangeFrameOwnerProperties(
291 m_marginWidth, marginHeight, m_scrollingMode); 292 m_marginWidth, marginHeight, m_scrollingMode);
292 } 293 }
293 m_marginHeight = marginHeight; 294 m_marginHeight = marginHeight;
294 frameOwnerPropertiesChanged(); 295 frameOwnerPropertiesChanged();
295 } 296 }
296 297
297 } // namespace blink 298 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/html/HTMLFrameElementBase.h ('k') | third_party/WebKit/Source/core/html/HTMLFrameSetElement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698