https://bugs.webkit.org/show_bug.cgi?id=100169
We should make TileCache tiles the size of the tile coverage rect 
when we can't do fast scrolling
-and-
<rdar://problem/12505021>

Reviewed by Simon Fraser.

Source/WebCore: 

Some websites that don't do fast scrolling still scroll slower than 
they do with tiled drawing disabled. 
https://bugs.webkit.org/show_bug.cgi?id=99768 addressed some of this 
performance problem, but there is still more ground to make up. This 
patch addresses the remaining issue by making tiles the size of the 
window when we can't do fast scrolling. 

The constructor and create function no longer take a size parameter. 
That's all fully controlled within TileCache now. m_tileSize is no 
longer const.
* platform/graphics/ca/mac/TileCache.h:

Store the current default size as constants so that we can access it 
in both the constructor and adjustTileSizeForCoverageRect().
* platform/graphics/ca/mac/TileCache.mm:
(WebCore::TileCache::TileCache):

This new function will set m_tileSize to the size of the tile 
coverage rect if the tile coverage is limited to the visible area. 
Otherwise, the tiles are set to be the default size.
(WebCore::TileCache::adjustTileSizeForCoverageRect):
        
Call adjustTileSizeForCoverageRect().
(WebCore::TileCache::revalidateTiles):

No need to send in a size anymore.
* platform/graphics/ca/mac/WebTileCacheLayer.h:
(WebCore):

LayoutTests: 

New test.
* platform/mac/tiled-drawing/tile-coverage-slow-scrolling-expected.txt: Added.
* platform/mac/tiled-drawing/tile-coverage-slow-scrolling.html: Added.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@132427 268f45cc-cd09-0410-ab3c-d52691b4dbfc
DFG compileBlahBlahByVal methods for Contiguous and ArrayStorage have only one caller and should be removed
https://bugs.webkit.org/show_bug.cgi?id=100311

Reviewed by Mark Hahnenberg.

Just trying to simplify things before I make them more complicated again.

* dfg/DFGSpeculativeJIT.h:
(SpeculativeJIT):
(JSC::DFG::SpeculativeJIT::temporaryRegisterForPutByVal):
* dfg/DFGSpeculativeJIT32_64.cpp:
(DFG):
(JSC::DFG::SpeculativeJIT::compile):
* dfg/DFGSpeculativeJIT64.cpp:
(DFG):
(JSC::DFG::SpeculativeJIT::compile):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@132428 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed, expectations and baseline cleanup.

Remove some old baselines for a test that was converted to a reftest,
and remove entries for tests no longer failing on Chromium Mac ML.

* platform/chromium-mac-lion/fast/forms/date/date-reset-value-expected.png: Removed.
* platform/chromium-mac-mountainlion/TestExpectations:
* platform/chromium-mac-snowleopard/fast/forms/date/date-reset-value-expected.png: Removed.
* platform/chromium-mac/fast/forms/date/date-reset-value-expected.png: Removed.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@132429 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed, update chromium-mac-mountainlion baselines.

* platform/chromium-mac-lion/media/track/track-cue-rendering-horizontal-expected.png: Copied from LayoutTests/platform/chromium-mac/media/track/track-cue-rendering-horizontal-expected.png.
* platform/chromium-mac-lion/media/track/track-cue-rendering-horizontal-expected.txt: Copied from LayoutTests/platform/chromium-mac/media/track/track-cue-rendering-horizontal-expected.txt.
* platform/chromium-mac/media/track/track-cue-rendering-horizontal-expected.png:
* platform/chromium-mac/media/track/track-cue-rendering-horizontal-expected.txt:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@132431 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Skip tiled drawing tests for WK1
https://bugs.webkit.org/show_bug.cgi?id=100312

Reviewed by Beth Dakin.

Skip platform/mac/tiled-drawing tests in the main TestExpections file,
but re-enable it in the WK2 TestExpections file.

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

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@132432 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Pass on exif orientation from ImageSource when using the open-source image decoders
https://bugs.webkit.org/show_bug.cgi?id=100164

Reviewed by Eric Seidel.

