[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
Roll chromium DEPS to 149416.

Unreviewed.

* DEPS:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@124348 268f45cc-cd09-0410-ab3c-d52691b4dbfc
run-perf-tests throws an exception when the output json is malformed
https://bugs.webkit.org/show_bug.cgi?id=92887

Reviewed by Dirk Pranke.

Catch exceptions and gracefully fail. Also split _generate_json into smaller methods.

* Scripts/webkitpy/performance_tests/perftestsrunner.py:
(PerfTestsRunner):
(PerfTestsRunner.run):
(PerfTestsRunner._generate_output): Extracted from _generate_json.
(PerfTestsRunner._merge_source_json): Ditto; catch all exceptions since they are too many
exceptions to consder here.
(PerfTestsRunner._merge_outputs): Ditto.
(PerfTestsRunner._generate_output_files): Extracted from _generate_json.
* Scripts/webkitpy/performance_tests/perftestsrunner_unittest.py:
(_test_run_with_json_output): Don't assert logs when we except an non-zero exit code.
(create_runner_and_setup_results_template): Extracted from test_run_generates_results_page.
(test_run_generates_results_page):
(test_run_with_bad_output_json): Added.
(test_run_with_bad_json_source): Added.
(test_run_with_upload_json):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@124349 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[CSS Regions] The regionLayoutUpdate event should be dispatched on the NamedFlow object
https://bugs.webkit.org/show_bug.cgi?id=88778

Patch by Andrei Bucur <abucur@adobe.com> on 2012-08-01
Reviewed by Adam Barth.

Spec: http://www.w3.org/TR/css3-regions/#region-flow-layout-events

Source/WebCore:

This patch implements the regionLayoutUpdate event per May 3rd CSS Regions spec recommendation.
Before this patch the event was dispatched individually on each region whenever its overflow state changed. The trigger conditions are preserved with the following additions:
- the event is dispatched when the last region is removed
- the event is not dispatched when the named flow switches to the NULL state
Also, the NamedFlow objects are not deleted if they switch to the NULL state and have listeners attached. In that scenario the JS wrapper will not release the reference
until the parent Document is destroyed.

Tests: The old tests have been modified to use the event on the NamedFlow object rather the one on the Region. New tests have been added to verify the
correct behavior in the special states of the NamedFlow (no region chain, NULL state).

* dom/Document.cpp:
(WebCore::Document::addListenerTypeIfNeeded): Listeners are not added on Nodes any more so the regionLayoutUpdate type was removed from the list.
* dom/Document.h:
* dom/EventTarget.h:
(WebCore):
* dom/EventTargetFactory.in:
* dom/Node.cpp:
* dom/Node.h:
(Node):
* dom/WebKitNamedFlow.cpp:
(WebCore::WebKitNamedFlow::eventTargetData):
(WebCore):
(WebCore::WebKitNamedFlow::ensureEventTargetData):
(WebCore::WebKitNamedFlow::dispatchRegionLayoutUpdateEvent): The 3rd May WD says the event is bubbling. However this doesn't make sense as this object doesn't belong to the DOM tree. This was fixed in the ED.
(WebCore::WebKitNamedFlow::interfaceName):
(WebCore::WebKitNamedFlow::scriptExecutionContext):
(WebCore::WebKitNamedFlow::base): Getter for the owner Document used by the wrapper to determine if the object is reachable.
* dom/WebKitNamedFlow.h:
(WebCore):
(WebKitNamedFlow):
(WebCore::WebKitNamedFlow::refEventTarget):
(WebCore::WebKitNamedFlow::derefEventTarget):
* dom/WebKitNamedFlow.idl:
* rendering/RenderFlowThread.cpp:
(WebCore::RenderFlowThread::RenderFlowThread):
(WebCore::RenderFlowThread::layout): The event dispatching is now handled by the implementation of RenderFlowThread.
(WebCore::RenderFlowThread::computeOverflowStateForRegions):
* rendering/RenderFlowThread.h:
* rendering/RenderNamedFlowThread.cpp:
(WebCore::RenderNamedFlowThread::RenderNamedFlowThread):
(WebCore::RenderNamedFlowThread::removeRegionFromThread): The layout doesn't detect changes caused by removing the last region. This case is handled separately.
(WebCore::RenderNamedFlowThread::dispatchRegionLayoutUpdateEvent):
(WebCore):
(WebCore::RenderNamedFlowThread::regionLayoutUpdateEventTimerFired):
* rendering/RenderNamedFlowThread.h:
(RenderNamedFlowThread):
* rendering/RenderRegion.cpp:
(WebCore::RenderRegion::RenderRegion):
* rendering/RenderRegion.h:
(RenderRegion):

LayoutTests:

The existing tests have been adapted to match the transition of the event on the NamedFlow interface. Also there are three more tests for the case
the region chain is removed, the flow goes in the NULL state and for the event target to match the NamedFlow object.

* fast/regions/webkit-named-flow-event-add-to-flow-expected.txt: Renamed from LayoutTests/fast/regions/region-event-add-to-flow-expected.txt.
* fast/regions/webkit-named-flow-event-add-to-flow.html: Renamed from LayoutTests/fast/regions/region-event-add-to-flow.html.
* fast/regions/webkit-named-flow-event-expected.txt: Renamed from LayoutTests/fast/regions/region-event-expected.txt.
* fast/regions/webkit-named-flow-event-no-regions-expected.txt: Added.
* fast/regions/webkit-named-flow-event-no-regions.html: Added.
* fast/regions/webkit-named-flow-event-remove-from-dom-expected.txt: Renamed from LayoutTests/fast/regions/region-event-remove-from-dom-expected.txt.
* fast/regions/webkit-named-flow-event-remove-from-dom.html: Renamed from LayoutTests/fast/regions/region-event-remove-from-dom.html.
* fast/regions/webkit-named-flow-event-remove-from-flow-expected.txt: Renamed from LayoutTests/fast/regions/region-event-remove-from-flow-expected.txt.
* fast/regions/webkit-named-flow-event-remove-from-flow.html: Renamed from LayoutTests/fast/regions/region-event-remove-from-flow.html.
* fast/regions/webkit-named-flow-event-target-expected.txt: Added.
* fast/regions/webkit-named-flow-event-target.html: Added.
* fast/regions/webkit-named-flow-event-to-null-expected.txt: Added.
* fast/regions/webkit-named-flow-event-to-null.html: Added.
* fast/regions/webkit-named-flow-event.html: Renamed from LayoutTests/fast/regions/region-event.html.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@124350 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Clean-up touchadjustment tests.
https://bugs.webkit.org/show_bug.cgi?id=92869

Reviewed by Jocelyn Turcotte.

Review and cleanup the touchadjustment tests, so they are more consistent,
uses best practices and are good examples for future touchadjustment tests.

Gather commonly used functions in touchadjustment.js.
Add HTML5 doctype to ensure strict parsing rules.
Remove redundant testRunner calls, and use js-test-post.js instead.
Fix XHTMLisms in small-target-test.html
Fix ignored offset mistake in nested-touch.html that resulted in three identical tests.

* touchadjustment/big-div-expected.txt:
* touchadjustment/big-div.html:
* touchadjustment/block-testing-expected.txt:
* touchadjustment/block-testing.html:
* touchadjustment/disabled-formelements-expected.txt:
* touchadjustment/disabled-formelements.html:
* touchadjustment/event-triggered-widgets-expected.txt:
* touchadjustment/event-triggered-widgets.html:
* touchadjustment/html-label-expected.txt:
* touchadjustment/html-label.html:
* touchadjustment/iframe.html:
* touchadjustment/nested-shadow-node.html:
* touchadjustment/nested-touch-expected.txt:
* touchadjustment/nested-touch.html:
* touchadjustment/resources/inner-frame.html:
* touchadjustment/resources/touchadjustment.js: Added.
(findAbsoluteBounds):
(nodeToString):
(touchPoint):
(offsetTouchPoint):
* touchadjustment/rotated-node-expected.txt:
* touchadjustment/rotated-node.html:
* touchadjustment/scroll-offset-expected.txt:
* touchadjustment/scroll-offset.html:
* touchadjustment/search-cancel.html:
* touchadjustment/small-target-test-expected.txt:
* touchadjustment/small-target-test.html:
* touchadjustment/touch-inlines-expected.txt:
* touchadjustment/touch-inlines.html:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@124351 268f45cc-cd09-0410-ab3c-d52691b4dbfc
MarkedBlock::sweep() should sweep another block if it can't sweep a Structure block
https://bugs.webkit.org/show_bug.cgi?id=92819

Reviewed by Geoffrey Garen.

If we are forced to allocate a new block for Structures because we are unable to safely 
sweep our pre-existing Structure blocks, we should sweep another random block so that we 
can start sweeping Structure blocks sooner.

* heap/IncrementalSweeper.cpp:
(JSC::IncrementalSweeper::doSweep): Change to use sweepNextBlock.
(JSC):
(JSC::IncrementalSweeper::sweepNextBlock): 
* heap/IncrementalSweeper.h:
(IncrementalSweeper):
* heap/MarkedAllocator.cpp:
(JSC::MarkedAllocator::tryAllocateHelper): When we can't safely sweep 
our Structure blocks, call sweepNextBlock instead.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@124352 268f45cc-cd09-0410-ab3c-d52691b4dbfc
HTMLTreeBuilder passes a wrong token when pushing the head element
https://bugs.webkit.org/show_bug.cgi?id=92838

Patch by Kwang Yul Seo <skyul@company100.net> on 2012-08-01
Reviewed by Adam Barth.

When the tree builder pushes the head element in the "after head" insertion mode,
it creates a HTMLStackItem from a wrong token.

Added HTMLConstructionSite::headStackItem() to retrieve the stack item for the head
element. Modified the tree builder to pass the correct stack item when pushing the head
element in the "after head" insertion mode.

No new tests, covered by existing tests.

* html/parser/HTMLConstructionSite.cpp:
(WebCore::HTMLConstructionSite::insertHTMLHeadElement):
* html/parser/HTMLConstructionSite.h:
(WebCore::HTMLConstructionSite::head):
(WebCore::HTMLConstructionSite::headStackItem):
(HTMLConstructionSite):
* html/parser/HTMLTreeBuilder.cpp:
(WebCore::HTMLTreeBuilder::processStartTag):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@124353 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed, rolling out r123865.
http://trac.webkit.org/changeset/123865
https://bugs.webkit.org/show_bug.cgi?id=92891

This patch is causing the style-queue to fall behind
(Requested by abarth on #webkit).

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

* Scripts/webkitpy/tool/commands/queues.py:
(AbstractReviewQueue.begin_work_queue):
(StyleQueue.__init__):
* Scripts/webkitpy/tool/commands/queues_unittest.py:
(StyleQueueTest.test_style_queue_with_style_exception):
(test_style_queue_with_watch_list_exception):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@124354 268f45cc-cd09-0410-ab3c-d52691b4dbfc
C++ code should get ClassInfo from the Structure
https://bugs.webkit.org/show_bug.cgi?id=92892

Reviewed by Geoffrey Garen.

In our march to remove ClassInfo from our JSCell object headers, we can switch 
C++ code over to grabbing the ClassInfo from the Structure since it is finally 
safe to do so now that Structure access is safe during finalization/destruction. 
The remaining JIT code changes can be done in a separate patch.

* heap/MarkedBlock.cpp:
(JSC::MarkedBlock::callDestructor): We don't want to clear the Structure any more 
since the Structure should still be valid at this point.
* heap/WeakSetInlines.h:
(JSC::WeakBlock::finalize): Ditto.
* runtime/JSCell.h:
(JSC):
* runtime/Structure.h:
(JSC::JSCell::classInfo): Move JSCell's classInfo() to Structure.h so it can be 
inline. Use a different method of getting the JSCell's Structure based on 
whether we're in GC_VALIDATION mode or not, since always using get() will cause 
infinite recursion in GC_VALIDATION mode.
(JSC):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@124355 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Fix FastMalloc build with assertions enabled.

* wtf/FastMalloc.cpp:
(WTF::TCMalloc_PageHeap::isScavengerSuspended):
(WTF::TCMalloc_PageHeap::scheduleScavenger):
(WTF::TCMalloc_PageHeap::suspendScavenger):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@124356 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Read tag names and attributes from the saved tokens in HTMLFormattingElementList::closestElementInScopeWithName(const AtomicString&)
https://bugs.webkit.org/show_bug.cgi?id=92841

Patch by Kwang Yul Seo <skyul@company100.net> on 2012-08-01
Reviewed by Adam Barth.

This is a follow-up patch for r123577.
Replaced entry.element()->hasLocalName(targetName) with entry.stackItem()->hasLocalName(targetName).

No new tests, covered by existing tests.

* html/parser/HTMLFormattingElementList.cpp:
(WebCore::HTMLFormattingElementList::closestElementInScopeWithName):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@124357 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Dropping webkit prefix from Vibration API
https://bugs.webkit.org/show_bug.cgi?id=92840

Patch by Kihong Kwon <kihong.kwon@samsung.com> on 2012-08-01
Reviewed by Adam Barth.

Source/WebCore:

Remove webkit prefix from navigator.webkitVibrate().
- Vibration API have been entered CR already.
- Firefox already implements Vibration API.

No new tests. Covered by fast/dom/navigator-vibration.html

* Modules/vibration/NavigatorVibration.cpp:
(WebCore::NavigatorVibration::vibrate):
* Modules/vibration/NavigatorVibration.h:
(NavigatorVibration):
* Modules/vibration/NavigatorVibration.idl:

LayoutTests:

Remove webkit prefix from navigator.webkitVibrate().

* fast/dom/navigator-vibration-expected.txt:
* fast/dom/navigator-vibration.html:

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