[mac] DumpRenderTree/WebKitTestRunner should disable NSBeep
https://bugs.webkit.org/show_bug.cgi?id=107251

Reviewed by Simon Fraser.

Disable NSBeep in DumpRenderTree and WebKitTestRunner using NSSound SPI.

* DumpRenderTree/mac/DumpRenderTree.mm:
(dumpRenderTree):
* WebKitTestRunner/InjectedBundle/mac/InjectedBundleMac.mm:
(WTR::InjectedBundle::platformInitialize):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@140188 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[mac] DumpRenderTree/WebKitTestRunner should not participate in Exposé/Mission Control
https://bugs.webkit.org/show_bug.cgi?id=107234

Reviewed by Simon Fraser.

* DumpRenderTree/mac/DumpRenderTree.mm:
(createWebViewAndOffscreenWindow): Disable participation in Exposé via NSWindowCollectionBehaviorStationary.
* WebKitTestRunner/mac/PlatformWebViewMac.mm:
(WTR::PlatformWebView::PlatformWebView): Ditto.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@140189 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[chromium] Roll Chromium DEPS to 177676

Unreviewed DEPS roll.

* DEPS:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@140190 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[BlackBerry] When acquiring/releasing backing store memory, allow web page client control suspend/resuming of backing store
https://bugs.webkit.org/show_bug.cgi?id=107307

Patch by Andrew Lo <anlo@rim.com> on 2013-01-18
Reviewed by Rob Buis.
Internally reviewed by Jakob Petsovits.

Internal PR276660
Have BackingStore::createBackingStoreMemory & releaseBackingStoreMemory only
acquire & release the surface pool. It doesn't matter if either is called
redundantly since SurfacePool has internal state to protect against that.

Resuming & suspending backing store and screen updates will be handled by
the WebPageClient.

* Api/BackingStore.cpp:
(BlackBerry::WebKit::BackingStore::acquireBackingStoreMemory):
(BlackBerry::WebKit::BackingStore::releaseOwnedBackingStoreMemory):
* Api/BackingStore.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@140191 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutUnit should round half consistently, not away from zero
https://bugs.webkit.org/show_bug.cgi?id=107208

Reviewed by Eric Seidel.

Source/WebCore:

The current implementation of LayoutUnit::round() always rounds half away from zero. This can result in
a shift of 1 pixel moving an element aligned at a half-pixel by 2. This problem is particularly common with
RenderLayers, which pass the sub-pixel accumulation into their renderers after translating the graphics
context passed in by their rounded location. This changes round() to always round 0.5 up.

Test: fast/sub-pixel/sub-pixel-root-layer.html

* platform/LayoutUnit.h:
(WebCore::LayoutUnit::round): Always round 0.5 up.
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::paintLayerContents): We no longer need to prevent rootLayers from passing in a
sub-pixel offset. This eliminates the shifting of elements when applying translateZ(0) or similar.

Tools:

* TestWebKitAPI/Tests/WebCore/LayoutUnit.cpp: Updating to reflect and
cover this change in rounding behavior.

LayoutTests:

* fast/sub-pixel/sub-pixel-root-layer-expected.html: Added.
* fast/sub-pixel/sub-pixel-root-layer.html: Added.
* platform/chromium-linux/fast/regions/overflow-moving-below-floats-in-variable-width-regions-expected.png:
* platform/chromium-linux/fast/regions/overflow-size-change-in-variable-width-regions-expected.png:
* platform/chromium-linux/fast/regions/overflow-size-change-with-stacking-context-expected.png:
* platform/chromium-win/fast/regions/overflow-moving-below-floats-in-variable-width-regions-expected.txt:
* platform/chromium-win/fast/regions/overflow-size-change-in-variable-width-regions-expected.txt:
* platform/chromium-win/fast/regions/overflow-size-change-with-stacking-context-expected.txt:
* platform/chromium/TestExpectations:
* platform/mac/TestExpectations:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@140192 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Text Autosizing: don't autosize headers with multiple inline links.
https://bugs.webkit.org/show_bug.cgi?id=106792

Patch by Tim Volodine <timvolodine@chromium.org> on 2013-01-18
Reviewed by Kenneth Rohde Christiansen.

Source/WebCore:

This patch includes code for detecting rows of links typically seen
in headers or footers of webpages. Such rows of links should not be
autosized.