The orientation is honored always for image documents, and optionally
for <img> elements if shouldRespectImageOrientation is set (off by
default). However, the feature needs port-specific modifications to
GraphicsContext (without this, webcore will use the rotated bounds but
draw the image as if it hadn't be rotated, resulting in squished
pixels), and most ports don't implement these yet -- so put
turning this on for image documents behind a port-specific #ifdef.

No observable behavior change. Once it's hooked up, it will be tested
by fast/images/exif-orientation.html.

* platform/graphics/ImageSource.cpp:
(WebCore::ImageSource::size):
(WebCore::ImageSource::frameSizeAtIndex):
(WebCore::ImageSource::orientationAtIndex):
* platform/graphics/chromium/DeferredImageDecoder.cpp:
(WebCore::DeferredImageDecoder::orientation):
(WebCore):
* platform/graphics/chromium/DeferredImageDecoder.h:
(DeferredImageDecoder):
* platform/image-decoders/jpeg/JPEGImageDecoder.cpp:
(WebCore::readImageOrientation):
* rendering/RenderObject.cpp:
(WebCore::RenderObject::shouldRespectImageOrientation):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@132433 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Updated results for https://bugs.webkit.org/show_bug.cgi?id=100312
I checked in results that relied on some local changes in WK2.

* platform/mac/tiled-drawing/tile-coverage-slow-scrolling-expected.txt:



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@132434 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[SOUP] Provide logging for SocketStreamHandleSoup
https://bugs.webkit.org/show_bug.cgi?id=100215

Patch by Seokju Kwon <seokju.kwon@samsung.com> on 2012-10-24
Reviewed by Alexey Proskuryakov.

Add logging to SocketStreamHandleSoup to facilitate debugging.

* platform/network/soup/SocketStreamHandleSoup.cpp:
(WebCore::SocketStreamHandle::SocketStreamHandle):
(WebCore::SocketStreamHandle::~SocketStreamHandle):
(WebCore::SocketStreamHandle::platformSend):
(WebCore::SocketStreamHandle::platformClose):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@132435 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Add two more tiled scrolling tests
https://bugs.webkit.org/show_bug.cgi?id=100314

Reviewed by Beth Dakin.

Two new tests for TileCache tile coverage after scrolling.

* platform/mac/tiled-drawing/tile-coverage-after-scroll-expected.txt: Added.
* platform/mac/tiled-drawing/tile-coverage-after-scroll.html: Added.
* platform/mac/tiled-drawing/tile-coverage-scroll-to-bottom-expected.txt: Added.
* platform/mac/tiled-drawing/tile-coverage-scroll-to-bottom.html: Added.

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

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@132437 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[cairo] unneeded FloatRect object creation in BitmapImage::draw
https://bugs.webkit.org/show_bug.cgi?id=100298

Patch by Arnaud Renevier <a.renevier@sisa.samsung.com> on 2012-10-24
Reviewed by Martin Robinson.

Do not copy FloatRect arguments src and dst to local variables.
Instead, use src and dst directly.

No new tests. No change in behavior.

* platform/graphics/cairo/BitmapImageCairo.cpp:
(WebCore::BitmapImage::draw):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@132438 268f45cc-cd09-0410-ab3c-d52691b4dbfc
nrwt: fix a couple of minor crashing issues under cygwin
https://bugs.webkit.org/show_bug.cgi?id=100309

Reviewed by Ojan Vafai.

Cygwin was crashing on a null object reference and then
an oserror in kill().

* Scripts/webkitpy/common/system/executive.py:
(Executive.kill_process):
* Scripts/webkitpy/layout_tests/port/server_process.py:
(ServerProcess.stop):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@132439 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[BlackBerry] Geolocation is segfaulting
https://bugs.webkit.org/show_bug.cgi?id=100305

Patch by Otto Derek Cheung <otcheung@rim.com> on 2012-10-24
Reviewed by Rob Buis.

We weren't wrapping the Geolocation object in a RefPtr when we call setIsAllowed in
GeolocationClientBlackBerry::onPermission.

This patch also removes all references of the Geolocation object in WebPageClientImpl.
One RefPtr<Geolocation> is used to store the reference of the WebCore object on our port.

