WebKit-https.git
2 years ago[GTK] [WebCrypto] Mark new WebCryptoAPI test failures after last WPT sync
clopez@igalia.com [Thu, 25 May 2017 16:24:31 +0000 (16:24 +0000)]
[GTK] [WebCrypto] Mark new WebCryptoAPI test failures after last WPT sync

Unreviewed GTK gardening.

* platform/gtk/TestExpectations:

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

2 years agoREGRESSION (r217423): Fix last-second typo in 'auto'
ddkilzer@apple.com [Thu, 25 May 2017 15:57:26 +0000 (15:57 +0000)]
REGRESSION (r217423): Fix last-second typo in 'auto'

* TestWebKitAPI/Tests/WebKit2Cocoa/WKHTTPCookieStore.mm:
(WebKit2_WKHTTPCookieStoreWithoutProcessPool_Test): Fix typo.

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

2 years agoREGRESSION (r216977): 4 leaks introduced in new WebKit2_WKHTTPCookieStoreWithoutProce...
ddkilzer@apple.com [Thu, 25 May 2017 15:54:29 +0000 (15:54 +0000)]
REGRESSION (r216977): 4 leaks introduced in new WebKit2_WKHTTPCookieStoreWithoutProcessPool_Test
<https://webkit.org/b/172558>

Reviewed by Sam Weinig.

* TestWebKitAPI/Tests/WebKit2Cocoa/WKHTTPCookieStore.mm:
(WebKit2_WKHTTPCookieStoreWithoutProcessPool_Test): Fix the leaks.

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

2 years ago[macOS WK2 Debug] Layout Test webrtc/video.html is crashing.
commit-queue@webkit.org [Thu, 25 May 2017 15:50:38 +0000 (15:50 +0000)]
[macOS WK2 Debug] Layout Test webrtc/video.html is crashing.
https://bugs.webkit.org/show_bug.cgi?id=172560
<rdar://problem/32392611>

Patch by youenn fablet <youenn@apple.com> on 2017-05-25
Reviewed by Eric Carlson.

webrtc/multiple-video.html is no longer crashing.

Allow autoplay only from going to not capture to capture, and not the reverse.
Renamed HTMLMediaElement::mediaStreamCaptureStateChanged to mediaStreamCaptureStarted.

* dom/Document.cpp:
(WebCore::Document::mediaStreamCaptureStateChanged):
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::mediaStreamCaptureStateChanged): Deleted.
* html/HTMLMediaElement.h:
(WebCore::HTMLMediaElement::mediaStreamCaptureStarted):

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

2 years ago[GTK] Update baseline
csaavedra@igalia.com [Thu, 25 May 2017 15:43:54 +0000 (15:43 +0000)]
[GTK] Update baseline

Unreviewed gardening. Update after r217272.
* platform/gtk/fast/text/font-style-parse-expected.txt:

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

2 years agoREGRESSION (r217416): Using #pragma once in WTFString.h broke the build
ddkilzer@apple.com [Thu, 25 May 2017 15:22:33 +0000 (15:22 +0000)]
REGRESSION (r217416): Using #pragma once in WTFString.h broke the build

* wtf/text/WTFString.h: Switch back to #ifndef/#define/#endif.

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

2 years agoBaseline of number inputs not right.
hyatt@apple.com [Thu, 25 May 2017 14:56:27 +0000 (14:56 +0000)]
Baseline of number inputs not right.
https://bugs.webkit.org/show_bug.cgi?id=172237

Reviewed by Dean Jackson.

Source/WebCore:

Added fast/forms/baseline-of-number-inputs.html

* css/html.css:
(input::-webkit-inner-spin-button):
* rendering/RenderSearchField.cpp:
(WebCore::RenderSearchField::computeLogicalHeightLimit): Deleted.
(WebCore::RenderSearchField::centerContainerIfNeeded): Deleted.
* rendering/RenderSearchField.h:
* rendering/RenderTextControlSingleLine.cpp:
(WebCore::RenderTextControlSingleLine::centerRenderer):
(WebCore::RenderTextControlSingleLine::layout):
(WebCore::RenderTextControlSingleLine::computeLogicalHeightLimit): Deleted.
* rendering/RenderTextControlSingleLine.h:
(WebCore::RenderTextControlSingleLine::centerContainerIfNeeded): Deleted.

LayoutTests:

* fast/forms/baseline-of-number-inputs-expected.html: Added.
* fast/forms/baseline-of-number-inputs.html: Added.

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

2 years ago[Win] Update expectations for layout tests.
pvollan@apple.com [Thu, 25 May 2017 14:37:10 +0000 (14:37 +0000)]
[Win] Update expectations for layout tests.
https://bugs.webkit.org/show_bug.cgi?id=172437

Unreviewed test gardening, update test expectations for failing tests.

* platform/win/TestExpectations:

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

2 years agoMake a change to force a build on the Apple bots
ddkilzer@apple.com [Thu, 25 May 2017 13:46:38 +0000 (13:46 +0000)]
Make a change to force a build on the Apple bots

* wtf/text/WTFString.h: Use #pragma once.

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

2 years ago[WPE] Unreviewed gardening
csaavedra@igalia.com [Thu, 25 May 2017 13:36:44 +0000 (13:36 +0000)]
[WPE] Unreviewed gardening

Update rebaseline after r216817.

* platform/wpe/fast/transforms/bounding-rect-zoom-expected.txt:

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

2 years ago[GTK] Web Inspector: Add ListStylePositionInside.svg and ListStylePositionOutside.svg
commit-queue@webkit.org [Thu, 25 May 2017 12:26:42 +0000 (12:26 +0000)]
[GTK] Web Inspector: Add ListStylePositionInside.svg and ListStylePositionOutside.svg
https://bugs.webkit.org/show_bug.cgi?id=172574

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

Add more free icons for the Web Inspector of GTK+ port.

* UserInterface/Images/gtk/ListStylePositionInside.svg: Added.
* UserInterface/Images/gtk/ListStylePositionOutside.svg: Added.

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

2 years ago[GTK] Web Inspector: Add new icons AnimationPlayStatePaused.svg and AnimationPlayStat...
commit-queue@webkit.org [Thu, 25 May 2017 12:24:17 +0000 (12:24 +0000)]
[GTK] Web Inspector: Add new icons AnimationPlayStatePaused.svg and AnimationPlayStateRunning.svg
https://bugs.webkit.org/show_bug.cgi?id=172579

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

Add more free icons for the Web Inspector of GTK+ port.

* UserInterface/Images/gtk/AnimationPlayStatePaused.svg: Added.
* UserInterface/Images/gtk/AnimationPlayStateRunning.svg: Added.

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

2 years ago[Win] Update expectations for layout tests.
pvollan@apple.com [Thu, 25 May 2017 11:45:52 +0000 (11:45 +0000)]
[Win] Update expectations for layout tests.
https://bugs.webkit.org/show_bug.cgi?id=172437

Unreviewed test gardening, update test expectations for failing tests.

* platform/win/TestExpectations:

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

2 years ago[css-grid] Fix behavior of positioned items without specific dimensions
rego@igalia.com [Thu, 25 May 2017 10:06:45 +0000 (10:06 +0000)]
[css-grid] Fix behavior of positioned items without specific dimensions
https://bugs.webkit.org/show_bug.cgi?id=172117

Reviewed by Sergio Villar Senin.

Source/WebCore:

Currently positioned items that doesn't have specific dimensions
are not properly sized. This patch fixes the issues with them.

The patch removes the extraInline|BlockOffsets from RenderBox,
so now RenderGrid is responsible of setting the location of the positioned item.
This will be useful to add alignment support for positioned items later.
It also removes grid specific logic from RenderBox.

RenderBox::computeInlineStaticDistance() was modified too.
The problem here was that the containing block of the positioned gird items
is the grid area (and not the grid container). The method didn't know
anything about grid, so it was using the grid container causing wrong values
when resolving "auto" in both left and right offset properties.

Note that after this patch we match Chrome and Firefox behavior on these cases.

Test: fast/css-grid-layout/positioned-grid-items-sizing.html

* rendering/RenderBox.cpp:
(WebCore::RenderBox::willBeDestroyed):
(WebCore::computeInlineStaticDistance):
(WebCore::RenderBox::computePositionedLogicalWidth):
(WebCore::RenderBox::computePositionedLogicalHeight):
* rendering/RenderBox.h:
* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::layoutPositionedObject):
(WebCore::RenderGrid::offsetAndBreadthForPositionedChild):

LayoutTests:

* fast/css-grid-layout/positioned-grid-items-sizing-expected.html: Added.
* fast/css-grid-layout/positioned-grid-items-sizing.html: Added.

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

2 years ago[WPE] Build fix after r217404
csaavedra@igalia.com [Thu, 25 May 2017 09:57:47 +0000 (09:57 +0000)]
[WPE] Build fix after r217404

Unreviewed

* PlatformWPE.cmake: Include missing cairo cmake file.

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

2 years ago_WKUserStyleSheet leaks string data
commit-queue@webkit.org [Thu, 25 May 2017 09:04:42 +0000 (09:04 +0000)]
_WKUserStyleSheet leaks string data
https://bugs.webkit.org/show_bug.cgi?id=172583
<rdar://problem/32395209>

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

* UIProcess/API/Cocoa/_WKUserStyleSheet.mm:
(-[_WKUserStyleSheet dealloc]):

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

