[Forms] Move wheel event handler to spin button class
https://bugs.webkit.org/show_bug.cgi?id=93928

Reviewed by Kent Tamura.

This patch moves implmentation of wheel event handling from TextFieldInput
class to SpinButtonElement class to share implementation in TextFieldInput
class, and DateTimeEditElement.

No new tests. This patch doesn't change behavior. fast/orms/number/number-wheel.html
covers this change.

* html/BaseDateAndTimeInputType.cpp: Removed handleWheelEvent() implementation.
* html/BaseDateAndTimeInputType.h:
(BaseDateAndTimeInputType): Removed handleWheelEvent() declaration.
* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::defaultEventHandler): Removed wheel event handling.
* html/InputType.cpp: Removed handleWheelEvent() implementation.
* html/InputType.h:
(InputType): Removed handleWheelEvent() declaration.
* html/NumberInputType.cpp: Removed handleWheelEvent() implementation.
* html/NumberInputType.h:
(NumberInputType): Removed handleWheelEvent() declaration.
* html/TextFieldInputType.cpp: Removed handleWheelEventForSpinButton() declaration.
(WebCore::TextFieldInputType::forwardEvent): Changed to call SpinButtonElement::forwardEvent().
* html/TextFieldInputType.h:
(TextFieldInputType): Removed handleWheelEventForSpinButton() declaration.
* html/shadow/TextControlInnerElements.cpp:
(WebCore::SpinButtonElement::forwardEvent): Moved implementation of wheel event handling code
from TextFieldInputType::handleWheelEventForSpinButton().
* html/shadow/TextControlInnerElements.h:
(SpinButtonElement): Added forwardEvent() declaration.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@125522 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Move page popup resources to separate directory
https://bugs.webkit.org/show_bug.cgi?id=93932

Reviewed by Kent Tamura.

.:

* ManualTests/forms/calendar-picker.html:
* ManualTests/forms/color-suggestion-picker.html:

Source/WebCore:

Keeping the resources organized.

No new tests.

* Resources/pagepopups/calendarPicker.css: Renamed from Source/WebCore/Resources/calendarPicker.css.
* Resources/pagepopups/calendarPicker.js: Renamed from Source/WebCore/Resources/calendarPicker.js.
* Resources/pagepopups/calendarPickerMac.css: Renamed from Source/WebCore/Resources/calendarPickerMac.css.
* Resources/pagepopups/colorSuggestionPicker.css: Renamed from Source/WebCore/Resources/colorSuggestionPicker.css.
* Resources/pagepopups/colorSuggestionPicker.js: Renamed from Source/WebCore/Resources/colorSuggestionPicker.js.
* WebCore.gyp/WebCore.gyp:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@125523 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[NRWT] Compare results between different platforms
https://bugs.webkit.org/show_bug.cgi?id=90555

Reviewed by Dirk Pranke.

* Scripts/webkitpy/layout_tests/port/base.py:
(Port.baseline_search_path):
(Port):
(Port.compare_baseline):
* Scripts/webkitpy/layout_tests/run_webkit_tests.py:
(parse_args):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@125524 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed, GTK rebaseline after r125519.

* platform/gtk/fast/dom/HTMLMeterElement/meter-appearances-capacity-expected.txt:
* platform/gtk/fast/dom/HTMLMeterElement/meter-appearances-rating-relevancy-expected.txt:
* platform/gtk/fast/dom/HTMLMeterElement/meter-boundary-values-expected.txt:
* platform/gtk/fast/dom/HTMLMeterElement/meter-element-expected.txt: Added.
* platform/gtk/fast/dom/HTMLMeterElement/meter-element-repaint-on-update-value-expected.txt: Added.
* platform/gtk/fast/dom/HTMLMeterElement/meter-optimums-expected.txt: Added.
* platform/gtk/fast/dom/HTMLMeterElement/meter-styles-changing-pseudo-expected.txt: Added.
* platform/gtk/fast/dom/HTMLMeterElement/meter-styles-expected.txt: Added.
* platform/gtk/fast/dom/HTMLMeterElement/meter-writing-mode-expected.txt:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@125525 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed, rolling out r125519.
http://trac.webkit.org/changeset/125519
https://bugs.webkit.org/show_bug.cgi?id=93945

