REGRESSION(r147019): Page has extra space
https://bugs.webkit.org/show_bug.cgi?id=119424

Reviewed by David Hyatt.

Clear the overflow rect before recomputing it in table sections.

No new tests: the reduction uses jquery and I was unable to simulate the reduction without it.

* rendering/RenderTableSection.cpp:
(WebCore::RenderTableSection::layoutRows):
(WebCore::RenderTableSection::computeOverflowFromCells):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@153832 268f45cc-cd09-0410-ab3c-d52691b4dbfc
svg/custom/use-href-update-crash.svg failing on certain platforms
https://bugs.webkit.org/show_bug.cgi?id=104054

Reviewed by Darin Adler.

Fix mistake in use-href-update-crash.svg which caused the gc() not found problem. Update the test expectations
that had this marked as failure, it passes after the test fix.

* platform/gtk/TestExpectations:
* platform/mac/TestExpectations:
* platform/qt/TestExpectations:
* platform/win/TestExpectations:
* svg/custom/use-href-update-crash.svg:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@153833 268f45cc-cd09-0410-ab3c-d52691b4dbfc
fullscreen/exit-full-screen-iframe.html is failing
https://bugs.webkit.org/show_bug.cgi?id=90708

Unreviewed gardening.

* platform/mac/TestExpectations: Unskip passing test.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@153834 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Crash in WTF::RefPtr<WebCore::SpaceSplitStringData>::operator UnspecifiedBoolType
https://bugs.webkit.org/show_bug.cgi?id=118839

Reviewed by Darin Adler.

Source/WebCore:

Take into account that elementData() can be null in classAttributeChanged.

Test: svg/animations/classAttributeSettingCrash.html

* dom/Element.cpp:
(WebCore::Element::classAttributeChanged):

LayoutTests:

Add testcase that showed up to cause a crash by the fuzzer.

* svg/animations/classAttributeSettingCrash-expected.txt: Added.
* svg/animations/classAttributeSettingCrash.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@153835 268f45cc-cd09-0410-ab3c-d52691b4dbfc
REGRESSION(r130839): fast/canvas/webgl/arraybuffer-transfer-of-control.html is failing
https://bugs.webkit.org/show_bug.cgi?id=99096

Unreviewed gardening.

* platform/mac/TestExpectations: Unskip passing test.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@153836 268f45cc-cd09-0410-ab3c-d52691b4dbfc
fast/events/scroll-div-with-prevent-default-in-subframe.html is failing
https://bugs.webkit.org/show_bug.cgi?id=82747

Unreviewed gardening.

* platform/mac/TestExpectations: Unskip passing test.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@153837 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[EME] Implement MediaKeys.isTypeSupported()
https://bugs.webkit.org/show_bug.cgi?id=119586

Reviewed by Eric Carlson.

Source/WebCore:

Test: media/encrypted-media/encrypted-media-is-type-supported.html

The EME spec has removed the extra keySystem parameter from
HTMLMediaElement.canPlayType() in favor of a new isTypeSupported()
method on MediaKeys.

To implement this method, the CDMFactory needs to know whether the
registered CDM supports the specified mime type.  CDMs must register
this new factory method, which requires changes to CDMPrivateAVFoundation
and MockCDM.

Add the new MediaKeys.isTypeSupported() method:
* Modules/encryptedmedia/MediaKeys.cpp:
(WebCore::MediaKeys::isTypeSupported):
* Modules/encryptedmedia/MediaKeys.h:
* Modules/encryptedmedia/MediaKeys.idl:

Add the new factory CDMSupportsKeySystemAndMimeType method:
* Modules/encryptedmedia/CDM.cpp:
(WebCore::CDMFactory::CDMFactory): Now takes a third parameter.
(WebCore::installedCDMFactories): When adding the AVFoundation CDM, pass its new method.
(WebCore::CDM::registerCDMFactory): Now takes a third parameter.
(WebCore::CDM::keySystemSupportsMimeType): Added.
* Modules/encryptedmedia/CDM.h:
* WebCore.exp.in:

Register this new method with the factory for all concrete CDMs:
* Modules/encryptedmedia/CDMPrivateAVFoundation.h:
* Modules/encryptedmedia/CDMPrivateAVFoundation.mm:
(WebCore::CDMPrivateAVFoundation::supportsKeySystem):
(WebCore::CDMPrivateAVFoundation::supportsKeySystemAndMimeType):
* testing/Internals.cpp:
(WebCore::Internals::initializeMockCDM):
* testing/MockCDM.cpp:
(WebCore::MockCDM::supportsKeySystem):
(WebCore::MockCDM::supportsKeySystemAndMimeType):
* testing/MockCDM.h:

LayoutTests:

* media/encrypted-media/encrypted-media-is-type-supported-expected.txt: Added.
* media/encrypted-media/encrypted-media-is-type-supported.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@153838 268f45cc-cd09-0410-ab3c-d52691b4dbfc
        WKBundleFrameCopyProvisionalURL crashes when there is no provisional loader
        https://bugs.webkit.org/show_bug.cgi?id=119587

        Reviewed by Darin Adler.

        * WebProcess/WebPage/WebFrame.cpp: (WebKit::WebFrame::provisionalURL): Added a null
        check, like we already have in WebFrame::url().



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@153839 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unprefix use of transitions in Web Inspector code
https://bugs.webkit.org/show_bug.cgi?id=119588

Reviewed by Tim Hatcher.

Replace "-webkit-transition" with "transition".

* UserInterface/CSSCompletions.js:
(WebInspector.CSSCompletions.requestCSSNameCompletions.collectPropertyNameForCodeMirror):
* UserInterface/FindBanner.css:
(.find-banner):
(.find-banner.showing):
(.supports-find-banner.no-find-banner-transition):
(.supports-find-banner):
(.supports-find-banner.showing-find-banner):
* UserInterface/NetworkTimeline.css:
(.network-graph-side:hover .network-graph-label):
* UserInterface/Popover.css:
(.popover.fade-out):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@153840 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Layout Test fast/overflow/scrollbar-click-retains-focus.html is failing on Apple Mac WK1 and GTK.
https://bugs.webkit.org/show_bug.cgi?id=104104

Unreviewed gardening.

* platform/mac/TestExpectations: Unskip passing test.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@153841 268f45cc-cd09-0410-ab3c-d52691b4dbfc
http/tests/navigation/back-twice-without-commit.html is flaky
https://bugs.webkit.org/show_bug.cgi?id=82980

Unreviewed gardening.

* platform/mac/TestExpectations: Unskip passing test.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@153842 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Work towards WebGL on AppleWin port.
https://bugs.webkit.org/show_bug.cgi?id=119562

Reviewed by Brent Fulgham.

* WebCore.vcxproj/WebCore.vcxproj:
Build GLContext.cpp and GraphicsContext3DPrivate.cpp on AppleWin port.
* WebCore.vcxproj/WebCore.vcxproj.filters:
Moved GLContext and GraphicsContext3DPrivate from Cairo filter to graphics.
* platform/graphics/GraphicsContext3D.h:
Added m_webGLLayer for AppleWin port.
* platform/graphics/GraphicsContext3DPrivate.cpp:
Protected inclusion of PlatformContextCairo.h in USE(CAIRO) macro for non-cairo ports.
* platform/graphics/win/GraphicsContext3DWin.cpp:
Removed stub GraphicsContext3DPrivate implementation in favor of GraphicsContext3DPrivate.cpp.
(WebCore::GraphicsContext3D::GraphicsContext3D):
Added GraphicsContext3DPrivate and PlatformCALayer initialization.
(WebCore::GraphicsContext3D::makeContextCurrent):
(WebCore::GraphicsContext3D::platformGraphicsContext3D):
Added implementation based on Cairo ports' to be refactored soon.
(WebCore::GraphicsContext3D::platformLayer):
Return PlatformCALayer's PlatformLayer instead of 0.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@153843 268f45cc-cd09-0410-ab3c-d52691b4dbfc
fast/events/scroll-div-with-prevent-default-in-subframe.html is failing
https://bugs.webkit.org/show_bug.cgi?id=82747

Unreviewed gardening.

* platform/mac/TestExpectations: Mark test as flakey, it doesn't always pass.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@153844 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Windows] Improper Caption Button Displayed to Users
https://bugs.webkit.org/show_bug.cgi?id=119593 

Reviewed by Eric Carlson.

Remove the custom drawing code for the Windows port, and
have it render using the CSS/SVG markup like we do on OS X.

* rendering/RenderThemeWin.cpp: Remove drawing code.
* rendering/RenderThemeWin.h: Remove declaration.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@153845 268f45cc-cd09-0410-ab3c-d52691b4dbfc
fullscreen/exit-full-screen-iframe.html is failing
https://bugs.webkit.org/show_bug.cgi?id=90708

Unreviewed gardening.

* platform/mac/TestExpectations: Mark test as flakey, it doesn't always pass.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@153846 268f45cc-cd09-0410-ab3c-d52691b4dbfc
ASSERT_NOT_REACHED() touched in WebCore::SVGAnimatedStringAnimator::addAnimatedTypes
https://bugs.webkit.org/show_bug.cgi?id=113224