2 years agoREGRESSION(r217390): "Broke internal Production builds that ran run-jsc-stress-tests...
ddkilzer@apple.com [Thu, 25 May 2017 07:40:02 +0000 (07:40 +0000)]
REGRESSION(r217390): "Broke internal Production builds that ran run-jsc-stress-tests" (Requested by ddkilzer on #webkit).
<https://bugs.webkit.org/show_bug.cgi?id=172584>

* fast/regex/:
* fast/regex/script-tests:
- Rollback changes in r217390 for Bug 172423 to these
  directories.

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

2 years agoResourceResponses for data URLs have their Source marked as Unknown
cdumez@apple.com [Thu, 25 May 2017 04:18:52 +0000 (04:18 +0000)]
ResourceResponses for data URLs have their Source marked as Unknown
https://bugs.webkit.org/show_bug.cgi?id=172573
<rdar://problem/31786198>

Reviewed by Geoffrey Garen.

Source/WebCore:

ResourceResponses for data URLs have their Source marked as Unknown.

Now set their source to Network to maintain previous behavior when
we used to decode those data URLs on Network process side.

Test: fast/url/data-url-source.html

* loader/ResourceLoader.cpp:
(WebCore::ResourceLoader::loadDataURL):

LayoutTests:

Add layout test coverage.

* fast/url/data-url-source-expected.txt: Added.
* fast/url/data-url-source.html: Added.

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

2 years ago[Win] An assertion fails if the custom cursor image isn't loaded yet
commit-queue@webkit.org [Thu, 25 May 2017 03:54:08 +0000 (03:54 +0000)]
[Win] An assertion fails if the custom cursor image isn't loaded yet
https://bugs.webkit.org/show_bug.cgi?id=172209

Patch by Fujii Hironori <Hironori.Fujii@sony.com> on 2017-05-24
Reviewed by Said Abou-Hallawa.

Source/WebCore:

Test: fast/css/crash-on-custom-cursor-when-loading.html

A custom cursor image can be zero dimension if it is loading or
decoding. Cursor::ensurePlatformCursor of Windows port should
handle such case properly.

* platform/win/CursorWin.cpp:
(WebCore::Cursor::ensurePlatformCursor): Load a stock cursor if
the custom cursor image has zero dimension. Do not do null-check
of the return value of createSharedCursor() because it never
returns null.

LayoutTests:

Windows port have the same issue Qt port had had several years ago
(Bug 68223). I'd like to reuse the test case. But, current CSS
parser rejects invalid 'cursor' property value which consists of
a single URL but no keywords.

* fast/css/crash-on-custom-cursor-when-loading.html: Fix invalid
'cursor' property by appending a fallback keyword.

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

2 years agoIncrease the headerpad for WebKit XPC Services
commit-queue@webkit.org [Thu, 25 May 2017 03:39:24 +0000 (03:39 +0000)]
Increase the headerpad for WebKit XPC Services
https://bugs.webkit.org/show_bug.cgi?id=172571

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

* Configurations/BaseXPCService.xcconfig:
Increase the headerpad to make room for additional dyld commands.

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

2 years ago[CMake] Consolidate CMake code related to Cairo
commit-queue@webkit.org [Thu, 25 May 2017 02:16:33 +0000 (02:16 +0000)]
[CMake] Consolidate CMake code related to Cairo
https://bugs.webkit.org/show_bug.cgi?id=172568

Patch by Don Olmstead <don.olmstead@am.sony.com> on 2017-05-24
Reviewed by Alex Christensen.

.:

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

Source/WebCore:

No new tests. No change in behavior.

* PlatformGTK.cmake:
* PlatformWPE.cmake:
* PlatformWinCairo.cmake:
* config.h:
* platform/Cairo.cmake: Added.
* platform/GStreamer.cmake:
* platform/ImageDecoders.cmake:

Tools:

* DumpRenderTree/config.h:
* TestWebKitAPI/config.h:

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

2 years agoOpening an analysis task from the queue page is broken
rniwa@webkit.org [Wed, 24 May 2017 23:54:43 +0000 (23:54 +0000)]
Opening an analysis task from the queue page is broken
https://bugs.webkit.org/show_bug.cgi?id=172559
<rdar://problem/32389708>

Rubber-stamped by Chris Dumez.

Fix the bug that opening the analysis task page from the queue page results in multiple assertion failures
as well as the list of test groups in the analysis task page not getting updated.

* public/v3/models/build-request.js:
(BuildRequest.prototype.updateSingleton): Because /api/build-requests/ do not include test groups, it's
possible for testGroup to be dynamically updated upon loading an analysis task page. Update _testGroup in
such instances instead of asserting that it doesn't happen.

* public/v3/models/data-model.js:
(DataModelObject.cachedFetch): Because various code to create model objects from the result of a JSON API
modify the fetched content in irreversible manner, e.g. `object.platform = Platform.findById(object.platform)`
we must return a fresh new content each time even if the result had been cached.

* public/v3/models/test-group.js:
(TestGroup.prototype.platform): Return this._platform as that's not available.

* public/v3/pages/analysis-task-page.js:
(AnalysisTaskPage):
(AnalysisTaskPage.prototype._resetVariables): Extracted from the constructor.
(AnalysisTaskPage.prototype.updateFromSerializedState): Reset all instance variables when opening a new
analysis task page. This would avoid showing the stale result even when fetching new test groups had failed.

* unit-tests/test-groups-tests.js: Added a test case for fetching the same test group twice. This used to hit
a problem in BuildRequest.constructBuildRequestsFromData which overrode platform property of each raw content
with a Platform model object because in the case of a cached fetch, we end up trying to look up the platform
again using the result of stringifying the Platform object instead of the platform ID included in the original
fetched content.
(sampleTestGroup): Added "platform" as included in the JSON API's response now.

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

2 years agoThe commit log viewer can overlap the analysis results viewer
rniwa@webkit.org [Wed, 24 May 2017 23:52:06 +0000 (23:52 +0000)]
The commit log viewer can overlap the analysis results viewer
https://bugs.webkit.org/show_bug.cgi?id=172534

Rubber-stamped by Chris Dumez.

Allocate the padding on the right for the commit log viewer, and add a horizontal scrollbar
to the analysis results viewer instead of letting it expand beneath the commit log viewer.

* public/v3/pages/analysis-task-page.js:
(AnalysisTaskResultsPane.htmlTemplate):
(AnalysisTaskResultsPane.cssTemplate):

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

2 years agoREGRESSION (r206481): Don't assume frameCount() is larger than or equal to the size...
commit-queue@webkit.org [Wed, 24 May 2017 23:13:50 +0000 (23:13 +0000)]
REGRESSION (r206481): Don't assume frameCount() is larger than or equal to the size of the image frame cache
https://bugs.webkit.org/show_bug.cgi?id=172552

Patch by Said Abou-Hallawa <sabouhallawa@apple.com> on 2017-05-24
Reviewed by Geoffrey Garen.

If an image with many cached ImageFrames is cached but its encoded data is
freed, then the same image is reused, the encoded data will be fetched.
But the initial frameCount() might be less than the current size of the
ImageFrames cache.

This was causing an assertion in the debug build and crash in the release
build. Vector::grow() does not handle the case where the new size is smaller
than the current size safely.

* platform/graphics/ImageFrameCache.cpp:
(WebCore::ImageFrameCache::growFrames):

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

2 years agonavigator.webdriver should return false if the page is not controlled by automation
commit-queue@webkit.org [Wed, 24 May 2017 23:05:53 +0000 (23:05 +0000)]
navigator.webdriver should return false if the page is not controlled by automation
https://bugs.webkit.org/show_bug.cgi?id=171997

Patch by Sergey Shekyan <shekyan@gmail.com> on 2017-05-24
Reviewed by Chris Dumez.

Per WebDriver Specification at https://www.w3.org/TR/webdriver/#interface

Test: js/dom/navigator-webdriver.html
Rebaseled fast/dom/navigator-detached-no-crash.html

* Modules/webdriver/NavigatorWebDriver.cpp:
(WebCore::NavigatorWebDriver::NavigatorWebDriver):
(WebCore::NavigatorWebDriver::isControlledByAutomation):
(WebCore::NavigatorWebDriver::from):
(WebCore::NavigatorWebDriver::webdriver):
(WebCore::JSNavigator::webdriver): Deleted.
* Modules/webdriver/NavigatorWebDriver.h:
* Modules/webdriver/NavigatorWebDriver.idl:

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

2 years agoMerge split script tests
ap@apple.com [Wed, 24 May 2017 22:53:00 +0000 (22:53 +0000)]
Merge split script tests
https://bugs.webkit.org/show_bug.cgi?id=172423

Reviewed by Sam Weinig.

In the past, many tests were being split into HTML and JS parts for no good reason.
This makes it hard to see what those tests are doing.

This is first part of the change, only including files where JS and HTML counterparts
have matching names. Custom cases will be completed in a follow-up.

Long change list omitted.

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

2 years ago[GTK] Provide details on javascript exception
commit-queue@webkit.org [Wed, 24 May 2017 21:59:58 +0000 (21:59 +0000)]
[GTK] Provide details on javascript exception
https://bugs.webkit.org/show_bug.cgi?id=161187

Patch by David Keijser <keijser@gmail.com> on 2017-05-24
Reviewed by Carlos Garcia Campos.

* UIProcess/API/gtk/WebKitWebView.cpp:
(webkitWebViewRunJavaScriptCallback):
(webkit_web_view_run_javascript):
(resourcesStreamReadCallback):

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

2 years agoUnreviewed, suppress deprecation warnings to fix the build.
ryanhaddad@apple.com [Wed, 24 May 2017 21:35:11 +0000 (21:35 +0000)]
Unreviewed, suppress deprecation warnings to fix the build.

Source/WebCore:

* platform/graphics/mac/GraphicsContextMac.mm:
(WebCore::linearRGBColorSpaceRef):

Source/WebKit2:

* Shared/mac/ColorSpaceData.mm:
(WebKit::ColorSpaceData::decode):

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

2 years agoMark http/tests/xmlhttprequest/xmlhttprequest-50ms-download-dispatch.html as failing...
ryanhaddad@apple.com [Wed, 24 May 2017 21:35:07 +0000 (21:35 +0000)]
Mark http/tests/xmlhttprequest/xmlhttprequest-50ms-download-dispatch.html as failing on iOS.
https://bugs.webkit.org/show_bug.cgi?id=172547

Unreviewed test gardening.

* platform/ios/TestExpectations:

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

2 years ago[GTK] Web Inspector: Add new GTK+ icons for garbage collect and clean buttons in...
commit-queue@webkit.org [Wed, 24 May 2017 20:28:17 +0000 (20:28 +0000)]
[GTK] Web Inspector: Add new GTK+ icons for garbage collect and clean buttons in Console
https://bugs.webkit.org/show_bug.cgi?id=167356

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

* UserInterface/Images/gtk/NavigationItemClear.svg: Aligned for 16x16 dimension.
* UserInterface/Images/gtk/NavigationItemGarbageCollect.svg: Added.
* UserInterface/Views/LogContentView.js:
(WebInspector.LogContentView): Removed the Clear image dimension's conditional expression.
* UserInterface/Views/NetworkGridContentView.js:
(WebInspector.NetworkGridContentView): Ditto.
* UserInterface/Views/TimelineRecordingContentView.js:
(WebInspector.TimelineRecordingContentView): Ditto.

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

2 years agoSycning script build fix after r217378.
rniwa@webkit.org [Wed, 24 May 2017 19:43:39 +0000 (19:43 +0000)]
Sycning script build fix after r217378.

* tools/sync-buildbot.js:
(syncLoop):

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

2 years agoDisable memory kill mechanisms when running with FastMalloc disabled.
akling@apple.com [Wed, 24 May 2017 19:32:26 +0000 (19:32 +0000)]
Disable memory kill mechanisms when running with FastMalloc disabled.
https://bugs.webkit.org/show_bug.cgi?id=172550
<rdar://problem/32181908>

Reviewed by Antti Koivisto.

If someone is using WebKit with a non-standard allocator, they are likely trying to debug
or test something, and suddenly getting killed is not gonna help with that.

* wtf/MemoryPressureHandler.cpp:
(WTF::MemoryPressureHandler::setShouldUsePeriodicMemoryMonitor):

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

2 years agoPlumb additional image metadata to item providers when beginning data interaction...
wenson_hsieh@apple.com [Wed, 24 May 2017 19:01:43 +0000 (19:01 +0000)]
Plumb additional image metadata to item providers when beginning data interaction on an image
https://bugs.webkit.org/show_bug.cgi?id=172536
<rdar://problem/32371300>

Reviewed by Beth Dakin.

Source/WebCore:

Plumb suggestedName (the last path component of the image's source URL) and size (the actual size of the image)
to item providers when beginning data interaction on an image.

Augments existing unit tests to cover these changes -- see DataInteractionTests.

* editing/ios/EditorIOS.mm:
(WebCore::Editor::writeImageToPasteboard):
* platform/Pasteboard.h:
* platform/ios/PlatformPasteboardIOS.mm:
(WebCore::PlatformPasteboard::writeObjectRepresentations):
* platform/ios/WebItemProviderPasteboard.h:
* platform/ios/WebItemProviderPasteboard.mm:
(-[WebItemProviderRegistrationInfoList init]):
(-[WebItemProviderPasteboard setItemsUsingRegistrationInfoLists:]):
(temporaryFileURLForDataInteractionContent):

Source/WebKit2:

Boilerplate plumbing to send suggestedName over IPC.

* Shared/WebCoreArgumentCoders.cpp:
(IPC::ArgumentCoder<PasteboardImage>::encode):
(IPC::ArgumentCoder<PasteboardImage>::decode):

Tools:

Tweak existing image data interaction tests to check for suggested name and estimated size on the generated
source item providers.

* TestWebKitAPI/Tests/ios/DataInteractionTests.mm:
(checkSuggestedNameAndEstimatedSize):
(TestWebKitAPI::TEST):

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

2 years agoCoreAudioCaptureSource is ducking system sound
eric.carlson@apple.com [Wed, 24 May 2017 18:56:49 +0000 (18:56 +0000)]
CoreAudioCaptureSource is ducking system sound
https://bugs.webkit.org/show_bug.cgi?id=172512

Reviewed by Youenn Fablet.

Manual testing.

* Configurations/WebCore.xcconfig: Adding CoreAudio as framework for iOS.
* platform/mediastream/mac/CoreAudioCaptureSource.cpp:
(WebCore::CoreAudioSharedUnit::setupAudioUnit):
(WebCore::CoreAudioSharedUnit::defaultOutputDevice):
* platform/spi/cf/CoreAudioSPI.h: Added.

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

2 years ago[WPE] Rebaseline test
csaavedra@igalia.com [Wed, 24 May 2017 18:54:00 +0000 (18:54 +0000)]
[WPE] Rebaseline test

Unreviewed gardening after a series of changes to dom static properties.

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

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

2 years agoWeb Inspector: Don't load the active recording until a Timeline view needs to be...
drousso@apple.com [Wed, 24 May 2017 18:53:46 +0000 (18:53 +0000)]
Web Inspector: Don't load the active recording until a Timeline view needs to be shown
https://bugs.webkit.org/show_bug.cgi?id=172467

Reviewed by Joseph Pecoraro.

* UserInterface/Views/TimelineTabContentView.js:
(WebInspector.TimelineTabContentView):
(WebInspector.TimelineTabContentView.prototype.restoreFromCookie):
(WebInspector.TimelineTabContentView.prototype._showTimelineViewForType):
Move the call to `_recordingLoaded` to when a timeline view needs to be shown and only if
`_displayedRecording` isn't already set. This delays the creation of the content view for
the recording to right before it needs to be displayed.

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

2 years agoAdd the support for perf try bots to sync-buildbot.js
rniwa@webkit.org [Wed, 24 May 2017 18:47:01 +0000 (18:47 +0000)]
Add the support for perf try bots to sync-buildbot.js
https://bugs.webkit.org/show_bug.cgi?id=172529

Rubber-stamped by Chris Dumez.

Make sync-buildbot.js schedule an A/B testing job with a patch or roots to buildbot.

Change the buildbot property format in the syncing script's configuration again to use a dictionary
with a single key of "revision", "patch", or "roots" to specify a revision, a patch, or a set of roots,
and simplified the structure of the configuration by always having "types" and "builders", and
make each entry in "configurations" refer to a list of types, platforms, and builders.

Since now there are build requests to build patches and run tests, "configurations" has been renamed to
"testConfigurations" and "buildConfigurations" have been added. Each entry in "buildConfigurations"
specifies a list of platforms and builders. Similarly in repository group configurations, the buildbot
properties for testing is now specified as "testProperties" and ones for building a patch is specified
in newly introduced "buildProperties".

* public/api/build-requests.php:
(update_builds): When a build request to build a patch fails, mark all subsequent requests as failed
since there is no way to run tests without a successful build.

* public/api/update-triggerable.php:
(main): Re-generate manifest.json after updating the triggerable. The lack of this re-generation was
the reason we had to manually GET /api/manifest in api-update-triggerable-tests.js.

* public/v3/models/build-request.js:
(BuildRequest.prototype.hasCompleted): Added.

* public/v3/models/manifest.js:
(Manifest.reset): Added. Extracted from MockData.resetV3Models in unit-tests/mock-data.js and
syncLoop in tools/sync-buildbot.js
(Manifest.fetch): Reset V3 models before fetching the manifest. This eliminates the need to manually
reset V3 models in syncLoop.

* public/v3/models/uploaded-file.js:
(UploadedFile.prototype.url): Use RemoteAPI.url to get the full URL instead of just a path.

* public/v3/remote.js:
(BrowserRemoteAPI.prototype.url): Added. Constructs the full URL.

* server-tests/api-update-triggerable-tests.js:
(.refetchManifest): Deleted. Now that /api/manifest re-generates manifest.json, we can simply call
Manifest.fetch instead.

* server-tests/resources/mock-data.js:
(MockData.resetV3Models): Calls Manifest.reset().
(MockData.addMockConfiguration): Extracted from addMockData.
(MockData.addMockData): Updated per the format change.
(MockData.mockTestSyncConfigWithSingleBuilder): Ditto.
(MockData.mockTestSyncConfigWithTwoBuilders): Ditto.
(MockData.runningBuild): Make buildNumber specifiable.
(MockData.finishedBuild): Ditto.

* server-tests/tools-buildbot-triggerable-tests.js: Updated configurations per the format change.
Now that now acceptsCustomRoots() for "system-and-webkit" must be true since we can't have a
repository group that which accepts a patch and not take roots.

* server-tests/tools-sync-buildbot-integration-tests.js: Added.
(createTriggerable): Added.
(createTestGroupWihPatch): Added.
(uploadRoot): Added.
(.assertAndResolveRequest): Added.
(.assertTestBuildHasFailed): Added.

* tools/js/buildbot-syncer.js:
(BuildbotSyncer): Added. _type as an instance variable to identify whether this buildbot builder
is a "builder" which builds a patch, builder, or a "tester" which runs a test. Also renamed
_testConfigurations to _configurations.
(BuildbotSyncer.prototype.addTestConfiguration): Assert that either the type of this syncer hasn't
been set or it's a tester.
(BuildbotSyncer.prototype.testConfigurations): Return [] when it's a builder.
(BuildbotSyncer.prototype.addBuildConfiguration): Added. Adds a platform to a builder.
(BuildbotSyncer.prototype.buildConfigurations): Added. Returns the list of configurations if this
syncer is a builder. Otherwise returns [].
(BuildbotSyncer.prototype.isTester): Added.
(BuildbotSyncer.prototype.matchesConfiguration):
(BuildbotSyncer.prototype._propertiesForBuildRequest): Updated to support the new format.
(BuildbotSyncer._loadConfig): Ditto. Optionally parse buildConfigurations.
(BuildbotSyncer._resolveBuildersWithPlatforms): Added. For each test or build configuration entry,
creates the list of configurations per builder and platform.
(BuildbotSyncer._parseRepositoryGroup): Added the support for parsing the new format with revision,
roots, and patch option types with a lot of validations as we're seeing a bit of combinatorial
explosion in the number of things that can go wrong. Also parse buildProperties optionally.
(BuildbotSyncer._parseRepositoryGroupPropertyTemplate): Added. A helper function to parse a set of
buildbot properties, validates its content, and invokes a callback if it's an dynamically resolved
type such as "revision" and "patch".
(BuildbotSyncer._validateAndMergeConfig): Updated per the format change. No longer allows "types",
"type", "platforms", and "platform" as they're explicity resolved in _resolveBuildersWithPlatforms.

* tools/js/buildbot-triggerable.js:
(BuildbotTriggerable.prototype.syncOnce):
(BuildbotTriggerable.prototype._validateRequests): Handle the case when a build request is not
associated with any test.
(BuildbotTriggerable.prototype._nextRequestInGroup): Return null when there is a build request to
build a patch which has not been completed (pending, scheduled, running, or failed). Since all
requests to build a patch has a negative order, those requests should all show up at the beginning.
(BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable): Pick a new buildbot syncer when
scheduling the first request to build a patch or the first request to run a test. The first request
to run a test will always have order of 0, so it's a sufficient condition to find such a request.
On the other hand, the first request to build a patch can have a negative order number so we must
explicitly check if it's the first item in the ordered list of requests in the test group.

* tools/remote-server-relay.log: Added.

* tools/sync-buildbot.js:
(syncLoop): Fixed a bug we were not re-fetching the triggerable after updating the triggerable so
that Triggerable and related objects we have in the memory may not reflect what we just synced to
the perf dashboard. Also, we don't reset V3 models manually any more since Manifest.fetch does that.

* unit-tests/buildbot-syncer-tests.js: Added more test cases and updated existing test cases to test
exception messages explicitly since allowing any exception was resulting in some tests passing a
result of unrelated parsing error being thrown, etc...
(sampleiOSConfig): Updated per the format change.
(sampleiOSConfigWithExpansions): Ditto.
(smallConfiguration): Ditto.

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

2 years ago[WPE] Rebaseline test
csaavedra@igalia.com [Wed, 24 May 2017 18:40:44 +0000 (18:40 +0000)]
[WPE] Rebaseline test

Unreviewed gardening after a series of changes to dom static properties.

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

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

2 years ago[WPE] Rebaseline test
csaavedra@igalia.com [Wed, 24 May 2017 18:39:05 +0000 (18:39 +0000)]
[WPE] Rebaseline test

Unreviewed gardening after a series of changes to dom static properties.

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

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

2 years ago[WK2] Remove workaround to disable zooming to the focus rect while performing a data...
wenson_hsieh@apple.com [Wed, 24 May 2017 18:38:53 +0000 (18:38 +0000)]
[WK2] Remove workaround to disable zooming to the focus rect while performing a data interaction
https://bugs.webkit.org/show_bug.cgi?id=172546

Reviewed by Beth Dakin.

Removes a now-unnecessary workaround to prevent scrolling when performing a data interaction operation in
editable content.

* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _displayFormNodeInputView]):

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

2 years agoResource Load Statistics: Change grandfathering default to one hour
wilander@apple.com [Wed, 24 May 2017 17:36:56 +0000 (17:36 +0000)]
Resource Load Statistics: Change grandfathering default to one hour
https://bugs.webkit.org/show_bug.cgi?id=172524
<rdar://problem/32360462>

Reviewed by Brent Fulgham.

Source/WebCore:

Covered by existing test.

* loader/ResourceLoadStatisticsStore.cpp:

Source/WebKit2:

* Shared/WebPreferencesDefinitions.h:
* UIProcess/WebResourceLoadStatisticsManager.cpp:
(WebKit::WebResourceLoadStatisticsManager::resetToConsistentState):

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

2 years agoRename DisplaySleepDisabler -> SleepDisabler
jer.noble@apple.com [Wed, 24 May 2017 16:39:57 +0000 (16:39 +0000)]
Rename DisplaySleepDisabler -> SleepDisabler
https://bugs.webkit.org/show_bug.cgi?id=172478

Reviewed by Sam Weinig.

Source/WebCore:

Rename DisplaySleepDisabler to SleepDisabler so that different (i.e., non-Display) sleep types can be
added in a future change.

* WebCore.xcodeproj/project.pbxproj:
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::updateSleepDisabling):
* html/HTMLMediaElement.h:
* platform/SleepDisabler.cpp: Renamed from Source/WebCore/platform/DisplaySleepDisabler.cpp.
(WebCore::SleepDisabler::create):
(WebCore::SleepDisabler::SleepDisabler):
(WebCore::SleepDisabler::~SleepDisabler):
* platform/SleepDisabler.h: Renamed from Source/WebCore/platform/DisplaySleepDisabler.h.
* platform/cocoa/SleepDisablerCocoa.cpp: Renamed from Source/WebCore/platform/cocoa/DisplaySleepDisablerCocoa.cpp.
(WebCore::SleepDisabler::create):
(WebCore::SleepDisablerCocoa::SleepDisablerCocoa):
(WebCore::SleepDisablerCocoa::~SleepDisablerCocoa):
* platform/cocoa/SleepDisablerCocoa.h: Renamed from Source/WebCore/platform/cocoa/DisplaySleepDisablerCocoa.h.
* platform/mac/WebVideoFullscreenController.h:
* platform/mac/WebVideoFullscreenController.mm:
(-[WebVideoFullscreenController updatePowerAssertions]):
* CMakeLists.txt:
* PlatformMac.cmake:
* WebCore.order:

Source/WebKit/mac:

* WebView/WebFullScreenController.h:

Source/WebKit2:

* UIProcess/mac/WKFullScreenWindowController.h:
* UIProcess/mac/WKFullScreenWindowController.mm:

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

