WebKit.git
2 years ago[Scripts] Fix missing variable warnings from svn-create-patch when there are untracke...
weinig@apple.com [Mon, 17 Jul 2017 17:56:23 +0000 (17:56 +0000)]
[Scripts] Fix missing variable warnings from svn-create-patch when there are untracked files
https://bugs.webkit.org/show_bug.cgi?id=174575

Reviewed by Brady Eidson.

* Scripts/svn-create-patch:
(findModificationType):
Add support for more status codes. C -> conflicted, ? -> untracked, ! -> missing. Give a
default value of "unknown".

(generateFileList):
Handle all the new modification types. Abort on conflicted, missing, and unknown. Log
for untracked, which matches our old behavior.

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

2 years agoRemove custom defined RELEASE_ASSERT in DFGObjectAllocationSinkingPhase
sbarati@apple.com [Mon, 17 Jul 2017 16:38:10 +0000 (16:38 +0000)]
Remove custom defined RELEASE_ASSERT in DFGObjectAllocationSinkingPhase
https://bugs.webkit.org/show_bug.cgi?id=174584

Rubber stamped by Keith Miller.

I used it to diagnose a bug. The bug is now fixed. This custom
RELEASE_ASSERT is no longer needed.

* dfg/DFGObjectAllocationSinkingPhase.cpp:

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

2 years ago-Wformat-truncation warning in ConfigFile.cpp
mcatanzaro@igalia.com [Mon, 17 Jul 2017 15:30:59 +0000 (15:30 +0000)]
-Wformat-truncation warning in ConfigFile.cpp
https://bugs.webkit.org/show_bug.cgi?id=174506

Reviewed by Darin Adler.

Check if the JSC config filename would be truncated due to exceeding max path length. If so,
return ParseError.

* runtime/ConfigFile.cpp:
(JSC::ConfigFile::parse):

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

2 years ago[CMake] Create targets before WEBKIT_INCLUDE_CONFIG_FILES_IF_EXISTS is called
annulen@yandex.ru [Mon, 17 Jul 2017 15:16:54 +0000 (15:16 +0000)]
[CMake] Create targets before WEBKIT_INCLUDE_CONFIG_FILES_IF_EXISTS is called
https://bugs.webkit.org/show_bug.cgi?id=174557

Reviewed by Michael Catanzaro.

.:

* Source/cmake/WebKitMacros.cmake:

Source/JavaScriptCore:

* CMakeLists.txt:

Source/WebCore:

No new tests needed.

* CMakeLists.txt:

Source/WebCore/PAL:

No new tests needed.

* pal/CMakeLists.txt:

Source/WebKit:

* CMakeLists.txt:

Source/WebKitLegacy:

* CMakeLists.txt:

Source/WTF:

* wtf/CMakeLists.txt:

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

2 years agoUnreviewed, rolling out r219556.
mcatanzaro@igalia.com [Mon, 17 Jul 2017 14:56:40 +0000 (14:56 +0000)]
Unreviewed, rolling out r219556.

Broke build without WebCrypto

Reverted changeset:

"[CMake] Clean up Web Crypto build targets"
https://bugs.webkit.org/show_bug.cgi?id=174253
http://trac.webkit.org/changeset/219556

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

2 years agoMedia controls draw behind captions
graouts@webkit.org [Mon, 17 Jul 2017 12:55:29 +0000 (12:55 +0000)]
Media controls draw behind captions
https://bugs.webkit.org/show_bug.cgi?id=174579
<rdar://problem/33295427>

Reviewed by Dean Jackson.

Source/WebCore:

Ensure the captions container is added as a previous sibling to the controls container.

Test: media/modern-media-controls/media-controls/media-controls-display-above-captions.html

* Modules/modern-media-controls/media/media-controller.js:
(MediaController):

LayoutTests:

Add a new test that checks the order in which order the captions and controls containers appear
under the media shadow root.

* media/modern-media-controls/media-controls/media-controls-display-above-captions-expected.txt: Added.
* media/modern-media-controls/media-controls/media-controls-display-above-captions.html: Added.
* platform/ios-simulator/TestExpectations:
* platform/mac/TestExpectations:

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

2 years agoAdd some missing build dependencies on Fedora
commit-queue@webkit.org [Mon, 17 Jul 2017 12:10:31 +0000 (12:10 +0000)]
Add some missing build dependencies on Fedora
https://bugs.webkit.org/show_bug.cgi?id=174578

Unreviewed dependency update.

Patch by Charlie Turner <cturner@igalia.com> on 2017-07-17

* gtk/install-dependencies:

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

2 years ago[CMake] Clean up Web Crypto build targets
zandobersek@gmail.com [Mon, 17 Jul 2017 08:45:54 +0000 (08:45 +0000)]
[CMake] Clean up Web Crypto build targets
https://bugs.webkit.org/show_bug.cgi?id=174253

Reviewed by Michael Catanzaro.

Gather the common WebCrypto source files in CMakeLists.txt, including them
in the build unconditionally and instead relying on ENABLE_SUBTLE_CRYPTO
build guards to exclude the code from compilation if the feature is disabled.

PlatformGTK.cmake, PlatformMac.cmake and PlatformWPE.cmake can then remove
duplicated build targets. PlatformMac.cmake still lists all the Mac-specific
Web Crypto build targets.

PlatformGTK.cmake and PlatformWPE.cmake now include GCrypt.cmake if the build
was configured to enable the use of libgcrypt. The new CMake file adds the
libgcrypt-specific Web Crypto build targets to the build if the feature was
enabled, and also sets up libgcrypt include directiories and libraries.

No new tests -- no change in behavior.

* CMakeLists.txt:
* PlatformGTK.cmake:
* PlatformMac.cmake:
* PlatformWPE.cmake:
* platform/GCrypt.cmake: Added.

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

2 years agoWeb Automation: link and partial link queries don't work if the link contains formatt...
carlosgc@webkit.org [Mon, 17 Jul 2017 07:03:03 +0000 (07:03 +0000)]
Web Automation: link and partial link queries don't work if the link contains formatting tags
https://bugs.webkit.org/show_bug.cgi?id=174498

Reviewed by Brian Burg.

So, for example, if we find links with text "Foo" and there's a link like <a href=""><bA>Foo</b></a> we fail
with no such element error. This causes test test_Link_With_Formatting_Tags to fail.

* UIProcess/Automation/atoms/FindNodes.js:
(switch): Use descendant-or-self::text() instead of just text() in the links xpath expressions.

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

2 years agoWeb Automation: FindNodes should throw an error in case of invalid strategy
carlosgc@webkit.org [Mon, 17 Jul 2017 07:01:07 +0000 (07:01 +0000)]
Web Automation: FindNodes should throw an error in case of invalid strategy
https://bugs.webkit.org/show_bug.cgi?id=174497

Reviewed by Brian Burg.

We are currently returning null or empty list. According to the spec in 12.2 Find Element and 12.3 Find
Elements, step 4: "If location strategy is not present as a keyword in the table of location strategies, return
error with error code invalid argument.".
https://www.w3.org/TR/webdriver/#find-element.

This is causing test test_should_throw_an_error_if_user_passes_in_invalid_by_when_find_elements to fail.

* UIProcess/Automation/atoms/FindNodes.js:
(switch): Throw an error in case of unknown strategy.
* WebProcess/Automation/WebAutomationSessionProxy.cpp:
(WebKit::WebAutomationSessionProxy::evaluateJavaScriptFunction): Handle InvalidParameter exceptions.

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

2 years ago-Wreorder warning caused by GraphicsContext3D cleanup
mcatanzaro@igalia.com [Mon, 17 Jul 2017 06:58:48 +0000 (06:58 +0000)]
-Wreorder warning caused by GraphicsContext3D cleanup
https://bugs.webkit.org/show_bug.cgi?id=174511

Reviewed by Carlos Garcia Campos.

* platform/graphics/cairo/GraphicsContext3DCairo.cpp:
(WebCore::GraphicsContext3D::GraphicsContext3D):
* platform/graphics/opengl/GraphicsContext3DOpenGLES.cpp:
(WebCore::GraphicsContext3D::GraphicsContext3D):

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

2 years agoDismissing the captions panel using the mouse is too eager to remove the captions...
commit-queue@webkit.org [Mon, 17 Jul 2017 05:29:20 +0000 (05:29 +0000)]
Dismissing the captions panel using the mouse is too eager to remove the captions panel and media controls
https://bugs.webkit.org/show_bug.cgi?id=174571
<rdar://problem/33294968>

Patch by Antoine Quint <graouts@apple.com> on 2017-07-16
Reviewed by Eric Carlson.

Source/WebCore:

We did several things wrong when dismissing the tracks panel:

    - we did not check whether we were hosted in a shadow root when figuring if a click was on the tracks panel
    - we did not check whether we clicked over the media when dismissing the tracks panel
    - we did not check whether auto-hide was on before fading the media controls out when we clicked outside
      the media controls bounds

We now correctly account for all of those cases and implement the following behavior when clickng as the tracks
panel is presented:

    - dismiss the panel if the click is outside of the panel
    - dismiss the panel and the media controls if the click is outside the video and the media controls have
      auto-hide on (ie. media is playing)
    - dismiss the panel and the media controls after the track selection animation is finished if a track is selected

Tests: media/modern-media-controls/tracks-panel/tracks-panel-up-click-outside-media-does-not-dimiss-media-controls-when-media-is-paused.html
       media/modern-media-controls/tracks-panel/tracks-panel-up-click-over-media-does-not-dimiss-media-controls-when-media-is-playing.html

* Modules/modern-media-controls/controls/media-controls.js:
(MediaControls.prototype.hideTracksPanel): Only hide the media controls if we clicked outside of the media
controls bounds and if we have auto-hide on when idle (ie. the media is playing).
(MediaControls.prototype.isPointInControls): Add an option to specify whether the container should be
considered when checking if a point is contained within the media controls bounds.
* Modules/modern-media-controls/controls/tracks-panel.js:
(TracksPanel.prototype._handleMousedown):
(TracksPanel.prototype._isPointInTracksPanel): Correctly check whether the element that we started pressing
on is contained within the tracks panel, accounting for the case where we are presented within a shadow root
(ie. always when runing inside a Web page).

LayoutTests:

Adding a method to show the tracks panel for a given shadow root and adding new tests to check the correct
behavior when dismissing the tracks panel when clicking over the media element or outside the media element
when it's paused.

* media/modern-media-controls/resources/media-controls-utils.js:
(pressOnElement):
(pressAtPoint):
(showTracksPanel):
(finishMediaControlsTest): Deleted.
* media/modern-media-controls/tracks-panel/tracks-panel-up-click-outside-media-does-not-dimiss-media-controls-when-media-is-paused-expected.txt: Added.
* media/modern-media-controls/tracks-panel/tracks-panel-up-click-outside-media-does-not-dimiss-media-controls-when-media-is-paused.html: Added.
* media/modern-media-controls/tracks-panel/tracks-panel-up-click-over-media-does-not-dimiss-media-controls-when-media-is-playing-expected.txt: Added.
* media/modern-media-controls/tracks-panel/tracks-panel-up-click-over-media-does-not-dimiss-media-controls-when-media-is-playing.html: Added.
* platform/mac/TestExpectations:

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

2 years agoDisallowUserAgentShadowContent moves out of non-UA shadow roots
commit-queue@webkit.org [Mon, 17 Jul 2017 02:10:42 +0000 (02:10 +0000)]
DisallowUserAgentShadowContent moves out of non-UA shadow roots
https://bugs.webkit.org/show_bug.cgi?id=165647

Patch by Ali Juma <ajuma@chromium.org> on 2017-07-16
Reviewed by Ryosuke Niwa.

Source/WebCore:

Make rect-based hit-testing include nodes in non-UA shadow trees when the
HitTestRequest has type DisallowUserAgentShadowContent.

Test: fast/dom/nodesFromRect/nodesFromRect-shadow.html

* rendering/HitTestResult.cpp:
(WebCore::HitTestResult::addNodeToRectBasedTestResult):
* testing/Internals.cpp:
(WebCore::Internals::nodesFromRect):
* testing/Internals.h:

LayoutTests:

* fast/dom/nodesFromRect/nodesFromRect-shadow-expected.txt: Added.
* fast/dom/nodesFromRect/nodesFromRect-shadow.html: Added.
* fast/dom/nodesFromRect/resources/nodesFromRect.js:
(check):
(checkShadowContent):
(nodesFromRectAsString):

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

2 years agoCrash when a WKHTTPCookieStore outlives its owning WKWebsiteDataStore.
beidson@apple.com [Mon, 17 Jul 2017 01:43:14 +0000 (01:43 +0000)]
Crash when a WKHTTPCookieStore outlives its owning WKWebsiteDataStore.
<rdar://problem/33341730> and https://bugs.webkit.org/show_bug.cgi?id=174574

Reviewed by Tim Horton.

Source/WebKit:

Instead of holding a weak reference to its owning API::WebsiteDataStore,
API::HTTPCookieStore can hold a strong reference to the owner's implementation
WebKit::WebsiteDataStore.

