Use StringBuilder append(char) and appendLiteral in more places
https://bugs.webkit.org/show_bug.cgi?id=136470

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2014-09-03
Reviewed by Andreas Kling.

* Modules/indexeddb/IDBKeyData.cpp:
(WebCore::IDBKeyData::loggingString):
* Modules/websockets/WebSocket.cpp:
(WebCore::encodeProtocolString):
* Modules/websockets/WebSocketExtensionDispatcher.cpp:
(WebCore::WebSocketExtensionDispatcher::createHeaderValue):
(WebCore::WebSocketExtensionDispatcher::appendAcceptedExtension):
* Modules/websockets/WebSocketHandshake.cpp:
(WebCore::WebSocketHandshake::clientLocation):
(WebCore::WebSocketHandshake::clientHandshakeMessage):
* css/CSSCalculationValue.cpp:
(WebCore::buildCssText):
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::CSSComputedStyleDeclaration::cssText):
* css/CSSMediaRule.cpp:
(WebCore::CSSMediaRule::cssText):
* css/CSSSelectorList.cpp:
(WebCore::CSSSelectorList::selectorsText):
* css/CSSSupportsRule.cpp:
(WebCore::CSSSupportsRule::cssText):
* css/MediaQuery.cpp:
(WebCore::MediaQuery::serialize):
* editing/MarkupAccumulator.cpp:
(WebCore::MarkupAccumulator::generateUniquePrefix):
* editing/markup.cpp:
(WebCore::urlToMarkup):
* fileapi/FileReaderLoader.cpp:
(WebCore::FileReaderLoader::convertToDataURL):
* html/EmailInputType.cpp:
(WebCore::EmailInputType::sanitizeValue):
* html/FormController.cpp:
(WebCore::recordFormStructure):
* html/parser/XSSAuditorDelegate.cpp:
(WebCore::buildConsoleError):
* html/track/WebVTTParser.cpp:
(WebCore::WebVTTParser::collectCueText):
* mathml/MathMLMencloseElement.cpp:
(WebCore::MathMLMencloseElement::longDivLeftPadding):
* page/PageSerializer.cpp:
(WebCore::SerializerMarkupAccumulator::appendElement):
* page/SecurityOrigin.cpp:
(WebCore::SecurityOrigin::toRawString):
* page/scrolling/ScrollingCoordinator.cpp:
(WebCore::ScrollingCoordinator::synchronousScrollingReasonsAsText):
* page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
(WebCore::logThreadedScrollingMode):
* platform/PODInterval.h:
(WebCore::PODInterval::toString):
* platform/PODRedBlackTree.h:
(WebCore::PODRedBlackTree::dumpFromNode):
* platform/UUID.cpp:
(WebCore::createCanonicalUUIDString):
* platform/network/ProxyServer.cpp:
(WebCore::appendProxyServerString):
(WebCore::toString):
* platform/text/DateTimeFormat.cpp:
(WebCore::DateTimeFormat::quoteAndAppendLiteral):
* platform/text/PlatformLocale.cpp:
(WebCore::DateTimeStringBuilder::zeroPadString):
(WebCore::Locale::convertFromLocalizedNumber):
* platform/text/TextStream.cpp:
(WebCore::TextStream::operator<<):
* rendering/RenderListMarker.cpp:
(WebCore::listMarkerText):
* testing/Internals.cpp:
(WebCore::Internals::parserMetaData):
(WebCore::Internals::getCurrentCursorInfo):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@173212 268f45cc-cd09-0410-ab3c-d52691b4dbfc
FTL In implementation sets callReturnLocation incorrectly leading to crashes beneath repatchCall()
https://bugs.webkit.org/show_bug.cgi?id=136488

Reviewed by Mark Hahnenberg.

* ftl/FTLCompile.cpp:
(JSC::FTL::generateCheckInICFastPath): The call is in the slow path.
* tests/stress/ftl-in-overflow.js: Added. This used to crash with 100% with FTL enabled.
(foo):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@173213 268f45cc-cd09-0410-ab3c-d52691b4dbfc
CallEdgeProfile::visitWeak() should gracefully handle the case where primaryCallee duplicates an entry in otherCallees
https://bugs.webkit.org/show_bug.cgi?id=136490

Reviewed by Geoffrey Garen.