We don't need a mapping between origin -> context of Geolocation because in our port,
one WebPage.cpp contains one GeolocationController only.

* Api/WebPageClient.h:
* WebCoreSupport/GeolocationClientBlackBerry.cpp:
(frameOrigin):
(GeolocationClientBlackBerry::requestPermission):
(GeolocationClientBlackBerry::cancelPermissionRequest):
(GeolocationClientBlackBerry::onPermission):
* WebCoreSupport/GeolocationClientBlackBerry.h:
(GeolocationClientBlackBerry):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@132440 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[V8] AbstractWeakReferenceMap is unnecessarily general and complex
https://bugs.webkit.org/show_bug.cgi?id=100175

Reviewed by Eric Seidel.

Before this patch, AbstractWeakReferenceMap served two masters:

1) DOM wrappers
2) NPV8 function templates

These two uses cases pushed AbstractWeakReferenceMap to be more general
and complex that needed. This patch separates these two uses cases into
two separate classes. V8NPTemplateMap is all of 40 lines of code. It's
not worth complicating the DOM wrapper code path to share that tiny
amount of code.

The other thing this patch does is store a pointer to the DOM wrapper
map as the weak callback context object. That means we no longer need
to search through all the wrapper maps in order to find the map that
contains this particular DOM wrapper.

* WebCore.gypi:
* bindings/v8/DOMData.cpp:
* bindings/v8/DOMData.h:
(DOMData):
* bindings/v8/DOMDataStore.cpp:
    - Delete all these complicated weak callback functions. The weak
      callback functions are now an order of magnitude simpler and
      declared as private member functions on the wrapper map.
* bindings/v8/DOMDataStore.h:
(WebCore::DOMDataStore::domNodeMap):
(WebCore::DOMDataStore::activeDomNodeMap):
(DOMDataStore):
    - We now have a consistent type to use for all these wrapper maps.
      Both the hash map and the intrusive map derive from
      DOMWrapperMap (with a single template parameter).
* bindings/v8/DOMWrapperMap.h: Added.
(WebCore):
(DOMWrapperVisitor):
    - The visitor is no longer an inner class. It's just a top-level
      class that does the same thing.
(DOMWrapperMap):
    - The abstract interface for DOMWrapperMap has about half as many
      functions as the old AbstractWeakReferenceMap because the two use
      cases are disentangled.
(WebCore::DOMWrapperMap::~DOMWrapperMap):
(DOMWrapperHashMap):
    - This is a concrete instance of DOMWrapperMap that uses a hash map.
(WebCore::DOMWrapperHashMap::DOMWrapperHashMap):
(WebCore::DOMWrapperHashMap::remove):
(WebCore::DOMWrapperHashMap::defaultWeakCallback):
    - Notice that the context parameter now points to the hashmap
      itself rather than to the native object. Now that we don't need
      to handle the NPAPI case, we can recover the native object from
      the wrapper using toNative. The assert in set() ensures that this
      always works.
* bindings/v8/DOMWrapperWorld.h:
* bindings/v8/IntrusiveDOMWrapperMap.h:
    - These classes are now simplified because they need to implement
      fewer functions.
(WebCore::DOMNodeWrapperMap::weakCallback):
    - For this weak callback, we still use the native object as the
      context parameter. We could also recover the native object from
      the wrapper, which means this context parameter is available to
      do other work.
* bindings/v8/ScopedDOMDataStore.cpp:
(WebCore::ScopedDOMDataStore::ScopedDOMDataStore):
    - This code no longer needs to have knowledge of which weak
      callbacks these objects use.
(WebCore::ScopedDOMDataStore::~ScopedDOMDataStore):
    - We need to clear the maps before deleting them because there are
      still JavaScript objects that have references to the map in their
      weak callback parameter. Previously, we handled this case because
      we would search all the wrapper maps and fail to find the wrapper.
* bindings/v8/ScriptProfiler.cpp:
(WebCore::ScriptProfiler::visitExternalArrays):
* bindings/v8/StaticDOMDataStore.cpp:
    - This code no longer needs to have knowledge of which weak
      callback these maps use.