2 years ago[Win] Create unique network storage session for each DRT.
pvollan@apple.com [Wed, 24 May 2017 16:22:13 +0000 (16:22 +0000)]
[Win] Create unique network storage session for each DRT.
https://bugs.webkit.org/show_bug.cgi?id=172540

Reviewed by Brent Fulgham.

During layout testing, each DRT instance should have its own network storage session.

Source/WebCore:

* platform/network/cf/NetworkStorageSessionCFNet.cpp:
(WebCore::NetworkStorageSession::switchToNewTestingSession):

Source/WebKit/win:

* Interfaces/IWebPreferencesPrivate.idl:
* WebPreferences.cpp:
(WebPreferences::switchNetworkLoaderToNewTestingSession):
* WebPreferences.h:

Tools:

* DumpRenderTree/win/DumpRenderTree.cpp:
(prepareConsistentTestingEnvironment):

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

2 years ago[WebIDL] Overloaded functions unnecessarily duplicate argument checks
weinig@apple.com [Wed, 24 May 2017 16:08:31 +0000 (16:08 +0000)]
[WebIDL] Overloaded functions unnecessarily duplicate argument checks
https://bugs.webkit.org/show_bug.cgi?id=172481

Reviewed by Chris Dumez.

* bindings/scripts/CodeGeneratorJS.pm:
(GenerateHeader):
(GeneratePropertiesHashTable):
Update for rename of GetConditionalForFunctionConsideringOverloads.

(AreTypesDistinguishableForOverloadResolution):
Remove unnecessary subroutine isDictionary that can be replaced by
a direct call to $codeGenerator->IsDictionaryType().

(GetConditionalForFunctionConsideringOverloads):
Renamed from getConditionalForFunctionConsideringOverloads.

(GenerateOverloadDispatcher):
Renamed from GenerateOverloadedFunctionOrConstructor. Moved Constructor/Operation/LegacyCaller
specific code out, and into parameters.

(GenerateImplementation):
Moved operation generation out into its own subroutine.

(GenerateOperationDefinition): Added.
Moved from GenerateImplementation.

(GenerateLegacyCallerDefinitions):
Pass function name and signature to GenerateOverloadDispatcher.

(GenerateArgumentsCountCheck):
Don't generate an argument check if this is an overloaded function. The argument
checks happen in the overload dispatcher.

(NeedsExplicitPropagateExceptionCall):
(GenerateParametersCheck):
(GenerateImplementationFunctionCall):
Replace IsReturningPromise with more direct check.

(GenerateConstructorDefinitions):
Pass function name and signature to GenerateOverloadDispatcher.

(getConditionalForFunctionConsideringOverloads): Renamed to GetConditionalForFunctionConsideringOverloads.
(GenerateOverloadedFunctionOrConstructor): Renamed to GenerateOverloadDispatcher.
(IsReturningPromise): Deleted.

* bindings/scripts/test/JS/JSTestGlobalObject.cpp:
* bindings/scripts/test/JS/JSTestInterface.cpp:
* bindings/scripts/test/JS/JSTestObj.cpp:
* bindings/scripts/test/TestInterface.idl:
Update test results.

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

2 years ago[ATK] Gardening needed after r217171
jdiggs@igalia.com [Wed, 24 May 2017 15:40:03 +0000 (15:40 +0000)]
[ATK] Gardening needed after r217171
https://bugs.webkit.org/show_bug.cgi?id=172539

Unreviewed test gardening after r217171.

Add "PASS successfullyParsed is true" and "TEST COMPLETE" lines for
tests with platform-specific expectations.

* accessibility/multiselect-list-reports-active-option-expected.txt:
* accessibility/table-cells-roles-expected.txt:
* platform/gtk/accessibility/aria-checkbox-sends-notification-expected.txt:
* platform/gtk/accessibility/aria-switch-sends-notification-expected.txt:
* platform/gtk/accessibility/deleting-iframe-destroys-axcache-expected.txt:
* platform/gtk/accessibility/menu-list-sends-change-notification-expected.txt:
* platform/gtk/accessibility/table-roles-hierarchy-expected.txt:

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

2 years agoUnreviewed, rolling out r217319.
commit-queue@webkit.org [Wed, 24 May 2017 10:47:44 +0000 (10:47 +0000)]
Unreviewed, rolling out r217319.
https://bugs.webkit.org/show_bug.cgi?id=172538

This patch broke iOS Simulator Debug build (Requested by fredw
on #webkit).

Reverted changeset:

"CoreAudioCaptureSource is ducking system sound"
https://bugs.webkit.org/show_bug.cgi?id=172512
http://trac.webkit.org/changeset/217319

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

2 years ago[WinCairo] AcceleratedCompositingContext.h: error C3668: 'AcceleratedCompositingConte...
commit-queue@webkit.org [Wed, 24 May 2017 09:50:20 +0000 (09:50 +0000)]
[WinCairo] AcceleratedCompositingContext.h: error C3668: 'AcceleratedCompositingContext::paintContents': method with override specifier 'override' did not override any base class methods
https://bugs.webkit.org/show_bug.cgi?id=172535

Patch by Fujii Hironori <Hironori.Fujii@sony.com> on 2017-05-24
Reviewed by Konstantin Tokarev.

* WebCoreSupport/AcceleratedCompositingContext.cpp:
(AcceleratedCompositingContext::paintContents): Append the fifth argument.
* WebCoreSupport/AcceleratedCompositingContext.h: Ditto.

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

2 years ago[mac-wk1] LayoutTest media/modern-media-controls/airplay-button/airplay-button.html...
commit-queue@webkit.org [Wed, 24 May 2017 09:00:59 +0000 (09:00 +0000)]
[mac-wk1] LayoutTest media/modern-media-controls/airplay-button/airplay-button.html is a flaky timeout
https://bugs.webkit.org/show_bug.cgi?id=168409

Unreviewed.

Remove temporary logging which prevents performance bots from reporting useful data.

Patch by Antoine Quint <graouts@apple.com> on 2017-05-24

* page/Page.cpp:
(WebCore::Page::suspendScriptedAnimations):

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

2 years ago[css-grid] Ignore collapsed tracks on content-distribution alignment
jfernandez@igalia.com [Wed, 24 May 2017 08:35:02 +0000 (08:35 +0000)]
[css-grid] Ignore collapsed tracks on content-distribution alignment
https://bugs.webkit.org/show_bug.cgi?id=172493

Reviewed by Manuel Rego Casasnovas.

Source/WebCore:

The CSS Box Alignment spec states that we should ignore the collapsed
tracks when computing the Distribution Alignment space to assign to the
different grid tracks.

No new tests, just unskipping the web-platform-tests imported to verify this use case.

* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::populateGridPositionsForDirection):

LayoutTests:

Unskip the web-platform-tests related to content-alignment and collapsed tracks.

* TestExpectations:

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

2 years agoRespect image UTIs when writing to item providers when beginning data interaction...
wenson_hsieh@apple.com [Wed, 24 May 2017 07:21:22 +0000 (07:21 +0000)]
Respect image UTIs when writing to item providers when beginning data interaction on an image
https://bugs.webkit.org/show_bug.cgi?id=172436
<rdar://problem/31786569>

Reviewed by Beth Dakin.

Source/WebCore:

Previously, when beginning writing images to the WebItemProviderPasteboard, we would create a new UIImage and
use standard UIImage UIItemProviderWriting utilities to register the image to the pasteboard. This is lossy for
gifs, since UIImage doesn't inherently know how to represent gifs. Instead, register the raw image data directly
to the UTI type corresponding to the MIME type of the image, and use UIImage's item provider writing capability
as a fallback when the raw resourceData is unavailable.

Augments existing unit tests, and also adds a new unit test:
DataInteractionTests.ImageDoesNotUseElementSizeAsEstimatedSize

* platform/ios/PlatformPasteboardIOS.mm:
(WebCore::PlatformPasteboard::writeObjectRepresentations):

Tools:

Tweaks existing unit tests and adds a new test for image data interaction. See WebCore ChangeLog for more
details.

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKit2Cocoa/apple.gif: Added.
* TestWebKitAPI/Tests/WebKit2Cocoa/gif-and-file-input.html: Added.

Create a new test page containing a GIF and a file input.

* TestWebKitAPI/Tests/ios/DataInteractionTests.mm:
(checkTypeIdentifierIsRegisteredAtIndex):
(TestWebKitAPI::TEST):

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

2 years ago[Win] Increase test timeout for slow tests.
pvollan@apple.com [Wed, 24 May 2017 06:25:31 +0000 (06:25 +0000)]
[Win] Increase test timeout for slow tests.
https://bugs.webkit.org/show_bug.cgi?id=172449

Reviewed by Alexey Proskuryakov.

Instead of using a fixed timeout of 30 seconds for all tests, we should use the
timeout member in the TestRunner class.

* DumpRenderTree/win/TestRunnerWin.cpp:
(TestRunner::setWaitToDump):

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

2 years agoCoreAudioCaptureSource is ducking system sound
eric.carlson@apple.com [Wed, 24 May 2017 05:39:22 +0000 (05:39 +0000)]
CoreAudioCaptureSource is ducking system sound
https://bugs.webkit.org/show_bug.cgi?id=172512

Reviewed by Youenn Fablet.

Manual testing.

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

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

2 years agoResource Load Statistics: Don't include HSTS cache data in website data removal
wilander@apple.com [Wed, 24 May 2017 03:42:41 +0000 (03:42 +0000)]
Resource Load Statistics: Don't include HSTS cache data in website data removal
https://bugs.webkit.org/show_bug.cgi?id=172525
<rdar://problem/32332704>

Reviewed by Brent Fulgham.

* UIProcess/WebResourceLoadStatisticsStore.cpp:
(WebKit::initializeDataTypesToRemove):

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

2 years agoWeb Inspector: content views are not restored on reload if its tree element is filter...
mattbaker@apple.com [Wed, 24 May 2017 01:09:18 +0000 (01:09 +0000)]
Web Inspector: content views are not restored on reload if its tree element is filtered out
https://bugs.webkit.org/show_bug.cgi?id=165744
<rdar://problem/27461323>

Reviewed by Devin Rousso.

By default, NavigationSidebar should get the selected represented object
from its content browser, instead of relying on the tree selection. This
allows a filtered tree selection to persist across page loads.

* UserInterface/Views/NavigationSidebarPanel.js:
(WebInspector.NavigationSidebarPanel.prototype.get currentRepresentedObject):
(WebInspector.NavigationSidebarPanel.prototype.saveStateToCookie):
Get the represented object from the content browser instead of relying
on the tree selection (which can be filtered out).

(WebInspector.NavigationSidebarPanel.prototype._updateFilter):
(WebInspector.NavigationSidebarPanel.prototype._treeElementAddedOrChanged):
(WebInspector.NavigationSidebarPanel.prototype._treeElementWasFiltered):
Reselect the represented object's tree element when it is shown due
to a change in the filter state.

(WebInspector.NavigationSidebarPanel.prototype.get hasSelectedElement): Deleted.
Not used.
(WebInspector.NavigationSidebarPanel.prototype.representedObjectWasFiltered): Deleted.
Not used. Replaced by _treeElementWasFiltered.

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

2 years ago[iOS] Speculative fix for a PLT regression
said@apple.com [Wed, 24 May 2017 01:06:25 +0000 (01:06 +0000)]
[iOS] Speculative fix for a PLT regression
<rdar://problem/32361890>

Unreviewed.

Make sure CGImageSourceGetTypeWithData() is called with a buffer which is
32 bytes or more.

* platform/graphics/cg/ImageDecoderCG.cpp:
(WebCore::ImageDecoder::ImageDecoder):

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

2 years ago[WebCrypto] Support RSA-PSS
jiewen_tan@apple.com [Wed, 24 May 2017 00:33:23 +0000 (00:33 +0000)]
[WebCrypto] Support RSA-PSS
https://bugs.webkit.org/show_bug.cgi?id=170869
<rdar://problem/31640672>

Reviewed by Brent Fulgham.

Source/WebCore:

This patch implements RSA-PSS according to the spec: https://www.w3.org/TR/WebCryptoAPI/#rsa-pss.
Supported operations include sign, verify, generateKey, importKey and exportKey.

Tests: crypto/subtle/rsa-pss-generate-export-key-jwk-sha1.html
       crypto/subtle/rsa-pss-generate-export-key-jwk-sha224.html
       crypto/subtle/rsa-pss-generate-export-key-jwk-sha256.html
       crypto/subtle/rsa-pss-generate-export-key-jwk-sha384.html
       crypto/subtle/rsa-pss-generate-export-key-jwk-sha512.html
       crypto/subtle/rsa-pss-generate-export-key-pkcs8.html
       crypto/subtle/rsa-pss-generate-export-key-spki.html
       crypto/subtle/rsa-pss-generate-key.html
       crypto/subtle/rsa-pss-import-jwk-private-key.html
       crypto/subtle/rsa-pss-import-jwk-public-key-empty-usages.html
       crypto/subtle/rsa-pss-import-jwk-public-key-sha1.html
       crypto/subtle/rsa-pss-import-jwk-public-key-sha224.html
       crypto/subtle/rsa-pss-import-jwk-public-key-sha256.html
       crypto/subtle/rsa-pss-import-jwk-public-key-sha384.html
       crypto/subtle/rsa-pss-import-jwk-public-key-sha512.html
       crypto/subtle/rsa-pss-import-key-sign-large-salt.html
       crypto/subtle/rsa-pss-import-key-sign.html
       crypto/subtle/rsa-pss-import-key-verify.html
       crypto/subtle/rsa-pss-import-pkcs8-key.html
       crypto/subtle/rsa-pss-import-spki-key-empty-usages.html
       crypto/subtle/rsa-pss-import-spki-key.html
       crypto/workers/subtle/rsa-pss-import-key-sign.html
       crypto/workers/subtle/rsa-pss-import-key-verify.html

* CMakeLists.txt:
* DerivedSources.make:
* PlatformGTK.cmake:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSSubtleCryptoCustom.cpp:
(WebCore::normalizeCryptoAlgorithmParameters):
* crypto/CryptoAlgorithmParameters.h:
* crypto/algorithms/CryptoAlgorithmRSA_PSS.cpp: Added.
(WebCore::CryptoAlgorithmRSA_PSS::create):
(WebCore::CryptoAlgorithmRSA_PSS::identifier):
(WebCore::CryptoAlgorithmRSA_PSS::sign):
(WebCore::CryptoAlgorithmRSA_PSS::verify):
(WebCore::CryptoAlgorithmRSA_PSS::generateKey):
(WebCore::CryptoAlgorithmRSA_PSS::importKey):
(WebCore::CryptoAlgorithmRSA_PSS::exportKey):
* crypto/algorithms/CryptoAlgorithmRSA_PSS.h: Added.
* crypto/mac/CryptoAlgorithmECDSAMac.cpp:
(WebCore::cryptoDigestAlgorithm): Deleted.
Extract function cryptoDigestAlgorithm to a separate file.
* crypto/mac/CryptoAlgorithmRSASSA_PKCS1_v1_5Mac.cpp:
(WebCore::cryptoDigestAlgorithm): Deleted.
Extract function cryptoDigestAlgorithm to a separate file.
* crypto/mac/CryptoAlgorithmRSA_PSSMac.cpp: Added.
(WebCore::signRSA_PSS):
(WebCore::verifyRSA_PSS):
(WebCore::CryptoAlgorithmRSA_PSS::platformSign):
(WebCore::CryptoAlgorithmRSA_PSS::platformVerify):
* crypto/mac/CryptoAlgorithmRegistryMac.cpp:
(WebCore::CryptoAlgorithmRegistry::platformRegisterAlgorithms):
* crypto/mac/CryptoDigestAlgorithm.h: Added.
(WebCore::cryptoDigestAlgorithm):
Have cryptoDigestAlgorithm in a separate file.
* crypto/parameters/CryptoAlgorithmRsaPssParams.h: Added.
* crypto/parameters/RsaPssParams.idl: Added.

Source/WTF:

* wtf/Platform.h:
Add a flag to enable RSA-PSS in the future.

LayoutTests:

* TestExpectations:
Skip tests related to RSA-PSS for now.
* crypto/subtle/rsa-generate-key-malformed-parameters-expected.txt:
* crypto/subtle/rsa-generate-key-malformed-parameters.html:
* crypto/subtle/rsa-import-key-malformed-parameters-expected.txt:
* crypto/subtle/rsa-import-key-malformed-parameters.html:
* crypto/subtle/rsa-pss-generate-export-key-jwk-sha1-expected.txt: Added.
* crypto/subtle/rsa-pss-generate-export-key-jwk-sha1.html: Added.
* crypto/subtle/rsa-pss-generate-export-key-jwk-sha224-expected.txt: Added.
* crypto/subtle/rsa-pss-generate-export-key-jwk-sha224.html: Added.
* crypto/subtle/rsa-pss-generate-export-key-jwk-sha256-expected.txt: Added.
* crypto/subtle/rsa-pss-generate-export-key-jwk-sha256.html: Added.
* crypto/subtle/rsa-pss-generate-export-key-jwk-sha384-expected.txt: Added.
* crypto/subtle/rsa-pss-generate-export-key-jwk-sha384.html: Added.
* crypto/subtle/rsa-pss-generate-export-key-jwk-sha512-expected.txt: Added.
* crypto/subtle/rsa-pss-generate-export-key-jwk-sha512.html: Added.
* crypto/subtle/rsa-pss-generate-export-key-pkcs8-expected.txt: Added.
* crypto/subtle/rsa-pss-generate-export-key-pkcs8.html: Added.
* crypto/subtle/rsa-pss-generate-export-key-spki-expected.txt: Added.
* crypto/subtle/rsa-pss-generate-export-key-spki.html: Added.
* crypto/subtle/rsa-pss-generate-key-expected.txt: Added.
* crypto/subtle/rsa-pss-generate-key.html: Added.
* crypto/subtle/rsa-pss-import-jwk-private-key-expected.txt: Added.
* crypto/subtle/rsa-pss-import-jwk-private-key.html: Added.
* crypto/subtle/rsa-pss-import-jwk-public-key-empty-usages-expected.txt: Added.
* crypto/subtle/rsa-pss-import-jwk-public-key-empty-usages.html: Added.
* crypto/subtle/rsa-pss-import-jwk-public-key-sha1-expected.txt: Added.
* crypto/subtle/rsa-pss-import-jwk-public-key-sha1.html: Added.
* crypto/subtle/rsa-pss-import-jwk-public-key-sha224-expected.txt: Added.
* crypto/subtle/rsa-pss-import-jwk-public-key-sha224.html: Added.
* crypto/subtle/rsa-pss-import-jwk-public-key-sha256-expected.txt: Added.
* crypto/subtle/rsa-pss-import-jwk-public-key-sha256.html: Added.
* crypto/subtle/rsa-pss-import-jwk-public-key-sha384-expected.txt: Added.
* crypto/subtle/rsa-pss-import-jwk-public-key-sha384.html: Added.
* crypto/subtle/rsa-pss-import-jwk-public-key-sha512-expected.txt: Added.
* crypto/subtle/rsa-pss-import-jwk-public-key-sha512.html: Added.
* crypto/subtle/rsa-pss-import-key-sign-expected.txt: Added.
* crypto/subtle/rsa-pss-import-key-sign-large-salt-expected.txt: Added.
* crypto/subtle/rsa-pss-import-key-sign-large-salt.html: Added.
* crypto/subtle/rsa-pss-import-key-sign.html: Added.
* crypto/subtle/rsa-pss-import-key-verify-expected.txt: Added.
* crypto/subtle/rsa-pss-import-key-verify.html: Added.
* crypto/subtle/rsa-pss-import-pkcs8-key-expected.txt: Added.
* crypto/subtle/rsa-pss-import-pkcs8-key.html: Added.
* crypto/subtle/rsa-pss-import-spki-key-empty-usages-expected.txt: Added.
* crypto/subtle/rsa-pss-import-spki-key-empty-usages.html: Added.
* crypto/subtle/rsa-pss-import-spki-key-expected.txt: Added.
* crypto/subtle/rsa-pss-import-spki-key.html: Added.
* crypto/workers/subtle/resources/rsa-pss-import-key-sign.js: Added.
* crypto/workers/subtle/resources/rsa-pss-import-key-verify.js: Added.
* crypto/workers/subtle/rsa-pss-import-key-sign-expected.txt: Added.
* crypto/workers/subtle/rsa-pss-import-key-sign.html: Added.
* crypto/workers/subtle/rsa-pss-import-key-verify-expected.txt: Added.
* crypto/workers/subtle/rsa-pss-import-key-verify.html: Added.

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

2 years agoWe should not mmap zero bytes for a memory in Wasm
sbarati@apple.com [Wed, 24 May 2017 00:32:12 +0000 (00:32 +0000)]
We should not mmap zero bytes for a memory in Wasm
https://bugs.webkit.org/show_bug.cgi?id=172528
<rdar://problem/32257076>

Reviewed by Mark Lam.

JSTests:

* wasm/js-api/dont-mmap-zero-byte-memory.js: Added.
(testMems):

Source/JavaScriptCore:

This patch fixes a bug where we would call into mmap with zero bytes
when creating a slow WasmMemory with zero initial page size. This fix
is simple: if we don't have any initial bytes, we just call the constructor
in WasmMemory that's meant to handle this case.

* wasm/WasmMemory.cpp:
(JSC::Wasm::Memory::create):

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

2 years agoSome async tests ignore jsTestIsAsync when ported from js-test-pre.js / js-test-post...
cdumez@apple.com [Wed, 24 May 2017 00:27:24 +0000 (00:27 +0000)]
Some async tests ignore jsTestIsAsync when ported from js-test-pre.js / js-test-post.js to js-test.js
https://bugs.webkit.org/show_bug.cgi?id=172523

Reviewed by Ryosuke Niwa.

* TestExpectations:
This test used to be flaky because jsTestIsAsync was ignored. It now consistently times out.

* fast/dom/script-charset-update.html:
Port test to js-test.js instead of js-test-pre.js / js-test-post.js now that it works.

* fast/mediacapturefromelement/CanvasCaptureMediaStream-webgl-events-expected.txt:
Rebaseline test now that it actually runs to the end.

* platform/ios-wk2/TestExpectations:
* platform/mac-wk2/TestExpectations:
Remove expectation for a test that is now skipped in root TestExpectations file.

* resources/js-test.js:
Call testRunner.waitUntilDone() in the DOMContentLoader event listener if jsTestIsAsync is already
set then, instead of waiting for the load event listener to do so. This is needed because some
tests may decide to complete *before* the load event has fired, such as the test updated in this
patch. We still need to call testRunner.waitUntilDone() in the load event listener as well because
some tests only set jsTestIsAsync in a load event handler.

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

2 years ago[MediaStream] Allow transition from autoplay to play when a capture stream begins.
eric.carlson@apple.com [Wed, 24 May 2017 00:07:21 +0000 (00:07 +0000)]
[MediaStream] Allow transition from autoplay to play when a capture stream begins.
https://bugs.webkit.org/show_bug.cgi?id=172391
<rdar://problem/32304934>

Reviewed by Youenn Fablet.

Manual testing. Regression testing to be added as a follow-up.

* dom/Document.cpp:
(WebCore::Document::updateIsPlayingMedia): Call mediaStreamCaptureStateChanged when capture
state changes.
(WebCore::Document::registerForMediaStreamStateChangeCallbacks):
(WebCore::Document::unregisterForMediaStreamStateChangeCallbacks):
(WebCore::Document::mediaStreamCaptureStateChanged): Call all registered elements.
* dom/Document.h:
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::registerWithDocument): Register for capture state changes.
(WebCore::HTMLMediaElement::unregisterWithDocument): Unregister for capture state changes.
(WebCore::HTMLMediaElement::mediaStreamCaptureStateChanged): Attempt autoplay as necessary.
* html/HTMLMediaElement.h:

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

2 years agoReplace autoplay events that fire at navigation with a DidAutoplayMediaPastThreshold...
mrajca@apple.com [Wed, 24 May 2017 00:01:44 +0000 (00:01 +0000)]
Replace autoplay events that fire at navigation with a DidAutoplayMediaPastThreshold event.
https://bugs.webkit.org/show_bug.cgi?id=172138

Reviewed by Alex Christensen.

Source/WebCore:

The current autoplay signals that are fired at navigation may not get delivered to the UIProcess if the WebPage is close()'ed around
this time. This patch simplifies this and just notifies clients if a media element has played past a threshold.

Updated API tests.

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::playbackProgressTimerFired):
(WebCore::HTMLMediaElement::mediaPlayerTimeChanged):
(WebCore::HTMLMediaElement::stopWithoutDestroyingMediaPlayer):
(WebCore::HTMLMediaElement::userDidInterfereWithAutoplay):
* page/AutoplayEvent.h:

Source/WebKit2:

Updated auto-play event types.

* Shared/WebCoreArgumentCoders.h:
* UIProcess/API/C/WKPage.cpp:
(WKPageSetPageUIClient):
* UIProcess/API/C/WKPageUIClient.h:

Tools:

Added API tests.

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKit2/js-autoplay-audio.html: Added.
* TestWebKitAPI/Tests/WebKit2Cocoa/WebsitePolicies.mm:
(TEST):
* TestWebKitAPI/Tests/WebKit2Cocoa/silence-long.m4a: Added.

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

2 years agoREGRESSION(r217051): Automation sessions fail to complete bootstrap
bburg@apple.com [Wed, 24 May 2017 00:01:41 +0000 (00:01 +0000)]
REGRESSION(r217051): Automation sessions fail to complete bootstrap
https://bugs.webkit.org/show_bug.cgi?id=172513
<rdar://problem/32338354>

Reviewed by Joseph Pecoraro.

The changes to be more strict about typechecking messages were too strict.

* inspector/remote/cocoa/RemoteInspectorCocoa.mm:
(Inspector::RemoteInspector::receivedSetupMessage):
WIRAutomatically is an optional key in the setup message. In the relay, this key gets copied
into an NSDictionary as NSNull if the key isn't present in a forwarded command.
We need to revert NSNull values to nil, since it's valid to call [nil boolValue] but not
[[NSNull null] boolValue]. We also need to allow for nil in the typecheck for this key.

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

2 years agoRebaseline tests for iOS simulator.
ryanhaddad@apple.com [Wed, 24 May 2017 00:00:09 +0000 (00:00 +0000)]
Rebaseline tests for iOS simulator.

Unreviewed test gardening.

* fast/events/ios/rotation/basic-rotation-expected.txt:
* fast/events/touch/ios/block-without-overflow-scroll-and-passive-observer-on-block-scrolling-state-expected.txt:
* fast/events/touch/ios/block-without-overflow-scroll-and-passive-observer-on-document-scrolling-state-expected.txt:
* fast/events/touch/ios/block-without-overflow-scroll-scrolling-state-expected.txt:
* fast/events/touch/ios/tap-with-active-touch-end-listener-expected.txt:
* fast/visual-viewport/ios/zoomed-focus-in-fixed-expected.txt:

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

2 years agoASSERT(!m_timeoutTimer.isActive()) hit in BackgroundProcessResponsivenessTimer::respo...
cdumez@apple.com [Tue, 23 May 2017 23:45:41 +0000 (23:45 +0000)]
ASSERT(!m_timeoutTimer.isActive()) hit in BackgroundProcessResponsivenessTimer::responsivenessCheckTimerFired()
https://bugs.webkit.org/show_bug.cgi?id=172509
<rdar://problem/32251578>

Reviewed by Geoffrey Garen.

In the BackgroundProcessResponsivenessTimer class, we have 2 timers:
- m_responsivenessCheckTimer that causes us to do an IPC handshake with
  the WebProcess.
- m_timeoutTimer that is started when we send the IPC message to the
  WebProcess and which is stopped when we get the response from the
  WebProcess. If we do not get the response by the time m_timeoutTimer
  fires, then we mark the process as unresponsive.

As a result, of the behavior above, whenever the BackgroundProcessResponsivenessTimer
is considered "active", there should be one of the 2 timers above that
is active, and only one.

The assertion hit showed that we decided to start the m_responsivenessCheckTimer
timer even though the m_timeoutTimer timer is still active (we are still waiting
for an IPC message from the WebProcess and the process is not considered
unresponsive yet), which is wrong. The reason was that in
BackgroundProcessResponsivenessTimer::updateState(), if we should be active,
we would start the m_responsivenessCheckTimer if m_responsivenessCheckTimer is
not already active, without checking if m_timeoutTimer is active. So if
updateState() was called while the IPC handshake was in process, we would have
both timers running at the same time.

* UIProcess/BackgroundProcessResponsivenessTimer.cpp:
(WebKit::BackgroundProcessResponsivenessTimer::updateState):
(WebKit::BackgroundProcessResponsivenessTimer::isActive):
* UIProcess/BackgroundProcessResponsivenessTimer.h:

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

2 years agoWeb Inspector: Cannot delete a disabled XHR breakpoint
mattbaker@apple.com [Tue, 23 May 2017 22:58:23 +0000 (22:58 +0000)]
Web Inspector: Cannot delete a disabled XHR breakpoint
https://bugs.webkit.org/show_bug.cgi?id=171971
<rdar://problem/32129527>

Reviewed by Devin Rousso.

Source/WebInspectorUI:

* UserInterface/Controllers/DOMDebuggerManager.js:
(WebInspector.DOMDebuggerManager.prototype.removeXHRBreakpoint):
Dispatch XHRBreakpointRemoved event before removing the breakpoint from
the backend. A disabled breakpoint will have already been removed, and
an enabled breakpoint that fails to get removed from the backend should
be removed from the frontend, to prevent it being resolved in the future.
Drive-by fix: remove spurious dispatch of DOMBreakpointRemoved event.

(WebInspector.DOMDebuggerManager.prototype._detachXHRBreakpoint): Deleted.
Merged with removeXHRBreakpoint to simplify implementation.

LayoutTests:

* inspector/dom-debugger/xhr-breakpoints-expected.txt:
* inspector/dom-debugger/xhr-breakpoints.html:

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

2 years agoSkip crashing css-display-3/display-contents tests.
ryanhaddad@apple.com [Tue, 23 May 2017 22:55:10 +0000 (22:55 +0000)]
Skip crashing css-display-3/display-contents tests.
https://bugs.webkit.org/show_bug.cgi?id=172503

Unreviewed test gardening.

* TestExpectations:

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

2 years agoStop consulting -viewsNeedDisplay when doing layer flushing in WebKit1
simon.fraser@apple.com [Tue, 23 May 2017 21:44:21 +0000 (21:44 +0000)]
Stop consulting -viewsNeedDisplay when doing layer flushing in WebKit1
https://bugs.webkit.org/show_bug.cgi?id=172522
rdar://problem/31071812

Source/WebKit/mac:

Reviewed by Tim Horton.

There's no need to consult -[NSWindow viewsNeedDisplay] on newer OSes. It was
added in r58623, and modified in r61204 for Carbon apps, but with more recent AppKit
versions this synchronization is no longer required.

* WebView/WebView.mm:
(LayerFlushController::flushLayers):

Tools:

Reviewed by Sam Weinig.

Remove NSWindowStyleMaskFullSizeContentView which is no longer referenced in code.
We set this in the .xib file now.

* MiniBrowser/mac/MiniBrowser_Prefix.pch:

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

2 years agoMove css-scoping-1 test suite to WPT
rego@igalia.com [Tue, 23 May 2017 21:33:33 +0000 (21:33 +0000)]
Move css-scoping-1 test suite to WPT
https://bugs.webkit.org/show_bug.cgi?id=172500

Reviewed by Youenn Fablet.

csswg-test repo was merged into web-platform-tests a while ago,
this patch moves the css-scoping-1 test suite to the new path.