* bytecode/CallEdgeProfile.cpp:
(JSC::CallEdgeProfile::visitWeak):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@173214 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Get rid of HIGH_DPI_CANVAS leftovers
https://bugs.webkit.org/show_bug.cgi?id=136491

Reviewed by Benjamin Poulain.

Source/JavaScriptCore:

* Configurations/FeatureDefines.xcconfig: Removed definition of ENABLE_HIGH_DPI_CANVAS
and removed it from FEATURE_DEFINES.

Source/WebCore:

* Configurations/FeatureDefines.xcconfig: Removed definition of ENABLE_HIGH_DPI_CANVAS
and removed it from FEATURE_DEFINES.
* html/HTMLCanvasElement.cpp:
(WebCore::HTMLCanvasElement::targetDeviceScaleFactor): Removed #if ENABLE(HIGH_DPI_CANVAS)
code.

Source/WebKit/mac:

* Configurations/FeatureDefines.xcconfig: Removed definition of ENABLE_HIGH_DPI_CANVAS
and removed it from FEATURE_DEFINES.

Source/WebKit2:

* Configurations/FeatureDefines.xcconfig: Removed definition of ENABLE_HIGH_DPI_CANVAS
and removed it from FEATURE_DEFINES.

Source/WTF:

* wtf/FeatureDefines.h: Removed definition of ENABLE_HIGH_DPI_CANVAS.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@173215 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Win] Prevent double-release on AVCFURLAssetRef
https://bugs.webkit.org/show_bug.cgi?id=136492
<rdar://problem/18206746>

Reviewed by Eric Carlson.

The AVFWrapper::setAsset method needs to retain the passed argument, since it
originates from AVCFPlayerItemGetAsset, which does not increment the
reference count of its return value as expected by Cocoa Get/Create/Copy
semantics.

* platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
(WebCore::AVFWrapper::setAsset): Retain the passed argument.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@173216 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Add support for the initial-letter CSS property to first-letter
https://bugs.webkit.org/show_bug.cgi?id=136484

Reviewed by Dean Jackson.
Source/WebCore:

        
New tests in fast/css-generated-content/initial-letter-*.html

This patch add support for the CSS initial-letter property, enabling
better drop caps support in WebKit. Letters size to a specified number of
paragraph lines, and align to the cap-height of the first line and the baseline
of the last line.

* css/CSSComputedStyleDeclaration.cpp:
(WebCore::ComputedStyleExtractor::propertyValue):
Add -webkit-initial-letter to the list.

* css/CSSLineBoxContainValue.cpp:
(WebCore::CSSLineBoxContainValue::customCSSText):
* css/CSSLineBoxContainValue.h:
Add support for a new value of line-box-contain, initial-letter, that causes
lines to use cap-height above the baseline and the glyph bounds below the
baseline.

* css/CSSParser.cpp:
(WebCore::CSSParser::parseValue):
Add support for parsing of initial-letter.

(WebCore::CSSParser::parseLineBoxContain):
Add the new line-box-contain value for first-letters with initial-letter set.

* css/CSSPropertyNames.in:
Add the new initial-letter property.

* css/CSSValueKeywords.in:
Add the new initial-letter line-box-contain value.

* css/StyleResolver.cpp:
(WebCore::StyleResolver::applyProperty):
Map initial-letter into the RenderStyle.

* platform/graphics/FontMetrics.h:
(WebCore::FontMetrics::hasCapHeight):
(WebCore::FontMetrics::floatCapHeight):
(WebCore::FontMetrics::setCapHeight):
(WebCore::FontMetrics::capHeight):
* platform/graphics/ios/SimpleFontDataIOS.mm:
(WebCore::SimpleFontData::platformInit):
* platform/graphics/mac/SimpleFontDataMac.mm:
(WebCore::SimpleFontData::platformInit):
Add support for cap-height to the font system. iOS and Mac have been patched.
Other platforms will need to add support for cap-height to get this feature.
hasCapHeight() will return false for unsupported platforms for graceful
degradation.

* rendering/RenderBlock.cpp:
(WebCore::styleForFirstLetter):
Modified to check for initialLetterDrop/Height and to adjust the style
accordingly (e.g., to apply float when needed).

* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::computeLogicalLocationForFloat):
Code to adjust the float's position and margin to do cap-height alignment
and sunken letters.

* rendering/RenderBlockFlow.h:
Remove the const from computeLogicalLocationForFloat, since the margin of the
float can now be modified dynamically for sunken first-letters.

