Add AtomicString::number and use it
authordarin@apple.com <darin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 5 Oct 2013 18:22:39 +0000 (18:22 +0000)
committerdarin@apple.com <darin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 5 Oct 2013 18:22:39 +0000 (18:22 +0000)
commit5dfae0eb8cfda3980437a3dffde0b3e2fe8a0819
treee0e19a930be8e20f5279b1bb6e091766ebf48f0f
parent7699ff47b8d7558516ddd2106e5d1798b7717bf9
Add AtomicString::number and use it
https://bugs.webkit.org/show_bug.cgi?id=122384

Reviewed by Anders Carlsson.

Source/WebCore:

* css/CSSGrammar.y.in: Use AtomicString::number instead of String::number since
we are creating an AtomicString. This can save a memory allocation if the string
happens to already be in the atomic string table.
* dom/Element.cpp:
(WebCore::Element::setIntegralAttribute): Ditto.
(WebCore::Element::setUnsignedIntegralAttribute): Ditto.
* editing/BreakBlockquoteCommand.cpp:
(WebCore::BreakBlockquoteCommand::doApply): Ditto.
* html/HTMLBodyElement.cpp:
(WebCore::HTMLBodyElement::insertedInto): Use setIntegralAttribute instead of
a local homegrown equivalent.
* html/HTMLCanvasElement.cpp:
(WebCore::HTMLCanvasElement::setHeight): Ditto.
(WebCore::HTMLCanvasElement::setWidth): Ditto.
* html/HTMLElement.cpp:
(WebCore::HTMLElement::setTabIndex): Ditto.
* html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::setHeight): Ditto.
(WebCore::HTMLImageElement::setWidth): Ditto.
* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::setMaxLength): Ditto.
(WebCore::HTMLInputElement::setSize): Same, but setUnsignedIntegralAttribute.
(WebCore::HTMLInputElement::setHeight): Ditto.
(WebCore::HTMLInputElement::setWidth): Ditto.
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::mediaPlayerSetSize): Ditto.
* html/HTMLMeterElement.cpp:
(WebCore::HTMLMeterElement::setMin): More of the same.
(WebCore::HTMLMeterElement::setMax): Ditto.
(WebCore::HTMLMeterElement::setValue): Ditto.
(WebCore::HTMLMeterElement::setLow): Ditto.
(WebCore::HTMLMeterElement::setHigh): Ditto.
(WebCore::HTMLMeterElement::setOptimum): Ditto.
* html/HTMLOListElement.cpp:
(WebCore::HTMLOListElement::setStart): Ditto.
* html/HTMLProgressElement.cpp:
(WebCore::HTMLProgressElement::setValue): Ditto.
(WebCore::HTMLProgressElement::setMax): Ditto.
* html/HTMLSelectElement.cpp:
(WebCore::HTMLSelectElement::parseAttribute): Ditto.
(WebCore::HTMLSelectElement::setSize): Ditto.
* html/HTMLTableCellElement.cpp:
(WebCore::HTMLTableCellElement::setColSpan): Ditto.
(WebCore::HTMLTableCellElement::setRowSpan): Ditto.
* html/HTMLTableColElement.cpp:
(WebCore::HTMLTableColElement::setSpan): Ditto.
* html/HTMLTextAreaElement.cpp:
(WebCore::HTMLTextAreaElement::setMaxLength): Ditto.
(WebCore::HTMLTextAreaElement::setCols): Ditto.
(WebCore::HTMLTextAreaElement::setRows): Ditto.
* html/shadow/MediaControlElements.cpp:
(WebCore::MediaControlTimelineElement::setDuration): Ditto.

Source/WTF:

* wtf/text/AtomicString.cpp:
(WTF::AtomicString::number): Added.
* wtf/text/AtomicString.h: Ditto.

* wtf/text/IntegerToStringConversion.h: Simplify includes, renamed ConversionTrait to
IntegerToStringConversionTrait. Changed String version to use String since we no longer
need to use PassRefPtr to efficiently handle return values. Replaced UnsignedIntegerTrait
with std::make_unsigned. Added AtomicString support. Use nullptr instead of 0.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@156965 268f45cc-cd09-0410-ab3c-d52691b4dbfc
22 files changed:
Source/WTF/ChangeLog
Source/WTF/wtf/text/AtomicString.cpp
Source/WTF/wtf/text/AtomicString.h
Source/WTF/wtf/text/IntegerToStringConversion.h
Source/WebCore/ChangeLog
Source/WebCore/css/CSSGrammar.y.in
Source/WebCore/dom/Element.cpp
Source/WebCore/editing/BreakBlockquoteCommand.cpp
Source/WebCore/html/HTMLBodyElement.cpp
Source/WebCore/html/HTMLCanvasElement.cpp
Source/WebCore/html/HTMLElement.cpp
Source/WebCore/html/HTMLImageElement.cpp
Source/WebCore/html/HTMLInputElement.cpp
Source/WebCore/html/HTMLMediaElement.cpp
Source/WebCore/html/HTMLMeterElement.cpp
Source/WebCore/html/HTMLOListElement.cpp
Source/WebCore/html/HTMLProgressElement.cpp
Source/WebCore/html/HTMLSelectElement.cpp
Source/WebCore/html/HTMLTableCellElement.cpp
Source/WebCore/html/HTMLTableColElement.cpp
Source/WebCore/html/HTMLTextAreaElement.cpp
Source/WebCore/html/shadow/MediaControlElements.cpp