WebKit-https.git
2 years agoTools:
commit-queue@webkit.org [Thu, 4 May 2017 21:46:39 +0000 (21:46 +0000)]
Tools:
Rename TestRunner.display() to TestRunner::displayAndTrackRepaints()
https://bugs.webkit.org/show_bug.cgi?id=171641

Patch by Said Abou-Hallawa <sabouhallawa@apple.com> on 2017-05-04
Reviewed by Simon Fraser.

The plan is to add back the TestRunner.display() which does the display
only without track repaints.

* DumpRenderTree/DumpRenderTree.h:
* DumpRenderTree/TestRunner.cpp:
(displayAndTrackRepaintsCallback):
(TestRunner::staticFunctions):
(displayCallback): Deleted.
(displayInvalidatedRegionCallback): Deleted.
* DumpRenderTree/TestRunner.h:
* DumpRenderTree/mac/DumpRenderTree.mm:
(displayWebView):
(displayAndTrackRepaintsWebView):
* DumpRenderTree/mac/TestRunnerMac.mm:
(TestRunner::displayAndTrackRepaints):
(TestRunner::display): Deleted.
* DumpRenderTree/win/TestRunnerWin.cpp:
(TestRunner::displayAndTrackRepaints):
(TestRunner::display): Deleted.
* WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl:
* WebKitTestRunner/InjectedBundle/TestRunner.cpp:
(WTR::TestRunner::displayAndTrackRepaints):
(WTR::TestRunner::display): Deleted.
* WebKitTestRunner/InjectedBundle/TestRunner.h:

LayoutTests:
Rename testRunner.displayAndTrackRepaints() to testRunner.displayAndTrackRepaints()
https://bugs.webkit.org/show_bug.cgi?id=171641

Patch by Said Abou-Hallawa <sabouhallawa@apple.com> on 2017-05-04
Reviewed by Simon Fraser.

Replace all the calls to testRunner.displayAndTrackRepaints() by testRunner.displayAndTrackRepaints()
Replace all the calls to testRunner.displayInvalidatedRegion() by
testRunner.displayAndTrackRepaints() since the former is a copy of the later.

* compositing/clip-change.html:
* compositing/geometry/foreground-offset-change.html:
* compositing/geometry/limit-layer-bounds-transformed-overflow.html:
* compositing/iframes/become-composited-nested-iframes.html:
* compositing/iframes/become-overlapped-iframe.html:
* compositing/iframes/connect-compositing-iframe-delayed.html:
* compositing/iframes/connect-compositing-iframe.html:
* compositing/iframes/connect-compositing-iframe2.html:
* compositing/iframes/connect-compositing-iframe3.html:
* compositing/iframes/enter-compositing-iframe.html:
* compositing/iframes/iframe-content-flipping.html:
* compositing/iframes/iframe-resize.html:
* compositing/iframes/iframe-size-to-zero.html:
* compositing/iframes/iframe-src-change.html:
* compositing/iframes/invisible-nested-iframe-hide.html:
* compositing/iframes/invisible-nested-iframe-show.html:
* compositing/iframes/leave-compositing-iframe.html:
* compositing/iframes/overlapped-iframe-iframe.html:
* compositing/iframes/overlapped-iframe.html:
* compositing/iframes/overlapped-nested-iframes.html:
* compositing/iframes/repaint-after-losing-scrollbars.html:
* compositing/iframes/resources/fixed-position-subframe.html:
* compositing/iframes/resources/fixed-position-transformed-subframe.html:
* compositing/iframes/resources/scrollgrandchild-inner.html:
* compositing/iframes/scrolling-iframe.html:
* compositing/overflow/content-gains-scrollbars.html:
* compositing/overflow/content-loses-scrollbars.html:
* compositing/overflow/do-not-paint-outline-into-composited-scrolling-contents.html:
* compositing/overflow/overflow-scrollbar-layers.html:
* compositing/overflow/paint-neg-z-order-descendants-into-scrolling-contents-layer.html:
* compositing/overflow/repaint-after-losing-scrollbars.html:
* compositing/patterns/direct-pattern-compositing-add-text-expected.html:
* compositing/patterns/direct-pattern-compositing-add-text.html:
* compositing/patterns/direct-pattern-compositing-change-expected.html:
* compositing/patterns/direct-pattern-compositing-change.html:
* compositing/patterns/direct-pattern-compositing-load-expected.html:
* compositing/patterns/direct-pattern-compositing-load.html:
* compositing/plugins/invalidate_rect.html:
* compositing/repaint/iframes/composited-iframe-with-fixed-background-doc-repaint.html:
* compositing/repaint/iframes/compositing-iframe-scroll-repaint.html:
* compositing/repaint/iframes/compositing-iframe-with-fixed-background-doc-repaint.html:
* compositing/repaint/newly-composited-on-scroll.html:
* compositing/repaint/newly-composited-repaint-rect.html:
* compositing/repaint/page-scale-repaint.html:
* compositing/repaint/requires-backing-repaint.html:
* compositing/repaint/transform-style-change.html:
* compositing/rtl/rtl-overflow-invalidation.html:
* compositing/scroll-painted-composited-content.html:
* compositing/tiling/huge-layer-resize.html:
* compositing/video-page-visibility.html:
* compositing/video/video-with-invalid-source.html:
* compositing/webgl/webgl-repaint.html:
* css3/filters/multiple-filters-invalidation.html:
* css3/flexbox/repaint-column-reverse.html:
* css3/flexbox/repaint-during-resize-no-flex.html:
* css3/flexbox/repaint-rtl-column.html:
* css3/flexbox/repaint.html:
* displaylists/canvas-display-list.html:
* displaylists/resources/dump-target-display-list.js:
(doTest):
* displaylists/resources/dump-target-replay-list.js:
(doTest):
* fast/animation/request-animation-frame-detach-element.html:
* fast/animation/request-animation-frame-detach-element2.html:
* fast/animation/request-animation-frame-during-modal.html:
* fast/animation/request-animation-frame-iframe.html:
* fast/animation/request-animation-frame-iframe2.html:
* fast/animation/script-tests/request-animation-frame-cancel.js:
* fast/animation/script-tests/request-animation-frame-cancel2.js:
* fast/animation/script-tests/request-animation-frame-disabled.js:
* fast/animation/script-tests/request-animation-frame-prefix.js:
(window.webkitRequestAnimationFrame):
(window.testRunner.window.setTimeout):
* fast/animation/script-tests/request-animation-frame-time-unit.js:
(window.requestAnimationFrame):
* fast/animation/script-tests/request-animation-frame-timestamps-advance.js:
(window.requestAnimationFrame):
(window.testRunner.window.setTimeout):
* fast/animation/script-tests/request-animation-frame-timestamps.js:
* fast/animation/script-tests/request-animation-frame-within-callback.js:
* fast/animation/script-tests/request-animation-frame.js:
* fast/backgrounds/obscured-background-child-style-change-expected.html:
* fast/backgrounds/obscured-background-child-style-change.html:
* fast/backgrounds/solid-color-context-restore.html:
* fast/canvas/canvas-as-image-incremental-repaint.html:
* fast/canvas/canvas-incremental-repaint-2.html:
* fast/canvas/canvas-incremental-repaint.html:
* fast/canvas/canvas-resize-after-paint.html:
* fast/canvas/resources/repaint.js:
(runRepaintTest):
* fast/canvas/script-tests/canvas-imageSmoothingEnabled-repaint.js:
(TestControllerPaint):
* fast/canvas/webgl/canvas-test.html:
* fast/canvas/webgl/webgl-layer-update.html:
* fast/css/pseudostyle-anonymous-text.html:
* fast/css/relative-positioned-block-crash.html:
* fast/dom/Window/post-message-crash.html:
* fast/dom/Window/web-timing-minimal-performance-now.html:
* fast/dynamic/containing-block-change.html:
* fast/dynamic/layer-no-longer-paginated.html:
* fast/events/touch/gesture/pad-gesture-cancel.js:
* fast/events/touch/gesture/pad-gesture-fling.js:
* fast/forms/hidden-listbox.html:
* fast/forms/listbox-clip.html:
* fast/frames/inline-object-inside-frameset.html:
* fast/frames/transparent-scrollbar.html:
* fast/images/animated-background-image-crash.html:
* fast/layers/add-layer-with-nested-stacking.html:
* fast/layers/inline-dirty-z-order-lists.html:
* fast/layers/layer-content-visibility-change.html:
* fast/layers/nested-layers-1.html:
* fast/layers/nested-layers-2.html:
* fast/layers/nested-layers-3.html:
* fast/layers/nested-layers-4.html:
* fast/layers/remove-layer-with-nested-stacking.html:
* fast/overflow/hidden-scrollbar-resize.html:
* fast/reflections/inline-crash.html:
* fast/repaint/animation-after-layer-scroll.html:
* fast/repaint/background-shorthand-with-gradient-and-height-changes.html:
* fast/repaint/fixed-child-move-after-scroll.html:
* fast/repaint/fixed-child-of-fixed-move-after-scroll.html:
* fast/repaint/fixed-child-of-transformed-move-after-scroll.html:
* fast/repaint/fixed-move-after-scroll.html:
* fast/repaint/no-animation-outside-viewport-subframe.html:
* fast/repaint/no-animation-outside-viewport.html:
* fast/repaint/obscured-background-no-repaint.html:
* fast/repaint/overflow-hidden-in-overflow-hidden-scrolled.html:
* fast/repaint/renderer-destruction-by-invalidateSelection-crash.html:
* fast/repaint/repaint-during-scroll-with-zoom.html:
* fast/repaint/resources/fixed-move-after-keyboard-scroll-iframe.html:
* fast/repaint/resources/iframe-scroll-repaint-iframe.html:
* fast/repaint/resources/line-flow-with-floats.js:
(beginTest):
* fast/repaint/resources/repaint.js:
(runRepaintTest):
* fast/repaint/table-overflow-hidden-in-overflow-hidden-scrolled.html:
* fast/replaced/width100percent-textarea.html:
* fast/scrolling/scrollbar-tickmarks-hittest.html:
* fast/table/border-collapsing/cached-69296.html:
* fast/table/border-collapsing/cached-cell-append.html:
* fast/table/border-collapsing/cached-cell-remove.html:
* fast/table/border-collapsing/cached-change-cell-border-color.html:
* fast/table/border-collapsing/cached-change-cell-border-width.html:
* fast/table/border-collapsing/cached-change-cell-sl-border-color.html:
* fast/table/border-collapsing/cached-change-col-border-color.html:
* fast/table/border-collapsing/cached-change-col-border-width.html:
* fast/table/border-collapsing/cached-change-colgroup-border-color.html:
* fast/table/border-collapsing/cached-change-colgroup-border-width.html:
* fast/table/border-collapsing/cached-change-row-border-color.html:
* fast/table/border-collapsing/cached-change-row-border-width.html:
* fast/table/border-collapsing/cached-change-table-border-color.html:
* fast/table/border-collapsing/cached-change-table-border-width.html:
* fast/table/border-collapsing/cached-change-tbody-border-color.html:
* fast/table/border-collapsing/cached-change-tbody-border-width.html:
* fast/table/empty-section-crash.html:
* fast/text/font-initial.html:
* fast/text/international/harfbuzz-runs-with-no-glyph.html:
* fast/text/text-shadow-extreme-value.html:
* http/tests/misc/slow-loading-image-in-pattern.html:
* media/audio-repaint.html:
* media/media-document-audio-repaint.html:
* plugins/windowless_plugin_paint_test.html:
* scrollbars/scrollbar-percent-padding-crash.html:
* svg/custom/non-scaling-stroke-update.svg:
* svg/custom/stale-resource-data-crash.svg:

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

2 years ago[ios-simulator] API test WebKit2.WebsiteDataStoreCustomPaths is failing.
beidson@apple.com [Thu, 4 May 2017 21:42:23 +0000 (21:42 +0000)]
[ios-simulator] API test WebKit2.WebsiteDataStoreCustomPaths is failing.
https://bugs.webkit.org/show_bug.cgi?id=171513

Unreviewed gardening.

* TestWebKitAPI/Tests/WebKit2Cocoa/WebsiteDataStoreCustomPaths.mm:
(TEST): Skip the failing parts of the test on iOS for now.

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

2 years agoCrash when pointer lock element is removed before pointer lock allowed arrives.
commit-queue@webkit.org [Thu, 4 May 2017 21:39:44 +0000 (21:39 +0000)]
Crash when pointer lock element is removed before pointer lock allowed arrives.
https://bugs.webkit.org/show_bug.cgi?id=171642

Patch by Jeremy Jones <jeremyj@apple.com> on 2017-05-04
Reviewed by Jer Noble.

Make sure there a pending lock before attempting to complete pointer lock.

* page/PointerLockController.cpp:
(WebCore::PointerLockController::didAcquirePointerLock):

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

2 years agoReformat / Clean up Node.idl to match the specification
cdumez@apple.com [Thu, 4 May 2017 21:27:11 +0000 (21:27 +0000)]
Reformat / Clean up Node.idl to match the specification
https://bugs.webkit.org/show_bug.cgi?id=171686

Reviewed by Sam Weinig.

Source/WebCore:

Reformat / Clean up Node.idl to match the specification:
- https://dom.spec.whatwg.org/#node

There should be no Web-facing behavior change, except for Node properties
being enumerated in a slightly different order.

* dom/Node.idl:

LayoutTests:

Rebaseline existing test now that the Node properties are enumerated in a
slightly different order.

* js/dom/dom-static-property-for-in-iteration-expected.txt:

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

2 years agoMake ImageDiff stand-alone
jbedard@apple.com [Thu, 4 May 2017 21:06:37 +0000 (21:06 +0000)]
Make ImageDiff stand-alone
https://bugs.webkit.org/show_bug.cgi?id=168939

Reviewed by David Kilzer.

Create ImageDiff without dependencies on bmalloc and WTF so that it exists as a
stand-alone project. Note that this change does not eliminate the ImageDiff inside
the DumpRenderTree project.

* ImageDiff/ImageDiff.xcodeproj: Added.
* ImageDiff/ImageDiff.xcodeproj/project.pbxproj: Added.
* ImageDiff/Makefile: Use ImageDiff project.
* ImageDiff/PlatformMac.cmake: Added.
* ImageDiff/PlatformWin.cmake: Added.
* ImageDiff/cg: Added.
* ImageDiff/cg/Configurations: Added.
* ImageDiff/cg/Configurations/Base.xcconfig: Copied from Tools/DumpRenderTree/mac/Configurations/Base.xcconfig.
* ImageDiff/cg/Configurations/DebugRelease.xcconfig: Copied from Tools/DumpRenderTree/mac/Configurations/DebugRelease.xcconfig.
* ImageDiff/cg/Configurations/ImageDiff.xcconfig: Copied from Tools/DumpRenderTree/mac/Configurations/ImageDiff.xcconfig.
* ImageDiff/cg/ImageDiff.cpp: Copied from Tools/DumpRenderTree/cg/ImageDiffCG.cpp.
(createImageFromStdin): Stop using RetainPtr.
(createDifferenceImage): Ditto.
(main): Ditto.
* Scripts/build-imagediff: Stop building WTF and bmalloc.

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

2 years agoRemove support for legacy Notifications
weinig@apple.com [Thu, 4 May 2017 20:56:00 +0000 (20:56 +0000)]
Remove support for legacy Notifications
https://bugs.webkit.org/show_bug.cgi?id=171487

Reviewed by Jon Lee.

Source/JavaScriptCore:

* Configurations/FeatureDefines.xcconfig:
Remove definition of ENABLE_LEGACY_NOTIFICATIONS.

Source/WebCore:

* CMakeLists.txt:
* WebCore.xcodeproj/project.pbxproj:
Remove files.

* Configurations/FeatureDefines.xcconfig:
Remove definition of ENABLE_LEGACY_NOTIFICATIONS.

* DerivedSources.make:
Remove IDL files.

* Modules/notifications/DOMWindowNotifications.cpp: Removed.
* Modules/notifications/DOMWindowNotifications.h: Removed.
* Modules/notifications/DOMWindowNotifications.idl: Removed.
* Modules/notifications/NotificationCenter.cpp: Removed.
* Modules/notifications/NotificationCenter.h: Removed.
* Modules/notifications/NotificationCenter.idl: Removed.
* Modules/notifications/NotificationClient.h:
* Modules/notifications/NotificationController.cpp:
* Modules/notifications/NotificationController.h:
* Modules/notifications/WorkerGlobalScopeNotifications.cpp: Removed.
* Modules/notifications/WorkerGlobalScopeNotifications.h: Removed.
* Modules/notifications/WorkerGlobalScopeNotifications.idl: Removed.
* Modules/notifications/Notification.idl:
* Modules/notifications/Notification.cpp:
* Modules/notifications/Notification.h:
* dom/EventTargetFactory.in:
* page/DOMWindow.cpp:
* workers/WorkerThread.h:
Remove code legacy Notification code. Replace use of NotificationCenter with direct
calls to the NotificationClient.

Source/WebCore/PAL:

* Configurations/FeatureDefines.xcconfig:
Remove definition of ENABLE_LEGACY_NOTIFICATIONS.

Source/WebKit/mac:

* Configurations/FeatureDefines.xcconfig:
* WebCoreSupport/WebNotificationClient.h:
* WebCoreSupport/WebNotificationClient.mm:
* WebView/WebNotification.mm:
* WebView/WebNotificationInternal.h:
* WebView/WebView.mm:
(-[WebView _commonInitializationWithFrameName:groupName:]):
(-[WebView _notificationIDForTesting:]):
Remove legacy notification specific code.

Source/WebKit/win:

* WebCoreSupport/WebChromeClient.cpp:
(WebChromeClient::WebChromeClient):
* WebCoreSupport/WebChromeClient.h:
* WebCoreSupport/WebDesktopNotificationsDelegate.cpp:
* WebCoreSupport/WebDesktopNotificationsDelegate.h:
Remove legacy notification specific code.

Source/WebKit2:

* Configurations/FeatureDefines.xcconfig:
* Shared/WebProcessCreationParameters.cpp:
* Shared/WebProcessCreationParameters.h:
* UIProcess/WebProcessPool.cpp:
* WebProcess/InjectedBundle/InjectedBundle.cpp:
* WebProcess/Notifications/NotificationPermissionRequestManager.cpp:
* WebProcess/Notifications/NotificationPermissionRequestManager.h:
* WebProcess/Notifications/WebNotificationManager.cpp:
* WebProcess/Notifications/WebNotificationManager.h:
* WebProcess/WebCoreSupport/WebNotificationClient.cpp:
* WebProcess/WebCoreSupport/WebNotificationClient.h:
* WebProcess/WebPage/WebPage.cpp:
* WebProcess/WebProcess.cpp:
Remove legacy notification specific code.

Source/WTF:

* wtf/FeatureDefines.h:
Remove definition of ENABLE_LEGACY_NOTIFICATIONS.

Tools:

* DumpRenderTree/win/DRTDesktopNotificationPresenter.cpp:
(DRTDesktopNotificationPresenter::checkNotificationPermission):
* Scripts/webkitperl/FeatureList.pm:
* TestWebKitAPI/Configurations/FeatureDefines.xcconfig:
Remove use and definition of ENABLE_LEGACY_NOTIFICATIONS.

LayoutTests:

- Remove fast/notifications/. It was skipped on all platforms and use legacy Notifications API.
- Remove http/notifications/legacy. It tested the legacy API.
- Update two tests in fast/history to use the non-legacy API to test page cache + notifications.
- Update TestExpectations for removals.

* TestExpectations:
* platform/gtk/TestExpectations:
* platform/ios/TestExpectations:
* platform/mac/TestExpectations:
* platform/win/TestExpectations:
* fast/history/page-cache-notification-non-suspendable.html:
* fast/history/page-cache-notification-suspendable.html:
* fast/notifications: Removed.
* fast/notifications/notification-after-close-expected.txt: Removed.
* fast/notifications/notification-after-close.html: Removed.
* fast/notifications/notification-permisssion-deletable-expected.txt: Removed.
* fast/notifications/notification-permisssion-deletable.html: Removed.
* fast/notifications/notifications-cancel-request-permission-expected.txt: Removed.
* fast/notifications/notifications-cancel-request-permission.html: Removed.
* fast/notifications/notifications-check-permission-expected.txt: Removed.
* fast/notifications/notifications-check-permission.html: Removed.
* fast/notifications/notifications-click-event-expected.txt: Removed.
* fast/notifications/notifications-click-event-focus-expected.txt: Removed.
* fast/notifications/notifications-click-event-focus.html: Removed.
* fast/notifications/notifications-click-event.html: Removed.
* fast/notifications/notifications-constructor-request-permission-expected.txt: Removed.
* fast/notifications/notifications-constructor-request-permission.html: Removed.
* fast/notifications/notifications-constructor-with-permission-expected.txt: Removed.
* fast/notifications/notifications-constructor-with-permission.html: Removed.
* fast/notifications/notifications-constructor-without-permission-expected.txt: Removed.
* fast/notifications/notifications-constructor-without-permission.html: Removed.
* fast/notifications/notifications-display-close-events-expected.txt: Removed.
* fast/notifications/notifications-display-close-events.html: Removed.
* fast/notifications/notifications-document-close-crash-expected.txt: Removed.
* fast/notifications/notifications-document-close-crash.html: Removed.
* fast/notifications/notifications-event-stop-propagation-expected.txt: Removed.
* fast/notifications/notifications-event-stop-propagation.html: Removed.
* fast/notifications/notifications-multi-events-expected.txt: Removed.
* fast/notifications/notifications-multi-events.html: Removed.
* fast/notifications/notifications-no-icon-expected.txt: Removed.
* fast/notifications/notifications-no-icon.html: Removed.
* fast/notifications/notifications-permission-expected.txt: Removed.
* fast/notifications/notifications-permission.html: Removed.
* fast/notifications/notifications-replace-expected.txt: Removed.
* fast/notifications/notifications-replace.html: Removed.
* fast/notifications/notifications-request-permission-expected.txt: Removed.
* fast/notifications/notifications-request-permission-optional-expected.txt: Removed.
* fast/notifications/notifications-request-permission-optional.html: Removed.
* fast/notifications/notifications-request-permission.html: Removed.
* fast/notifications/notifications-rtl-expected.txt: Removed.
* fast/notifications/notifications-rtl.html: Removed.
* fast/notifications/notifications-sandbox-permission-expected.txt: Removed.
* fast/notifications/notifications-sandbox-permission.html: Removed.
* fast/notifications/notifications-window-close-crash-expected.txt: Removed.
* fast/notifications/notifications-window-close-crash.html: Removed.
* fast/notifications/notifications-with-permission-expected.txt: Removed.
* fast/notifications/notifications-with-permission.html: Removed.
* fast/notifications/notifications-without-permission-expected.txt: Removed.
* fast/notifications/notifications-without-permission.html: Removed.
* fast/notifications/request-notification-permission-while-reloading-expected.txt: Removed.
* fast/notifications/request-notification-permission-while-reloading.html: Removed.
* fast/notifications/resources: Removed.
* fast/notifications/resources/notifications-cancel-request-permission.html: Removed.
* fast/notifications/resources/notifications-iframe.html: Removed.
* http/tests/notifications/legacy: Removed.
* http/tests/notifications/legacy/double-show-expected.txt: Removed.
* http/tests/notifications/legacy/double-show.html: Removed.
* http/tests/notifications/legacy/events-expected.txt: Removed.
* http/tests/notifications/legacy/events.html: Removed.
* http/tests/notifications/legacy/notification-request-permission-then-navigate-expected.txt: Removed.
* http/tests/notifications/legacy/notification-request-permission-then-navigate.html: Removed.
* http/tests/notifications/legacy/request-expected.txt: Removed.
* http/tests/notifications/legacy/request-no-callback-expected.txt: Removed.
* http/tests/notifications/legacy/request-no-callback.html: Removed.
* http/tests/notifications/legacy/request.html: Removed.
* http/tests/notifications/legacy/resources: Removed.
* http/tests/notifications/legacy/resources/notify-opener-done.html: Removed.
* http/tests/notifications/legacy/resources/request-permission-then-navigate.html: Removed.
* http/tests/notifications/legacy/show-expected.txt: Removed.
* http/tests/notifications/legacy/show.html: Removed.
* http/tests/notifications/legacy/window-show-on-click-expected.txt: Removed.
* http/tests/notifications/legacy/window-show-on-click.html: Removed.

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

2 years agoMarked http/tests/xmlhttprequest/workers/methods-async.html as flaky.
ryanhaddad@apple.com [Thu, 4 May 2017 20:20:32 +0000 (20:20 +0000)]
Marked http/tests/xmlhttprequest/workers/methods-async.html as flaky.
https://bugs.webkit.org/show_bug.cgi?id=160368

Unreviewed test gardening.

Patch by Matt Lewis <jlewis3@apple.com> on 2017-05-04

* platform/ios-wk2/TestExpectations:

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

2 years agoREGRESSION (Safari 10.1): When 'transition' contains -ms-transform, transform-origin...
antti@apple.com [Thu, 4 May 2017 20:16:01 +0000 (20:16 +0000)]
REGRESSION (Safari 10.1): When 'transition' contains -ms-transform, transform-origin is also transitioned
https://bugs.webkit.org/show_bug.cgi?id=171250
<rdar://problem/31827243>

Reviewed by Geoffrey Garen.

Source/WebCore:

We were mapping unknown properties to 'all' animation. With this patch we ignore them instead.
The patch also implements roundtripping of unknown properties via CSSOM, matching Blink and Gecko.

Test: transitions/transition-unknown-property-ignore.html

* css/CSSComputedStyleDeclaration.cpp:
(WebCore::createTransitionPropertyValue):

    Return the correct name for unknown properties.

* css/CSSToStyleMap.cpp:
(WebCore::CSSToStyleMap::mapAnimationProperty):

    Map any unknown property to AnimateUnknownProperty mode instead of falling back to the default of AnimateAll.
    Save the unknown property name so we can roundtrip it properly.

* page/animation/CompositeAnimation.cpp:
(WebCore::CompositeAnimation::updateTransitions):

    Ignore AnimateUnknownProperty like AnimateNone.

* platform/animation/Animation.h:
(WebCore::Animation::unknownProperty):
(WebCore::Animation::setUnknownProperty):

LayoutTests:

* transitions/transition-unknown-property-ignore-expected.txt: Added.
* transitions/transition-unknown-property-ignore.html: Added.
* transitions/transitions-parsing-expected.txt:
* transitions/transitions-parsing.html:

    Update the roundtrip expectations for unknown properties. The new results match Blink and Gecko.

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

2 years agoGive +testwebkitapi_configurationWithTestPlugInClassName: a shorter name
aestes@apple.com [Thu, 4 May 2017 20:08:40 +0000 (20:08 +0000)]
Give +testwebkitapi_configurationWithTestPlugInClassName: a shorter name
https://bugs.webkit.org/show_bug.cgi?id=171673

Reviewed by Dan Bernstein.

* TestWebKitAPI/Tests/WebKit2Cocoa/AdditionalReadAccessAllowedURLs.mm:
(TEST):
* TestWebKitAPI/Tests/WebKit2Cocoa/BundleEditingDelegate.mm:
(TEST):
* TestWebKitAPI/Tests/WebKit2Cocoa/BundleParameters.mm:
(TEST):
* TestWebKitAPI/Tests/WebKit2Cocoa/BundleRangeHandle.mm:
(TEST):
* TestWebKitAPI/Tests/WebKit2Cocoa/CancelFontSubresource.mm:
(TEST):
* TestWebKitAPI/Tests/WebKit2Cocoa/ContentFiltering.mm:
(configurationWithContentFilterSettings):
(-[LazilyLoadPlatformFrameworksController init]):
* TestWebKitAPI/Tests/WebKit2Cocoa/RemoteObjectRegistry.mm:
(TEST):
* TestWebKitAPI/Tests/WebKit2Cocoa/RenderedImageWithOptions.mm:
(runTestWithWidth):
* TestWebKitAPI/Tests/WebKit2Cocoa/UserContentWorld.mm:
(TEST):
* TestWebKitAPI/Tests/ios/DataInteractionTests.mm:
(TestWebKitAPI::TEST):
* TestWebKitAPI/WKWebViewConfigurationExtras.h:
* TestWebKitAPI/WKWebViewConfigurationExtras.mm:
(+[WKWebViewConfiguration _test_configurationWithTestPlugInClassName:]):
(+[WKWebViewConfiguration testwebkitapi_configurationWithTestPlugInClassName:]): Renamed to
+_test_configurationWithTestPlugInClassName:

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

2 years agoClean up MutationRecord.idl
cdumez@apple.com [Thu, 4 May 2017 20:02:42 +0000 (20:02 +0000)]
Clean up MutationRecord.idl
https://bugs.webkit.org/show_bug.cgi?id=171685

Reviewed by Sam Weinig.

Clean up MutationRecord.idl to match the specification:
- https://dom.spec.whatwg.org/#mutationrecord

There is no Web-facing behavior change.

* dom/MutationRecord.idl:

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

2 years ago[GTK][JSCOnly] Implement memoryFootprint for Linux
utatane.tea@gmail.com [Thu, 4 May 2017 20:00:36 +0000 (20:00 +0000)]
[GTK][JSCOnly] Implement memoryFootprint for Linux
https://bugs.webkit.org/show_bug.cgi?id=171680

Reviewed by Carlos Alberto Lopez Perez.

Darwin's phys_footprint returns the amount of dirty anonymous memory in the process.
This patch implements the same thing in Linux by reading /proc/self/smaps.
We sum sizes of private dirty pages in anonymous regions.

* wtf/MemoryFootprint.cpp:
(WTF::forEachLine):
(WTF::memoryFootprint):

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

2 years agoReformat / clean up Event.idl
cdumez@apple.com [Thu, 4 May 2017 19:55:05 +0000 (19:55 +0000)]
Reformat / clean up Event.idl
https://bugs.webkit.org/show_bug.cgi?id=171675

Reviewed by Sam Weinig.

Source/WebCore:

Reformat / clean up Event.idl to match the latest spec more closely:
- https://dom.spec.whatwg.org/#interface-event

There is no web-facing behavior change, except for properties being
enumerated in a slightly different order.

* dom/Event.idl:

LayoutTests:

Rebaseline test now that the Event properties are in a slightly different order.

* inspector/model/remote-object-get-properties-expected.txt:

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

2 years agoCleanup: Extract CachedScript::mimeTypeAllowedByNosniff() into a common function
dbates@webkit.org [Thu, 4 May 2017 19:49:48 +0000 (19:49 +0000)]
Cleanup: Extract CachedScript::mimeTypeAllowedByNosniff() into a common function
https://bugs.webkit.org/show_bug.cgi?id=171678

Reviewed by Andy Estes.

Extract CachedScript::mimeTypeAllowedByNosniff() into a common function that can
be shared by LoadableClassicScript and WorkerScriptLoader.

No functionality was changed. So, no new tests.

* dom/LoadableClassicScript.cpp:
(WebCore::LoadableClassicScript::notifyFinished): Modified to use WebCore::isScriptAllowedByNosniff().
* loader/cache/CachedScript.cpp:
(WebCore::CachedScript::mimeType): Deleted; incorporated into WebCore::isScriptAllowedByNosniff().
(WebCore::CachedScript::mimeTypeAllowedByNosniff): Deleted; incorporated into WebCore::isScriptAllowedByNosniff().
* loader/cache/CachedScript.h:
* platform/network/ResourceResponseBase.cpp:
(WebCore::isScriptAllowedByNosniff): Added. Note that it is sufficient to extract the MIME type
as-is and query the MIME type registry because the MIME type registry performs look ups case-insensitively.
* platform/network/ResourceResponseBase.h:
* workers/WorkerScriptLoader.cpp:
(WebCore::WorkerScriptLoader::didReceiveResponse): Modified to use WebCore::isScriptAllowedByNosniff().
(WebCore::mimeTypeAllowedByNosniff): Deleted.

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

2 years agoMake the [EnabledBySetting] extended attribute work for any attribute or operation...
commit-queue@webkit.org [Thu, 4 May 2017 18:39:03 +0000 (18:39 +0000)]
Make the [EnabledBySetting] extended attribute work for any attribute or operation on a prototype
https://bugs.webkit.org/show_bug.cgi?id=171588

Patch by Sam Weinig <sam@webkit.org> on 2017-05-04
Reviewed by Dean Jackson.

* bindings/js/JSDOMIterator.h:
(WebCore::JSDOMIterator::createPrototype):
* bindings/js/JSDOMWindowShell.cpp:
(WebCore::JSDOMWindowShell::setWindow):
* bindings/js/JSDOMWrapperCache.h:
(WebCore::getDOMStructure):
(WebCore::getDOMPrototype):
* bindings/js/WorkerScriptController.cpp:
(WebCore::WorkerScriptController::initScript):
Update to account for createPrototype and prototype taking the global object by reference.

* bindings/scripts/CodeGeneratorJS.pm:
(NeedsSettingsCheckForPrototypeProperty):
Add predicate to determine if an interface has any settings enabled properties on the prototype,
needed to determine if we should pass the global object to finishCreation.

(GenerateHeader):
Update signature of both createPrototype and prototype to take JSDOMGlobalObject& rather than
a JSC::JSGlobalObject*, this allows us to pass the more specific type to the prototype constructor,
and access the ScriptExecutionContext for the Settings.

(GeneratePropertiesHashTable):
Update to return, via out parameter, arrays with the attributes and operations that specify EnabledBySetting. This
mimics the model used for RuntimeEnabledFeatures.

(GenerateImplementation):
In {Class}Prototype::finishCreation, add code to check settings to see if an attribute or operation should be enabled,
and if it shouldn't remove it from the object. This, again, is modeled on RuntimeEnabledFeatures.

(GeneratePrototypeDeclaration):
Update signatures to take JSDOMGlobalObject& and specialize finishCreation to take one if there are any properties
that require settings to enable.

(GenerateConstructorHelperMethods):
Update for new signature of prototype(...).

* bindings/scripts/test/JS/JSInterfaceName.cpp:
* bindings/scripts/test/JS/JSInterfaceName.h:
* bindings/scripts/test/JS/JSMapLike.cpp:
* bindings/scripts/test/JS/JSMapLike.h:
* bindings/scripts/test/JS/JSReadOnlyMapLike.cpp:
* bindings/scripts/test/JS/JSReadOnlyMapLike.h:
* bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
* bindings/scripts/test/JS/JSTestActiveDOMObject.h:
* bindings/scripts/test/JS/JSTestCEReactions.cpp:
* bindings/scripts/test/JS/JSTestCEReactions.h:
* bindings/scripts/test/JS/JSTestCEReactionsStringifier.cpp:
* bindings/scripts/test/JS/JSTestCEReactionsStringifier.h:
* bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.cpp:
* bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.h:
* bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp:
* bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.h:
* bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp:
* bindings/scripts/test/JS/JSTestCustomNamedGetter.h:
* bindings/scripts/test/JS/JSTestDOMJIT.cpp:
* bindings/scripts/test/JS/JSTestDOMJIT.h:
* bindings/scripts/test/JS/JSTestEventConstructor.cpp:
* bindings/scripts/test/JS/JSTestEventConstructor.h:
* bindings/scripts/test/JS/JSTestEventTarget.cpp:
* bindings/scripts/test/JS/JSTestEventTarget.h:
* bindings/scripts/test/JS/JSTestException.cpp:
* bindings/scripts/test/JS/JSTestException.h:
* bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
* bindings/scripts/test/JS/JSTestGenerateIsReachable.h:
* bindings/scripts/test/JS/JSTestGlobalObject.h:
* bindings/scripts/test/JS/JSTestInterface.cpp:
* bindings/scripts/test/JS/JSTestInterface.h:
* bindings/scripts/test/JS/JSTestInterfaceLeadingUnderscore.cpp:
* bindings/scripts/test/JS/JSTestInterfaceLeadingUnderscore.h:
* bindings/scripts/test/JS/JSTestIterable.cpp:
* bindings/scripts/test/JS/JSTestIterable.h:
* bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp:
* bindings/scripts/test/JS/JSTestJSBuiltinConstructor.h:
* bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
* bindings/scripts/test/JS/JSTestMediaQueryListListener.h:
* bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
* bindings/scripts/test/JS/JSTestNamedConstructor.h:
* bindings/scripts/test/JS/JSTestNode.cpp:
* bindings/scripts/test/JS/JSTestNode.h:
* bindings/scripts/test/JS/JSTestObj.cpp:
* bindings/scripts/test/JS/JSTestObj.h:
* bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
* bindings/scripts/test/JS/JSTestOverloadedConstructors.h:
* bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp:
* bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.h:
* bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
* bindings/scripts/test/JS/JSTestOverrideBuiltins.h:
* bindings/scripts/test/JS/JSTestSerialization.cpp:
* bindings/scripts/test/JS/JSTestSerialization.h:
* bindings/scripts/test/JS/JSTestSerializationInherit.cpp:
* bindings/scripts/test/JS/JSTestSerializationInherit.h:
* bindings/scripts/test/JS/JSTestSerializationInheritFinal.cpp:
* bindings/scripts/test/JS/JSTestSerializationInheritFinal.h:
* bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
* bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.h:
* bindings/scripts/test/JS/JSTestTypedefs.cpp:
* bindings/scripts/test/JS/JSTestTypedefs.h:
Update test results for new test values and changes in signatures to pass JSDOMGlobalObject.

* bindings/scripts/test/TestObj.idl:
Add tests for [EnableBySetting] for attributes and operations.

* bridge/objc/objc_runtime.h:
* bridge/runtime_array.h:
* bridge/runtime_method.h:
* bridge/runtime_object.h:
* inspector/CommandLineAPIHost.cpp:
Update createPrototype function to take the global object by reference.

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