* csswg-test/css-scoping-1/w3c-import.log: Removed.
* resources/import-expectations.json:
* web-platform-tests/css/css-scoping-1/OWNERS: Renamed from LayoutTests/imported/w3c/csswg-test/css-scoping-1/OWNERS.
* web-platform-tests/css/css-scoping-1/css-scoping-shadow-assigned-node-with-before-after-expected.html: Renamed from LayoutTests/imported/w3c/csswg-test/css-scoping-1/css-scoping-shadow-assigned-node-with-before-after-expected.html.
* web-platform-tests/css/css-scoping-1/css-scoping-shadow-assigned-node-with-before-after.html: Renamed from LayoutTests/imported/w3c/csswg-test/css-scoping-1/css-scoping-shadow-assigned-node-with-before-after.html.
* web-platform-tests/css/css-scoping-1/css-scoping-shadow-assigned-node-with-rules-expected.html: Renamed from LayoutTests/imported/w3c/csswg-test/css-scoping-1/css-scoping-shadow-assigned-node-with-rules-expected.html.
* web-platform-tests/css/css-scoping-1/css-scoping-shadow-assigned-node-with-rules.html: Renamed from LayoutTests/imported/w3c/csswg-test/css-scoping-1/css-scoping-shadow-assigned-node-with-rules.html.
* web-platform-tests/css/css-scoping-1/css-scoping-shadow-host-functional-rule-expected.html: Renamed from LayoutTests/imported/w3c/csswg-test/css-scoping-1/css-scoping-shadow-host-functional-rule-expected.html.
* web-platform-tests/css/css-scoping-1/css-scoping-shadow-host-functional-rule.html: Renamed from LayoutTests/imported/w3c/csswg-test/css-scoping-1/css-scoping-shadow-host-functional-rule.html.
* web-platform-tests/css/css-scoping-1/css-scoping-shadow-host-rule-expected.html: Renamed from LayoutTests/imported/w3c/csswg-test/css-scoping-1/css-scoping-shadow-host-rule-expected.html.
* web-platform-tests/css/css-scoping-1/css-scoping-shadow-host-rule.html: Renamed from LayoutTests/imported/w3c/csswg-test/css-scoping-1/css-scoping-shadow-host-rule.html.
* web-platform-tests/css/css-scoping-1/css-scoping-shadow-host-with-before-after-expected.html: Renamed from LayoutTests/imported/w3c/csswg-test/css-scoping-1/css-scoping-shadow-host-with-before-after-expected.html.
* web-platform-tests/css/css-scoping-1/css-scoping-shadow-host-with-before-after.html: Renamed from LayoutTests/imported/w3c/csswg-test/css-scoping-1/css-scoping-shadow-host-with-before-after.html.
* web-platform-tests/css/css-scoping-1/css-scoping-shadow-invisible-slot-expected.html: Renamed from LayoutTests/imported/w3c/csswg-test/css-scoping-1/css-scoping-shadow-invisible-slot-expected.html.
* web-platform-tests/css/css-scoping-1/css-scoping-shadow-invisible-slot.html: Renamed from LayoutTests/imported/w3c/csswg-test/css-scoping-1/css-scoping-shadow-invisible-slot.html.
* web-platform-tests/css/css-scoping-1/css-scoping-shadow-root-hides-children-expected.html: Renamed from LayoutTests/imported/w3c/csswg-test/css-scoping-1/css-scoping-shadow-root-hides-children-expected.html.
* web-platform-tests/css/css-scoping-1/css-scoping-shadow-root-hides-children.html: Renamed from LayoutTests/imported/w3c/csswg-test/css-scoping-1/css-scoping-shadow-root-hides-children.html.
* web-platform-tests/css/css-scoping-1/css-scoping-shadow-slot-display-override-expected.html: Renamed from LayoutTests/imported/w3c/csswg-test/css-scoping-1/css-scoping-shadow-slot-display-override-expected.html.
* web-platform-tests/css/css-scoping-1/css-scoping-shadow-slot-display-override.html: Renamed from LayoutTests/imported/w3c/csswg-test/css-scoping-1/css-scoping-shadow-slot-display-override.html.
* web-platform-tests/css/css-scoping-1/css-scoping-shadow-slot-expected.html: Renamed from LayoutTests/imported/w3c/csswg-test/css-scoping-1/css-scoping-shadow-slot-expected.html.
* web-platform-tests/css/css-scoping-1/css-scoping-shadow-slot-fallback-expected.html: Renamed from LayoutTests/imported/w3c/csswg-test/css-scoping-1/css-scoping-shadow-slot-fallback-expected.html.
* web-platform-tests/css/css-scoping-1/css-scoping-shadow-slot-fallback.html: Renamed from LayoutTests/imported/w3c/csswg-test/css-scoping-1/css-scoping-shadow-slot-fallback.html.
* web-platform-tests/css/css-scoping-1/css-scoping-shadow-slot-style-expected.html: Renamed from LayoutTests/imported/w3c/csswg-test/css-scoping-1/css-scoping-shadow-slot-style-expected.html.
* web-platform-tests/css/css-scoping-1/css-scoping-shadow-slot-style.html: Renamed from LayoutTests/imported/w3c/csswg-test/css-scoping-1/css-scoping-shadow-slot-style.html.
* web-platform-tests/css/css-scoping-1/css-scoping-shadow-slot.html: Renamed from LayoutTests/imported/w3c/csswg-test/css-scoping-1/css-scoping-shadow-slot.html.
* web-platform-tests/css/css-scoping-1/css-scoping-shadow-slotted-nested-expected.html: Renamed from LayoutTests/imported/w3c/csswg-test/css-scoping-1/css-scoping-shadow-slotted-nested-expected.html.
* web-platform-tests/css/css-scoping-1/css-scoping-shadow-slotted-nested.html: Renamed from LayoutTests/imported/w3c/csswg-test/css-scoping-1/css-scoping-shadow-slotted-nested.html.
* web-platform-tests/css/css-scoping-1/css-scoping-shadow-slotted-rule-expected.html: Renamed from LayoutTests/imported/w3c/csswg-test/css-scoping-1/css-scoping-shadow-slotted-rule-expected.html.
* web-platform-tests/css/css-scoping-1/css-scoping-shadow-slotted-rule.html: Renamed from LayoutTests/imported/w3c/csswg-test/css-scoping-1/css-scoping-shadow-slotted-rule.html.
* web-platform-tests/css/css-scoping-1/css-scoping-shadow-with-outside-rules-expected.html: Renamed from LayoutTests/imported/w3c/csswg-test/css-scoping-1/css-scoping-shadow-with-outside-rules-expected.html.
* web-platform-tests/css/css-scoping-1/css-scoping-shadow-with-outside-rules.html: Renamed from LayoutTests/imported/w3c/csswg-test/css-scoping-1/css-scoping-shadow-with-outside-rules.html.
* web-platform-tests/css/css-scoping-1/css-scoping-shadow-with-rules-expected.html: Renamed from LayoutTests/imported/w3c/csswg-test/css-scoping-1/css-scoping-shadow-with-rules-expected.html.
* web-platform-tests/css/css-scoping-1/css-scoping-shadow-with-rules-no-style-leak-expected.html: Renamed from LayoutTests/imported/w3c/csswg-test/css-scoping-1/css-scoping-shadow-with-rules-no-style-leak-expected.html.
* web-platform-tests/css/css-scoping-1/css-scoping-shadow-with-rules-no-style-leak.html: Renamed from LayoutTests/imported/w3c/csswg-test/css-scoping-1/css-scoping-shadow-with-rules-no-style-leak.html.
* web-platform-tests/css/css-scoping-1/css-scoping-shadow-with-rules.html: Renamed from LayoutTests/imported/w3c/csswg-test/css-scoping-1/css-scoping-shadow-with-rules.html.
* web-platform-tests/css/css-scoping-1/shadow-cascade-order-001-expected.txt: Renamed from LayoutTests/imported/w3c/csswg-test/css-scoping-1/shadow-cascade-order-001-expected.txt.
* web-platform-tests/css/css-scoping-1/shadow-cascade-order-001.html: Renamed from LayoutTests/imported/w3c/csswg-test/css-scoping-1/shadow-cascade-order-001.html.
* web-platform-tests/css/css-scoping-1/w3c-import.log: Added.

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

2 years agoMarked imported/w3c/web-platform-tests/css/css-display-3/display-contents-dynamic...
jlewis3@apple.com [Tue, 23 May 2017 21:30:37 +0000 (21:30 +0000)]
Marked imported/w3c/web-platform-tests/css/css-display-3/display-contents-dynamic-flex-002-inline.html as failing.
https://bugs.webkit.org/show_bug.cgi?id=172515

Unreviewed test gardening.

* TestExpectations:

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

2 years agoRegression(r215229): ASSERTION FAILED: !m_scriptHash || m_scriptHash == m_script...
cdumez@apple.com [Tue, 23 May 2017 21:06:23 +0000 (21:06 +0000)]
Regression(r215229): ASSERTION FAILED: !m_scriptHash || m_scriptHash == m_script.impl()->hash()
https://bugs.webkit.org/show_bug.cgi?id=171091
<rdar://problem/31752046>

Reviewed by Geoffrey Garen.

* fast/dom/resources/script-with-unicode.js: Added.
* fast/dom/script-charset-update-expected.txt: Added.
* fast/dom/script-charset-update.html: Added.
Add test that was consistently hitting the assertion in debug builds before
r215229 was rolled out.

* fast/loader/cache-encoding-expected.txt:
* fast/loader/cache-encoding.html:
Improve test to check that it is actually getting a SyntaxError the first time,
when it loads the script with the wrong encoding. Apparently this test was not
clear enough because it was updated / disabled in r215229, but was showing a
real bug.

* platform/ios-wk2/TestExpectations:
* platform/mac-wk2/TestExpectations:
Unskip test was should no longer be flaky now that r215229 has been rolled out.

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

2 years agoMarked imported/w3c/web-platform-tests/webrtc/getstats.html as flaky.
jlewis3@apple.com [Tue, 23 May 2017 20:59:09 +0000 (20:59 +0000)]
Marked imported/w3c/web-platform-tests/webrtc/getstats.html as flaky.
https://bugs.webkit.org/show_bug.cgi?id=172521

Unreviewed test gardening.

* platform/ios-wk2/TestExpectations:
* platform/mac-wk2/TestExpectations:

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

2 years agocheckGPUStatus needs to exercise instancing calls
dino@apple.com [Tue, 23 May 2017 20:49:58 +0000 (20:49 +0000)]
checkGPUStatus needs to exercise instancing calls
https://bugs.webkit.org/show_bug.cgi?id=172520
<rdar://problem/23118395>

Reviewed by Brent Fulgham.

Source/WebCore:

The checkGPUStatus method (formerly checkGPUStatusIfNecessary) was
not being called after the drawArrays/Elements instancing calls.

I also added a test case to exercise the recovery logic.

Test: fast/canvas/webgl/lose-context-on-status-failure.html

* html/canvas/WebGLRenderingContextBase.cpp:
(WebCore::WebGLRenderingContextBase::setFailNextGPUStatusCheck): Force
the next checkGPUStatus on the GC3D to fail.
* html/canvas/WebGLRenderingContextBase.h:
* platform/graphics/GraphicsContext3D.h: Rename a function, and make
the number of calls we wait before checking per instance, rather than
static (which might have meant we're only ever checking after one canvas on
a page with multiple contexts).
(WebCore::GraphicsContext3D::setFailNextGPUStatusCheck):
* platform/graphics/cairo/GraphicsContext3DCairo.cpp:
(WebCore::GraphicsContext3D::checkGPUStatus): Renamed.
(WebCore::GraphicsContext3D::checkGPUStatusIfNecessary): Deleted.
* platform/graphics/mac/GraphicsContext3DMac.mm:
(WebCore::GraphicsContext3D::checkGPUStatus): Improve the logic.
(WebCore::GraphicsContext3D::checkGPUStatusIfNecessary): Deleted.
* platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
(WebCore::GraphicsContext3D::clear):
(WebCore::GraphicsContext3D::drawArrays):
(WebCore::GraphicsContext3D::drawElements):
(WebCore::GraphicsContext3D::drawArraysInstanced): Add a call to checkGPUStatus.
(WebCore::GraphicsContext3D::drawElementsInstanced): Ditto.
* platform/graphics/opengl/GraphicsContext3DOpenGLES.cpp:
(WebCore::GraphicsContext3D::checkGPUStatus):
(WebCore::GraphicsContext3D::checkGPUStatusIfNecessary): Deleted.
* testing/Internals.cpp: Implement the internal call to cause the next
check to fail.
(WebCore::Internals::failNextGPUStatusCheck):
* testing/Internals.h:
* testing/Internals.idl:

LayoutTests:

* fast/canvas/webgl/lose-context-on-status-failure-expected.txt: Added.
* fast/canvas/webgl/lose-context-on-status-failure.html: Added.

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

2 years ago[WebIDL] Further cleanup enumeration handling
commit-queue@webkit.org [Tue, 23 May 2017 20:49:09 +0000 (20:49 +0000)]
[WebIDL] Further cleanup enumeration handling
https://bugs.webkit.org/show_bug.cgi?id=172516

Patch by Sam Weinig <sam@webkit.org> on 2017-05-23
Reviewed by Chris Dumez.

* bindings/scripts/CodeGeneratorJS.pm:
(GeneratePut):
(GeneratePutByIndex):
(GenerateDictionaryImplementationContent):
(GenerateParametersCheck):
(GenerateCallbackImplementationContent):
Update now that JSValueToNative doesn't have a second return value.

(GenerateImplementation):
Add enumeration special casing to attribute setting code, where it is special
cased in the standard

(PassArgumentExpression):
Stop special casing enumerations.

(IsValidContextForJSValueToNative):
Assert that enums are never passed to JSValueToNative in an attribute context.

(JSValueToNative):
Remove enumeration special case and second return value (which was always 1).

* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::setJSTestObjEnumAttrFunction):
(WebCore::setJSTestObjImplementationEnumAttrFunction):
(WebCore::setJSTestObjAttributeWithReservedEnumTypeFunction):
Update results.

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

2 years agoSnapshotting via -renderInContext: should do synchronous image decodes
simon.fraser@apple.com [Tue, 23 May 2017 20:44:10 +0000 (20:44 +0000)]
Snapshotting via -renderInContext: should do synchronous image decodes
https://bugs.webkit.org/show_bug.cgi?id=172485
rdar://problem/32276146

Reviewed by Tim Horton.

Source/WebCore:

When UIWebView clients snapshot the view via -renderInContext: on the UIView's layer,
WebKit should do synchronous image decodes so that the images show in the snapshot.

Fix by plumbing through a "snapshotting" paint behavior flag from two source locations:
WebSimpleLayer, used by compositing layers, and LegacyTileLayer, used for the WK1 tile cache.
On WebSimpleLayer the flag propagates through PlatformCALayer to GraphicsLayer, and on LegacyTileLayer
it sets some state on the WAKWindow, which is detected by -[WebFrame _paintBehaviorForDestinationContext:].
In both cases, the flag becomes PaintBehaviorSnapshotting which is passed down through painting
in PaintInfo.paintBehavior.

Fix code that was checking paintBehavior on the FrameView to just looking at PaintInfo.paintBehavior,
which required passing PaintInfo along in RenderImage::paintIntoRect().

We can't just use the PaintBehaviorFlattenCompositingLayers flag, because that triggers
a flattening paint of compositing layers, and we don't want that behavior for -renderInContext:,
since CoreAnimation calls -renderInContext: on each of our layers and we need to avoid double-painting.
So PaintBehaviorSnapshotting is now added to the call sites that also set PaintBehaviorFlattenCompositingLayers
in most cases.

Tested by SnapshotViaRenderInContext API test.

* html/shadow/MediaControlElements.cpp:
(WebCore::MediaControlTextTrackContainerElement::createTextTrackRepresentationImage):
* page/FrameView.cpp:
(WebCore::FrameView::willPaintContents):
(WebCore::FrameView::paintContentsForSnapshot):
* page/PageOverlayController.cpp:
(WebCore::PageOverlayController::paintContents):
* page/PageOverlayController.h:
* page/mac/ServicesOverlayController.h:
* page/mac/ServicesOverlayController.mm:
(WebCore::ServicesOverlayController::Highlight::paintContents):
* platform/graphics/GraphicsLayer.cpp:
(WebCore::GraphicsLayer::paintGraphicsLayerContents):
* platform/graphics/GraphicsLayer.h:
* platform/graphics/GraphicsLayerClient.h:
(WebCore::GraphicsLayerClient::paintContents):
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::recursiveCommitChanges):
(WebCore::GraphicsLayerCA::platformCALayerPaintContents):
* platform/graphics/ca/GraphicsLayerCA.h:
* platform/graphics/ca/PlatformCALayer.h:
* platform/graphics/ca/PlatformCALayerClient.h:
* platform/graphics/ca/TileCoverageMap.cpp:
(WebCore::TileCoverageMap::platformCALayerPaintContents):
* platform/graphics/ca/TileCoverageMap.h:
* platform/graphics/ca/TileGrid.cpp:
(WebCore::TileGrid::platformCALayerPaintContents):
* platform/graphics/ca/TileGrid.h:
* platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
(PlatformCALayer::drawLayerContents):
* platform/graphics/mac/WebLayer.mm:
(-[WebLayer drawInContext:]):
(-[WebSimpleLayer renderInContext:]):
(-[WebSimpleLayer drawInContext:]):
* platform/ios/LegacyTileCache.h: Use initializers.
* platform/ios/LegacyTileCache.mm:
(WebCore::LegacyTileCache::LegacyTileCache):
(WebCore::LegacyTileCache::drawWindowContent):
(WebCore::LegacyTileCache::drawLayer):
* platform/ios/LegacyTileLayer.h:
* platform/ios/LegacyTileLayer.mm:
(-[LegacyTileHostLayer renderInContext:]):
(-[LegacyTileLayer renderInContext:]):
(-[LegacyTileLayer drawInContext:]):
(+[LegacyTileLayer layerBeingPainted]): Deleted. There were no callers.
* platform/ios/wak/WAKView.mm:
(-[WAKView _drawRect:context:lockFocus:]): bool -> BOOL
* platform/ios/wak/WAKWindow.h:
* platform/ios/wak/WAKWindow.mm:
(-[WAKWindow setIsInSnapshottingPaint:]):
(-[WAKWindow isInSnapshottingPaint]):
* rendering/PaintPhase.h:
* rendering/RenderBox.cpp:
(WebCore::RenderBox::paintMaskImages):
* rendering/RenderBoxModelObject.cpp:
(WebCore::RenderBoxModelObject::paintFillLayerExtended):
* rendering/RenderImage.cpp:
(WebCore::RenderImage::paintReplaced):
(WebCore::RenderImage::paintIntoRect):
* rendering/RenderImage.h:
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::paintLayerContents):
(WebCore::RenderLayer::paintForegroundForFragments):
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::paintContents):
* rendering/RenderLayerBacking.h:
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::paintContents):
* rendering/RenderLayerCompositor.h:
* rendering/RenderVideo.cpp:
(WebCore::RenderVideo::paintReplaced):

Source/WebKit/mac:

Remove the _setIncludesFlattenedCompositingLayersWhenDrawingToBitmap: SPI that no longer
has any callers.

* Plugins/WebBaseNetscapePluginView.h:
* Plugins/WebBaseNetscapePluginView.mm:
(-[WebBaseNetscapePluginView inFlatteningPaint]): Deleted.
* WebView/WebFrame.mm:
(-[WebFrame _paintBehaviorForDestinationContext:]):
(-[WebFrame _drawRect:contentsOnly:]):
(-[WebFrame _shouldFlattenCompositingLayers:]): Deleted.
* WebView/WebHTMLView.mm:
(imageFromRect):
* WebView/WebView.mm:
(-[WebView _commonInitializationWithFrameName:groupName:]):
(-[WebView _setIncludesFlattenedCompositingLayersWhenDrawingToBitmap:]): Deleted.
(-[WebView _includesFlattenedCompositingLayersWhenDrawingToBitmap]): Deleted.
* WebView/WebViewData.h:
* WebView/WebViewPrivate.h:

Source/WebKit2:

Pass the PaintBehaviorSnapshotting flag in functions that do snapshotting.

* Shared/mac/RemoteLayerBackingStore.mm:
(WebKit::RemoteLayerBackingStore::drawInContext):
* WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp:
(WebKit::imageForRect):
* WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.cpp:
(WebKit::InjectedBundleRangeHandle::renderedImage):

Tools:

New API test.

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKit/ios/SnapshotViaRenderInContext.mm: Added.
(-[RenderInContextWebViewDelegate webViewDidFinishLoad:]):
(-[RenderInContextWebViewDelegate webView:didFailLoadWithError:]):
(TestWebKitAPI::getPixelIndex):
(TestWebKitAPI::TEST):

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

2 years agoWeb Inspector: use initialLayout for NetworkSidebarPanel
drousso@apple.com [Tue, 23 May 2017 20:34:52 +0000 (20:34 +0000)]
Web Inspector: use initialLayout for NetworkSidebarPanel
https://bugs.webkit.org/show_bug.cgi?id=172470

Reviewed by Joseph Pecoraro.

* UserInterface/Views/NetworkSidebarPanel.js:
(WebInspector.NetworkSidebarPanel):
(WebInspector.NetworkSidebarPanel.prototype.showDefaultContentView):
(WebInspector.NetworkSidebarPanel.prototype.initialLayout):
Don't create NetworkGridContentView until right before it is shown.

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

2 years ago[css-grid] Import css/css-grid-1/alignment/ from WPT (8df7c9c215)
rego@igalia.com [Tue, 23 May 2017 20:31:53 +0000 (20:31 +0000)]
[css-grid] Import css/css-grid-1/alignment/ from WPT (8df7c9c215)
https://bugs.webkit.org/show_bug.cgi?id=172494

Reviewed by Youenn Fablet.

LayoutTests/imported/w3c:

This patch imports the new alignment tests for the CSS Grid Layout test suite
from WPT repository. It also needs to start importing "css/reference" folder
as some of the new tests were pointing to reference files there
and the importer wasn't able to get them.

* resources/import-expectations.json:
* web-platform-tests/css/css-grid-1/alignment/grid-content-distribution-001-expected.html: Added.
* web-platform-tests/css/css-grid-1/alignment/grid-content-distribution-001.html: Added.
* web-platform-tests/css/css-grid-1/alignment/grid-content-distribution-002-expected.html: Added.
* web-platform-tests/css/css-grid-1/alignment/grid-content-distribution-002.html: Added.
* web-platform-tests/css/css-grid-1/alignment/grid-content-distribution-003-expected.html: Added.
* web-platform-tests/css/css-grid-1/alignment/grid-content-distribution-003.html: Added.
* web-platform-tests/css/css-grid-1/alignment/grid-content-distribution-004-expected.html: Added.
* web-platform-tests/css/css-grid-1/alignment/grid-content-distribution-004.html: Added.
* web-platform-tests/css/css-grid-1/alignment/grid-content-distribution-005-expected.html: Added.
* web-platform-tests/css/css-grid-1/alignment/grid-content-distribution-005.html: Added.
* web-platform-tests/css/css-grid-1/alignment/grid-content-distribution-006-expected.html: Added.
* web-platform-tests/css/css-grid-1/alignment/grid-content-distribution-006.html: Added.
* web-platform-tests/css/css-grid-1/alignment/grid-content-distribution-007-expected.html: Added.
* web-platform-tests/css/css-grid-1/alignment/grid-content-distribution-007.html: Added.
* web-platform-tests/css/css-grid-1/alignment/grid-content-distribution-008-expected.html: Added.
* web-platform-tests/css/css-grid-1/alignment/grid-content-distribution-008.html: Added.
* web-platform-tests/css/css-grid-1/alignment/grid-content-distribution-009-expected.html: Added.
* web-platform-tests/css/css-grid-1/alignment/grid-content-distribution-009.html: Added.
* web-platform-tests/css/css-grid-1/alignment/grid-content-distribution-010-expected.html: Added.
* web-platform-tests/css/css-grid-1/alignment/grid-content-distribution-010.html: Added.
* web-platform-tests/css/css-grid-1/alignment/grid-content-distribution-011-expected.html: Added.
* web-platform-tests/css/css-grid-1/alignment/grid-content-distribution-011.html: Added.
* web-platform-tests/css/css-grid-1/alignment/grid-content-distribution-012-expected.html: Added.
* web-platform-tests/css/css-grid-1/alignment/grid-content-distribution-012.html: Added.
* web-platform-tests/css/css-grid-1/alignment/grid-content-distribution-013-expected.html: Added.
* web-platform-tests/css/css-grid-1/alignment/grid-content-distribution-013.html: Added.
* web-platform-tests/css/css-grid-1/alignment/grid-content-distribution-014-expected.html: Added.
* web-platform-tests/css/css-grid-1/alignment/grid-content-distribution-014.html: Added.
* web-platform-tests/css/css-grid-1/alignment/grid-content-distribution-015-expected.html: Added.
* web-platform-tests/css/css-grid-1/alignment/grid-content-distribution-015.html: Added.
* web-platform-tests/css/css-grid-1/alignment/grid-content-distribution-016-expected.html: Added.
* web-platform-tests/css/css-grid-1/alignment/grid-content-distribution-016.html: Added.
* web-platform-tests/css/css-grid-1/alignment/grid-content-distribution-017-expected.html: Added.
* web-platform-tests/css/css-grid-1/alignment/grid-content-distribution-017.html: Added.
* web-platform-tests/css/css-grid-1/alignment/grid-content-distribution-018-expected.html: Added.
* web-platform-tests/css/css-grid-1/alignment/grid-content-distribution-018.html: Added.
* web-platform-tests/css/css-grid-1/alignment/grid-content-distribution-019-expected.html: Added.
* web-platform-tests/css/css-grid-1/alignment/grid-content-distribution-019.html: Added.
* web-platform-tests/css/css-grid-1/alignment/grid-content-distribution-020-expected.html: Added.
* web-platform-tests/css/css-grid-1/alignment/grid-content-distribution-020.html: Added.
* web-platform-tests/css/css-grid-1/alignment/grid-content-distribution-021-expected.html: Added.
* web-platform-tests/css/css-grid-1/alignment/grid-content-distribution-021.html: Added.
* web-platform-tests/css/css-grid-1/alignment/grid-content-distribution-022-expected.html: Added.
* web-platform-tests/css/css-grid-1/alignment/grid-content-distribution-022.html: Added.
* web-platform-tests/css/css-grid-1/alignment/grid-content-distribution-023-expected.html: Added.
* web-platform-tests/css/css-grid-1/alignment/grid-content-distribution-023.html: Added.
* web-platform-tests/css/css-grid-1/alignment/grid-content-distribution-024-expected.html: Added.
* web-platform-tests/css/css-grid-1/alignment/grid-content-distribution-024.html: Added.
* web-platform-tests/css/css-grid-1/alignment/grid-content-distribution-025-expected.html: Added.
* web-platform-tests/css/css-grid-1/alignment/grid-content-distribution-025.html: Added.
* web-platform-tests/css/css-grid-1/alignment/grid-content-distribution-with-collapsed-tracks-001-expected.html: Added.
* web-platform-tests/css/css-grid-1/alignment/grid-content-distribution-with-collapsed-tracks-001.html: Added.
* web-platform-tests/css/css-grid-1/alignment/grid-content-distribution-with-collapsed-tracks-002-expected.html: Added.
* web-platform-tests/css/css-grid-1/alignment/grid-content-distribution-with-collapsed-tracks-002.html: Added.
* web-platform-tests/css/css-grid-1/alignment/grid-content-distribution-with-collapsed-tracks-003-expected.html: Added.
* web-platform-tests/css/css-grid-1/alignment/grid-content-distribution-with-collapsed-tracks-003.html: Added.
* web-platform-tests/css/css-grid-1/alignment/grid-content-distribution-with-collapsed-tracks-004-expected.html: Added.
* web-platform-tests/css/css-grid-1/alignment/grid-content-distribution-with-collapsed-tracks-004.html: Added.
* web-platform-tests/css/css-grid-1/alignment/grid-content-distribution-with-collapsed-tracks-005-expected.html: Added.
* web-platform-tests/css/css-grid-1/alignment/grid-content-distribution-with-collapsed-tracks-005.html: Added.
* web-platform-tests/css/css-grid-1/alignment/grid-content-distribution-with-collapsed-tracks-006-expected.html: Added.
* web-platform-tests/css/css-grid-1/alignment/grid-content-distribution-with-collapsed-tracks-006.html: Added.
* web-platform-tests/css/css-grid-1/alignment/grid-content-distribution-with-collapsed-tracks-007-expected.html: Added.
* web-platform-tests/css/css-grid-1/alignment/grid-content-distribution-with-collapsed-tracks-007.html: Added.
* web-platform-tests/css/css-grid-1/alignment/grid-content-distribution-with-collapsed-tracks-008-expected.html: Added.
* web-platform-tests/css/css-grid-1/alignment/grid-content-distribution-with-collapsed-tracks-008.html: Added.
* web-platform-tests/css/css-grid-1/alignment/grid-content-distribution-with-collapsed-tracks-009-expected.html: Added.
* web-platform-tests/css/css-grid-1/alignment/grid-content-distribution-with-collapsed-tracks-009.html: Added.
* web-platform-tests/css/css-grid-1/alignment/grid-content-distribution-with-collapsed-tracks-010-expected.html: Added.
* web-platform-tests/css/css-grid-1/alignment/grid-content-distribution-with-collapsed-tracks-010.html: Added.
* web-platform-tests/css/css-grid-1/alignment/grid-content-distribution-with-collapsed-tracks-011-expected.html: Added.
* web-platform-tests/css/css-grid-1/alignment/grid-content-distribution-with-collapsed-tracks-011.html: Added.
* web-platform-tests/css/css-grid-1/alignment/grid-content-distribution-with-collapsed-tracks-012-expected.html: Added.
* web-platform-tests/css/css-grid-1/alignment/grid-content-distribution-with-collapsed-tracks-012.html: Added.
* web-platform-tests/css/css-grid-1/alignment/grid-content-distribution-with-collapsed-tracks-013-expected.html: Added.
* web-platform-tests/css/css-grid-1/alignment/grid-content-distribution-with-collapsed-tracks-013.html: Added.
* web-platform-tests/css/css-grid-1/alignment/grid-content-distribution-with-collapsed-tracks-014-expected.html: Added.
* web-platform-tests/css/css-grid-1/alignment/grid-content-distribution-with-collapsed-tracks-014.html: Added.
* web-platform-tests/css/css-grid-1/alignment/grid-content-distribution-with-collapsed-tracks-015-expected.html: Added.
* web-platform-tests/css/css-grid-1/alignment/grid-content-distribution-with-collapsed-tracks-015.html: Added.
* web-platform-tests/css/css-grid-1/alignment/grid-content-distribution-with-collapsed-tracks-016-expected.html: Added.
* web-platform-tests/css/css-grid-1/alignment/grid-content-distribution-with-collapsed-tracks-016.html: Added.
* web-platform-tests/css/css-grid-1/alignment/grid-content-distribution-with-collapsed-tracks-017-expected.html: Added.
* web-platform-tests/css/css-grid-1/alignment/grid-content-distribution-with-collapsed-tracks-017.html: Added.
* web-platform-tests/css/css-grid-1/alignment/grid-content-distribution-with-collapsed-tracks-018-expected.html: Added.
* web-platform-tests/css/css-grid-1/alignment/grid-content-distribution-with-collapsed-tracks-018.html: Added.
* web-platform-tests/css/css-grid-1/alignment/grid-content-distribution-with-collapsed-tracks-019-expected.html: Added.
* web-platform-tests/css/css-grid-1/alignment/grid-content-distribution-with-collapsed-tracks-019.html: Added.
* web-platform-tests/css/css-grid-1/alignment/grid-content-distribution-with-collapsed-tracks-020-expected.html: Added.
* web-platform-tests/css/css-grid-1/alignment/grid-content-distribution-with-collapsed-tracks-020.html: Added.
* web-platform-tests/css/css-grid-1/alignment/grid-content-distribution-with-collapsed-tracks-021-expected.html: Added.
* web-platform-tests/css/css-grid-1/alignment/grid-content-distribution-with-collapsed-tracks-021.html: Added.
* web-platform-tests/css/css-grid-1/alignment/grid-content-distribution-with-collapsed-tracks-022-expected.html: Added.
* web-platform-tests/css/css-grid-1/alignment/grid-content-distribution-with-collapsed-tracks-022.html: Added.
* web-platform-tests/css/css-grid-1/alignment/grid-content-distribution-with-collapsed-tracks-023-expected.html: Added.
* web-platform-tests/css/css-grid-1/alignment/grid-content-distribution-with-collapsed-tracks-023.html: Added.
* web-platform-tests/css/css-grid-1/alignment/grid-content-distribution-with-collapsed-tracks-024-expected.html: Added.
* web-platform-tests/css/css-grid-1/alignment/grid-content-distribution-with-collapsed-tracks-024.html: Added.
* web-platform-tests/css/css-grid-1/alignment/w3c-import.log: Added.
* web-platform-tests/css/css-grid-1/grid-items/w3c-import.log:
* web-platform-tests/css/css-grid-1/grid-model/w3c-import.log:
* web-platform-tests/css/reference/OWNERS: Added.
* web-platform-tests/css/reference/pass_if_filler_text_match_bold-expected.xht: Added.
* web-platform-tests/css/reference/pass_if_filler_text_match_bold.xht: Added.
* web-platform-tests/css/reference/pass_if_filler_text_match_smallcaps-expected.xht: Added.
* web-platform-tests/css/reference/pass_if_filler_text_match_smallcaps.xht: Added.
* web-platform-tests/css/reference/pass_if_filler_text_underlined-expected.html: Added.
* web-platform-tests/css/reference/pass_if_filler_text_underlined.html: Added.
* web-platform-tests/css/reference/w3c-import.log: Added.

LayoutTests:

* TestExpectations: Mark as failure a few tests due to bug #172493.

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

2 years agoRemove dead ENABLE(FONT_LOAD_EVENTS) code
mmaxfield@apple.com [Tue, 23 May 2017 20:24:38 +0000 (20:24 +0000)]
Remove dead ENABLE(FONT_LOAD_EVENTS) code
https://bugs.webkit.org/show_bug.cgi?id=172517

Rubber-stamped by Simon Fraser.

.:

* Source/cmake/OptionsMac.cmake:
* Source/cmake/WebKitFeatures.cmake:

Source/JavaScriptCore:

* Configurations/FeatureDefines.xcconfig:

Source/WebCore:

No new tests because there is no behavior change.

* CMakeLists.txt:
* Configurations/FeatureDefines.xcconfig:
* DerivedSources.cpp:
* DerivedSources.make:
* WebCore.xcodeproj/project.pbxproj:
* css/CSSAllInOne.cpp:
* css/CSSFontFaceLoadEvent.cpp: Removed.
* css/CSSFontFaceLoadEvent.h: Removed.
* css/CSSFontFaceLoadEvent.idl: Removed.
* dom/EventNames.in:
* page/FrameView.cpp:
(WebCore::FrameView::performPostLayoutTasks):
* page/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::setFontLoadEventsEnabled): Deleted.
(WebCore::RuntimeEnabledFeatures::fontLoadEventsEnabled): Deleted.

Source/WebCore/PAL:

No new tests because there is no behavior change.

* Configurations/FeatureDefines.xcconfig:

Source/WebKit/mac:

* Configurations/FeatureDefines.xcconfig:

Source/WebKit2:

* Configurations/FeatureDefines.xcconfig:

Source/WTF:

* wtf/FeatureDefines.h:

Tools:

* TestWebKitAPI/Configurations/FeatureDefines.xcconfig:

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

2 years agoMany editing js-tests use waitUntilDone
ap@apple.com [Tue, 23 May 2017 20:23:23 +0000 (20:23 +0000)]
Many editing js-tests use waitUntilDone
https://bugs.webkit.org/show_bug.cgi?id=172401

Reviewed by Ryosuke Niwa.

Corrected the use of js-test harness, updated the tests to use js-test.js instead
of js-test-pre.js where possible.

* editing/caret/ios/absolute-caret-position-after-scroll.html:
* editing/caret/ios/fixed-caret-position-after-scroll.html:
* editing/input/style-change-during-input.html:
* editing/inserting/insert-html-crash.html:
* editing/mac/input/undo-grouping-on-text-insertion.html:
* editing/mac/selection/context-menu-select-editability-expected.txt:
* editing/mac/selection/context-menu-select-editability.html:
* editing/mac/spelling/accept-candidate-undo-does-not-select.html:
* editing/mac/spelling/autocorrection-respets-undo-expected.txt:
* editing/mac/spelling/autocorrection-respets-undo.html:
* editing/pasteboard/drag-and-drop-attachment-contenteditable.html:
* editing/pasteboard/drag-and-drop-image-contenteditable.html:
* editing/pasteboard/drag-and-drop-inputimage-contenteditable.html:
* editing/pasteboard/drag-and-drop-objectimage-contenteditable.html:
* editing/pasteboard/drag-link-with-data-transfer-adds-trusted-link-to-pasteboard-expected.txt:
* editing/pasteboard/drag-link-with-data-transfer-adds-trusted-link-to-pasteboard.html:
* editing/selection/ios/absolute-selection-after-scroll.html:
* editing/selection/ios/fixed-selection-after-scroll.html:
* editing/spelling/copy-paste-crash-expected.txt:
* editing/spelling/copy-paste-crash.html:
* editing/style/apply-style-join-child-text-nodes-crash.html:

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

2 years ago[WTF] Export additional symbols in threading
commit-queue@webkit.org [Tue, 23 May 2017 19:51:44 +0000 (19:51 +0000)]
[WTF] Export additional symbols in threading
https://bugs.webkit.org/show_bug.cgi?id=171952

Patch by Don Olmstead <don.olmstead@am.sony.com> on 2017-05-23
Reviewed by Konstantin Tokarev.

