Attempt to fix flakiness of color-suggestion-picker-appearance.html
https://bugs.webkit.org/show_bug.cgi?id=92848

Reviewed by Kent Tamura.

Source/WebCore:

* Resources/colorSuggestionPicker.js:
(ColorPicker.prototype._layout): We put the width and height into
variables so we don't call window.onresize twice.

LayoutTests:

We observed console.log bleeding into the next test.

* platform/chromium/fast/forms/color/color-suggestion-picker-appearance.html:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@124326 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[EFL] Dump a backtrace in case of a crash on the UIProcess
https://bugs.webkit.org/show_bug.cgi?id=92843

Patch by Thiago Marcos P. Santos <thiago.santos@intel.com> on 2012-08-01
Reviewed by Csaba Osztrogonác.

We are already dumping the backtraces when automated tests are
crashing, but only for the WebProcess. This patch adds the same
hooks for the UIProcess.

* TestWebKitAPI/efl/main.cpp:
(main):
* WebKitTestRunner/efl/main.cpp:
(main):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@124327 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Export StringImpl::sizeInBytes() with WTF_EXPORT_STRING_API
https://bugs.webkit.org/show_bug.cgi?id=92851

Reviewed by Hajime Morita.

r124069 missed to change one export macro, which is needed
to make the windows port with USE(EXPORT_MACROS).

* wtf/text/StringImpl.h:
(StringImpl):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@124328 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed, rolling out r124325.
http://trac.webkit.org/changeset/124325
https://bugs.webkit.org/show_bug.cgi?id=92865

