Cleanup: Move loading complete function into callback, rather than global.
https://bugs.webkit.org/show_bug.cgi?id=112167

Reviewed by Dirk Pranke.

Stop calling global functions, pass in proper handler to Loader
constructor. Note that the callback is optional, as tests, and
some potential dashboards, do not need one.

* TestResultServer/static-dashboards/dashboard_base.js:
* TestResultServer/static-dashboards/loader.js:
(.):
* TestResultServer/static-dashboards/loader_unittests.js:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@145586 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Add more Checked<> tests
https://bugs.webkit.org/show_bug.cgi?id=112190

Reviewed by Geoffrey Garen.

Source/WTF:

Export the CheckedState enum type

* wtf/CheckedArithmetic.h:

Tools:

Tests!

* TestWebKitAPI/Tests/WTF/CheckedArithmeticOperations.cpp:
(TestWebKitAPI):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@145587 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Mac: Incorrect rendering of <audio> controls
https://bugs.webkit.org/show_bug.cgi?id=110913

Patch by Christian Biesinger <cbiesinger@chromium.org> on 2013-03-12
Reviewed by Tony Chang.

Source/WebCore:

Covered by existing tests under media/.

* css/mediaControls.css:
(audio::-webkit-media-controls-timeline-container, video::-webkit-media-controls-timeline-container):
(audio::-webkit-media-controls-timeline, video::-webkit-media-controls-timeline):
The timeline container and the timeline need min-width: 0 so that they can shrink if needed.
* css/mediaControlsQuickTime.css:
(audio::-webkit-media-controls-timeline-container, video::-webkit-media-controls-timeline-container):
(audio::-webkit-media-controls-current-time-display, video::-webkit-media-controls-current-time-display):
(audio::-webkit-media-controls-time-remaining-display, video::-webkit-media-controls-time-remaining-display):
The timeline container also needs flex-start to ensure that it never overlaps
the play/rewind buttons. The current-time and remaining-time displays need min-width: 0 so that the hack
in RenderMediaControls.cpp works correctly - otherwise, RenderFlexibleBox tries to use the preferred width
of the time displays, which is wrong when they try to hide themselves.

LayoutTests:

* platform/mac/media/audio-controls-rendering-expected.txt:
* platform/mac/media/controls-after-reload-expected.txt:
* platform/mac/media/controls-strict-expected.txt:
* platform/mac/media/controls-styling-strict-expected.txt:
* platform/mac/media/controls-without-preload-expected.txt:
* platform/mac/media/video-controls-rendering-expected.txt:
* platform/mac/media/video-display-toggle-expected.txt:
* platform/mac/media/video-no-audio-expected.txt:
* platform/mac/media/video-playing-and-pause-expected.txt:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@145588 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Chromium] Remove WEBKIT_USING_V8 from the WebKit API
https://bugs.webkit.org/show_bug.cgi?id=112120

Reviewed by Tony Chang.

Chromium always uses V8. This macro has outlived it's usefulness. It's
now just noise.

* README:
* public/WebArrayBuffer.h:
(WebArrayBuffer):
* public/WebArrayBufferView.h:
(WebArrayBufferView):
* public/WebBindings.h:
(WebBindings):
* public/WebBlob.h:
(WebBlob):
* public/WebFrame.h:
(WebFrame):
* public/WebFrameClient.h:
* public/WebSerializedScriptValue.h:
(WebSerializedScriptValue):
* src/WebArrayBuffer.cpp:
(WebKit::WebArrayBuffer::createFromV8Value):
* src/WebArrayBufferView.cpp:
(WebKit::WebArrayBufferView::createFromV8Value):
* src/WebBindings.cpp:
(WebKit::WebBindings::toV8Value):
* src/WebBlob.cpp:
(WebKit::WebBlob::toV8Value):
* src/WebFrameImpl.cpp:
(WebKit::WebFrame::frameForContext):
* src/WebFrameImpl.h:
(WebFrameImpl):
* src/WebSerializedScriptValue.cpp:
(WebKit::WebSerializedScriptValue::serialize):
(WebKit::WebSerializedScriptValue::deserialize):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@145589 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Remove stray .gitmodules file
https://bugs.webkit.org/show_bug.cgi?id=112186