* wtf/ThreadMessage.h:
* wtf/threads/Signals.h:

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

2 years agoUnreviewed, test gardening after r217225
jiewen_tan@apple.com [Tue, 23 May 2017 19:46:39 +0000 (19:46 +0000)]
Unreviewed, test gardening after r217225

* TestExpectations:
Gardening about imported/w3c/web-platform-tests/WebCryptoAPI/

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

2 years agoUnreviewed, roll out r215229
cdumez@apple.com [Tue, 23 May 2017 19:39:16 +0000 (19:39 +0000)]
Unreviewed, roll out r215229

It caused CachedScripts in MemoryCache to be reused with different encodings
even though CachedScript potentially has already decoded data or cached hash
with a previous encoding.

LayoutTests/imported/w3c:

* web-platform-tests/html/semantics/scripting-1/the-script-element/script-charset-01-expected.txt:

Source/WebCore:

* loader/TextResourceDecoder.cpp:
(WebCore::TextResourceDecoder::setEncoding):
* loader/TextResourceDecoder.h:
(WebCore::TextResourceDecoder::sawError):
(WebCore::TextResourceDecoder::encodingSet): Deleted.
* loader/cache/CachedCSSStyleSheet.cpp:
(WebCore::CachedCSSStyleSheet::setEncoding):
* loader/cache/CachedResource.cpp:
(WebCore::CachedResource::CachedResource):
* loader/cache/CachedResource.h:
(WebCore::CachedResource::hasUnknownEncoding):
(WebCore::CachedResource::setHasUnknownEncoding):
* loader/cache/CachedResourceLoader.cpp:
(WebCore::CachedResourceLoader::determineRevalidationPolicy):

LayoutTests:

* TestExpectations:
* fast/loader/cache-encoding-expected.txt:
* fast/loader/cache-encoding.html:
* http/tests/preload/preload-encoding-expected.txt:
* http/tests/preload/preload-encoding.php:

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

2 years agoZoom in/out is slow in Safari with large PDFs
timothy_horton@apple.com [Tue, 23 May 2017 18:58:10 +0000 (18:58 +0000)]
Zoom in/out is slow in Safari with large PDFs
https://bugs.webkit.org/show_bug.cgi?id=172495
<rdar://problem/32338631>

Reviewed by Simon Fraser.

No tests; just a performance improvement.

* WebProcess/Plugins/PDF/PDFPlugin.h:
* WebProcess/Plugins/PDF/PDFPlugin.mm:
(WebKit::PDFPlugin::computePageBoxes):
Use PDFKit instead of CGPDF to compute the first page box, so we can take
advantage of PDFKit optimizations. PDFKit also handles box fallback,
so we don't need to do that ourselves. Stop fetching all the boxes, as
we only seem to use the first one.

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

2 years agoCFGSimplificationPhase should not merge a block with itself
sbarati@apple.com [Tue, 23 May 2017 18:49:15 +0000 (18:49 +0000)]
CFGSimplificationPhase should not merge a block with itself
https://bugs.webkit.org/show_bug.cgi?id=172508
<rdar://problem/28424006>

Reviewed by Keith Miller.

JSTests:

* stress/dont-crash-in-cfg-simplification.js: Added.
(bar):
(baz):
(foo):

Source/JavaScriptCore:

CFGSimplificationPhase can run into or create IR that ends up with a
block that has a Jump to itself, and no other predecessors. It should
gracefully handle such IR. Before this patch, it would not. The only criteria
for merging 'block' with 'targetBlock' used to be that 'targetBlock.predecessors.size() == 1'.
The code is written in such a way that if we merge a block with itself, we
will infinite loop until we run out of memory.

Merging a block with itself does not make sense for a few reasons. First,
we're joining the contents of two blocks. What is the definition of joining
a block with itself? I suppose we could simply unroll this self loop
one level, but that would not be wise because this self loop is by definition
unreachable unless it's the root block in the graph (which I think is
invalid IR since we'd never generate bytecode that would do this).

This patch employs an easy fix: we can't merge a block with itself.

* dfg/DFGCFGSimplificationPhase.cpp:
(JSC::DFG::CFGSimplificationPhase::canMergeBlocks):
(JSC::DFG::CFGSimplificationPhase::run):
(JSC::DFG::CFGSimplificationPhase::convertToJump):
(JSC::DFG::CFGSimplificationPhase::mergeBlocks):

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

2 years agoASSERTION FAILED: !renderer().view().needsLayout() while running media/video-main...
zalan@apple.com [Tue, 23 May 2017 18:37:07 +0000 (18:37 +0000)]
ASSERTION FAILED: !renderer().view().needsLayout() while running media/video-main-content-autoplay.html
https://bugs.webkit.org/show_bug.cgi?id=172476

Reviewed by Simon Fraser.

This patch decouples the layout call logic from the post layout task timer setup.
Just because we are switching over to asynchronous performPostLayoutTasks() it should not stop us from
running layout on a dirty tree (we could encounter a forced layout (which sets m_postLayoutTasksTimer active)
and a subsequent tree mutation during performPostLayoutTasks()).

There are a few different ways to end up here:
root layout is done -> call performPostLayoutTasks() synchronously ->
1. tree stays clean -> no action needed.
2. tree gets dirty -> setup performPostLayoutTasks timer -> run nested layout -> since m_postLayoutTasksTimer is active()
we don't try to run performPostLayoutTasks() while in the nested layout and we return with a clean tree.

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

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

2 years agoSkip LayoutTest imported/w3c/web-platform-tests/innerText/getter.html.
ryanhaddad@apple.com [Tue, 23 May 2017 18:36:35 +0000 (18:36 +0000)]
Skip LayoutTest imported/w3c/web-platform-tests/innerText/getter.html.
https://bugs.webkit.org/show_bug.cgi?id=172514

Unreviewed test gardening.

* TestExpectations:

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

2 years agoMultiple links should be inserted separately when performing data interaction
wenson_hsieh@apple.com [Tue, 23 May 2017 18:27:21 +0000 (18:27 +0000)]
Multiple links should be inserted separately when performing data interaction
https://bugs.webkit.org/show_bug.cgi?id=172489
<rdar://problem/31510832>

Reviewed by Dan Bernstein.

Source/WebCore:

In WebContentReader, URLs are currently always inserted inline. When inserting multiple items, this causes
adjacent links to be inserted on a single line with no break, which is undesirable. To address this, when
appending links from additional items to the existing document fragment in WebContentReader, insert a new space
prior to inserting the anchor element.

New unit test: DataInteractionTests.ExternalSourceMultipleURLsToContentEditable

* editing/ios/EditorIOS.mm:
(WebCore::Editor::WebContentReader::addFragment):

Tweak to add all children of the new fragment, rather than just the first child.

(WebCore::Editor::WebContentReader::readURL):

Tools:

Adds a new test that performs data interaction in a contenteditable with multiple items containing URLs.

* TestWebKitAPI/Tests/ios/DataInteractionTests.mm:
(TestWebKitAPI::TEST):

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

2 years agoREGRESSION: API test WebKit2.WKObject is failing
timothy_horton@apple.com [Tue, 23 May 2017 18:20:34 +0000 (18:20 +0000)]
REGRESSION: API test WebKit2.WKObject is failing
https://bugs.webkit.org/show_bug.cgi?id=172497
<rdar://problem/31694641>

Reviewed by Geoff Garen.

* Shared/Cocoa/WKNSString.mm:
(-[WKNSString superclass]):
(-[WKNSString class]):
Pretend to be NSString instead of the more specific subclass (__NSCFString)
that we actually are. There is code underneath us that assumes that if
-class returns __NSCFString, that the object is a CFStringRef, which is
not true in our case.

* TestWebKitAPI/Tests/WebKit2Cocoa/WKObject.mm:
(TestWebKitAPI::TEST):
Add a test that ensures that we pretend to at least be *some* kind of
NSString, which my first fix would not have passed.

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

2 years ago[WebIDL] Remove some unnecessary specialization for enum types
commit-queue@webkit.org [Tue, 23 May 2017 16:30:37 +0000 (16:30 +0000)]
[WebIDL] Remove some unnecessary specialization for enum types
https://bugs.webkit.org/show_bug.cgi?id=172482

Patch by Sam Weinig <sam@webkit.org> on 2017-05-23
Reviewed by Chris Dumez.

Source/WebCore:

- Removes convertEnumeration template function and generated specialization.
  convert<IDLEnumeration<T>> now does the entire check, and can have specialized
  exceptions.
- Treats enums more like all other types, removing enum specific code in the
  generator.

Also fixes some order of exception bugs as the convertEnumeration<T> implementations
were not correctly catching exceptions thrown in parseEnumeration<T>.

* bindings/js/JSDOMConvertEnumeration.h:
(WebCore::Converter<IDLEnumeration<T>>::convert):
Remove convertEnumeration and move implementation to convert. Add ExceptionThrower
parameter to retain argument conversion exception specialization and allow future
specialization for other contexts.

* bindings/js/JSSubtleCryptoCustom.cpp:
(WebCore::jsSubtleCryptoFunctionImportKeyPromise):
(WebCore::jsSubtleCryptoFunctionExportKeyPromise):
(WebCore::jsSubtleCryptoFunctionWrapKeyPromise):
(WebCore::jsSubtleCryptoFunctionUnwrapKeyPromise):
Switch from convertEnumeration<T> to convert<IDLEnumeration<T>>.

* bindings/scripts/CodeGeneratorJS.pm:
(GetArgumentExceptionFunction):
Add (really move from GenerateParametersCheck) enum specific argument conversion exception.

(PassArgumentExpression):
Allow the enum specific code for attributes to remain by explicitly checking the context.
Attribute setters use parseEnumeration<T> explicitly, as WebIDL mandates slightly different
behavior, specially that they don't throw.

(GenerateEnumerationImplementationContent):
(GenerateEnumerationHeaderContent):
Remove convertEnumeration<T>.

(GenerateParametersCheck):
Remove entire branch devoted to enums. The main parameter check is now mature enough
to handle them.

(JSValueToNative):
Like in PassArgumentExpression, we need to retain the specialize behavior for attributes.
Before, JSValueToNative was only called for enums with a context of IDLAttribute or IDLDictionaryMember,
but now that we use if IDLArguments as well, it makes more sense to make this check in terms
of the odd man out, IDLAttribute.

* bindings/scripts/test/JS/JSTestCallbackInterface.cpp:
* bindings/scripts/test/JS/JSTestCallbackInterface.h:
* bindings/scripts/test/JS/JSTestObj.cpp:
* bindings/scripts/test/JS/JSTestObj.h:
* bindings/scripts/test/JS/JSTestStandaloneDictionary.cpp:
* bindings/scripts/test/JS/JSTestStandaloneDictionary.h:
* bindings/scripts/test/JS/JSTestStandaloneEnumeration.cpp:
* bindings/scripts/test/JS/JSTestStandaloneEnumeration.h:
Update test results.

LayoutTests:

* crypto/subtle/import-key-malformed-parameters-expected.txt:
* fast/files/blob-constructor-expected.txt:
* fast/files/script-tests/blob-constructor.js:
Update test and results for improved order of exceptions. In this case, the conversion
to String throws before the failure to parse the enumeration (which is what the
plain TypeError was).

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

2 years agoImport the css-display-3 css tests.
commit-queue@webkit.org [Tue, 23 May 2017 16:27:36 +0000 (16:27 +0000)]
Import the css-display-3 css tests.
https://bugs.webkit.org/show_bug.cgi?id=172212

Patch by Emilio Cobos Álvarez <ecobos@igalia.com> on 2017-05-23
Reviewed by Chris Dumez.
LayoutTests/imported/w3c:

* resources/import-expectations.json:
* web-platform-tests/css/css-display-3/OWNERS: Added.
* web-platform-tests/css/css-display-3/display-contents-alignment-001-expected.html: Added.
* web-platform-tests/css/css-display-3/display-contents-alignment-001.html: Added.
* web-platform-tests/css/css-display-3/display-contents-alignment-002-expected.html: Added.
* web-platform-tests/css/css-display-3/display-contents-alignment-002.html: Added.
* web-platform-tests/css/css-display-3/display-contents-before-after-001-expected.html: Added.
* web-platform-tests/css/css-display-3/display-contents-before-after-001.html: Added.
* web-platform-tests/css/css-display-3/display-contents-before-after-002-expected.html: Added.
* web-platform-tests/css/css-display-3/display-contents-before-after-002.html: Added.
* web-platform-tests/css/css-display-3/display-contents-block-001-expected.html: Added.
* web-platform-tests/css/css-display-3/display-contents-block-001.html: Added.
* web-platform-tests/css/css-display-3/display-contents-block-002-expected.html: Added.
* web-platform-tests/css/css-display-3/display-contents-block-002.html: Added.
* web-platform-tests/css/css-display-3/display-contents-computed-style-expected.txt: Added.
* web-platform-tests/css/css-display-3/display-contents-computed-style.html: Added.
* web-platform-tests/css/css-display-3/display-contents-dynamic-before-after-001-expected.html: Added.
* web-platform-tests/css/css-display-3/display-contents-dynamic-before-after-001.html: Added.
* web-platform-tests/css/css-display-3/display-contents-dynamic-before-after-first-letter-001-expected.html: Added.
* web-platform-tests/css/css-display-3/display-contents-dynamic-before-after-first-letter-001.html: Added.
* web-platform-tests/css/css-display-3/display-contents-dynamic-flex-001-inline-expected.html: Added.
* web-platform-tests/css/css-display-3/display-contents-dynamic-flex-001-inline.html: Added.
* web-platform-tests/css/css-display-3/display-contents-dynamic-flex-001-none-expected.html: Added.
* web-platform-tests/css/css-display-3/display-contents-dynamic-flex-001-none.html: Added.
* web-platform-tests/css/css-display-3/display-contents-dynamic-flex-002-inline-expected.html: Added.
* web-platform-tests/css/css-display-3/display-contents-dynamic-flex-002-inline.html: Added.
* web-platform-tests/css/css-display-3/display-contents-dynamic-flex-002-none-expected.html: Added.
* web-platform-tests/css/css-display-3/display-contents-dynamic-flex-002-none.html: Added.
* web-platform-tests/css/css-display-3/display-contents-dynamic-flex-003-inline-expected.html: Added.
* web-platform-tests/css/css-display-3/display-contents-dynamic-flex-003-inline.html: Added.
* web-platform-tests/css/css-display-3/display-contents-dynamic-flex-003-none-expected.html: Added.
* web-platform-tests/css/css-display-3/display-contents-dynamic-flex-003-none.html: Added.
* web-platform-tests/css/css-display-3/display-contents-dynamic-inline-flex-001-inline-expected.html: Added.
* web-platform-tests/css/css-display-3/display-contents-dynamic-inline-flex-001-inline.html: Added.
* web-platform-tests/css/css-display-3/display-contents-dynamic-inline-flex-001-none-expected.html: Added.
* web-platform-tests/css/css-display-3/display-contents-dynamic-inline-flex-001-none.html: Added.
* web-platform-tests/css/css-display-3/display-contents-dynamic-list-001-inline-expected.html: Added.
* web-platform-tests/css/css-display-3/display-contents-dynamic-list-001-inline.html: Added.
* web-platform-tests/css/css-display-3/display-contents-dynamic-list-001-none-expected.html: Added.
* web-platform-tests/css/css-display-3/display-contents-dynamic-list-001-none.html: Added.
* web-platform-tests/css/css-display-3/display-contents-dynamic-multicol-001-inline-expected.html: Added.
* web-platform-tests/css/css-display-3/display-contents-dynamic-multicol-001-inline.html: Added.
* web-platform-tests/css/css-display-3/display-contents-dynamic-multicol-001-none-expected.html: Added.
* web-platform-tests/css/css-display-3/display-contents-dynamic-multicol-001-none.html: Added.
* web-platform-tests/css/css-display-3/display-contents-dynamic-table-001-inline-expected.html: Added.
* web-platform-tests/css/css-display-3/display-contents-dynamic-table-001-inline.html: Added.
* web-platform-tests/css/css-display-3/display-contents-dynamic-table-001-none-expected.html: Added.
* web-platform-tests/css/css-display-3/display-contents-dynamic-table-001-none.html: Added.
* web-platform-tests/css/css-display-3/display-contents-dynamic-table-002-inline-expected.html: Added.
* web-platform-tests/css/css-display-3/display-contents-dynamic-table-002-inline.html: Added.
* web-platform-tests/css/css-display-3/display-contents-dynamic-table-002-none-expected.html: Added.
* web-platform-tests/css/css-display-3/display-contents-dynamic-table-002-none.html: Added.
* web-platform-tests/css/css-display-3/display-contents-first-letter-001-expected.html: Added.
* web-platform-tests/css/css-display-3/display-contents-first-letter-001.html: Added.
* web-platform-tests/css/css-display-3/display-contents-first-line-001-expected.html: Added.
* web-platform-tests/css/css-display-3/display-contents-first-line-001.html: Added.
* web-platform-tests/css/css-display-3/display-contents-flex-001-expected.html: Added.
* web-platform-tests/css/css-display-3/display-contents-flex-001.html: Added.
* web-platform-tests/css/css-display-3/display-contents-flex-002-expected.html: Added.
* web-platform-tests/css/css-display-3/display-contents-flex-002.html: Added.
* web-platform-tests/css/css-display-3/display-contents-flex-003-expected.html: Added.
* web-platform-tests/css/css-display-3/display-contents-flex-003.html: Added.
* web-platform-tests/css/css-display-3/display-contents-float-001-expected.html: Added.
* web-platform-tests/css/css-display-3/display-contents-float-001.html: Added.
* web-platform-tests/css/css-display-3/display-contents-inline-001-expected.html: Added.
* web-platform-tests/css/css-display-3/display-contents-inline-001.html: Added.
* web-platform-tests/css/css-display-3/display-contents-inline-flex-001-expected.html: Added.
* web-platform-tests/css/css-display-3/display-contents-inline-flex-001.html: Added.
* web-platform-tests/css/css-display-3/display-contents-list-001-expected.html: Added.
* web-platform-tests/css/css-display-3/display-contents-list-001.html: Added.
* web-platform-tests/css/css-display-3/display-contents-multicol-001-expected.html: Added.
* web-platform-tests/css/css-display-3/display-contents-multicol-001.html: Added.
* web-platform-tests/css/css-display-3/display-contents-oof-001-expected.html: Added.
* web-platform-tests/css/css-display-3/display-contents-oof-001.html: Added.
* web-platform-tests/css/css-display-3/display-contents-oof-002-expected.html: Added.
* web-platform-tests/css/css-display-3/display-contents-oof-002.html: Added.
* web-platform-tests/css/css-display-3/display-contents-replaced-001-expected.html: Added.
* web-platform-tests/css/css-display-3/display-contents-replaced-001.html: Added.
* web-platform-tests/css/css-display-3/display-contents-state-change-001-expected.html: Added.
* web-platform-tests/css/css-display-3/display-contents-state-change-001.html: Added.
* web-platform-tests/css/css-display-3/display-contents-table-001-expected.html: Added.
* web-platform-tests/css/css-display-3/display-contents-table-001.html: Added.
* web-platform-tests/css/css-display-3/display-contents-table-002-expected.html: Added.
* web-platform-tests/css/css-display-3/display-contents-table-002.html: Added.
* web-platform-tests/css/css-display-3/display-contents-td-001-expected.html: Added.
* web-platform-tests/css/css-display-3/display-contents-td-001.html: Added.
* web-platform-tests/css/css-display-3/display-contents-text-only-001-expected.html: Added.
* web-platform-tests/css/css-display-3/display-contents-text-only-001.html: Added.
* web-platform-tests/css/css-display-3/display-contents-tr-001-expected.html: Added.
* web-platform-tests/css/css-display-3/display-contents-tr-001.html: Added.
* web-platform-tests/css/css-display-3/display-flow-root-001-expected.html: Added.
* web-platform-tests/css/css-display-3/display-flow-root-001.html: Added.
* web-platform-tests/css/css-display-3/support/acid.css: Added.
(html, body):
(body):
(.table):
(.itable):
(.caption):
(.cell):
(.row):
(.rowg):
(.head):
(.foot):
(.col):
(.colg):
(.flex):
(.iflex):
(.li):
(.ib):
(.inline):
(.columns):
(.contents):
(.c1):
(.c2):
(.c3):
(.c4):
(.c5):
(.c6):
(.c7):
(.c8):
(.c9):
(.c10):
(.b):
(.ref .c2):
(.ref .b):
(.ref div.contents):
(.ref span.contents):
* web-platform-tests/css/css-display-3/support/swatch-orange.png: Added.
* web-platform-tests/css/css-display-3/support/util.js: Added.
(eachDisplayContentsElementIn):
* web-platform-tests/css/css-display-3/support/w3c-import.log: Added.
* web-platform-tests/css/css-display-3/w3c-import.log: Added.

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