* UIProcess/API/APIHTTPCookieStore.cpp:
(API::HTTPCookieStore::HTTPCookieStore):
(API::HTTPCookieStore::cookies):
(API::HTTPCookieStore::setCookie):
(API::HTTPCookieStore::deleteCookie):
(API::HTTPCookieStore::registerObserver):
(API::HTTPCookieStore::unregisterObserver):
(API::HTTPCookieStore::cookieManagerDestroyed):
(API::HTTPCookieStore::registerForNewProcessPoolNotifications):
* UIProcess/API/APIHTTPCookieStore.h:

Tools:

* TestWebKitAPI/Tests/WebKit2Cocoa/WKHTTPCookieStore.mm:
(-[CookieNavigationDelegate webView:didFinishNavigation:]):
(TEST):

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

2 years agoClicking edges of media control buttons changes visual state of button (pressed)...
commit-queue@webkit.org [Sun, 16 Jul 2017 22:23:52 +0000 (22:23 +0000)]
Clicking edges of media control buttons changes visual state of button (pressed) but doesn't execute action
https://bugs.webkit.org/show_bug.cgi?id=174565
<rdar://problem/33294833>

Patch by Antoine Quint <graouts@apple.com> on 2017-07-16
Reviewed by Dean Jackson.

Source/WebCore:

WebCore doesn't dispatch a "click" event to a parent element when a child that was the original target when
the "mousedown" occured is no longer hit-testing at the location where the mouse pointer is at when the "mouseup"
occurs (see webkit.org/b/174564). Since button icons, which are a <picture> element that is a child of the
<button> element for media controls buttons, shrink to 89% of their size when the ":active" pseudo-class matches,
clicking on the edges of the media controls buttons would not trigger the expected action.

Test: media/modern-media-controls/button/button-click-on-edges.html

* Modules/modern-media-controls/controls/button.css:
(button > picture):

LayoutTests:

Add a new test where we click on the edge of a button and check that we trigger the Button's
UI delegate. This test fails prior to this patch.

* media/modern-media-controls/button/button-click-on-edges-expected.txt: Added.
* media/modern-media-controls/button/button-click-on-edges.html: Added.
* platform/ios-simulator/TestExpectations:

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

2 years agoMake the decision for asynchronously decoding an image be in one place
commit-queue@webkit.org [Sun, 16 Jul 2017 21:36:54 +0000 (21:36 +0000)]
Make the decision for asynchronously decoding an image be in one place
https://bugs.webkit.org/show_bug.cgi?id=174479

Patch by Said Abou-Hallawa <sabouhallawa@apple.com> on 2017-07-16
Reviewed by Tim Horton.

Move all the logic of whether a large image should be asynchronously decoded
or not be in one place: RenderBoxModelObject::decodingModeForImageDraw().

* loader/cache/CachedImage.cpp:
(WebCore::CachedImage::addPendingImageDrawingClient): Fixing unrelated
spelling error.
* platform/RuntimeApplicationChecks.h:
* platform/cocoa/RuntimeApplicationChecksCocoa.mm:
(WebCore::IOSApplication::isIBooks):
(WebCore::IOSApplication::isIBooksStorytime):
* platform/graphics/BitmapImage.cpp:
(WebCore::BitmapImage::updateFromSettings): Remove reading the setting
largeImageAsyncDecodingEnabled from this function because it will be read
by RenderBoxModelObject::decodingModeForImageDraw().
(WebCore::BitmapImage::dataChanged):
(WebCore::BitmapImage::draw):
(WebCore::BitmapImage::shouldAnimate):
(WebCore::BitmapImage::canAnimate):
(WebCore::BitmapImage::canUseAsyncDecodingForLargeImages):
(WebCore::BitmapImage::shouldUseAsyncDecodingForAnimatedImages):
(WebCore::BitmapImage::canDestroyDecodedData):
(WebCore::BitmapImage::shouldUseAsyncDecodingForLargeImages): Deleted.
* platform/graphics/BitmapImage.h:
* platform/graphics/ImageSource.cpp:
(WebCore::ImageSource::canUseAsyncDecoding): It is okay to keep the
decoded frame if canUseAsyncDecodingForLargeImages() is true by the setting
largeImageAsyncDecodingEnabled is false.
(WebCore::ImageSource::shouldUseAsyncDecoding): Deleted.
* platform/graphics/ImageSource.h:
* rendering/RenderBoxModelObject.cpp:
(WebCore::RenderBoxModelObject::decodingModeForImageDraw): The plan is to
add a new Internal settings to force asynchronous image decoding regardless
of the image size and the settings.
(WebCore::RenderBoxModelObject::paintFillLayerExtended):
* rendering/RenderBoxModelObject.h:
* rendering/RenderImage.cpp:
(WebCore::RenderImage::paintIntoRect):

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

2 years ago[CMake] Raise minimum CMake requirement
mcatanzaro@igalia.com [Sun, 16 Jul 2017 14:28:12 +0000 (14:28 +0000)]
[CMake] Raise minimum CMake requirement
https://bugs.webkit.org/show_bug.cgi?id=174545

Reviewed by Konstantin Tokarev.

.:

* CMakeLists.txt:
* Source/cmake/OptionsCommon.cmake:
* Source/cmake/OptionsGTK.cmake:
* Source/cmake/OptionsJSCOnly.cmake:

Source/WebCore:

* WebCoreMacros.cmake:

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

2 years ago[GTK] Sort inspector GResource manifest to ensure reproducible builds
commit-queue@webkit.org [Sun, 16 Jul 2017 12:51:26 +0000 (12:51 +0000)]
[GTK] Sort inspector GResource manifest to ensure reproducible builds
https://bugs.webkit.org/show_bug.cgi?id=174540

Patch by Bernhard M. Wiedemann <bwiedemann@suse.de> on 2017-07-16
Reviewed by Michael Catanzaro.

* gtk/generate-inspector-gresource-manifest.py:
(get_filenames): sort list of input files

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

2 years agoMake sure all CFHTTPCookieStorageRefs we create are scheduled.
beidson@apple.com [Sun, 16 Jul 2017 06:57:48 +0000 (06:57 +0000)]
Make sure all CFHTTPCookieStorageRefs we create are scheduled.
<rdar://problem/33221110> and https://bugs.webkit.org/show_bug.cgi?id=174513

Reviewed by Tim Horton.

Source/WebCore:

* platform/spi/cf/CFNetworkSPI.h:

Source/WebKit:

Whenever we create a CFHTTPCookieStorage from identifying data it is unscheduled.
We need to schedule it on the appropriate RunLoop.

This patch also cleans up the creation of the identifying data itself.

* NetworkProcess/mac/RemoteNetworkingContext.mm:
(WebKit::RemoteNetworkingContext::ensureWebsiteDataStoreSession):

* Shared/cf/CookieStorageUtilsCF.h: Added.
* Shared/cf/CookieStorageUtilsCF.mm: Added.
(WebKit::cookieStorageFromIdentifyingData):
(WebKit::identifyingDataFromCookieStorage):

* Shared/mac/ChildProcessMac.mm:
(WebKit::ChildProcess::setSharedHTTPCookieStorage):

* UIProcess/Cocoa/WebProcessPoolCocoa.mm:
(WebKit::WebProcessPool::platformInitializeWebProcess):
(WebKit::WebProcessPool::platformInitializeNetworkProcess):

* UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
(WebKit::WebsiteDataStore::parameters):

* WebKit.xcodeproj/project.pbxproj:

* WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.mm:
(WebKit::WebFrameNetworkingContext::ensureWebsiteDataStoreSession):

Tools:

* TestWebKitAPI/Tests/WebKit2Cocoa/WKHTTPCookieStore.mm:
(TEST): Make this test more reliable by clearing everything beforehand.

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

2 years agoRename RenderStyle::fontSize() to RenderStyle::computedFontPixelSize()
mmaxfield@apple.com [Sun, 16 Jul 2017 06:08:41 +0000 (06:08 +0000)]
Rename RenderStyle::fontSize() to RenderStyle::computedFontPixelSize()
https://bugs.webkit.org/show_bug.cgi?id=174509

Reviewed by Simon Fraser.

We have three font size functions:
- computedFontSize(): returns a float
- specifiedFontSize(): also returns a float
- fontSize(): returns the rounded computedFontSize()

FontDescription uses the convention of labelling rounded values as "pixel",
so a better name font fontSize() is computedFontPixelSize().

Also, because font sizes can never be negative, switch the type from an int
to an unsigned.

No new tests because there is no behavior change.

* accessibility/atk/WebKitAccessibleInterfaceText.cpp:
(getAttributeSetForAccessibilityObject):
* css/StyleResolver.cpp:
(WebCore::StyleResolver::adjustRenderStyle):
* platform/graphics/FontDescription.h:
(WebCore::FontDescription::computedPixelSize):
(WebCore::FontDescription::fontSelectionRequest):
* rendering/RenderBlock.cpp:
(WebCore::styleForFirstLetter):
* rendering/RenderRubyRun.cpp:
(WebCore::shouldOverhang):
(WebCore::RenderRubyRun::getOverhang):
* rendering/RenderRubyText.cpp:
(WebCore::RenderRubyText::adjustInlineDirectionLineBounds):
* rendering/RenderThemeGtk.cpp:
(WebCore::adjustSearchFieldIconStyle):
(WebCore::paintSearchFieldIcon):
* rendering/RenderThemeIOS.mm:
(WebCore::RenderThemeIOS::adjustCheckboxStyle):
(WebCore::RenderThemeIOS::adjustRadioStyle):
* rendering/RenderThemeMac.mm:
(WebCore::RenderThemeMac::controlSizeForFont):
(WebCore::RenderThemeMac::controlSizeForSystemFont):
(WebCore::RenderThemeMac::paintMenuListButtonDecorations):
(WebCore::RenderThemeMac::popupInternalPaddingBox):
(WebCore::RenderThemeMac::adjustMenuListButtonStyle):
* rendering/RenderThemeWin.cpp:
(WebCore::RenderThemeWin::adjustSearchFieldCancelButtonStyle):
(WebCore::RenderThemeWin::adjustSearchFieldResultsDecorationPartStyle):
(WebCore::RenderThemeWin::adjustSearchFieldResultsButtonStyle):
* rendering/TextDecorationPainter.cpp:
(WebCore::TextDecorationPainter::paintTextDecoration):
* rendering/mathml/RenderMathMLRow.cpp:
(WebCore::RenderMathMLRow::computeLineVerticalStretch):
* rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::computedFontPixelSize):
(WebCore::RenderStyle::computedLineHeight):
(WebCore::RenderStyle::fontSize): Deleted.
* rendering/style/RenderStyle.h:
* style/InlineTextBoxStyle.cpp:
(WebCore::visualOverflowForDecorations):
* style/StyleTreeResolver.cpp:
(WebCore::Style::TreeResolver::resolveElement):
* svg/SVGLengthContext.cpp:
(WebCore::SVGLengthContext::convertValueFromUserUnitsToEMS):
(WebCore::SVGLengthContext::convertValueFromEMSToUserUnits):

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

2 years agoline-height: <number> gets visually applied twice when text autosizing is in effect
mmaxfield@apple.com [Sun, 16 Jul 2017 05:52:30 +0000 (05:52 +0000)]
line-height: <number> gets visually applied twice when text autosizing is in effect
https://bugs.webkit.org/show_bug.cgi?id=174536
<rdar://problem/33338259>

Reviewed by Simon Fraser.

Source/WebCore:

StyleBuilderConverter::convertLineHeight() converts line-height: <number> into a
"percentage" length. Then, when layout needs to know what the computed value of
line-height is, RenderStyle::computedLineHeight() multiplies this percentage by
the computed font size.

With autosizing, the computed font size already incorporates the autosizing
multiplier, so we shouldn't also incorporate this multiplier into the percentage
value itself. getComputedStyle()'s lineHeightFromStyle() was compensating for
this double application by multiplying the percentage by the font-size's specified
value instead of its computed value, which is incorrect.

Test: fast/text-autosizing/line-height-number.html

* css/CSSComputedStyleDeclaration.cpp:
(WebCore::lineHeightFromStyle):
* css/StyleBuilderConverter.h:
(WebCore::StyleBuilderConverter::convertLineHeight):

LayoutTests:

* fast/text-autosizing/line-height-number-expected.html: Added.
* fast/text-autosizing/line-height-number.html: Added.

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

2 years agoMake it possible to extend check-webkit-style with Apple-internal checkers
ddkilzer@apple.com [Sun, 16 Jul 2017 04:47:03 +0000 (04:47 +0000)]
Make it possible to extend check-webkit-style with Apple-internal checkers
<https://webkit.org/b/174464>
<rdar://problem/25564402>

Reviewed by Darin Adler.

* Scripts/webkitpy/style/checker.py: Import apple_additions.
(_all_categories): Add categories from apple_additions() if it
exists.
(CheckerDispatcher._create_checker): Create python checker
from apple_additions() if it exists.

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