The heuristics to detect such rows of links are based on the appearance
of headers in most websites: i.e. links are inline, there are at least three
of them, they should have the same font size with possibly only short textual
separators between them (max 3 characters) and there should be no line breaks
(i.e. <br> elements) between them.

Tests: fast/text-autosizing/header-li-links-autosizing.html
       fast/text-autosizing/header-links-autosizing-different-fontsize.html
       fast/text-autosizing/header-links-autosizing.html

* rendering/TextAutosizer.cpp:
(WebCore::TextAutosizer::containerShouldBeAutosized):
(WebCore::TextAutosizer::containerIsRowOfLinks):
(WebCore):
* rendering/TextAutosizer.h:

LayoutTests:

* fast/text-autosizing/header-li-links-autosizing-expected.html: Added.
* fast/text-autosizing/header-li-links-autosizing.html: Added.
* fast/text-autosizing/header-links-autosizing-different-fontsize-expected.html: Added.
* fast/text-autosizing/header-links-autosizing-different-fontsize.html: Added.
* fast/text-autosizing/header-links-autosizing-expected.html: Added.
* fast/text-autosizing/header-links-autosizing.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@140193 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Weak GC maps should be easier to use
https://bugs.webkit.org/show_bug.cgi?id=107312

Reviewed by Sam Weinig.

../JavaScriptCore: 

This patch changes WeakGCMap to not use a WeakImpl finalizer to remove
items from the map, and to instead have the map automatically remove
stale items itself upon insertion. This has a few advantages:

(1) WeakGCMap is now compatible with all the specializations you would
use for HashMap.

(2) There's no need for clients to write special finalization munging
functions.

(3) Clients can specify custom value finalizers if they like.

* JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreExports.def: Def!

* API/JSWeakObjectMapRefPrivate.cpp: Setter no longer requires a global
data, since we've reduced interdependency.

* heap/Handle.h: No more need to forward declare, since we've reduced
interdependency.

* heap/Weak.h:
(Weak): Use explicit so we can assign directly to a weak map iterator
without ambiguity between Weak<T> and PassWeak<T>.

* runtime/Structure.cpp:
(JSC::StructureTransitionTable::add): See above.

* runtime/Structure.h:
(JSC):
* runtime/StructureTransitionTable.h:
(StructureTransitionTable): Bad code goes away, programmer happy.

* runtime/WeakGCMap.h:
(JSC):
(WeakGCMap):
(JSC::WeakGCMap::WeakGCMap):
(JSC::WeakGCMap::set):
(JSC::WeakGCMap::add):
(JSC::WeakGCMap::find):
(JSC::WeakGCMap::contains):
(JSC::WeakGCMap::gcMap):
(JSC::WeakGCMap::gcMapIfNeeded): Inherit from HashMap and override any
function that might observe a Weak<T> that has died, just enough to
make such items appear as if they are not in the table.

../WebCore: 

Since weak GC maps are so easy to use now, let's use them for the DOM
string cache.

* WebCore.exp.in:
* bindings/js/DOMWrapperWorld.cpp:
(WebCore):
(WebCore::DOMWrapperWorld::DOMWrapperWorld):
* bindings/js/DOMWrapperWorld.h:
(WebCore):
(WebCore::DOMWrapperWorld::globalData):
(DOMWrapperWorld):
* bindings/js/JSDOMBinding.cpp:
(WebCore):
* bindings/js/JSDOMBinding.h:
(WebCore):
(WebCore::jsStringWithCache):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@140194 268f45cc-cd09-0410-ab3c-d52691b4dbfc
r134080 causes heap problem on linux systems where PAGESIZE != 4096
https://bugs.webkit.org/show_bug.cgi?id=102828

Patch by Balazs Kilvady <kilvadyb@homejinni.com> on 2013-01-18
Reviewed by Mark Hahnenberg.

Make MarkStackSegment::blockSize as the capacity of segments of a MarkStackArray.

* JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreExports.def:
* heap/MarkStack.cpp:
(JSC):
(JSC::MarkStackArray::MarkStackArray):
(JSC::MarkStackArray::expand):
(JSC::MarkStackArray::donateSomeCellsTo):
(JSC::MarkStackArray::stealSomeCellsFrom):
* heap/MarkStack.h:
(JSC::MarkStackSegment::data):
(CapacityFromSize):
(MarkStackArray):
* heap/MarkStackInlines.h:
(JSC::MarkStackArray::setTopForFullSegment):
(JSC::MarkStackArray::append):
(JSC::MarkStackArray::isEmpty):
(JSC::MarkStackArray::size):
* runtime/Options.h:
(JSC):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@140195 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[chromium] Test expectation updates