2 years ago[Readable Streams API] Align respondInClosedState with spec
commit-queue@webkit.org [Tue, 23 May 2017 16:24:39 +0000 (16:24 +0000)]
[Readable Streams API] Align respondInClosedState with spec
https://bugs.webkit.org/show_bug.cgi?id=172288

Patch by Romain Bellessort <romain.bellessort@crf.canon.fr> on 2017-05-23
Reviewed by Chris Dumez.

Two changes are implemented in this patch:
- Change #1: An issue was reported to GH [1] while working on respondInClosedState
implementation. This issue has now been fixed, and this patch aligns implementation
with spec [2].
- Change #2: In addition, this patch also fixes a bug that went unnoticed as code
is not yet reachable (usage of controller.@reader is not valid and is therefore
replaced by controller.@controlledReadableStream.@reader).

[1] https://github.com/whatwg/streams/issues/686
[2] https://streams.spec.whatwg.org/#readable-byte-stream-controller-respond-in-closed-state

No added test as:
- Change #1 does not change behavior;
- Change #2 is not testable as the code is not yet reachable.

* Modules/streams/ReadableByteStreamInternals.js:
(readableByteStreamControllerRespondInClosedState): Aligned with spec.

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

2 years ago[WK2][iOS] Add a mach-lookup exception for 'com.apple.analyticsd'
bfulgham@apple.com [Tue, 23 May 2017 16:06:06 +0000 (16:06 +0000)]
[WK2][iOS] Add a mach-lookup exception for 'com.apple.analyticsd'
https://bugs.webkit.org/show_bug.cgi?id=172462
<rdar://problem/32331638>

Reviewed by Alexey Proskuryakov.

* Resources/SandboxProfiles/ios/com.apple.WebKit.Databases.sb:
* Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb:
* Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:

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

2 years ago[WK2][iOS] Adopt a whitelist for XPC services
bfulgham@apple.com [Tue, 23 May 2017 15:57:07 +0000 (15:57 +0000)]
[WK2][iOS] Adopt a whitelist for XPC services
https://bugs.webkit.org/show_bug.cgi?id=172182
<rdar://problem/30669445>

Reviewed by Sam Weinig.

Tell the Sandbox to block all XPC connections that are not explicitly allowed by
the sandbox profile. The default behavior is to allow everything by default.

If the restriction is set before including the standard iOS sandbox profiles, there
does not seem to be a need to white list any other services.

General web browsing on multiple devices indicate that these sandbox profiles work
properly with media, accessibility, webgl, and general web content.

* Resources/SandboxProfiles/ios/com.apple.WebKit.Databases.sb:
* Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb:
* Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:

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

2 years agoThere should be an easy way to run HTTP/WPT served tests on a browser
commit-queue@webkit.org [Tue, 23 May 2017 15:56:12 +0000 (15:56 +0000)]
There should be an easy way to run HTTP/WPT served tests on a browser
https://bugs.webkit.org/show_bug.cgi?id=172068

Patch by youenn fablet <youenn@apple.com> on 2017-05-23
Reviewed by Sam Weinig.

Tools:

Adding a new script open-layout-test to open a layout-test in a
browser and making sure it is served as done through run-webkit-tests.
In case tests should be run using a server, detecting whether the
server are running. If not, calling run-webkit-httpd to run the
servers and open the URL in a browser.
Otherwise, open directly the URL.

Adding an option in run-webkit-httpd to open an URL after having
started the servers.

Adding the --no-http-servers option in run-webkit-tests to not start any HTTP server.
This allows running run-webkit-httpd once and not having to restart
servers everytime a test should be served.

Moving most of run-webkit-httpd logic in its own python file to reuse
it in open-layout-test script.

Adding routines to check whether HTTP and WPT servers are running.

* Scripts/open-layout-test: Added.
(parse_args):
(main):
* Scripts/run-webkit-httpd:
(main):
* Scripts/webkitpy/layout_tests/controllers/layout_test_finder.py:
(LayoutTestFinder.find_tests):
* Scripts/webkitpy/layout_tests/controllers/layout_test_runner.py:
(LayoutTestRunner.run_tests):
* Scripts/webkitpy/layout_tests/run_webkit_tests.py:
(parse_args):
* Scripts/webkitpy/layout_tests/servers/http_server_base.py:
(HttpServerBase._is_server_running_on_all_ports):
(HttpServerBase):
(HttpServerBase._is_running_on_port):
(HttpServerBase._check_that_all_ports_are_available):
(is_http_server_running):
* Scripts/webkitpy/layout_tests/servers/run_webkit_httpd.py: Copied from Tools/Scripts/run-webkit-httpd.
(parse_args):
(main):
(run_server):
* Scripts/webkitpy/layout_tests/servers/web_platform_test_server.py:
(is_wpt_server_running):
* Scripts/webkitpy/port/base.py:
(Port.to.is_http_server_running):
(Port.to):
(Port.to.is_wpt_server_running):
(Port.to.start_web_platform_test_server):
* Scripts/webkitpy/port/driver.py:
(DriverProxy.is_web_platform_test):
(DriverProxy):
(DriverProxy.is_webkit_specific_web_platform_test):

LayoutTests:

* fast/harness/results.html: In case results.html is opened locallly,
open HTTP/WPT urls as served by their related servers.
Adding a check that the servers are running before opening the related test.

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

2 years ago[Modern Media Controls] Turn off all tests
commit-queue@webkit.org [Tue, 23 May 2017 14:18:55 +0000 (14:18 +0000)]
[Modern Media Controls] Turn off all tests
https://bugs.webkit.org/show_bug.cgi?id=172447

Patch by Antoine Quint <graouts@apple.com> on 2017-05-23
Reviewed by Jon Lee.

Due to the high number of timeouts and random failures with the current tests, we turn off
all modern-media-controls tests while we wait on a more permanent solution.

* TestExpectations:
* platform/gtk/TestExpectations:
* platform/ios/TestExpectations:
* platform/mac-wk1/TestExpectations:
* platform/mac/TestExpectations:

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

2 years ago[GTK] Test gardening after r217225
commit-queue@webkit.org [Tue, 23 May 2017 14:04:57 +0000 (14:04 +0000)]
[GTK] Test gardening after r217225
https://bugs.webkit.org/show_bug.cgi?id=172498

Patch by Romain Bellessort <romain.bellessort@crf.canon.fr> on 2017-05-23
Reviewed by Michael Catanzaro.

Update test expectations after r217225 resync of WPT tests.

* web-platform-tests/streams/readable-byte-streams/general-expected.txt: Updated.

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

2 years agoAdd a RuntimeEnabledFeature for display: contents, defaulted to false.
commit-queue@webkit.org [Tue, 23 May 2017 13:34:46 +0000 (13:34 +0000)]
Add a RuntimeEnabledFeature for display: contents, defaulted to false.
https://bugs.webkit.org/show_bug.cgi?id=171984

LayoutTests/imported/w3c:

Patch by Emilio Cobos Álvarez <ecobos@igalia.com> on 2017-05-22
Reviewed by Antti Koivisto.

* web-platform-tests/innerText/getter-expected.txt:

Source/WebCore:

Patch by Emilio Cobos Álvarez <ecobos@igalia.com> on 2017-05-22
Reviewed by Antti Koivisto.

The "defaulted to false" is not only because there are spec issues,
but because I ran the WPT suite, and there was a fair amount of
crashes and messed render trees.

Tests: imported/w3c/web-platform-tests/innerText/getter.html

* css/StyleResolver.cpp:
(WebCore::StyleResolver::adjustRenderStyle):
* page/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::setDisplayContentsEnabled):
(WebCore::RuntimeEnabledFeatures::displayContentsEnabled):

Source/WebKit/mac:

Patch by Emilio Cobos Álvarez <ecobos@igalia.com> on 2017-05-23
Reviewed by Antti Koivisto.

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

Source/WebKit2:

Patch by Emilio Cobos Álvarez <ecobos@igalia.com> on 2017-05-23
Reviewed by Antti Koivisto.

* Shared/WebPreferencesDefinitions.h:
* UIProcess/API/C/WKPreferences.cpp:
(WKPreferencesSetDisplayContentsEnabled):
(WKPreferencesGetDisplayContentsEnabled):
* UIProcess/API/C/WKPreferencesRefPrivate.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::updatePreferences):

Tools:

Patch by Emilio Cobos Álvarez <ecobos@igalia.com> on 2017-05-23
Reviewed by Antti Koivisto.

* DumpRenderTree/mac/DumpRenderTree.mm:
(enableExperimentalFeatures):
* WebKitTestRunner/TestController.cpp:
(WTR::TestController::resetPreferencesToConsistentValues):

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

2 years agoUpdate font-style's implementation in the font selection algorithm
mmaxfield@apple.com [Tue, 23 May 2017 07:37:42 +0000 (07:37 +0000)]
Update font-style's implementation in the font selection algorithm
https://bugs.webkit.org/show_bug.cgi?id=169453

Reviewed by Simon Fraser.

Source/WebCore:

Previously, we were treating "font-style: oblique" exactly the same as "font-style: italic".
These values were parsed to the same internal data type. However, variation fonts may have two
distinct axes: 'slnt' and 'ital'. Therefore, we need to keep a bool of state which represents
which of these two axes we should be setting when we apply font variations. We can do this by
making the "font-style" parser a "custom" parser. The implementation of these custom functions
will set both the italic value on the FontDescription as well as this extra bool.

We don't, however, want to treat these values as distinct for the purposese of font selection.
The fact that we treat oblique fonts the same as italic fonts is a feature, not a bug. Therefore,
the font selection algorithm is not made aware of this distinction. This is why we don't want to
package up the bool and FontSelectionValue into a class: font selection only cares about the
FontSelectionValue, so conceptually they shouldn't be joined. (The FontSelectionValue already
exists within a collection of all the things font selection needs to know about.)

Now that there is this extra bit of state on the FontDescription, we can do a little better when
computing the result of getComputedStyle(). Previously, we were always returning "italic" even
when "oblique" was specified. Now, we can return the correct one. However, this extra bit of
state is not kept on the CSSFontFace (because it doesn't need to be), which means we can only
improve the computed style of an element, rather than the cssText of an @font-face rule.

Test: fast/text/font-style-parse.html

* css/CSSComputedStyleDeclaration.cpp:
(WebCore::ComputedStyleExtractor::fontStyleFromStyleValue):
(WebCore::fontStyleFromStyle):
(WebCore::fontShorthandValueForSelectionProperties):
* css/CSSComputedStyleDeclaration.h:
* css/CSSFontFaceSet.h:
* css/CSSProperties.json:
* css/FontFace.cpp:
(WebCore::FontFace::style):
* css/FontSelectionValueInlines.h:
(WebCore::fontStyleKeyword):
* css/StyleBuilderConverter.h:
(WebCore::StyleBuilderConverter::convertFontStyle): Deleted.
* css/StyleBuilderCustom.h:
(WebCore::StyleBuilderCustom::applyInitialFontStyle):
(WebCore::StyleBuilderCustom::applyInheritFontStyle):
(WebCore::StyleBuilderCustom::applyValueFontStyle):
* platform/graphics/FontCache.h:
(WebCore::FontDescriptionKey::makeFlagsKey):
* platform/graphics/FontDescription.cpp:
(WebCore::FontDescription::FontDescription):
* platform/graphics/FontDescription.h:
(WebCore::FontDescription::shouldUseItalicVariationAxis):
(WebCore::FontDescription::setShouldUseItalicVariationAxis):
(WebCore::FontDescription::operator==):
(WebCore::FontCascadeDescription::initialShouldUseItalicVariationAxis):
* platform/graphics/cocoa/FontCacheCoreText.cpp:
(WebCore::preparePlatformFont):
(WebCore::fontWithFamily):
(WebCore::FontCache::createFontPlatformData):
(WebCore::FontCache::systemFallbackForCharacters):
* platform/graphics/mac/FontCustomPlatformData.cpp:
(WebCore::FontCustomPlatformData::fontPlatformData):

LayoutTests:

* fast/text/font-style-parse-expected.txt:
* fast/text/font-style-parse.html:
* platform/mac-elcapitan/fast/text/font-style-parse-expected.txt:

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

2 years ago[GTK] Web Inspector: Add a new icon DockLeft.svg
commit-queue@webkit.org [Tue, 23 May 2017 07:21:21 +0000 (07:21 +0000)]
[GTK] Web Inspector: Add a new icon DockLeft.svg
https://bugs.webkit.org/show_bug.cgi?id=172492

Patch by Fujii Hironori <Hironori.Fujii@sony.com> on 2017-05-23
Reviewed by Carlos Garcia Campos.

* UserInterface/Images/gtk/DockLeft.svg: Added.

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

2 years ago[WTF] Compilation fails with system malloc
tpopela@redhat.com [Tue, 23 May 2017 07:17:28 +0000 (07:17 +0000)]
[WTF] Compilation fails with system malloc
https://bugs.webkit.org/show_bug.cgi?id=172445

Reviewed by Michael Catanzaro.

We are using the bmalloc even if the system malloc should be used.
Don't use bmalloc if the system malloc is requested and add the
missing implementation for computeRAMSize() on UNIX that's utilizing
the sysinfo() call.

* wtf/RAMSize.cpp:
(WTF::computeRAMSize):

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

2 years ago[GTK] Web Inspector: Add a new icon CSSVariable.svg
commit-queue@webkit.org [Tue, 23 May 2017 07:02:43 +0000 (07:02 +0000)]
[GTK] Web Inspector: Add a new icon CSSVariable.svg
https://bugs.webkit.org/show_bug.cgi?id=172491

Patch by Fujii Hironori <Hironori.Fujii@sony.com> on 2017-05-23
Reviewed by Carlos Garcia Campos.

* UserInterface/Images/gtk/CSSVariable.svg: Added.

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

2 years ago[Win] Update expectations for layout tests.
pvollan@apple.com [Tue, 23 May 2017 06:50:17 +0000 (06:50 +0000)]
[Win] Update expectations for layout tests.
https://bugs.webkit.org/show_bug.cgi?id=172437

Unreviewed test gardening, update test expectations for failing tests.

* platform/win/TestExpectations:

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