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

Side by Side Diff: Source/core/dom/Element.cpp

Issue 560273004: Use AtomicString API directly (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Add more Created 6 years, 3 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
« no previous file with comments | « Source/core/dom/Element.h ('k') | Source/core/html/HTMLEmbedElement.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) 2001 Peter Kelly (pmk@post.com) 4 * (C) 2001 Peter Kelly (pmk@post.com)
5 * (C) 2001 Dirk Mueller (mueller@kde.org) 5 * (C) 2001 Dirk Mueller (mueller@kde.org)
6 * (C) 2007 David Smith (catfish.man@gmail.com) 6 * (C) 2007 David Smith (catfish.man@gmail.com)
7 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012, 2013 Apple Inc. All rights reserved. 7 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012, 2013 Apple Inc. All rights reserved.
8 * (C) 2007 Eric Seidel (eric@webkit.org) 8 * (C) 2007 Eric Seidel (eric@webkit.org)
9 * 9 *
10 * This library is free software; you can redistribute it and/or 10 * This library is free software; you can redistribute it and/or
(...skipping 2590 matching lines...) Expand 10 before | Expand all | Expand 10 after
2601 } 2601 }
2602 #endif 2602 #endif
2603 String value = stripLeadingAndTrailingHTMLSpaces(getAttribute(name)); 2603 String value = stripLeadingAndTrailingHTMLSpaces(getAttribute(name));
2604 if (value.isEmpty()) 2604 if (value.isEmpty())
2605 return KURL(); 2605 return KURL();
2606 return document().completeURL(value); 2606 return document().completeURL(value);
2607 } 2607 }
2608 2608
2609 int Element::getIntegralAttribute(const QualifiedName& attributeName) const 2609 int Element::getIntegralAttribute(const QualifiedName& attributeName) const
2610 { 2610 {
2611 return getAttribute(attributeName).string().toInt(); 2611 return getAttribute(attributeName).toInt();
2612 } 2612 }
2613 2613
2614 void Element::setIntegralAttribute(const QualifiedName& attributeName, int value ) 2614 void Element::setIntegralAttribute(const QualifiedName& attributeName, int value )
2615 { 2615 {
2616 setAttribute(attributeName, AtomicString::number(value)); 2616 setAttribute(attributeName, AtomicString::number(value));
2617 } 2617 }
2618 2618
2619 unsigned Element::getUnsignedIntegralAttribute(const QualifiedName& attributeNam e) const
2620 {
2621 return getAttribute(attributeName).string().toUInt();
2622 }
2623
2624 void Element::setUnsignedIntegralAttribute(const QualifiedName& attributeName, u nsigned value) 2619 void Element::setUnsignedIntegralAttribute(const QualifiedName& attributeName, u nsigned value)
2625 { 2620 {
2626 // Range restrictions are enforced for unsigned IDL attributes that 2621 // Range restrictions are enforced for unsigned IDL attributes that
2627 // reflect content attributes, 2622 // reflect content attributes,
2628 // http://www.whatwg.org/specs/web-apps/current-work/multipage/common-dom- interfaces.html#reflecting-content-attributes-in-idl-attributes 2623 // http://www.whatwg.org/specs/web-apps/current-work/multipage/common-dom- interfaces.html#reflecting-content-attributes-in-idl-attributes
2629 if (value > 0x7fffffffu) 2624 if (value > 0x7fffffffu)
2630 value = 0; 2625 value = 0;
2631 setAttribute(attributeName, AtomicString::number(value)); 2626 setAttribute(attributeName, AtomicString::number(value));
2632 } 2627 }
2633 2628
(...skipping 633 matching lines...) Expand 10 before | Expand all | Expand 10 after
3267 return v8::Handle<v8::Object>(); 3262 return v8::Handle<v8::Object>();
3268 3263
3269 wrapper->SetPrototype(binding->prototype()); 3264 wrapper->SetPrototype(binding->prototype());
3270 3265
3271 wrapperType->refObject(toScriptWrappableBase()); 3266 wrapperType->refObject(toScriptWrappableBase());
3272 V8DOMWrapper::associateObjectWithWrapperNonTemplate(this, wrapperType, wrapp er, isolate); 3267 V8DOMWrapper::associateObjectWithWrapperNonTemplate(this, wrapperType, wrapp er, isolate);
3273 return wrapper; 3268 return wrapper;
3274 } 3269 }
3275 3270
3276 } // namespace blink 3271 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/dom/Element.h ('k') | Source/core/html/HTMLEmbedElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698