Introduce toSVGGradientElement(), use it
https://bugs.webkit.org/show_bug.cgi?id=118943

Reviewed by Andreas Kling.

As a step to change static_cast with toSVGXXX, static_cast<SVGGradientElement*> can
be changed with toSVGGradientElement().

No new tests, no behavior change.

* rendering/svg/RenderSVGGradientStop.cpp:
(WebCore::RenderSVGGradientStop::gradientElement):
* rendering/svg/RenderSVGResourceGradient.cpp:
(WebCore::RenderSVGResourceGradient::applyResource):
* rendering/svg/SVGResources.cpp:
(WebCore::targetReferenceFromResource):
* svg/SVGGradientElement.h:
(WebCore::toSVGGradientElement):
* svg/SVGLinearGradientElement.cpp:
(WebCore::SVGLinearGradientElement::collectGradientAttributes):
* svg/SVGRadialGradientElement.cpp:
(WebCore::SVGRadialGradientElement::collectGradientAttributes):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@152955 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Web Inspector: Cleanup InspectorFrontendHostStub.js
https://bugs.webkit.org/show_bug.cgi?id=118959

Patch by Seokju Kwon <seokju.kwon@gmail.com> on 2013-07-21
Reviewed by Timothy Hatcher.

Remove some functions because we dont use on New Inspector.

* UserInterface/InspectorFrontendHostStub.js:
(.WebInspector.InspectorFrontendHostStub):
(.WebInspector.InspectorFrontendHostStub.prototype.save):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@152956 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Qt] Unreviewed gardening. Update platform specific expectations.

* platform/qt-5.0-wk1/fast/loader/show-only-one-beforeunload-dialog-expected.txt: Added after r152941.
* platform/qt-5.0-wk1/http/tests/misc/iframe-beforeunload-dialog-matching-ancestor-securityorigin-expected.txt: Added after r152941.
* platform/qt-5.0-wk2/fast/multicol/shrink-to-column-height-for-pagination-expected.png: Removed.
* platform/qt/fast/multicol/shrink-to-column-height-for-pagination-expected.png: Added after r152911.
* platform/qt/fast/multicol/shrink-to-column-height-for-pagination-expected.txt: Renamed from LayoutTests/platform/qt-5.0-wk2/fast/multicol/shrink-to-column-height-for-pagination-expected.txt.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@152960 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Qt] Implement more of DOM3 KeyEvent key-identifiers
https://bugs.webkit.org/show_bug.cgi?id=118566

Reviewed by Jocelyn Turcotte.

Implemented as many of the key values from http://www.w3.org/TR/DOM-Level-3-Events/#key-values-list
as Qt keycodes support.

Also corrected the mapping of the Menu key, which was confused because MENU
is also the ancient Microsoft speak for the Alt keys.

* platform/qt/PlatformKeyboardEventQt.cpp:
(WebCore::keyIdentifierForQtKeyCode):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@152961 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Use toSVGPathElement() instead of static_cast<>
https://bugs.webkit.org/show_bug.cgi?id=118960

Reviewed by Allan Sandfeld Jensen.

Though there is toSVGPathElement(), some files still use static_cast<SVGPathElement*>.
To remove all static_cast<> use, we need to change argument from SVGElement to Element.

Merge from https://src.chromium.org/viewvc/blink?view=rev&revision=154621

No new tests, no behavior change.

* rendering/svg/RenderSVGTextPath.cpp:
(WebCore::RenderSVGTextPath::layoutPath):
* rendering/svg/SVGPathData.cpp:
(WebCore::updatePathFromPathElement):
* rendering/svg/SVGRenderTreeAsText.cpp:
(WebCore::operator<<):
* svg/SVGMPathElement.cpp:
(WebCore::SVGMPathElement::pathElement):
* svg/SVGPathElement.h:
(WebCore::toSVGPathElement):
* svg/SVGPathSegList.cpp:
(WebCore::SVGPathSegList::commitChange):
* svg/properties/SVGAnimatedPathSegListPropertyTearOff.h:
(WebCore::SVGAnimatedPathSegListPropertyTearOff::animValDidChange):
* svg/properties/SVGPathSegListPropertyTearOff.cpp:
(WebCore::SVGPathSegListPropertyTearOff::contextElement):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@152962 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Introduce toSVGUseElement(), use it
https://bugs.webkit.org/show_bug.cgi?id=118942

