Contents of directly composited image layers are sometimes missing
https://bugs.webkit.org/show_bug.cgi?id=131880

Reviewed by Tim Horton.

Source/WebCore:
RenderLayerBacking::updateGraphicsLayerGeometry() tested whether a
GraphicsLayer had a contents layer to determine whether to call code
that updates the contents rect. However, on Mac, we don't make a contents
layer until later at layer flush time. That would result in an empty
contentsRect being set.

Fix by renaming GraphicsLayer::hasContentsLayer() to usesContentsLayer(),
and on Mac consulting the m_contentsLayerPurpose flag, which is set
at the appropriate time.

Test: compositing/images/update-content-rect.html

* platform/ScrollView.cpp:
(WebCore::positionScrollbarLayer):
* platform/graphics/GraphicsLayer.cpp:
(WebCore::GraphicsLayer::getDebugBorderInfo):
* platform/graphics/GraphicsLayer.h:
(WebCore::GraphicsLayer::usesContentsLayer):
(WebCore::GraphicsLayer::hasContentsLayer): Deleted.
* platform/graphics/ca/GraphicsLayerCA.h:
(WebCore::GraphicsLayerCA::hasContentsLayer): Deleted.
* platform/graphics/texmap/GraphicsLayerTextureMapper.h:
(WebCore::GraphicsLayerTextureMapper::usesContentsLayer):
(WebCore::GraphicsLayerTextureMapper::hasContentsLayer): Deleted.
* platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::updateGraphicsLayerGeometry):
(WebCore::RenderLayerBacking::positionOverflowControlsLayers):
(WebCore::RenderLayerBacking::compositingLayerType):

LayoutTests:
Test that that shows the issue in Safari, but not in the test
runner because of timing issues, but maybe it will some day.

* compositing/images/update-content-rect-expected.html: Added.
* compositing/images/update-content-rect.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@167529 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Web Inspector: Move InspectorProfilerAgent to JavaScriptCore
https://bugs.webkit.org/show_bug.cgi?id=131673

Passes existing profiler and inspector tests.

Reviewed by Joseph Pecoraro.

* CMakeLists.txt:
* DerivedSources.make:

Source/JavaScriptCore:
* JavaScriptCore.vcxproj/JavaScriptCore.vcxproj:
* JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters:
* JavaScriptCore.xcodeproj/project.pbxproj:
* inspector/JSConsoleClient.cpp:
(Inspector::JSConsoleClient::JSConsoleClient):
(Inspector::JSConsoleClient::profile):
(Inspector::JSConsoleClient::profileEnd):
(Inspector::JSConsoleClient::count): Deleted.
* inspector/JSConsoleClient.h:
* inspector/JSGlobalObjectInspectorController.cpp:
(Inspector::JSGlobalObjectInspectorController::JSGlobalObjectInspectorController):
* inspector/agents/InspectorProfilerAgent.cpp: Added.
(Inspector::InspectorProfilerAgent::InspectorProfilerAgent):
(Inspector::InspectorProfilerAgent::~InspectorProfilerAgent):
(Inspector::InspectorProfilerAgent::addProfile):
(Inspector::InspectorProfilerAgent::createProfileHeader):
(Inspector::InspectorProfilerAgent::enable):
(Inspector::InspectorProfilerAgent::disable):
(Inspector::InspectorProfilerAgent::getUserInitiatedProfileName):
(Inspector::InspectorProfilerAgent::getProfileHeaders):
(Inspector::buildInspectorObject):
(Inspector::InspectorProfilerAgent::buildProfileInspectorObject):
(Inspector::InspectorProfilerAgent::getCPUProfile):
(Inspector::InspectorProfilerAgent::removeProfile):
(Inspector::InspectorProfilerAgent::reset):
(Inspector::InspectorProfilerAgent::didCreateFrontendAndBackend):
(Inspector::InspectorProfilerAgent::willDestroyFrontendAndBackend):
(Inspector::InspectorProfilerAgent::start):
(Inspector::InspectorProfilerAgent::stop):
(Inspector::InspectorProfilerAgent::setRecordingProfile):
(Inspector::InspectorProfilerAgent::startProfiling):
(Inspector::InspectorProfilerAgent::stopProfiling):
* inspector/agents/InspectorProfilerAgent.h: Added.
* inspector/agents/JSGlobalObjectProfilerAgent.cpp: Copied from Source/WebCore/inspector/ScriptProfile.idl.
(Inspector::JSGlobalObjectProfilerAgent::JSGlobalObjectProfilerAgent):
(Inspector::JSGlobalObjectProfilerAgent::profilingGlobalExecState):
* inspector/agents/JSGlobalObjectProfilerAgent.h: Copied from Source/WebCore/inspector/ScriptProfile.idl.
* inspector/protocol/Profiler.json: Renamed from Source/WebCore/inspector/protocol/Profiler.json.
* profiler/Profile.h:
* runtime/ConsoleClient.h:

Source/WebCore:
* ForwardingHeaders/inspector/agents/InspectorProfilerAgent.h: Added.
* WebCore.exp.in:
* WebCore.vcxproj/WebCore.vcxproj:
* WebCore.vcxproj/WebCore.vcxproj.filters:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/ScriptProfile.cpp: Removed.
* bindings/js/ScriptProfile.h:
* bindings/js/ScriptProfiler.cpp: Removed.
* bindings/js/ScriptProfiler.h: Removed.
* inspector/InspectorAllInOne.cpp:
* inspector/InspectorConsoleInstrumentation.h:
(WebCore::InspectorInstrumentation::profilerEnabled):
(WebCore::InspectorInstrumentation::startProfiling):
(WebCore::InspectorInstrumentation::stopProfiling):
* inspector/InspectorController.cpp:
(WebCore::InspectorController::InspectorController):
* inspector/InspectorController.h:
* inspector/InspectorInstrumentation.cpp:
(WebCore::InspectorInstrumentation::didCommitLoadImpl):
(WebCore::InspectorInstrumentation::startProfilingImpl):
(WebCore::InspectorInstrumentation::stopProfilingImpl):
(WebCore::InspectorInstrumentation::consoleTimeStampImpl): Deleted.
* inspector/InspectorInstrumentation.h:
* inspector/InspectorProfilerAgent.cpp: Removed.
* inspector/InspectorProfilerAgent.h: Removed.
* inspector/InspectorTimelineAgent.cpp:
(WebCore::startProfiling):
(WebCore::stopProfiling):
(WebCore::InspectorTimelineAgent::willCallFunction):
(WebCore::InspectorTimelineAgent::didCallFunction):
(WebCore::InspectorTimelineAgent::willEvaluateScript):
(WebCore::InspectorTimelineAgent::didEvaluateScript):
(WebCore::InspectorTimelineAgent::didDispatchXHRLoadEvent): Deleted.
* inspector/InstrumentingAgents.h:
(WebCore::InstrumentingAgents::inspectorProfilerAgent):
(WebCore::InstrumentingAgents::setInspectorProfilerAgent):
* inspector/PageDebuggerAgent.cpp:
(WebCore::PageDebuggerAgent::sourceMapURLForScript): Deleted.
* inspector/PageDebuggerAgent.h:
* inspector/PageProfilerAgent.cpp: Added.
(WebCore::PageProfilerAgent::PageProfilerAgent):
(WebCore::PageProfilerAgent::profilingGlobalExecState):
* inspector/PageProfilerAgent.h: Added.
(WebCore::PageProfilerAgent::~PageProfilerAgent):
* inspector/ScriptProfile.idl:
* inspector/TimelineRecordFactory.cpp:
(WebCore::TimelineRecordFactory::appendProfile):
* inspector/TimelineRecordFactory.h:
* inspector/WebConsoleAgent.cpp:
* inspector/WebProfilerAgent.cpp: Added.
(WebCore::WebProfilerAgent::WebProfilerAgent):
(WebCore::WebProfilerAgent::enable):
(WebCore::WebProfilerAgent::disable):
* inspector/WebProfilerAgent.h: Added.
(WebCore::WebProfilerAgent::~WebProfilerAgent):
* inspector/WorkerInspectorController.cpp:
(WebCore::WorkerInspectorController::WorkerInspectorController):
* inspector/WorkerProfilerAgent.cpp: Added.
(WebCore::WorkerProfilerAgent::WorkerProfilerAgent):
(WebCore::WorkerProfilerAgent::profilingGlobalExecState):
* inspector/WorkerProfilerAgent.h: Added.
(WebCore::WorkerProfilerAgent::~WorkerProfilerAgent):
* loader/appcache/ApplicationCacheGroup.cpp:
* page/PageConsole.cpp:
(WebCore::PageConsole::profile):
(WebCore::PageConsole::profileEnd):
(WebCore::PageConsole::time): Deleted.
(WebCore::PageConsole::timeEnd): Deleted.
(WebCore::PageConsole::timeStamp): Deleted.
* page/PageConsole.h:
* testing/Internals.cpp:
* testing/Internals.h:
* xml/XMLHttpRequest.cpp:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@167530 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Skip fast/dom/gc-attribute-node.html which is flaky
https://bugs.webkit.org/show_bug.cgi?id=131885

* platform/mac/TestExpectations:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@167531 268f45cc-cd09-0410-ab3c-d52691b4dbfc
REGRESSION(r164205): WebKit crash @StructureIDTable::get.
<https://webkit.org/b/130539>

Reviewed by Geoffrey Garen.

prepareOSREntry() prepares for OSR entry by first copying the local var
values from the baseline frame to a scartch buffer, which is then used
to fill in the locals in their new position in the DFG frame.  Unfortunately,
prepareOSREntry() was using the DFG frame's frameRegisterCount as the frame
size of the baseline frame.  As a result, some values of locals in the
baseline frame were not saved off, and the DFG frame may get initialized
with random content that happened to be in the uninitialized (and possibly
unallocated) portions of the scratch buffer.

The fix is to use OSREntryData::m_expectedValues.numberOfLocals() as the
number of locals in the baseline frame that we want to copy to the scratch
buffer.

Note: osrEntryThunkGenerator() is expecting the DFG frameRegisterCount
at offset 0 in the scratch buffer.  So, we continue to write that value
there, not the baseline frame size.

* dfg/DFGOSREntry.cpp:
(JSC::DFG::prepareOSREntry):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@167532 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[WebGL] Two tests failing on Mountain Lion after r167520
https://bugs.webkit.org/show_bug.cgi?id=131886

Skip two failing tests.

* platform/mac/TestExpectations:

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