Split EWS tool cold-boot.sh into modular components
https://bugs.webkit.org/show_bug.cgi?id=106527

Patch by Alan Cutter <alancutter@chromium.org> on 2013-01-10
Reviewed by Adam Barth.

Split cold-boot.sh script up into build-vm.sh, build-repo.sh and build-boot-cmd.sh.
Updated GCE bot build scripts to match.
Unable to test scripts directly as they depend on being in the repository to work!

* EWSTools/GoogleComputeEngine/build-chromium-ews.sh:
* EWSTools/GoogleComputeEngine/build-commit-queue.sh:
* EWSTools/build-boot-cmd.sh: Copied from Tools/EWSTools/GoogleComputeEngine/build-chromium-ews.sh.
* EWSTools/build-repo.sh: Copied from Tools/EWSTools/cold-boot.sh.
* EWSTools/build-vm.sh: Renamed from Tools/EWSTools/cold-boot.sh.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@139354 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[chromium] move webpermissionclient related methods to TestRunner library
https://bugs.webkit.org/show_bug.cgi?id=106548

Patch by Dan Carney <dcarney@google.com> on 2013-01-10
Reviewed by Jochen Eisinger.

* DumpRenderTree/DumpRenderTree.gypi:
* DumpRenderTree/chromium/DRTTestRunner.cpp:
(DRTTestRunner::DRTTestRunner):
(DRTTestRunner::reset):
* DumpRenderTree/chromium/DRTTestRunner.h:
(DRTTestRunner):
* DumpRenderTree/chromium/TestRunner/public/WebTestDelegate.h:
(WebTestRunner::WebTestDelegate::normalizeLayoutTestURL):
* DumpRenderTree/chromium/TestRunner/public/WebTestRunner.h:
(WebKit):
(WebTestRunner::WebTestRunner::webPermissions):
* DumpRenderTree/chromium/TestRunner/src/TestRunner.cpp:
(WebTestRunner::TestRunner::TestRunner):
(WebTestRunner::TestRunner::setDelegate):
(WebTestRunner):
(WebTestRunner::TestRunner::reset):
(WebTestRunner::TestRunner::webPermissions):
(WebTestRunner::TestRunner::dumpPermissionClientCallbacks):
(WebTestRunner::TestRunner::setImagesAllowed):
(WebTestRunner::TestRunner::setScriptsAllowed):
(WebTestRunner::TestRunner::setStorageAllowed):
(WebTestRunner::TestRunner::setPluginsAllowed):
(WebTestRunner::TestRunner::setAllowDisplayOfInsecureContent):
(WebTestRunner::TestRunner::setAllowRunningOfInsecureContent):
* DumpRenderTree/chromium/TestRunner/src/TestRunner.h:
(WebTestRunner):
(TestRunner):
* DumpRenderTree/chromium/TestRunner/src/WebPermissions.cpp: Renamed from Tools/DumpRenderTree/chromium/WebPermissions.cpp.
(WebTestRunner):
(WebTestRunner::WebPermissions::WebPermissions):
(WebTestRunner::WebPermissions::~WebPermissions):
(WebTestRunner::WebPermissions::allowImage):
(WebTestRunner::WebPermissions::allowScriptFromSource):
(WebTestRunner::WebPermissions::allowStorage):
(WebTestRunner::WebPermissions::allowPlugins):
(WebTestRunner::WebPermissions::allowDisplayingInsecureContent):
(WebTestRunner::WebPermissions::allowRunningInsecureContent):
(WebTestRunner::WebPermissions::setImagesAllowed):
(WebTestRunner::WebPermissions::setScriptsAllowed):
(WebTestRunner::WebPermissions::setStorageAllowed):
(WebTestRunner::WebPermissions::setPluginsAllowed):
(WebTestRunner::WebPermissions::setDisplayingInsecureContentAllowed):
(WebTestRunner::WebPermissions::setRunningInsecureContentAllowed):
(WebTestRunner::WebPermissions::setDelegate):
(WebTestRunner::WebPermissions::setDumpCallbacks):
(WebTestRunner::WebPermissions::reset):
* DumpRenderTree/chromium/TestRunner/src/WebPermissions.h: Renamed from Tools/DumpRenderTree/chromium/WebPermissions.h.
(WebTestRunner):
(WebPermissions):
* DumpRenderTree/chromium/TestShell.cpp:
(TestShell::initialize):
(TestShell::resetTestController):
(TestShell::createNewWindow):
* DumpRenderTree/chromium/TestShell.h:
(TestShell):
* DumpRenderTree/chromium/WebViewHost.cpp:
(WebViewHost::normalizeLayoutTestURL):
* DumpRenderTree/chromium/WebViewHost.h:
(WebViewHost):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@139355 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Fix scale of screen.width, window.outerWidth and @media device-width when page scale not applied in compositor.
https://bugs.webkit.org/show_bug.cgi?id=106460