Mark this test added in r140024 as Failure on Chromium Mac Debug:
fast/inline/fixed-pos-moves-with-abspos-inline-parent.html

* platform/chromium/TestExpectations:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@140196 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Objective-C API: Update documentation for JSValue and JSContext
https://bugs.webkit.org/show_bug.cgi?id=107313

Reviewed by Geoffrey Garen.

After changing the semantics of object lifetime we need to update the API documentation to reflect the new semantics.

* API/APIJSValue.h:
* API/JSContext.h:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@140197 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[CSS Grid Layout] Add support for min-content
https://bugs.webkit.org/show_bug.cgi?id=106474

Reviewed by Ojan Vafai.

Source/WebCore:

Tests: fast/css-grid-layout/minmax-min-content-column-resolution-columns.html
       fast/css-grid-layout/minmax-min-content-column-resolution-rows.html

This change adds support to properly size min-content as long as the grid items and the grid element
don't have orthogonal writing-modes. Orthogonal writing modes will be handled in a follow-up bug
to keep the patch small-ish.

This change implements a subset of the specification's algorithm, taking some shortcuts where the
extra complexity wasn't a clear win for now: e.g. the specification relies on behavior customization
through functors to share code among more complex cases - like spanning columns / rows. These shortcuts
have been marked as FIXME / comments in the code so that they can be evaluated and fixed as we implement
more of the complexity.

* platform/Length.h:
(WebCore::Length::isMinContent):
(WebCore::Length::isMaxContent):
Helper functions.

* rendering/RenderGrid.cpp:
(WebCore::GridTrack::maxBreadthIfNotInfinite):
Helper function that returns the max breadth if finite and the used breadth otherwise.

(WebCore::RenderGrid::computedUsedBreadthOfGridTracks):
Updated to call resolveContentBasedTrackSizingFunctions.

(WebCore::RenderGrid::computeUsedBreadthOfMinLength):
(WebCore::RenderGrid::computeUsedBreadthOfMaxLength):
(WebCore::RenderGrid::computeUsedBreadthOfSpecifiedLength):
Split computeUsedBreadthOfLength into min and max side so that we can return the default values accordingly.
computeUsedBreadthOfSpecifiedLength shares the common code. Also made these functions 'const'.

(WebCore::RenderGrid::minContentForChild):
This function returns the 'min-content' value based on layout / compute preferred logical widths information.

(WebCore::RenderGrid::resolveContentBasedTrackSizingFunctions):
This is the core function that implements the sizing. It currently doesn't share much code between the branches,
which will be done as we implement more of the algorithm.

(WebCore::RenderGrid::distributeSpaceToTracks):
Clamped the growthShare to positive value only. This is required to handle cases where min-content is bigger
than max track breadth. Added a comment about this deviation from the specification.

(WebCore::RenderGrid::tracksAreWiderThanMinTrackBreadth):
Debug only method. It is a sanity check as our algorithm should *never* shrink the used breadth to a value
smaller than the computed min track breadth.

(WebCore::RenderGrid::layoutGridItems):
Added 2 ASSERT using tracksAreWiderThanMinTrackBreadth.

(WebCore::RenderGrid::resolveGridPosition):
Helper overriden instance.
* rendering/RenderGrid.h:
Added the new functions. Also made more core functions take both grid tracks.

LayoutTests:

* fast/css-grid-layout/minmax-min-content-column-resolution-columns-expected.txt: Added.
* fast/css-grid-layout/minmax-min-content-column-resolution-columns.html: Added.
* fast/css-grid-layout/minmax-min-content-column-resolution-rows-expected.txt: Added.
* fast/css-grid-layout/minmax-min-content-column-resolution-rows.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@140198 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Tried to fix the build after r140194.

* API/JSWrapperMap.mm:
(-[JSWrapperMap wrapperForObject:]):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@140199 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed build fix. Remove deleted symbol from windows export list.

* WebKit.vcproj/WebKitExports.def.in:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@140200 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Fix up of ArithDiv nodes for non-x86 CPUs is broken
https://bugs.webkit.org/show_bug.cgi?id=107309

Reviewed by  Filip Pizlo.

Changed the logic so that we insert an Int32ToDouble node when the existing edge is not SpecDouble.

* dfg/DFGFixupPhase.cpp:
(JSC::DFG::FixupPhase::fixDoubleEdge):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@140201 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Fix scrollRectToVisible in the presence of transforms
https://bugs.webkit.org/show_bug.cgi?id=105574