2 years ago[iOS WK2] Presenting an action sheet on an image map prevents selection UI from updating
wenson_hsieh@apple.com [Sun, 16 Jul 2017 04:01:30 +0000 (04:01 +0000)]
[iOS WK2] Presenting an action sheet on an image map prevents selection UI from updating
https://bugs.webkit.org/show_bug.cgi?id=174539
<rdar://problem/33307395>

Reviewed by Darin Adler.

Source/WebCore:

Currently, if TextIndicator fails to take a snapshot in TextIndicator::createWithRange, we will enter an
inconsistent state in the web process where Editor will continue to ignore selection changes until the next time
Editor::setIgnoreSelectionChanges(false) is called. This causes us to indefinitely defer EditorState updates to
the UI process, which leads to selection UI appearing unresponsive.

To fix this, we introduce a new TemporarySelectionChange object to simplify selection changes and/or
EditorState-update-ignoring behaviors within the scope of a single function. The constructor applies these
temporary changes, and the destructor reverts them as needed to their prior values.

This patch only adopts TemporarySelectionChange in order to fix this bug, but future patches will replace the
remaining places where we temporarily change selection and/or ignore selection with this helper.

Test: ActionSheetTests.ImageMapDoesNotDestroySelection.

* editing/Editor.cpp:
(WebCore::TemporarySelectionChange::TemporarySelectionChange):
(WebCore::TemporarySelectionChange::~TemporarySelectionChange):
* editing/Editor.h:
* editing/FrameSelection.h:
(WebCore::FrameSelection::isUpdateAppearanceEnabled):
* page/TextIndicator.cpp:
(WebCore::TextIndicator::createWithRange):

Source/WebKit:

Small tweak to avoid presenting at the element rect or text rect if the interaction information failed to
capture valid bounds for the element. We instead fall back to presenting at the touch location. This addresses
problems when presenting the action sheet popover on image maps on iPad, where GetPositionInformation fails to
capture correct data about for the <area>.

* UIProcess/ios/WKActionSheetAssistant.mm:
(presentationStyleForView):

Tools:

Adds a new unit test suite to cover action sheet popover presentation.

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKit2Cocoa/image-map.html: Added.
* TestWebKitAPI/Tests/ios/ActionSheetTests.mm: Added.
(-[ActionSheetObserver waitForActionSheetAfterBlock:]):

Runs the given block and waits until the UI process has indicated that it will present an action sheet.

(-[ActionSheetObserver _webView:actionsForElement:defaultActions:]):
(TestWebKitAPI::IPadUserInterfaceSwizzler::IPadUserInterfaceSwizzler):

Helper class to alter the behavior of [[UIDevice currentDevice] userInterfaceIdiom] for testing.

(TestWebKitAPI::IPadUserInterfaceSwizzler::padUserInterfaceIdiom):
(TestWebKitAPI::TEST):

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

2 years ago[Scripts] Make svn-create-patch work better when called in sub directories
weinig@apple.com [Sun, 16 Jul 2017 03:45:04 +0000 (03:45 +0000)]
[Scripts] Make svn-create-patch work better when called in sub directories
https://bugs.webkit.org/show_bug.cgi?id=174551

Reviewed by Darin Adler.

- Fixes manufacturePatchForAdditionWithHistory to use the correct path
  by ensuring that the prefix is applied as is done in generateDiff.
- Silence output of explanatory lines from svn stat (" > move to ...")
  that show up in STDERR when running svn-create-patch.
- Add verbose logging that I found useful while debugging this issue.

* Scripts/svn-create-patch:
(findBaseUrl):
(findMimeType):
(findSourceFileAndRevision):
(generateDiff):
(generateFileList):
(manufacturePatchForAdditionWithHistory):

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

2 years agoClean up line-height and minimumFontSize functions
mmaxfield@apple.com [Sat, 15 Jul 2017 22:03:23 +0000 (22:03 +0000)]
Clean up line-height and minimumFontSize functions
https://bugs.webkit.org/show_bug.cgi?id=174535

Reviewed by Simon Fraser.

No behavior change.

No new tests because there is no behavior change.

* css/StyleBuilderConverter.h:
(WebCore::StyleBuilderConverter::convertLineHeight):
* css/StyleResolver.cpp:
(WebCore::StyleResolver::styleForKeyframe):
(WebCore::StyleResolver::adjustRenderStyle):
(WebCore::StyleResolver::pseudoStyleRulesForElement):
(WebCore::StyleResolver::applyMatchedProperties):
(WebCore::StyleResolver::cascadedPropertiesForRollback):
(WebCore::StyleResolver::applyProperty):
(WebCore::StyleResolver::checkForZoomChange):
(WebCore::StyleResolver::createFilterOperations):
(WebCore::StyleResolver::CascadedProperties::set):
(WebCore::StyleResolver::applyCascadedProperties):
* style/StyleFontSizeFunctions.cpp:
(WebCore::Style::computedFontSizeFromSpecifiedSize):
(WebCore::Style::computedFontSizeFromSpecifiedSizeForSVGInlineText):
(): Deleted.

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

2 years agoUnreviewed build fix after r219537.
jbedard@apple.com [Sat, 15 Jul 2017 21:47:16 +0000 (21:47 +0000)]
Unreviewed build fix after r219537.

* TestWebKitAPI/Tests/ios/DataInteractionTests.mm:

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

2 years agoAdd iOS 11 SPI
jbedard@apple.com [Sat, 15 Jul 2017 05:41:54 +0000 (05:41 +0000)]
Add iOS 11 SPI
https://bugs.webkit.org/show_bug.cgi?id=174430
<rdar://problem/33269288>

Reviewed by Tim Horton.

Source/WebCore:

* WebCore.xcodeproj/project.pbxproj: Add sqlite3SPI.h header.
* platform/ios/PlatformPasteboardIOS.mm: Move UIKit SPI to UIKitSPI.h.
* platform/ios/WebItemProviderPasteboard.mm: Ditto.
* platform/network/cf/FormDataStreamCFNet.cpp: Explicitly define fnfErr and remove
MacErrors.h header for iOS.
* platform/spi/cocoa/IOSurfaceSPI.h: IOSurface is no longer SPI in iOS 11.
* platform/spi/cocoa/PassKitSPI.h: Do not re-define setRequiredShippingContactFields
and setRequiredBillingContactFields in iOS 11.
* platform/spi/cocoa/QuartzCoreSPI.h: Added QuartzCoreSPI used in iOS 11.
* platform/spi/ios/UIKitSPI.h: Add drag-and-drop SPI.
* platform/spi/ios/sqlite3SPI.h: Define required sqlite3 macros.
* platform/sql/SQLiteFileSystem.cpp: Use sqlite3SPI.h.

Source/WebKit:

* Platform/spi/ios/UIKitSPI.h: Add drag-and-drop SPI for iOS 11.
* UIProcess/ios/WKContentViewInteraction.mm: Move UIKit SPI to UIKitSPI.h.

Source/WebKitLegacy:

* Storage/StorageTracker.cpp: sqlite3_private.h no longer exists in the iOS
Simulator SDK, explicitly define the required macro.

Source/WTF:

* Configurations/WTF.xcconfig: Exclude MachExceptions.def when building iOS 11 for
the iOS simulator.

Tools:

* TestWebKitAPI/Tests/ios/DataInteractionTests.mm: Define drag-and-drop API required for testing.
* TestWebKitAPI/ios/DataInteractionSimulator.h: Ditto.
* TestWebKitAPI/ios/DataInteractionSimulator.mm: Ditto.

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

2 years ago[GCrypt] Implement CryptoKeyRSA PKCS#8 exports
zandobersek@gmail.com [Sat, 15 Jul 2017 05:23:19 +0000 (05:23 +0000)]
[GCrypt] Implement CryptoKeyRSA PKCS#8 exports
https://bugs.webkit.org/show_bug.cgi?id=173697

Reviewed by Jiewen Tan.

Source/WebCore:

Implement the PKCS#8 import operation for RSA keys for platforms that use
libgcrypt.

In CryptoKeyRSA::exportPkcs8(), we bail early with an invalid access exception if
this export is not being done for a private key. Otherwise, we start with creating
the `RSAPrivateKey` ASN.1 structure, writing out '0' under the `version` element
and then retrieving the modulus, public and private exponent and both primes.
MPI data for those parameters is written out into corresponding elements in the
`RSAPrivateKey` structure. We then manually compute values of both exponents and
the coefficient parameters, using the private exponent's and both primes' MPI
values. The p and q parameters (i.e. the primes) are switched in libgcrypt,
deviating from the standard practice, so we have to operate with those two
accordingly. We eliminate the optional `otherPrimeInfos` attribute on the
`RSAPrivateKey` structure. Support for this attribute will be added later.

We then create the `PrivateKeyInfo` ASN.1 structure, and write out '0' under the
`version` element. The id-rsaEncryption object identifier is written out under
the `algorithm.algorithm` element. In the future, an object identifier that
matches this key's algorithm will have to be written out here (id-RSASSA-PSS or
id-RSAES-OAEP), along with the appropriate parameters structure, but no test in
WebKit or the web-platform-tests suite covers this detail. For now, a null value
is written out under the `algorithm.parameters` element.

Data for the `RSAPrivateKey` structure is retrieved and written out under the
`privateKey` element.  The optional `attributes` element on the `PrivateKeyInfo`
structure is eliminated.

Data that was encoded through the `PrivateKeyInfo` structure is then retrieved
and returned from the exportPkcs8() method.

No new tests -- related tests are now passing and are unskipped.

* crypto/gcrypt/CryptoKeyRSAGCrypt.cpp:
(WebCore::CryptoKeyRSA::exportPkcs8):

LayoutTests:

* platform/gtk/TestExpectations: Unskip the RSA PKCS#8 export tests

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

2 years ago[GCrypt] Implement CryptoKeyRSA PKCS#8 imports
zandobersek@gmail.com [Sat, 15 Jul 2017 05:20:32 +0000 (05:20 +0000)]
[GCrypt] Implement CryptoKeyRSA PKCS#8 imports
https://bugs.webkit.org/show_bug.cgi?id=173696

Reviewed by Jiewen Tan.

Source/WebCore:

Implement the PKCS#8 import operation for RSA keys for platforms that use
libgcrypt.

In CryptoKeyRSA::importPkcs8(), the provided key data is decoded against the
'PrivateKeyInfo` ASN.1 structure. We then validate the `version` element and
check that the `privateKeyAlgorithm.algorithm` element contains a supported
object identifier. This check is for now mostly superficial, only ensuring
that the object identifier is either id-rsaEncryption, id-RSAES-OAEP or
id-RSASSA-PSS. This has to be further extended to also check the
id-sha{1,256,384,512}WithRSAEncryption identifiers as well as decoding the
`privateKeyAlgorithm.parameters` element against a specific ASN.1 structure, if
necessary (RSASSA-PSS-params or RSAES-OAEP-params), and cross-checking the
specified digest algorithm with the algorithm that's specified through the main
object identifier or the structure contained in `privateKeyAlgorithm.parameters`.
This is avoided for now because no test in WebKit or the web-platform-tests
suite covers this detail of the specification.

Data under the `privateKey` element is decoded against the `RSAPrivateKey` ASN.1
structure, and the `version` element of that structure is validated. We then
retrieve data from that structure for the modulus, public exponent, private
exponent, both primes, both exponents and the coefficient parameters, bailing if
any of them is missing. Because libgcrypt switches the use of p and q parameters,
deviating from the standard use, we have to recompute the u parameter (the
coefficient). With that calculated, we're then able to construct the `private-key`
s-expression, embedding into it all the necessary parameters, and transferring
the ownership of this object to the new CryptoKeyRSA object that's then returned
from the importPkcs8() method.

No new tests -- related tests are now passing and are unskipped.

* crypto/gcrypt/CryptoKeyRSAGCrypt.cpp:
(WebCore::CryptoKeyRSA::importPkcs8):

LayoutTests:

* platform/gtk/TestExpectations: Unskip the RSA PKCS#8 import tests
that are now passing.

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

2 years agoFailing to install on iPad simulators
jbedard@apple.com [Sat, 15 Jul 2017 00:29:52 +0000 (00:29 +0000)]
Failing to install on iPad simulators
https://bugs.webkit.org/show_bug.cgi?id=174532
<rdar://problem/33328347>

Reviewed by Stephanie Lewis.

* Scripts/webkitpy/xcode/simulated_device.py:
(SimulatedDevice.install_app): Place install command in retry try-except block.

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

2 years agoSource/WebKit:
jeffm@apple.com [Fri, 14 Jul 2017 23:13:33 +0000 (23:13 +0000)]
Source/WebKit:
-[WKWebProcessBundleParameters setParametersForKeyWithDictionary:] passing wrong parameters to -setParameter:forKey
https://bugs.webkit.org/show_bug.cgi?id=174524

Reviewed by Sam Weinig.

* WebProcess/InjectedBundle/API/Cocoa/WKWebProcessBundleParameters.mm:
(-[WKWebProcessBundleParameters setParametersForKeyWithDictionary:]):
Pass the dictionary key and value in the correct order.