broke android build (Requested by mnaganov on #webkit).

Patch by Sheriff Bot <webkit.review.bot@gmail.com> on 2012-08-01

* DumpRenderTree/DumpRenderTree.gyp/DumpRenderTree.gyp:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@124329 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Web Inspector: add CSSStyleSheet memory instrumentation
https://bugs.webkit.org/show_bug.cgi?id=92748

Reviewed by Antti Koivisto.

Added MemoryInstrumentation for CSSStyleSheet, StyleSheetContents, StyleRule,
CSSSelectorList and StylePropertySet. The coverage is not complete as the
patch was growing too big.

* css/CSSSelectorList.cpp:
(WebCore::CSSSelectorList::CSSSelectorList):
(WebCore::CSSSelectorList::length):
(WebCore):
(WebCore::CSSSelectorList::reportMemoryUsage):
* css/CSSSelectorList.h:
(WebCore):
(CSSSelectorList):
* css/CSSStyleSheet.cpp:
(WebCore::CSSStyleSheet::reportMemoryUsage):
(WebCore):
* css/CSSStyleSheet.h:
(WebCore):
(CSSStyleSheet):
* css/MediaList.cpp:
(WebCore):
(WebCore::MediaQuerySet::reportMemoryUsage):
(WebCore::MediaList::reportMemoryUsage):
* css/MediaList.h:
(WebCore):
(MediaQuerySet):
(MediaList):
* css/MediaQuery.cpp:
(WebCore::MediaQuery::reportMemoryUsage):
(WebCore):
* css/MediaQuery.h:
(WebCore):
(MediaQuery):
* css/MediaQueryExp.cpp:
(WebCore::MediaQueryExp::reportMemoryUsage):
(WebCore):
* css/MediaQueryExp.h:
(WebCore):
(MediaQueryExp):
* css/StylePropertySet.cpp:
(WebCore::StylePropertySet::reportMemoryUsage):
(WebCore):
* css/StylePropertySet.h:
(WebCore):
(StylePropertySet):
* css/StyleRule.cpp:
(WebCore::StyleRuleBase::reportMemoryUsage): We cannot make
reportMemoryUsage virtual as it would add vtable to StyleRuleBase
and its descendants and would blow its memory footprint. This
is why we have a switch over StyleRule type here.
(WebCore):
(WebCore::StyleRule::reportMemoryUsage):
(WebCore::StyleRulePage::reportMemoryUsage):
(WebCore::StyleRuleFontFace::reportMemoryUsage):
(WebCore::StyleRuleBlock::reportMemoryUsage):
(WebCore::StyleRuleMedia::reportMemoryUsage):
(WebCore::StyleRuleRegion::reportMemoryUsage):
* css/StyleRule.h:
(WebCore):
(StyleRuleBase):
(StyleRule):
(StyleRuleFontFace):
(StyleRulePage):
(StyleRuleBlock):
(StyleRuleMedia):
(StyleRuleRegion):
* css/StyleSheetContents.cpp:
(WebCore::StyleSheetContents::reportMemoryUsage):
(WebCore):
* css/StyleSheetContents.h:
(WebCore):
(StyleSheetContents):
* dom/Document.cpp:
(WebCore::Document::reportMemoryUsage):
* dom/MemoryInstrumentation.h:
(WebCore::MemoryClassInfo::addInstrumentedVectorPtr):
(WebCore::MemoryClassInfo::addVectorPtr):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@124330 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[BlackBerry] Disable tap highlight when transparent color is specified
https://bugs.webkit.org/show_bug.cgi?id=92849

Patch by Arvid Nilsson <anilsson@rim.com> on 2012-08-01
Reviewed by Antonio Gomes.

When the web page specifies -webkit-tap-highlight-color:rgba(0,0,0,0)
or any color with alpha value 0, we should disable the tap highlight.

* WebKitSupport/DefaultTapHighlight.cpp:
(BlackBerry::WebKit::DefaultTapHighlight::draw):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@124331 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Web Inspector: count DOM storage cache memory for native snapshot
https://bugs.webkit.org/show_bug.cgi?id=91617

Patch by Alexei Filippov <alexeif@chromium.org> on 2012-08-01
Reviewed by Yury Semikhatsky.

Source/Platform:

Add memory size used for DOM storage cache reporting interface.

* chromium/public/WebStorageArea.h:
(WebStorageArea):
(WebKit::WebStorageArea::memoryBytesUsedByCache):

Source/WebCore:

Add memory size used for DOM storage cache reporting interface.
Report it to the native memory snapshot instrumentation framework.

* inspector/InspectorController.cpp:
(WebCore::InspectorController::InspectorController):
* inspector/InspectorDOMStorageAgent.cpp:
(WebCore::InspectorDOMStorageAgent::memoryBytesUsedByStorageCache):
(WebCore):
* inspector/InspectorDOMStorageAgent.h:
(InspectorDOMStorageAgent):
* inspector/InspectorMemoryAgent.cpp:
(MemoryBlockName):
(WebCore):
(WebCore::dumpDOMStorageCache):
(WebCore::InspectorMemoryAgent::getProcessMemoryDistribution):
(WebCore::InspectorMemoryAgent::InspectorMemoryAgent):
* inspector/InspectorMemoryAgent.h:
(WebCore):
(WebCore::InspectorMemoryAgent::create):
(InspectorMemoryAgent):
* inspector/front-end/NativeMemorySnapshotView.js:
(WebInspector.MemoryBlockViewProperties._initialize):
* storage/StorageArea.h:
(StorageArea):
* storage/StorageAreaImpl.cpp:
(WebCore::StorageAreaImpl::memoryBytesUsedByCache):
(WebCore):
* storage/StorageAreaImpl.h:
(StorageAreaImpl):

Source/WebKit/chromium:

Add memory size used for DOM storage cache reporting interface.

* src/StorageAreaProxy.cpp:
(WebCore::StorageAreaProxy::memoryBytesUsedByCache):
(WebCore):
* src/StorageAreaProxy.h:
(StorageAreaProxy):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@124332 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[GTK] Memory leak found while running webaudio tests
https://bugs.webkit.org/show_bug.cgi?id=92861

Patch by Sudarsana Nagineni <sudarsana.nagineni@linux.intel.com> on 2012-08-01
Reviewed by Philippe Normand.

Fix a memory leak in decodeAudioForBusCreation by adopting
an allocation of GInputStream.

No new tests. No change in behavior.

* platform/audio/gstreamer/AudioFileReaderGStreamer.cpp:
(WebCore::AudioFileReader::decodeAudioForBusCreation):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@124333 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Web Inspector: test native memory instrumentation code with help of unittests
https://bugs.webkit.org/show_bug.cgi?id=92743

Reviewed by Yury Semikhatsky.

Source/WebCore:

Test a part of existing Native Memory Instrumentation code with help of unit tests.
6 tests were added and two bugs were fixed.
a drive-by improvement: the method MemoryInstrumentation::addInstrumentedObject
was marked as private and addRootObject was introduced instead of it.
The new function also calls processDeferedPointers.

* bindings/v8/ScriptProfiler.cpp:
(WebCore::ScriptProfiler::collectBindingMemoryInfo):
* dom/MemoryInstrumentation.h:
(WebCore::MemoryInstrumentation::addRootObject):
(MemoryInstrumentation):
(WebCore::MemoryInstrumentation::addInstrumentedObject):
(WebCore::MemoryInstrumentation::addInstrumentedObjectImpl):
(WebCore):
(WebCore::MemoryInstrumentation::addObjectImpl):
* inspector/InspectorMemoryAgent.cpp:
(WebCore):
* inspector/MemoryInstrumentationImpl.h:
(MemoryInstrumentationImpl):

Source/WebKit/chromium:

Test a part of existing Native Memory Instrumentation code with help of unit tests.
6 tests were added and two bugs were fixed.

* WebKit.gypi:
* tests/MemoryInstrumentationTest.cpp: Added.
(WebCore):
(MemoryInstrumentationImpl):
(WebCore::MemoryInstrumentationImpl::MemoryInstrumentationImpl):
(WebCore::MemoryInstrumentationImpl::reportedSize):
(WebCore::MemoryInstrumentationImpl::countObjectSize):
(WebCore::MemoryInstrumentationImpl::processDeferredInstrumentedPointers):
(NotInstrumented):
(Instrumented):
(WebCore::Instrumented::Instrumented):
(WebCore::Instrumented::~Instrumented):
(WebCore::Instrumented::reportMemoryUsage):
(WebCore::TEST):
(InstrumentedWithOwnPtr):
(WebCore::InstrumentedWithOwnPtr::InstrumentedWithOwnPtr):
(WebCore::InstrumentedWithOwnPtr::reportMemoryUsage):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@124334 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Web Inspector: Crashes in NetworkResourcesData.
https://bugs.webkit.org/show_bug.cgi?id=92874

Reviewed by Yury Semikhatsky.

* inspector/NetworkResourcesData.cpp:
(WebCore::contentSizeInBytes):
(WebCore):
(WebCore::NetworkResourcesData::ResourceData::removeContent):
(WebCore::NetworkResourcesData::ResourceData::decodeDataToContent):
(WebCore::NetworkResourcesData::setResourceContent):
(WebCore::NetworkResourcesData::maybeDecodeDataToContent):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@124335 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Qt]REGRESSION(r123786): It made 3 fast/animation tests fail.
https://bugs.webkit.org/show_bug.cgi?id=92490