Patch by John Mellor <johnme@chromium.org> on 2013-01-10
Reviewed by Kenneth Rohde Christiansen.

Source/WebCore:

screen.width, window.outerWidth and @media device-width should be in
density independent (UI) pixels, not physical screen pixels.

This already works on most ports (including iOS). However Chrome for
Android currently internally sizes its windows in physical screen pixels
instead of density independent pixels, and this leaks through in the
sizes provided to WebCore.

This patch scales these sizes appropriately before they reach JavaScript,
on platforms where the applyPageScaleFactorInCompositor setting is false
(i.e. just Chrome for Android). Once Chrome for Android switches over to
the same coordinate space, the applyPageScaleFactorInCompositor setting
will be removed, along with any code (such as this) that depends on it.

The effect of this patch on Chrome for Android when viewing a page with
a width=device-width viewport on a Galaxy Nexus (720x1280 @ dPR 2) is:
    @media device-width      changes from 720 to 360
    screen.width             changes from 720 to 360
    screen.availWidth        changes from 720 to 360
    window.outerWidth        changes from 720 to 360
    window.innerWidth                    remains 360 (at overview zoom)
    @media width                         remains 360
    document.documentElement.clientWidth remains 360
    document.documentElement.offsetWidth remains 360
    document.documentElement.scrollWidth remains 360
    document.body.clientWidth            remains 360
    document.body.offsetWidth            remains 360
    document.body.scrollWidth            remains 360
And similarly for heights (though they are slightly less than 640, since
toolbars etc. get subtracted from the available height).

No new tests, as applyDeviceScaleFactorInCompositor appears to always be
true in DumpRenderTree, so this situation cannot occur there.

* page/Settings.in:
    Added applyDeviceScaleFactorInCompositor setting, which allows
    detecting whether we need to normalize the scale.
* platform/chromium/PlatformScreenChromium.cpp:
(WebCore::toUserSpace):
    Static function for normalizing screen rect scale.
(WebCore::screenRect):
    Uses toUserSpace.
(WebCore::screenAvailableRect):
    Uses toUserSpace.
* rendering/TextAutosizer.cpp:
(WebCore::TextAutosizer::processSubtree):
    Use applyDeviceScaleFactorInCompositor instead of
    applyPageScaleFactorInCompositor, to scale the window rect correctly
    on platforms other than Chrome for Android.

Source/WebKit/chromium:

1. Exposes the existing applyDeviceScaleFactorInCompositor from
WebSettings on Settings (and stores the value there instead), so it can
be accessed from WebCore.

2. Changes ChromeClientImpl::windowRect to return values in density
independent (UI) pixels pixels instead of physical screen pixels (see
explanation in Source/WebCore/ChangeLog).

* src/ChromeClientImpl.cpp:
(WebKit::ChromeClientImpl::windowRect):
    Normalizes window rect scale.
* src/WebSettingsImpl.cpp:
(WebKit::WebSettingsImpl::WebSettingsImpl):
(WebKit::WebSettingsImpl::setApplyDeviceScaleFactorInCompositor):
(WebKit::WebSettingsImpl::applyDeviceScaleFactorInCompositor):
(WebKit):
* src/WebSettingsImpl.h:
(WebSettingsImpl):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@139356 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Add Mac WK2 EWS bots
https://bugs.webkit.org/show_bug.cgi?id=106590

Reviewed by Adam Barth.

Added MacWK2EWS, and made myself a watcher for MacEWS and MacWK2EWS.
Also add a deprecated MacWK2Port class.

* QueueStatusServer/model/queues.py:
(Queue):
* Scripts/webkitpy/common/config/ports.py:
(DeprecatedPort.port):
(MacWK2Port):
(MacWK2Port.run_webkit_tests_command):
* Scripts/webkitpy/tool/commands/earlywarningsystem.py:
(MacEWS):
(MacWK2EWS):
* Scripts/webkitpy/tool/commands/earlywarningsystem_unittest.py:
(_test_ewses):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@139357 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[EFL][jhbuild] Use tarballs for gstreamer instead of git
https://bugs.webkit.org/show_bug.cgi?id=106552

Reviewed by Laszlo Gombos.

Use tarballs for gstreamer instead of git in EFL's jhbuild
to work around intermittent network issues on our build
bots. Tarballs are fully cached and require no network
operation if their checksum matches.

* efl/jhbuild.modules:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@139360 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed GTK gardening.