Reviewed by Tony Chang.

Apparently I imported this together with the jquery tests by mistake.

* jquery/resources/src/sizzle/.gitmodules: Removed.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@145591 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Moved RunLoopTimer and SchedulePair to WTF
https://bugs.webkit.org/show_bug.cgi?id=112171

Reviewed by Oliver Hunt.

This will allow us to use timers in lower level primitives without
duplicating all the code.

../WebCore: 

* WebCore.exp.in:
* WebCore.xcodeproj/project.pbxproj:
* loader/DocumentLoader.h:
(WTF):
(WebCore):
(DocumentLoader):
* loader/MainResourceLoader.h:
* page/Page.h:
* platform/AutodrainedPool.h: Removed.
* platform/cf/RunLoopTimerCF.cpp: Removed.
* platform/cf/SchedulePair.cpp: Removed.
* platform/cf/SchedulePair.h: Removed.
* platform/mac/AutodrainedPool.mm: Removed.
* platform/mac/SchedulePairMac.mm: Removed.
* platform/network/NetworkingContext.h:
* platform/network/ResourceHandle.h:
(WTF):
(WebCore):
(ResourceHandle):
* platform/network/cf/FormDataStreamCFNet.cpp:
* platform/network/mac/ResourceHandleMac.mm:

../WebKit/mac: 

* WebCoreSupport/WebFrameNetworkingContext.h:
(WebFrameNetworkingContext):

../WebKit2: 

* WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.h:
(WebFrameNetworkingContext):

../WTF: 

* WTF.xcodeproj/project.pbxproj:
* wtf/AutodrainedPool.h: Copied from Source/WebCore/platform/AutodrainedPool.h.
(AutodrainedPool):
* wtf/AutodrainedPoolMac.mm: Copied from Source/WebCore/platform/mac/AutodrainedPool.mm.
* wtf/RunLoopTimer.h: Copied from Source/WebCore/platform/RunLoopTimer.h.
* wtf/RunLoopTimerCF.cpp: Copied from Source/WebCore/platform/cf/RunLoopTimerCF.cpp.
* wtf/SchedulePair.cpp: Copied from Source/WebCore/platform/cf/SchedulePair.cpp.
* wtf/SchedulePair.h: Copied from Source/WebCore/platform/cf/SchedulePair.h.
(SchedulePair):
* wtf/SchedulePairMac.mm: Copied from Source/WebCore/platform/mac/SchedulePairMac.mm.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@145592 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Add one more test expectation per bug 112176.

* platform/mac-wk2/TestExpectations:
* platform/mac/TestExpectations:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@145593 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Harden JSStringJoiner
https://bugs.webkit.org/show_bug.cgi?id=112093

Reviewed by Filip Pizlo.

Harden JSStringJoiner, make it use our CheckedArithmetic
class to simplify everything.

* runtime/JSStringJoiner.cpp:
(JSC::JSStringJoiner::build):
* runtime/JSStringJoiner.h:
(JSStringJoiner):
(JSC::JSStringJoiner::JSStringJoiner):
(JSC::JSStringJoiner::append):

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

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@145595 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Replace static_casts with to* helper functions.
https://bugs.webkit.org/show_bug.cgi?id=112164

Reviewed by Philip Rogers.

to* helper functions are preferred over static_cast calls since they
help to catch bad casts easily on the testing infrastructure.

Source/WebCore:

* css/ElementRuleCollector.cpp:
(WebCore::ElementRuleCollector::collectMatchingRulesForRegion):
* platform/gtk/PasteboardGtk.cpp:
(WebCore::getURLForImageNode):
(WebCore::Pasteboard::writeImage):
* platform/gtk/RenderThemeGtk.cpp:
(WebCore::getMediaElementFromRenderObject):
* platform/qt/RenderThemeQtMobile.cpp:
(WebCore::RenderThemeQtMobile::checkMultiple):
* rendering/HitTestResult.cpp:
(WebCore::HitTestResult::title):
(WebCore::HitTestResult::absoluteImageURL):
(WebCore::HitTestResult::absolutePDFURL):
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::resize):
(WebCore::RenderLayer::hitTest):
* rendering/RenderMenuList.cpp:
(WebCore::RenderMenuList::valueChanged):
* rendering/RenderObject.cpp:
(WebCore::RenderObject::addPDFURLRect):
* rendering/RenderPart.cpp:
(WebCore::RenderPart::requiresAcceleratedCompositing):
* rendering/RenderRegion.cpp:
(WebCore::RenderRegion::checkRegionStyle):
* rendering/RenderTableCell.cpp:
(WebCore::RenderTableCell::computePreferredLogicalWidths):
* rendering/RenderTheme.cpp:
(WebCore::RenderTheme::isEnabled):
(WebCore::RenderTheme::isSpinUpButtonPartPressed):
(WebCore::RenderTheme::isHovered):
(WebCore::RenderTheme::isSpinUpButtonPartHovered):
(WebCore::RenderTheme::paintSliderTicks):
* rendering/RenderThemeWinCE.cpp:
(WebCore::mediaElementParent):
* rendering/RenderTreeAsText.cpp:
(WebCore::isEmptyOrUnstyledAppleStyleSpan):
(WebCore::RenderTreeAsText::writeRenderObject):
(WebCore::writeRenderRegionList):
* rendering/svg/SVGRenderTreeAsText.cpp:
(WebCore::writeSVGResourceContainer):

Source/WebKit/win:

* DOMHTMLClasses.cpp:
(DOMHTMLElement::idName):
(DOMHTMLElement::innerText):
(DOMHTMLElement::setInnerText):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@145596 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed.  Rolled Chromium DEPS to r187660.  Requested by
"Adam Barth" <abarth@webkit.org> via sheriffbot.

Patch by Sheriff Bot <webkit.review.bot@gmail.com> on 2013-03-12

* DEPS:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@145597 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Replace static_casts for SVG transformable and locatable elements
https://bugs.webkit.org/show_bug.cgi?id=111651

Reviewed by Abhishek Arya.

toSVGStyledTransformableElement and toSVGStyledLocatableElement are preferred over
static_casts because bad casts can be caught on our testing infrastructure. This patch
replaces all static_casts for SVGStyledTransformableElement and SVGStyledLocatableElement
with toSVGStyledTransformableElement and toSVGStyledLocatableElement, respectively.

No new tests as this is covered with existing tests.

* rendering/svg/RenderSVGResourceClipper.cpp:
(WebCore::RenderSVGResourceClipper::pathOnlyClipping):
* rendering/svg/RenderSVGResourceContainer.cpp:
(WebCore::RenderSVGResourceContainer::transformOnNonScalingStroke):
* rendering/svg/RenderSVGShape.cpp:
(WebCore::RenderSVGShape::updateShapeFromElement):
(WebCore::RenderSVGShape::layout):
(WebCore::RenderSVGShape::nonScalingStrokeTransform):
(WebCore::RenderSVGShape::shouldGenerateMarkerPositions):
* rendering/svg/RenderSVGTransformableContainer.cpp:
(WebCore::RenderSVGTransformableContainer::calculateLocalTransform):
* svg/SVGAnimatedLength.cpp:
(WebCore::SVGAnimatedLengthAnimator::calculateDistance):

    This was an unnecessary cast and has been removed.

* svg/SVGElement.cpp:
(WebCore::SVGElement::getBoundingBox):
* svg/SVGLocatable.cpp:
(WebCore::SVGLocatable::getTransformToElement):
* svg/SVGStyledLocatableElement.h:
(WebCore):
(WebCore::toSVGStyledLocatableElement):
* svg/SVGStyledTransformableElement.h:
(WebCore):
(WebCore::toSVGStyledTransformableElement):

    It makes the code cleaner to pass Node* in here, rather than converting the Node*
    to an SVGElement* before calling this function. The same was not necessary for
    SVGStyledLocatable.

* svg/SVGSVGElement.h:
(WebCore):
(WebCore::toSVGSVGElement):

    This code has been cleaned up. During the review of this patch, a similar cleanup
    was done in toSVGStyledTransformableElement.

* svg/SVGUseElement.cpp:
(WebCore::SVGUseElement::toClipPath):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@145598 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Add a --build-directory argument to delete-stale-build-files
https://bugs.webkit.org/show_bug.cgi?id=112198

Reviewed by Ryosuke Niwa.

