Web Inspector: improve standalone test harness to allow attaching to inspector before test.
https://bugs.webkit.org/show_bug.cgi?id=94426

Reviewed by Vsevolod Vlasov.

- User can not "Debug", attach inspector to the front-end and "Continue" test execution.
- You can also assign filter from the query parameter.

* inspector/front-end/test-runner.html:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@126016 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[GTK] Add API to set preferred languages to WebKit2 GTK+
https://bugs.webkit.org/show_bug.cgi?id=90878

Source/WebCore:

Unreviewed. Fix mac build.

* WebCore.exp.in: Export WebCore::languageDidChange().

Source/WebKit2:

Reviewed by Martin Robinson.

* UIProcess/API/gtk/WebKitWebContext.cpp:
(webkit_web_context_set_preferred_languages): Public API to set a
list of preferred languages sorted from most desirable to least
desirable.
* UIProcess/API/gtk/WebKitWebContext.h:
* UIProcess/API/gtk/docs/webkit2gtk-sections.txt: Add new symbol.
* UIProcess/API/gtk/tests/TestWebKitWebContext.cpp:
(testWebContextLanguages):
(serverCallback):
(beforeAll):
(afterAll):
* UIProcess/API/gtk/tests/WebViewTest.cpp:
(resourceGetDataCallback):
(WebViewTest::mainResourceData): Moved from TestWebKitWebContext
to make it available to all WebViewTests.
* UIProcess/API/gtk/tests/WebViewTest.h:
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::userPreferredLanguagesChanged): Notify our
observer that the languages have been overriden.
* WebProcess/gtk/WebProcessGtk.cpp:
(WebKit::buildAcceptLanguages): Helper function to build the
accept languages as specified in RFC 2616.
(WebKit::setSoupSessionAcceptLanguage): Set the accept-language
property of the default SoupSession.
(WebKit::languageChanged): Update the preferred languages in
SoupSession.
(WebKit::WebProcess::platformInitializeWebProcess): Add an
observer to be notified when the list of preferred languages is
updated.
(WebKit::WebProcess::platformTerminate): Remove the observer added
in platformInitializeWebProcess().

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@126017 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[chromium] Convert screen space scroll gestures to layer space
https://bugs.webkit.org/show_bug.cgi?id=92499

Patch by Sami Kyostila <skyostil@chromium.org> on 2012-08-20
Reviewed by James Robinson.

Source/WebCore:

Scroll gestures should be converted from screen space to local layer space to
correctly apply the scroll delta to page scaled and/or transformed layers.
Visually this means that the scrolled content will always follow the user's
finger for any "well-formed" layer transform.

Wheel scroll deltas will still be directly interpreted as local layer scroll
coordinates.

We also adjust the logic for propagating ("bubbling") scroll events to parent
layers. Previously a parent layer was allowed to scroll in the screen-space
axis orthogonal to the direction the starting layer scrolled toward. For
example if a vertically scrolling layer is scrolled diagonally down and right,
the layer moves down and its parent to the right.

This patch generalizes this behavior to non-axis aligned transformed layers so
that the scrolling direction of any parent is constrained to be perpendicular
direction of movement of the starting layer. This makes the scrolling behavior
of transformed layers physically plausible. For instance, assume a 45 degree
rotated, vertically scrollable layer. Dragging your finger vertically
(relative to the layer) scrolls the layer up and down, while horizontal
movement results in the parent of the layer moving in a corresponding way.

Since generally users want to scroll a single layer in one direction, this
patch also introduces a rule that if the resulting movement of a layer is
within 45 degrees of the original scroll input, the bubbling process is
stopped. This makes it possible to reliably scroll a single layer without
affecting any of its parents.

Added new unit tests:
    CCLayerTreeHostImplTest.scrollAxisAlignedRotatedLayer
    CCLayerTreeHostImplTest.scrollNonAxisAlignedRotatedLayer
    CCLayerTreeHostImplTest.scrollScaledLayer
    CCMathUtilTest.smallestAngleBetweenVectors
    CCMathUtilTest.vectorProjection