Source/WebKit/qt:

QAbstractAnimation:start() is implicitly calling updateTime
without going through the event loop. This resulted in executing
scripted animation callbacks right when registering a first callback.

Reviewed by Noam Rosenthal.

* WebCoreSupport/ChromeClientQt.cpp:
(WebCore::RefreshAnimation::scheduleAnimation):
    Invoke QAbstractAnimation::start() method through the event loop.

Source/WebKit2:

Make sure that scripted animations are also serviced when
forceRepaint is being executed. As this is what is being used for
running layout tests.
Move servicing of scripted animations and layoutIfNeeded call
into a separate function syncDisplayState.
This function can then be called from forceRepaint as well as from
performScheduledLayerFlush.

Reviewed by Noam Rosenthal.

* WebProcess/WebPage/LayerTreeCoordinator/LayerTreeCoordinator.cpp:
(WebKit::LayerTreeCoordinator::forceRepaint):
(WebKit::LayerTreeCoordinator::performScheduledLayerFlush):
(WebKit):
(WebKit::LayerTreeCoordinator::syncDisplayState):
* WebProcess/WebPage/LayerTreeCoordinator/LayerTreeCoordinator.h:
(LayerTreeCoordinator):

LayoutTests:

Reviewed by Noam Rosenthal.

* platform/qt/Skipped: Unskipping the tests listed below.
    fast/animation/request-animation-frame-cancel2.html
    fast/animation/request-animation-frame-detach-element.html
    fast/animation/request-animation-frame-during-modal.html
    fast/animation/request-animation-frame-timestamps.html
    fast/dom/Window/post-message-crash.html

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@124336 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[BlackBerry] Consolidate suppression of keyboard requests.
https://bugs.webkit.org/show_bug.cgi?id=92871