Tools:
Add test for -[WKProcessPool _setObjectsForBundleParametersWithDictionary:].
https://bugs.webkit.org/show_bug.cgi?id=174524

Reviewed by Sam Weinig.

* TestWebKitAPI/Tests/WebKit2Cocoa/BundleParameters.mm:
(TEST):
Renamed TestParameter to TestParameter1.
Add test for -[WKProcessPool _setObjectsForBundleParametersWithDictionary:].

* TestWebKitAPI/Tests/WebKit2Cocoa/BundleParametersPlugIn.mm:
(-[BundleParametersPlugIn webProcessPlugIn:didCreateBrowserContextController:]):
Observe changes for two bundle parameters.

(-[BundleParametersPlugIn dealloc]):
Remove observers for two bundle parameters.

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

2 years ago[Curl] Don't start downloading more than once for same request
commit-queue@webkit.org [Fri, 14 Jul 2017 23:03:13 +0000 (23:03 +0000)]
[Curl] Don't start downloading more than once for same request
https://bugs.webkit.org/show_bug.cgi?id=174172

Patch by Basuke Suzuki <Basuke.Suzuki@sony.com> on 2017-07-14
Reviewed by Alex Christensen.

* WebDownloadCurl.cpp:
(WebDownload::init):

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

2 years agoPossible crash in ~UserGestureIndicator() when on non-main thread
cdumez@apple.com [Fri, 14 Jul 2017 23:02:52 +0000 (23:02 +0000)]
Possible crash in ~UserGestureIndicator() when on non-main thread
https://bugs.webkit.org/show_bug.cgi?id=174522
<rdar://problem/30283071>

Reviewed by Sam Weinig.

Source/WebCore:

UserGestureIndicator objects may be constructed / destructed in worker thread
(e.g. in DOMTimer::fired()). The UserGestureIndicator constructor / destructor
are supposed to be no-op on non-main threads so that it is safe. However,
we were mistakenly initializing m_previousToken data member in the constructor
on background thread, which meant that we could crash later on in the
UserGestureIndicator destructor when destroying m_previousToken.

Test: fast/workers/worker-user-gesture.html

* dom/UserGestureIndicator.cpp:
(WebCore::currentToken):
(WebCore::UserGestureIndicator::UserGestureIndicator):

LayoutTests:

Add layout test coverage.

* fast/workers/worker-user-gesture-expected.txt: Added.
* fast/workers/worker-user-gesture.html: Added.
* fast/workers/worker-user-gesture.js: Added.
(setInterval):

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

2 years agoMonitor directory for new statistics files after a delete operation
bfulgham@apple.com [Fri, 14 Jul 2017 22:52:52 +0000 (22:52 +0000)]
Monitor directory for new statistics files after a delete operation
https://bugs.webkit.org/show_bug.cgi?id=174521
<rdar://problem/33322189>

Reviewed by Chris Dumez.

Create a FileMonitor to watch the data directory when the statistics file is
deleted by an external process. If it sees the file get created externally, merge
those data into the in-memory store.

* UIProcess/Storage/ResourceLoadStatisticsPersistentStorage.cpp:
(WebKit::ResourceLoadStatisticsPersistentStorage::startMonitoringDisk): Added.
(WebKit::ResourceLoadStatisticsPersistentStorage::monitorDirectoryForNewStatistics):
* UIProcess/Storage/ResourceLoadStatisticsPersistentStorage.h:

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

2 years agoUnreviewed, rolling out r219516.
jlewis3@apple.com [Fri, 14 Jul 2017 22:51:36 +0000 (22:51 +0000)]
Unreviewed, rolling out r219516.

This caused an API failure on macOS.

Reverted changeset:

"Make sure all CFHTTPCookieStorageRefs we create are
scheduled."
https://bugs.webkit.org/show_bug.cgi?id=174513
http://trac.webkit.org/changeset/219516

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

2 years agoREGRESSION (r219013): Compute source frame info for frameless document
dbates@webkit.org [Fri, 14 Jul 2017 22:27:52 +0000 (22:27 +0000)]
REGRESSION (r219013): Compute source frame info for frameless document
https://bugs.webkit.org/show_bug.cgi?id=174385
<rdar://problem/33217736>

Reviewed by Brady Eidson.

Source/WebKit:

Fixes an issue where we would crash in WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction()
when computing the frame info for a now-frameless document. One way this can happen is when the frame
that contains the document that initiated the navigation is removed from the page.

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::decidePolicyForNavigationAction): Check that we have a valid page ID before
looking up the WebPage object corresponding to it.
* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction): Compute a FrameInfoData
object from the source document directly as opposed to using WebFrame::info() as the latter requires
that we have a valid WebCore frame and the source document may not have a frame.

LayoutTests:

* http/tests/navigation/resources/window-open-redirect-and-remove-opener.html: Added.
* http/tests/navigation/window-open-redirect-and-remove-opener-expected.txt: Added.
* http/tests/navigation/window-open-redirect-and-remove-opener.html: Added.

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

2 years agoFixed expectations after Mac expectation change.
jlewis3@apple.com [Fri, 14 Jul 2017 22:25:03 +0000 (22:25 +0000)]
Fixed expectations after Mac expectation change.
https://trac.webkit.org/changeset/219507/webkit

Unreviewed test gardening.

* platform/wk2/TestExpectations:

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

2 years agoAllow clients to override their own hardware media requirements where no fallback...
jer.noble@apple.com [Fri, 14 Jul 2017 22:04:20 +0000 (22:04 +0000)]
Allow clients to override their own hardware media requirements where no fallback media exists.
https://bugs.webkit.org/show_bug.cgi?id=174426
<rdar://problem/32537704>

Reviewed by Eric Carlson.

Source/WebCore:

Add a new setting which allows clients to specify their own mediaContentTypesRequiringHardwareSupport should be
ignared in the case where no fallback exists, such as the case of a single <source> element, or setting the src
attribute directly.

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::havePotentialSourceChild):
(WebCore::HTMLMediaElement::selectNextSourceChild):
(WebCore::HTMLMediaElement::sourceWasAdded):
(WebCore::HTMLMediaElement::sourceWasRemoved):
(WebCore::HTMLMediaElement::mediaPlayerShouldCheckHardwareSupport):
* html/HTMLMediaElement.h:
* page/Settings.h:
* platform/graphics/MediaPlayer.cpp:
(WebCore::MediaPlayer::shouldCheckHardwareSupport):
* platform/graphics/MediaPlayer.h:
(WebCore::MediaPlayerClient::mediaPlayerShouldCheckHardwareSupport):
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::assetStatus):
* platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
(WebCore::SourceBufferPrivateAVFObjC::didParseStreamDataAsAsset):

Source/WebKit:

Add a new WKWebViewConfiguration property, as well as a new WKPreferences function, both to control
WebCore's new allowMediaContentTypesRequiringHardwareSupportAsFallback setting.

* Shared/WebPreferencesDefinitions.h:
* UIProcess/API/C/WKPreferences.cpp:
(WKPreferencesGetAllowMediaContentTypesRequiringHardwareSupportAsFallback):
(WKPreferencesSetAllowMediaContentTypesRequiringHardwareSupportAsFallback):
* UIProcess/API/C/WKPreferencesRef.h:
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _initializeWithConfiguration:]):
* UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
(-[WKWebViewConfiguration init]):
(-[WKWebViewConfiguration copyWithZone:]):
(-[WKWebViewConfiguration _setAllowMediaContentTypesRequiringHardwareSupportAsFallback:]):
(-[WKWebViewConfiguration _allowMediaContentTypesRequiringHardwareSupportAsFallback]):
* UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::updatePreferences):

Source/WebKitLegacy/mac:

Add a new WebPreferences property to control WebCore's new
allowMediaContentTypesRequiringHardwareSupportAsFallback setting.

* WebView/WebPreferenceKeysPrivate.h:
* WebView/WebPreferences.mm:
(+[WebPreferences initialize]):
(-[WebPreferences allowMediaContentTypesRequiringHardwareSupportAsFallback]):
(-[WebPreferences setAllowMediaContentTypesRequiringHardwareSupportAsFallback:]):
* WebView/WebPreferencesPrivate.h:
* WebView/WebView.mm:
(-[WebView _preferencesChanged:]):

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

2 years agoPossible crash under NetworkSocketStream::didFailSocketStream()
cdumez@apple.com [Fri, 14 Jul 2017 21:45:40 +0000 (21:45 +0000)]
Possible crash under NetworkSocketStream::didFailSocketStream()
https://bugs.webkit.org/show_bug.cgi?id=174526
<rdar://problem/32831441>

Reviewed by Brent Fulgham.

Source/WebCore:

Call m_client.didFailSocketStream() asynchronously in the constructor as our
caller (the client) is also being initialized at this point.

* platform/network/cf/SocketStreamHandleImplCFNet.cpp:
(WebCore::SocketStreamHandleImpl::SocketStreamHandleImpl):

Source/WebKit:

For robustness, initialize the SocketStreamHandleImpl after the other
data members. We are passing |this| to the SocketStreamHandleImpl when
constructing it so it is unsafe to have uninitialized data members
at this point.

* NetworkProcess/NetworkSocketStream.cpp:
(WebKit::NetworkSocketStream::NetworkSocketStream):
* NetworkProcess/NetworkSocketStream.h:

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

2 years agoWebRTC: silence data not sent for disabled audio track
commit-queue@webkit.org [Fri, 14 Jul 2017 21:43:35 +0000 (21:43 +0000)]
WebRTC: silence data not sent for disabled audio track
https://bugs.webkit.org/show_bug.cgi?id=174456
<rdar://problem/33284623>

Patch by Youenn Fablet <youenn@apple.com> on 2017-07-14
Reviewed by Eric Carlson.

Source/WebCore:

Test: webrtc/audio-muted-stats.html
      webrtc/audio-muted-stats2.html

Adding a timer-based approach to send 10ms of silence every second.
This is consistent with how muted video tracks are implemented.
In case the audio track is muted at the time it is added, no silence data is sent.

* platform/mediastream/mac/RealtimeOutgoingAudioSource.cpp:
(WebCore::RealtimeOutgoingAudioSource::RealtimeOutgoingAudioSource):
(WebCore::RealtimeOutgoingAudioSource::initializeConverter):
(WebCore::RealtimeOutgoingAudioSource::stop):
(WebCore::RealtimeOutgoingAudioSource::sourceMutedChanged):
(WebCore::RealtimeOutgoingAudioSource::sourceEnabledChanged):
(WebCore::RealtimeOutgoingAudioSource::handleMutedIfNeeded):
(WebCore::RealtimeOutgoingAudioSource::sendSilence):
* platform/mediastream/mac/RealtimeOutgoingAudioSource.h:

LayoutTests:

* webrtc/audio-muted-stats-expected.txt: Added.
* webrtc/audio-muted-stats.html: Added.
* webrtc/audio-muted-stats2-expected.txt: Added.
* webrtc/audio-muted-stats2.html: Added.

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

2 years agoAdd High Sierra test expectations
jbedard@apple.com [Fri, 14 Jul 2017 21:26:29 +0000 (21:26 +0000)]
Add High Sierra test expectations
https://bugs.webkit.org/show_bug.cgi?id=174518
<rdar://problem/32716970>

Unreviewed test gardening.

* platform/mac-highsierra: Added.
* platform/mac-highsierra-wk1: Added.
* platform/mac-highsierra-wk2: Added.

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

2 years ago[CMake] Unclear distinction between WebKitHelpers and WebKitMacros
mcatanzaro@igalia.com [Fri, 14 Jul 2017 20:29:43 +0000 (20:29 +0000)]
[CMake] Unclear distinction between WebKitHelpers and WebKitMacros
https://bugs.webkit.org/show_bug.cgi?id=153189

Reviewed by Antonio Gomes.

.:

Merge WebKitHelpers.cmake into WebKitMacros.cmake, since there is no meaningful distinction
between the macros that belong in each file. Then, move the macros that are only needed by
one project into project-specific CMake files. Retain here only the macros that are needed
in multiple places.

* Source/cmake/OptionsCommon.cmake: Update a comment.
* Source/cmake/OptionsGTK.cmake: New location for libtool macro, exclusively needed here.
* Source/cmake/WebKitCommon.cmake: Do not include WebKitHelpers.cmake.
* Source/cmake/WebKitHelpers.cmake: Removed.
* Source/cmake/WebKitMacros.cmake:

Source/WebCore:

* CMakeLists.txt: Include WebCoreMacros.cmake.
* WebCoreMacros.cmake: Added.

Source/WebKit:

New location for macros that are exclusively needed here.

* CMakeLists.txt:

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

2 years agoUnreviewed, rolling out r219510.
commit-queue@webkit.org [Fri, 14 Jul 2017 20:27:05 +0000 (20:27 +0000)]
Unreviewed, rolling out r219510.
https://bugs.webkit.org/show_bug.cgi?id=174525