Reviewed by Dirk Schulze.

Source/WebCore:

Do not perform from-by animations for non-additive attributes.

Test: svg/animations/non-additive-type-from-by-animation.html

* svg/SVGAnimateElement.cpp:
(WebCore::SVGAnimateElement::calculateFromAndByValues):

LayoutTests:

Add a test for animating non-additive attributes in from-by animations

* svg/animations/non-additive-type-from-by-animation-expected.txt: Added.
* svg/animations/non-additive-type-from-by-animation.html: Added.
* svg/animations/resources/non-additive-type-from-by-animation.svg: Added.
* svg/animations/script-tests/non-additive-type-from-by-animation.js: Added.
(sample):
(executeTest):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@153847 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Add logging to the primary plugin detection
https://bugs.webkit.org/show_bug.cgi?id=119594

Reviewed by Tim Horton.

Add some simple logging to our primary plug-in detection.

* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::determinePrimarySnapshottedPlugIn):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@153848 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Hashing SecurityOrigin's can lead to trouble if you mutate them :(
https://bugs.webkit.org/show_bug.cgi?id=119533
<rdar://problem/12978338>

Reviewed by Andreas Kling.

We are getting into trouble in the following circumstance:
- You have a HashMap<RefPtr<SecurityOrigin>, Value> map.
- You add security origin A (http, www.webkit.org, 80) to the map.
- You mutate security origin A by domain relaxation, so that it has the domain webkit.org.
- You add security origin B (http, www.webkit.org, 80) to the map.
- You mutate security origin B by domain relaxation, so that it has the domain webkit.org.
    You now have two identical keys in the map.
- Add few more items to the map causing a rehash.
- When you try to add A and B back into the map, you will have a collision, because they now equal each other.

We should probably stop using SecurityOrigins as keys in HashMaps (and move to using a non-mutable SecurityOriginTuple,
or something), but for now, we can just only use the scheme / host / port part for equality, which is what all the users
really want.

* page/SecurityOriginHash.h:
(WebCore::SecurityOriginHash::equal):
Switch to using isSameSchemeHostPort() for SecurityOriginHash::equal().


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@153850 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[EME] setMediaKeys function as defined in the EME specification does not work
https://bugs.webkit.org/show_bug.cgi?id=119597

Reviewed by Anders Carlsson.

Source/WebCore:

No new tests; updated media/encrypted-media/encrypted-media-v2-syntax.html

Rename the mediaKeys attribute 'keys' and make readonly, and add an explicit
setMediaKeys() method in HTMLMediaElement's IDL.

* html/HTMLMediaElement.h:
(WebCore::HTMLMediaElement::keys):
* html/HTMLMediaElement.idl:

LayoutTests:

* media/encrypted-media/encrypted-media-v2-syntax-expected.txt:
* media/encrypted-media/encrypted-media-v2-syntax.html:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@153851 268f45cc-cd09-0410-ab3c-d52691b4dbfc
        [WK2] loader/go-back-cached-main-resource.html fails
        https://bugs.webkit.org/show_bug.cgi?id=116491

        Reviewed by Tim Horton.

        * DumpRenderTree/efl/DumpRenderTreeChrome.cpp:
        * DumpRenderTree/gtk/DumpRenderTree.cpp:
        * DumpRenderTree/qt/DumpRenderTreeQt.cpp:
        * DumpRenderTree/win/DumpRenderTree.cpp:
        Added FIXMEs about making path printing normalization more compatible.

        * DumpRenderTree/mac/ResourceLoadDelegate.mm: (-[NSURL _drt_descriptionSuitableForTestResult]):
        Return last path component in cases where we used to return a full path, which is
        never desirable. Added a null check to basePath to prevent potentially getting
        an Objective C exception.

        * WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
        (WTR::pathSuitableForTestResult): Changed to use path for main test window, not
        for a currently loading one (which is different for tests that use multiple windows).
        Changed to return "(null)" for empty URLs to match WK1 output. Changed to return
        last path component as last fallback.
        (WTR::dumpRequestDescriptionSuitableForTestResult): We no longer need to pass main
        frame URL here, and it was potentially a wrong frame.
        (WTR::dumpResponseDescriptionSuitableForTestResult): Ditto.
        (WTR::InjectedBundlePage::willPerformClientRedirectForFrame): Ditto.
        (WTR::InjectedBundlePage::didInitiateLoadForResource): Ditto.
        (WTR::InjectedBundlePage::willSendRequestForFrame): Ditto.
        (WTR::InjectedBundlePage::didReceiveResponseForResource): Ditto.



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