DFG worklist scanning should not treat the key as a separate entity
https://bugs.webkit.org/show_bug.cgi?id=132167

Reviewed by Mark Hahnenberg.
        
This simplifies the interface to the GC and will enable more optimizations.

* dfg/DFGCompilationKey.cpp:
(JSC::DFG::CompilationKey::visitChildren): Deleted.
* dfg/DFGCompilationKey.h:
* dfg/DFGPlan.cpp:
(JSC::DFG::Plan::visitChildren):
* dfg/DFGWorklist.cpp:
(JSC::DFG::Worklist::visitChildren):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@167814 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Figure out how many cores are available for realsies.

Rubber stamped by Andreas Kling.
        
HW_AVAILCPU is more canonical than HW_NCPU. For example if you use hacks to tell Darwin
to make it seem like there are fewer CPUs, HW_AVAILCPU will change but HW_NCPU won't.
HW_NCPU doesn't reflect how much actual paralellism you'll get; it's merely reporting
facts about the machine you're running on. HW_AVAILCPU is almost always what WebKit
wants since it uses this information to decide how many threads to launch for various
things.

* wtf/NumberOfCores.cpp:
(WTF::numberOfProcessorCores):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@167815 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Refactor debugging code to use BreakpointActions instead of Vector<ScriptBreakpointAction>.
<https://webkit.org/b/132201>

Reviewed by Joseph Pecoraro.

BreakpointActions is Vector<ScriptBreakpointAction>.  Let's just consistently use
BreakpointActions everywhere.

* inspector/ScriptBreakpoint.h:
(Inspector::ScriptBreakpoint::ScriptBreakpoint):
* inspector/ScriptDebugServer.cpp:
(Inspector::ScriptDebugServer::setBreakpoint):
(Inspector::ScriptDebugServer::getActionsForBreakpoint):
* inspector/ScriptDebugServer.h:
* inspector/agents/InspectorDebuggerAgent.cpp:
(Inspector::InspectorDebuggerAgent::breakpointActionsFromProtocol):
(Inspector::InspectorDebuggerAgent::setBreakpointByUrl):
(Inspector::InspectorDebuggerAgent::setBreakpoint):
(Inspector::InspectorDebuggerAgent::removeBreakpoint):
* inspector/agents/InspectorDebuggerAgent.h:



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@167816 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[New Multicolumn] fast/multicol/hit-test-* layout tests all fail
https://bugs.webkit.org/show_bug.cgi?id=132081

Reviewed by Dean Jackson.


Source/WebCore: 
Added a bunch of tests in fast/multicol/newmulticol/compare-with-old-impl/hit-test-*.html

* rendering/RenderBlock.h:
Make offsetForContents public, since I need to call it from RenderMultiColumnSet.

* rendering/RenderMultiColumnFlowThread.cpp:
(WebCore::RenderMultiColumnFlowThread::populate):
Stop an ASSERT in the new columns code on the hit tests by making sure layout state is
disabled when moving children around.

* rendering/RenderMultiColumnSet.cpp:
(WebCore::RenderMultiColumnSet::positionForPoint):
Refactor this function to call a helper function instead, translateRegionPointToFlowThread.

(WebCore::RenderMultiColumnSet::translateRegionPointToFlowThread):
This function is logical (unlike the mistaken physical function I first implemented in
positionForPoint).

(WebCore::RenderMultiColumnSet::updateHitTestResult):
* rendering/RenderMultiColumnSet.h:
Overridden to fill in the correct local coordinate when the HTML document is inside a paginated
RenderView. Note that column spans don't actually work, but once we move over to a 
non-column based pagination API, that will become irrelevant.