* rendering/RootInlineBox.cpp:
(WebCore::RootInlineBox::ascentAndDescentForBox):
Add support for initial-letter line-box-contain value.

* rendering/RootInlineBox.h:
Add the includeInitialLetterForBox method to support the new line-box-contain value.

* rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::changeRequiresLayout):
* rendering/style/RenderStyle.h:
* rendering/style/StyleRareNonInheritedData.cpp:
(WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
(WebCore::StyleRareNonInheritedData::operator==):
* rendering/style/StyleRareNonInheritedData.h:
Normal maintenance stuff for addition of a new CSS property (making sure it is diffed
properly for layout changes and copied on assignment, etc.)

LayoutTests:


* fast/css-generated-content/initial-letter-basic.html: Added.
* fast/css-generated-content/initial-letter-border-padding.html: Added.
* fast/css-generated-content/initial-letter-descender.html: Added.
* fast/css-generated-content/initial-letter-raised.html: Added.
* fast/css-generated-content/initial-letter-sunken.html: Added.
* platform/mac/fast/css-generated-content/initial-letter-basic-expected.png: Added.
* platform/mac/fast/css-generated-content/initial-letter-basic-expected.txt: Added.
* platform/mac/fast/css-generated-content/initial-letter-border-padding-expected.png: Added.
* platform/mac/fast/css-generated-content/initial-letter-border-padding-expected.txt: Added.
* platform/mac/fast/css-generated-content/initial-letter-descender-expected.png: Added.
* platform/mac/fast/css-generated-content/initial-letter-descender-expected.txt: Added.
* platform/mac/fast/css-generated-content/initial-letter-raised-expected.png: Added.
* platform/mac/fast/css-generated-content/initial-letter-raised-expected.txt: Added.
* platform/mac/fast/css-generated-content/initial-letter-sunken-expected.png: Added.
* platform/mac/fast/css-generated-content/initial-letter-sunken-expected.txt: Added.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@173217 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Win] Improper release of unretained AVCFAssetResourceLoaderRef
https://bugs.webkit.org/show_bug.cgi?id=136493
<rdar://problem/18112559>

Reviewed by Eric Carlson.

Don't bother wrapping the return value of AVCFURLAssetGetResourceLoader in a
RetainPtr. We don't hold onto this value or want to control its lifetime; we just
want to pass it to the AVCFAssetResourceLoaderSetCallbacks function.

Use of the RetainPtr created a double-release and crash.

* platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
(WebCore::AVFWrapper::createAssetForURL): 


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@173218 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Win] Revise test environment for Windows build.
https://bugs.webkit.org/show_bug.cgi?id=136486

Reviewed by David Kilzer.

The various calls to get the Safari path really only have
meaning on the Mac. Other ports get access to the build
and test environment separately, so remove the various
checks in the Safari-specific code to simplify things.

Remove some 64-bit hacks used on Windows now that the
various tools know how to find the 64-bit runtime environment.

* Scripts/run-javascriptcore-tests: 
* Scripts/webkitdirs.pm:
(safariPathFromSafariBundle): Revise to expect Mac.
(installedSafariPath): Ditto.
(safariPath): Ditto.
(appleApplicationSupportPath): Get rid of 64-bit Windows hack.
(setPathForRunningWebKitApp): Get rid of unused SafariPath
argument for Windows runs.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@173219 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Get rid of DOMImplementationFront
https://bugs.webkit.org/show_bug.cgi?id=136495

Reviewed by Andreas Kling.

DOMImplementationFront was used in a workaround for a GCC bug, and since we're building with clang
on Mac this is no longer an issue.

* WebCore.xcodeproj/project.pbxproj:
* bindings/objc/DOMImplementationFront.cpp: Removed.
* bindings/objc/DOMImplementationFront.h: Removed.
Remove files.

* bindings/objc/DOMUtility.mm:
(JSC::createDOMWrapper):
Remove call to implementationFront.

* bindings/scripts/CodeGeneratorObjC.pm:
(GetImplClassName):
Remove DOMImplementation special case

(AddIncludesForType):
Ditto.

(GenerateHeader):
Use the class header name in the #import in the internal header.

(GenerateImplementation):
Remove DOMImplementation special case.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@173220 268f45cc-cd09-0410-ab3c-d52691b4dbfc