Turn PageLoad tests into simple performancetests, commit #1 
https://bugs.webkit.org/show_bug.cgi?id=99899

Reviewed by Ryosuke Niwa.

We cannot provide an elegant way to measure the memory consumption of the PageLoad tests, but we can turn them into simple
performance tests and measure their memory footprint and performance that way. This change moves and renames the related files
to their new location and adds html/js wrappers for them.

This is the #1 commit of the whole patch.

* PageLoad/svg/files/az-lizard_benji_park_01.svg: Removed.
* PageLoad/svg/files/bamboo_01.svg: Removed.
* SVG/AzLizardBenjiPark.html: Added.
* SVG/Bamboo.html: Added.
* SVG/resources: Added.
* SVG/resources/AzLizardBenjiPark.svg: Copied from PerformanceTests/PageLoad/svg/files/az-lizard_benji_park_01.svg.
* SVG/resources/Bamboo.svg: Copied from PerformanceTests/PageLoad/svg/files/bamboo_01.svg.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@132379 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Make the Inspector WKView/WebView become the first responder when bringToFront is called.

https://bugs.webkit.org/show_bug.cgi?id=100209

Reviewed by Joseph Pecoraro.

Source/WebKit/mac:

* WebCoreSupport/WebInspectorClient.mm:
(WebInspectorFrontendClient::bringToFront): Make the Inspector WebView become the first responder.

Source/WebKit2:

* UIProcess/mac/WebInspectorProxyMac.mm:
(WebKit::WebInspectorProxy::platformBringToFront): Make the Inspector WKView become the first responder.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@132380 268f45cc-cd09-0410-ab3c-d52691b4dbfc
AX: WebKit exposes abstract ARIA role range as AXSlider; should be generic AXGroup
https://bugs.webkit.org/show_bug.cgi?id=100204

Reviewed by Beth Dakin.

Source/WebCore: 

Remove the "range" role as a valid ARIA role.

Test: platform/mac/accessibility/aria-slider-value.html

* accessibility/AccessibilityObject.cpp:
(WebCore::createARIARoleMap):

LayoutTests: 

Remove the aria-range.html test because the same functionality is covered in aria-slider.html
Rename aria-range-value to aria-slider-value and use the non-abstract role slider instead (and 
move that to the general accessibility platform).

* accessibility/aria-slider-value-expected.txt: Copied from LayoutTests/platform/mac/accessibility/aria-range-value-expected.txt.
* accessibility/aria-slider-value.html: Copied from LayoutTests/platform/mac/accessibility/aria-range-value.html.
* platform/mac/accessibility/aria-range-expected.txt: Removed.
* platform/mac/accessibility/aria-range-value-expected.txt: Removed.
* platform/mac/accessibility/aria-range-value.html: Removed.
* platform/mac/accessibility/aria-range.html: Removed.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@132381 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed GTK gardening.

Rebaselining two Video Track tests after r132349.

* platform/gtk/media/track/track-cue-rendering-horizontal-expected.txt:
* platform/gtk/media/track/track-cue-rendering-vertical-expected.txt:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@132382 268f45cc-cd09-0410-ab3c-d52691b4dbfc
        Fixed Windows path for SharedWorkerStrategy.h - it's in workers/, not platform/.

        * WebCore.vcproj/WebCore.vcproj:



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@132383 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Honor image orientation in GraphicsContextSkia
https://bugs.webkit.org/show_bug.cgi?id=100179

Reviewed by Stephen White.

Also fix a bug in ImageOrientation.h: Some of the values were
switched. They now match the description in the exif spec at
http://www.exif.org/Exif2-2.PDF page 18, and the notes at
http://www.sno.phy.queensu.ca/~phil/exiftool/TagNames/EXIF.html and
the picture at http://www.80sidea.com/archives/2316.

They showed up correctly in Safari because the orientation transform
was done after flipping Y. Let the flipping happen later. I verified
that flipping transformation order and fixing the exif enum cancelled
each other out, so this has no effect on the apple port.

Not hooked up yet, so no observable difference.