Need to revert length() == 0 check for null string (Requested
by yusukesuzuki on #webkit).

Reverted changeset:

"[WTF] Newly added AtomicStringImpl should use BufferInternal
static string if StringImpl is static"
https://bugs.webkit.org/show_bug.cgi?id=174501
http://trac.webkit.org/changeset/219510

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

2 years agoFix style for name of class alloc function in WebVideoFullscreenInterfaceAVKit.
commit-queue@webkit.org [Fri, 14 Jul 2017 20:17:18 +0000 (20:17 +0000)]
Fix style for name of class alloc function in WebVideoFullscreenInterfaceAVKit.
https://bugs.webkit.org/show_bug.cgi?id=174476

Patch by Jeremy Jones <jeremyj@apple.com> on 2017-07-14
Reviewed by Alex Christensen.

No new tests because no behavior change.

This is a rename for per style requirements.

* platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
(allocWebAVPictureInPicturePlayerLayerViewInstance):
(WebAVPlayerLayerView_pictureInPicturePlayerLayerView):
(allocWebAVPlayerLayerViewInstance):
(WebVideoFullscreenInterfaceAVKit::setupFullscreen):
(getWebAVPictureInPicturePlayerLayerViewClass): Deleted.
(getWebAVPlayerLayerViewClass): Deleted.

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

2 years ago[MSE] Removing samples when presentation order does not match decode order can cause...
jer.noble@apple.com [Fri, 14 Jul 2017 20:08:05 +0000 (20:08 +0000)]
[MSE] Removing samples when presentation order does not match decode order can cause bad behavior.
https://bugs.webkit.org/show_bug.cgi?id=174514

Reviewed by Sam Weinig.

Source/WebCore:

Test: media/media-source/media-source-remove-decodeorder-crash.html

Fix the algorithm in removeCodedFrames() so that it's not possible to have a removePresentationStart >
removePresentationEnd (and also removeDecodeStart > removeDecodeEnd).

* Modules/mediasource/SampleMap.cpp:
(WebCore::PresentationOrderSampleMap::findSampleContainingOrAfterPresentationTime):
(WebCore::PresentationOrderSampleMap::findSampleStartingAfterPresentationTime):
* Modules/mediasource/SampleMap.h:
* Modules/mediasource/SourceBuffer.cpp:
(WebCore::SourceBuffer::removeCodedFrames):

Tools:

* TestWebKitAPI/Tests/WebCore/SampleMap.cpp:
(TestWebKitAPI::TEST_F):

LayoutTests:

* media/media-source/media-source-remove-decodeorder-crash-expected.txt: Added.
* media/media-source/media-source-remove-decodeorder-crash.html: Added.

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

2 years agoCorrecting test expectations after mac-expectation changes.
jlewis3@apple.com [Fri, 14 Jul 2017 20:04:20 +0000 (20:04 +0000)]
Correcting test expectations after mac-expectation changes.
https://bugs.webkit.org/show_bug.cgi?id=174472

Unreviews test gardening.

* platform/mac/TestExpectations:

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

2 years agoIncrease CoreAudio render audio buffer sizes for WebRTC
commit-queue@webkit.org [Fri, 14 Jul 2017 19:34:33 +0000 (19:34 +0000)]
Increase CoreAudio render audio buffer sizes for WebRTC
https://bugs.webkit.org/show_bug.cgi?id=174508

Patch by Youenn Fablet <youenn@apple.com> on 2017-07-14
Reviewed by Eric Carlson.

Covered by manually testing audio rendering through WebRTC sites.

* platform/mediastream/mac/AudioTrackPrivateMediaStreamCocoa.cpp:
(WebCore::AudioTrackPrivateMediaStreamCocoa::createAudioUnit): Setting audio buffer size equivalent to 20 ms.

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

2 years agoMake sure all CFHTTPCookieStorageRefs we create are scheduled.
beidson@apple.com [Fri, 14 Jul 2017 19:16:40 +0000 (19:16 +0000)]
Make sure all CFHTTPCookieStorageRefs we create are scheduled.
<rdar://problem/33221110> and https://bugs.webkit.org/show_bug.cgi?id=174513

Reviewed by Tim Horton.

Source/WebCore:

* platform/spi/cf/CFNetworkSPI.h:

Source/WebKit:

Whenever we create a CFHTTPCookieStorage from identifying data it is unscheduled.
We need to schedule it on a RunLoop.

This patch also cleans up the creation of the identifying data itself.

* NetworkProcess/mac/RemoteNetworkingContext.mm:
(WebKit::RemoteNetworkingContext::ensureWebsiteDataStoreSession):

* Shared/cf/CookieStorageUtilsCF.cpp: Added.
(WebKit::cookieStorageFromIdentifyingData):
(WebKit::identifyingDataFromCookieStorage):
* Shared/cf/CookieStorageUtilsCF.h: Added.

* Shared/mac/ChildProcessMac.mm:
(WebKit::ChildProcess::setSharedHTTPCookieStorage):

* UIProcess/Cocoa/WebProcessPoolCocoa.mm:
(WebKit::WebProcessPool::platformInitializeWebProcess):
(WebKit::WebProcessPool::platformInitializeNetworkProcess):

* UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
(WebKit::WebsiteDataStore::parameters):

* WebKit.xcodeproj/project.pbxproj:

* WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.mm:
(WebKit::WebFrameNetworkingContext::ensureWebsiteDataStoreSession):

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

2 years agoRemove CoreAudioCaptureSource speaker configuration
commit-queue@webkit.org [Fri, 14 Jul 2017 19:02:55 +0000 (19:02 +0000)]
Remove CoreAudioCaptureSource speaker configuration
https://bugs.webkit.org/show_bug.cgi?id=174512

Patch by Youenn Fablet <youenn@apple.com> on 2017-07-14
Reviewed by Eric Carlson.

Covered by manually testing audio rendering through WebRTC sites.

* platform/mediastream/mac/CoreAudioCaptureSource.cpp:
(WebCore::CoreAudioSharedUnit::setupAudioUnit):

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

2 years agoPotential null-dereference under NetworkRTCProvider::resolvedName()
cdumez@apple.com [Fri, 14 Jul 2017 18:55:40 +0000 (18:55 +0000)]
Potential null-dereference under NetworkRTCProvider::resolvedName()
https://bugs.webkit.org/show_bug.cgi?id=174507
<rdar://problem/32597868>

Reviewed by Youenn Fablet.

NetworkRTCProvider::resolvedName() could do a null dereference of m_connection
because m_connection is nullified in NetworkRTCProvider::close() but resolvers
were only closed later on in the NetworkRTCProvider destructor.

To address the issue, we now stop DNS resolvers earlier, in NetworkRTCProvider::close().
Also fix unsafe modification of m_resolvers HashMap when iterating over it.

* NetworkProcess/webrtc/NetworkRTCProvider.cpp:
(WebKit::NetworkRTCProvider::~NetworkRTCProvider):
(WebKit::NetworkRTCProvider::close):
(WebKit::NetworkRTCProvider::Resolver::~Resolver):
(WebKit::NetworkRTCProvider::stopResolver):

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

2 years ago[MediaStream] Limit the number of remote video samples queued
eric.carlson@apple.com [Fri, 14 Jul 2017 18:35:00 +0000 (18:35 +0000)]
[MediaStream] Limit the number of remote video samples queued
https://bugs.webkit.org/show_bug.cgi?id=174505
<rdar://problem/33223015>

Reviewed by Youenn Fablet.

* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::removeOldSamplesFromPendingQueue): Only
enqueue a fixed number of frames with invalid or negative decode times.

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

2 years agoFix ambiguous description text in ARES-6 about the data the benchmark measures
sbarati@apple.com [Fri, 14 Jul 2017 17:47:28 +0000 (17:47 +0000)]
Fix ambiguous description text in ARES-6 about the data the benchmark measures
https://bugs.webkit.org/show_bug.cgi?id=174510

Rubber stamped by Filip Pizlo.

* ARES-6/about.html:

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

2 years agoReport CoreAudioCaptureSource failure in case shared unit stops working properly
commit-queue@webkit.org [Fri, 14 Jul 2017 17:44:04 +0000 (17:44 +0000)]
Report CoreAudioCaptureSource failure in case shared unit stops working properly
https://bugs.webkit.org/show_bug.cgi?id=174494

Patch by Youenn Fablet <youenn@apple.com> on 2017-07-14
Reviewed by Eric Carlson.

Source/WebCore:

Manual test by interrupting an audio capture on Mac.

This patch adds a timer to CoreAudioSharedUnit.
In case the capture callback is not called after one second, the shared unit is said to fail.
Each source is notified that capture is failing.
This will in turn trigger onend track event so that web pages can remedy capture failure.

Timer starts with 10 seconds for audio data to start being captured.
It is then decreased to 2 seconds.

* platform/mediastream/RealtimeMediaSource.cpp:
(WebCore::RealtimeMediaSource::captureFailed):
* platform/mediastream/RealtimeMediaSource.h:
* platform/mediastream/mac/CoreAudioCaptureSource.cpp:
(WebCore::CoreAudioSharedUnit::CoreAudioSharedUnit):
(WebCore::CoreAudioSharedUnit::processMicrophoneSamples):
(WebCore::CoreAudioSharedUnit::startInternal):
(WebCore::CoreAudioSharedUnit::verifyIsCapturing):
(WebCore::CoreAudioSharedUnit::stopInternal):

Source/WebKit:

In case of capture failure, send a CaptureFailure message so that the
correct behavior happens in the Web process.

* UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp:
* WebProcess/cocoa/UserMediaCaptureManager.cpp:
(WebKit::UserMediaCaptureManager::captureFailed):
* WebProcess/cocoa/UserMediaCaptureManager.h:
* WebProcess/cocoa/UserMediaCaptureManager.messages.in:

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

2 years ago[WTF] Newly added AtomicStringImpl should use BufferInternal static string if StringI...
utatane.tea@gmail.com [Fri, 14 Jul 2017 17:37:26 +0000 (17:37 +0000)]
[WTF] Newly added AtomicStringImpl should use BufferInternal static string if StringImpl is static
https://bugs.webkit.org/show_bug.cgi?id=174501

Reviewed by Darin Adler.

Source/WTF:

When creating AtomicStringImpl from static StringImpl, we can just use createWithoutCopying
to create a BufferInternal AtomicStringImpl which m_data{8,16} is static string's one.

* wtf/text/AtomicStringImpl.cpp:
(WTF::CStringTranslator::hash):
(WTF::CStringTranslator::equal):
(WTF::CStringTranslator::translate):
(WTF::AtomicStringImpl::add):
(WTF::HashTranslatorCharBuffer::HashTranslatorCharBuffer):
(WTF::UCharBufferTranslator::hash):
(WTF::UCharBufferTranslator::equal):
(WTF::UCharBufferTranslator::translate):
(WTF::LCharBufferTranslator::hash):
(WTF::LCharBufferTranslator::equal):
(WTF::LCharBufferTranslator::translate):
(WTF::BufferFromStaticDataTranslator::hash):
(WTF::BufferFromStaticDataTranslator::equal):
(WTF::BufferFromStaticDataTranslator::translate):
(WTF::AtomicStringImpl::addLiteral):
(WTF::addSymbol):
(WTF::addStatic):
(WTF::AtomicStringImpl::addSlowCase):
(WTF::AtomicStringImpl::lookUp):
(WTF::CharBufferFromLiteralDataTranslator::hash): Deleted.
(WTF::CharBufferFromLiteralDataTranslator::equal): Deleted.
(WTF::CharBufferFromLiteralDataTranslator::translate): Deleted.
(WTF::addSubstring): Deleted.
* wtf/text/StringImpl.h:

Tools:

* TestWebKitAPI/Tests/WTF/StringImpl.cpp:
(TestWebKitAPI::TEST):

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

2 years agoAdding the 'autoplay' attribute to a media element during a user gesture should remov...
jer.noble@apple.com [Fri, 14 Jul 2017 17:33:28 +0000 (17:33 +0000)]
Adding the 'autoplay' attribute to a media element during a user gesture should remove user gesture restrictions.
https://bugs.webkit.org/show_bug.cgi?id=174373

Reviewed by Eric Carlson.

Source/WebCore:

Test: media/video-add-autoplay-user-gesture.html

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::parseAttribute):

LayoutTests:

* media/video-add-autoplay-user-gesture-expected.txt: Added.
* media/video-add-autoplay-user-gesture.html: Added.
* media/platform/ios/TestExpectations: Skipped; requires EventSender.

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

2 years agoUnreviewed, rolling out r219500.
jlewis3@apple.com [Fri, 14 Jul 2017 17:31:14 +0000 (17:31 +0000)]
Unreviewed, rolling out r219500.

The test is consistently failing on iOS simulator.

Reverted changeset:

"AX: VoiceOver silent or skipping over time values on media
player."
https://bugs.webkit.org/show_bug.cgi?id=174324
http://trac.webkit.org/changeset/219500

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

2 years agoTools:
jbedard@apple.com [Fri, 14 Jul 2017 17:15:02 +0000 (17:15 +0000)]
Tools:
Bring mac expectations in-line with other platforms
https://bugs.webkit.org/show_bug.cgi?id=174472
<rdar://problem/33297388>