LayoutTests: 
* fast/multicol/newmulticol/compare-with-old-impl/hit-test-above-or-below-expected.txt: Added.
* fast/multicol/newmulticol/compare-with-old-impl/hit-test-above-or-below.html: Added.
* fast/multicol/newmulticol/compare-with-old-impl/hit-test-block-axis-flipped-expected.txt: Added.
* fast/multicol/newmulticol/compare-with-old-impl/hit-test-block-axis-flipped.html: Added.
* fast/multicol/newmulticol/compare-with-old-impl/hit-test-end-of-column-expected.txt: Added.
* fast/multicol/newmulticol/compare-with-old-impl/hit-test-end-of-column-with-line-height-expected.txt: Added.
* fast/multicol/newmulticol/compare-with-old-impl/hit-test-end-of-column-with-line-height.html: Added.
* fast/multicol/newmulticol/compare-with-old-impl/hit-test-end-of-column.html: Added.
* fast/multicol/newmulticol/compare-with-old-impl/hit-test-float-expected.txt: Added.
* fast/multicol/newmulticol/compare-with-old-impl/hit-test-float.html: Added.
* fast/multicol/newmulticol/compare-with-old-impl/hit-test-gap-between-pages-expected.txt: Added.
* fast/multicol/newmulticol/compare-with-old-impl/hit-test-gap-between-pages-flipped-expected.txt: Added.
* fast/multicol/newmulticol/compare-with-old-impl/hit-test-gap-between-pages-flipped.html: Added.
* fast/multicol/newmulticol/compare-with-old-impl/hit-test-gap-between-pages.html: Added.
* fast/multicol/newmulticol/compare-with-old-impl/hit-test-gap-block-axis-expected.txt: Added.
* fast/multicol/newmulticol/compare-with-old-impl/hit-test-gap-block-axis.html: Added.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@167817 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Crash applying editing commands from iframe onload event

<https://bugs.webkit.org/show_bug.cgi?id=132103>
<rdar://problem/15696351>

Source/WebCore:
This patch merges the Chromium bug workaround from
<http://src.chromium.org/viewvc/blink?revision=162080&view=revision>,
which prevents reentrancy in CompositeEditCommand::apply().

Reviewed by Darin Adler.

Test: editing/apply-style-iframe-crash.html

* editing/CompositeEditCommand.cpp:
(WebCore::HTMLNames::ReentrancyGuard::isRecursiveCall):
(WebCore::HTMLNames::ReentrancyGuard::Scope::Scope):
(WebCore::HTMLNames::ReentrancyGuard::Scope::~Scope):
(WebCore::CompositeEditCommand::apply):
If this is a recursive call, return early.

LayoutTests:
Reviewed by Darin Adler.

* editing/apply-style-iframe-crash-expected.txt: Added.
* editing/apply-style-iframe-crash.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@167818 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Crash in platform/mac/accessibility/table-visible-rows.html
https://bugs.webkit.org/show_bug.cgi?id=132146

Reviewed by Mark Lam.

Changed to use a local JSValueRef array temporary instead of a
std::make_unique<JSValueRef[]> when making an array of JSValues so that the temporary
JSValues are visited during garbage collection when the stack is scanned.  Otherwise,
the temporary values could be collected.

* DumpRenderTree/AccessibilityUIElement.cpp:
(convertElementsToObjectArray):
* WebKitTestRunner/InjectedBundle/EventSendingController.cpp:
(WTR::EventSendingController::contextClick):
* WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementMac.mm:
(WTR::convertElementsToObjectArray):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@167819 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Column rules not respecting scroll offsets.
https://bugs.webkit.org/show_bug.cgi?id=109683

Reviewed by Dean Jackson.


Source/WebCore: 
Added fast/multicol/scrolling-column-rules.html

* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::paintColumnRules):
Make paintColumnRules virtual so that it works with both column implementations.

(WebCore::RenderBlock::paintObject):
Changed to call paintColumnRules with the adjusted scroll offset and to do it after
bailing on the root background only check.

* rendering/RenderBlock.h:
paintColumnRules is now virtual.

* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::paintColumnRules):
(WebCore::RenderBlockFlow::paintBoxDecorations): Deleted.
* rendering/RenderBlockFlow.h:
Got rid of paintBoxDecorations override since it failed when hasBoxDecorations was false
anyway. Override paintColumnRules instead to paint at the right time.

LayoutTests: 
* fast/multicol/scrolling-column-rules.html: Added.
* platform/mac/fast/multicol/scrolling-column-rules-expected.png: Added.
* platform/mac/fast/multicol/scrolling-column-rules-expected.txt: Added.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@167820 268f45cc-cd09-0410-ab3c-d52691b4dbfc
REGRESSION(r167799): ASSERTION in parseGridTemplateShorthand in fast/css-grid-layout/grid-template-shorthand-get-set.html
https://bugs.webkit.org/show_bug.cgi?id=132194

Patch by Javier Fernandez <jfernandez@igalia.com> on 2014-04-25
Reviewed by Martin Robinson.

Source/WebCore:
Properly resolving the grid-template shorthand for the corresponding longhand
properties.

No new tests, grid-template-shorthand-get-set.html already covers this case.

* css/StyleProperties.cpp:
(WebCore::StyleProperties::getPropertyValue):
* css/StylePropertyShorthand.cpp:
(WebCore::shorthandForProperty):
(WebCore::matchingShorthandsForLonghand):
* css/StyleResolver.cpp:
(WebCore::StyleResolver::applyProperty):