* platform/graphics/BitmapImage.h:
* platform/graphics/ImageOrientation.h:
(WebCore::ImageOrientation::usesWidthAsHeight):
(WebCore::ImageOrientation::fromEXIFValue):
* platform/graphics/cg/GraphicsContextCG.cpp:
(WebCore::GraphicsContext::drawNativeImage):
* platform/graphics/skia/ImageSkia.cpp:
(WebCore::paintSkBitmap):
(WebCore::BitmapImage::draw):
(WebCore):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@132384 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Create skia_webkit.gyp to improve rebaselining.
https://bugs.webkit.org/show_bug.cgi?id=99759

Patch by Ben Wagner <bungeman@chromium.org> on 2012-10-24
Reviewed by Dirk Pranke.

This allows for code suppressions to be lifted atomically with new baselines.

* skia_webkit.gyp: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@132385 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Add per destination ID message receivers
https://bugs.webkit.org/show_bug.cgi?id=100276

Reviewed by Andreas Kling.

Extend MessageReceiverMap to handle adding message receivers for a given destinationID/receiver name pair.
Use this to make every WebPage object a message receiver.

* Platform/CoreIPC/MessageReceiverMap.cpp:
(CoreIPC::MessageReceiverMap::addMessageReceiver):
(CoreIPC):
(CoreIPC::MessageReceiverMap::removeMessageReceiver):
(CoreIPC::MessageReceiverMap::invalidate):
(CoreIPC::MessageReceiverMap::dispatchMessage):
(CoreIPC::MessageReceiverMap::dispatchSyncMessage):
* Platform/CoreIPC/MessageReceiverMap.h:
(MessageReceiverMap):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::WebPage):
(WebKit::WebPage::~WebPage):
* WebProcess/WebPage/WebPage.h:
(WebPage):
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::addMessageReceiver):
(WebKit):
(WebKit::WebProcess::removeMessageReceiver):
(WebKit::WebProcess::didReceiveSyncMessage):
(WebKit::WebProcess::didReceiveMessage):
* WebProcess/WebProcess.h:
(WebProcess):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@132386 268f45cc-cd09-0410-ab3c-d52691b4dbfc
BlackBerry fix for webgl-depth-texture.html
https://bugs.webkit.org/show_bug.cgi?id=100258

Patch by Jonathan Feldstein <jfeldstein@rim.com> on 2012-10-24
Reviewed by Yong Li.

Removed a platform specific define that is unnecessary.

* platform/graphics/GraphicsContext3D.cpp:
(WebCore::GraphicsContext3D::computeFormatAndTypeParameters):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@132387 268f45cc-cd09-0410-ab3c-d52691b4dbfc
image-set doesn't round-trip properly with cssText
https://bugs.webkit.org/show_bug.cgi?id=99725

Patch by Rick Byers <rbyers@chromium.org> on 2012-10-24
Reviewed by Beth Dakin.

Source/WebCore:

Fix serialization of -webkit-image-set rules to use the same format as
is used for parsing.

Test: fast/css/image-set-setting.html

* css/CSSImageSetValue.cpp:
(WebCore::CSSImageSetValue::customCssText):
* css/CSSValueList.h:
(WebCore::CSSValueList::item): Add const overload

LayoutTests:

Update image-set-setting test to expect the css text to round-trip properly.

* fast/css/image-set-setting-expected.txt:
* fast/css/script-tests/image-set-setting.js:
(testComputedStyle):
(testImageSetRule):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@132388 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Qt-on-Mac] GraphicsSurfaces should not create a global IOSurface handle
https://bugs.webkit.org/show_bug.cgi?id=89885

Reviewed by Kenneth Rohde Christiansen.

Source/WebCore:

Use mach_port instead of global tokens for IOSurfaces.
Global IOSurfaces are accessible from other processes using their handle, while mach_ports
can only be shared directly via IPC.

Tested by existing WebGL tests.

* platform/graphics/surfaces/GraphicsSurfaceToken.h:
(GraphicsSurfaceToken):
* platform/graphics/surfaces/mac/GraphicsSurfaceMac.cpp:
(WebCore::GraphicsSurfacePrivate::GraphicsSurfacePrivate):
(WebCore::GraphicsSurfacePrivate::~GraphicsSurfacePrivate):

Source/WebKit2:

Use mach_port instead of global tokens for IOSurfaces.
Global IOSurfaces are accessible from other processes, while mach_ports can only be shared
directly via IPC.

* Shared/CoordinatedGraphics/CoordinatedGraphicsArgumentCoders.cpp:
(CoreIPC::::encode):
(CoreIPC::::decode):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@132389 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[BlackBerry][Fullscreen] Roll out changes to fullscreen which rely on viewport size change
https://bugs.webkit.org/show_bug.cgi?id=100259

Reviewed by Rob Buis.
Patch by Jacky Jiang <zhajiang@rim.com>.

PR: 219666
Roll out r130392 and r129909.
The patches rely on the viewport size change of the client side to
update the scale and scroll position of the video. However, some client
sides don't need or wish to resize the WebKit viewport at all.

* Api/WebPage.cpp:
(BlackBerry::WebKit::WebPagePrivate::WebPagePrivate):
(BlackBerry::WebKit::WebPagePrivate::setViewportSize):
(BlackBerry::WebKit::WebPagePrivate::enterFullScreenForElement):
(BlackBerry::WebKit::WebPagePrivate::exitFullScreenForElement):
* Api/WebPage_p.h:
(WebPagePrivate):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@132390 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[BlackBerry][Fullscreen] Roll out changes to fullscreen which rely on viewport size change [Part II]
https://bugs.webkit.org/show_bug.cgi?id=100259

Reviewed by Rob Buis.
Patch by Jacky Jiang <zhajiang@rim.com>.

PR: 219666
Revert "[BlackBerry] [FullScreen] entering/leaving fullscreen results in temporary glitches on the screen"
This rolls out r128772.
The patches relies on the viewport size change of the client side to
resume the screen and backing store updates. However, some client
sides don't need or wish to resize the WebKit viewport at all which
will result in upexpected screen and backing store suspensions.

* Api/WebPage.cpp:
(BlackBerry::WebKit::WebPagePrivate::WebPagePrivate):
(BlackBerry::WebKit::WebPagePrivate::setViewportSize):
* Api/WebPage_p.h:
(WebPagePrivate):
* WebCoreSupport/ChromeClientBlackBerry.cpp:
(WebCore::ChromeClientBlackBerry::enterFullScreenForElement):
(WebCore::ChromeClientBlackBerry::exitFullScreenForElement):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@132391 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Coordinated Graphics: Enable threaded/IPC animations
https://bugs.webkit.org/show_bug.cgi?id=93146

Reviewed by Caio Marcelo de Oliveira Filho.

In some cases there are pending changes in the layers, but no actual changes to the frame.
In that case we should unlock the animations.

* WebProcess/WebPage/CoordinatedGraphics/LayerTreeCoordinator.cpp:
(WebKit::LayerTreeCoordinator::flushPendingLayerChanges):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@132392 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Update mozilla's CheckedInt.h to the latest version
https://bugs.webkit.org/show_bug.cgi?id=100177

Reviewed by Kenneth Russell.

* html/canvas/CheckedInt.h: Sync with mozilla's copy with minumum modifications.
(detail):
(IsSupportedPass2):
(IsSupported):
(UnsignedType):
(IsSigned):
(TwiceBiggerType):
(PositionOfSignBit):
(MinValue):
(MaxValue):
(WebCore::detail::HasSignBit):
(WebCore::detail::BinaryComplement):
(WebCore::detail::IsInRange):
(WebCore::detail::IsAddValid):
(WebCore::detail::IsSubValid):
(WebCore::detail::IsMulValid):
(WebCore::detail::IsDivValid):
(WebCore::detail::OppositeIfSignedImpl::run):
(WebCore::detail::OppositeIfSigned):
(WebCore):
(CheckedInt):
(WebCore::CheckedInt::CheckedInt):
(WebCore::CheckedInt::value):
(WebCore::CheckedInt::isValid):
(WebCore::CheckedInt::operator -):
(WebCore::CheckedInt::operator ==):
(WebCore::CheckedInt::operator++):
(WebCore::CheckedInt::operator--):
(CastToCheckedIntImpl):
(WebCore::detail::CastToCheckedIntImpl::run):
(WebCore::castToCheckedInt):
(WebCore::operator ==):
* html/canvas/DataView.cpp: change valid() to isValid().
(WebCore::DataView::create):
* html/canvas/WebGLBuffer.cpp: Ditto.
(WebCore::WebGLBuffer::associateBufferDataImpl):
(WebCore::WebGLBuffer::associateBufferSubDataImpl):
* html/canvas/WebGLRenderingContext.cpp: Ditto.
(WebCore):
(WebCore::WebGLRenderingContext::drawArrays):
* platform/graphics/GraphicsContext3D.cpp: Ditto.
(WebCore::GraphicsContext3D::computeImageSizeInBytes):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@132393 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Fix CALayer hiearchy when combining tiling with preserve-3d
https://bugs.webkit.org/show_bug.cgi?id=100205