New ref-tests caused image failures on chromium-mac bots.
(Requested by yutak on #webkit).

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

Source/WebCore:

* css/html.css:
(meter):
* html/HTMLMeterElement.cpp:
(WebCore::HTMLMeterElement::HTMLMeterElement):
(WebCore::HTMLMeterElement::createRenderer):
(WebCore::HTMLMeterElement::didElementStateChange):
(WebCore::HTMLMeterElement::createShadowSubtree):
* html/HTMLMeterElement.h:
(WebCore):
(HTMLMeterElement):
* html/shadow/MeterShadowElement.cpp:
(WebCore::MeterShadowElement::meterElement):
(WebCore::MeterShadowElement::rendererIsNeeded):
(WebCore):
* html/shadow/MeterShadowElement.h:
(WebCore):
* rendering/RenderMeter.cpp:
(WebCore::RenderMeter::RenderMeter):
(WebCore::RenderMeter::valueRatio):
* rendering/RenderMeter.h:
(RenderMeter):

LayoutTests:

* fast/dom/HTMLMeterElement/meter-clone-expected.txt:
* fast/dom/HTMLMeterElement/meter-clone.html:
* fast/dom/HTMLMeterElement/meter-element-markup-expected.txt:
* fast/dom/shadow/resources/replaced-element-styles.css:
(.progress-inner-element-like):
* fast/dom/shadow/shadowdom-for-meter-dynamic-expected.html: Removed.
* fast/dom/shadow/shadowdom-for-meter-dynamic.html: Removed.
* fast/dom/shadow/shadowdom-for-meter-expected.html: Removed.
* fast/dom/shadow/shadowdom-for-meter-multiple-expected.html: Removed.
* fast/dom/shadow/shadowdom-for-meter-multiple.html: Removed.
* fast/dom/shadow/shadowdom-for-meter-with-style-expected.html: Removed.
* fast/dom/shadow/shadowdom-for-meter-with-style.html: Removed.
* fast/dom/shadow/shadowdom-for-meter-without-appearance-expected.html: Removed.
* fast/dom/shadow/shadowdom-for-meter-without-appearance.html: Removed.
* fast/dom/shadow/shadowdom-for-meter-without-shadow-element-expected.html: Removed.
* fast/dom/shadow/shadowdom-for-meter-without-shadow-element.html: Removed.
* fast/dom/shadow/shadowdom-for-meter.html: Removed.
* platform/chromium-win/fast/dom/HTMLMeterElement/meter-appearances-capacity-expected.txt:
* platform/chromium-win/fast/dom/HTMLMeterElement/meter-appearances-rating-relevancy-expected.txt:
* platform/chromium-win/fast/dom/HTMLMeterElement/meter-boundary-values-expected.txt:
* platform/chromium-win/fast/dom/HTMLMeterElement/meter-element-expected.txt:
* platform/chromium-win/fast/dom/HTMLMeterElement/meter-element-repaint-on-update-value-expected.txt:
* platform/chromium-win/fast/dom/HTMLMeterElement/meter-optimums-expected.txt:
* platform/chromium-win/fast/dom/HTMLMeterElement/meter-styles-changing-pseudo-expected.txt:
* platform/chromium-win/fast/dom/HTMLMeterElement/meter-styles-expected.txt:
* platform/chromium-win/fast/dom/HTMLMeterElement/meter-writing-mode-expected.txt:
* platform/mac/TestExpectations:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@125526 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Web Inspector: Drop "Loading..." message from FileContentView
https://bugs.webkit.org/show_bug.cgi?id=91732

Patch by Taiju Tsuiki <tzik@chromium.org> on 2012-08-14
Reviewed by Vsevolod Vlasov.

* inspector/front-end/FileContentView.js:
(WebInspector.FileContentView.prototype.wasShown):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@125527 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[GTK] Implement smart separators for context menu in WebKit2 GTK+
https://bugs.webkit.org/show_bug.cgi?id=90449

Reviewed by Martin Robinson.

Don't add to the context menu separators that are at the very
beginning or end of the menu. Once the context menu is shown,
monitor menu items visibility to hide or show separators to make
sure they never appear in the context menu unless they are between
two visible items.

* UIProcess/API/gtk/tests/TestContextMenu.cpp:
(testContextMenuSmartSeparators):
(beforeAll):
* UIProcess/gtk/WebContextMenuProxyGtk.cpp:
(WebKit::contextMenuItemVisibilityChanged):
(WebKit):
(WebKit::WebContextMenuProxyGtk::append):
(WebKit::WebContextMenuProxyGtk::populate):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@125528 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Speech Input: wrong position was reported for scolled-down elements
https://bugs.webkit.org/show_bug.cgi?id=93634

Reviewed by Kent Tamura.

Source/WebCore:

When clicking on a speech-enabled input element, WebKit reports
the position of the element to the embedder, so that it can show
a bubble indicating that speech recognition is in progress for
the element that the user clicked on.

On a page that was scrolled, this position was being reported
erroneously: it was given relative to the frame content as opposed to
the root view, and the in-progress bubble would be shown in the wrong
place.

Test: fast/speech/bubble-position-scrolled.html

* html/shadow/TextControlInnerElements.cpp:
(WebCore::InputFieldSpeechButtonElement::startSpeechInput):

LayoutTests:

Test that the position of the speech element is passed to the embedder
corectly, i.e. where the user clicked, when the page is scrolled down.

* fast/speech/bubble-position-scrolled-expected.txt: Added.
* fast/speech/bubble-position-scrolled.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@125529 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[BlackBerry] Enable DNS prefetch
https://bugs.webkit.org/show_bug.cgi?id=93846

Reviewed by George Staikos.

Source/WebCore:

No new tests.

* PlatformBlackBerry.cmake:
* platform/blackberry/TemporaryLinkStubs.cpp:
* platform/network/blackberry/DNSBlackBerry.cpp: Copied from Source/WebCore/platform/blackberry/TemporaryLinkStubs.cpp.
(WebCore):
(WebCore::prefetchDNS):

Source/WebKit/blackberry:

* Api/WebPage.cpp:
(BlackBerry::WebKit::WebPagePrivate::init):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@125530 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Implement the plugin-types Content Security Policy directive.
https://bugs.webkit.org/show_bug.cgi?id=91919

Patch by Mike West <mkwst@chromium.org> on 2012-08-14
Reviewed by Adam Barth.

Source/WebCore:

The CSP 1.1 editor's draft defines the 'plugin-types' directive as a
mechanism for whitelisting only specific types of plugin content on a
page. A protected resource might trust only Flash content, for instance,
and could enforce that preference via a Content Security Policy of
'plugin-types application/x-shockwave-flash'. Flash would load, no other
plugin type would.

Specification details available at: https://dvcs.w3.org/hg/content-security-policy/raw-file/tip/csp-specification.dev.html#plugin-types--experimental

This experimental directive is gated on the ENABLE_CSP_NEXT flag, which
is currently only enabled in Chromium.

Tests: http/tests/security/contentSecurityPolicy/1.1/plugintypes-invalid.html
       http/tests/security/contentSecurityPolicy/1.1/plugintypes-mismatched-data.html
       http/tests/security/contentSecurityPolicy/1.1/plugintypes-mismatched-url.html
       http/tests/security/contentSecurityPolicy/1.1/plugintypes-notype-data.html
       http/tests/security/contentSecurityPolicy/1.1/plugintypes-notype-url.html
       http/tests/security/contentSecurityPolicy/1.1/plugintypes-nourl-allowed.html
       http/tests/security/contentSecurityPolicy/1.1/plugintypes-nourl-blocked.html
       http/tests/security/contentSecurityPolicy/1.1/plugintypes-url-01.html
       http/tests/security/contentSecurityPolicy/1.1/plugintypes-url-02.html

* loader/SubframeLoader.cpp:
(WebCore::SubframeLoader::pluginIsLoadable):
    Adding a check against 'allowPluginType', and passing in both the
    MIME type of the plugin, as well as the declared MIME type from the
    object/embed element (ensuring that we do this correctly, even if
    we're inside a PluginDocument).
(WebCore::SubframeLoader::createJavaAppletWidget):
    Same as 'pluginIsLoadable', but hard-coded to
    'application/x-java-applet'.
* page/ContentSecurityPolicy.cpp:
(CSPDirectiveList):
(WebCore::CSPDirectiveList::logInvalidPluginTypes):
    Plugin types that don't match the grammar ('not/a/mime/type') are
    logged to the console, and ignored for purposes of matching.
(WebCore):
(WebCore::CSPDirectiveList::checkPluginType):
    Given both the plugin type and the declared type attribute, returns
    true if both types match, and are contained in the list of accepted
    plugin types.
(WebCore::CSPDirectiveList::checkPluginTypeAndReportViolation):
    Calls out to checkPluginType, and reports a violation if that check
    fails.
(WebCore::CSPDirectiveList::allowPluginType):
    Analog to the other 'CSPDirectiveList::allowXXX' methods, this
    branches between simply checking the type against the policy, and
    checking against the policy and then reporting violations.
(WebCore::CSPDirectiveList::parsePluginTypes):
    Given a directive value, parse out the media types contained within
    by splitting on spaces, and validating each token. Valid tokens are
    added to 'm_pluginTypes' for use in 'checkPluginType'.
(WebCore::CSPDirectiveList::addDirective):
    Wire up 'plugin-types' as a valid directive (if the ENABLE_CSP_NEXT
    flag is set). This has been combined with the other implemented 1.1
    header, 'script-nonce'.
(WebCore::ContentSecurityPolicy::allowPluginType):
    The public interface to this set of functionality.
* page/ContentSecurityPolicy.h:

LayoutTests:

* http/tests/plugins/resources/mock-plugin-unknown-type.pl:
    Adding a mock plugin resource that is served with a type that WebKit
    doesn't understand. Using it to test a confusion attack in
    plugintypes-url-02.
* http/tests/security/contentSecurityPolicy/1.1/plugintypes-invalid-expected.txt: Added.
* http/tests/security/contentSecurityPolicy/1.1/plugintypes-invalid.html: Added.
* http/tests/security/contentSecurityPolicy/1.1/plugintypes-mismatched-data-expected.txt: Added.
* http/tests/security/contentSecurityPolicy/1.1/plugintypes-mismatched-data.html: Added.
* http/tests/security/contentSecurityPolicy/1.1/plugintypes-mismatched-url-expected.txt: Added.
* http/tests/security/contentSecurityPolicy/1.1/plugintypes-mismatched-url.html: Added.
* http/tests/security/contentSecurityPolicy/1.1/plugintypes-notype-data-expected.txt: Added.
* http/tests/security/contentSecurityPolicy/1.1/plugintypes-notype-data.html: Added.
* http/tests/security/contentSecurityPolicy/1.1/plugintypes-notype-url-expected.txt: Added.
* http/tests/security/contentSecurityPolicy/1.1/plugintypes-notype-url.html: Added.
* http/tests/security/contentSecurityPolicy/1.1/plugintypes-nourl-allowed-expected.txt: Added.
* http/tests/security/contentSecurityPolicy/1.1/plugintypes-nourl-allowed.html: Added.
* http/tests/security/contentSecurityPolicy/1.1/plugintypes-nourl-blocked-expected.txt: Added.
* http/tests/security/contentSecurityPolicy/1.1/plugintypes-nourl-blocked.html: Added.
* http/tests/security/contentSecurityPolicy/1.1/plugintypes-url-01-expected.txt: Added.
* http/tests/security/contentSecurityPolicy/1.1/plugintypes-url-01.html: Added.
* http/tests/security/contentSecurityPolicy/1.1/plugintypes-url-02-expected.txt: Added.
* http/tests/security/contentSecurityPolicy/1.1/plugintypes-url-02.html: Added.
* http/tests/security/contentSecurityPolicy/object-src-none-allowed.html:
* http/tests/security/contentSecurityPolicy/object-src-none-blocked.html:
    Renaming the `q` parameter to `plugin` in these two tests.
* http/tests/security/contentSecurityPolicy/resources/echo-object-data.pl:
    Add output of explicit MIME types to the object data renderer, and
    changed the `q` parameter to be slightly less confusingly named.
    It's now `plugin`.
* http/tests/security/contentSecurityPolicy/resources/multiple-iframe-plugin-test.js: Added.
    Copy `multiple-iframe-test.js`, and add in plugin-specific details,
    like `plugin`, `log`, and `type`.
(test):
(finishTesting):

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

* platform/gtk/TestExpectations: Skip media-source tests, the GTK
port doesn't support this feature yet and the tests time out.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@125532 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[GTK] REGRESSION (r122428) WebKit2APITests/TestWebKitFindController fails "next" test
https://bugs.webkit.org/show_bug.cgi?id=91083

Reviewed by Carlos Garcia Campos.

Source/WebKit2:

After r122428 search_next()/search_prev() should return just 1 match
if the text is found.

* UIProcess/API/gtk/tests/TestWebKitFindController.cpp:
(testFindControllerNext):
(testFindControllerPrevious):

Tools:

Unskipped a couple of API tests that should work fine from now on.

* Scripts/run-gtk-tests:
(TestRunner):

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