Expanding the timeout expectation for fast/css/user-drag-none.html, the test
times out on both debug and release builds.

* platform/gtk/TestExpectations:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@139361 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[WK2] Set IndexedDB database path in WK2
https://bugs.webkit.org/show_bug.cgi?id=106257

Patch by Michael Pruett <michael@68k.org> on 2013-01-10
Reviewed by Benjamin Poulain.

* WebProcess/KeyValueStorage/WebKeyValueStorageManager.cpp:
(WebKit::WebKeyValueStorageManager::initialize):
* WebProcess/KeyValueStorage/WebKeyValueStorageManager.h:
(WebKeyValueStorageManager):
(WebKit::WebKeyValueStorageManager::indexedDBDatabaseDirectory):
* WebProcess/WebPage/WebPageGroupProxy.cpp:
(WebKit::WebPageGroupProxy::WebPageGroupProxy):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@139364 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Regression(r129944): Heap-use-after-free in WebCore::computeNonFastScrollableRegion
https://bugs.webkit.org/show_bug.cgi?id=99515

Reviewed by Simon Fraser.

The object used-after-freed is a destructed FrameView that is still in the m_scrollableAreas set of the parent FrameView. Actually it has been removed from m_scrollableAreas when setParent(0), but then is added back in updateScrollableAreaSet() because its frameViewParent() is still not 0 (though parent() is already 0).

No new tests. The heap-use-after-free doesn't always cause crash so it can't be stably tested with a test case. Memory analysis tools like asan discovered the heap-use-after-free and verified that the patch can fix the issue.

* page/FrameView.cpp:
(WebCore::FrameView::parentFrameView): Checks if the FrameView has been removed from the parent.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@139365 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Chromium] Layout Test svg/dom/SVGScriptElement/script-onerror-bubbling.svg is a flaky timeout on all platforms.
https://bugs.webkit.org/show_bug.cgi?id=106598

* platform/chromium/TestExpectations: Expectatized.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@139366 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Add an ENABLE macro and a WebCore::Setting for the threaded parser
https://bugs.webkit.org/show_bug.cgi?id=106595

Reviewed by Benjamin Poulain.

Source/WebCore: 

This patch adds both a WebCore::Setting and an ENABLE macro for the
threaded parser. We plan to keep the ENABLE macro off by default for a
while. The runtime setting will let us more easily conduct A/B
experiments when the time arises.

* page/Settings.in:

Source/WebKit/chromium: 

Explicitly disable THREADED_HTML_PARSER for Chromium so that we can
more easily enable it locally.

* features.gypi:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@139367 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Update WebkitSystemInterface lib for Windows port.
This hasn't been done in a while and the current one is out of date.
In addition I believe it will fix:
<rdar://problem/12990844>

Rubberstamped by Timothy Horton.

* win/lib/WebKitSystemInterface.lib:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@139368 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed, rolling out r139226.
http://trac.webkit.org/changeset/139226
https://bugs.webkit.org/show_bug.cgi?id=106602

re
baselines were premature (Requested by rfong on #webkit).

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

* platform/win/accessibility/canvas-fallback-content-2-expected.txt:
* platform/win/platform/win/accessibility/option-element-selection-and-focus-events-expected.txt: Removed.
* platform/win/platform/win/accessibility/select-element-valuechange-event-expected.txt: Removed.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@139369 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed rebaselines. Apple Windows port.

* platform/win/TestExpectations:
* platform/win/fast/dom/window-load-crash-expected.txt: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@139370 268f45cc-cd09-0410-ab3c-d52691b4dbfc
HTMLMediaElement::resume() should schedule a load rather than load immediately
https://bugs.webkit.org/show_bug.cgi?id=106587

Reviewed by Eric Carlson.

It is not always safe to start the jobs at the time resume() is called. That is why the jobs are
suspended. It can also be suspended again right after being resumed.

No new tests as there is no visible functional change, also it is a theoretically good-to-have change
that doesn't fix any known cross-platform issue.

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::resume): Replace load() with scheduleLoad().


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@139371 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Implement AutocompleteErrorEvent#reason
https://bugs.webkit.org/show_bug.cgi?id=105568

Source/WebCore:

Patch by Dan Beam <dbeam@chromium.org> on 2013-01-10
Reviewed by Adam Barth.

Test: fast/events/constructors/autocomplete-error-event-constructor.html

