[BlackBerry] GraphicsLayer: fix code that was accidentally reverted
https://bugs.webkit.org/show_bug.cgi?id=112143

Patch by Alberto Garcia <agarcia@igalia.com> on 2013-03-21
Reviewed by Rob Buis.

Several changes were accidentally reverted in r144465 due to the
upstreaming of some new code:

- clearBackgroundColor() and m_contentsLayerHasBackgroundColor had
  been removed in r137798.

- showDebugBorders() had been renamed to isShowingDebugBorder() in
  r133517.

- A new GraphicsLayer::create() overload had been introduced in
  r130185.

This patch fixes them all.

* platform/graphics/blackberry/GraphicsLayerBlackBerry.cpp:
(WebCore::GraphicsLayer::create):
(WebCore):
(WebCore::GraphicsLayerBlackBerry::GraphicsLayerBlackBerry):
(WebCore::GraphicsLayerBlackBerry::setBackgroundColor):
(WebCore::GraphicsLayerBlackBerry::updateLayerBackgroundColor):
(WebCore::GraphicsLayerBlackBerry::setupContentsLayer):
* platform/graphics/blackberry/GraphicsLayerBlackBerry.h:
(GraphicsLayerBlackBerry):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@146499 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Web Inspector: Regression: drawer resizes slowly with animation.
https://bugs.webkit.org/show_bug.cgi?id=112920

Drawer status bar opacity wasn't set to zero on inialization, so no transition event
was fired on first time drawer appeared,thus animation styles wasn't removed properly.

Patch by Dmitry Zvorygin <zvorygin@chromium.org> on 2013-03-21
Reviewed by Vsevolod Vlasov.

* inspector/front-end/Drawer.js:
(WebInspector.Drawer):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@146500 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Texmap] Implement support for OpenGLES EXT_unpack_subimage extension
https://bugs.webkit.org/show_bug.cgi?id=108716

If the extension GL_EXT_unpack_subimage is supported, it adds GL_UNPACK_ROW_LENGTH,
GL_UNPACK_SKIP_ROWS and GL_UNPACK_SKIP_PIXELS as valid enums to PixelStore.

Reviewed by Noam Rosenthal.

* platform/graphics/texmap/TextureMapperGL.cpp:
(WebCore::driverSupportsSubImage):
(WebCore::BitmapTextureGL::updateContentsNoSwizzle):
(WebCore::BitmapTextureGL::updateContents):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@146501 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[BlackBerry] GCActivityCallback: replace JSLock with JSLockHolder
https://bugs.webkit.org/show_bug.cgi?id=112448

Patch by Alberto Garcia <agarcia@igalia.com> on 2013-03-21
Reviewed by Xan Lopez.

This changed in r121381.

* runtime/GCActivityCallbackBlackBerry.cpp:
(JSC::DefaultGCActivityCallback::doWork):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@146502 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[SVG] Remove explicit LightSource dispatchers
https://bugs.webkit.org/show_bug.cgi?id=112827

Reviewed by Stephen Chenney.

Convert LightSource setters to dynamic dispatch. This allows us to remove LightSource.cpp
altogether.

No new tests: refactoring only.

* CMakeLists.txt:
* GNUmakefile.list.am:
* Target.pri:
* WebCore.gypi:
* WebCore.vcproj/WebCore.vcproj:
* WebCore.vcxproj/WebCore.vcxproj:
* WebCore.vcxproj/WebCore.vcxproj.filters:
* WebCore.xcodeproj/project.pbxproj:
* platform/graphics/filters/DistantLightSource.h:
(DistantLightSource):
* platform/graphics/filters/LightSource.cpp: Removed.
* platform/graphics/filters/LightSource.h:
(WebCore::LightSource::setAzimuth):
(WebCore::LightSource::setElevation):
(WebCore::LightSource::setX):
(WebCore::LightSource::setY):
(WebCore::LightSource::setZ):
(WebCore::LightSource::setPointsAtX):
(WebCore::LightSource::setPointsAtY):
(WebCore::LightSource::setPointsAtZ):
(WebCore::LightSource::setSpecularExponent):
(WebCore::LightSource::setLimitingConeAngle):
* platform/graphics/filters/PointLightSource.h:
(PointLightSource):
* platform/graphics/filters/SpotLightSource.h:
(SpotLightSource):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@146503 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[GTK] generate-feature-defines-files is incompatible with Python3
https://bugs.webkit.org/show_bug.cgi?id=112956