Reviewed by Allan Sandfeld Jensen.

As a step to change static_cast with toSVGXXX, static_cast<SVGUseElement*> can
be changed with toSVGUseElement().

No new tests, no behavior change.

* dom/EventRetargeter.h:
(WebCore::EventRetargeter::eventTargetRespectingTargetRules):
* page/EventHandler.cpp:
(WebCore::instanceAssociatedWithShadowTreeElement):
* rendering/svg/RenderSVGResourceClipper.cpp:
(WebCore::RenderSVGResourceClipper::drawContentIntoMaskImage):
* rendering/svg/RenderSVGTransformableContainer.cpp:
(WebCore::RenderSVGTransformableContainer::calculateLocalTransform):
* svg/SVGStyledElement.cpp:
(WebCore::SVGStyledElement::title):
* svg/SVGUseElement.cpp:
(WebCore::dumpInstanceTree):
(WebCore::SVGUseElement::buildInstanceTree):
(WebCore::SVGUseElement::expandUseElementsInShadowTree):
* svg/SVGUseElement.h:
(WebCore::toSVGUseElement):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@152963 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed gardening. Update test expectations for GTK.

* platform/gtk/accessibility/aria-option-role-expected.txt: Update
expectations to match those from EFL.
* platform/gtk/TestExpectations: Removed test from failures expectations,
now it's running as expected.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@152964 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[GTK] Regression: Multiple tests fail after r152701 changed how unavailable plugins are handled
https://bugs.webkit.org/show_bug.cgi?id=118730

Unreviewed GTK gardening. Unskip tests no longer failing.

Changes from r152701 were reverted in r152814 and later reworked in r152824,
so the tests no longer fail.

Patch by Simon Pena <simon.pena@samsung.com> on 2013-07-22

* platform/gtk/TestExpectations:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@152965 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Qt] Unreviewed gardening. Skipping failing tests.

Patch by Gabor Abraham <abrhm@inf.u-szeged.hu> on 2013-07-22

* platform/qt-5.0-wk1/TestExpectations:
* platform/qt/TestExpectations:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@152966 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed gardening. Add accesibility/lists.html as 'Missing' expectation.

* platform/gtk/TestExpectations: Added test.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@152967 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[CSS Regions] Convert percentage-margins-* tests to ref-tests
https://bugs.webkit.org/show_bug.cgi?id=118723

Reviewed by Andreas Kling.

The patch converts the percentage margins tests for regions in ref tests.

