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

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

Issue 84713002: Add number() static methods to AtomicString class (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years 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
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, 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 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
159 HTMLElement::insertedInto(insertionPoint); 159 HTMLElement::insertedInto(insertionPoint);
160 if (insertionPoint->inDocument()) { 160 if (insertionPoint->inDocument()) {
161 // FIXME: It's surprising this is web compatible since it means a margin width 161 // FIXME: It's surprising this is web compatible since it means a margin width
162 // and marginheight attribute can magically appear on the <body> of all documents 162 // and marginheight attribute can magically appear on the <body> of all documents
163 // embedded through <iframe> or <frame>. 163 // embedded through <iframe> or <frame>.
164 Element* ownerElement = document().ownerElement(); 164 Element* ownerElement = document().ownerElement();
165 if (ownerElement && ownerElement->isFrameElementBase()) { 165 if (ownerElement && ownerElement->isFrameElementBase()) {
166 HTMLFrameElementBase* ownerFrameElement = toHTMLFrameElementBase(own erElement); 166 HTMLFrameElementBase* ownerFrameElement = toHTMLFrameElementBase(own erElement);
167 int marginWidth = ownerFrameElement->marginWidth(); 167 int marginWidth = ownerFrameElement->marginWidth();
168 if (marginWidth != -1) 168 if (marginWidth != -1)
169 setAttribute(marginwidthAttr, String::number(marginWidth)); 169 setAttribute(marginwidthAttr, AtomicString::number(marginWidth)) ;
170 int marginHeight = ownerFrameElement->marginHeight(); 170 int marginHeight = ownerFrameElement->marginHeight();
171 if (marginHeight != -1) 171 if (marginHeight != -1)
172 setAttribute(marginheightAttr, String::number(marginHeight)); 172 setAttribute(marginheightAttr, AtomicString::number(marginHeight ));
eseidel 2013/11/24 21:37:44 Looks like some of these could use the helpers on
Inactive 2013/11/24 22:30:01 Excellent point, I'll update everywhere to use the
Inactive 2013/11/24 23:19:17 Done.
173 } 173 }
174 } 174 }
175 return InsertionDone; 175 return InsertionDone;
176 } 176 }
177 177
178 bool HTMLBodyElement::isURLAttribute(const Attribute& attribute) const 178 bool HTMLBodyElement::isURLAttribute(const Attribute& attribute) const
179 { 179 {
180 return attribute.name() == backgroundAttr || HTMLElement::isURLAttribute(att ribute); 180 return attribute.name() == backgroundAttr || HTMLElement::isURLAttribute(att ribute);
181 } 181 }
182 182
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
289 } 289 }
290 290
291 void HTMLBodyElement::addSubresourceAttributeURLs(ListHashSet<KURL>& urls) const 291 void HTMLBodyElement::addSubresourceAttributeURLs(ListHashSet<KURL>& urls) const
292 { 292 {
293 HTMLElement::addSubresourceAttributeURLs(urls); 293 HTMLElement::addSubresourceAttributeURLs(urls);
294 294
295 addSubresourceURL(urls, document().completeURL(getAttribute(backgroundAttr)) ); 295 addSubresourceURL(urls, document().completeURL(getAttribute(backgroundAttr)) );
296 } 296 }
297 297
298 } // namespace WebCore 298 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698