Reviewed by Antonio Gomes.

Reduce VKB requests even more by applying the filter on
all requests during processing.

Reviewed Internally by Gen Mak.

* WebKitSupport/InputHandler.cpp:
(BlackBerry::WebKit::InputHandler::focusedNodeChanged):
(BlackBerry::WebKit::InputHandler::notifyClientOfKeyboardVisibilityChange):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@124337 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[BlackBerry] Allow client side to add and remove origin access whitelist entries
https://bugs.webkit.org/show_bug.cgi?id=92790

Reviewed by Yong Li.

PR: 172658
Add two new APIs to add and remove origin access whitelist entries.
Initialize the BlackBerryAllowCrossSiteRequests WebSetting to false.

* Api/WebPage.cpp:
(BlackBerry::WebKit::WebPagePrivate::addOriginAccessWhitelistEntry):
(WebKit):
(BlackBerry::WebKit::WebPage::addOriginAccessWhitelistEntry):
(BlackBerry::WebKit::WebPagePrivate::removeOriginAccessWhitelistEntry):
(BlackBerry::WebKit::WebPage::removeOriginAccessWhitelistEntry):
* Api/WebPage.h:
* Api/WebPage_p.h:
(WebPagePrivate):
* Api/WebSettings.cpp:
(BlackBerry::WebKit::WebSettings::standardSettings):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@124338 268f45cc-cd09-0410-ab3c-d52691b4dbfc
REGRESSION(r122498): Assertion failure: m_nodeListCounts is sometimes not zero in the Document destructor
https://bugs.webkit.org/show_bug.cgi?id=92742

Reviewed by Andreas Kling.

Source/WebCore: 

The bug was caused by adoptTreeScope's not always calling unregisterNodeListCache and registerNodeListCache
on node lists that use m_atomicNameCaches and m_nameCaches.

Tests: fast/dom/NodeList/nodelist-moved-to-fragment-2.html
       fast/dom/NodeList/nodelist-moved-to-fragment.html

* dom/NodeRareData.h:
(WebCore::NodeListsNodeData::adoptTreeScope):

LayoutTests: 

Add regression tests for two types of node lists: one that uses addCacheWithName and the other that uses
addCacheWithAtomicName.

* fast/dom/NodeList/nodelist-moved-to-fragment-2-expected.txt: Added.
* fast/dom/NodeList/nodelist-moved-to-fragment-2.html: Added.
* fast/dom/NodeList/nodelist-moved-to-fragment-expected.txt: Added.
* fast/dom/NodeList/nodelist-moved-to-fragment.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@124339 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Layout Test fast/text/descent-clip-in-scaled-page.html is failing on linux since it was added
https://bugs.webkit.org/show_bug.cgi?id=91386

Reviewed by Tony Chang.

Tools:

Added font mapping from SubpixelPositioningAhem to Ahem on Linux and Android
(used in layout test fast/text/descent-clip-in-scaled-page.html).
Added font mapping from SubpixelPositioning to Times New Roman on Android to match Linux
(used in platform/chromium-linux/fast/text/chromium-linux-text-subpixel-positioning.html)

* DumpRenderTree/chromium/android_main_fonts.xml:
* DumpRenderTree/chromium/fonts.conf:

LayoutTests:

The failure was because of the caching of font data. Now use the fake font families which are
only used when subpixel text positioing is enabled. This is the same method used in
platform/chromium-linux/fast/text/chromium-linux-text-subpixel-positioning.html.

On Linux and Android, the fake font families will be mapped to Time New Roman and Ahem, respectively.
On other platforms, they will fall back to system default fonts.

* fast/text/descent-clip-in-scaled-page-expected.html:
* fast/text/descent-clip-in-scaled-page.html:
* platform/chromium/TestExpectations:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@124340 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Fix gcc 4.7 compile warnings.
https://bugs.webkit.org/show_bug.cgi?id=92797

Patch by Han Shen <shenhan@google.com> on 2012-08-01
Reviewed by Kentaro Hara.

GCC 4.7 gives (more strict) warnings on uninitialized variables,
fixed by providing initilization values.