LayoutTests:
* TestExpectations: Unskip fast/css-grid-layout/grid-template-shorthand-get-set.html.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@167821 268f45cc-cd09-0410-ab3c-d52691b4dbfc
REGRESSION (r167775): Safari crashes in ViewSnapshotStore::pruneSnapshots after loading 20 pages
https://bugs.webkit.org/show_bug.cgi?id=132204
<rdar://problem/16729123>

Reviewed by Anders Carlsson.

* UIProcess/mac/ViewSnapshotStore.h:
* UIProcess/mac/ViewSnapshotStore.mm:
(WebKit::ViewSnapshotStore::ViewSnapshotStore):
(WebKit::ViewSnapshotStore::pruneSnapshots):
(WebKit::ViewSnapshotStore::recordSnapshot):
Keep track of the number of snapshots that actually have live images; the
size of the snapshot map no longer represents that.
Also, fix the crash by using the UUID from the current item instead of from
the (potentially null) most distant item; r167775 accidentally typo'd this.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@167822 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Windows build fix attempt.

* runtime/JSGlobalObject.h:
(JSC::JSGlobalObject::JSGlobalObjectRareData::~JSGlobalObjectRareData):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@167823 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Update WKSI for https://webkit.org/b/132195
<rdar://problem/16175750>

Reviewed by Jessie Berlin.

* WebKitSystemInterface.h:
* libWebKitSystemInterfaceMavericks.a:
* libWebKitSystemInterfaceMountainLion.a:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@167824 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Allow a platform-specific size enumeration to be passed into popup-menu display
https://bugs.webkit.org/show_bug.cgi?id=132195

Reviewed by Brent Fulgham. With some in-person review comments from Sam Weinig.

Platforms like OS X use a set of predefined sizes for built-in controls
used for <select>: normal, small and mini. Expose that information to
the PopupMenuClient via the PopupMenuStyle, allowing it to be passed
into the platform code in WebKitSystemInterface.

Source/WebCore:
* platform/PopupMenuStyle.h: Add a menu size enum.
(WebCore::PopupMenuStyle::PopupMenuStyle):
(WebCore::PopupMenuStyle::menuSize):
* platform/mac/WebCoreSystemInterface.h: Pass in NSControlSize as a parameter
to WKPopupMenu.
* platform/mac/WebCoreSystemInterface.mm: Ditto.
* rendering/RenderMenuList.cpp:
(RenderMenuList::menuStyle): Ask the RenderTheme to calculate the size
of the menu button, so that it can be added to the PopupMenuStyle.
* rendering/RenderTheme.h: New method to retrieve the menu size.
(WebCore::RenderTheme::popupMenuSize): Convert an NSControlSize into a PopupMenuSize.
* rendering/RenderThemeMac.h: Override the base function, and add a
controlSizeForCell helper.
* rendering/RenderThemeMac.mm:
(WebCore::RenderThemeMac::controlSizeForCell): Used by this new
code and the old setControlSizeForCell to calculate the NSControlSize
that would be used for the button.
(WebCore::RenderThemeMac::setControlSize): Call the new helper.
(WebCore::RenderThemeMac::popupMenuSize): Return the value from the helper.

Source/WebKit/mac:
* WebCoreSupport/PopupMenuMac.mm:
(PopupMenuMac::show): Convert the WebCore menu size type into the
WebCoreSystemInterface type.

Source/WebKit2:
* Shared/PlatformPopupMenuData.cpp: Encode and decode the PopupMenuSize enum.
(WebKit::PlatformPopupMenuData::encode):
(WebKit::PlatformPopupMenuData::decode):
* Shared/PlatformPopupMenuData.h: Add PopupMenuSize member variable.
* UIProcess/mac/WebPopupMenuProxyMac.mm:
(WebKit::WebPopupMenuProxyMac::showPopupMenu): Convert the PopupMenuSize
into a WKControlSize, and pass that into WKPopupMenu.
* WebProcess/WebCoreSupport/mac/WebPopupMenuMac.mm:
(WebKit::WebPopupMenu::setUpPlatformData): Add the PopupMenuSize to
the PlatformPopupMenuData.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@167825 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Remove duplicate member variable in WKAutocorrectionRects and WKAutocorrectionContext.
https://bugs.webkit.org/show_bug.cgi?id=132206

Reviewed by Benjamin Poulain.

* UIProcess/ios/WKContentViewInteraction.mm:



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