Patch by Chris Hopman <cjhopman@google.com> on 2013-01-18
Reviewed by Simon Fraser.

Source/WebCore:

When scrolling to reveal an overflow layer, the required scroll was
being calculated in absolute coordinates. To properly account for
transforms, this calculation should be done in the local coordinates
of the renderBox.

Tests: editing/input/reveal-selection-transformed-overflow-parent.html
       editing/input/reveal-selection-transformed-textarea.html

* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::scrollRectToVisible):
When scrolling to reveal an overflow layer, calculate the required
scroll in the local coordinates of the RenderBox.
* rendering/RenderObject.cpp:
(WebCore::RenderObject::absoluteToLocalQuad):
(WebCore):
* rendering/RenderObject.h:
(RenderObject):
Add function to convert an absolute quad to a local quad.

LayoutTests:

* editing/input/reveal-caret-of-transformed-input-scrollable-parent.html: Added.
* editing/input/reveal-caret-of-transformed-input-scrollable-parent-expected.txt: Added.
Test that when scrolling an overflow layer to reveal a rect, the rect
passed to the parent to scroll is calculated properly.
* editing/input/reveal-caret-of-transformed-multiline-input.html: Added.
* editing/input/reveal-caret-of-transformed-multiline-input-expected.txt: Added.
Test that scrolling to reveal a rect works properly on a transformed
overflow layer.

* platform/chromium/TestExpectations:
* platform/mac/TestExpectations:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@140202 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Harden ArithDiv of integers fix-up by inserting Int32ToDouble node directly
https://bugs.webkit.org/show_bug.cgi?id=107321

Reviewed by  Filip Pizlo.

Split out the Int32ToDouble node insertion from fixDoubleEdge() and used it directly when we're fixing up
an ArithDiv node with integer inputs and output for platforms that don't have integer division.
Since we are checking that our inputs should be ints, we can just insert the Int32ToDouble node
without any further checks.

* dfg/DFGFixupPhase.cpp:
(JSC::DFG::FixupPhase::fixupNode):
(JSC::DFG::FixupPhase::fixDoubleEdge):
(FixupPhase):
(JSC::DFG::FixupPhase::injectInt32ToDoubleNode):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@140203 268f45cc-cd09-0410-ab3c-d52691b4dbfc
VCSUtils.pm: Stop calling git repo-config.
https://bugs.webkit.org/show_bug.cgi?id=107294

Reviewed by Dirk Pranke.

The `repo-config' git command has been deprecated since early
2008, and recent versions have started warning it is deprecated.

Basically revert r27870 and use the `config' command all the time.

* Scripts/VCSUtils.pm:
(gitConfig):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@140204 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Update LayoutUnit rounding unit test
https://bugs.webkit.org/show_bug.cgi?id=107322

Reviewed by Levi Weintraub.
        
Update the LayoutUnitRounding test to use fromFloatRound for
values that cannot accurately be represented as a LayoutUnit
(the default behavior is to floor the value to the nearest
LayoutUnit).

* TestWebKitAPI/Tests/WebCore/LayoutUnit.cpp:
(TestWebKitAPI::TEST):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@140205 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Heap-use-after-free in WebCore::RenderObject::isDescendantOf
https://bugs.webkit.org/show_bug.cgi?id=107226

Reviewed by David Hyatt.

Source/WebCore:

Test: fast/block/float/overhanging-float-not-removed-crash.html

* rendering/RenderBox.cpp:
(WebCore::RenderBox::removeFloatingOrPositionedChildFromBlockLists):
Skip anonymous blocks in the chain to get the enclosing block and
be able to correctly mark the overhanging floats in the next siblings.

LayoutTests:

* fast/block/float/overhanging-float-not-removed-crash-expected.txt: Added.
* fast/block/float/overhanging-float-not-removed-crash.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@140206 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[chromium] Layout test rebaselines

Unreviewed rebaseline. Update test results after Chromium roll in r140190.

* platform/chromium-win/css2.1/t100801-c544-valgn-03-d-agi-expected.png:
* platform/chromium-win/css2.1/t100801-c544-valgn-03-d-agi-expected.txt:
* platform/chromium/css2.1/t100801-c544-valgn-03-d-agi-expected.txt: Renamed from LayoutTests/platform/chromium-mac/css2.1/t100801-c544-valgn-03-d-agi-expected.txt.

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