* fast/regions/percentage-margins-mixed-ltr-dominant-regions-expected.html: Added.
* fast/regions/percentage-margins-mixed-ltr-dominant-regions.html:
* fast/regions/percentage-margins-mixed-rtl-dominant-regions-expected.html: Added.
* fast/regions/percentage-margins-mixed-rtl-dominant-regions.html:
* fast/regions/percentage-margins-rtl-variable-width-regions-expected.html: Added.
* fast/regions/percentage-margins-rtl-variable-width-regions.html:
* platform/efl/fast/regions/percentage-margins-mixed-ltr-dominant-regions-expected.png: Removed.
* platform/efl/fast/regions/percentage-margins-mixed-ltr-dominant-regions-expected.txt: Removed.
* platform/efl/fast/regions/percentage-margins-mixed-rtl-dominant-regions-expected.png: Removed.
* platform/efl/fast/regions/percentage-margins-mixed-rtl-dominant-regions-expected.txt: Removed.
* platform/efl/fast/regions/percentage-margins-rtl-variable-width-regions-expected.png: Removed.
* platform/efl/fast/regions/percentage-margins-rtl-variable-width-regions-expected.txt: Removed.
* platform/efl/fast/regions/percentage-margins-variable-width-regions-expected.png: Removed.
* platform/efl/fast/regions/percentage-margins-variable-width-regions-expected.txt: Removed.
* platform/gtk/fast/regions/percentage-margins-mixed-ltr-dominant-regions-expected.png: Removed.
* platform/gtk/fast/regions/percentage-margins-mixed-ltr-dominant-regions-expected.txt: Removed.
* platform/gtk/fast/regions/percentage-margins-mixed-rtl-dominant-regions-expected.png: Removed.
* platform/gtk/fast/regions/percentage-margins-mixed-rtl-dominant-regions-expected.txt: Removed.
* platform/gtk/fast/regions/percentage-margins-rtl-variable-width-regions-expected.png: Removed.
* platform/gtk/fast/regions/percentage-margins-rtl-variable-width-regions-expected.txt: Removed.
* platform/gtk/fast/regions/percentage-margins-variable-width-regions-expected.png: Removed.
* platform/gtk/fast/regions/percentage-margins-variable-width-regions-expected.txt: Removed.
* platform/mac/fast/regions/percentage-margins-mixed-ltr-dominant-regions-expected.png: Removed.
* platform/mac/fast/regions/percentage-margins-mixed-ltr-dominant-regions-expected.txt: Removed.
* platform/mac/fast/regions/percentage-margins-mixed-rtl-dominant-regions-expected.png: Removed.
* platform/mac/fast/regions/percentage-margins-mixed-rtl-dominant-regions-expected.txt: Removed.
* platform/mac/fast/regions/percentage-margins-rtl-variable-width-regions-expected.png: Removed.
* platform/mac/fast/regions/percentage-margins-rtl-variable-width-regions-expected.txt: Removed.
* platform/qt/fast/regions/percentage-margins-mixed-ltr-dominant-regions-expected.png: Removed.
* platform/qt/fast/regions/percentage-margins-mixed-ltr-dominant-regions-expected.txt: Removed.
* platform/qt/fast/regions/percentage-margins-mixed-rtl-dominant-regions-expected.png: Removed.
* platform/qt/fast/regions/percentage-margins-mixed-rtl-dominant-regions-expected.txt: Removed.
* platform/qt/fast/regions/percentage-margins-rtl-variable-width-regions-expected.png: Removed.
* platform/qt/fast/regions/percentage-margins-rtl-variable-width-regions-expected.txt: Removed.
* platform/qt/fast/regions/percentage-margins-variable-width-regions-expected.png: Removed.
* platform/qt/fast/regions/percentage-margins-variable-width-regions-expected.txt: Removed.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@152968 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Qt][WK1] Support direct painting without GraphicsSurface
https://bugs.webkit.org/show_bug.cgi?id=118302

Reviewed by Jocelyn Turcotte.

Configure the WebGL OpenGL context to share texture with
the HostWindow OpenGL if available, and paint accelerated
using the the now shared textures.

This should return the performance without GraphicsSurface
on the WK1 code path to what it was before r135995 (28/11 2012).

* platform/graphics/qt/GraphicsContext3DQt.cpp:
(WebCore::GraphicsContext3DPrivate::GraphicsContext3DPrivate):
(WebCore::GraphicsContext3DPrivate::paintToTextureMapper):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@152969 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed gardening. Added needed baselines for GTK after r149088.

* platform/gtk/editing/selection/5825350-1-expected.txt: Added.
* platform/gtk/editing/selection/5825350-2-expected.txt: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@152970 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed gardening. Added baselines for GTK+ related to subpixel layout.

* platform/gtk/editing/selection/mixed-editability-10-expected.txt: Added.
* platform/gtk/svg/W3C-SVG-1.1/animate-elem-22-b-expected.txt: Added.
* platform/gtk/svg/W3C-SVG-1.1/animate-elem-23-t-expected.txt: Added.
* platform/gtk/svg/W3C-SVG-1.1/coords-units-03-b-expected.txt: Added.
* platform/gtk/svg/W3C-SVG-1.1/filters-comptran-01-b-expected.txt: Added.
* platform/gtk/svg/W3C-SVG-1.1/filters-example-01-b-expected.txt: Added.
* platform/gtk/svg/custom/pattern-with-transformation-expected.txt: Added.
* platform/gtk/svg/text/text-midpoint-split-bug-expected.txt: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@152971 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed gardening. Added new baselines for GTK+ after r152911.