* platform/graphics/chromium/cc/CCInputHandler.h:
* platform/graphics/chromium/cc/CCLayerTreeHostImpl.cpp:
(WebCore::CCLayerTreeHostImpl::CCLayerTreeHostImpl):
(WebCore::CCLayerTreeHostImpl::scrollBegin):
(WebCore::scrollLayerWithScreenSpaceDelta):
(WebCore):
(WebCore::scrollLayerWithLocalDelta):
(WebCore::CCLayerTreeHostImpl::scrollBy):
* platform/graphics/chromium/cc/CCLayerTreeHostImpl.h:
(CCLayerTreeHostImpl):
* platform/graphics/chromium/cc/CCMathUtil.cpp:
(WebCore::CCMathUtil::smallestAngleBetweenVectors):
(WebCore):
(WebCore::CCMathUtil::projectVector):
* platform/graphics/chromium/cc/CCMathUtil.h:
(CCMathUtil):

Source/WebKit/chromium:

Added new tests for verifying transformed layer scrolling:

    CCLayerTreeHostImplTest.scrollAxisAlignedRotatedLayer
    CCLayerTreeHostImplTest.scrollNonAxisAlignedRotatedLayer
    CCLayerTreeHostImplTest.scrollScaledLayer

Also some tests for the introduced math utilities:

    CCMathUtilTest.smallestAngleBetweenVectors
    CCMathUtilTest.vectorProjection

* src/WebCompositorInputHandlerImpl.cpp:
(WebKit::WebCompositorInputHandlerImpl::handleInputEventInternal):
(WebKit::WebCompositorInputHandlerImpl::handleGestureFling):
* tests/CCLayerTreeHostImplTest.cpp: Adjusted scroll delta in scrollChildBeyondLimit to avoid triggering the 45 degree rule.
* tests/CCLayerTreeHostTest.cpp:
* tests/CCMathUtilTest.cpp:
* tests/WebCompositorInputHandlerImplTest.cpp:
(MockCCInputHandlerClient):
(WebKit::TEST_F):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@126018 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[EFL][WK2] Add unit tests for WKEinaSharedString
https://bugs.webkit.org/show_bug.cgi?id=94104

Patch by Mikhail Pozdnyakov <mikhail.pozdnyakov@intel.com> on 2012-08-20
Reviewed by Kenneth Rohde Christiansen.

Added unit tests for WKEinaSharedString class.

* PlatformEfl.cmake:
* UIProcess/API/efl/tests/test_ewk2_eina_shared_string.cpp: Added.
(checkString):
(TEST_F):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@126019 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[EFL] Update flaky tests to make the bots green
https://bugs.webkit.org/show_bug.cgi?id=94467

Unreviewed EFL gardening. Mark several tests as
flaky in order to make the bots green.

Patch by Christophe Dumez <christophe.dumez@intel.com> on 2012-08-20

* platform/efl/TestExpectations:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@126020 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[GTK] Provide backwards compatible method for WebKitDOMWebKitNamedFlow::overflow
https://bugs.webkit.org/show_bug.cgi?id=94464

Patch by Xan Lopez <xlopez@igalia.com> on 2012-08-20
Reviewed by Carlos Garcia Campos.

Provide a compatibility method to access the new 'overset'
property through the old 'overflow' name in
WebKitDOMWebKitNamedFlow. Note that trying to access it through
g_object_get directly will give a runtime warning, since the
property does not actually exist anymore; this is done purely to
maintain API compatibility.

* bindings/gobject/WebKitDOMCustom.cpp:
(webkit_dom_webkit_named_flow_get_overflow): add method.
* bindings/gobject/WebKitDOMCustom.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@126021 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Regression(r124945): Build is broken when touch events is disabled
https://bugs.webkit.org/show_bug.cgi?id=94466

Patch by Thiago Marcos P. Santos <thiago.santos@intel.com> on 2012-08-20
Reviewed by Kenneth Rohde Christiansen.

Added missing guards around touch events code.

* ewk/ewk_touch_event.cpp:
* ewk/ewk_touch_event_private.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@126022 268f45cc-cd09-0410-ab3c-d52691b4dbfc
The 2d.imageData.object.round canvas test is failing
https://bugs.webkit.org/show_bug.cgi?id=40272

Patch by Dominik Röttsches <dominik.rottsches@intel.com> on 2012-08-20
Reviewed by Kenneth Rohde Christiansen.

Source/WTF:

According to the Uint8ClampedArray spec (http://www.khronos.org/registry/typedarray/specs/latest/#7.1)
which references WebIDL's clamping rules, with implications defined in http://www.w3.org/TR/WebIDL/#es-octet
we need to round to nearest integer, and to the even one if exactly halfway in between.
As a solution: applying C99's lrint which, in default rounding mode, does that.

The updated version of test 2d.imageData.object.round.html test passes now.

* wtf/MathExtras.h:
(lrint): Assembly based implementation for MSVC under X86, otherwise falling back to casting.
* wtf/Uint8ClampedArray.h:
(WTF::Uint8ClampedArray::set): lrint instead of simple rounding.

LayoutTests:

Fixing expectations for the imageData rounding test, unskipping the tests on all ports.

* canvas/philip/tests/2d.imageData.object.round.html: Fixing expected results according to "round to even in halfway case".
* fast/canvas/canvas-ImageData-behaviour-expected.txt: Fixing expected results according to "round to even in halfway case".
* fast/canvas/canvas-ImageData-behaviour.js: Fixing expected results according to "round to even in halfway case".
* platform/chromium/TestExpectations: Updating bug id for 2d.imageData.object.round.html and for wrap case, adding SVG case for rebaselining.
* platform/efl/Skipped: 2d.imageData.object.round.html
* platform/efl/TestExpectations: Moving 2d.imageData.object.wrap.html case here with new bug id.
* platform/gtk/TestExpectations: Unskippng 2d.imageData.object.round.html, updating bug id for wrap case.
* platform/mac/Skipped: Unskipping 2d.imageData.object.round.html.
* platform/qt/Skipped: Unskipping 2d.imageData.object.round.html.

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

Fixing the failure expectations for a flaky crasher XFrameOptions test
in debug builds. When it doesn't crash it fails due to text diff.

* platform/gtk/TestExpectations:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@126024 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Not reviewed: fixing flaky inspector test.

* http/tests/inspector/resource-tree/resource-tree-frame-navigate.html:
* http/tests/inspector/resource-tree/resource-tree-test.js:
(initialize_ResourceTreeTest.InspectorTest.dumpResourcesTree):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@126025 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[TouchAdjustment] Adjust to word or selection
https://bugs.webkit.org/show_bug.cgi?id=94449

Reviewed by Antonio Gomes.

Source/WebCore:

Makes each separate word a separate subtarget when context menu triggers
selections, and only the selected part of a partial selected node a
target when selections are not overridden.

Test: touchadjustment/context-menu-text-subtargets.html

* page/TouchAdjustment.cpp:
(TouchAdjustment):
(WebCore::TouchAdjustment::providesContextMenuItems):
(WebCore::TouchAdjustment::appendQuadsToSubtargetList):
(WebCore::TouchAdjustment::appendBasicSubtargetsForNode):
(WebCore::TouchAdjustment::appendContextSubtargetsForNode):
(WebCore::TouchAdjustment::compileSubtargetList):
(WebCore::findBestClickableCandidate):
(WebCore::findBestContextMenuCandidate):

LayoutTests:

Tests that touch-adjustment can adjust to the right subtargets within text-nodes.

* touchadjustment/context-menu-select-text.html:
* touchadjustment/context-menu-text-subtargets-expected.txt: Added.
* touchadjustment/context-menu-text-subtargets.html: Added.
* touchadjustment/resources/touchadjustment.js:
(pointToString):
(shouldBeWithin):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@126026 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Update canvas tests that are using CanvasPixelArray
https://bugs.webkit.org/show_bug.cgi?id=94474

Patch by Thiago Marcos P. Santos <thiago.santos@intel.com> on 2012-08-20
Reviewed by Andreas Kling.

CanvasPixelArray is deprecated. W3C already updated these tests on the
approved tests repository. Using Uint8ClampedArray, they now pass on
WebKit.

* canvas/philip/tests/2d.imageData.create1.type.html:
* canvas/philip/tests/2d.imageData.create2.type.html:
* canvas/philip/tests/2d.imageData.get.type.html:
* platform/chromium/TestExpectations:
* platform/efl/Skipped:
* platform/gtk/TestExpectations:
* platform/mac/canvas/philip/tests/2d.imageData.create1.type-expected.txt: Removed.
* platform/mac/canvas/philip/tests/2d.imageData.create2.type-expected.txt: Removed.
* platform/mac/canvas/philip/tests/2d.imageData.get.type-expected.txt: Removed.
* platform/qt/Skipped:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@126027 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Web Inspector: [WebGL] Add minimum transport protocol from backend to frontend
https://bugs.webkit.org/show_bug.cgi?id=88973

Patch by Andrey Adaikin <aandrey@chromium.org> on 2012-08-20
Reviewed by Pavel Feldman.

Added the following protocol methods to communicate with the WebGL injected
module: captureFrame, getTraceLog, dropTraceLog, replayTraceLog.

* inspector/CodeGeneratorInspector.py:
* inspector/InjectedScriptWebGLModule.cpp:
(WebCore::InjectedScriptWebGLModule::captureFrame):
(WebCore):
(WebCore::InjectedScriptWebGLModule::dropTraceLog):
(WebCore::InjectedScriptWebGLModule::getTraceLog):
(WebCore::InjectedScriptWebGLModule::replayTraceLog):
* inspector/InjectedScriptWebGLModule.h:
(InjectedScriptWebGLModule):
* inspector/Inspector.json:
* inspector/InspectorController.cpp:
(WebCore::InspectorController::InspectorController):
* inspector/InspectorWebGLAgent.cpp:
(WebCore::InspectorWebGLAgent::InspectorWebGLAgent):
(WebCore::InspectorWebGLAgent::dropTraceLog):
(WebCore):
(WebCore::InspectorWebGLAgent::captureFrame):
(WebCore::InspectorWebGLAgent::getTraceLog):
(WebCore::InspectorWebGLAgent::replayTraceLog):
* inspector/InspectorWebGLAgent.h:
(WebCore):
(WebCore::InspectorWebGLAgent::create):
(InspectorWebGLAgent):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@126028 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[GTK] Replace webkit_web_view_replace_content with webkit_web_view_load_alternate_html
https://bugs.webkit.org/show_bug.cgi?id=94471

Reviewed by Martin Robinson.

In WebKit1 there's code to prevent that load signals are emitted
when loading internal custom error pages. We added
webkit_web_view_replace_content() with the same idea, but it has
ended up being problematic, because it allows to add any HTML
content (in WebKit1 we assumed internal error pages never failed
and always loaded) and it's impossible to know when the load has
finished. It also required a lot of logic to handle
replace_content as an especial case, in order to hide the fact
that it loads content. This patch renames
webkit_web_view_replace_content() as
webkit_web_view_load_alternate_html() and emit load events
normally.

* UIProcess/API/gtk/WebKitWebView.cpp:
(_WebKitWebViewPrivate):
(webkitWebViewLoadChanged):
(webkitWebViewLoadFailed):
(webkitWebViewSetEstimatedLoadProgress):
(webkitWebViewResourceLoadStarted):
(webkitWebViewGetLoadingWebResource):
(webkitWebViewRemoveLoadingWebResource):
(webkitWebViewResourceLoadFinished):
(webkit_web_view_load_alternate_html):
* UIProcess/API/gtk/WebKitWebView.h:
* UIProcess/API/gtk/docs/webkit2gtk-sections.txt:
* UIProcess/API/gtk/tests/TestLoaderClient.cpp:
(testLoadAlternateHTML):
(beforeAll):
* UIProcess/API/gtk/tests/TestResources.cpp:
(beforeAll):
* UIProcess/API/gtk/tests/TestWebKitWebView.cpp:
(beforeAll):
* UIProcess/API/gtk/tests/WebViewTest.cpp:
(WebViewTest::loadAlternateHTML):
* UIProcess/API/gtk/tests/WebViewTest.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@126030 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Qt] Custom tap-highlight-color renders fully opaque
https://bugs.webkit.org/show_bug.cgi?id=94468

