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

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

Issue 84713002: Add number() static methods to AtomicString class (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Take feedback into consideration (getting AppEngine errors...) 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
« no previous file with comments | « Source/core/dom/Element.h ('k') | Source/core/editing/BreakBlockquoteCommand.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 2734 matching lines...) Expand 10 before | Expand all | Expand 10 after
2745 return document().completeURL(value); 2745 return document().completeURL(value);
2746 } 2746 }
2747 2747
2748 int Element::getIntegralAttribute(const QualifiedName& attributeName) const 2748 int Element::getIntegralAttribute(const QualifiedName& attributeName) const
2749 { 2749 {
2750 return getAttribute(attributeName).string().toInt(); 2750 return getAttribute(attributeName).string().toInt();
2751 } 2751 }
2752 2752
2753 void Element::setIntegralAttribute(const QualifiedName& attributeName, int value ) 2753 void Element::setIntegralAttribute(const QualifiedName& attributeName, int value )
2754 { 2754 {
2755 // FIXME: Need an AtomicString version of String::number. 2755 setAttribute(attributeName, AtomicString::number(value));
2756 setAttribute(attributeName, String::number(value));
2757 } 2756 }
2758 2757
2759 unsigned Element::getUnsignedIntegralAttribute(const QualifiedName& attributeNam e) const 2758 unsigned Element::getUnsignedIntegralAttribute(const QualifiedName& attributeNam e) const
2760 { 2759 {
2761 return getAttribute(attributeName).string().toUInt(); 2760 return getAttribute(attributeName).string().toUInt();
2762 } 2761 }
2763 2762
2764 void Element::setUnsignedIntegralAttribute(const QualifiedName& attributeName, u nsigned value) 2763 void Element::setUnsignedIntegralAttribute(const QualifiedName& attributeName, u nsigned value)
2765 { 2764 {
2766 // FIXME: Need an AtomicString version of String::number. 2765 setAttribute(attributeName, AtomicString::number(value));
2767 setAttribute(attributeName, String::number(value)); 2766 }
2767
2768 double Element::getFloatingPointAttribute(const QualifiedName& attributeName, do uble fallbackValue) const
eseidel 2013/11/25 00:46:43 This is the same as the next function. We just ne
Inactive 2013/11/25 01:19:38 parseToDoubleForNumberType() uses std::numeric_lim
Inactive 2013/11/25 01:28:13 Done.
2769 {
2770 return parseToDoubleForNumberType(getAttribute(attributeName), fallbackValue );
2771 }
2772
2773 double Element::getFloatingPointAttribute(const QualifiedName& attributeName) co nst
2774 {
2775 return parseToDoubleForNumberType(getAttribute(attributeName));
2776 }
2777
2778 void Element::setFloatingPointAttribute(const QualifiedName& attributeName, doub le value)
2779 {
2780 setAttribute(attributeName, AtomicString::number(value));
2768 } 2781 }
2769 2782
2770 bool Element::childShouldCreateRenderer(const Node& child) const 2783 bool Element::childShouldCreateRenderer(const Node& child) const
2771 { 2784 {
2772 // Only create renderers for SVG elements whose parents are SVG elements, or for proper <svg xmlns="svgNS"> subdocuments. 2785 // Only create renderers for SVG elements whose parents are SVG elements, or for proper <svg xmlns="svgNS"> subdocuments.
2773 if (child.isSVGElement()) 2786 if (child.isSVGElement())
2774 return child.hasTagName(SVGNames::svgTag) || isSVGElement(); 2787 return child.hasTagName(SVGNames::svgTag) || isSVGElement();
2775 2788
2776 return ContainerNode::childShouldCreateRenderer(child); 2789 return ContainerNode::childShouldCreateRenderer(child);
2777 } 2790 }
(...skipping 751 matching lines...) Expand 10 before | Expand all | Expand 10 after
3529 // Before doing so, we need to resolve issues in HTMLSelectElement::recalcLi stItems 3542 // Before doing so, we need to resolve issues in HTMLSelectElement::recalcLi stItems
3530 // and RenderMenuList::setText. See also https://bugs.webkit.org/show_bug.cg i?id=88405 3543 // and RenderMenuList::setText. See also https://bugs.webkit.org/show_bug.cg i?id=88405
3531 if (hasTagName(optionTag) || hasTagName(optgroupTag)) 3544 if (hasTagName(optionTag) || hasTagName(optgroupTag))
3532 return false; 3545 return false;
3533 if (FullscreenElementStack::isActiveFullScreenElement(this)) 3546 if (FullscreenElementStack::isActiveFullScreenElement(this))
3534 return false; 3547 return false;
3535 return true; 3548 return true;
3536 } 3549 }
3537 3550
3538 } // namespace WebCore 3551 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/dom/Element.h ('k') | Source/core/editing/BreakBlockquoteCommand.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698