Reviewed by Martin Robinson.

Make the generate-feature-defines-files compatible with Python3 by calling the items()
method on the dictionary objects when iterating through said dictionaries.

* gtk/generate-feature-defines-files:
(write_feature_defines_header):
(write_flattened_feature_defines_file):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@146504 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Fix lexer charPosition computation when "rewind"ing the lexer.
https://bugs.webkit.org/show_bug.cgi?id=112952.

Reviewed by Michael Saboff.

Changed the Lexer to no longer keep a m_charPosition. Instead, we compute
currentCharPosition() from m_code and m_codeStartPlusOffset, where
m_codeStartPlusOffset is the SourceProvider m_codeStart + the SourceCode
start offset. This ensures that the charPosition is always in sync with
m_code.

* parser/Lexer.cpp:
(JSC::::setCode):
(JSC::::internalShift):
(JSC::::shift):
(JSC::::lex):
* parser/Lexer.h:
(JSC::Lexer::currentCharPosition):
(JSC::::lexExpectIdentifier):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@146505 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Windows rebaseline after r146469.

* platform/win/css3/filters/effect-reference-expected.txt:
* platform/win/css3/filters/effect-reference-hw-expected.txt:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@146506 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[WinCairo] Correct assert in Empty BitmapImage Test.
https://bugs.webkit.org/show_bug.cgi?id=112934

Reviewed by Tim Horton.

* TestWebKitAPI/Tests/WebCore/win/BitmapImage.cpp:
(TestWebKitAPI::TEST): Use proper RefPtr and adoptRef
to avoid ref counting assertion when leaving test scope.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@146507 268f45cc-cd09-0410-ab3c-d52691b4dbfc
        Move non-trivial virtual functions out of ResourceHandleClient.h
        https://bugs.webkit.org/show_bug.cgi?id=112950

        Reviewed by Brady Eidson.

        * CMakeLists.txt:
        * GNUmakefile.list.am:
        * Target.pri:
        * WebCore.exp.in:
        * WebCore.gypi:
        * WebCore.vcproj/WebCore.vcproj:
        * WebCore.vcxproj/WebCore.vcxproj:
        * WebCore.vcxproj/WebCore.vcxproj.filters:
        * WebCore.xcodeproj/project.pbxproj:
        * platform/network/ResourceHandleClient.cpp: Added.
        (WebCore::ResourceHandleClient::ResourceHandleClient):
        (WebCore::ResourceHandleClient::~ResourceHandleClient):
        (WebCore::ResourceHandleClient::didReceiveBuffer):
        (WebCore::ResourceHandleClient::getBuffer):
        * platform/network/ResourceHandleClient.h:



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@146508 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Expose the Type field of an RTCStatsReport
https://bugs.webkit.org/show_bug.cgi?id=112951

Patch by Harald Alvestrand <hta@google.com> on 2013-03-21
Reviewed by Adam Barth.

Source/WebCore:

Covered by an extension of an existing test.

* Modules/mediastream/RTCStatsReport.h:
(WebCore::RTCStatsReport::type):
* Modules/mediastream/RTCStatsReport.idl:

LayoutTests:

* fast/mediastream/RTCPeerConnection-stats-expected.txt:
* fast/mediastream/RTCPeerConnection-stats.html:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@146509 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Correct bisector angle calculation for markers
https://bugs.webkit.org/show_bug.cgi?id=112054

Reviewed by Stephen Chenney.

Source/WebCore:

The SVG marker spec states that mid markers with orient=auto should be aligned with their
x-axis along the bisector of the incoming (in) and outgoing (out) angles. Previously we
calculated this bisector angle as:
    bisector = (in + out) / 2;
Angles cannot be averaged this way! Consider in=90deg and out=-180deg: the bisector should
be 135deg but a naive average gives -45deg. This patch corrects for the discontinuity in
angle values with:
    bisector = (in + out + 360) / 2   // if |in - out| > 180
    bisector = (in + out) / 2         // otherwise
This patch includes an exhaustive test of angle values.

Test: svg/custom/marker-orient-auto.html

* rendering/svg/SVGMarkerData.h:
(WebCore::SVGMarkerData::currentAngle):

LayoutTests:

* platform/chromium-linux/svg/custom/marker-orient-auto-expected.png: Added.
* platform/chromium-linux/svg/custom/marker-orient-auto-expected.txt: Added.
* platform/chromium/TestExpectations:
* svg/custom/marker-orient-auto.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@146510 268f45cc-cd09-0410-ab3c-d52691b4dbfc
IndexedDB: Remove onVersionChange(string) plumbing
https://bugs.webkit.org/show_bug.cgi?id=112712

Reviewed by Adam Barth.

Source/WebCore:

Delete unused onVersionChange(string) overload.

No new tests - just deleting dead code.

* Modules/indexeddb/IDBDatabase.cpp: Delete onVersionChange(string) overload.
* Modules/indexeddb/IDBDatabase.h: Ditto.
* Modules/indexeddb/IDBDatabaseBackendImpl.cpp: Ditto.
* Modules/indexeddb/IDBDatabaseCallbacks.h: Ditto.
* Modules/indexeddb/IDBDatabaseCallbacksImpl.cpp: Ditto.
* Modules/indexeddb/IDBDatabaseCallbacksImpl.h: Ditto.

Source/WebKit/chromium:

* public/WebIDBDatabaseCallbacks.h: Remove onVersionChange(string) overload.
* src/IDBDatabaseCallbacksProxy.cpp: Ditto.
* src/IDBDatabaseCallbacksProxy.h: Ditto.
* src/WebIDBDatabaseCallbacksImpl.cpp: Ditto.
* src/WebIDBDatabaseCallbacksImpl.h: Ditto.
* tests/IDBAbortOnCorruptTest.cpp: Ditto.
* tests/IDBDatabaseBackendTest.cpp: Ditto.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@146511 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Chromium] Removed unused WEBKIT_USE_NEW_WEBFILESYSTEMTYPE flag
https://bugs.webkit.org/show_bug.cgi?id=112931

Reviewed by Adam Barth.

Migration complete; flag no longer needed.

* chromium/public/WebFileSystemType.h:


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

        * NetworkProcess/mac/NetworkResourceLoaderMac.mm: Include CurrentTime.h, as needed
        to call currentTime().



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@146513 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[chromium] add missing project dependencies to DRT to fix Mac Valgrind
https://bugs.webkit.org/show_bug.cgi?id=112953

Reviewed by Tony Chang.

When I created the DumpRenderTree_resources target in r144863 I
forgot to declare the needed dependencies on the other resource
targets. Due to a quirk of ordering, this appears to have been fine
w/ ninja but not w/ Xcode (which is still being used on the chromium
mac valgrind bots). Declaring the dependencies fixes the build
failures.

* DumpRenderTree/DumpRenderTree.gyp/DumpRenderTree.gyp:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@146514 268f45cc-cd09-0410-ab3c-d52691b4dbfc
SVG text path referencing parent text infinite loops
https://bugs.webkit.org/show_bug.cgi?id=112078

Reviewed by Philip Rogers.

Source/WebCore:

We do not check the target type when adding a resource reference for
SVG Text Path's URI. This goes horribly wrong when the target is the
text path's parent text element. In this patch we check that the target
element of the text path is indeed a path element, as the spec
requires. No other element type is allowed.

Note that RenderSVGTextPath enforces this check in the renderer code
also, so if we get past this check via pending resources, it doesn't
matter. You can't get into this situation with a pending reference
because, by definition, the parent must be defined before the text
path child.

Test: svg/text/textpath-referencing-text-crash.svg

* svg/SVGTextPathElement.cpp:
(WebCore::SVGTextPathElement::buildPendingResource):

LayoutTests:

* svg/text/textpath-referencing-text-crash-expected.txt: Added.
* svg/text/textpath-referencing-text-crash.svg: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@146515 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Drop full URLs from cross-origin access errors caused by protocol mismatches.
https://bugs.webkit.org/show_bug.cgi?id=112894

Reviewed by Timothy Hatcher.

Source/WebCore:

Following up on http://wkbug.com/112813, this patch brings protocol
mismatch errors into line with the new origin-only hotness. The message
is also changed to display the URL's protocol rather than the origin's
protocol: it makes a big difference for 'data:' URLs, for instance.

* page/DOMWindow.cpp:
(WebCore::DOMWindow::crossDomainAccessErrorMessage):

LayoutTests:

* http/tests/security/contentSecurityPolicy/1.1/reflected-xss-and-xss-protection-allow-block-expected.txt:
* http/tests/security/contentSecurityPolicy/1.1/reflected-xss-and-xss-protection-block-allow-expected.txt:
* http/tests/security/contentSecurityPolicy/1.1/reflected-xss-and-xss-protection-block-block-expected.txt:
* http/tests/security/contentSecurityPolicy/1.1/reflected-xss-and-xss-protection-block-filter-expected.txt:
* http/tests/security/contentSecurityPolicy/1.1/reflected-xss-and-xss-protection-block-invalid-expected.txt:
* http/tests/security/contentSecurityPolicy/1.1/reflected-xss-and-xss-protection-block-unset-expected.txt:
* http/tests/security/contentSecurityPolicy/1.1/reflected-xss-and-xss-protection-filter-block-expected.txt:
* http/tests/security/contentSecurityPolicy/1.1/reflected-xss-and-xss-protection-invalid-block-expected.txt:
* http/tests/security/contentSecurityPolicy/1.1/reflected-xss-and-xss-protection-unset-block-expected.txt:
* http/tests/security/contentSecurityPolicy/1.1/reflected-xss-block-expected.txt:
* http/tests/security/cross-frame-access-protocol-expected.txt:
* http/tests/security/cross-frame-access-protocol-explicit-domain-expected.txt:
* http/tests/security/dataURL/xss-DENIED-from-data-url-in-foreign-domain-subframe-expected.txt:
* http/tests/security/dataURL/xss-DENIED-from-data-url-in-foreign-domain-window-open-expected.txt:
* http/tests/security/dataURL/xss-DENIED-from-data-url-sub-frame-2-level-expected.txt:
* http/tests/security/dataURL/xss-DENIED-from-data-url-sub-frame-expected.txt:
* http/tests/security/dataURL/xss-DENIED-from-javascript-url-window-open-expected.txt:
* http/tests/security/dataURL/xss-DENIED-to-data-url-in-foreign-domain-subframe-expected.txt:
* http/tests/security/dataURL/xss-DENIED-to-data-url-in-foreign-domain-subframe-location-change-expected.txt:
* http/tests/security/dataURL/xss-DENIED-to-data-url-in-foreign-domain-window-open-expected.txt:
* http/tests/security/dataURL/xss-DENIED-to-data-url-sub-frame-2-level-expected.txt:
* http/tests/security/dataURL/xss-DENIED-to-data-url-sub-frame-expected.txt:
* http/tests/security/dataURL/xss-DENIED-to-data-url-sub-frame-uppercase-expected.txt:
* http/tests/security/dataURL/xss-DENIED-to-data-url-window-open-expected.txt:
* http/tests/security/view-source-no-javascript-url-expected.txt:
* http/tests/security/xssAuditor/block-does-not-leak-location-expected.txt:
* http/tests/security/xssAuditor/block-does-not-leak-referrer-expected.txt:
* http/tests/security/xssAuditor/full-block-base-href-expected.txt:
* http/tests/security/xssAuditor/full-block-iframe-javascript-url-expected.txt:
* http/tests/security/xssAuditor/full-block-javascript-link-expected.txt:
* http/tests/security/xssAuditor/full-block-link-onclick-expected.txt:
* http/tests/security/xssAuditor/full-block-object-tag-expected.txt:
* http/tests/security/xssAuditor/full-block-script-tag-cross-domain-expected.txt:
* http/tests/security/xssAuditor/full-block-script-tag-expected.txt:
* http/tests/security/xssAuditor/full-block-script-tag-with-source-expected.txt:
* http/tests/security/xssAuditor/xss-protection-parsing-03-expected.txt:
* http/tests/security/xssAuditor/xss-protection-parsing-04-expected.txt:
* platform/chromium/http/tests/security/dataURL/xss-DENIED-from-data-url-in-foreign-domain-subframe-expected.txt:
* platform/chromium/http/tests/security/dataURL/xss-DENIED-from-data-url-in-foreign-domain-window-open-expected.txt:
* platform/chromium/http/tests/security/dataURL/xss-DENIED-from-data-url-sub-frame-2-level-expected.txt:
* platform/chromium/http/tests/security/dataURL/xss-DENIED-from-data-url-sub-frame-expected.txt:
* platform/chromium/http/tests/security/dataURL/xss-DENIED-from-javascript-url-window-open-expected.txt:
* platform/chromium/http/tests/security/dataURL/xss-DENIED-to-data-url-in-foreign-domain-subframe-expected.txt:
* platform/chromium/http/tests/security/dataURL/xss-DENIED-to-data-url-in-foreign-domain-subframe-location-change-expected.txt:
* platform/chromium/http/tests/security/dataURL/xss-DENIED-to-data-url-in-foreign-domain-window-open-expected.txt:
* platform/chromium/http/tests/security/dataURL/xss-DENIED-to-data-url-sub-frame-2-level-expected.txt:
* platform/chromium/http/tests/security/dataURL/xss-DENIED-to-data-url-sub-frame-expected.txt:
* platform/chromium/http/tests/security/dataURL/xss-DENIED-to-data-url-sub-frame-uppercase-expected.txt:
* platform/chromium/http/tests/security/dataURL/xss-DENIED-to-data-url-window-open-expected.txt:
* platform/chromium/http/tests/security/inactive-document-with-empty-security-origin-expected.txt:
* platform/chromium/http/tests/security/window-named-proto-expected.txt:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@146516 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Cleanup android media layout test code
https://bugs.webkit.org/show_bug.cgi?id=112944