Reviewed by Kenneth Rohde Christiansen.

Source/WebCore:

Adjust the default tap-highlight-color to figure in that is will be
drawn semi-transparent.

* rendering/RenderTheme.h:
(RenderTheme):

Source/WebKit2:

Draw tap-highlight-color at 50% transparency, to better match how
existing WebKit browsers act on custom tap-highlight colors.

* WebProcess/WebPage/TapHighlightController.cpp:
(WebKit::TapHighlightController::drawRect):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@126031 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed, rolling out r125989.
http://trac.webkit.org/changeset/125989
https://bugs.webkit.org/show_bug.cgi?id=94485

"Two of the new tests always failed on Mac bots" (Requested by
bradee-oh on #webkit).

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

Source/WebCore:

* css/CSSComputedStyleDeclaration.cpp:
(WebCore):
(WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue):
* css/CSSParser.cpp:
(WebCore::isValidKeywordPropertyAndValue):
(WebCore::isKeywordPropertyID):
(WebCore::CSSParser::parseValue):
* css/CSSProperty.cpp:
(WebCore::CSSProperty::isInheritedProperty):
* css/CSSPropertyNames.in:
* css/CSSValueKeywords.in:
* css/StyleBuilder.cpp:
(WebCore::StyleBuilder::StyleBuilder):
* rendering/RenderLayer.h:
(RenderLayer):
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::createPrimaryGraphicsLayer):
(WebCore):
(WebCore::RenderLayerBacking::updateGraphicsLayerGeometry):
* rendering/RenderLayerBacking.h:
(RenderLayerBacking):
* rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::diff):
* rendering/style/RenderStyle.h:
* rendering/style/StyleRareNonInheritedData.cpp:
(WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
(WebCore::StyleRareNonInheritedData::operator==):
* rendering/style/StyleRareNonInheritedData.h:
(StyleRareNonInheritedData):

LayoutTests:

* css3/compositing/blend-mode-property-expected.txt: Removed.
* css3/compositing/blend-mode-property-parsing-expected.txt: Removed.
* css3/compositing/blend-mode-property-parsing-invalid-expected.txt: Removed.
* css3/compositing/blend-mode-property-parsing-invalid.html: Removed.
* css3/compositing/blend-mode-property-parsing.html: Removed.
* css3/compositing/blend-mode-property.html: Removed.
* css3/compositing/script-tests/blend-mode-property-parsing-invalid.js: Removed.
* css3/compositing/script-tests/blend-mode-property-parsing.js: Removed.
* css3/compositing/script-tests/blend-mode-property.js: Removed.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@126032 268f45cc-cd09-0410-ab3c-d52691b4dbfc
postMessage() in MessagePort.idl does not match spec
https://bugs.webkit.org/show_bug.cgi?id=94477

Patch by Christophe Dumez <christophe.dumez@intel.com> on 2012-08-20
Reviewed by Kentaro Hara.

Update definition of postMessage() in MessagePort.idl
to match the specification at:
http://www.w3.org/TR/html5/comms.html#messageport

The first argument should be of type 'any', not
'DOMString'.

No new tests, no behavior change.

* dom/MessagePort.idl:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@126040 268f45cc-cd09-0410-ab3c-d52691b4dbfc
<https://bugs.webkit.org/show_bug.cgi?id=94486>
<rdar://problem/12128557>
REGRESSION (r121482, Lion-only): Closing a popover containing a WKView can crash
        
Reviewed by Darin Adler.

* UIProcess/API/mac/WKView.mm:
(-[WKView viewWillMoveToWindow:]):
Avoid calling the code added in 121482 that ensures that the undo stack is cleaned up
before the WKView is moved from one window to another when the WKView is being moved
out of a popover window. This avoids a bug in OS X 10.7 that was fixed in 10.8.
While this technically reopens a potentially crashing code path that 121482 closed,
it only reopens it for WKViews that are used for text editing and that are removed
from an NSPopover at some time earlier than tear-down of the NSPopover.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@126041 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[chromium] pepper plugins sometimes are shifted by 1 pixel
https://bugs.webkit.org/show_bug.cgi?id=94257

Patch by Yuzhu Shen <yzshen@chromium.com> on 2012-08-20
Reviewed by Levi Weintraub.

Change RenderWidget::updateWidgetGeometry() to use LayoutRect instead of IntRect to avoid unwanted truncation
(when converting from FloatRect to IntRect).

This makes sure that the optimized rendering code path of Pepper plugin
(PluginInstance::GetBitmapForOptimizedPluginPaint) has consistent coordinates with the normal WebKit rendering
code path.

No new tests because we don't have Pepper plugin tests in WebKit.

* rendering/RenderWidget.cpp:
(WebCore::RenderWidget::updateWidgetGeometry):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@126042 268f45cc-cd09-0410-ab3c-d52691b4dbfc
webkitfullscreenchange not fired properly in iframe.
https://bugs.webkit.org/show_bug.cgi?id=93525

Reviewed by Adam Barth.

webkitCancelFullScreen exits fullscreen by invoking webkitExitFullScreen on topDocument.
However, if webkitDidExitFullScreenForElement is invoked on a descendant document, no events
get dispatched. This change starts the event dispatch delay timer on the document where
webkitCancelFullScreen was called, so that the events get dispatched. In addition, when events
are dispatched, the check whether a node has been removed is changed to also check that the
node isn't in another document, as can happen with frames. Finally, webkitExitFullscreen
is fixed to remove unnecessary code and conform to the spec.

No new tests (the existing fullscreen/exit-full-screen-iframe.html test now passes).

* dom/Document.cpp:
(WebCore::Document::webkitExitFullscreen):
(WebCore::Document::webkitDidExitFullScreenForElement):
(WebCore::Document::fullScreenChangeDelayTimerFired):


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