Tested by gcc 4.7 building. No change in behavior.

* platform/graphics/filters/arm/NEONHelpers.h:
(WebCore::loadRGBA8AsFloat): Add initilizaton value for local variable.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@124341 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed, rolling out r124334.
http://trac.webkit.org/changeset/124334
https://bugs.webkit.org/show_bug.cgi?id=92879

Broke MemoryInstrumentationTest.sizeOf from webkit_unit_tests
on Chromium canaries (Requested by apavlov1 on #webkit).

Patch by Sheriff Bot <webkit.review.bot@gmail.com> on 2012-08-01

Source/WebCore:

* bindings/v8/ScriptProfiler.cpp:
(WebCore::ScriptProfiler::collectBindingMemoryInfo):
* dom/MemoryInstrumentation.h:
(WebCore::MemoryInstrumentation::addInstrumentedObject):
(MemoryInstrumentation):
(WebCore::MemoryInstrumentation::addInstrumentedObjectImpl):
* inspector/InspectorMemoryAgent.cpp:
(WebCore):
* inspector/MemoryInstrumentationImpl.h:
(MemoryInstrumentationImpl):
(WebCore::MemoryInstrumentationImpl::totalTypeSize):

Source/WebKit/chromium:

* WebKit.gypi:
* tests/MemoryInstrumentationTest.cpp: Removed.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@124342 268f45cc-cd09-0410-ab3c-d52691b4dbfc
keyring.get_password may raise an exception.
https://bugs.webkit.org/show_bug.cgi?id=92876

Patch by Arnaud Renevier <a.renevier@sisa.samsung.com> on 2012-08-01
Reviewed by Dirk Pranke.

keyring.get_password sometimes raises an exception. We wrap this call,
and also set_password to avoid breaking webkit-patch in that case.

* Scripts/webkitpy/common/net/credentials.py:
(Credentials._offer_to_store_credentials_in_keyring):
(Credentials.read_credentials):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@124343 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Regression(r124135): nrwt: --verbose logging does not work right on windows
https://bugs.webkit.org/show_bug.cgi?id=92845

Patch by Thiago Marcos P. Santos <thiago.santos@intel.com> on 2012-08-01
Reviewed by Dirk Pranke.

Disabled the failing test. The Workers spawned by this test are using Host()
instead of MockHost() and trying to access the real filesystem instead of the
MockFilesytem.

* Scripts/webkitpy/layout_tests/run_webkit_tests_integrationtest.py:
(MainTest.disabled_test_verbose):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@124344 268f45cc-cd09-0410-ab3c-d52691b4dbfc
CSS 2.1 failure: margin-collapse-012 fails
https://bugs.webkit.org/show_bug.cgi?id=80219

Reviewed by Eric Seidel.

Source/WebCore:

Tests: css2.1/20110323/margin-collapse-012.htm
       fast/css/margin-collapse-abspos-negmargin.htm

I also ran this against the full margin-collapse-* CSS 2.1 suite without regressions.

Per http://www.w3.org/TR/CSS21/box.html#collapsing-margins don't collapse the margins of
positioned blocks. Instead, just use the margin of the sibling/container to offset the
positioned block's logical top - its own margin gets added in later at
RenderBox::computePositionedLogicalHeightUsing().

* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::adjustPositionedBlock):

LayoutTests:

* css2.1/20110323/margin-collapse-012.htm: Added.
* css2.1/20110323/margin-collapse-012-expected.html: Added.
* fast/css/margin-collapse-abspos-negmargin-expected.html: Added.
* fast/css/margin-collapse-abspos-negmargin.htm: Added.

* fast/block/positioning/auto/001.html:
* fast/block/positioning/auto/002.html:
* fast/block/positioning/auto/vertical-lr/002.html:
* fast/block/positioning/auto/vertical-rl/002.html:
* fast/dynamic/staticY.html:
  Remove the margins from these tests so the results remain the same. The new results
  are consistent with FF.

* platform/chromium-linux/fast/box-sizing/box-sizing-expected.png:
* platform/chromium-win/compositing/overflow/clip-descendents-expected.txt:
* platform/chromium-win/fast/box-sizing/box-sizing-expected.txt:
  I've rebaselined these - removing the margins doesn't seem helpful.

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