2 years ago[MediaStream] Allow host application to enable/disable media capture
eric.carlson@apple.com [Thu, 4 May 2017 18:32:29 +0000 (18:32 +0000)]
[MediaStream] Allow host application to enable/disable media capture
https://bugs.webkit.org/show_bug.cgi?id=171292
<rdar://problem/31821492>

Reviewed by Jer Noble.

Source/WebCore:

No new layout tests, added an API test instead.

* Modules/mediastream/MediaStream.cpp:
(WebCore::MediaStream::endStream): New, stop all tracks.
* Modules/mediastream/MediaStream.h:

* Modules/mediastream/MediaStreamRegistry.cpp:
(WebCore::MediaStreamRegistry::unregisterStream): Minor cleanup.
(WebCore::MediaStreamRegistry::forEach): New, call the lambda with each stream.
(WebCore::MediaStreamRegistry::MediaStreamRegistry): Deleted, unused.
* Modules/mediastream/MediaStreamRegistry.h:

* Modules/mediastream/MediaStreamTrack.cpp:
(WebCore::MediaStreamTrack::stopTrack): Add parameter so caller can specify if an 'ended'
event should be sent or not.
(WebCore::MediaStreamTrack::trackMutedChanged): Don't post an event if the track has ended.
* Modules/mediastream/MediaStreamTrack.h:

* dom/Document.cpp:
(WebCore::Document::stopMediaCapture): Stop all streams in the document.
* dom/Document.h:

* page/Page.cpp:
(WebCore::Page::stopMediaCapture): Stop all streams.
* page/Page.h:

* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::currentDisplayMode): Display a black frame
when the stream ends.
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::activeStatusChanged): Signal a characteristics
change to HTMLMediaElement refresh state.
* platform/mediastream/MediaStreamPrivate.h:

* platform/mediastream/mac/AVMediaCaptureSource.mm:
(WebCore::AVMediaCaptureSource::stopProducingData): Don't return early if the session isn't
running, we always need to clear m_session on iOS.

Source/WebKit2:

* UIProcess/API/C/WKPage.cpp:
(WKPageSetMediaCaptureEnabled): New.
(WKPageGetMediaCaptureEnabled): New.
* UIProcess/API/C/WKPagePrivate.h:

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _setMediaCaptureEnabled:]): New.
(-[WKWebView _mediaCaptureEnabled]): New.
* UIProcess/API/Cocoa/WKWebViewPrivate.h:

* UIProcess/Cocoa/UIDelegate.mm:
(WebKit::UIDelegate::setDelegate): Initialize webViewRequestUserMediaAuthorizationForDevicesURLMainFrameURLDecisionHandler
and webViewCheckUserMediaPermissionForURLMainFrameURLFrameIdentifierDecisionHandler on macOS
and iOS.

* UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
(WebKit::UserMediaPermissionRequestManagerProxy::UserMediaPermissionRequestManagerProxy):
Initialize the rejection timer.
(WebKit::UserMediaPermissionRequestManagerProxy::~UserMediaPermissionRequestManagerProxy):
Call invalidatePendingRequests.
(WebKit::UserMediaPermissionRequestManagerProxy::invalidatePendingRequests): Invalidate all
pending requests.
(WebKit::UserMediaPermissionRequestManagerProxy::stopCapture): New.
(WebKit::UserMediaPermissionRequestManagerProxy::rejectionTimerFired): Reject a promise and
schedule the timer if there are any others pending.
(WebKit::UserMediaPermissionRequestManagerProxy::scheduleNextRejection):
(WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame): Don't
prompt the user if capture is disabled.
(WebKit::UserMediaPermissionRequestManagerProxy::invalidateRequests): Deleted.
(WebKit::UserMediaPermissionRequestManagerProxy::clearCachedState): Deleted.
* UIProcess/UserMediaPermissionRequestManagerProxy.h:

* UIProcess/UserMediaProcessManager.cpp:
(WebKit::UserMediaProcessManager::willEnableMediaStreamInPage): Stop capture in the current
page on iOS.
(WebKit::UserMediaProcessManager::setCaptureEnabled):
* UIProcess/UserMediaProcessManager.h:

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::setMediaCaptureEnabled):

* UIProcess/WebPageProxy.h:
(WebKit::WebPageProxy::mediaCaptureEnabled):

* WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp:
(WebKit::UserMediaPermissionRequestManager::cancelPendingRequests): New, cancel all pending
requests.
(WebKit::UserMediaPermissionRequestManager::cancelUserMediaRequest): Deny the request.
(WebKit::UserMediaPermissionRequestManager::cancelMediaDevicesEnumeration):
* WebProcess/MediaStream/UserMediaPermissionRequestManager.h:

* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::stopMediaCapture):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:

Tools:

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKit2Cocoa/UserMediaDisabled.mm: Added.
(-[UserMediaMessageHandler userContentController:didReceiveScriptMessage:]):
(-[UserMediaUIDelegate _webView:requestUserMediaAuthorizationForDevices:url:mainFrameURL:decisionHandler:]):
(-[UserMediaUIDelegate _webView:checkUserMediaPermissionForURL:mainFrameURL:frameIdentifier:decisionHandler:]):
(MediaCaptureDisabledTest::SetUp):
(MediaCaptureDisabledTest::loadTestAndWaitForMessage):
(TEST_F):
* TestWebKitAPI/Tests/WebKit2Cocoa/disableGetUserMedia.html: Added.

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

2 years agoShould never hit layout while updating the render tree.
zalan@apple.com [Thu, 4 May 2017 18:27:08 +0000 (18:27 +0000)]
Should never hit layout while updating the render tree.
https://bugs.webkit.org/show_bug.cgi?id=171643

Reviewed by Antti Koivisto.

Laying out a half-baked render tree is not a great idea. Especially considering
that layout (sadly) can mutate the render tree.

* page/FrameView.cpp:
(WebCore::FrameView::layout):

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

2 years agoimportScripts() should respect X-Content-Type-Options: nosniff
dbates@webkit.org [Thu, 4 May 2017 18:25:39 +0000 (18:25 +0000)]
importScripts() should respect X-Content-Type-Options: nosniff
https://bugs.webkit.org/show_bug.cgi?id=171248
<rdar://problem/31819023>

Reviewed by Andy Estes.

LayoutTests/imported/w3c:

Update expected results for Web Platform Tests that now pass.

* web-platform-tests/fetch/nosniff/importscripts-expected.txt: Added.
* web-platform-tests/fetch/nosniff/worker-expected.txt:

Source/WebCore:

Do not load a worker script if it has the HTTP response header "X-Content-Type-Options: nosniff"
and its Content-type header is not an allowed JavaScript script mime type. This behavior follows
from <https://html.spec.whatwg.org/multipage/webappapis.html#fetch-a-classic-worker-imported-script> (3 May 2017),
<https://fetch.spec.whatwg.org/#concept-fetch> (2 May 2017), and <https://fetch.spec.whatwg.org/#concept-main-fetch>.

* workers/WorkerScriptLoader.cpp:
(WebCore::mimeTypeAllowedByNosniff): Added.
(WebCore::WorkerScriptLoader::didReceiveResponse): Mark the load as failed if the response
is not allowed by X-Content-Type-Options: nosniff.

LayoutTests:

Unskip web-platform-tests/fetch/nosniff/importscripts as it now passes.

* TestExpectations:

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

2 years agoUnreviewed: Replace Windows line ending (CRLF) by Unix line ending (CR).
said@apple.com [Thu, 4 May 2017 18:02:46 +0000 (18:02 +0000)]
Unreviewed: Replace Windows line ending (CRLF) by Unix line ending (CR).

* plugins/windowless_plugin_paint_test.html:

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

2 years agoUnreviewed, Adding self to contributors.json
ticaiolima@gmail.com [Thu, 4 May 2017 17:46:59 +0000 (17:46 +0000)]
Unreviewed, Adding self to contributors.json

* Scripts/webkitpy/common/config/contributors.json: Added name.

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

2 years agoUnreviewed: Replace Windows line ending (CRLF) by Unix line ending (CR).
said@apple.com [Thu, 4 May 2017 17:44:44 +0000 (17:44 +0000)]
Unreviewed: Replace Windows line ending (CRLF) by Unix line ending (CR).

* compositing/video/video-with-invalid-source.html:

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

2 years agoSkip media/modern-media-controls/pip-support/pip-support-click.html on mac-wk1.
ryanhaddad@apple.com [Thu, 4 May 2017 17:19:24 +0000 (17:19 +0000)]
Skip media/modern-media-controls/pip-support/pip-support-click.html on mac-wk1.
https://bugs.webkit.org/show_bug.cgi?id=171610

Unreviewed test gardening.

* platform/mac-wk1/TestExpectations:

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

2 years agoVersioning.
jmarcell@apple.com [Thu, 4 May 2017 16:45:17 +0000 (16:45 +0000)]
Versioning.

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

2 years agoREGRESSION(STP): rgb() with calc() containing variables doesn't work
hyatt@apple.com [Thu, 4 May 2017 15:41:13 +0000 (15:41 +0000)]
REGRESSION(STP): rgb() with calc() containing variables doesn't work
https://bugs.webkit.org/show_bug.cgi?id=169939

Reviewed by Zalan Bujtas.

Source/WebCore:

Added new test in fast/css/variables.

* css/CSSCalculationValue.cpp:
(WebCore::CSSCalcExpressionNodeParser::parseValue):
Treat floats in calcs as integers when we can.

LayoutTests:

* fast/css/variables/calc-float-to-int-expected.html: Added.
* fast/css/variables/calc-float-to-int.html: Added.

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

2 years agoFix compilation with ICU 59.1
annulen@yandex.ru [Thu, 4 May 2017 15:33:41 +0000 (15:33 +0000)]
Fix compilation with ICU 59.1
https://bugs.webkit.org/show_bug.cgi?id=171612

Reviewed by Mark Lam.

ICU 59.1 has broken source compatibility. Now it defines UChar as
char16_t, which does not allow automatic type conversion from unsigned
short in C++ code.

Source/JavaScriptCore:

* API/JSStringRef.cpp:
(JSStringCreateWithCharacters):
(JSStringCreateWithCharactersNoCopy):
(JSStringGetCharactersPtr):
* runtime/DateConversion.cpp:
(JSC::formatDateTime):

Source/WebKit2:

* Shared/API/c/WKString.cpp:
(WKStringGetCharacters):

Tools:

* TestRunnerShared/UIScriptContext/UIScriptContext.cpp:
(UIScriptContext::tryToCompleteUIScriptForCurrentParentCallback):

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

2 years ago[Cocoa] -[WKWebsiteDataStore httpCookieStore] is declared in the main @interface...
mitz@apple.com [Thu, 4 May 2017 14:58:26 +0000 (14:58 +0000)]
[Cocoa] -[WKWebsiteDataStore httpCookieStore] is declared in the main @interface but implemented in a category
https://bugs.webkit.org/show_bug.cgi?id=171657

Reviewed by Sam Weinig.

* UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
(-[WKWebsiteDataStore httpCookieStore]): Moved from the WKPrivate category into the main
  @implementation block.

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