* BuildSlaveSupport/delete-stale-build-files:
(main): Add --build-directory argument.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@145600 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Add a single character cache to WidthCache
https://bugs.webkit.org/show_bug.cgi?id=112084

Patch by Benjamin Poulain <bpoulain@apple.com> on 2013-03-12
Reviewed by Geoffrey Garen.

More than half of the values stored in WidthCache are values
for a single character.

Previously, we were creating a new SmallStringKey for each one of
them, causing a lot of extra memory operations even for the simple
cases.

This patch adds a second map, m_singleCharMap, to simplify the
computation for the common case of a single char TextRun.

* platform/graphics/WidthCache.h:
(WebCore::WidthCache::clear):
(WidthCache):
(WebCore::WidthCache::addSlowCase):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@145601 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Build fix for r145592 - update gyp files to refer to new file locations.

Source/WebCore:

* WebCore.gypi:

Source/WTF:

* WTF.gypi:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@145603 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Try to fix the Windows build.

Not reviewed.

* JavaScriptCore.vcxproj/JavaScriptCoreExportGenerator/JavaScriptCoreExports.def.in:
Export a thing.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@145606 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed, disabling tests for Win EWS.

win-ews obviously cannot keep up with running tests, it's >300 behind.
Probably doesn't help that its (likely) running tests serially.

* Scripts/webkitpy/tool/commands/earlywarningsystem.py:
(WinEWS):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@145607 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[css exclusions] Move ExclusionShapeInsideInfo into RenderBlockRareData
https://bugs.webkit.org/show_bug.cgi?id=110995

Reviewed by Julien Chaffraix.

This patch moves ExclusionShapeInsideInfo into the RenderBlockRareData struct,
which enables us to move away from the global ExclusionShapeInsideInfo map.
Some additional refactoring was done to remove ExclusionShapeInsideInfo's
dependency on InlineIterator, which depended on RenderBlock. This work required
adding a new LineSegmentIterator struct.

Refactoring, no new tests.

* rendering/ExclusionShapeInsideInfo.cpp:
(WebCore):
(WebCore::LineSegmentRange::LineSegmentRange): Moving the InlineIterator
constructor to the .cpp file, as InlineIterator is now forward declared in
the .h file.
(WebCore::ExclusionShapeInsideInfo::isEnabledFor): Moving isEnabledFor to
the .cpp file, as RenderBlock is now forward declared in the .h file.
* rendering/ExclusionShapeInsideInfo.h:
(WebCore):
(LineSegmentIterator): A simple struct for containing segment positions for
layout.
(WebCore::LineSegmentIterator::LineSegmentIterator): Constructor.
(LineSegmentRange): Transitioning to store LineSegmentIterator.
(WebCore::LineSegmentRange::LineSegmentRange): Ditto.
(ExclusionShapeInsideInfo):
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::willBeDestroyed): Destroying a block will now destroy
its ExclusionShapeInsideInfo, so there is no need to remove it from the map.
(WebCore):
(WebCore::RenderBlock::updateExclusionShapeInsideInfoAfterStyleChange): Use
the RenderBlockRareData struct rather than the global map.
* rendering/RenderBlock.h:
(WebCore):
(WebCore::RenderBlock::ensureExclusionShapeInsideInfo): Ensure an info struct
is present if the shape-inside style is set.
(WebCore::RenderBlock::exclusionShapeInsideInfo): Look up the info struct for
the current block.
(WebCore::RenderBlock::setExclusionShapeInsideInfo): Update the info struct
for the current block.
(RenderBlockRareData): Add the ExclusionShapeInsideInfo member. Move the struct
declaration to be public, so that the OwnPtr reference can properly delete it.
* rendering/RenderBlockLineLayout.cpp:
(WebCore::constructBidiRunsForLine): Construct the appropriate offsets during
layout based on the stored LineSegmentIterators.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@145610 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Remove TextIterator.cpp's isAllCollapsibleWhitespace
https://bugs.webkit.org/show_bug.cgi?id=112200

Reviewed by Ryosuke Niwa.

Remove isAllCollapsibleWhitespace since nothing uses it.

* editing/TextIterator.cpp: Remove isAllCollapsibleWhitespace.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@145613 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Try to fix the Windows build.

Not reviewed.

* JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreExports.def:


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