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

Side by Side Diff: Source/core/html/HTMLFrameSetElement.cpp

Issue 198553002: Use new is*Element() helper functions even more in HTML code (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/html/HTMLFrameElement.cpp ('k') | Source/core/html/HTMLImageLoader.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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, 2009, 2010 Apple Inc. All rights reserved. 6 * Copyright (C) 2004, 2006, 2009, 2010 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 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 return RenderObject::createObject(this, style); 163 return RenderObject::createObject(this, style);
164 164
165 return new RenderFrameSet(this); 165 return new RenderFrameSet(this);
166 } 166 }
167 167
168 void HTMLFrameSetElement::attach(const AttachContext& context) 168 void HTMLFrameSetElement::attach(const AttachContext& context)
169 { 169 {
170 // Inherit default settings from parent frameset 170 // Inherit default settings from parent frameset
171 // FIXME: This is not dynamic. 171 // FIXME: This is not dynamic.
172 for (ContainerNode* node = parentNode(); node; node = node->parentNode()) { 172 for (ContainerNode* node = parentNode(); node; node = node->parentNode()) {
173 if (node->hasTagName(framesetTag)) { 173 if (isHTMLFrameSetElement(*node)) {
174 HTMLFrameSetElement* frameset = toHTMLFrameSetElement(node); 174 HTMLFrameSetElement& frameset = toHTMLFrameSetElement(*node);
175 if (!m_frameborderSet) 175 if (!m_frameborderSet)
176 m_frameborder = frameset->hasFrameBorder(); 176 m_frameborder = frameset.hasFrameBorder();
177 if (m_frameborder) { 177 if (m_frameborder) {
178 if (!m_borderSet) 178 if (!m_borderSet)
179 m_border = frameset->border(); 179 m_border = frameset.border();
180 if (!m_borderColorSet) 180 if (!m_borderColorSet)
181 m_borderColorSet = frameset->hasBorderColor(); 181 m_borderColorSet = frameset.hasBorderColor();
182 } 182 }
183 if (!m_noresize) 183 if (!m_noresize)
184 m_noresize = frameset->noResize(); 184 m_noresize = frameset.noResize();
185 break; 185 break;
186 } 186 }
187 } 187 }
188 188
189 HTMLElement::attach(context); 189 HTMLElement::attach(context);
190 } 190 }
191 191
192 void HTMLFrameSetElement::defaultEventHandler(Event* evt) 192 void HTMLFrameSetElement::defaultEventHandler(Event* evt)
193 { 193 {
194 if (evt->isMouseEvent() && !m_noresize && renderer() && renderer()->isFrameS et()) { 194 if (evt->isMouseEvent() && !m_noresize && renderer() && renderer()->isFrameS et()) {
(...skipping 18 matching lines...) Expand all
213 { 213 {
214 if (needsStyleRecalc() && renderer()) { 214 if (needsStyleRecalc() && renderer()) {
215 renderer()->setNeedsLayout(); 215 renderer()->setNeedsLayout();
216 clearNeedsStyleRecalc(); 216 clearNeedsStyleRecalc();
217 } 217 }
218 } 218 }
219 219
220 DOMWindow* HTMLFrameSetElement::anonymousNamedGetter(const AtomicString& name) 220 DOMWindow* HTMLFrameSetElement::anonymousNamedGetter(const AtomicString& name)
221 { 221 {
222 Element* frameElement = children()->namedItem(name); 222 Element* frameElement = children()->namedItem(name);
223 if (!frameElement || !frameElement->hasTagName(HTMLNames::frameTag)) 223 if (!isHTMLFrameElement(frameElement))
224 return 0; 224 return 0;
225 Document* document = toHTMLFrameElement(frameElement)->contentDocument(); 225 Document* document = toHTMLFrameElement(frameElement)->contentDocument();
226 if (!document || !document->frame()) 226 if (!document || !document->frame())
227 return 0; 227 return 0;
228 return document->domWindow(); 228 return document->domWindow();
229 } 229 }
230 230
231 } // namespace WebCore 231 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/html/HTMLFrameElement.cpp ('k') | Source/core/html/HTMLImageLoader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698