Reviewed by David Kilzer.

The override order for Mac test expectations does not conform to the pattern used by iOS,
GTK, Windows and WPE. Before this change, El Capitan's baseline search path looks like this:

    platform/mac-wk2
    platform/wk2
    platform/mac-elcapitan
    platform/mac-sierra
    generic

After this change, El Capitan's baseline search path looks like this:

    platform/mac-sierra-wk2
    platform/mac-sierra
    platform/mac-wk2
    platform/wk2
    generic

* Scripts/webkitpy/port/mac.py:
(MacPort.__init__): If a specific version is specified in the port name, use that
as the os version.
(MacPort.default_baseline_search_path): Expectation search paths should work the
same way they do on other ports. Port + version overrides port, port overrides generic
and wk1/wk2 should override expectations for the two combined.
* Scripts/webkitpy/port/mac_unittest.py:
(MacTest.test_tests_for_other_platforms): Deleted.
(MacTest._assert_search_path): Deleted.
(MacTest.test_baseline_search_path): Deleted.
* Scripts/webkitpy/tool/commands/rebaseline_unittest.py:
(TestRebaselineTest.test_baseline_directory): Adjust expectations for new over-ride order.
(test_rebaseline_test_and_print_scm_changes): Ditto.
(test_rebaseline_and_copy_test): Ditto.
(test_rebaseline_and_copy_test_no_existing_result): Ditto.
(test_rebaseline_and_copy_test_with_lion_result): Ditto.
(test_rebaseline_and_copy_no_overwrite_test): Ditto.

LayoutTests:
Add script to rebase patches during the WebKit2->WebKit/WebKit->WebKitLegacy transition
https://bugs.webkit.org/show_bug.cgi?id=174438
<rdar://problem/33277112>

Reviewed by David Kilzer.

* platform/mac-wk2/TestExpectations: Move skipped tests because of webkit.org/b/174504.
* platform/wk2/TestExpectations: Ditto.

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

2 years ago[WTF] Use std::unique_ptr for StackTrace
utatane.tea@gmail.com [Fri, 14 Jul 2017 16:03:47 +0000 (16:03 +0000)]
[WTF] Use std::unique_ptr for StackTrace
https://bugs.webkit.org/show_bug.cgi?id=174495

Reviewed by Alex Christensen.

Source/JavaScriptCore:

* runtime/ExceptionScope.cpp:
(JSC::ExceptionScope::unexpectedExceptionMessage):
* runtime/VM.cpp:
(JSC::VM::throwException):

Source/WTF:

Instead of returning pointer to heap allocated StackTrace,
we should return std::unique_ptr<StackTrace>.
And we also move WTFGetBackTrace from Assertions.cpp to
StackTrace.cpp to consolidate stack trace related operations
into StackTrace.cpp.

* wtf/Assertions.cpp:
* wtf/StackTrace.cpp:
(WTFGetBacktrace):
(WTF::StackTrace::captureStackTrace):
* wtf/StackTrace.h:

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

2 years ago[WinCairo] error 'm_compositorTexture': undeclared identifier since Bug 174345
commit-queue@webkit.org [Fri, 14 Jul 2017 15:58:47 +0000 (15:58 +0000)]
[WinCairo] error 'm_compositorTexture': undeclared identifier since Bug 174345
https://bugs.webkit.org/show_bug.cgi?id=174493

Patch by Fujii Hironori <Hironori.Fujii@sony.com> on 2017-07-14
Reviewed by Alex Christensen.

Compilation errors are reported by the code using a member
m_compositorTexture of GraphicsContext3D which exists only if
USE(COORDINATED_GRAPHICS_THREADED). WinCairo port doesn't use it.

* platform/graphics/cairo/GraphicsContext3DCairo.cpp:
(WebCore::GraphicsContext3D::GraphicsContext3D):
Use m_compositorTexture only if USE(COORDINATED_GRAPHICS_THREADED).
(WebCore::GraphicsContext3D::~GraphicsContext3D): Ditto.
* platform/graphics/opengl/GraphicsContext3DOpenGLES.cpp:
(WebCore::GraphicsContext3D::reshapeFBOs):
Ditto. Fix the wrong indentation level.

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

2 years ago[HarfBuzz] Decomposed Vietnamese characters are rendered incorrectly
commit-queue@webkit.org [Fri, 14 Jul 2017 15:54:31 +0000 (15:54 +0000)]
[HarfBuzz] Decomposed Vietnamese characters are rendered incorrectly
https://bugs.webkit.org/show_bug.cgi?id=174418

Patch by Fujii Hironori <Hironori.Fujii@sony.com> on 2017-07-14
Reviewed by Michael Catanzaro.

Source/WebCore:

HarfBuzzShaper should normalize the input text before collecting
HarfBuzzRuns. Actually, HarfBuzzShaper::setNormalizedBuffer does
the task. But, this function hasn't been called from anywhere
since Bug 108077.

Test: fast/text/international/vietnamese-nfd.html

* platform/graphics/harfbuzz/HarfBuzzShaper.cpp:
(WebCore::HarfBuzzShaper::HarfBuzzShaper):
Call setNormalizedBuffer instead of normalizeCharacters.
(WebCore::normalizeCharacters): Deleted.

LayoutTests:

* fast/text/international/vietnamese-nfd-expected.html: Added.
* fast/text/international/vietnamese-nfd.html: Added.

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

2 years ago[WinCairo] Build broken "Cannot open include file: 'GL/glext.h'" since Bug 172104
commit-queue@webkit.org [Fri, 14 Jul 2017 12:06:15 +0000 (12:06 +0000)]
[WinCairo] Build broken "Cannot open include file: 'GL/glext.h'" since Bug 172104
https://bugs.webkit.org/show_bug.cgi?id=174492

Patch by Fujii Hironori <Hironori.Fujii@sony.com> on 2017-07-14
Reviewed by Žan Doberšek.

WinCairo port uses GLES. OpenGLShims.h shouldn't be included.

* platform/graphics/cairo/GraphicsContext3DCairo.cpp:
Include "OpenGLShims.h" only if !USE(OPENGL_ES_2) instead of USE(OPENGL).

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

2 years ago[JSC] Use WTFMove to prune liveness in DFGAvailabilityMap
utatane.tea@gmail.com [Fri, 14 Jul 2017 08:21:52 +0000 (08:21 +0000)]
[JSC] Use WTFMove to prune liveness in DFGAvailabilityMap
https://bugs.webkit.org/show_bug.cgi?id=174423

Reviewed by Saam Barati.

* dfg/DFGAvailabilityMap.cpp:
(JSC::DFG::AvailabilityMap::pruneHeap):
(JSC::DFG::AvailabilityMap::pruneByLiveness):

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

2 years agoPageCache::removeAllItemsForPage(Page&) may reenter itself and cause crashes
cdumez@apple.com [Fri, 14 Jul 2017 08:17:10 +0000 (08:17 +0000)]
PageCache::removeAllItemsForPage(Page&) may reenter itself and cause crashes
https://bugs.webkit.org/show_bug.cgi?id=174473
<rdar://problem/32177485>

Reviewed by Antti Koivisto.

This could happen when a Page containing an SVGImage is removed from PageCache and
this resulted in the destruction of the SVGImage. Because the SVGImage has an internal
utility Page, it will also call PageCache::removeAllItemsForPage(WebCore::Page&) upon
destruction, causing us to reenter.

Address the issue by not calling PageCache::removeAllItemsForPage() for utility pages
since those cannot be in PageCache in the first place.

Also add assertions to make sure:
1. We never insert a utility page into PageCache
2. PageCache::removeAllItemsForPage() does not reenter

No new tests, because I was unable to write a test which reproduced the crash. This
is in theory testable using an API test which enables PageCache, loads a page
containing an SVGImage, navigates away from this page so that it goes into PageCache,
and then calls [WebView _close]. However, when I tried writing such test, I could
not get the SVGImage to get destroyed while PageCache::removeAllItemsForPage() is
called for the top-level page for some reason. Something seems to be keeping the
SVGImage alive longer. I tried disabling the MemoryCache but it did not help.

* history/PageCache.cpp:
(WebCore::PageCache::addIfCacheable):
(WebCore::PageCache::removeAllItemsForPage):
* history/PageCache.h:
* page/Page.cpp:
(WebCore::Page::~Page):

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

2 years agoAX: VoiceOver silent or skipping over time values on media player.
commit-queue@webkit.org [Fri, 14 Jul 2017 07:07:49 +0000 (07:07 +0000)]
AX: VoiceOver silent or skipping over time values on media player.
https://bugs.webkit.org/show_bug.cgi?id=174324
<rdar://problem/32021784>

Patch by Aaron Chu <aaron_chu@apple.com> on 2017-07-14
Reviewed by Antoine Quint.

Added role attribute to modern media controls time lable class so that VoiceOver can access the time label when the media is playing.

Source/WebCore:

Updated: media/modern-media-controls/time-label/time-label.html

* Modules/modern-media-controls/controls/time-label.js:

LayoutTests:

* media/modern-media-controls/time-label/time-label-expected.txt:
* media/modern-media-controls/time-label/time-label.html:

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

2 years agoBetter deal with changes to the ResourceLoadStatisticsStore file on disk
cdumez@apple.com [Fri, 14 Jul 2017 06:39:08 +0000 (06:39 +0000)]
Better deal with changes to the ResourceLoadStatisticsStore file on disk
https://bugs.webkit.org/show_bug.cgi?id=174487

Reviewed by Brent Fulgham.

Rename WebResourceLoadStatisticsStore's resetDataFromDecoder() to mergeWithDataFromDecoder()
and update it so that it actual merges the data from the disk with the one we have in memory,
instead of replacing it. This avoid data loss.

We leverage the existing WebResourceLoadStatisticsStore::mergeStatistics() to merge the
statistics.

To faciliate merging the operating dates, they are now represented as OperatingDate objects
instead of WallTime objects. OperatingDate only include date precision, no time information.
As a result, the merge 2 vectors of OperatingDate objects, we can:
1. Merge the 2 sorted vectors (using std::merge())
2. Get rid of duplicates (easy because of date-level precision)
3. Drop old dates until the vector has at most 30 items.

* UIProcess/Storage/ResourceLoadStatisticsPersistentStorage.cpp:
(WebKit::ResourceLoadStatisticsPersistentStorage::refreshMemoryStoreFromDisk):
(WebKit::ResourceLoadStatisticsPersistentStorage::populateMemoryStoreFromDisk):
* UIProcess/WebResourceLoadStatisticsStore.cpp:
(WebKit::OperatingDate::fromWallTime):
(WebKit::OperatingDate::today):
(WebKit::OperatingDate::secondsSinceEpoch):
(WebKit::OperatingDate::operator==):
(WebKit::OperatingDate::operator<):
(WebKit::OperatingDate::operator<=):
(WebKit::OperatingDate::OperatingDate):
(WebKit::mergeOperatingDates):
(WebKit::WebResourceLoadStatisticsStore::createEncoderFromData):
(WebKit::WebResourceLoadStatisticsStore::mergeWithDataFromDecoder):
(WebKit::WebResourceLoadStatisticsStore::includeTodayAsOperatingDateIfNecessary):
(WebKit::WebResourceLoadStatisticsStore::hasStatisticsExpired):
* UIProcess/WebResourceLoadStatisticsStore.h:

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

2 years agoAdd some additional test cases for bug 170896.
mark.lam@apple.com [Fri, 14 Jul 2017 06:18:15 +0000 (06:18 +0000)]
Add some additional test cases for bug 170896.
https://bugs.webkit.org/show_bug.cgi?id=174491

Reviewed by Filip Pizlo.

* stress/regress-170896-with-contiguous-shape-profile.js: Copied from JSTests/stress/regress-170896.js.
* stress/regress-170896-with-double-shape-profile.js: Added.
(test):
* stress/regress-170896-with-int32-shape-profile.js: Added.
(test):
* stress/regress-170896.js: Removed.

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

2 years agoFix style checker unit test
mcatanzaro@igalia.com [Fri, 14 Jul 2017 03:56:07 +0000 (03:56 +0000)]
Fix style checker unit test

Unreviewed WebKit2 => WebKit fixup.

* Scripts/webkitpy/style/checker_unittest.py:
(CheckerDispatcherSkipTest.test_should_skip_with_warning):

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

2 years ago[GTK][WPE] Avoid setting settings that are set by default
mcatanzaro@igalia.com [Fri, 14 Jul 2017 03:53:17 +0000 (03:53 +0000)]
[GTK][WPE] Avoid setting settings that are set by default

Unreviewed.

* Source/cmake/OptionsGTK.cmake:
* Source/cmake/OptionsWPE.cmake:

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

2 years agoUnreviewed, Windows ports should enable WebKitLegacy and disable
annulen@yandex.ru [Fri, 14 Jul 2017 03:45:48 +0000 (03:45 +0000)]
Unreviewed, Windows ports should enable WebKitLegacy and disable
WebKit.