* WebCore.gypi: Added AutocompleteErrorEvent.idl and AutocompleteErrorEvent.h for chromium port's build.
* dom/AutocompleteErrorEvent.h: Added.
(WebCore): Added new type of error named AutocompleteErrorEvent.
(AutocompleteErrorEventInit): Added init params for AutocompleteErrorEvents (so initEvent() can be used).
(AutocompleteErrorEvent): Added a new error event that inherits from Event but also has a reason for failure.
(WebCore::AutocompleteErrorEvent::create): Factory function to create AutocompleteErrorEvents.
(WebCore::AutocompleteErrorEvent::reason): The reason why a requestAutocomplete() invocation failed. Can be
                                           "disabled", "cancel", or "invalid".
(WebCore::AutocompleteErrorEvent::interfaceName): The name of the event's interface (for event.toString()).
(WebCore::AutocompleteErrorEvent::AutocompleteErrorEvent): Various ways of constructing the error event.
* dom/AutocompleteErrorEvent.idl: Added.
* dom/EventNames.in: Added AutocompleteError to this list, based on REQUEST_AUTOCOMPLETE conditional.
* html/HTMLFormElement.cpp: Updated form elements to dispatch AutocompleteErrorEvents on errors and to give
                            more details (event.reason) when the request fails.
(WebCore::HTMLFormElement::requestAutocomplete): Changed to newly added failure type "disabled".
(WebCore::HTMLFormElement::finishRequestAutocomplete): Changed
* html/HTMLFormElement.h: Added new results (ErrorDisabled, ErrorCancel, ErrorInvalid).
* page/DOMWindow.idl: Added global event constructor for new AutocompleteErrorEvent() style event creation.

Source/WebKit/chromium:

Patch by Dan Beam <dbeam@chromium.org> on 2013-01-10
Reviewed by Adam Barth.

* public/WebFormElement.h: Added matching enum values for public chromium WebKit API.
* src/AssertMatchingEnums.cpp: Updated compile assert that WebKit and WebCore enums match.

LayoutTests:

Added tests to verify event creation and global event constructor existence of AutocompleteErrorEvent
and updated the existing tests to make sure errors received are of the right type and have the right reason.

Patch by Dan Beam <dbeam@chromium.org> on 2013-01-10
Reviewed by Adam Barth.

* fast/events/constructors/autocomplete-error-event-constructor-expected.txt: Added.
* fast/events/constructors/autocomplete-error-event-constructor.html: Added.
* fast/events/event-creation.html: Added new AutocompleteErrorEvent() test case.
* fast/forms/form-request-autocomplete.html: Updated 'autocompleteerror' listeners to check event.reason.
* fast/js/constructor-length.html: Added AutocompleteErrorEvent to list.
* fast/js/script-tests/global-constructors.js: Added AutocompleteErrorEvent to list.
* platform/blackberry/fast/js/constructor-length-expected.txt: Added expected ReferenceError.
* platform/chromium/fast/events/constructors/autocomplete-error-event-constructor-expected.txt: Added.
* platform/chromium/fast/forms/form-request-autocomplete-expected.txt: Updated passing expectations.
* platform/chromium/fast/js/constructor-length-expected.txt: Added expected 0 length result.
* platform/gtk/fast/js/constructor-length-expected.txt: Added expected ReferenceError.
* platform/mac/fast/js/constructor-length-expected.txt: Added expected ReferenceError.
* platform/qt/fast/js/constructor-length-expected.txt: Added expected ReferenceError.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@139372 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Chromium] Layout Test fast/canvas/webgl/context-release-upon-reload.html is a flaky timeout.
https://bugs.webkit.org/show_bug.cgi?id=106606

* platform/chromium/TestExpectations: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@139373 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed rebaseline. Apple Windows port.

* platform/win/fast/ruby/base-shorter-than-text-expected.txt:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@139374 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Adjust ref-test expectation to actual work.

* platform/chromium/TestExpectations: Adjusted.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@139375 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Chromium] Layout Test animations/fill-mode-iteration-count-non-integer.html is failing.
https://bugs.webkit.org/show_bug.cgi?id=106609

* platform/chromium/TestExpectations: Marked as failing.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@139376 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Qt][EFL] Rename from xxxContentsScale() to xxxScale() in PageViewportController.
https://bugs.webkit.org/show_bug.cgi?id=106537

Patch by Huang Dongsung <luxtella@company100.net> on 2013-01-10
Reviewed by Kenneth Rohde Christiansen.

Rename 3 methods to match the terms of ViewportAttributes.

* UIProcess/API/qt/qwebkittest.cpp:
(QWebKitTest::viewport):
(QWebKitTest::contentsScale):
* UIProcess/PageViewportController.h:
(WebKit::PageViewportController::minimumScale):
(WebKit::PageViewportController::maximumScale):
(WebKit::PageViewportController::currentScale):
* UIProcess/qt/PageViewportControllerClientQt.cpp:
(WebKit::PageViewportControllerClientQt::zoomToAreaGestureEnded):

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