* bindings/v8/StaticDOMDataStore.h:
(StaticDOMDataStore):
* bindings/v8/V8DOMMap.cpp:
(WebCore::getDOMNodeMap):
(WebCore::getActiveDOMNodeMap):
(WebCore::removeAllDOMObjects):
    - Rather than using some complicated visitor pattern, we can now
      just call clear() directly on the maps to remove all the objects.
(WebCore::visitActiveDOMNodes):
(WebCore::visitDOMObjects):
(WebCore::visitActiveDOMObjects):
* bindings/v8/V8DOMMap.h:
(WebCore):
    - Delete the old versions of these classes.
(DOMDataStoreHandle):
    - Style nit: one-argument constructors should be marked explicit.
* bindings/v8/V8DOMWrapper.cpp:
(WebCore::V8DOMWrapper::domWrapperType):
    - I moved this logic into WrapperTypeInfo.h to avoid a circular
      header dependency.
* bindings/v8/V8DOMWrapper.h:
(WebCore::V8DOMWrapper::getCachedWrapper):
* bindings/v8/V8GCController.cpp:
    - EnsureWeakDOMNodeVisitor is no longer used (or needed since we no
      longer clear the weak callbacks in V8GCController).
* bindings/v8/V8NPObject.cpp:
(V8NPTemplateMap):
    - staticTemplateMap is no longer an instance of WeakReferenceMap.
      Instead, this patch just implements the functionality we need
      here directly.
(WebCore::V8NPTemplateMap::get):
(WebCore::V8NPTemplateMap::set):
(WebCore::V8NPTemplateMap::sharedInstance):
(WebCore::V8NPTemplateMap::weakCallback):
(WebCore::V8NPTemplateMap::dispose):
(WebCore::npObjectGetProperty):
(WebCore):
(WebCore::staticNPObjectMap):
(WebCore::weakNPObjectCallback):
    - DOMWrapperMap no longer exposes a "forget" function. Instead, we
      just use the more basic "remove" and "Dispose" operations to do
      the same thing. This is possible now because we no longer have
      "removeIfPossible" to support searching all the wrapper maps for
      the one that has the right wrapper.
(WebCore::createV8ObjectForNPObject):
    - DOMWrapperMap No longer has a "contains" function. Instead, we
      use get, which actually makes this code more efficient because we
      only do one hash map lookup.
(WebCore::forgetV8ObjectForNPObject):
    - The changes here are a combination of the two sorts of changes
      above.
* bindings/v8/WrapperTypeInfo.h:
(WebCore::toNative):
(WebCore::toWrapperTypeInfo):
    - The patch moves these functions into this header to avoid a
      circular header dependency.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@132441 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Rebaseline some sputnik unicode failed cases.
https://bugs.webkit.org/show_bug.cgi?id=99976

Unreviewed rebaseline.

According to BUG 93103, seems these four test cases have different results after libicu 4.6 version.
As Ubuntu 12.04 installs 4.8 and mac has same result with windows, expected results on BUG 93103 could replace common result file except chromium-mac-snowleopard.

Patch by Kangil Han <kangil.han@samsung.com> on 2012-10-24