* platform/gtk/fast/multicol/pagination/BottomToTop-bt-expected.txt: Added.
* platform/gtk/fast/multicol/pagination/BottomToTop-lr-expected.txt: Added.
* platform/gtk/fast/multicol/pagination/BottomToTop-rl-expected.txt: Added.
* platform/gtk/fast/multicol/pagination/BottomToTop-tb-expected.txt: Added.
* platform/gtk/fast/multicol/pagination/LeftToRight-bt-expected.txt: Added.
* platform/gtk/fast/multicol/pagination/LeftToRight-lr-expected.txt: Added.
* platform/gtk/fast/multicol/pagination/LeftToRight-rl-expected.txt: Added.
* platform/gtk/fast/multicol/pagination/LeftToRight-tb-expected.txt: Added.
* platform/gtk/fast/multicol/pagination/RightToLeft-bt-expected.txt: Added.
* platform/gtk/fast/multicol/pagination/RightToLeft-lr-expected.txt: Added.
* platform/gtk/fast/multicol/pagination/RightToLeft-rl-expected.txt: Added.
* platform/gtk/fast/multicol/pagination/RightToLeft-tb-expected.txt: Added.
* platform/gtk/fast/multicol/pagination/TopToBottom-bt-expected.txt: Added.
* platform/gtk/fast/multicol/pagination/TopToBottom-lr-expected.txt: Added.
* platform/gtk/fast/multicol/pagination/TopToBottom-rl-expected.txt: Added.
* platform/gtk/fast/multicol/pagination/TopToBottom-tb-expected.txt: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@152972 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Windows] Unreviewed build fix.

* WTF.vcxproj/WTFGenerated.make: Stop triggering a "Build All" when things have not changed.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@152973 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Qt] Unreviewed gardening. Rebase after r152814.

Patch by Gabor Abraham <abrhm@inf.u-szeged.hu> on 2013-07-22

* platform/qt-5.0-wk1/http/tests/security/contentSecurityPolicy/object-src-none-allowed-expected.txt:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@152974 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[iOS] captions sometimes positioned incorrectly after fullscreen state change
https://bugs.webkit.org/show_bug.cgi?id=118912

Reviewed by Jer Noble.

* html/shadow/MediaControlElements.cpp:
(WebCore::MediaControlTextTrackContainerElement::updateDisplay): Call clearTextTrackRepresentation.
(WebCore::MediaControlTextTrackContainerElement::updateTimerFired): Call updateDisplay so
    cues are re-rendered with the updated size.
(WebCore::MediaControlTextTrackContainerElement::clearTextTrackRepresentation): Cleanup the
    text track representation.
(WebCore::MediaControlTextTrackContainerElement::enteredFullscreen): New, force cues to be updated.
(WebCore::MediaControlTextTrackContainerElement::exitedFullscreen): Ditto.
* html/shadow/MediaControlElements.h:

* html/shadow/MediaControls.cpp:
(WebCore::MediaControls::enteredFullscreen): Call MediaControlTextTrackContainerElement::enteredFullscreen.
(WebCore::MediaControls::exitedFullscreen): Call MediaControlTextTrackContainerElement::exitedFullscreen.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@152975 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Curl] Download fails for certain urls.
https://bugs.webkit.org/show_bug.cgi?id=118468

Patch by peavo@outlook.com <peavo@outlook.com> on 2013-07-22
Reviewed by Brent Fulgham.

Source/WebCore:

The current Curl download implementation has a few shortcomings:
1) Downloading from secure locations fails. We need to provide Curl with the path to a certificate file (.pem file).
2) Cookies are not set in the download request. We need to give Curl the path to the cookie file.
3) When a normal load is converted to a download, some of the headers from the original request is not sent (e.g. Referer, User agent).

* platform/network/curl/CurlDownload.cpp:
(WebCore::CurlDownload::CurlDownload): Initialize custom headers member.
(WebCore::CurlDownload::~CurlDownload): Free custom headers member.
(WebCore::CurlDownload::init): Set certificate and cookie file path.
(WebCore::CurlDownload::closeFile): Check file handle against value for invalid platform handle.
(WebCore::CurlDownload::writeDataToFile): Added utility method to write download data to file.
(WebCore::CurlDownload::addHeaders): Added utility method to add headers to request.
(WebCore::CurlDownload::didReceiveData): Use writeDataToFile utility method.
* platform/network/curl/CurlDownload.h:
Put class in WebCore namespace.
Added method to init download from resource handle, request, and response object.
Added utility method to write download data to file.
Added utility method to add headers to request.
Added custom headers member.

Source/WebKit/win:

Initialize download from provided resource handle, request, and response object.

* WebDownload.h: Use WebCore namespace for Curl download class.
* WebDownloadCurl.cpp:
(WebDownload::init): Initialize download from provided resource handle, request, and response object.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@152976 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[GTK] Unreviewed gardening. Added baselines needed after r110542.

* platform/gtk/fast/forms/label/labelable-elements-expected.txt: Added.

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