* Source/cmake/OptionsWin.cmake:

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

2 years agoFix the Mac CMake build.
matthew_hanson@apple.com [Fri, 14 Jul 2017 03:36:38 +0000 (03:36 +0000)]
Fix the Mac CMake build.

Unreviewed build fix.

Fix the Mac CMake build after r219488 broke it. r219488 erroneously updated
the variable name DERIVED_SOURCES_WEBKITLEGACY_DIR to DERIVED_SOURCES_WEBKIT_LEGACY_DIR
without updating subsequent users of that variable.

* Source/cmake/WebKitFS.cmake:
Rename DERIVED_SOURCES_WEBKIT_LEGACY_DIR back to DERIVED_SOURCES_WEBKITLEGACY_DIR.

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

2 years agoUse the old WebKit/WebKit2 targets for CMake builds. (v2)
matthew_hanson@apple.com [Fri, 14 Jul 2017 03:09:54 +0000 (03:09 +0000)]
Use the old WebKit/WebKit2 targets for CMake builds. (v2)

Unreviewed build fix.

r219492 missed one hunk from its partial revert of r219489.
This patch reverts that hunk.

* TestWebKitAPI/CMakeLists.txt:

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

2 years agoUse the old WebKit/WebKit2 targets for CMake builds.
matthew_hanson@apple.com [Fri, 14 Jul 2017 02:56:11 +0000 (02:56 +0000)]
Use the old WebKit/WebKit2 targets for CMake builds.

Unreviewed build fix.

We can update the target names to match the Framework names in a future patch.
This is a partial revert of r219489.

* TestWebKitAPI/CMakeLists.txt:
WebKitLegacy => WebKit
WebKit => WebKit2

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

2 years agoUnreviewed, annotate inline for operator==/!= for FastAllocator
utatane.tea@gmail.com [Fri, 14 Jul 2017 02:53:24 +0000 (02:53 +0000)]
Unreviewed, annotate inline for operator==/!= for FastAllocator
https://bugs.webkit.org/show_bug.cgi?id=174366

* wtf/FastMalloc.h:
(WTF::operator==):
(WTF::operator!=):

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

2 years agoRemoved empty project directories left behind after the rename
mitz@apple.com [Fri, 14 Jul 2017 02:39:08 +0000 (02:39 +0000)]
Removed empty project directories left behind after the rename

Source/WebKit:

* WebKit2.xcodeproj: Removed.

Source/WebKitLegacy:

* WebKit.vcxproj: Removed.
* WebKit.xcodeproj: Removed.

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

2 years agoFix TestWebKit API.
matthew_hanson@apple.com [Fri, 14 Jul 2017 02:29:31 +0000 (02:29 +0000)]
Fix TestWebKit API.
https://bugs.webkit.org/show_bug.cgi?id=174164
rdar://problem/33137595

Reviewed by Dan Bernstein.

* TestWebKitAPI/CMakeLists.txt:
* TestWebKitAPI/Configurations/FeatureDefines.xcconfig:
* TestWebKitAPI/PlatformGTK.cmake:

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

2 years agoFix the cMake builds (GTK and WPE.)
matthew_hanson@apple.com [Fri, 14 Jul 2017 02:29:28 +0000 (02:29 +0000)]
Fix the cMake builds (GTK and WPE.)
https://bugs.webkit.org/show_bug.cgi?id=174164
rdar://problem/33137595

Reviewed by Dan Bernstein.

.:

* Source/CMakeLists.txt:
* Source/cmake/OptionsGTK.cmake:
* Source/cmake/OptionsJSCOnly.cmake:
* Source/cmake/OptionsMac.cmake:
* Source/cmake/OptionsWPE.cmake:
* Source/cmake/WebKitFS.cmake:
* Source/cmake/WebKitPackaging.cmake:

Source/WebCore/platform/gtk/po:

* POTFILES.in:

Source/WebKit:

* Scripts/generate-forwarding-headers.pl:
(collectFrameworkHeaderPaths):
(createForwardingHeadersForFramework):

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

2 years agoRename WebKit2.xcodeproj to WebKit.xcodeproj.
matthew_hanson@apple.com [Fri, 14 Jul 2017 02:29:25 +0000 (02:29 +0000)]
Rename WebKit2.xcodeproj to WebKit.xcodeproj.
https://bugs.webkit.org/show_bug.cgi?id=174164
rdar://problem/33137595

Reviewed by Dan Bernstein.

.:

* WebKit.xcworkspace/contents.xcworkspacedata:
* WebKit.xcworkspace/xcshareddata/xcschemes/All Source.xcscheme:

Source/WebKit:

* WebKit.xcodeproj/project.pbxproj: Renamed from Source/WebKit/WebKit2.xcodeproj/project.pbxproj.

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

2 years agoUpdate tools and configurations after renaming Source/WebKit2 to Source/WebKit.
matthew_hanson@apple.com [Fri, 14 Jul 2017 02:29:22 +0000 (02:29 +0000)]
Update tools and configurations after renaming Source/WebKit2 to Source/WebKit.
https://bugs.webkit.org/show_bug.cgi?id=174164
rdar://problem/33137595

Reviewed by Dan Bernstein.

.:

* Source/Makefile:
* Source/PlatformGTK.cmake:
* Source/cmake/OptionsGTK.cmake:
* Source/cmake/WebKitFS.cmake:
* Source/cmake/WebKitPackaging.cmake:
* WebKit.xcworkspace/contents.xcworkspacedata:
* WebKit.xcworkspace/xcshareddata/xcschemes/All Source.xcscheme:

Source/WebKit:

* PlatformGTK.cmake:
* Shared/API/c/wpe/WebKit.h:

Tools:

* BuildSlaveSupport/build.webkit.org-config/wkbuild_unittest.py:
(ShouldBuildTest):
* DumpRenderTree/mac/Configurations/Base.xcconfig:
* Scripts/build-webkit:
* Scripts/do-file-rename:
* Scripts/do-webcore-rename:
* Scripts/update-webkit-localizable-strings:
* Scripts/webkitpy/common/config/watchlist:
* Scripts/webkitpy/style/checker.py:
* Scripts/webkitpy/style/checkers/featuredefines.py:
* gtk/make-dist.py:
(ensure_version_if_possible):
* gtk/manifest.txt.in:

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

2 years agoUpdate the Visual Studio project name from WebKit to WebKitLegacy.
matthew_hanson@apple.com [Fri, 14 Jul 2017 02:29:17 +0000 (02:29 +0000)]
Update the Visual Studio project name from WebKit to WebKitLegacy.
https://bugs.webkit.org/show_bug.cgi?id=174162
rdar://problem/33137594

Reviewed by Dan Bernstein.

Rename WebKit to WebKitLegacy.

* WebKitLegacy.vcxproj/WebKitLegacy.proj: Renamed from Source/WebKitLegacy/WebKit.vcxproj/WebKit.proj.

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

2 years agoUpdate the Xcode project name from WebKit to WebKitLegacy.
matthew_hanson@apple.com [Fri, 14 Jul 2017 02:29:15 +0000 (02:29 +0000)]
Update the Xcode project name from WebKit to WebKitLegacy.
https://bugs.webkit.org/show_bug.cgi?id=174162
rdar://problem/33137594

Reviewed by Dan Bernstein.

Rename WebKit to WebKitLegacy.

.:

* WebKit.xcworkspace/contents.xcworkspacedata:
* WebKit.xcworkspace/xcshareddata/xcschemes/All Source.xcscheme:

Source/WebKitLegacy:

* WebKitLegacy.xcodeproj/project.pbxproj: Renamed from Source/WebKitLegacy/WebKit.xcodeproj/project.pbxproj.

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

2 years agoUpdate tools and configurations after renaming Source/WebKit to Source/WebKitLegacy.
matthew_hanson@apple.com [Fri, 14 Jul 2017 02:29:11 +0000 (02:29 +0000)]
Update tools and configurations after renaming Source/WebKit to Source/WebKitLegacy.
https://bugs.webkit.org/show_bug.cgi?id=174162
rdar://problem/33137594

Reviewed by Dan Bernstein.

.:

Mass rename of Source/WebKit to Source/WebKitLegacy in OpenSource cmake files
and Xcode project files.

* Source/cmake/OptionsGTK.cmake:
* Source/cmake/WebKitFS.cmake:
* WebKit.xcworkspace/contents.xcworkspacedata:
* WebKit.xcworkspace/xcshareddata/xcschemes/All Source.xcscheme:

Tools:

Mass rename of Source/WebKit to Source/WebKitLegacy in OpenSource tooling.

* BuildSlaveSupport/build.webkit.org-config/wkbuild_unittest.py:
* DumpRenderTree/mac/InternalHeaders/WebKit/WebTypesInternal.h:
* EWSTools/configure-clang-linux.sh:
* Scripts/build-webkit:
* Scripts/do-file-rename:
* Scripts/do-webcore-rename:
* Scripts/update-webkit-localizable-strings:
* Scripts/webkitpy/common/checkout/checkout_unittest.py:
* Scripts/webkitpy/style/checkers/changelog_unittest.py:
* Scripts/webkitpy/style/checkers/featuredefines.py:
* gtk/manifest.txt.in:

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

2 years agoRename Source/WebKit2 to Source/WebKit.
matthew_hanson@apple.com [Fri, 14 Jul 2017 02:12:32 +0000 (02:12 +0000)]
Rename Source/WebKit2 to Source/WebKit.

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

2 years agoRename Source/WebKit to Source/WebKitLegacy.
matthew_hanson@apple.com [Fri, 14 Jul 2017 02:11:40 +0000 (02:11 +0000)]
Rename Source/WebKit to Source/WebKitLegacy.

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

2 years agoFix compiler warnings when building with GCC 7
mcatanzaro@igalia.com [Fri, 14 Jul 2017 01:48:49 +0000 (01:48 +0000)]
Fix compiler warnings when building with GCC 7
https://bugs.webkit.org/show_bug.cgi?id=174463

Reviewed by Darin Adler.

.:

* Source/cmake/OptionsCommon.cmake:

Source/JavaScriptCore:

* disassembler/udis86/udis86_decode.c:
(decode_operand):

Source/ThirdParty:

* brotli/CMakeLists.txt:

Source/WebCore:

* testing/InternalSettings.cpp:
(WebCore::InternalSettings::setShouldManageAudioSessionCategory):

Source/WebKit2:

* Platform/IPC/unix/ConnectionUnix.cpp:
(IPC::Connection::sendOutputMessage):

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

2 years agoIncorrect call to StyledElement::setInlineStyleProperty in ImageDocument::createDocum...
mcatanzaro@igalia.com [Fri, 14 Jul 2017 01:38:54 +0000 (01:38 +0000)]
Incorrect call to StyledElement::setInlineStyleProperty in ImageDocument::createDocumentStructure
https://bugs.webkit.org/show_bug.cgi?id=174470

Reviewed by Darin Adler.

* html/ImageDocument.cpp:
(WebCore::ImageDocument::createDocumentStructure):

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

2 years agoSkipped multiple http/tests/webrtc/ test on iOS simulator.
jlewis3@apple.com [Fri, 14 Jul 2017 00:23:26 +0000 (00:23 +0000)]
Skipped multiple http/tests/webrtc/ test on iOS simulator.
https://bugs.webkit.org/show_bug.cgi?id=173861

Unreviewed test gardening.
* platform/ios-simulator-wk2/TestExpectations:

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

2 years agoAdd script to rebase patches during the WebKit2->WebKit/WebKit->WebKitLegacy transition
jbedard@apple.com [Fri, 14 Jul 2017 00:20:11 +0000 (00:20 +0000)]
Add script to rebase patches during the WebKit2->WebKit/WebKit->WebKitLegacy transition
https://bugs.webkit.org/show_bug.cgi?id=174438
<rdar://problem/33277112>

Reviewed by Aakash Jain.

Given a patch, this will convert the changes from the path to the new directory structure.

* Scripts/rebase-patch-after-webkit-move: Added.
(append_source): Append 'Source' to the provided path.
(is_editable_line): Return true if a line the script expects to modify.
(needs_rebase): Return if a line needs to be rebased based on it's content.
(rebase_line): Rebase the provided line.
(rebase): Rebase a patch given the lines of that patch and a file to output the rebased patch to.
(parse_arguments): Parse the command line arguments and return the patches to be rebased, if they
were provided.

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

2 years agoFix iOS build.
dino@apple.com [Thu, 13 Jul 2017 23:09:05 +0000 (23:09 +0000)]
Fix iOS build.

* platform/graphics/GraphicsContext3D.h:

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

2 years agoMoved filesystem code out of WebResourceLoadStatisticsStore class
cdumez@apple.com [Thu, 13 Jul 2017 23:08:57 +0000 (23:08 +0000)]
Moved filesystem code out of WebResourceLoadStatisticsStore class
https://bugs.webkit.org/show_bug.cgi?id=174435

Reviewed by Brent Fulgham.