Patch by Min Qin <qinmin@chromium.org> on 2013-03-21
Reviewed by Adam Barth.

Chromium change: https://codereview.chromium.org/12892010/
The current android layout tests are using WebmediaPlayerInProcessAndroid class.
The code path has been largely diverged from that of the WebMediaPlayerImplAndroid.
It is not worth the effort to keep the code path, and the layout tests will not reflect the actual behavior on the browser.
Instead, we should switch to use content shell for layout tests.

* DumpRenderTree/chromium/TestShell.cpp:
(TestShell::resetTestController):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@146517 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Support connecting the Web Inspector without showing it.

This allows you to get the debugger attached in the background. When a breakpoint is hit
the Inspector will open. This change also reduces some WebProcess messaging by removing
the DidLoadInspectorPage message and stops sending the SetAttachedWindow message on close.

https://bugs.webkit.org/show_bug.cgi?id=112445

Reviewed by Sam Weinig.

* UIProcess/API/C/WKInspector.cpp:
(WKInspectorIsConnected): Added.
(WKInspectorConnect): Added.
(WKInspectorHide): Added.

* UIProcess/API/C/WKInspector.h:
Added new APIs.

* UIProcess/WebInspectorProxy.cpp:
(WebKit::WebInspectorProxy::WebInspectorProxy):
Initialize new state booleans.

(WebKit::WebInspectorProxy::invalidate):
Don't set state booleans that didClose already resets.

(WebKit::WebInspectorProxy::connect): Added.
(WebKit::WebInspectorProxy::show):
Open if we are already connected. Call connect().

(WebKit::WebInspectorProxy::hide): Added.

(WebKit::WebInspectorProxy::close):
Call didClose we can detach or close the window immediately instead of waiting for a
message from the WebProcess.

(WebKit::WebInspectorProxy::attach):
(WebKit::WebInspectorProxy::detach):
Check for !m_page to match other functions.

(WebKit::WebInspectorProxy::createInspectorPage):
(WebKit::WebInspectorProxy::didLoadInspectorPage):
Removed. Moved logic to open().

(WebKit::WebInspectorProxy::open): Added.

(WebKit::WebInspectorProxy::didClose):
Clear new state booleans. Don't perform work again if already closed. Use platformDetach()
instead of detach() to avoid sending the SetAttachedWindow message.

(WebKit::WebInspectorProxy::bringToFront):
Call open() if we are not visible yet, otherwise platformBringToFront.

* UIProcess/WebInspectorProxy.h:
(WebKit::WebInspectorProxy::isConnected): Added.

* UIProcess/WebInspectorProxy.messages.in: Removed DidLoadInspectorPage.

* UIProcess/gtk/WebInspectorProxyGtk.cpp:
(WebKit::WebInspectorProxy::platformHide): Added stub.

* UIProcess/mac/WebInspectorProxyMac.mm:
(WebKit::WebInspectorProxy::platformHide): Added.

* UIProcess/qt/WebInspectorProxyQt.cpp:
(WebKit::WebInspectorProxy::platformHide): Added stub.

* WebProcess/WebCoreSupport/WebInspectorFrontendClient.cpp:
* WebProcess/WebCoreSupport/WebInspectorFrontendClient.h:
Removed frontendLoaded().

* WebProcess/WebPage/WebInspector.cpp:
* WebProcess/WebPage/WebInspector.h:
Removed didLoadInspectorPage().


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