Reviewed by Dean Jackson.

Source/WebCore:

When an element has "transform-style: preserve-3d", its GraphicsLayerCA has a
m_structuralLayer which is a CATransformLayer. The primary CALayer which contains rendered
content becomes a sublayer of the CATransformLayer. If the element has backface-visibility:hidden,
it is the primary layer that is set to be single-sided.

In r131940 we started to use TileCaches in place of CATiledLayer. TileCaches work via
"customSublayers" returned from the PlatformCALayer, where the custom sublayer is
the tile cache container layer. However, the custom sublayers were being added as
children of the structural (CATransformLayer) layer, not of the primary (CALayer) layer,
thus they were not affected by the doubleSided property.

This change cleans up the confusing code in GraphicsLayerCA::updateSublayerList()
by maintaining two vectors of PlatformCALayers, one for sublayers of the structural
layer, and one for sublayers of the primary layer. It adds custom sublayers to
the latter list, so now the tile cache container layer becomes a sublayer of
the primary layer, so is affected by that layer's doubleSided property.

Test: compositing/tiling/backface-preserve-3d-tiled.html

* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::updateSublayerList):

LayoutTests:

Pixel test that tests backface-visibility on a tile cache layer. Mark the test as
failing on Chromium.

* compositing/tiling/backface-preserve-3d-tiled-expected.png: Added.
* compositing/tiling/backface-preserve-3d-tiled-expected.txt: Added.
* compositing/tiling/backface-preserve-3d-tiled.html: Added.
* platform/chromium/TestExpectations:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@132394 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Setting width of a flexitem causes the adjacent flex item to be displayed poorly.
https://bugs.webkit.org/show_bug.cgi?id=99925

Reviewed by Ojan Vafai.

Source/WebCore:

Make sure that we always repaint when moving a child. This is similar to what RenderDeprecatedFlexibleBox does.

Test: css3/flexbox/repaint-during-resize-no-flex.html

* rendering/RenderFlexibleBox.cpp:
(WebCore::RenderFlexibleBox::setFlowAwareLocationForChild): Move logic for repaining into the helper method
for setting the location of a child.
(WebCore::RenderFlexibleBox::layoutColumnReverse): Remove code for repaint since it's now in setFlowAwareLocationForChild.
(WebCore::RenderFlexibleBox::adjustAlignmentForChild): Remove code for repaint since it's now in setFlowAwareLocationForChild.

LayoutTests:

Add a repaint test.  The render tree should be cross platform, but due to
slight color differences in the grey overlay, the png can't be shared.

* css3/flexbox/repaint-during-resize-no-flex-expected.txt: Added.
* css3/flexbox/repaint-during-resize-no-flex.html: Added.
* platform/chromium-linux/css3/flexbox/repaint-during-resize-no-flex-expected.png: Added.
* platform/chromium/TestExpectations:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@132395 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Add a strategy for loader customization.
https://bugs.webkit.org/show_bug.cgi?id=100278

Reviewed by Alexey Proskuryakov.

Source/WebCore:

It's empty for now and does nothing, just like the goggles.

* WebCore.gypi:
* WebCore.vcproj/WebCore.vcproj:
* WebCore.xcodeproj/project.pbxproj:
* platform/PlatformStrategies.h:
(WebCore::PlatformStrategies::loaderStrategy):
(PlatformStrategies):
(WebCore::PlatformStrategies::PlatformStrategies):

Source/WebKit/efl:

* WebCoreSupport/PlatformStrategiesEfl.cpp:
(PlatformStrategiesEfl::createLoaderStrategy):
* WebCoreSupport/PlatformStrategiesEfl.h:
(PlatformStrategiesEfl):

Source/WebKit/gtk:

* WebCoreSupport/PlatformStrategiesGtk.cpp:
(PlatformStrategiesGtk::createLoaderStrategy):
* WebCoreSupport/PlatformStrategiesGtk.h:
(PlatformStrategiesGtk):

Source/WebKit/mac:

* WebCoreSupport/WebPlatformStrategies.h:
(WebPlatformStrategies):
* WebCoreSupport/WebPlatformStrategies.mm:
(WebPlatformStrategies::createLoaderStrategy):

Source/WebKit/qt:

* WebCoreSupport/PlatformStrategiesQt.cpp:
(PlatformStrategiesQt::createLoaderStrategy):
* WebCoreSupport/PlatformStrategiesQt.h:
(PlatformStrategiesQt):

Source/WebKit/win:

* WebCoreSupport/WebPlatformStrategies.cpp:
(WebPlatformStrategies::createLoaderStrategy):
* WebCoreSupport/WebPlatformStrategies.h:
(WebPlatformStrategies):

Source/WebKit/wince:

* WebCoreSupport/PlatformStrategiesWinCE.cpp:
(PlatformStrategiesWinCE::createLoaderStrategy):
* WebCoreSupport/PlatformStrategiesWinCE.h:
(PlatformStrategiesWinCE):

Source/WebKit2:

* WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
(WebKit::WebPlatformStrategies::createLoaderStrategy):
* WebProcess/WebCoreSupport/WebPlatformStrategies.h:
(WebPlatformStrategies):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@132396 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[V8] ActiveDOMObjectEpilogueVisitor is unnecessary and can be deleted
https://bugs.webkit.org/show_bug.cgi?id=100208

Reviewed by Eric Seidel.

Rather than clearing and re-establishing the weak callback for
ActiveDOMObjects during every GC, this patch puts all the
ActiveDOMObjects with pending activity into an object group with a live
object, causing them not to be garbage collected.

In addition to simplifying this code, this patch makes the patch in
https://bugs.webkit.org/show_bug.cgi?id=100175 much easier because
V8GCController no longer needs to know how to configure the weak
callbacks for these objects.

* bindings/v8/V8GCController.cpp:
(WebCore::ActiveDOMObjectPrologueVisitor::ActiveDOMObjectPrologueVisitor):
(ActiveDOMObjectPrologueVisitor):
(WebCore::ActiveDOMObjectPrologueVisitor::visitDOMWrapper):
(WebCore::V8GCController::majorGCPrologue):
(WebCore::V8GCController::majorGCEpilogue):
* bindings/v8/V8PerIsolateData.cpp:
(WebCore::V8PerIsolateData::V8PerIsolateData):
* bindings/v8/V8PerIsolateData.h:
(WebCore::V8PerIsolateData::liveRoot):
(V8PerIsolateData):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@132397 268f45cc-cd09-0410-ab3c-d52691b4dbfc
call to setNeedsLayout during RenderVideo::paintReplaced
https://bugs.webkit.org/show_bug.cgi?id=100265

Reviewed by Eric Carlson.

Removed unnecessary call and added new defensive guards to catch erroneous setNeedsLayout() calls
during paints earlier (so the offending calls are in the emitted stacktrace).

No new tests - new defensive checks are triggered by existing tests.

* page/FrameView.cpp:
(WebCore::FrameView::paintContents): forbid setNeedsLayout() during painting
* rendering/RenderObject.cpp:
(WebCore):
(WebCore::RenderObject::SetLayoutNeededForbiddenScope::SetLayoutNeededForbiddenScope):
(WebCore::RenderObject::SetLayoutNeededForbiddenScope::~SetLayoutNeededForbiddenScope):
* rendering/RenderObject.h:
(RenderObject):
(SetLayoutNeededForbiddenScope): added helper class for forbidding setNeedsLayout() in a scope.
* rendering/RenderVideo.cpp:
(WebCore::RenderVideo::paintReplaced): drop the offending & unnecessary call to updatePlayer().


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