* platform/chromium/sputnik/Unicode/Unicode_510/S7.6_A3.1-expected.txt: Removed.
* platform/chromium/sputnik/Unicode/Unicode_510/S7.6_A3.2-expected.txt: Removed.
* platform/chromium/sputnik/Unicode/Unicode_510/S7.6_A5.3_T1-expected.txt: Removed.
* platform/chromium/sputnik/Unicode/Unicode_510/S7.6_A5.3_T2-expected.txt: Removed.
* platform/efl/TestExpectations:
* platform/gtk/sputnik/Unicode/Unicode_510/S7.6_A3.2-expected.txt: Removed.
* platform/gtk/sputnik/Unicode/Unicode_510/S7.6_A5.3_T1-expected.txt: Removed.
* platform/gtk/sputnik/Unicode/Unicode_510/S7.6_A5.3_T2-expected.txt: Removed.
* platform/mac-snowleopard/sputnik/Unicode/Unicode_510/S7.6_A3.1-expected.txt: Removed.
* platform/mac-snowleopard/sputnik/Unicode/Unicode_510/S7.6_A3.2-expected.txt: Removed.
* platform/mac-snowleopard/sputnik/Unicode/Unicode_510/S7.6_A5.3_T1-expected.txt: Removed.
* platform/mac-snowleopard/sputnik/Unicode/Unicode_510/S7.6_A5.3_T2-expected.txt: Removed.
* platform/mac/sputnik/Unicode/Unicode_510/S7.6_A3.1-expected.txt: Removed.
* platform/mac/sputnik/Unicode/Unicode_510/S7.6_A3.2-expected.txt: Removed.
* platform/mac/sputnik/Unicode/Unicode_510/S7.6_A5.3_T1-expected.txt: Removed.
* platform/mac/sputnik/Unicode/Unicode_510/S7.6_A5.3_T2-expected.txt: Removed.
* sputnik/Unicode/Unicode_510/S7.6_A3.1-expected.txt:
* sputnik/Unicode/Unicode_510/S7.6_A3.2-expected.txt:
* sputnik/Unicode/Unicode_510/S7.6_A5.3_T1-expected.txt:
* sputnik/Unicode/Unicode_510/S7.6_A5.3_T2-expected.txt:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@132442 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[BlackBerry] ASSERT(!needsOneShotDrawingSynchronization()) failed in commitRootLayerIfNeeded()
https://bugs.webkit.org/show_bug.cgi?id=100214

Patch by Sean Wang <Xuewen.Wang@torchmobile.com.cn> on 2012-10-24
Reviewed by Rob Buis.

ViewportSize has been changed before committing root layer, it asserts
that it needs relayout and render if needed before committing if it
Needs One Shot Drawing Synchronization.
This patch calls requestLayoutIfNeeded() when resumeScreenAndBackingStoreUpdates().

Fix a coding style in the BackingStore.cpp as well.

Reviewed internally by Arvid Nilsson.
PR #230253

* Api/BackingStore.cpp:
(BlackBerry::WebKit::BackingStorePrivate::resumeScreenAndBackingStoreUpdates):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@132443 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sort an Xcode project file.

* WebCore.xcodeproj/project.pbxproj: Sorted.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@132444 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Refactor LLInt64 to distinguish the pointer operations from the 64-bit integer operations
https://bugs.webkit.org/show_bug.cgi?id=100321

Reviewed by Filip Pizlo.

We have refactored the MacroAssembler and JIT compilers to distinguish
the pointer operations from the 64-bit integer operations (see bug #99154).
Now we want to do the similar work for LLInt, and the goal is same as
the one mentioned in 99154.

This is the first part of the modification: in the offline assembler,
adding the support of the "<foo>q" instructions which will be used for
64-bit integer operations.

* llint/LowLevelInterpreter.cpp:
(JSC::CLoop::execute):
* offlineasm/cloop.rb:
* offlineasm/instructions.rb:
* offlineasm/x86.rb:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@132445 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Not reviewed: platform/chromium/TestExpectations lint.

* platform/chromium/TestExpectations:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@132446 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[V8] DOMData is no longer needed
https://bugs.webkit.org/show_bug.cgi?id=100313

Reviewed by Eric Seidel.

This class serves no purpose anymore and can be deleted.

* WebCore.gypi:
* bindings/v8/DOMData.cpp: Removed.
* bindings/v8/DOMData.h: Removed.
* bindings/v8/DOMDataStore.cpp:
(WebCore::DOMDataStore::current):
* bindings/v8/DOMDataStore.h:
(WebCore):
(DOMDataStore):
* bindings/v8/SerializedScriptValue.cpp:
(WebCore::neuterBinding):
* bindings/v8/V8DOMMap.cpp:
(WebCore::getDOMNodeMap):
(WebCore::getActiveDOMNodeMap):
(WebCore::getDOMObjectMap):
(WebCore::getActiveDOMObjectMap):
(WebCore::removeAllDOMObjects):
(WebCore::visitActiveDOMNodes):
(WebCore::visitDOMObjects):
(WebCore::visitActiveDOMObjects):


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