2 years ago[Cocoa] Add an optional width parameter to -[WKWebProcessPlugInNodeHandle renderedIma...
aestes@apple.com [Thu, 4 May 2017 14:41:03 +0000 (14:41 +0000)]
[Cocoa] Add an optional width parameter to -[WKWebProcessPlugInNodeHandle renderedImageWithOptions:]
https://bugs.webkit.org/show_bug.cgi?id=171646
<rdar://problem/30306321>

Reviewed by Tim Horton.

Source/WebKit2:

* WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandle.h:
* WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandle.mm:
(-[WKWebProcessPlugInNodeHandle renderedImageWithOptions:]): Called
-renderedImageWithOptions:width: with a nil width.
(-[WKWebProcessPlugInNodeHandle renderedImageWithOptions:width:]): Passed an optional width
to InjectedBundleNodeHandle::renderedImage().
* WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp:
(WebKit::imageForRect): If a width is specified, create an image graphics context at that
width, preserving the aspect ratio of paintingRect.
(WebKit::InjectedBundleNodeHandle::renderedImage):
* WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.h:

Tools:

* TestWebKitAPI/Tests/WebKit2Cocoa/RenderedImageWithOptions.mm:
(runTestWithWidth):
(TEST):
(-[RenderedImageWithOptionsObject didRenderImageWithSize:]): Deleted.
* TestWebKitAPI/Tests/WebKit2Cocoa/RenderedImageWithOptionsPlugIn.mm:
(-[RenderedImageWithOptionsPlugIn webProcessPlugIn:didCreateBrowserContextController:]):
(-[RenderedImageWithOptionsPlugIn webProcessPlugInBrowserContextController:didFinishLoadForFrame:]):
(-[RenderedImageWithOptionsPlugIn renderImageWithWidth:completionHandler:]):
* TestWebKitAPI/Tests/WebKit2Cocoa/RenderedImageWithOptionsProtocol.h:

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

2 years ago[GTK] Fontconfig 2.11.2 in JHBuild does not build with glibc 2.25+ or gperf 3.1+
commit-queue@webkit.org [Thu, 4 May 2017 14:30:41 +0000 (14:30 +0000)]
[GTK] Fontconfig 2.11.2 in JHBuild does not build with glibc 2.25+ or gperf 3.1+
https://bugs.webkit.org/show_bug.cgi?id=171649

Patch by Adrian Perez de Castro <aperez@igalia.com> on 2017-05-04
Reviewed by Carlos Garcia Campos.

Add two patches picked from the upstream repository to fix building of
the Fontconfig module in JHBuild. Additionally, this needed a patch to
add "autogen.sh" as it is not included in release tarballs. Also:
building the module with srcdir!=builddir prevents "fcobjshash.gperf"
being regenerated (which is needed) so this is disabled for the
Fontconfig module.

* gtk/jhbuild.modules:
* gtk/patches/fontconfig-2.11.1-add-autogen.patch: Added.
* gtk/patches/fontconfig-Avoid-conflicts-with-integer-width-macros-from-TS-18661-1-2014.patch: Added.
* gtk/patches/fontconfig-Fix-the-build-issue-with-gperf-3.1.patch: Added.

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

2 years agoUnreviewed, rolling out r216172.
commit-queue@webkit.org [Thu, 4 May 2017 12:56:54 +0000 (12:56 +0000)]
Unreviewed, rolling out r216172.
https://bugs.webkit.org/show_bug.cgi?id=171654

FTBFS for iOS due to missing WebPageProxy::stopMediaCapture()
implementation. (Requested by ddkilzer on #webkit).

Reverted changeset:

"[MediaStream] Allow host application to enable/disable media
capture"
https://bugs.webkit.org/show_bug.cgi?id=171292
http://trac.webkit.org/changeset/216172

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

2 years ago[Threaded Compositor] SHOULD NEVER BE REACHED in WebKit::CompositingRunLoop::updateCo...
carlosgc@webkit.org [Thu, 4 May 2017 12:42:13 +0000 (12:42 +0000)]
[Threaded Compositor] SHOULD NEVER BE REACHED in WebKit::CompositingRunLoop::updateCompleted
https://bugs.webkit.org/show_bug.cgi?id=171336

Reviewed by Michael Catanzaro.

We are assuming that all calls to ThreadedCompositor::renderLayerTree() happen because of an scheduled update,
but that's not true in the case of ThreadedCompositor::forceRepaint(). In that case we never want to call
CompositingRunLoop::updateCompleted().

* Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
(WebKit::ThreadedCompositor::forceRepaint):
(WebKit::ThreadedCompositor::sceneUpdateFinished):
* Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h:

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

2 years agocheck-webkit-style exits with an error while parsing Source/WebKit2/Scripts/webkit...
ddkilzer@apple.com [Thu, 4 May 2017 12:30:13 +0000 (12:30 +0000)]
check-webkit-style exits with an error while parsing Source/WebKit2/Scripts/webkit/ directory: KeyError: 'st'
<https://bugs.webkit.org/show_bug.cgi?id=171510>

Reviewed by Daniel Bates.

The problem was that 'import parser' was ambiguous since there
is a built-in parser module that comes with Python.  Changing
'import parser' to 'from webkit import parser' fixed the error
in check-webkit-style (and pylint) by forcing it to load the
local 'parser' module, but then running messages_unittest.py
directly would fail because .../Source/WebKit2/Scripts was not
in the module search path by default.  This is fixed by using
sys.path.append() to add .../Source/WebKit2/Scripts to the
module search path based on the path to messages_unittest.py.

As an added bonus, this patch also fixes all webkit-style issues
in Source/WebKit2/Scripts/webkit/*.py files.

* Scripts/webkit/messages.py:
- Separate local module imports from built-in modules for
  consistency.
- Fix whitespace issues for check-webkit-style, and remove stray
  semi-colon.
* Scripts/webkit/messages_unittest.py:
- Update sys.path to find the 'webkit' module based on the path
  to messages_unittest.py.  This makes 'from webkit import ...'
  statements work when running messages_unittest.py directly.
- Change 'messages' and 'parser' modules to use
  'from webkit import ...' format for consistency.
- Fix whitespace issues for check-webkit-style.
* Scripts/webkit/model.py:
- Fix whitespace issue for check-webkit-style.
* Scripts/webkit/parser.py:
- Fix whitespace issue for check-webkit-style.

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

2 years agostress/call-apply-exponential-bytecode-size.js.no-llint failing on 32-bit debug for...
sbarati@apple.com [Thu, 4 May 2017 12:20:59 +0000 (12:20 +0000)]
stress/call-apply-exponential-bytecode-size.js.no-llint failing on 32-bit debug for OOM on executable memory
https://bugs.webkit.org/show_bug.cgi?id=171008

Reviewed by Yusuke Suzuki.

This patch lowers the threshold for .call/.apply recursion
in an attempt to emit less code and not impact perf.
We're currently failing tests on x86-32 by running out
of executable memory. If perf gets impacted because of this,
then I'll apply a stricter change just to 32-bit platforms.
However, if this doesn't negatively impact perf, it's all around
better than all platforms emit less bytecode.

* bytecompiler/NodesCodegen.cpp:

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

2 years ago[GTK] Bump GStreamer version to 1.10.4 in jhbuild
commit-queue@webkit.org [Thu, 4 May 2017 11:57:08 +0000 (11:57 +0000)]
[GTK] Bump GStreamer version to 1.10.4 in jhbuild
https://bugs.webkit.org/show_bug.cgi?id=171595

Patch by Carlos Garcia Campos <cgarcia@igalia.com> on 2017-05-04
Reviewed by Xabier Rodriguez-Calvar.

* gtk/jhbuild.modules:
* gtk/patches/gst-plugins-bad-0001-dtls-port-to-OpenSSL-1.1.0.patch: Removed.
* gtk/patches/gst-plugins-bad-0002-dtlscertificate-Fix-error-checking-in-RSA_generate_k.patch: Removed.
* gtk/patches/gst-plugins-good-0001-rtpbin-pipeline-gets-an-EOS-when-any-rtpsources-byes.patch: Removed.
* gtk/patches/gst-plugins-good-0002-rtpbin-avoid-generating-errors-when-rtcp-messages-ar.patch: Removed.
* gtk/patches/gst-plugins-good-0004-qtdemux-add-context-for-a-preferred-protection.patch:
* gtk/patches/gst-plugins-good-Revert-qtdemux-expose-streams-with-first-moof-for-fr.patch: Removed.
* gtk/patches/gst-plugins-good-use-the-tfdt-decode-time.patch: Removed.

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

2 years ago[JSC] Math unary functions should be handled by DFG
utatane.tea@gmail.com [Thu, 4 May 2017 11:40:46 +0000 (11:40 +0000)]
[JSC] Math unary functions should be handled by DFG
https://bugs.webkit.org/show_bug.cgi?id=171269

Reviewed by Saam Barati.

JSTests:

* stress/arith-acos-on-various-types.js: Added.
(let.validInputTypedTestCases.validInputTestCases.map):
(isIdentical):
(opaqueACosNoArgument):
(testNoArgument):
(opaqueAllTypesACos):
(testAllTypesCall):
(testSingleTypeCall):
(testConstant):
(opaqueACosForSideEffects):
(testSideEffect.let.testObject.valueOf):
(testSideEffect):
(opaqueACosForCSE):
(testCSE.let.testObject.valueOf):
(testCSE):
(opaqueACosForDCE):
(testDCE.let.testObject.valueOf):
(testDCE):
(testException.opaqueACosWithException):
(testException):
* stress/arith-acosh-on-various-types.js: Added.
(let.validInputTypedTestCases.validInputTestCases.map):
(isIdentical):
(opaqueACoshNoArgument):
(testNoArgument):
(opaqueAllTypesACosh):
(testAllTypesCall):
(testSingleTypeCall):
(testConstant):
(opaqueACoshForSideEffects):
(testSideEffect.let.testObject.valueOf):
(testSideEffect):
(opaqueACoshForCSE):
(testCSE.let.testObject.valueOf):
(testCSE):
(opaqueACoshForDCE):
(testDCE.let.testObject.valueOf):
(testDCE):
(testException.opaqueACoshWithException):
(testException):
* stress/arith-asin-on-various-types.js: Added.
(let.validInputTypedTestCases.validInputTestCases.map):
(isIdentical):
(opaqueASinNoArgument):
(testNoArgument):
(opaqueAllTypesASin):
(testAllTypesCall):
(testSingleTypeCall):
(testConstant):
(opaqueASinForSideEffects):
(testSideEffect.let.testObject.valueOf):
(testSideEffect):
(opaqueASinForCSE):
(testCSE.let.testObject.valueOf):
(testCSE):
(opaqueASinForDCE):
(testDCE.let.testObject.valueOf):
(testDCE):
(testException.opaqueASinWithException):
(testException):
* stress/arith-asinh-on-various-types.js: Added.
(let.validInputTypedTestCases.validInputTestCases.map):
(isIdentical):
(opaqueASinhNoArgument):
(testNoArgument):
(opaqueAllTypesASinh):
(testAllTypesCall):
(testSingleTypeCall):
(testConstant):
(opaqueASinhForSideEffects):
(testSideEffect.let.testObject.valueOf):
(testSideEffect):
(opaqueASinhForCSE):
(testCSE.let.testObject.valueOf):
(testCSE):
(opaqueASinhForDCE):
(testDCE.let.testObject.valueOf):
(testDCE):
(testException.opaqueASinhWithException):
(testException):
* stress/arith-atan-on-various-types.js: Added.
(let.validInputTypedTestCases.validInputTestCases.map):
(isIdentical):
(opaqueATanNoArgument):
(testNoArgument):
(opaqueAllTypesATan):
(testAllTypesCall):
(testSingleTypeCall):
(testConstant):
(opaqueATanForSideEffects):
(testSideEffect.let.testObject.valueOf):
(testSideEffect):
(opaqueATanForCSE):
(testCSE.let.testObject.valueOf):
(testCSE):
(opaqueATanForDCE):
(testDCE.let.testObject.valueOf):
(testDCE):
(testException.opaqueATanWithException):
(testException):
* stress/arith-atanh-on-various-types.js: Added.
(let.validInputTypedTestCases.validInputTestCases.map):
(isIdentical):
(opaqueATanhNoArgument):
(testNoArgument):
(opaqueAllTypesATanh):
(testAllTypesCall):
(testSingleTypeCall):
(testConstant):
(opaqueATanhForSideEffects):
(testSideEffect.let.testObject.valueOf):
(testSideEffect):
(opaqueATanhForCSE):
(testCSE.let.testObject.valueOf):
(testCSE):
(opaqueATanhForDCE):
(testDCE.let.testObject.valueOf):
(testDCE):
(testException.opaqueATanhWithException):
(testException):
* stress/arith-cbrt-on-various-types.js: Added.
(let.validInputTypedTestCases.validInputTestCases.map):
(isIdentical):
(opaqueCbrtNoArgument):
(testNoArgument):
(opaqueAllTypesCbrt):
(testAllTypesCall):
(testSingleTypeCall):
(testConstant):
(opaqueCbrtForSideEffects):
(testSideEffect.let.testObject.valueOf):
(testSideEffect):
(opaqueCbrtForCSE):
(testCSE.let.testObject.valueOf):
(testCSE):
(opaqueCbrtForDCE):
(testDCE.let.testObject.valueOf):
(testDCE):
(testException.opaqueCbrtWithException):
(testException):
* stress/arith-cosh-on-various-types.js: Added.
(let.validInputTypedTestCases.validInputTestCases.map):
(isIdentical):
(opaqueCoshNoArgument):
(testNoArgument):
(opaqueAllTypesCosh):
(testAllTypesCall):
(testSingleTypeCall):
(testConstant):
(opaqueCoshForSideEffects):
(testSideEffect.let.testObject.valueOf):
(testSideEffect):
(opaqueCoshForCSE):
(testCSE.let.testObject.valueOf):
(testCSE):
(opaqueCoshForDCE):
(testDCE.let.testObject.valueOf):
(testDCE):
(testException.opaqueCoshWithException):
(testException):
* stress/arith-expm1-on-various-types.js: Added.
(let.validInputTypedTestCases.validInputTestCases.map):
(isIdentical):
(opaqueExpm1NoArgument):
(testNoArgument):
(opaqueAllTypesExpm1):
(testAllTypesCall):
(testSingleTypeCall):
(testConstant):
(opaqueExpm1ForSideEffects):
(testSideEffect.let.testObject.valueOf):
(testSideEffect):
(opaqueExpm1ForCSE):
(testCSE.let.testObject.valueOf):
(testCSE):
(opaqueExpm1ForDCE):
(testDCE.let.testObject.valueOf):
(testDCE):
(testException.opaqueExpm1WithException):
(testException):
* stress/arith-log10-on-various-types.js: Added.
(let.validInputTypedTestCases.validInputTestCases.map):
(isIdentical):
(opaqueLog10NoArgument):
(testNoArgument):
(opaqueAllTypesLog10):
(testAllTypesCall):
(testSingleTypeCall):
(testConstant):
(opaqueLog10ForSideEffects):
(testSideEffect.let.testObject.valueOf):
(testSideEffect):
(opaqueLog10ForCSE):
(testCSE.let.testObject.valueOf):
(testCSE):
(opaqueLog10ForDCE):
(testDCE.let.testObject.valueOf):
(testDCE):
(testException.opaqueLog10WithException):
(testException):
* stress/arith-log2-on-various-types.js: Added.
(let.validInputTypedTestCases.validInputTestCases.map):
(isIdentical):
(opaqueLog2NoArgument):
(testNoArgument):
(opaqueAllTypesLog2):
(testAllTypesCall):
(testSingleTypeCall):
(testConstant):
(opaqueLog2ForSideEffects):
(testSideEffect.let.testObject.valueOf):
(testSideEffect):
(opaqueLog2ForCSE):
(testCSE.let.testObject.valueOf):
(testCSE):
(opaqueLog2ForDCE):
(testDCE.let.testObject.valueOf):
(testDCE):
(testException.opaqueLog2WithException):
(testException):
* stress/arith-sinh-on-various-types.js: Added.
(let.validInputTypedTestCases.validInputTestCases.map):
(isIdentical):
(opaqueSinhNoArgument):
(testNoArgument):
(opaqueAllTypesSinh):
(testAllTypesCall):
(testSingleTypeCall):
(testConstant):
(opaqueSinhForSideEffects):
(testSideEffect.let.testObject.valueOf):
(testSideEffect):
(opaqueSinhForCSE):
(testCSE.let.testObject.valueOf):
(testCSE):
(opaqueSinhForDCE):
(testDCE.let.testObject.valueOf):
(testDCE):
(testException.opaqueSinhWithException):
(testException):
* stress/arith-tan-on-various-types.js:
(isIdentical):
* stress/arith-tanh-on-various-types.js: Added.
(let.validInputTypedTestCases.validInputTestCases.map):
(isIdentical):
(opaqueTanhNoArgument):
(testNoArgument):
(opaqueAllTypesTanh):
(testAllTypesCall):
(testSingleTypeCall):
(testConstant):
(opaqueTanhForSideEffects):
(testSideEffect.let.testObject.valueOf):
(testSideEffect):
(opaqueTanhForCSE):
(testCSE.let.testObject.valueOf):
(testCSE):
(opaqueTanhForDCE):
(testDCE.let.testObject.valueOf):
(testDCE):
(testException.opaqueTanhWithException):
(testException):

Source/JavaScriptCore:

ArithSin, ArithCos, and ArithLog are just calling a C runtime function.
While handling them in DFG is not very effective for performance, they
can drop some type checks & value conversions and mark them as pure
operations. It is effective if they are involved in some complex
optimization phase. Actually, ArithLog is effective in kraken.

While a few of Math functions have DFG nodes, basically math functions
are pure. And large part of these functions are just calling a C runtime
function. This patch generalizes these nodes in DFG as ArithUnary. And
we annotate many unary math functions with Intrinsics and convert them
to ArithUnary in DFG. It also cleans up duplicate code in ArithSin,
ArithCos, and ArithLog. If your math function has some good DFG / FTL
optimization rather than calling a C runtime function, you should add
a specialized DFG node, like ArithSqrt.

We also create a new namespace JSC::Math. Inside it, we collect math functions.

* dfg/DFGAbstractInterpreterInlines.h:
(JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects):
* dfg/DFGArithMode.cpp:
(JSC::DFG::arithUnaryFunction):
(JSC::DFG::arithUnaryOperation):
(WTF::printInternal):
* dfg/DFGArithMode.h:
* dfg/DFGBackwardsPropagationPhase.cpp:
(JSC::DFG::BackwardsPropagationPhase::propagate):
* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::handleIntrinsicCall):
* dfg/DFGClobberize.h:
(JSC::DFG::clobberize):
* dfg/DFGDoesGC.cpp:
(JSC::DFG::doesGC):
* dfg/DFGFixupPhase.cpp:
(JSC::DFG::FixupPhase::fixupNode):
* dfg/DFGGraph.cpp:
(JSC::DFG::Graph::dump):
* dfg/DFGNode.h:
(JSC::DFG::Node::hasArithUnaryType):
(JSC::DFG::Node::arithUnaryType):
* dfg/DFGNodeType.h:
* dfg/DFGOperations.cpp:
* dfg/DFGOperations.h:
* dfg/DFGPredictionPropagationPhase.cpp:
* dfg/DFGSafeToExecute.h:
(JSC::DFG::safeToExecute):
* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::compileArithUnary):
(JSC::DFG::SpeculativeJIT::compileArithCos): Deleted.
(JSC::DFG::SpeculativeJIT::compileArithTan): Deleted.
(JSC::DFG::SpeculativeJIT::compileArithSin): Deleted.
(JSC::DFG::SpeculativeJIT::compileArithLog): Deleted.
* dfg/DFGSpeculativeJIT.h:
* dfg/DFGSpeculativeJIT32_64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* dfg/DFGSpeculativeJIT64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* ftl/FTLCapabilities.cpp:
(JSC::FTL::canCompile):
* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::compileNode):
(JSC::FTL::DFG::LowerDFGToB3::compileArithUnary):
(JSC::FTL::DFG::LowerDFGToB3::compileArithSin): Deleted.
(JSC::FTL::DFG::LowerDFGToB3::compileArithCos): Deleted.
(JSC::FTL::DFG::LowerDFGToB3::compileArithTan): Deleted.
(JSC::FTL::DFG::LowerDFGToB3::compileArithLog): Deleted.
* ftl/FTLOutput.cpp:
(JSC::FTL::Output::doubleUnary):
(JSC::FTL::Output::doubleSin): Deleted.
(JSC::FTL::Output::doubleCos): Deleted.
(JSC::FTL::Output::doubleTan): Deleted.
(JSC::FTL::Output::doubleLog): Deleted.
* ftl/FTLOutput.h:
* runtime/Intrinsic.h:
* runtime/MathCommon.cpp:
(JSC::Math::log1p):
* runtime/MathCommon.h:
* runtime/MathObject.cpp:
(JSC::MathObject::finishCreation):
(JSC::mathProtoFuncACos):
(JSC::mathProtoFuncASin):
(JSC::mathProtoFuncATan):
(JSC::mathProtoFuncCos):
(JSC::mathProtoFuncExp):
(JSC::mathProtoFuncLog):
(JSC::mathProtoFuncSin):
(JSC::mathProtoFuncTan):
(JSC::mathProtoFuncACosh):
(JSC::mathProtoFuncASinh):
(JSC::mathProtoFuncATanh):
(JSC::mathProtoFuncCbrt):
(JSC::mathProtoFuncCosh):
(JSC::mathProtoFuncExpm1):
(JSC::mathProtoFuncLog1p):
(JSC::mathProtoFuncLog10):
(JSC::mathProtoFuncLog2):
(JSC::mathProtoFuncSinh):
(JSC::mathProtoFuncTanh):

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

2 years agoUnreviewed gardening. Update main expectations of http/tests/inspector/network/resour...
carlosgc@webkit.org [Thu, 4 May 2017 09:03:19 +0000 (09:03 +0000)]
Unreviewed gardening. Update main expectations of http/tests/inspector/network/resource-request-headers.html.

And add platform specific results for mac-wk2.

* http/tests/inspector/network/resource-request-headers-expected.txt:
* platform/mac-wk2/http/tests/inspector/network/resource-request-headers-expected.txt: Copied from LayoutTests/http/tests/inspector/network/resource-request-headers-expected.txt.

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

2 years agoREGRESSION(r215686): Incremental reads from SharedBuffer are wrong after r215686
carlosgc@webkit.org [Thu, 4 May 2017 06:14:36 +0000 (06:14 +0000)]
REGRESSION(r215686): Incremental reads from SharedBuffer are wrong after r215686
https://bugs.webkit.org/show_bug.cgi?id=171602

Reviewed by Michael Catanzaro.

In TextTrackLoader::processNewCueData() and PNGImageReader::decode() we changed the patter to read data from a
SharedBuffer at a given offset. The new pattern is not correct, because it assumes the whole segment is always
read, and the new offset is not correct when that's not the case. This has broken the rendering of png images in
the GTK+ port, only the first bytes are correctly decoded and drawn, but not the rest of the image.

Fixes: editing/pasteboard/paste-image-using-image-data.html

* loader/TextTrackLoader.cpp:
(WebCore::TextTrackLoader::processNewCueData):
* platform/image-decoders/png/PNGImageDecoder.cpp:
(WebCore::PNGImageReader::decode):

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

2 years agoHow we build polymorphic cases is wrong when making a call from Wasm
sbarati@apple.com [Thu, 4 May 2017 05:50:01 +0000 (05:50 +0000)]
How we build polymorphic cases is wrong when making a call from Wasm
https://bugs.webkit.org/show_bug.cgi?id=171527

Reviewed by JF Bastien.

Source/JavaScriptCore:

This patches fixes a bug when we emit a polymorphic call IC from
Wasm. We were incorrectly assuming that if we made a call *from wasm*,
then the thing we are *calling to* does not have a CodeBlock. This
is obviously wrong. This patch fixes the incorrect assumption.

This patch also does two more things:
1. Add a new option that makes us make calls to JS using a
slow path instead of using a call IC.
2. Fixes a potential GC bug where we didn't populate JSWebAssemblyCodeBlock's
JSWebAssemblyModule pointer.

* jit/Repatch.cpp:
(JSC::linkPolymorphicCall):
* runtime/Options.h:
* wasm/WasmBinding.cpp:
(JSC::Wasm::wasmToJs):
* wasm/js/JSWebAssemblyCodeBlock.cpp:
(JSC::JSWebAssemblyCodeBlock::create):
(JSC::JSWebAssemblyCodeBlock::finishCreation):
* wasm/js/JSWebAssemblyCodeBlock.h:
* wasm/js/JSWebAssemblyInstance.cpp:
(JSC::JSWebAssemblyInstance::finalizeCreation):

Tools:

* Scripts/run-jsc-stress-tests:

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

2 years ago[MediaStream] Allow host application to enable/disable media capture
eric.carlson@apple.com [Thu, 4 May 2017 04:48:07 +0000 (04:48 +0000)]
[MediaStream] Allow host application to enable/disable media capture
https://bugs.webkit.org/show_bug.cgi?id=171292
<rdar://problem/31821492>

Reviewed by Jer Noble.

Source/WebCore:

No new layout tests, added an API test instead.

* Modules/mediastream/MediaStream.cpp:
(WebCore::MediaStream::endStream): New, stop all tracks.
* Modules/mediastream/MediaStream.h:

* Modules/mediastream/MediaStreamRegistry.cpp:
(WebCore::MediaStreamRegistry::unregisterStream): Minor cleanup.
(WebCore::MediaStreamRegistry::forEach): New, call the lambda with each stream.
(WebCore::MediaStreamRegistry::MediaStreamRegistry): Deleted, unused.
* Modules/mediastream/MediaStreamRegistry.h:

* Modules/mediastream/MediaStreamTrack.cpp:
(WebCore::MediaStreamTrack::stopTrack): Add parameter so caller can specify if an 'ended'
event should be sent or not.
(WebCore::MediaStreamTrack::trackMutedChanged): Don't post an event if the track has ended.
* Modules/mediastream/MediaStreamTrack.h:

* dom/Document.cpp:
(WebCore::Document::stopMediaCapture): Stop all streams in the document.
* dom/Document.h:

* page/Page.cpp:
(WebCore::Page::stopMediaCapture): Stop all streams.
* page/Page.h:

* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::currentDisplayMode): Display a black frame
when the stream ends.
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::activeStatusChanged): Signal a characteristics
change to HTMLMediaElement refresh state.
* platform/mediastream/MediaStreamPrivate.h:

* platform/mediastream/mac/AVMediaCaptureSource.mm:
(WebCore::AVMediaCaptureSource::stopProducingData): Don't return early if the session isn't
running, we always need to clear m_session on iOS.

Source/WebKit2:

* UIProcess/API/C/WKPage.cpp:
(WKPageSetMediaCaptureEnabled): New.
(WKPageGetMediaCaptureEnabled): New.
* UIProcess/API/C/WKPagePrivate.h:

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _setMediaCaptureEnabled:]): New.
(-[WKWebView _mediaCaptureEnabled]): New.
* UIProcess/API/Cocoa/WKWebViewPrivate.h:

* UIProcess/Cocoa/UIDelegate.mm:
(WebKit::UIDelegate::setDelegate): Initialize webViewRequestUserMediaAuthorizationForDevicesURLMainFrameURLDecisionHandler
and webViewCheckUserMediaPermissionForURLMainFrameURLFrameIdentifierDecisionHandler on macOS
and iOS.

* UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
(WebKit::UserMediaPermissionRequestManagerProxy::UserMediaPermissionRequestManagerProxy):
Initialize the rejection timer.
(WebKit::UserMediaPermissionRequestManagerProxy::~UserMediaPermissionRequestManagerProxy):
Call invalidatePendingRequests.
(WebKit::UserMediaPermissionRequestManagerProxy::invalidatePendingRequests): Invalidate all
pending requests.
(WebKit::UserMediaPermissionRequestManagerProxy::stopCapture): New.
(WebKit::UserMediaPermissionRequestManagerProxy::rejectionTimerFired): Reject a promise and
schedule the timer if there are any others pending.
(WebKit::UserMediaPermissionRequestManagerProxy::scheduleNextRejection):
(WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame): Don't
prompt the user if capture is disabled.
(WebKit::UserMediaPermissionRequestManagerProxy::invalidateRequests): Deleted.
(WebKit::UserMediaPermissionRequestManagerProxy::clearCachedState): Deleted.
* UIProcess/UserMediaPermissionRequestManagerProxy.h:

* UIProcess/UserMediaProcessManager.cpp:
(WebKit::UserMediaProcessManager::willEnableMediaStreamInPage): Stop capture in the current
page on iOS.
(WebKit::UserMediaProcessManager::setCaptureEnabled):
* UIProcess/UserMediaProcessManager.h:

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::setMediaCaptureEnabled):

* UIProcess/WebPageProxy.h:
(WebKit::WebPageProxy::mediaCaptureEnabled):

* WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp:
(WebKit::UserMediaPermissionRequestManager::cancelPendingRequests): New, cancel all pending
requests.
(WebKit::UserMediaPermissionRequestManager::cancelUserMediaRequest): Deny the request.
(WebKit::UserMediaPermissionRequestManager::cancelMediaDevicesEnumeration):
* WebProcess/MediaStream/UserMediaPermissionRequestManager.h:

* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::stopMediaCapture):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:

Tools:

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKit2Cocoa/UserMediaDisabled.mm: Added.
(-[UserMediaMessageHandler userContentController:didReceiveScriptMessage:]):
(-[UserMediaUIDelegate _webView:requestUserMediaAuthorizationForDevices:url:mainFrameURL:decisionHandler:]):
(-[UserMediaUIDelegate _webView:checkUserMediaPermissionForURL:mainFrameURL:frameIdentifier:decisionHandler:]):
(MediaCaptureDisabledTest::SetUp):
(MediaCaptureDisabledTest::loadTestAndWaitForMessage):
(TEST_F):
* TestWebKitAPI/Tests/WebKit2Cocoa/disableGetUserMedia.html: Added.

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

2 years agoResource Load Statistics: Remove all statistics for modifiedSince website data removals
wilander@apple.com [Thu, 4 May 2017 04:16:39 +0000 (04:16 +0000)]
Resource Load Statistics: Remove all statistics for modifiedSince website data removals
https://bugs.webkit.org/show_bug.cgi?id=171584
<rdar://problem/24702576>

Reviewed by Brent Fulgham.

Source/WebCore:

Test: http/tests/loading/resourceLoadStatistics/clear-in-memory-and-persistent-store-one-hour.html

* loader/ResourceLoadObserver.cpp:
(WebCore::ResourceLoadObserver::clearInMemoryAndPersistentStore):
    Now clears all regardless of the modifiedSince parameter's value.

Source/WebKit2:

These are all test infrastructure changes.

* UIProcess/API/C/WKResourceLoadStatisticsManager.cpp:
(WKResourceLoadStatisticsManagerClearInMemoryAndPersistentStoreModifiedSinceHours):
* UIProcess/API/C/WKResourceLoadStatisticsManager.h:
* UIProcess/WebResourceLoadStatisticsManager.cpp:
(WebKit::WebResourceLoadStatisticsManager::clearInMemoryAndPersistentStoreModifiedSinceHours):
* UIProcess/WebResourceLoadStatisticsManager.h:

Tools:

New function to call the clear function that takes a modifiedSince parameter.

* WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl:
* WebKitTestRunner/InjectedBundle/TestRunner.cpp:
(WTR::TestRunner::statisticsClearInMemoryAndPersistentStoreModifiedSinceHours):
* WebKitTestRunner/InjectedBundle/TestRunner.h:
* WebKitTestRunner/TestController.cpp:
(WTR::TestController::statisticsClearInMemoryAndPersistentStoreModifiedSinceHours):
* WebKitTestRunner/TestController.h:
* WebKitTestRunner/TestInvocation.cpp:
(WTR::TestInvocation::didReceiveSynchronousMessageFromInjectedBundle):

LayoutTests:

* http/tests/loading/resourceLoadStatistics/clear-in-memory-and-persistent-store-one-hour-expected.txt: Added.
* http/tests/loading/resourceLoadStatistics/clear-in-memory-and-persistent-store-one-hour.html: Added.

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

2 years agoTry to fix the macOS Public SDK build
aestes@apple.com [Thu, 4 May 2017 03:08:40 +0000 (03:08 +0000)]
Try to fix the macOS Public SDK build
https://bugs.webkit.org/show_bug.cgi?id=171635
<rdar://problem/31812751>

Unreviewed because the commit queue told me to say this.

* platform/spi/cocoa/AVKitSPI.h:

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

2 years agoArray.prototype.sort should also allow a null comparator
keith_miller@apple.com [Thu, 4 May 2017 02:16:12 +0000 (02:16 +0000)]
Array.prototype.sort should also allow a null comparator
https://bugs.webkit.org/show_bug.cgi?id=171621
JSTests:

Reviewed by Michael Saboff.

Add test to make it less likely we revert to the incompatable behavior.
Also, fix now incorrect tests.

* ChakraCore/test/Array/array_sort.baseline-jsc:
* stress/array-sort-bad-comparator.js:
(test):
* stress/sort-null-comparator.js: Added.
(assertEq):

Source/JavaScriptCore:

<rdar://problem/30757933>

Reviewed by Michael Saboff.

It looks like sort not accepting a null comparator
causes some pages to stop working. Those pages work in
Chrome/Firefox so we should try to match them.

* builtins/ArrayPrototype.js:
(sort):

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

2 years agoMaintain interaction information imageURL as a URL, not a string
timothy_horton@apple.com [Thu, 4 May 2017 02:02:58 +0000 (02:02 +0000)]
Maintain interaction information imageURL as a URL, not a string
https://bugs.webkit.org/show_bug.cgi?id=171639

Reviewed by Sam Weinig.

* Shared/ios/InteractionInformationAtPosition.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _dataForPreviewItemController:atPosition:type:]):
(-[WKContentView _previewItemController:commitPreview:]):
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::getPositionInformation):

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

2 years agoAX: aria-rowspan value should be ignored if td/th rowspan value is provided
jdiggs@igalia.com [Thu, 4 May 2017 01:40:45 +0000 (01:40 +0000)]
AX: aria-rowspan value should be ignored if td/th rowspan value is provided
https://bugs.webkit.org/show_bug.cgi?id=171214

Reviewed by Chris Fleizach.

Source/WebCore:

Return -1 in AccessibilityTableCell::ariaColumnSpan() and ariaRowSpan() if the
cell element has an explicit value for the native host language's span attribute.
Add checks to AccessibilityTableCell::columnIndexRange() and rowIndexRange() so
that we prefer an author-provided ARIA span value over an implicit host-language
span value. Similarly, add checks to AccessibilityARIAGridCell::columnIndexRange()
and rowIndexRange() so that we fall back on implicit host-language span values
when there is no author-provided ARIA span value and the ARIA cell is associated
with a cell element.

Test: accessibility/aria-cellspans-with-native-cellspans.html

* accessibility/AccessibilityARIAGridCell.cpp:
(WebCore::AccessibilityARIAGridCell::ariaRowSpanWithRowIndex):
(WebCore::AccessibilityARIAGridCell::columnIndexRange):
* accessibility/AccessibilityTableCell.cpp:
(WebCore::AccessibilityTableCell::rowIndexRange):
(WebCore::AccessibilityTableCell::columnIndexRange):
(WebCore::AccessibilityTableCell::ariaColumnSpan):
(WebCore::AccessibilityTableCell::ariaRowSpan):

LayoutTests:

* accessibility/aria-cellspans-with-native-cellspans-expected.txt: Added.
* accessibility/aria-cellspans-with-native-cellspans.html: Added.

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

2 years agoREGRESSION (r215630): Web Inspector: Option-Click on URL in Styles sidebar does not...
webkit@devinrousso.com [Thu, 4 May 2017 01:39:45 +0000 (01:39 +0000)]
REGRESSION (r215630): Web Inspector: Option-Click on URL in Styles sidebar does not work
https://bugs.webkit.org/show_bug.cgi?id=171569

Reviewed by Joseph Pecoraro.

* UserInterface/Views/CSSStyleDeclarationTextEditor.js:
(WebInspector.SourceCodeTextEditor.prototype.tokenTrackingControllerHighlightedRangeWasClicked):
Add missing `frame` parameter to `WebInspector.openURL`.

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

2 years ago[Cocoa] Stop exporting symbols for ivars that were made private
commit-queue@webkit.org [Thu, 4 May 2017 01:37:45 +0000 (01:37 +0000)]
[Cocoa] Stop exporting symbols for ivars that were made private
https://bugs.webkit.org/show_bug.cgi?id=171631

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2017-05-03
Reviewed by Dan Bernstein.

* WebKit.exp:

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

2 years agoMark http/tests/xmlhttprequest/methods.html as flaky.
ryanhaddad@apple.com [Thu, 4 May 2017 01:20:54 +0000 (01:20 +0000)]
Mark http/tests/xmlhttprequest/methods.html as flaky.
https://bugs.webkit.org/show_bug.cgi?id=171638

Unreviewed test gardening.

Patch by Matt Lewis <jlewis3@apple.com> on 2017-05-03

* platform/ios-wk2/TestExpectations:

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

2 years agoMark scrollingcoordinator/ios/nested-fixed-layer-positions.html as flaky.
ryanhaddad@apple.com [Thu, 4 May 2017 01:17:06 +0000 (01:17 +0000)]
Mark scrollingcoordinator/ios/nested-fixed-layer-positions.html as flaky.
https://bugs.webkit.org/show_bug.cgi?id=171628

Unreviewed test gardening.

* platform/ios-wk2/TestExpectations:

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

2 years agoUnreviewed, rolling out r216160 and r216161.
ryanhaddad@apple.com [Thu, 4 May 2017 01:00:27 +0000 (01:00 +0000)]
Unreviewed, rolling out r216160 and r216161.
https://bugs.webkit.org/show_bug.cgi?id=171640

These changes broke the iOS build. (Requested by mlewis13 on
#webkit).

Reverted changesets:

"[MediaStream] Allow host application to enable/disable media
capture"
https://bugs.webkit.org/show_bug.cgi?id=171292
http://trac.webkit.org/changeset/216160

"[MediaStream] Allow host application to enable/disable media
capture"
https://bugs.webkit.org/show_bug.cgi?id=171292
http://trac.webkit.org/changeset/216161

Patch by Commit Queue <commit-queue@webkit.org> on 2017-05-03

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

2 years ago[MediaStream] Allow host application to enable/disable media capture
eric.carlson@apple.com [Thu, 4 May 2017 00:27:17 +0000 (00:27 +0000)]
[MediaStream] Allow host application to enable/disable media capture
https://bugs.webkit.org/show_bug.cgi?id=171292
<rdar://problem/31821492>

Unreviewed build fix.

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::clearUserMediaState):
* UIProcess/WebPageProxy.h:

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

2 years ago[MediaStream] Allow host application to enable/disable media capture
eric.carlson@apple.com [Thu, 4 May 2017 00:03:29 +0000 (00:03 +0000)]
[MediaStream] Allow host application to enable/disable media capture
https://bugs.webkit.org/show_bug.cgi?id=171292
<rdar://problem/31821492>

Reviewed by Jer Noble.

Source/WebCore:

No new layout tests, added an API test instead.

* Modules/mediastream/MediaStream.cpp:
(WebCore::MediaStream::endStream): New, stop all tracks.
* Modules/mediastream/MediaStream.h:

* Modules/mediastream/MediaStreamRegistry.cpp:
(WebCore::MediaStreamRegistry::unregisterStream): Minor cleanup.
(WebCore::MediaStreamRegistry::forEach): New, call the lambda with each stream.
(WebCore::MediaStreamRegistry::MediaStreamRegistry): Deleted, unused.
* Modules/mediastream/MediaStreamRegistry.h:

* Modules/mediastream/MediaStreamTrack.cpp:
(WebCore::MediaStreamTrack::stopTrack): Add parameter so caller can specify if an 'ended'
event should be sent or not.
(WebCore::MediaStreamTrack::trackMutedChanged): Don't post an event if the track has ended.
* Modules/mediastream/MediaStreamTrack.h:

* dom/Document.cpp:
(WebCore::Document::stopMediaCapture): Stop all streams in the document.
* dom/Document.h:

* page/Page.cpp:
(WebCore::Page::stopMediaCapture): Stop all streams.
* page/Page.h:

* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::currentDisplayMode): Display a black frame
when the stream ends.
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::activeStatusChanged): Signal a characteristics
change to HTMLMediaElement refresh state.
* platform/mediastream/MediaStreamPrivate.h:

* platform/mediastream/mac/AVMediaCaptureSource.mm:
(WebCore::AVMediaCaptureSource::stopProducingData): Don't return early if the session isn't
running, we always need to clear m_session on iOS.

Source/WebKit2:

* UIProcess/API/C/WKPage.cpp:
(WKPageSetMediaCaptureEnabled): New.
(WKPageGetMediaCaptureEnabled): New.
(WKPageClearUserMediaState): Deleted, unused.
* UIProcess/API/C/WKPagePrivate.h:

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _setMediaCaptureEnabled:]): New.
(-[WKWebView _mediaCaptureEnabled]): New.
* UIProcess/API/Cocoa/WKWebViewPrivate.h:

* UIProcess/Cocoa/UIDelegate.mm:
(WebKit::UIDelegate::setDelegate): Initialize webViewRequestUserMediaAuthorizationForDevicesURLMainFrameURLDecisionHandler
and webViewCheckUserMediaPermissionForURLMainFrameURLFrameIdentifierDecisionHandler on macOS
and iOS.

* UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
(WebKit::UserMediaPermissionRequestManagerProxy::UserMediaPermissionRequestManagerProxy):
Initialize the rejection timer.
(WebKit::UserMediaPermissionRequestManagerProxy::~UserMediaPermissionRequestManagerProxy):
Call invalidatePendingRequests.
(WebKit::UserMediaPermissionRequestManagerProxy::invalidatePendingRequests): Invalidate all
pending requests.
(WebKit::UserMediaPermissionRequestManagerProxy::stopCapture): New.
(WebKit::UserMediaPermissionRequestManagerProxy::rejectionTimerFired): Reject a promise and
schedule the timer if there are any others pending.
(WebKit::UserMediaPermissionRequestManagerProxy::scheduleNextRejection):
(WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame): Don't
prompt the user if capture is disabled.
(WebKit::UserMediaPermissionRequestManagerProxy::invalidateRequests): Deleted.
(WebKit::UserMediaPermissionRequestManagerProxy::clearCachedState): Deleted.
* UIProcess/UserMediaPermissionRequestManagerProxy.h:

* UIProcess/UserMediaProcessManager.cpp:
(WebKit::UserMediaProcessManager::willEnableMediaStreamInPage): Stop capture in the current
page on iOS.
(WebKit::UserMediaProcessManager::setCaptureEnabled):
* UIProcess/UserMediaProcessManager.h:

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::setMediaCaptureEnabled):
(WebKit::WebPageProxy::clearUserMediaState): Deleted.

* UIProcess/WebPageProxy.h:
(WebKit::WebPageProxy::mediaCaptureEnabled):

* WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp:
(WebKit::UserMediaPermissionRequestManager::cancelPendingRequests): New, cancel all pending
requests.
(WebKit::UserMediaPermissionRequestManager::cancelUserMediaRequest): Deny the request.
(WebKit::UserMediaPermissionRequestManager::cancelMediaDevicesEnumeration):
* WebProcess/MediaStream/UserMediaPermissionRequestManager.h:

* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::stopMediaCapture):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:

Tools:

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKit2Cocoa/UserMediaDisabled.mm: Added.
(-[UserMediaMessageHandler userContentController:didReceiveScriptMessage:]):
(-[UserMediaUIDelegate _webView:requestUserMediaAuthorizationForDevices:url:mainFrameURL:decisionHandler:]):
(-[UserMediaUIDelegate _webView:checkUserMediaPermissionForURL:mainFrameURL:frameIdentifier:decisionHandler:]):
(MediaCaptureDisabledTest::SetUp):
(MediaCaptureDisabledTest::loadTestAndWaitForMessage):
(TEST_F):
* TestWebKitAPI/Tests/WebKit2Cocoa/disableGetUserMedia.html: Added.

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

2 years agoSearchInputType could end up with a mismatched renderer.
zalan@apple.com [Wed, 3 May 2017 23:57:18 +0000 (23:57 +0000)]
SearchInputType could end up with a mismatched renderer.
https://bugs.webkit.org/show_bug.cgi?id=171547
<rdar://problem/31935047>

Reviewed by Antti Koivisto.

Source/WebCore:

Normally we've got the correct renderer by the time we call into SearchInputType.
However, since HTMLInputElement::updateType() eagerly updates the type while the associated renderers are done lazily
(so we don't get them updated until after the next tree update), we could actually end up
with a mismatched renderer (e.g. through form submission).

Test: fast/forms/change-input-type-and-submit-form-crash.html

* html/SearchInputType.cpp:
(WebCore::SearchInputType::addSearchResult):
(WebCore::SearchInputType::didSetValueByUserEdit):

LayoutTests:

* fast/forms/change-input-type-and-submit-form-crash-expected.txt: Added.
* fast/forms/change-input-type-and-submit-form-crash.html: Added.

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

2 years ago[WebCrypto] Add an api test for testing wrapping/unwrapping serialized crypto keys
jiewen_tan@apple.com [Wed, 3 May 2017 23:50:38 +0000 (23:50 +0000)]
[WebCrypto] Add an api test for testing wrapping/unwrapping serialized crypto keys
https://bugs.webkit.org/show_bug.cgi?id=171350
<rdar://problem/28600836>

Patched by Brady Eidson.

Reviewed by Brent Fulgham.

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKit2/NavigationClientDefaultCrypto.cpp: Added.
(TestWebKitAPI::runJavaScriptAlert):
(TestWebKitAPI::decidePolicyForNavigationAction):
(TestWebKitAPI::decidePolicyForNavigationResponse):
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WebKit2/navigation-client-default-crypto.html: Added.

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

2 years agoMake the VPIO audio unit a singleton, shared between multiple CaptureSources
jer.noble@apple.com [Wed, 3 May 2017 23:50:18 +0000 (23:50 +0000)]
Make the VPIO audio unit a singleton, shared between multiple CaptureSources
https://bugs.webkit.org/show_bug.cgi?id=171622

Reviewed by Eric Carlson.

Move the implemnetation of CoreAudioCaptureSource into a shared singleton class, CoreAudioSharedUnit,
which will send audio to each of it's client CoreAudioCaptureSources. The first registered client will
define the settings used by the shared unit.

Drive-by fixes: Fix up setUseAVFoundationAudioCapture() to always accept the first value set.

* platform/mediastream/mac/CoreAudioCaptureSource.cpp:
(WebCore::CoreAudioSharedUnit::isProducingData):
(WebCore::CoreAudioSharedUnit::microphoneFormat):
(WebCore::CoreAudioSharedUnit::singleton):
(WebCore::CoreAudioSharedUnit::addClient):
(WebCore::CoreAudioSharedUnit::removeClient):
(WebCore::CoreAudioSharedUnit::addEchoCancellationSource):
(WebCore::CoreAudioSharedUnit::removeEchoCancellationSource):
(WebCore::CoreAudioSharedUnit::preferredIOBufferSize):
(WebCore::CoreAudioSharedUnit::setupAudioUnits):
(WebCore::CoreAudioSharedUnit::configureMicrophoneProc):
(WebCore::CoreAudioSharedUnit::configureSpeakerProc):
(WebCore::CoreAudioSharedUnit::checkTimestamps):
(WebCore::CoreAudioSharedUnit::provideSpeakerData):
(WebCore::CoreAudioSharedUnit::speakerCallback):
(WebCore::CoreAudioSharedUnit::processMicrophoneSamples):
(WebCore::CoreAudioSharedUnit::microphoneCallback):
(WebCore::CoreAudioSharedUnit::cleanupAudioUnits):
(WebCore::CoreAudioSharedUnit::startProducingData):
(WebCore::CoreAudioSharedUnit::stopProducingData):
(WebCore::CoreAudioSharedUnit::suspend):
(WebCore::CoreAudioSharedUnit::defaultInputDevice):
(WebCore::CoreAudioCaptureSource::create):
(WebCore::CoreAudioCaptureSource::factory):
(WebCore::CoreAudioCaptureSource::CoreAudioCaptureSource):
(WebCore::CoreAudioCaptureSource::~CoreAudioCaptureSource):
(WebCore::CoreAudioCaptureSource::addEchoCancellationSource):
(WebCore::CoreAudioCaptureSource::removeEchoCancellationSource):
(WebCore::CoreAudioCaptureSource::startProducingData):
(WebCore::CoreAudioCaptureSource::stopProducingData):
(WebCore::CoreAudioCaptureSource::audioSourceProvider):
(WebCore::CoreAudioCaptureSource::preferredSampleRate): Deleted.
(WebCore::CoreAudioCaptureSource::preferredIOBufferSize): Deleted.
(WebCore::CoreAudioCaptureSource::configureMicrophoneProc): Deleted.
(WebCore::CoreAudioCaptureSource::configureSpeakerProc): Deleted.
(WebCore::CoreAudioCaptureSource::checkTimestamps): Deleted.
(WebCore::CoreAudioCaptureSource::provideSpeakerData): Deleted.
(WebCore::CoreAudioCaptureSource::speakerCallback): Deleted.
(WebCore::CoreAudioCaptureSource::processMicrophoneSamples): Deleted.
(WebCore::CoreAudioCaptureSource::microphoneCallback): Deleted.
(WebCore::CoreAudioCaptureSource::cleanupAudioUnits): Deleted.
(WebCore::CoreAudioCaptureSource::defaultInputDevice): Deleted.
(WebCore::CoreAudioCaptureSource::setupAudioUnits): Deleted.
(WebCore::CoreAudioCaptureSource::suspend): Deleted.
(WebCore::CoreAudioCaptureSource::resume): Deleted.
* platform/mediastream/mac/CoreAudioCaptureSource.h:
* platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp:
(WebCore::RealtimeMediaSourceCenterMac::setUseAVFoundationAudioCapture):

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

2 years agogetUserMedia() fails because devices list is empty / inactive
jer.noble@apple.com [Wed, 3 May 2017 23:48:35 +0000 (23:48 +0000)]
getUserMedia() fails because devices list is empty / inactive
https://bugs.webkit.org/show_bug.cgi?id=171626

Reviewed by Eric Carlson.

When creating a AVAudioSessionCaptureDevice, set the device's enabled state to true if the port description
has any items in its dataSources property (which is the best analogue to "isActive" we have in AVAudioSession).

Also, when creating the generic list of CaptureDevices, use the copy constructor to ensure the enabled state
gets copied to the new generic device.

* platform/mediastream/ios/AVAudioSessionCaptureDevice.mm:
(WebCore::AVAudioSessionCaptureDevice::create):
* platform/mediastream/ios/AVAudioSessionCaptureDeviceManager.mm:
(WebCore::AVAudioSessionCaptureDeviceManager::refreshAudioCaptureDevices):

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

2 years agoImplement the imageready event to reliably test the async image decoding
commit-queue@webkit.org [Wed, 3 May 2017 23:21:12 +0000 (23:21 +0000)]
Implement the imageready event to reliably test the async image decoding
https://bugs.webkit.org/show_bug.cgi?id=171016

Patch by Said Abou-Hallawa <sabouhallawa@apple.com> on 2017-05-03
Reviewed by Simon Fraser.

The event will be fired for each client of the image. Firing the event
will happen after finishing the decoding and repainting the client.

Existing tests will be modified in a separate patch to use this event.

* dom/Element.cpp:
(WebCore::Element::dispatchWebKitImageReadyEventForTesting):
* dom/Element.h:
* page/Settings.in:
* rendering/RenderElement.cpp:
(WebCore::RenderElement::imageFrameAvailable):

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

2 years agoMark media/modern-media-controls/slider/slider-styles.html as flaky on mac-wk1.
ryanhaddad@apple.com [Wed, 3 May 2017 23:07:24 +0000 (23:07 +0000)]
Mark media/modern-media-controls/slider/slider-styles.html as flaky on mac-wk1.
https://bugs.webkit.org/show_bug.cgi?id=171629

Unreviewed test gardening.

* platform/mac-wk1/TestExpectations:

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

2 years agoMaintain interaction information URL as a URL, not a string
timothy_horton@apple.com [Wed, 3 May 2017 23:00:02 +0000 (23:00 +0000)]
Maintain interaction information URL as a URL, not a string
https://bugs.webkit.org/show_bug.cgi?id=171623

Reviewed by Simon Fraser.

No new tests, not a behavior change.

* platform/URL.h:

* Shared/ios/InteractionInformationAtPosition.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _showAttachmentSheet]):
(-[WKContentView _interactionShouldBeginFromPreviewItemController:forPosition:]):
(-[WKContentView _dataForPreviewItemController:atPosition:type:]):
* UIProcess/ios/WKPDFView.mm:
(-[WKPDFView annotation:isBeingPressedAtPoint:controller:]):
(-[WKPDFView actionSheetAssistant:performAction:]):
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::getPositionInformation):

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

2 years agoUse the CLoop for CPU(ARM64E).
mark.lam@apple.com [Wed, 3 May 2017 22:36:29 +0000 (22:36 +0000)]
Use the CLoop for CPU(ARM64E).
https://bugs.webkit.org/show_bug.cgi?id=171620
<rdar://problem/31973027>

Reviewed by Geoffrey Garen.

Source/JavaScriptCore:

* llint/LLIntOfflineAsmConfig.h:
* tools/SigillCrashAnalyzer.cpp:
(JSC::SigillCrashAnalyzer::dumpCodeBlock):

Source/WTF:

* wtf/Platform.h:

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

2 years agoLayoutTest http/tests/inspector/network/fetch-network-data.html is a flaky timeout
commit-queue@webkit.org [Wed, 3 May 2017 22:30:38 +0000 (22:30 +0000)]
LayoutTest http/tests/inspector/network/fetch-network-data.html is a flaky timeout
https://bugs.webkit.org/show_bug.cgi?id=166038
<rdar://problem/29488489>

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2017-05-03
Reviewed by Matt Baker.

* platform/mac/TestExpectations:
* http/tests/inspector/network/fetch-network-data.html:
* http/tests/inspector/network/xhr-request-data-encoded-correctly.html:
Use singleFireEventListener instead of awaitEvent so that the follow-up event handlers
can be added synchronously instead of in a microtask. When the microtask happened later
than other incoming events then the follow-up handlers would have been added too late.

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

2 years agoMark imported/w3c/web-platform-tests/html/webappapis/timers/negative-settimeout.html...
ryanhaddad@apple.com [Wed, 3 May 2017 22:26:43 +0000 (22:26 +0000)]
Mark imported/w3c/web-platform-tests/html/webappapis/timers/negative-settimeout.html as flaky.
https://bugs.webkit.org/show_bug.cgi?id=170699.

Unreviewed test gardening.

Patch by Matt Lewis <jlewis3@apple.com> on 2017-05-03

* platform/ios-wk2/TestExpectations:

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

2 years ago[JSC] remove unneeded asyncFunctionTests.yaml
caitp@igalia.com [Wed, 3 May 2017 22:15:57 +0000 (22:15 +0000)]
[JSC] remove unneeded asyncFunctionTests.yaml
https://bugs.webkit.org/show_bug.cgi?id=171611

Reviewed by Yusuke Suzuki.

Async functions have shipped, and those tests are run as part of
JSTests/stress and JSTests/test262.yaml. The file is no longer needed.

* asyncFunctionTests.yaml: Removed.
* stress/async-await-long-loop.js:
* stress/async-await-throw-loop.js:

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

2 years agoUncaught Exception: Can't make a ContentView for an unknown representedObject of...
nvasilyev@apple.com [Wed, 3 May 2017 22:13:26 +0000 (22:13 +0000)]
Uncaught Exception: Can't make a ContentView for an unknown representedObject of type: IndexedDatabase
https://bugs.webkit.org/show_bug.cgi?id=167473
<rdar://problem/30249715>

Reviewed by Matt Baker.

When an indexed database is selected in the Storage navigation sidebar, show its host, security origin, and version.

Previously, selecting an indexed database didn't change the content view. It could lead to a misleading state
when an indexed database is selected in the sidebar, but the content view showed previously selected item such as
Cookies or Local Storage.

* UserInterface/Main.html:
* UserInterface/Views/ContentView.css:
(.content-view .details-section):
(.content-view .details-section > .content):
(.content-view .details-section > .content > .group > .row.simple > .label):
(.content-view .details-section:last-child):
* UserInterface/Views/ContentView.js:
(WebInspector.ContentView.createFromRepresentedObject):
(WebInspector.ContentView.isViewable):
* UserInterface/Views/IndexedDatabaseContentView.css: Added.
(.indexed-database.content-view):
(.indexed-database.content-view .indexed-database-details):
(.indexed-database.content-view .details-section > .header):
* UserInterface/Views/IndexedDatabaseContentView.js: Added.
(WebInspector.IndexedDatabaseContentView):
* UserInterface/Views/IndexedDatabaseDetailsSidebarPanel.js:
(WebInspector.IndexedDatabaseDetailsSidebarPanel.prototype.inspect):
Don't show the details sidebar for IndexedDB top level item since it has the same content as the content view.

* UserInterface/Views/StorageSidebarPanel.js:
(WebInspector.StorageSidebarPanel._treeSelectionDidChange):
* UserInterface/Views/StorageTabContentView.js:
(WebInspector.StorageTabContentView.prototype.canShowRepresentedObject):
(WebInspector.StorageTabContentView):

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

2 years agoHave WKWebView call _updateVisibleContentRects for the current transaction if possibl...
simon.fraser@apple.com [Wed, 3 May 2017 22:04:18 +0000 (22:04 +0000)]
Have WKWebView call _updateVisibleContentRects for the current transaction if possible, rather than always delaying
https://bugs.webkit.org/show_bug.cgi?id=171619
Source/WebKit2:

Also fixes webkit.org/b/170153 and webkit.org/b/170195

Reviewed by Tim Horton.

In r214391 we started adding the pre-commit handler in a dispatch_async() to ensure that
the handler would always run, since we couldn't reliably test the phase of the current
transaction. Now that problem has been solved (rdar://problem/31253952) we can go back to
checking the transaction phase on newer iOS versions. If we're too late for the current transaction
we still need to dispatch_async() to get into the next one.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _addUpdateVisibleContentRectPreCommitHandler]):
(-[WKWebView _scheduleVisibleContentRectUpdateAfterScrollInView:]):

Tools:

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

Reviewed by Tim Horton.

Re-enable WebKit2.ResizeWithHiddenContentDoesNotHang.

* TestWebKitAPI/Tests/WebKit2Cocoa/AnimatedResize.mm:
(TEST):

LayoutTests:

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

Reviewed by Tim Horton.

These tests need to wait a bit for the scrolling state of the document to be updated.

* fast/scrolling/ios/touch-scroll-pointer-events-none.html:
* fast/scrolling/ios/touch-scroll-visibility-hidden.html:
* platform/ios-wk2/TestExpectations:

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

2 years agoREGRESSION (r216129): ASSERTION FAILED: m_process->state() == WebProcessProxy::State...
cdumez@apple.com [Wed, 3 May 2017 21:56:33 +0000 (21:56 +0000)]
REGRESSION (r216129): ASSERTION FAILED: m_process->state() == WebProcessProxy::State::Terminated
https://bugs.webkit.org/show_bug.cgi?id=171616

Reviewed by Brady Eidson.

Stop calling resetStateAfterProcessExited() in WebPageProxy::terminateProcess() as the call to
WebProcessProxy::requestTermination() already causes WebPageProxy::processDidCrash() to be called
after r216129. WebPageProxy::processDidCrash() already takes care of calling
resetStateAfterProcessExited().

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::terminateProcess):

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

2 years agoLink preload HTMLPreloadScanner support
yoav@yoav.ws [Wed, 3 May 2017 21:55:25 +0000 (21:55 +0000)]
Link preload HTMLPreloadScanner support
https://bugs.webkit.org/show_bug.cgi?id=170747

Reviewed by Youenn Fablet.

Source/WebCore:

Test: http/tests/preload/preloadscanner_download_resources.html

* html/parser/HTMLPreloadScanner.cpp:
(WebCore::TokenPreloadScanner::StartTagScanner::StartTagScanner): Initialize link preload flag.
(WebCore::TokenPreloadScanner::StartTagScanner::createPreloadRequest): Create a request only if the type is known (so ignore
preloads with unknown type).
(WebCore::TokenPreloadScanner::StartTagScanner::processAttribute): Add handling for link preload and the `as` attribute.
(WebCore::TokenPreloadScanner::StartTagScanner::relAttributeIsStyleSheet): Get LinkRelAttribute as input.
(WebCore::TokenPreloadScanner::StartTagScanner::resourceType): Return an std::optional, in case the preload type is unknown.
(WebCore::TokenPreloadScanner::StartTagScanner::shouldPreload): Return true for the link preload case.
* loader/cache/CachedResourceLoader.cpp:
(WebCore::CachedResourceLoader::preload): Return the resource rather than a nullptr if it's already in m_preloads.

LayoutTests:

* http/tests/preload/preloadscanner_download_resources-expected.txt: Added.
* http/tests/preload/preloadscanner_download_resources.html: Added.

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

2 years agoMark http/tests/preload/single_download_preload.html as flaky.
ryanhaddad@apple.com [Wed, 3 May 2017 21:36:50 +0000 (21:36 +0000)]
Mark http/tests/preload/single_download_preload.html as flaky.
https://bugs.webkit.org/show_bug.cgi?id=171331

Unreviewed test gardening.

* platform/ios-wk2/TestExpectations:

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

2 years agoMark perf/object-keys.html as flaky
ryanhaddad@apple.com [Wed, 3 May 2017 21:20:15 +0000 (21:20 +0000)]
Mark perf/object-keys.html as flaky
https://bugs.webkit.org/show_bug.cgi?id=171617

Unreviewed test gardening.

Patch by Matt Lewis <jlewis3@apple.com> on 2017-05-03

* platform/ios-wk2/TestExpectations:

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

2 years agoYouTube user agent quirk breaks new YouTube
mcatanzaro@igalia.com [Wed, 3 May 2017 20:51:01 +0000 (20:51 +0000)]
YouTube user agent quirk breaks new YouTube
https://bugs.webkit.org/show_bug.cgi?id=171603

Reviewed by Carlos Garcia Campos.

Source/WebCore:

Our user agent quirk to make YouTube 360 work breaks the new YouTube UI, causing it to
attempt to use the obsolete custom elements v0 API. WebKit only supports the v1 API. We
have to remove this quirk.

Note this does not affect Safari as Apple ports don't use our user agent quirks.

* platform/UserAgentQuirks.cpp:
(WebCore::urlRequiresChromeBrowser):

Tools:

Remove the YouTube quirk test.

* TestWebKitAPI/Tests/WebCore/UserAgentQuirks.cpp:
(TestWebKitAPI::TEST):

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

2 years agoWeb Inspector: 404 Image Load does not appear as a failure in Web Inspector
commit-queue@webkit.org [Wed, 3 May 2017 20:36:27 +0000 (20:36 +0000)]
Web Inspector: 404 Image Load does not appear as a failure in Web Inspector
https://bugs.webkit.org/show_bug.cgi?id=171587
<rdar://problem/13222846>

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2017-05-03
Reviewed by Matt Baker.

Source/WebCore:

* inspector/InspectorPageAgent.h:
* inspector/InspectorPageAgent.cpp:
(WebCore::InspectorPageAgent::cachedResourceContent):
(WebCore::prepareCachedResourceBuffer): Deleted.
Inline the function to make this less confusing.

(WebCore::InspectorPageAgent::buildObjectForFrameTree):
Treat a DecodeError as a failure.

Source/WebInspectorUI:

* UserInterface/Models/Resource.js:
(WebInspector.Resource.prototype.createObjectURL):
This may return null if the data is not a Blob. This can happen if we
loaded non-base64Encoded text content for an Image. Such as a 404 response.

(WebInspector.Resource.prototype.hadLoadingError):
Consistent way to check for any kind of loading error.

(WebInspector.Resource.prototype.getImageSize):
Handle failure to create an object URL.

* UserInterface/Views/FontResourceContentView.js:
(WebInspector.FontResourceContentView.prototype.contentAvailable):
* UserInterface/Views/ImageResourceContentView.js:
(WebInspector.ImageResourceContentView.prototype.contentAvailable):
Handle failure to create an object URL.

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

2 years agoDifferent behaviour with the .sort(callback) method (unlike Firefox & Chrome)
keith_miller@apple.com [Wed, 3 May 2017 20:33:01 +0000 (20:33 +0000)]
Different behaviour with the .sort(callback) method (unlike Firefox & Chrome)
https://bugs.webkit.org/show_bug.cgi?id=47825

Reviewed by Saam Barati.

JSTests:

* stress/sorting-boolean-result-comparator.js: Added.
(checkArray):

Source/JavaScriptCore:

This patch makes our sort function match the behavior of Firefox
and Chrome when the result of the comparison function is a
boolean. When we first switched to using merge sort, it regressed
JQuery sorting of DOM nodes by 30%. The regression was do to the
fact that JQuery was using compareDocumentPosition to compare the
locations of objects. Since one of the benchmarks would pass a
reverse sorted list to the sort function we would end up walking
the entire DOM to do comparisons. The solution to this was to
merge based on comparison(right, left) rather than
comparison(left, right). Although, in practice this does nothing
since sort could just as easily receive an already sorted list and
we're back in the same spot.

The downside of sorting with comparison(right, left) is that to
maintain stability when sorting, you only want to merge from right
when the comparison function returns a negative value. This is
where the problem with booleans comes in. Since booleans toNumber
false to 0 and true to 1 both values are "equal". This patch fixes
this by special casing boolean return values.

* builtins/ArrayPrototype.js:
(sort.merge):

LayoutTests:

Fix broken test.

* http/tests/inspector/worker/blob-script-with-cross-domain-imported-scripts-expected.txt:

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

2 years agoMark http/tests/xmlhttprequest/supported-xml-content-types.html as flaky.
ryanhaddad@apple.com [Wed, 3 May 2017 20:28:28 +0000 (20:28 +0000)]
Mark http/tests/xmlhttprequest/supported-xml-content-types.html as flaky.
https://bugs.webkit.org/show_bug.cgi?id=171613

Unreviewed test gardening.

Patch by Matt Lewis <jlewis3@apple.com> on 2017-05-03

* platform/ios-wk2/TestExpectations:

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

2 years agoAsync image decoding should be disabled for snapshots, printing and preview
commit-queue@webkit.org [Wed, 3 May 2017 19:43:42 +0000 (19:43 +0000)]
Async image decoding should be disabled for snapshots, printing and preview
https://bugs.webkit.org/show_bug.cgi?id=171467
Source/WebCore:

Patch by Said Abou-Hallawa <sabouhallawa@apple.com> on 2017-05-03
Reviewed by Simon Fraser.

Asynchronous image decoding should only be used for window display where
RenderElements can be repainted and painted. For cases where there is only
one chance to draw the image, synchronous decoding should be used.

* rendering/RenderBoxModelObject.cpp:
(WebCore::RenderBoxModelObject::paintFillLayerExtended):
* rendering/RenderImage.cpp:
(WebCore::RenderImage::paintIntoRect):

Tools:

Patch by Said Abou-Hallawa <sabouhallawa@apple.com> on 2017-05-03
Reviewed by Simon Fraser.

Add a API test for snapshotting with large images. Ensure the images are
drawn correctly which implies they should have been synchronously decoded.

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKit2/large-red-square-image.html: Added.
* TestWebKitAPI/Tests/WebKit2Cocoa/WKWebViewSnapshot.mm:
(TEST):

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

2 years agoAX: VO skips cells after cell with aria-colspan
n_wang@apple.com [Wed, 3 May 2017 19:33:19 +0000 (19:33 +0000)]
AX: VO skips cells after cell with aria-colspan
https://bugs.webkit.org/show_bug.cgi?id=171579

Reviewed by Chris Fleizach.

Source/WebCore:

We should consider the previous cells' column span value when
calculating the column index.

Test: accessibility/mac/aria-grid-column-span.html

* accessibility/AccessibilityARIAGridCell.cpp:
(WebCore::AccessibilityARIAGridCell::columnIndexRange):

LayoutTests:

* accessibility/mac/aria-grid-column-span-expected.txt: Added.
* accessibility/mac/aria-grid-column-span.html: Added.

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

2 years agoASSERTION FAILED: m_scriptExecutionContext->isContextThread() seen with LayoutTest...
jiewen_tan@apple.com [Wed, 3 May 2017 19:27:09 +0000 (19:27 +0000)]
ASSERTION FAILED: m_scriptExecutionContext->isContextThread() seen with LayoutTest crypto/workers/crypto-random-values-limits-worker.html
https://bugs.webkit.org/show_bug.cgi?id=171462
<rdar://problem/31906859>

Reviewed by Brent Fulgham.

Covered by existing tests.

* workers/WorkerGlobalScope.cpp:
(WebCore::WorkerGlobalScope::~WorkerGlobalScope):
Clear Crypto early in destruction since its ContextDestructionObserver
destruction makes checks about the WorkerThread.

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

2 years agoHandle KVO updating of the "hasOnlySecureContent" before a page results in an HTTP...
beidson@apple.com [Wed, 3 May 2017 19:27:06 +0000 (19:27 +0000)]
Handle KVO updating of the "hasOnlySecureContent" before a page results in an HTTP auth challenge.
https://bugs.webkit.org/show_bug.cgi?id=171607

Reviewed by Andy Estes.

To test this fix we'd need the combination of an HTTPD inside API tests, so no test for now.

* UIProcess/PageLoadState.cpp:
(WebKit::PageLoadState::hasOnlySecureContent): If the state is provisional, check the provisional URL instead.

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

2 years agoRenderSearchField should not use isTextField() in SPECIALIZE_TYPE_TRAITS_RENDER_OBJECT
zalan@apple.com [Wed, 3 May 2017 19:17:19 +0000 (19:17 +0000)]
RenderSearchField should not use isTextField() in SPECIALIZE_TYPE_TRAITS_RENDER_OBJECT
https://bugs.webkit.org/show_bug.cgi?id=171608

Reviewed by Simon Fraser.

isTextField() is true for any generic single line text control.

* rendering/RenderObject.h:
(WebCore::RenderObject::isSearchField):
* rendering/RenderSearchField.h:

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

2 years agoRemove ScrollingCoordinator::supportsFixedPositionLayers()
commit-queue@webkit.org [Wed, 3 May 2017 19:02:44 +0000 (19:02 +0000)]
Remove ScrollingCoordinator::supportsFixedPositionLayers()
https://bugs.webkit.org/show_bug.cgi?id=171557

Patch by Frederic Wang <fwang@igalia.com> on 2017-05-03
Reviewed by Simon Fraser.

No new tests, behavior is not changed.

* page/FrameView.cpp:
(WebCore::FrameView::shouldUpdateCompositingLayersAfterScrolling):
* page/scrolling/AsyncScrollingCoordinator.cpp:
(WebCore::AsyncScrollingCoordinator::updateViewportConstrainedNode):
* page/scrolling/AsyncScrollingCoordinator.h:
* page/scrolling/ScrollingCoordinator.cpp:
(WebCore::ScrollingCoordinator::synchronousScrollingReasons):
* page/scrolling/ScrollingCoordinator.h:
(WebCore::ScrollingCoordinator::supportsFixedPositionLayers): Deleted.
* page/scrolling/coordinatedgraphics/ScrollingCoordinatorCoordinatedGraphics.cpp:
(WebCore::ScrollingCoordinatorCoordinatedGraphics::updateViewportConstrainedNode):
* page/scrolling/coordinatedgraphics/ScrollingCoordinatorCoordinatedGraphics.h:
(): Deleted.
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::updateScrollCoordinatedLayer):

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

2 years ago[WK2] Extend processDidCrash delegate to let the client know the reason for the crash
cdumez@apple.com [Wed, 3 May 2017 18:54:37 +0000 (18:54 +0000)]
[WK2] Extend processDidCrash delegate to let the client know the reason for the crash
https://bugs.webkit.org/show_bug.cgi?id=171565
<rdar://problem/31204417>

Reviewed by Sam Weinig.

Source/WebKit2:

Extend processDidCrash delegate to let the client know the reason for the crash. This
is needed by some clients to distinguish actual crashes from terminations due to
resource limits.

* Shared/ProcessCrashReason.h: Added.
* UIProcess/API/APINavigationClient.h:
(API::NavigationClient::processDidCrash):
* UIProcess/API/C/WKAPICast.h:
(WebKit::toAPI):
* UIProcess/API/C/WKPage.cpp:
(WKPageSetPageNavigationClient):
* UIProcess/API/C/WKPageNavigationClient.h:
* UIProcess/API/C/WKProcessCrashReason.h: Added.
* UIProcess/Cocoa/NavigationState.h:
* UIProcess/Cocoa/NavigationState.mm:
(WebKit::NavigationState::NavigationClient::processDidCrash):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::processDidCrash):
* UIProcess/WebPageProxy.h:
* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::didClose):
(WebKit::WebProcessProxy::requestTermination):
(WebKit::diagnosticLoggingKeyForTerminationReason):
(WebKit::toProcessCrashReason):
(WebKit::WebProcessProxy::terminateProcessDueToResourceLimits):
(WebKit::WebProcessProxy::didExceedActiveMemoryLimit):
(WebKit::WebProcessProxy::didExceedInactiveMemoryLimit):
(WebKit::WebProcessProxy::didExceedBackgroundCPULimit):
* UIProcess/WebProcessProxy.h:
* WebKit2.xcodeproj/project.pbxproj:

Tools:

Add API test coverage.

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKit2/ProcessDidCrashWithReason.cpp: Added.
(TestWebKitAPI::didFinishNavigation):
(TestWebKitAPI::didCrashWithReason):
(TestWebKitAPI::TEST):

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

2 years agoUse PassRefPtr less in CompositeEditCommand
cdumez@apple.com [Wed, 3 May 2017 18:41:47 +0000 (18:41 +0000)]
Use PassRefPtr less in CompositeEditCommand
https://bugs.webkit.org/show_bug.cgi?id=171590

Reviewed by Sam Weinig.

Use PassRefPtr less in CompositeEditCommand.

* CMakeLists.txt:
* WebCore.xcodeproj/project.pbxproj:
* editing/ApplyStyleCommand.cpp:
(WebCore::hasNoAttributeOrOnlyStyleAttribute):
(WebCore::isStyleSpanOrSpanWithOnlyStyleAttribute):
(WebCore::isSpanWithoutAttributesOrUnstyledStyleSpan):
(WebCore::isEmptyFontTag):
(WebCore::ApplyStyleCommand::doApply):
(WebCore::ApplyStyleCommand::applyBlockStyle):
(WebCore::ApplyStyleCommand::applyRelativeFontStyleChange):
(WebCore::dummySpanAncestorForNode):
(WebCore::ApplyStyleCommand::cleanupUnstyledAppleStyleSpans):
(WebCore::ApplyStyleCommand::removeEmbeddingUpToEnclosingBlock):
(WebCore::ApplyStyleCommand::applyInlineStyle):
(WebCore::ApplyStyleCommand::fixRangeAndApplyInlineStyle):
(WebCore::ApplyStyleCommand::applyInlineStyleToNodeRange):
(WebCore::ApplyStyleCommand::shouldApplyInlineStyleToRun):
(WebCore::ApplyStyleCommand::removeConflictingInlineStyleFromRun):
(WebCore::ApplyStyleCommand::removeInlineStyleFromElement):
(WebCore::ApplyStyleCommand::replaceWithSpanOrRemoveIfWithoutAttributes):
(WebCore::ApplyStyleCommand::removeImplicitlyStyledElement):
(WebCore::ApplyStyleCommand::removeCSSStyle):
(WebCore::ApplyStyleCommand::highestAncestorWithConflictingInlineStyle):
(WebCore::ApplyStyleCommand::pushDownInlineStyleAroundNode):
(WebCore::ApplyStyleCommand::removeInlineStyle):
(WebCore::ApplyStyleCommand::shouldSplitTextElement):
(WebCore::ApplyStyleCommand::mergeStartWithPreviousIfIdentical):
(WebCore::ApplyStyleCommand::mergeEndWithNextIfIdentical):
(WebCore::ApplyStyleCommand::surroundNodeRangeWithElement):
(WebCore::ApplyStyleCommand::addBlockStyle):
(WebCore::ApplyStyleCommand::joinChildTextNodes):
* editing/ApplyStyleCommand.h:
(WebCore::ApplyStyleCommand::shouldRemoveInlineStyleFromElement):
* editing/CompositeEditCommand.cpp:
(WebCore::CompositeEditCommand::removeChildrenInRange):
(WebCore::CompositeEditCommand::mergeIdenticalElements):
(WebCore::CompositeEditCommand::insertTextIntoNode):
(WebCore::CompositeEditCommand::deleteTextFromNode):
(WebCore::CompositeEditCommand::replaceTextInNode):
(WebCore::CompositeEditCommand::replaceSelectedTextInNode):
(WebCore::CompositeEditCommand::replaceTextInNodePreservingMarkers):
(WebCore::CompositeEditCommand::removeNodeAttribute):
(WebCore::CompositeEditCommand::rebalanceWhitespaceAt):
(WebCore::CompositeEditCommand::rebalanceWhitespaceOnTextSubstring):
(WebCore::CompositeEditCommand::prepareWhitespaceAtPositionForSplit):
(WebCore::CompositeEditCommand::deleteInsignificantText):
(WebCore::CompositeEditCommand::removePlaceholderAt):
(WebCore::CompositeEditCommand::cleanupAfterDeletion):
(WebCore::CompositeEditCommand::moveParagraphs):
* editing/CompositeEditCommand.h:
* editing/DeleteFromTextNodeCommand.cpp:
(WebCore::DeleteFromTextNodeCommand::DeleteFromTextNodeCommand):
(WebCore::DeleteFromTextNodeCommand::doApply):
(WebCore::DeleteFromTextNodeCommand::doUnapply):
(WebCore::DeleteFromTextNodeCommand::getNodesInCommand):
* editing/DeleteFromTextNodeCommand.h:
(WebCore::DeleteFromTextNodeCommand::create):
* editing/DeleteSelectionCommand.cpp:
(WebCore::DeleteSelectionCommand::deleteTextFromNode):
(WebCore::DeleteSelectionCommand::handleGeneralDelete):
(WebCore::DeleteSelectionCommand::fixupWhitespace):
* editing/DeleteSelectionCommand.h:
* editing/EditingAllInOne.cpp:
* editing/EditingStyle.cpp:
(WebCore::EditingStyle::removeStyleConflictingWithStyleOfNode):
(WebCore::elementMatchesAndPropertyIsNotInInlineStyleDecl):
(WebCore::EditingStyle::mergeInlineAndImplicitStyleOfElement):
(WebCore::EditingStyle::wrappingStyleForSerialization):
(WebCore::styleFromMatchedRulesForElement):
(WebCore::EditingStyle::mergeStyleFromRules):
(WebCore::EditingStyle::mergeStyleFromRulesForSerialization):
(WebCore::EditingStyle::removeStyleFromRulesAndContext):
(WebCore::EditingStyle::removePropertiesInElementDefaultStyle):
* editing/EditingStyle.h:
* editing/IndentOutdentCommand.cpp:
(WebCore::IndentOutdentCommand::tryIndentingAsListItem):
* editing/InsertIntoTextNodeCommand.cpp:
(WebCore::InsertIntoTextNodeCommand::InsertIntoTextNodeCommand):
(WebCore::InsertIntoTextNodeCommand::getNodesInCommand):
* editing/InsertIntoTextNodeCommand.h:
(WebCore::InsertIntoTextNodeCommand::create):
* editing/InsertLineBreakCommand.cpp:
(WebCore::InsertLineBreakCommand::doApply):
* editing/InsertListCommand.cpp:
(WebCore::InsertListCommand::mergeWithNeighboringLists):
(WebCore::InsertListCommand::listifyParagraph):
* editing/InsertParagraphSeparatorCommand.cpp:
(WebCore::InsertParagraphSeparatorCommand::doApply):
* editing/InsertTextCommand.cpp:
(WebCore::InsertTextCommand::performOverwrite):
(WebCore::InsertTextCommand::doApply):
(WebCore::InsertTextCommand::insertTab):
* editing/MergeIdenticalElementsCommand.cpp:
(WebCore::MergeIdenticalElementsCommand::MergeIdenticalElementsCommand):
(WebCore::MergeIdenticalElementsCommand::doApply):
(WebCore::MergeIdenticalElementsCommand::doUnapply):
(WebCore::MergeIdenticalElementsCommand::getNodesInCommand):
* editing/MergeIdenticalElementsCommand.h:
(WebCore::MergeIdenticalElementsCommand::create):
* editing/RemoveCSSPropertyCommand.cpp: Removed.
* editing/RemoveCSSPropertyCommand.h: Removed.
* editing/ReplaceSelectionCommand.cpp:
(WebCore::ReplaceSelectionCommand::removeRedundantStylesAndKeepStyleSpanInline):
(WebCore::ReplaceSelectionCommand::doApply):
(WebCore::ReplaceSelectionCommand::addSpacesForSmartReplace):
(WebCore::ReplaceSelectionCommand::mergeTextNodesAroundPosition):
* editing/markup.cpp:
(WebCore::StyledMarkupAccumulator::appendElement):
(WebCore::styleFromMatchedRulesAndInlineDecl):
(WebCore::createMarkupInternal):

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

2 years agoMark http/tests/websocket/tests/hybi/inspector/binary.html as flaky.
ryanhaddad@apple.com [Wed, 3 May 2017 17:54:26 +0000 (17:54 +0000)]
Mark http/tests/websocket/tests/hybi/inspector/binary.html as flaky.
https://bugs.webkit.org/show_bug.cgi?id=171553

Unreviewed test gardening.

* platform/mac-wk2/TestExpectations:

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

2 years agoDetach frame from document when entering page cache
dbates@webkit.org [Wed, 3 May 2017 17:52:30 +0000 (17:52 +0000)]
Detach frame from document when entering page cache
https://bugs.webkit.org/show_bug.cgi?id=166774
<rdar://problem/29904368>

Reviewed by Chris Dumez.

* TestExpectations: Unskip tests.
* fast/history/page-cache-after-window-open-expected.txt: Update expected result.
* fast/history/page-cache-after-window-open.html: Ditto.
* fast/history/page-cache-with-opener-expected.txt: Ditto.
* fast/history/page-cache-with-opener.html: Update test given its new expected behavior.
* fast/history/resources/page-cache-window-with-opener.html: Ditto.
* http/tests/security/xss-DENIED-click-and-form-submission-from-inactive-domwindow-expected.txt: Added.
* http/tests/security/xss-DENIED-click-and-form-submission-from-inactive-domwindow.html: Added.
* http/tests/security/xss-DENIED-script-inject-into-inactive-window-expected.txt: Added.
* http/tests/security/xss-DENIED-script-inject-into-inactive-window.html: Added.
* http/tests/security/xss-DENIED-script-inject-into-inactive-window2-expected.txt: Added.
* http/tests/security/xss-DENIED-script-inject-into-inactive-window2.html: Added.
* http/tests/security/xss-DENIED-script-inject-into-inactive-window3-expected.txt: Added.
* http/tests/security/xss-DENIED-script-inject-into-inactive-window3.html: Added.

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

2 years agoMarking three imported/w3c/web-platform-tests/webrtc test as flaky failures.
ryanhaddad@apple.com [Wed, 3 May 2017 17:51:16 +0000 (17:51 +0000)]
Marking three imported/w3c/web-platform-tests/webrtc test as flaky failures.
https://bugs.webkit.org/show_bug.cgi?id=171605

Unreviewed test gardening.

Patch by Matt Lewis <jlewis3@apple.com> on 2017-05-03

* platform/mac-wk2/TestExpectations:

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

2 years agoMarked test http/tests/local/blob/send-sliced-data-blob.html as flaky failure and...
ryanhaddad@apple.com [Wed, 3 May 2017 17:47:08 +0000 (17:47 +0000)]
Marked test http/tests/local/blob/send-sliced-data-blob.html as flaky failure and timeout.
https://bugs.webkit.org/show_bug.cgi?id=171564

Unreviewed test gardening.

Patch by Matt Lewis <jlewis3@apple.com> on 2017-05-03

* platform/ios-wk2/TestExpectations:

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

2 years agoAX: Treat cells with ARIA table cell properties as cells
jdiggs@igalia.com [Wed, 3 May 2017 17:18:43 +0000 (17:18 +0000)]
AX: Treat cells with ARIA table cell properties as cells
https://bugs.webkit.org/show_bug.cgi?id=171178

Reviewed by Chris Fleizach.

Source/WebCore:

Add the following checks to heuristics in AccessibilityTable::isDataTable():
1. If the author has provided a valid aria-rowcount or aria-colcount value on
   the table element, expose it as a data table.
2. If the author has provided a valid aria-colindex or aria-rowindex on the
   cell element, expose it as a data table.
3. If the author has provided a valid aria-rowindex on the row element, expose
   it as a data table.
4. If the author has provided a value for aria-colspan or aria-rowspan on a cell,
   expose it as a data table (even though we are supposed to ignore the value for
   the purpose of exposing the span via platform accessibility APIs)

Remove the heuristic that a table with only one cell is "not a good AXTable candidate."
It prevents us from ever doing the above checks.

Test: accessibility/minimal-table-with-aria-is-data-table.html

* accessibility/AccessibilityTable.cpp:
(WebCore::AccessibilityTable::isDataTable):

LayoutTests:

* accessibility/minimal-table-with-aria-is-data-table-expected.txt: Added.
* accessibility/minimal-table-with-aria-is-data-table.html: Added.
* platform/gtk/accessibility/minimal-table-with-aria-is-data-table-expected.txt: Added.

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

2 years ago[INTL] Support dashed values in unicode locale extensions
commit-queue@webkit.org [Wed, 3 May 2017 17:17:51 +0000 (17:17 +0000)]
[INTL] Support dashed values in unicode locale extensions
https://bugs.webkit.org/show_bug.cgi?id=171480

Patch by Andy VanWagoner <thetalecrafter@gmail.com> on 2017-05-03
Reviewed by JF Bastien.

Source/JavaScriptCore:

Implements the UnicodeExtensionSubtags operation and updates the ResolveLocale operation to use it.
This fixes locale extensions with values that include '-'. The following calendars work now:
ethiopic-amete-alem
islamic-umalqura
islamic-tbla
islamic-civil
islamic-rgsa

While updating IntlObject, the comments containing spec text were replaced with a single url at the
top of each function pointing to the relevant part of ECMA-402.

* runtime/IntlObject.cpp:
(JSC::unicodeExtensionSubTags): Added.
(JSC::resolveLocale): Updated to latest standard.

LayoutTests:

Added tests for calendar locale extensions that contain '-'.

* js/intl-datetimeformat-expected.txt:
* js/script-tests/intl-datetimeformat.js:

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

2 years ago[Cairo] Handle extended colors in gradients
carlosgc@webkit.org [Wed, 3 May 2017 17:06:37 +0000 (17:06 +0000)]
[Cairo] Handle extended colors in gradients
https://bugs.webkit.org/show_bug.cgi?id=171596

Reviewed by Michael Catanzaro.

Check if every gradient color step is an extended color and use asExtended() instead of getRGBA() in such case.

Fixes: css3/color/gradients.html

* platform/graphics/cairo/GradientCairo.cpp:
(WebCore::Gradient::platformGradient):

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

2 years agoAbandon the current load once the provisional loader detaches from the frame
dbates@webkit.org [Wed, 3 May 2017 16:58:04 +0000 (16:58 +0000)]
Abandon the current load once the provisional loader detaches from the frame
https://bugs.webkit.org/show_bug.cgi?id=171577
<rdar://problem/31581227>

Source/WebCore:

Reviewed by Brent Fulgham and Brady Eidson.

We detach all child frames as part of setting our document loader to the provisional
document loader when committing a load for a frame. Detaching child frames invokes
the unload event handler on the child frames that can run arbitrary JavaScript script.
Among other things, such script can initiate a new load in the frame whose current
load is being committed. We should stop processing the current load as soon as we
detect that updating our document loader has started a new provisional load.

Test: fast/loader/inner-iframe-loads-data-url-into-parent-on-unload-crash.html

* loader/FrameLoader.cpp:
(WebCore::FrameLoader::transitionToCommitted):

LayoutTests:

Reviewed by Brent Fulgham.

* fast/loader/inner-iframe-loads-data-url-into-parent-on-unload-crash-expected.txt: Added.
* fast/loader/inner-iframe-loads-data-url-into-parent-on-unload-crash.html: Added.

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

2 years agoCleanup: Remove out-of-date comment and null check from DocumentLoader::detachFromFrame()
dbates@webkit.org [Wed, 3 May 2017 16:52:42 +0000 (16:52 +0000)]
Cleanup: Remove out-of-date comment and null check from DocumentLoader::detachFromFrame()
https://bugs.webkit.org/show_bug.cgi?id=171604

Reviewed by Brady Eidson.

We no longer want to passively allow DocumentLoader::detachFromFrame() to be called twice.
It does not make sense to be called twice and should never be called twice. A release assert
in DocumentLoader::cancelPolicyCheckIfNeeded() (added in r187558) called by DocumentLoader::detachFromFrame()
enforces this invariant. Therefore we can remove the null check of DocumentLoader::m_frame
and the comment that explains the purpose of this null check from DocumentLoader::detachFromFrame().

* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::detachFromFrame):

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

2 years agoUnreviewed attempt to fix the Windows build after r216117.
ryanhaddad@apple.com [Wed, 3 May 2017 16:28:47 +0000 (16:28 +0000)]
Unreviewed attempt to fix the Windows build after r216117.
https://bugs.webkit.org/show_bug.cgi?id=171601

* css/CSSAllInOne.cpp:

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

2 years agoRename StyleInvalidationAnalysis to Style::Invalidator
antti@apple.com [Wed, 3 May 2017 14:04:21 +0000 (14:04 +0000)]
Rename StyleInvalidationAnalysis to Style::Invalidator
https://bugs.webkit.org/show_bug.cgi?id=171601

Reviewed by Žan Doberšek.

Also move it to the 'style' directory.

* CMakeLists.txt:
* WebCore.xcodeproj/project.pbxproj:
* css/StyleInvalidationAnalysis.cpp: Removed.
* css/StyleInvalidationAnalysis.h: Removed.
* dom/ExtensionStyleSheets.cpp:
* style/AttributeChangeInvalidation.cpp:
(WebCore::Style::AttributeChangeInvalidation::invalidateDescendants):
* style/ClassChangeInvalidation.cpp:
(WebCore::Style::ClassChangeInvalidation::invalidateDescendantStyle):
* style/StyleInvalidator.cpp: Copied from Source/WebCore/css/StyleInvalidationAnalysis.cpp.
(WebCore::Style::Invalidator::Invalidator):
(WebCore::Style::Invalidator::invalidateIfNeeded):
(WebCore::Style::Invalidator::invalidateStyleForTree):
(WebCore::Style::Invalidator::invalidateStyle):
(WebCore::shouldDirtyAllStyle): Deleted.
(WebCore::StyleInvalidationAnalysis::StyleInvalidationAnalysis): Deleted.
(WebCore::StyleInvalidationAnalysis::invalidateIfNeeded): Deleted.
(WebCore::StyleInvalidationAnalysis::invalidateStyleForTree): Deleted.
(WebCore::StyleInvalidationAnalysis::invalidateStyle): Deleted.
* style/StyleInvalidator.h: Copied from Source/WebCore/css/StyleInvalidationAnalysis.h.
(WebCore::StyleInvalidationAnalysis::dirtiesAllStyle): Deleted.
(WebCore::StyleInvalidationAnalysis::hasShadowPseudoElementRulesInAuthorSheet): Deleted.
* style/StyleScope.cpp:
(WebCore::Style::Scope::resolver):
(WebCore::Style::Scope::analyzeStyleSheetChange):

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

2 years agoUnreviewed GTK+ gardening. Update expectations of several tests.
carlosgc@webkit.org [Wed, 3 May 2017 12:47:38 +0000 (12:47 +0000)]
Unreviewed GTK+ gardening. Update expectations of several tests.

* platform/gtk/TestExpectations:

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

2 years agoUnreviewed GTK+ gardening. Rebaseline inspector resource size tests.
carlosgc@webkit.org [Wed, 3 May 2017 10:18:33 +0000 (10:18 +0000)]
Unreviewed GTK+ gardening. Rebaseline inspector resource size tests.

Libsoup doesn't provide the required information to fill all those size metrics.

* platform/gtk/http/tests/inspector/network/resource-sizes-memory-cache-expected.txt: Added.
* platform/gtk/http/tests/inspector/network/resource-sizes-network-expected.txt: Added.

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

2 years ago[GTK] Add GTK+ implementation of WebAutomationSession
carlosgc@webkit.org [Wed, 3 May 2017 08:55:56 +0000 (08:55 +0000)]
[GTK] Add GTK+ implementation of WebAutomationSession
https://bugs.webkit.org/show_bug.cgi?id=171431

Reviewed by Michael Catanzaro.

Add platform dependent methods for GTK+ to synthesize events.

* PlatformGTK.cmake:
* UIProcess/API/gtk/WebKitUIClient.cpp: Always resize the window for web views controlled by automation.
* UIProcess/Automation/WebAutomationSession.cpp:
(WebKit::WebAutomationSession::resizeWindowOfBrowsingContext):
(WebKit::WebAutomationSession::moveWindowOfBrowsingContext):
(WebKit::WebAutomationSession::performMouseInteraction):
(WebKit::WebAutomationSession::performKeyboardInteractions):
* UIProcess/Automation/WebAutomationSession.h:
* UIProcess/Automation/gtk/WebAutomationSessionGtk.cpp: Added.
(WebKit::modifiersToEventState):
(WebKit::mouseButtonToGdkButton):
(WebKit::doMouseEvent):
(WebKit::doMotionEvent):
(WebKit::WebAutomationSession::platformSimulateMouseInteraction):
(WebKit::doKeyStrokeEvent):
(WebKit::keyCodeForVirtualKey):
(WebKit::WebAutomationSession::platformSimulateKeyStroke):
(WebKit::WebAutomationSession::platformSimulateKeySequence):
(WebKit::WebAutomationSession::platformGetBase64EncodedPNGData):

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

2 years agoUnreviewed. Update OptionsGTK.cmake and NEWS for 2.17.1 release.
carlosgc@webkit.org [Wed, 3 May 2017 08:30:58 +0000 (08:30 +0000)]
Unreviewed. Update OptionsGTK.cmake and NEWS for 2.17.1 release.

.:

* Source/cmake/OptionsGTK.cmake: Bump version numbers.

Source/WebKit2:

* gtk/NEWS: Add release notes for 2.17.1.

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

2 years ago[Soup] Add request headers to network load metrics
carlosgc@webkit.org [Wed, 3 May 2017 07:15:41 +0000 (07:15 +0000)]
[Soup] Add request headers to network load metrics
https://bugs.webkit.org/show_bug.cgi?id=171545

Reviewed by Sergio Villar Senin.

This will make the headers to appear in the web inspector.

Fixes: http/tests/inspector/network/resource-request-headers.html

* NetworkProcess/soup/NetworkDataTaskSoup.cpp:
(WebKit::NetworkDataTaskSoup::didGetHeaders):

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

2 years agocheck-webkit-style should also keep js-test-post[-async].js in sync
ddkilzer@apple.com [Wed, 3 May 2017 03:59:24 +0000 (03:59 +0000)]
check-webkit-style should also keep js-test-post[-async].js in sync
<https://webkit.org/b/171568>

Reviewed by Joseph Pecoraro.

* Scripts/webkitpy/style/checker.py:
(_NEVER_SKIPPED_JS_FILES): Add new list that just contains
JavaScript files not to be skipped.
(_NEVER_SKIPPED_FILES): Update to use _NEVER_SKIPPED_JS_FILES.
(CheckerDispatcher._create_checker): Update to use
_NEVER_SKIPPED_JS_FILES.

* Scripts/webkitpy/style/checkers/jstest.py:
(ALL_JS_TEST_FUNCTION_FILES): Rename from ALL_JS_TEST_FILES.
This is the list of files containing functions that need to be
kept in sync.
(KEEP_JS_TEST_FILES_IN_SYNC): Change to list-of-lists format so
we can keep more sets of files in sync between
LayoutTests/resources and LayoutTests/http/tests/resources.
(JSTestChecker.check): Update to use KEEP_JS_TEST_FILES_IN_SYNC
as list of lists.  Update for ALL_JS_TEST_FUNCTION_FILES rename.
(JSTestChecker.check_js_test_files): Add 'file_group' argument
for list of files to check instead of using
KEEP_JS_TEST_FILES_IN_SYNC.
(JSTestChecker.check_js_test_functions): Update for
ALL_JS_TEST_FUNCTION_FILES rename.

* Scripts/webkitpy/style/checkers/jstest_unittest.py:
(JSTestCheckerTestCase):
(JSTestCheckerTestCase.test_map_functions_to_dict):
- Add test case for map_functions_to_dict() in jstest.py.

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

2 years agoBuild fix after r216078
commit-queue@webkit.org [Wed, 3 May 2017 02:48:49 +0000 (02:48 +0000)]
Build fix after r216078
https://bugs.webkit.org/show_bug.cgi?id=171554

Patch by Don Olmstead <don.olmstead@am.sony.com> on 2017-05-02
Reviewed by Saam Barati.

* API/tests/testapi.c:

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

2 years agoews should indicate in logs when it fails to fetch the attachment
aakash_jain@apple.com [Wed, 3 May 2017 02:48:25 +0000 (02:48 +0000)]
ews should indicate in logs when it fails to fetch the attachment
https://bugs.webkit.org/show_bug.cgi?id=171583

Reviewed by Alexey Proskuryakov.

* Scripts/webkitpy/common/net/bugzilla/bugzilla.py:
(Bugzilla.fetch_attachment): Added log statement.

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

2 years agoTypo in AVAudioSessionCaptureDeviceManager.mm
commit-queue@webkit.org [Wed, 3 May 2017 00:11:11 +0000 (00:11 +0000)]
Typo in AVAudioSessionCaptureDeviceManager.mm
https://bugs.webkit.org/show_bug.cgi?id=171572

Patch by Andrew Gold <agold@apple.com> on 2017-05-02
Reviewed by Jer Noble.

We attempt to call +[AVAudioSession sharedSession], but the actual method is
called +[AVAudioSession sharedInstance].

* platform/mediastream/ios/AVAudioSessionCaptureDeviceManager.mm:
(WebCore::AVAudioSessionCaptureDeviceManager::refreshAudioCaptureDevices):

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

2 years agoSource/WebCore:
dbates@webkit.org [Tue, 2 May 2017 23:15:19 +0000 (23:15 +0000)]
Source/WebCore:
Improve scrolling tree logging
https://bugs.webkit.org/show_bug.cgi?id=171574

Patch by Simon Fraser <simon.fraser@apple.com> on 2017-05-02
Reviewed by Tim Horton.

Make a call to showScrollingStateTree() print debugging-related information like node and layer IDs.
Required fixing scrolling state tree nodes to respect ScrollingStateTreeAsTextBehavior, and fixing
fixed and sticky nodes to call super.

Also enhance compositing logging to show layer IDs, and to log for layer scrolling tree registration.

* page/scrolling/AsyncScrollingCoordinator.cpp:
(WebCore::AsyncScrollingCoordinator::scrollingStateTreeAsText):
* page/scrolling/AsyncScrollingCoordinator.h:
* page/scrolling/ScrollingCoordinator.cpp:
(WebCore::ScrollingCoordinator::scrollingStateTreeAsText):
* page/scrolling/ScrollingCoordinator.h:
* page/scrolling/ScrollingStateFixedNode.cpp:
(WebCore::ScrollingStateFixedNode::dumpProperties):
* page/scrolling/ScrollingStateNode.cpp:
(WebCore::ScrollingStateNode::dumpProperties):
(WebCore::ScrollingStateNode::scrollingStateTreeAsText):
* page/scrolling/ScrollingStateNode.h:
* page/scrolling/ScrollingStateScrollingNode.cpp:
(WebCore::ScrollingStateScrollingNode::dumpProperties):
* page/scrolling/ScrollingStateStickyNode.cpp:
(WebCore::ScrollingStateStickyNode::dumpProperties):
* page/scrolling/ScrollingStateTree.cpp:
(showScrollingStateTree):
* page/scrolling/mac/ScrollingCoordinatorMac.mm:
(WebCore::ScrollingCoordinatorMac::commitTreeState):
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::detachFromScrollingCoordinator):
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::logLayerInfo):
(WebCore::RenderLayerCompositor::updateScrollCoordinatedLayer):

Source/WTF:
Fix the build after <https://trac.webkit.org/changeset/216102>
(https://bugs.webkit.org/show_bug.cgi?id=170925)

Export into global scope ASCIICaseInsensitiveStringViewHashTranslator.

Also fix indentation of member functions of ASCIICaseInsensitiveStringViewHashTranslator.

* wtf/text/StringHash.h:

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

2 years agoFix the build after <https://trac.webkit.org/changeset/216102>
dbates@webkit.org [Tue, 2 May 2017 23:07:35 +0000 (23:07 +0000)]
Fix the build after <https://trac.webkit.org/changeset/216102>
(https://bugs.webkit.org/show_bug.cgi?id=170925)

Export into global scope ASCIICaseInsensitiveStringViewHashTranslator.

Also fix indentation of member functions of ASCIICaseInsensitiveStringViewHashTranslator.

* wtf/text/StringHash.h:

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