Moved filesystem code out of WebResourceLoadStatisticsStore class and into
a new ResourceLoadStatisticsPersistentStorage class to decrease complexity.

* CMakeLists.txt:
* UIProcess/Cocoa/WebResourceLoadStatisticsStoreCocoa.mm:
* UIProcess/Storage/ResourceLoadStatisticsPersistentStorage.cpp: Added.
(WebKit::hasFileChangedSince):
(WebKit::createDecoderForFile):
(WebKit::ResourceLoadStatisticsPersistentStorage::ResourceLoadStatisticsPersistentStorage):
(WebKit::ResourceLoadStatisticsPersistentStorage::~ResourceLoadStatisticsPersistentStorage):
(WebKit::ResourceLoadStatisticsPersistentStorage::storageDirectoryPath):
(WebKit::ResourceLoadStatisticsPersistentStorage::resourceLogFilePath):
(WebKit::ResourceLoadStatisticsPersistentStorage::startMonitoringDisk):
(WebKit::ResourceLoadStatisticsPersistentStorage::stopMonitoringDisk):
(WebKit::ResourceLoadStatisticsPersistentStorage::refreshMemoryStoreFromDisk):
(WebKit::ResourceLoadStatisticsPersistentStorage::populateMemoryStoreFromDisk):
(WebKit::ResourceLoadStatisticsPersistentStorage::writeMemoryStoreToDisk):
(WebKit::ResourceLoadStatisticsPersistentStorage::scheduleOrWriteMemoryStore):
(WebKit::ResourceLoadStatisticsPersistentStorage::clear):
(WebKit::ResourceLoadStatisticsPersistentStorage::finishAllPendingWorkSynchronously):
(WebKit::ResourceLoadStatisticsPersistentStorage::excludeFromBackup):
* UIProcess/Storage/ResourceLoadStatisticsPersistentStorage.h: Added.
* UIProcess/Storage/ios/ResourceLoadStatisticsPersistentStorageIOS.mm: Added.
(WebKit::ResourceLoadStatisticsPersistentStorage::excludeFromBackup):
* UIProcess/WebResourceLoadStatisticsStore.cpp:
(WebKit::WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore):
(WebKit::WebResourceLoadStatisticsStore::processStatisticsAndDataRecords):
(WebKit::WebResourceLoadStatisticsStore::grandfatherExistingWebsiteData):
(WebKit::WebResourceLoadStatisticsStore::applicationWillTerminate):
(WebKit::WebResourceLoadStatisticsStore::scheduleClearInMemoryAndPersistent):
(WebKit::WebResourceLoadStatisticsStore::resetDataFromDecoder):
* UIProcess/WebResourceLoadStatisticsStore.h:
* WebKit2.xcodeproj/project.pbxproj:

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

2 years agoRename GraphicsContext[3D]Mac to Cocoa and move things into graphics/cocoa
dino@apple.com [Thu, 13 Jul 2017 23:04:13 +0000 (23:04 +0000)]
Rename GraphicsContext[3D]Mac to Cocoa and move things into graphics/cocoa
https://bugs.webkit.org/show_bug.cgi?id=174453
<rdar://problem/33281481>

Reviewed by Simon Fraser.

Two renames, two moves:
graphics/mac/GraphicsContext3DMac.mm -> graphics/cocoa/GraphicsContext3DCocoa.mm
graphics/mac/GraphicsContext.mm -> graphics/cocoa/GraphicsContextCocoa.mm
graphics/mac/WebGLLayer.h -> graphics/cocoa/WebGLLayer.h
graphics/mac/WebGLLayer.mm -> graphics/cocoa/WebGLLayer.mm

* PlatformMac.cmake:
* WebCore.xcodeproj/project.pbxproj:
* platform/graphics/cocoa/GraphicsContext3DCocoa.mm: Renamed from Source/WebCore/platform/graphics/mac/GraphicsContext3DMac.mm.
* platform/graphics/cocoa/GraphicsContextCocoa.mm: Renamed from Source/WebCore/platform/graphics/mac/GraphicsContextMac.mm.
* platform/graphics/cocoa/WebGLLayer.h: Renamed from Source/WebCore/platform/graphics/mac/WebGLLayer.h.
* platform/graphics/cocoa/WebGLLayer.mm: Renamed from Source/WebCore/platform/graphics/mac/WebGLLayer.mm.

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

2 years agoClean-up some things in GraphicsContext3D
dino@apple.com [Thu, 13 Jul 2017 22:59:50 +0000 (22:59 +0000)]
Clean-up some things in GraphicsContext3D
https://bugs.webkit.org/show_bug.cgi?id=174452
<rdar://problem/33281257>

Reviewed by Simon Fraser.

General clean-up in GC3D.

Covered by existing tests.

* platform/graphics/GraphicsContext3D.h: Use initial values where possible.
(WebCore::GraphicsContext3D::GraphicsContext3DState::GraphicsContext3DState): Deleted.
* platform/graphics/mac/GraphicsContext3DMac.mm:
(WebCore::GraphicsContext3D::GraphicsContext3D): Nearly everything can come from the
initial values now.
(WebCore::GraphicsContext3D::~GraphicsContext3D): Remove code that won't be enabled
on this platform.
* platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
(WebCore::GraphicsContext3D::paintRenderingResultsToCanvas): While unlikely to happen,
and possibly harmless in this case, add some checked arithmetic to make sure we don't overflow
when working out how big a buffer to create.
(WebCore::GraphicsContext3D::paintRenderingResultsToImageData): Ditto.
(WebCore::GraphicsContext3D::reshape): Do nothing if we are ever given negative
width or height. Again unlikely.

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

2 years agoAvoid unnecessary copy of framebuffer into WebGL Layer
dino@apple.com [Thu, 13 Jul 2017 22:49:52 +0000 (22:49 +0000)]
Avoid unnecessary copy of framebuffer into WebGL Layer
https://bugs.webkit.org/show_bug.cgi?id=174345
<rdar://problem/33228950>

Reviewed by Sam Weinig.

On macOS, we're unnecessarily copying the framebuffer into another
texture before pushing it into the compositing layer. Instead we
should simply render the FBO into the CALayer we use to draw on
the screen.

Covered by the existing WebGL tests.

* platform/graphics/GraphicsContext3D.h:
(WebCore::GraphicsContext3D::platformTexture): Return the FBO texture instead.
* platform/graphics/mac/GraphicsContext3DMac.mm:
(WebCore::GraphicsContext3D::GraphicsContext3D): No need to have a compositing
texture.
(WebCore::GraphicsContext3D::~GraphicsContext3D):
* platform/graphics/opengl/GraphicsContext3DOpenGL.cpp:
(WebCore::GraphicsContext3D::reshapeFBOs):
* platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
(WebCore::GraphicsContext3D::prepareTexture): Don't copy the pixels from
the FBO into the compositing texture

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

2 years agoUnreviewed, rolling out r219453.
cdumez@apple.com [Thu, 13 Jul 2017 22:04:05 +0000 (22:04 +0000)]
Unreviewed, rolling out r219453.

Seems to cause some crashes on the bots

Reverted changeset:

"Moved filesystem code out of WebResourceLoadStatisticsStore
class"
https://bugs.webkit.org/show_bug.cgi?id=174435
http://trac.webkit.org/changeset/219453

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

2 years agoMarked imported/w3c/web-platform-tests/IndexedDB/large-nested-cloning.html as flaky...
jlewis3@apple.com [Thu, 13 Jul 2017 22:02:14 +0000 (22:02 +0000)]
Marked imported/w3c/web-platform-tests/IndexedDB/large-nested-cloning.html as flaky on iOS.
https://bugs.webkit.org/show_bug.cgi?id=173487

Unreviewed test gardening.

* platform/ios-simulator-wk2/TestExpectations:

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

2 years agoSkipping media/video-source-before-src.html.
jlewis3@apple.com [Thu, 13 Jul 2017 21:02:37 +0000 (21:02 +0000)]
Skipping media/video-source-before-src.html.
https://bugs.webkit.org/show_bug.cgi?id=174284

Unreviewed test gardening.

* TestExpectations:

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

2 years agoIncorrect assertion in JSC::CallLinkInfo::callTypeFor
mcatanzaro@igalia.com [Thu, 13 Jul 2017 20:39:32 +0000 (20:39 +0000)]
Incorrect assertion in JSC::CallLinkInfo::callTypeFor
https://bugs.webkit.org/show_bug.cgi?id=174467

Reviewed by Saam Barati.

* bytecode/CallLinkInfo.cpp:
(JSC::CallLinkInfo::callTypeFor):

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

2 years agoREGRESSION: "visibility:hidden" does not hide play button for video elements
graouts@webkit.org [Thu, 13 Jul 2017 20:19:10 +0000 (20:19 +0000)]
REGRESSION: "visibility:hidden" does not hide play button for video elements
​https://bugs.webkit.org/show_bug.cgi?id=174258
<rdar://problem/33181452>

Unreviewed test gardening.

Add a missing expectation file which is designed to be empty and is now just a space.

* media/modern-media-controls/css/visibility-hidden-expected.html: Added.

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

2 years agoImplementors of memoryCost() need to be thread-safe.
mark.lam@apple.com [Thu, 13 Jul 2017 19:16:54 +0000 (19:16 +0000)]
Implementors of memoryCost() need to be thread-safe.
https://bugs.webkit.org/show_bug.cgi?id=172738
<rdar://problem/32474881>

Reviewed by Keith Miller.

No new tests. This patch fixes a race condition bug that can result in random
crashes (and other unpredictable behavior), and is very difficult to test for.

* Modules/webaudio/AudioBuffer.cpp:
(WebCore::AudioBuffer::releaseMemory):
(WebCore::AudioBuffer::memoryCost):
* Modules/webaudio/AudioBuffer.h:
* dom/ChildNodeList.h:
* dom/CollectionIndexCache.h:
(WebCore::CollectionIndexCache::memoryCost):
* dom/LiveNodeList.h:
* html/CachedHTMLCollection.h:
* html/HTMLCanvasElement.cpp:
(WebCore::HTMLCanvasElement::memoryCost):
(WebCore::HTMLCanvasElement::externalMemoryCost):
(WebCore::HTMLCanvasElement::setImageBuffer):
* html/HTMLCanvasElement.h:
* html/HTMLCollection.cpp:
(WebCore::HTMLCollection::invalidateNamedElementCache):
* html/HTMLCollection.h:
(WebCore::CollectionNamedElementCache::memoryCost):
(WebCore::HTMLCollection::memoryCost):
(WebCore::HTMLCollection::setNamedItemCache):
* platform/graphics/ImageBuffer.cpp:
(WebCore::ImageBuffer::memoryCost):
* platform/graphics/cg/ImageBufferCG.cpp:
(WebCore::ImageBuffer::memoryCost):
(WebCore::ImageBuffer::externalMemoryCost):

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

2 years agoFix style. Use #pragma once in VideoFullscreen and PlaybackSession headers.
commit-queue@webkit.org [Thu, 13 Jul 2017 18:41:10 +0000 (18:41 +0000)]
Fix style. Use #pragma once in VideoFullscreen and PlaybackSession headers.
https://bugs.webkit.org/show_bug.cgi?id=174448

Patch by Jeremy Jones <jeremyj@apple.com> on 2017-07-13
Reviewed by Eric Carlson.

No behavior change.

Source/WebCore:

* platform/cocoa/WebPlaybackSessionInterface.h:
* platform/cocoa/WebVideoFullscreenChangeObserver.h:
* platform/cocoa/WebVideoFullscreenModel.h:
* platform/cocoa/WebVideoFullscreenModelVideoElement.h:
* platform/ios/WebPlaybackSessionInterfaceAVKit.h:
* platform/ios/WebVideoFullscreenControllerAVKit.h:
* platform/ios/WebVideoFullscreenInterfaceAVKit.h:
* platform/mac/WebVideoFullscreenInterfaceMac.h:

Source/WebKit2:

* UIProcess/Cocoa/WebVideoFullscreenManagerProxy.h:
* WebProcess/cocoa/WebVideoFullscreenManager.h:

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

2 years agoDeleting last URLSearchParams key should remove trailing ? in associated URL
commit-queue@webkit.org [Thu, 13 Jul 2017 18:21:48 +0000 (18:21 +0000)]
Deleting last URLSearchParams key should remove trailing ? in associated URL
https://bugs.webkit.org/show_bug.cgi?id=174465

Patch by Alex Christensen <achristensen@webkit.org> on 2017-07-13
Reviewed by Chris Dumez.

Source/WebCore:

This makes us match the behavior of Chrome and Firefox, and the spec after https://github.com/whatwg/url/issues/332 is approved.
This will be covered by an upcoming web platform test, and I updated fast/dom/DOMURL/searchparams.html to cover it now.

* platform/URLParser.cpp:
(WebCore::URLParser::serialize):
If there are no tuples, serialize to the null string instead of a non-null empty string.
This makes it so URL::setQuery removes the ?

LayoutTests:

* fast/dom/DOMURL/searchparams-expected.txt:
* fast/dom/DOMURL/searchparams.html:

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