WebKit-https.git
17 months agoRemove RenderElement::s_noLongerAffectsParentBlock
zalan@apple.com [Thu, 1 Mar 2018 20:20:46 +0000 (20:20 +0000)]
Remove RenderElement::s_noLongerAffectsParentBlock
https://bugs.webkit.org/show_bug.cgi?id=183196
<rdar://problem/38030797>

Reviewed by Antti Koivisto.

Remove the hack to track floating/out-of-flow changes between styleWillChange and styleDidChange.

Covered by existing tests.

* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::styleDidChange):
* rendering/RenderElement.cpp:
(WebCore::RenderElement::styleWillChange):
(WebCore::RenderElement::noLongerAffectsParentBlock const):
(WebCore::RenderElement::styleDidChange):
* rendering/RenderElement.h:
(WebCore::RenderElement::noLongerAffectsParentBlock const): Deleted.

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

17 months agoUnreviewed, update WebKit.CustomHeaderFields API test after r229133.
cdumez@apple.com [Thu, 1 Mar 2018 18:41:41 +0000 (18:41 +0000)]
Unreviewed, update WebKit.CustomHeaderFields API test after r229133.

We no longer do policy checks for 'about:blank'.

* TestWebKitAPI/Tests/WebKitCocoa/WebsitePolicies.mm:
(-[CustomHeaderFieldsDelegate webView:startURLSchemeTask:]):
(TEST):

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

17 months agoCrash when updating cache entry after validation in apps that uses class A file prote...
antti@apple.com [Thu, 1 Mar 2018 17:11:33 +0000 (17:11 +0000)]
Crash when updating cache entry after validation in apps that uses class A file protection
https://bugs.webkit.org/show_bug.cgi?id=183242
<rdar://problem/33289058>

Reviewed by Chris Dumez.

When validating a cache entry, we keep it alive until we get a network response. With 304 response
we then update the headers of this existing entry. This accesses the body data of the entry which
may be backed by a mapped file. If the app uses class A protection, user might have locked
the device and the entry might have become inaccessible, leading to a crash.

* NetworkProcess/cache/NetworkCacheEntry.cpp:
(WebKit::NetworkCache::Entry::setNeedsValidation):

In case of class A protection, pull the data to a memory buffer immediately before starting a revalidation request.
This makes the window where the file could become inaccessible much shorter (since it no longer depends on network).

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

17 months agoimported/w3c/web-platform-tests/html/browsers/windows/browsing-context.html fails...
cdumez@apple.com [Thu, 1 Mar 2018 17:05:23 +0000 (17:05 +0000)]
imported/w3c/web-platform-tests/html/browsers/windows/browsing-context.html fails with async policy delegates
https://bugs.webkit.org/show_bug.cgi?id=183225
<rdar://problem/38003828>

Reviewed by Alex Christensen.

Source/WebCore:

Bypass navigation policy check when loading about:blank. This does not seem necessary and it would not
be Web-compatible for such policy check to happen synchronously. This is because an iframe without src
or src="about:blank" should load synchronously as per HTML specification.

Test: http/wpt/html/browsers/windows/browsing-context.html

* loader/PolicyChecker.cpp:
(WebCore::PolicyChecker::checkNavigationPolicy):

LayoutTests:

* http/wpt/html/browsers/windows/browsing-context-expected.txt: Added.
* http/wpt/html/browsers/windows/browsing-context.html: Added.
Add layout test coverage.

* fast/loader/iframe-src-invalid-url-expected.txt:
* fast/loader/policy-delegate-action-hit-test-zoomed-expected.txt:
* loader/navigation-policy/should-open-external-urls/subframe-click-target-self-expected.txt:
* loader/navigation-policy/should-open-external-urls/subframe-click-target-top-expected.txt:
Rebaseline a few layout tests now that the log lines for the about:blank policy checks are
gone.

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

17 months ago[Curl] Linker errors in some curl files due to missing exports
commit-queue@webkit.org [Thu, 1 Mar 2018 16:59:43 +0000 (16:59 +0000)]
[Curl] Linker errors in some curl files due to missing exports
https://bugs.webkit.org/show_bug.cgi?id=183238

Patch by Christopher Reid <chris.reid@sony.com> on 2018-03-01
Reviewed by Alex Christensen.

No new tests, no change in behavior.

Adding WEBCORE_EXPORT to functions now used in WebKit.

* platform/network/NetworkStorageSession.h:
* platform/network/curl/CookieJarDB.h:
* platform/network/curl/CurlContext.h:

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

17 months agoUnreviewed, rolling out r229130.
commit-queue@webkit.org [Thu, 1 Mar 2018 14:00:39 +0000 (14:00 +0000)]
Unreviewed, rolling out r229130.
https://bugs.webkit.org/show_bug.cgi?id=183244

It breaks AppleWin compilation (Requested by alexg__ on
#webkit).

Reverted changeset:

"Make LibWebRTCProvider port agnostic again after r215424"
https://bugs.webkit.org/show_bug.cgi?id=183080
https://trac.webkit.org/changeset/229130

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

17 months agoMake LibWebRTCProvider port agnostic again after r215424
commit-queue@webkit.org [Thu, 1 Mar 2018 13:27:23 +0000 (13:27 +0000)]
Make LibWebRTCProvider port agnostic again after r215424
https://bugs.webkit.org/show_bug.cgi?id=183080

Patch by Alejandro G. Castro <alex@igalia.com> on 2018-03-01
Reviewed by Youenn Fablet.

In the r215424 commit the webRTCAvailable function started to use a function from the DARWIN platform,
we have moved that code to the cocoa class and created a glib implementation that will be used in the future
to implement the LibWebRTCProviderGlib class.

No new tests, this is a refactor.

* Sources.txt: Add the compilation of the new file.
* platform/mediastream/libwebrtc/LibWebRTCProvider.cpp: Remove the webRTCAvailable function from this file.
(WebCore::LibWebRTCProvider::create): We want to use this even when LIBWEBRTC is not used.
* platform/mediastream/libwebrtc/LibWebRTCProviderCocoa.cpp:
(WebCore::LibWebRTCProvider::webRTCAvailable): Moved the code from the LibWebRTCProvider class.
* platform/mediastream/libwebrtc/LibWebRTCProviderGlib.cpp:
(WebCore::LibWebRTCProvider::webRTCAvailable): Add the glib implementation, basically true, we are always
linking libwebrtc for the moment in these situations.

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

17 months agoUnreviewed, fix exception check for ExceptionScope
utatane.tea@gmail.com [Thu, 1 Mar 2018 10:24:33 +0000 (10:24 +0000)]
Unreviewed, fix exception check for ExceptionScope
https://bugs.webkit.org/show_bug.cgi?id=183175

* jsc.cpp:
(GlobalObject::moduleLoaderFetch):

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

17 months ago[FreeType] Color emojis in WebKitGTK+ for great justice
carlosgc@webkit.org [Thu, 1 Mar 2018 09:26:08 +0000 (09:26 +0000)]
[FreeType] Color emojis in WebKitGTK+ for great justice
https://bugs.webkit.org/show_bug.cgi?id=183155

Reviewed by Michael Catanzaro.

Emojis are actually rendered if there's an emoji font installed in the system, but the size is so tiny that we
don't see them. This is because for some reason the matrix we are getting from fontconfig contains a scale,
which we don't expect. We only get the fontconfig matrix to apply rotations in case of oblique fonts, and then we
always apply the scale for the computed pixel font size. Ignoring the fontconfig matrix scale fixes the issue.

* platform/graphics/freetype/FontCacheFreeType.cpp:
(WebCore::fontWeightToFontconfigWeight): Moved here since it's now used by configurePatternForFontDescription().
(WebCore::configurePatternForFontDescription): Helper function to apply the same options for fallback pattern.
(WebCore::createFontConfigPatternForCharacters): Use configurePatternForFontDescription().
(WebCore::findBestFontGivenFallbacks): Adopt the returned reference.
(WebCore::FontCache::systemFallbackForCharacters): Clean it up.
(WebCore::FontCache::createFontPlatformData): Use configurePatternForFontDescription().
* platform/graphics/freetype/FontPlatformDataFreeType.cpp:
(WebCore::FontPlatformData::buildScaledFont): Ignore the scale returned by fontconfig matrix.

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

17 months ago[GStreamer] text samples no longer processed
philn@webkit.org [Thu, 1 Mar 2018 09:24:54 +0000 (09:24 +0000)]
[GStreamer] text samples no longer processed
https://bugs.webkit.org/show_bug.cgi?id=183212

Reviewed by Xabier Rodriguez-Calvar.

* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::newTextSample): Refer to
track stream ID instead of (potentially) manually generated track
ID stored as hashmap keys.

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

17 months agoREGRESSION(r221514): [GTK] UI process crash in WebKit::WaylandCompositor::Surface...
carlosgc@webkit.org [Thu, 1 Mar 2018 09:24:24 +0000 (09:24 +0000)]
REGRESSION(r221514): [GTK] UI process crash in WebKit::WaylandCompositor::Surface::flushPendingFrameCallbacks
https://bugs.webkit.org/show_bug.cgi?id=183091

Reviewed by Michael Catanzaro.

Invalidate the surface in the page map when the backing store is destroyed.

* UIProcess/gtk/WaylandCompositor.cpp:
(WebKit::WaylandCompositor::willDestroySurface):
* UIProcess/gtk/WaylandCompositor.h:

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

17 months ago[ARM] Fix compile error in debug builds by invoking unpoisoned().
commit-queue@webkit.org [Thu, 1 Mar 2018 07:35:30 +0000 (07:35 +0000)]
[ARM] Fix compile error in debug builds by invoking unpoisoned().

Patch by Dominik Infuehr <dinfuehr@igalia.com> on 2018-02-28
Reviewed by Mark Lam.

* assembler/MacroAssemblerCodeRef.h:
(JSC::MacroAssemblerCodePtr::MacroAssemblerCodePtr): Fix compile error.
(JSC::MacroAssemblerCodePtr::createFromExecutableAddress()): Ditto.
(JSC::MacroAssemblerCodePtr::dataLocation()): Ditto.
* yarr/YarrInterpreter.cpp:
(JSC::Yarr::ByteCompiler::dumpDisjunction): use %zu for printf'ing size_t.

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

17 months agoPush WTF_PLATFORM_IOS down into preprocessor.pm instead of trying to determine it...
timothy_horton@apple.com [Thu, 1 Mar 2018 06:47:43 +0000 (06:47 +0000)]
Push WTF_PLATFORM_IOS down into preprocessor.pm instead of trying to determine it inside
https://bugs.webkit.org/show_bug.cgi?id=183193

Reviewed by Andy Estes.

* DerivedSources.make:
* bindings/scripts/preprocessor.pm:
(applyPreprocessor):
Instead of trying to discern WTF_PLATFORM_IOS inside preprocessor.pm,
push it down from DerivedSources.make. Also clean up DerivedSources.make
a tiny bit by adding a variable, FEATURE_AND_PLATFORM_DEFINES, which
contains both FEATURE_DEFINES and WTF_PLATFORM macros if needed.

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

17 months agoMake LayoutTests wait_for_state fail after a given period of time
commit-queue@webkit.org [Thu, 1 Mar 2018 02:18:09 +0000 (02:18 +0000)]
Make LayoutTests wait_for_state fail after a given period of time
https://bugs.webkit.org/show_bug.cgi?id=183039

Patch by Youenn Fablet <youenn@apple.com> on 2018-02-28
Reviewed by Chris Dumez.

This will allow further investigating why some tests are timing out.

* web-platform-tests/service-workers/service-worker/resources/test-helpers.sub.js:
(wait_for_state):

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

17 months agoLayout Test accessibility/mac/accessibility-make-first-responder.html is flaky
n_wang@apple.com [Thu, 1 Mar 2018 02:15:23 +0000 (02:15 +0000)]
Layout Test accessibility/mac/accessibility-make-first-responder.html is flaky
https://bugs.webkit.org/show_bug.cgi?id=183232

Reviewed by Chris Fleizach.

The test is flaky because that the UIProcess might have received the IPC message
to set the first responder after we check the current state. Added a delay
in the test to fix that.

* accessibility/mac/accessibility-make-first-responder.html:

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

17 months ago[Cocoa] Web Automation: provide a way to ask clients the type of a JavaScript dialog
bburg@apple.com [Thu, 1 Mar 2018 02:12:31 +0000 (02:12 +0000)]
[Cocoa] Web Automation: provide a way to ask clients the type of a JavaScript dialog
https://bugs.webkit.org/show_bug.cgi?id=182660
<rdar://problem/37408183>

Reviewed by Tim Horton and Carlos Garcia Campos.

Add another delegate method to ask what type of dialog is being shown.
This is used to implement §18.4 Step 5, where sending text to a dialog
without a prompt will return several different kinds of errors.

No new tests, covered by web platform tests once Safari side has landed.

* UIProcess/API/Cocoa/_WKAutomationSessionDelegate.h: Update FIXME radar numbers.
* UIProcess/Cocoa/AutomationSessionClient.h:
* UIProcess/Cocoa/AutomationSessionClient.mm:
(WebKit::AutomationSessionClient::AutomationSessionClient):
(WebKit::toImpl):
(WebKit::AutomationSessionClient::typeOfCurrentJavaScriptDialogOnPage):
If there is no current dialog to be checked, the client can return the 'None'
type. This gets converted into a std::nullopt and causes a command error later.

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

17 months ago[webkitpy] Remove concept of 'future' versions (Follow-up fix 2)
jbedard@apple.com [Thu, 1 Mar 2018 02:09:39 +0000 (02:09 +0000)]
[webkitpy] Remove concept of 'future' versions (Follow-up fix 2)
https://bugs.webkit.org/show_bug.cgi?id=183184
<rdar://problem/37958594>

Reviewed by Aakash Jain.

Unlisted Apple versions can't run webkitpy tests because they don't
have specified port names.

* Scripts/webkitpy/port/apple.py:
(ApplePort.determine_full_port_name): Return valid port name for unnamed
versions.
* Scripts/webkitpy/port/base.py:
(Port.version_name): Check both public and internal version mapping
when returning a version name.
* Scripts/webkitpy/port/mac.py:
(MacPort.__init__): If no os version is defined, use the current version.

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

17 months agoRemove assertion from ResourceLoadStatisticsClassifier::calculateResourcePrevalence...
wilander@apple.com [Thu, 1 Mar 2018 00:54:45 +0000 (00:54 +0000)]
Remove assertion from ResourceLoadStatisticsClassifier::calculateResourcePrevalence() which causes crashes when domains are explicitly set as prevalent without the associated statistics
https://bugs.webkit.org/show_bug.cgi?id=183233

Unreviewed removal of an assertion that's causing layout test crashes.

* Platform/classifier/ResourceLoadStatisticsClassifier.cpp:
(WebKit::ResourceLoadStatisticsClassifier::calculateResourcePrevalence):
    Removed ASSERT(currentPrevalence == Low).

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

17 months agoAX: AOM: Dispatch accessiblesetvalue event
n_wang@apple.com [Thu, 1 Mar 2018 00:30:08 +0000 (00:30 +0000)]
AX: AOM: Dispatch accessiblesetvalue event
https://bugs.webkit.org/show_bug.cgi?id=183021
<rdar://problem/37764242>

Reviewed by Chris Fleizach.

Source/WebCore:

Accessibility events.
Spec: https://wicg.github.io/aom/spec/phase2.html

Added a new event type AccessibleSetValueEvent.

Test: accessibility/mac/AOM-event-accessiblesetvalue.html

* CMakeLists.txt:
* DerivedSources.make:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* accessibility/AccessibilityAllInOne.cpp:
* accessibility/AccessibilityNodeObject.cpp:
(WebCore::AccessibilityNodeObject::canSetValueAttribute const):
* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::press):
(WebCore::AccessibilityObject::dispatchAccessibilityEvent):
(WebCore::AccessibilityObject::dispatchAccessibleSetValueEvent):
* accessibility/AccessibilityObject.h:
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::setValue):
* accessibility/AccessibilityScrollbar.cpp:
(WebCore::AccessibilityScrollbar::setValue):
* accessibility/AccessibilitySlider.cpp:
(WebCore::AccessibilitySlider::setValue):
* accessibility/AccessibleSetValueEvent.cpp: Added.
(WebCore::AccessibleSetValueEvent::AccessibleSetValueEvent):
* accessibility/AccessibleSetValueEvent.h: Added.
(WebCore::AccessibleSetValueEvent::create):
(WebCore::AccessibleSetValueEvent::value const):
* accessibility/AccessibleSetValueEvent.idl: Added.
* dom/Element.idl:
* dom/EventNames.h:
* dom/EventNames.in:

LayoutTests:

* accessibility/mac/AOM-event-accessiblesetvalue-expected.txt: Added.
* accessibility/mac/AOM-event-accessiblesetvalue.html: Added.
* js/dom/dom-static-property-for-in-iteration-expected.txt:

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

17 months agoGC should sweep code block before deleting
jfbastien@apple.com [Thu, 1 Mar 2018 00:00:07 +0000 (00:00 +0000)]
GC should sweep code block before deleting
https://bugs.webkit.org/show_bug.cgi?id=183229
<rdar://problem/32767615>

Reviewed by Saam Barati, Fil Pizlo.

Stub routines shouldn't get deleted before codeblocks have been
swept, otherwise there's a small race window where the codeblock
thinks it's still reachable.

* heap/Heap.cpp:
(JSC::Heap::deleteUnmarkedCompiledCode):
(JSC::Heap::sweepInFinalize):

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

17 months agohtml/browsers/browsing-the-web/navigating-across-documents/006.html fails with async...
cdumez@apple.com [Wed, 28 Feb 2018 23:58:22 +0000 (23:58 +0000)]
html/browsers/browsing-the-web/navigating-across-documents/006.html fails with async policy delegates
https://bugs.webkit.org/show_bug.cgi?id=183168
<rdar://problem/37951341>

Reviewed by Alex Christensen.

Source/WebCore:

The test has an anchor element with both a 'click' event handler which submits a form
and an href attribute. When clicking the link, as per specification, things happen in
this order:
1. We fire the click event at the anchor, which will execute the event handler and submit the form.
   Submitting the form *schedules* a navigation to 'click.html'.
2. We execute the anchor activation code which *navigates* to 'href.html'. The navigation to
   'href' is supposed to cancel the pending navigation to 'click.html' and we should navigate
   to 'href.html', which is what the test asserts.

The issue for us is that we do not cancel pending navigations until after the navigation
policy decision is made, when the provisional loads actually starts, in FrameLoader::provisionalLoadStarted().
Because the policy decision for the navigation can now be made asynchronously, the NavigationScheduler
timer can now fire while the decision is made and we'll submit the form, thus navigating to
'click.html'.

To address the issue, we now cancel any pending navigations in FrameLoader::loadWithDocumentLoader(),
*before* doing the policy check for the navigation.

Test: http/wpt/html/browsers/browsing-the-web/navigating-across-documents/006.html

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

LayoutTests:

Add layout test coverage.

* TestExpectations:
* http/wpt/html/browsers/browsing-the-web/navigating-across-documents/006-expected.txt: Added.
* http/wpt/html/browsers/browsing-the-web/navigating-across-documents/006.html: Added.
* http/wpt/html/browsers/browsing-the-web/navigating-across-documents/click.html: Added.
* http/wpt/html/browsers/browsing-the-web/navigating-across-documents/href.html: Added.

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

17 months agoUnreviewed GTK test gardening.
mcatanzaro@igalia.com [Wed, 28 Feb 2018 23:23:48 +0000 (23:23 +0000)]
Unreviewed GTK test gardening.
https://bugs.webkit.org/show_bug.cgi?id=183217

Patch by Alicia Boya García <aboya@igalia.com> on 2018-02-28

* platform/gtk/TestExpectations:

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

17 months agoAdd a second tier of prevalence to facilitate telemetry on very prevalent domains
wilander@apple.com [Wed, 28 Feb 2018 22:25:27 +0000 (22:25 +0000)]
Add a second tier of prevalence to facilitate telemetry on very prevalent domains
https://bugs.webkit.org/show_bug.cgi?id=183218
<rdar://problem/37992388>

Reviewed by Brent Fulgham.

Source/WebCore:

Test: http/tests/resourceLoadStatistics/classify-as-very-prevalent-based-on-mixed-statistics.html

* loader/ResourceLoadStatistics.cpp:
(WebCore::ResourceLoadStatistics::encode const):
(WebCore::ResourceLoadStatistics::decode):
(WebCore::ResourceLoadStatistics::toString const):
(WebCore::ResourceLoadStatistics::merge):
    Handling of the new boolean field isVeryPrevalentResource.
* loader/ResourceLoadStatistics.h:
    Added the new boolean field isVeryPrevalentResource.

Source/WebKit:

* Platform/classifier/ResourceLoadStatisticsClassifier.cpp:
(WebKit::vectorLength):
    New convenience function.
(WebKit::ResourceLoadStatisticsClassifier::calculateResourcePrevalence):
    Renamed from ResourceLoadStatisticsClassifier::hasPrevalentResourceCharacteristics().
    Now returns a value from the enum ResourceLoadPrevalence.
(WebKit::ResourceLoadStatisticsClassifier::classifyWithVectorThreshold):
    Now uses the new vectorLength() convenience function.
(WebKit::ResourceLoadStatisticsClassifier::hasPrevalentResourceCharacteristics): Deleted.
    Renamed to ResourceLoadStatisticsClassifier::calculateResourcePrevalence().
* Platform/classifier/ResourceLoadStatisticsClassifier.h:
    Added enum ResourceLoadPrevalence.
* Shared/WebCoreArgumentCoders.cpp:
(IPC::ArgumentCoder<ResourceLoadStatistics>::encode):
(IPC::ArgumentCoder<ResourceLoadStatistics>::decode):
    Handling of the new boolean field isVeryPrevalentResource.
* UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
(WKWebsiteDataStoreSetStatisticsVeryPrevalentResource):
(WKWebsiteDataStoreIsStatisticsVeryPrevalentResource):
    Test infrastructure.
* UIProcess/API/C/WKWebsiteDataStoreRef.h:
* UIProcess/WebResourceLoadStatisticsStore.cpp:
(WebKit::WebResourceLoadStatisticsStore::processStatisticsAndDataRecords):
(WebKit::WebResourceLoadStatisticsStore::setPrevalentResource):
(WebKit::WebResourceLoadStatisticsStore::setVeryPrevalentResource):
(WebKit::WebResourceLoadStatisticsStore::isVeryPrevalentResource):
(WebKit::WebResourceLoadStatisticsStore::clearPrevalentResource):
    All of these are for handling of the two-tier classification.
    Also bumped the statisticsModelVersion to 12.
* UIProcess/WebResourceLoadStatisticsStore.h:

Tools:

* WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl:
    Added two new testRunner functions:
    - setStatisticsVeryPrevalentResource()
    - isStatisticsVeryPrevalentResource()
* WebKitTestRunner/InjectedBundle/TestRunner.cpp:
(WTR::TestRunner::setStatisticsVeryPrevalentResource):
(WTR::TestRunner::isStatisticsVeryPrevalentResource):
* WebKitTestRunner/InjectedBundle/TestRunner.h:
* WebKitTestRunner/TestController.cpp:
(WTR::TestController::setStatisticsVeryPrevalentResource):
(WTR::TestController::isStatisticsVeryPrevalentResource):
* WebKitTestRunner/TestController.h:
* WebKitTestRunner/TestInvocation.cpp:
(WTR::TestInvocation::didReceiveSynchronousMessageFromInjectedBundle):

LayoutTests:

* http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-mixed-statistics.html:
* http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-sub-frame-under-top-frame-origins.html:
* http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-subresource-redirect-collusion.html:
* http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-subresource-under-top-frame-origins.html:
* http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-subresource-unique-redirects-to.html:
* http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-top-frame-redirect-collusion.html:
* http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-top-frame-unique-redirects-to.html:
* http/tests/resourceLoadStatistics/classify-as-very-prevalent-based-on-mixed-statistics-expected.txt: Added.
* http/tests/resourceLoadStatistics/classify-as-very-prevalent-based-on-mixed-statistics.html: Added.
* platform/wk2/TestExpectations:
    New test marked as [ Pass ].

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

17 months agoRename samplePendingBuild to samplePendingBuildRequest
aakash_jain@apple.com [Wed, 28 Feb 2018 21:54:56 +0000 (21:54 +0000)]
Rename samplePendingBuild to samplePendingBuildRequest
https://bugs.webkit.org/show_bug.cgi?id=183171

Reviewed by Ryosuke Niwa.

* unit-tests/buildbot-syncer-tests.js:
(samplePendingBuildRequests): Renamed from samplePendingBuild.
(samplePendingBuildRequestDeprecated): Renamed from samplePendingBuildDeprecated.
(samplePendingBuild): Deleted.
(samplePendingBuildDeprecated): Deleted.

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

17 months agoReduce use of NetworkingContext in WebKit
commit-queue@webkit.org [Wed, 28 Feb 2018 19:53:58 +0000 (19:53 +0000)]
Reduce use of NetworkingContext in WebKit
https://bugs.webkit.org/show_bug.cgi?id=183213

Patch by Alex Christensen <achristensen@webkit.org> on 2018-02-28
Reviewed by Brady Eidson.

Source/WebCore:

NetworkingContext is intended to be used only with ResourceHandle, which is now only used in WebKitLegacy.
Now that we don't use ResourceHandle in the WebProcess, everything that was done through the NetworkingContext
can now be done a cleaner way with no change in behavior.

* loader/FrameLoader.cpp:
(WebCore::FrameLoader::loadResourceSynchronously):
* loader/LinkLoader.cpp:
(WebCore::LinkLoader::loadLink):
* loader/LoaderStrategy.h:
* platform/network/ProxyServer.h:
* platform/network/cf/ProxyServerCFNet.cpp:
(WebCore::proxyServersForURL):
* platform/network/curl/ProxyServerCurl.cpp:
(WebCore::proxyServersForURL):
* platform/network/soup/ProxyServerSoup.cpp:
(WebCore::proxyServersForURL):

Source/WebKit:

* NetworkProcess/RemoteNetworkingContext.h:
* WebProcess/Network/WebLoaderStrategy.cpp:
(WebKit::WebLoaderStrategy::loadResourceSynchronously):
(WebKit::WebLoaderStrategy::preconnectTo):
* WebProcess/Network/WebLoaderStrategy.h:
* WebProcess/Plugins/PluginView.cpp:
(WebKit::PluginView::proxiesForURL):
* WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
* WebProcess/WebPage/WebFrame.cpp:

Source/WebKitLegacy:

* WebCoreSupport/WebResourceLoadScheduler.cpp:
(WebResourceLoadScheduler::loadResourceSynchronously):
(WebResourceLoadScheduler::preconnectTo):
* WebCoreSupport/WebResourceLoadScheduler.h:

Source/WebKitLegacy/mac:

* Plugins/Hosted/NetscapePluginInstanceProxy.mm:
(WebKit::NetscapePluginInstanceProxy::getProxy):
* Plugins/WebNetscapePluginView.mm:
(-[WebNetscapePluginView getVariable:forURL:value:length:]):

Source/WebKitLegacy/win:

* Plugins/PluginView.cpp:
(WebCore::PluginView::getValueForURL):

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

17 months ago[webkitpy] Remove concept of 'future' versions (Follow-up fix)
jbedard@apple.com [Wed, 28 Feb 2018 19:34:46 +0000 (19:34 +0000)]
[webkitpy] Remove concept of 'future' versions (Follow-up fix)
https://bugs.webkit.org/show_bug.cgi?id=183184
<rdar://problem/37958594>

Reviewed by David Kilzer.

The factory also relies on future in a non-obvious way.

* Scripts/webkitpy/common/system/platforminfo.py:
(PlatformInfo.os_version_name): Check both public and internal version mapping
when returning a version name.
* Scripts/webkitpy/common/system/platforminfo_mock.py:
(MockPlatformInfo.os_version_name): Ditto.

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

17 months agoDisable three resourceLoadStatistics tests on iOS Simulator Debug because they freque...
ryanhaddad@apple.com [Wed, 28 Feb 2018 19:14:48 +0000 (19:14 +0000)]
Disable three resourceLoadStatistics tests on iOS Simulator Debug because they frequently time out.
https://bugs.webkit.org/show_bug.cgi?id=183216

Unreviewed test gardening.

* platform/ios/TestExpectations:

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

17 months agoUnreviewed WPE fixup after r229080.
zandobersek@gmail.com [Wed, 28 Feb 2018 18:25:05 +0000 (18:25 +0000)]
Unreviewed WPE fixup after r229080.

Add empty definitions for two AccessibilityUIElement methods,
avoiding undefined symbols in the WKTR injected bundle.

* WebKitTestRunner/InjectedBundle/wpe/AccessibilityUIElementWPE.cpp:
(WTR::AccessibilityUIElement::attributedStringForTextMarkerRange):
(WTR::AccessibilityUIElement::attributedStringForTextMarkerRangeWithOptions):

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

17 months agoMark http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-top-frame-redir...
ryanhaddad@apple.com [Wed, 28 Feb 2018 18:08:25 +0000 (18:08 +0000)]
Mark http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-top-frame-redirect-collusion.html as flaky.
https://bugs.webkit.org/show_bug.cgi?id=182983

Unreviewed test gardening.

* platform/wk2/TestExpectations:

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

17 months agoRemove network access from the WebContent process sandbox
bfulgham@apple.com [Wed, 28 Feb 2018 17:17:12 +0000 (17:17 +0000)]
Remove network access from the WebContent process sandbox
https://bugs.webkit.org/show_bug.cgi?id=183192
<rdar://problem/35369115>

Reviewed by Alex Christensen.

Remove the 'system-network', 'allow-network-common', and 'network-client' access from the WebContent process.
That's why we have a Network Process!

* Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
* WebProcess/com.apple.WebProcess.sb.in:

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

17 months agoJSC crash with `import("")`
utatane.tea@gmail.com [Wed, 28 Feb 2018 16:38:31 +0000 (16:38 +0000)]
JSC crash with `import("")`
https://bugs.webkit.org/show_bug.cgi?id=183175

Reviewed by Saam Barati.

JSTests:

* stress/import-with-empty-string.js: Added.

Source/JavaScriptCore:

Add file existence and file type check for module loader implementation in jsc.cpp.
This is not safe for TOCTOU, but it is OK since this functionality is used for the
JSC shell (jsc.cpp): testing purpose.

* jsc.cpp:
(fillBufferWithContentsOfFile):
(fetchModuleFromLocalFileSystem):

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

17 months agoRemove RenderElement::s_affectsParentBlock
zalan@apple.com [Wed, 28 Feb 2018 16:31:34 +0000 (16:31 +0000)]
Remove RenderElement::s_affectsParentBlock
https://bugs.webkit.org/show_bug.cgi?id=183187
<rdar://problem/37961079>

Reviewed by Antti Koivisto.

Remove the hack to track floating/out-of-flow changes between styleWillChange and styleDidChange.

Covered by existing tests.

* rendering/RenderElement.cpp:
(WebCore::RenderElement::styleWillChange):
(WebCore::RenderElement::styleDidChange):
* rendering/RenderElement.h:

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

17 months agoFilter attribute selectors with selector filter
antti@apple.com [Wed, 28 Feb 2018 15:50:00 +0000 (15:50 +0000)]
Filter attribute selectors with selector filter
https://bugs.webkit.org/show_bug.cgi?id=183200

Reviewed by Zalan Bujtas.

Currently selector filtering is done based on tags, classes and ids. We should include attributes too.

This patch adds filtering based on attribute name (but not content).

* css/SelectorFilter.cpp:
(WebCore::isExcludedAttribute):

    Ignore id, class and style attributes. First two are already handled and the last is common but is rarely
    used in selectors.

(WebCore::collectElementIdentifierHashes):

    Collect attributes.
    Remove the unnecessary StyledElement casting.

(WebCore::collectSimpleSelectorHash):

    Collect attribute selectors.

(WebCore::chooseSelectorHashesForFilter):

    Pick attributes with high priority for the filter as it is likely a good signal.

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

17 months ago[WebVR] Convert VRPlatformDisplayInfo into a class
svillar@igalia.com [Wed, 28 Feb 2018 08:45:26 +0000 (08:45 +0000)]
[WebVR] Convert VRPlatformDisplayInfo into a class
https://bugs.webkit.org/show_bug.cgi?id=183162

Reviewed by Žan Doberšek.

In preparation for further changes we're transforming the
VRPlatformDisplayInfo into a class. All the members are now private
and the class provides the needed getters/setters.

Apart from that VRDisplayCapabilityFlags is now just an unsigned and
the different flags are defined in VRDisplayCapabilityFlag enum.
Another cleanup was the removal of VRDisplayCapabilities.cpp as
everything can be implemented in the header.

* Modules/webvr/VRDisplay.cpp:
(WebCore::VRDisplay::VRDisplay):
(WebCore::VRDisplay::isConnected const):
(WebCore::VRDisplay::stageParameters const):
* Modules/webvr/VRDisplayCapabilities.cpp: Removed.
* Modules/webvr/VRDisplayCapabilities.h:
(WebCore::VRDisplayCapabilities::hasPosition const):
(WebCore::VRDisplayCapabilities::hasOrientation const):
(WebCore::VRDisplayCapabilities::hasExternalDisplay const):
(WebCore::VRDisplayCapabilities::canPresent const):
(WebCore::VRDisplayCapabilities::maxLayer const):
(WebCore::VRDisplayCapabilities::VRDisplayCapabilities):
* Sources.txt:
* platform/vr/VRPlatformDisplay.h:
(WebCore::VRPlatformDisplayInfo::displayName const):
(WebCore::VRPlatformDisplayInfo::setDisplayName):
(WebCore::VRPlatformDisplayInfo::isConnected const):
(WebCore::VRPlatformDisplayInfo::setIsConnected):
(WebCore::VRPlatformDisplayInfo::isMounted const):
(WebCore::VRPlatformDisplayInfo::setIsMounted):
(WebCore::VRPlatformDisplayInfo::capabilityFlags const):
(WebCore::VRPlatformDisplayInfo::setCapabilityFlags):
(WebCore::VRPlatformDisplayInfo::displayIdentifier const):
(WebCore::VRPlatformDisplayInfo::setDisplayIdentifier):
(WebCore::VRPlatformDisplayInfo::eyeTranslation const):
(WebCore::VRPlatformDisplayInfo::setEyeTranslation):
(WebCore::VRPlatformDisplayInfo::eyeFieldOfView const):
(WebCore::VRPlatformDisplayInfo::setEyeFieldOfView):
(WebCore::VRPlatformDisplayInfo::renderSize const):
(WebCore::VRPlatformDisplayInfo::setRenderSize):
(WebCore::VRPlatformDisplayInfo::setPlayAreaBounds):
(WebCore::VRPlatformDisplayInfo::playAreaBounds const):
(WebCore::VRPlatformDisplayInfo::setSittingToStandingTransform):
(WebCore::VRPlatformDisplayInfo::sittingToStandingTransform const):
* platform/vr/openvr/VRPlatformDisplayOpenVR.cpp:
(WebCore::VRPlatformDisplayOpenVR::VRPlatformDisplayOpenVR):
(WebCore::VRPlatformDisplayOpenVR::updateEyeParameters):
(WebCore::VRPlatformDisplayOpenVR::updateStageParameters):

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

17 months agoUnreviewed, rolling out r229060.
commit-queue@webkit.org [Wed, 28 Feb 2018 07:49:44 +0000 (07:49 +0000)]
Unreviewed, rolling out r229060.
https://bugs.webkit.org/show_bug.cgi?id=183198

This patch causes crashes on two SVG tests (Requested by fredw
on #webkit).

Reverted changeset:

"Relayout frames after AsyncFrameScrolling or FrameFlattening
option is changed"
https://bugs.webkit.org/show_bug.cgi?id=183081
https://trac.webkit.org/changeset/229060

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

17 months agoReplace TrustedImmPtr(0) with TrustedImmPtr(nullptr)
keith_miller@apple.com [Wed, 28 Feb 2018 05:41:18 +0000 (05:41 +0000)]
Replace TrustedImmPtr(0) with TrustedImmPtr(nullptr)
https://bugs.webkit.org/show_bug.cgi?id=183195

Reviewed by Mark Lam.

* assembler/AbstractMacroAssembler.h:
(JSC::AbstractMacroAssembler::TrustedImmPtr::TrustedImmPtr):
* assembler/MacroAssembler.h:
(JSC::MacroAssembler::patchableBranchPtr):
(JSC::MacroAssembler::patchableBranchPtrWithPatch):
* assembler/MacroAssemblerARM.h:
(JSC::MacroAssemblerARM::branchPtrWithPatch):
(JSC::MacroAssemblerARM::storePtrWithPatch):
* assembler/MacroAssemblerARM64.h:
(JSC::MacroAssemblerARM64::call):
(JSC::MacroAssemblerARM64::tailRecursiveCall):
(JSC::MacroAssemblerARM64::branchPtrWithPatch):
(JSC::MacroAssemblerARM64::patchableBranchPtrWithPatch):
(JSC::MacroAssemblerARM64::storePtrWithPatch):
* assembler/MacroAssemblerARMv7.h:
(JSC::MacroAssemblerARMv7::branchPtrWithPatch):
(JSC::MacroAssemblerARMv7::patchableBranchPtr):
(JSC::MacroAssemblerARMv7::patchableBranchPtrWithPatch):
(JSC::MacroAssemblerARMv7::storePtrWithPatch):
* assembler/MacroAssemblerMIPS.h:
(JSC::MacroAssemblerMIPS::branchPtrWithPatch):
(JSC::MacroAssemblerMIPS::storePtrWithPatch):
* assembler/MacroAssemblerX86.h:
(JSC::MacroAssemblerX86::branchPtrWithPatch):
* assembler/MacroAssemblerX86_64.h:
(JSC::MacroAssemblerX86_64::callWithSlowPathReturnType):
(JSC::MacroAssemblerX86_64::call):
(JSC::MacroAssemblerX86_64::tailRecursiveCall):
(JSC::MacroAssemblerX86_64::makeTailRecursiveCall):
(JSC::MacroAssemblerX86_64::branchPtrWithPatch):
* bytecode/AccessCase.cpp:
(JSC::AccessCase::generateImpl):
* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::emitAllocateRawObject):
(JSC::DFG::SpeculativeJIT::compileToLowerCase):
(JSC::DFG::SpeculativeJIT::compileMakeRope):
(JSC::DFG::SpeculativeJIT::compileGetTypedArrayByteOffset):
(JSC::DFG::SpeculativeJIT::compileNewFunctionCommon):
(JSC::DFG::SpeculativeJIT::compileCreateDirectArguments):
(JSC::DFG::SpeculativeJIT::compileNewArrayWithSpread):
(JSC::DFG::SpeculativeJIT::compileArraySlice):
(JSC::DFG::SpeculativeJIT::compileAllocatePropertyStorage):
(JSC::DFG::SpeculativeJIT::compileReallocatePropertyStorage):
(JSC::DFG::SpeculativeJIT::compileNewTypedArrayWithSize):
* dfg/DFGSpeculativeJIT.h:
(JSC::DFG::SpeculativeJIT::TrustedImmPtr::TrustedImmPtr):
* dfg/DFGSpeculativeJIT32_64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
(JSC::DFG::SpeculativeJIT::compileAllocateNewArrayWithSize):
* dfg/DFGSpeculativeJIT64.cpp:
(JSC::DFG::SpeculativeJIT::emitCall):
(JSC::DFG::SpeculativeJIT::compile):
(JSC::DFG::SpeculativeJIT::compileAllocateNewArrayWithSize):
* dfg/DFGThunks.cpp:
(JSC::DFG::osrExitGenerationThunkGenerator):
* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::compileCallOrConstruct):
(JSC::FTL::DFG::LowerDFGToB3::compileTailCall):
(JSC::FTL::DFG::LowerDFGToB3::compileCallOrConstructVarargs):
* ftl/FTLThunks.cpp:
(JSC::FTL::genericGenerationThunkGenerator):
* jit/AssemblyHelpers.cpp:
(JSC::AssemblyHelpers::debugCall):
(JSC::AssemblyHelpers::sanitizeStackInline):
* jit/IntrinsicEmitter.cpp:
(JSC::IntrinsicGetterAccessCase::emitIntrinsicGetter):
* jit/JITCall.cpp:
(JSC::JIT::compileOpCall):
* jit/JITCall32_64.cpp:
(JSC::JIT::compileOpCall):
* jit/ScratchRegisterAllocator.cpp:
(JSC::ScratchRegisterAllocator::restoreUsedRegistersFromScratchBufferForCall):
* wasm/js/WasmToJS.cpp:
(JSC::Wasm::wasmToJS):
* yarr/YarrJIT.cpp:
(JSC::Yarr::YarrGenerator::initParenContextFreeList):
(JSC::Yarr::YarrGenerator::storeToFrameWithPatch):
(JSC::Yarr::YarrGenerator::generate):

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

17 months agoDo not trigger a service worker match in case of document redirection if it will...
commit-queue@webkit.org [Wed, 28 Feb 2018 02:28:15 +0000 (02:28 +0000)]
Do not trigger a service worker match in case of document redirection if it will be already served by AppCache
https://bugs.webkit.org/show_bug.cgi?id=183185
<rdar://problem/37693796>

Patch by Youenn Fablet <youenn@apple.com> on 2018-02-27
Reviewed by Chris Dumez.

Source/WebCore:

Disabling service worker matching in case there is a substitute data.
Otherwise there is a risk for a double load, substitute data first and the new load
triggered if matching a new registration.
A future fix should first do service worker registration matching and if there is no registration query appcache.

Test: http/tests/appcache/main-resource-redirect-with-sw.html

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

LayoutTests:

* http/tests/appcache/main-resource-redirect-with-sw-expected.txt: Added.
* http/tests/appcache/main-resource-redirect-with-sw.html: Added.
* http/tests/appcache/resources/main-resource-redirect-with-sw.manifest: Added.
* http/tests/appcache/resources/register-resources-service-worker.html: Added.
* http/tests/appcache/service-worker-proxy.js: Added.
* platform/gtk/TestExpectations:
* platform/mac-wk1/TestExpectations:
* platform/win/TestExpectations:
* platform/wpe/TestExpectations:

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

17 months agoRemove concept of 'future'
jbedard@apple.com [Wed, 28 Feb 2018 02:05:59 +0000 (02:05 +0000)]
Remove concept of 'future'
https://bugs.webkit.org/show_bug.cgi?id=183184
<rdar://problem/37958594>

Reviewed by Aakash Jain.

Remove concept of 'future' from expectations and instead
use a system of inheritance centered around the current version
of an OS for Mac and iOS.

Inheritance works like so:

| ....
V Future
> High Sierra (mac)
^ mac-sierra
| mac-elcapitan
| ....

This does not change expectation inheritance for any currently running
configurations, it generalizes the logic already used.

* Scripts/webkitpy/common/version_name_map.py:
(VersionNameMap.__init__): Remove all future versions.
(VersionNameMap.mapping_for_platform): Return empty dicts instead of
asserting.
* Scripts/webkitpy/port/apple.py:
(ApplePort):
(ApplePort._allowed_versions): Return all available versions.
(ApplePort._generate_all_test_configurations): Instead of picking from a set
of allowed versions, assume that every specified version is allowed.
(ApplePort._port_name_with_version): Deleted.
* Scripts/webkitpy/port/darwin.py: Add CURRENT_VERSION overridden by subclasses.
(DarwinPort):
* Scripts/webkitpy/port/ios.py:
(IOSPort):
(IOSPort.default_baseline_search_path): Use system of inheritance centered around
the current version.
* Scripts/webkitpy/port/mac.py:
(MacPort):
(MacPort.__init__): Use current version by default.
(MacPort.default_baseline_search_path): Use system of inheritance centered around
the current version.
(MacPort.configuration_specifier_macros): Use the same set of version names
supported in default_baseline_search_path.
* Scripts/webkitpy/port/mac_unittest.py:
(MacTest.test_versions): Remove 'future' tests.

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

17 months agoMark http/tests/resourceLoadStatistics/partitioned-and-unpartitioned-cookie-deletion...
ryanhaddad@apple.com [Wed, 28 Feb 2018 01:32:29 +0000 (01:32 +0000)]
Mark http/tests/resourceLoadStatistics/partitioned-and-unpartitioned-cookie-deletion.html as flaky.
https://bugs.webkit.org/show_bug.cgi?id=183094

Unreviewed test gardening.

* platform/mac-wk2/TestExpectations:

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

17 months agoMark fast/dom/Window/window-focus-self.html as flaky.
ryanhaddad@apple.com [Wed, 28 Feb 2018 01:24:22 +0000 (01:24 +0000)]
Mark fast/dom/Window/window-focus-self.html as flaky.
https://bugs.webkit.org/show_bug.cgi?id=183164

Unreviewed test gardening.

* platform/mac-wk2/TestExpectations:

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

17 months agoUnreviewed GTK test gardening
mcatanzaro@igalia.com [Tue, 27 Feb 2018 23:46:48 +0000 (23:46 +0000)]
Unreviewed GTK test gardening

Tools:

* TestWebKitAPI/glib/TestExpectations.json:

LayoutTests:

* TestExpectations:
* platform/gtk/TestExpectations:

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

17 months agoEnsure target triple is propagated correctly to DerivedSources.make
timothy_horton@apple.com [Tue, 27 Feb 2018 23:45:40 +0000 (23:45 +0000)]
Ensure target triple is propagated correctly to DerivedSources.make
https://bugs.webkit.org/show_bug.cgi?id=183189
<rdar://problem/37959694>

Reviewed by Dan Bernstein.

If we don't propagate the target triple, we can sometimes build with
the wrong options enabled.

* Configurations/Base.xcconfig:
Mentioning LLVM_TARGET_TRIPLE_SUFFIX here is required to get it to be available to scripts.

* DerivedSources.make:
Propagate the target triple into our compiler invocations.

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

17 months agoAX: Spell check and style attributes should be optional when fetching attributed...
commit-queue@webkit.org [Tue, 27 Feb 2018 22:57:14 +0000 (22:57 +0000)]
AX: Spell check and style attributes should be optional when fetching attributed string
https://bugs.webkit.org/show_bug.cgi?id=160744

Patch by Doug Russell <doug@getitdownonpaper.com> on 2018-02-27
Reviewed by Chris Fleizach.

The overhead of fetching a spell checked attributed string via AX API is substantial.
In some cases on the order of 7/8 of the total time spent fetching the string.

This change introduces the new attribute AXAttributedStringForTextMarkerRangeWithOptions which accepts an NSDictionary as it's parameter with keys "AXTextMarkerRange" (AXTextMarkerRangeRef) and "AXSpellCheck" (NSNumber(BOOL)).

AXAttributedStringForTextMarkerRange will remain unchanged.

Source/WebCore:

Tests: accessibility/mac/attributed-string/attributed-string-for-range-with-options.html
       accessibility/mac/attributed-string/attributed-string-for-range.html

* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(AXAttributedStringAppendText):
(-[WebAccessibilityObjectWrapper doAXAttributedStringForTextMarkerRange:spellCheck:]):
(-[WebAccessibilityObjectWrapper accessibilityParameterizedAttributeNames]):
(-[WebAccessibilityObjectWrapper doAXAttributedStringForRange:]):
(-[WebAccessibilityObjectWrapper accessibilityAttributeValue:forParameter:]):
(-[WebAccessibilityObjectWrapper doAXAttributedStringForTextMarkerRange:]): Deleted.

Tools:

* DumpRenderTree/AccessibilityUIElement.cpp:
(attributedStringForTextMarkerRangeCallback):
(attributedStringForTextMarkerRangeWithOptionsCallback):
(AccessibilityUIElement::attributedStringForTextMarkerRange):
(AccessibilityUIElement::attributedStringForTextMarkerRangeWithOptions):
(AccessibilityUIElement::getJSClass):
* DumpRenderTree/AccessibilityUIElement.h:
* DumpRenderTree/ios/AccessibilityUIElementIOS.mm:
(AccessibilityUIElement::attributedStringForTextMarkerRange):
(AccessibilityUIElement::attributedStringForTextMarkerRangeWithOptions):
* DumpRenderTree/mac/AccessibilityUIElementMac.mm:
(createJSStringRef):
(AccessibilityUIElement::attributedStringForTextMarkerRange):
(AccessibilityUIElement::attributedStringForTextMarkerRangeWithOptions):
* WebKitTestRunner/InjectedBundle/AccessibilityUIElement.h:
* WebKitTestRunner/InjectedBundle/Bindings/AccessibilityUIElement.idl:
* WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp:
(WTR::AccessibilityUIElement::attributedStringForTextMarkerRange):
(WTR::AccessibilityUIElement::attributedStringForTextMarkerRangeWithOptions):
* WebKitTestRunner/InjectedBundle/ios/AccessibilityUIElementIOS.mm:
(WTR::AccessibilityUIElement::attributedStringForTextMarkerRange):
(WTR::AccessibilityUIElement::attributedStringForTextMarkerRangeWithOptions):
* WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementMac.mm:
(WTR::createJSStringRef):
(WTR::AccessibilityUIElement::attributedStringForTextMarkerRange):
(WTR::AccessibilityUIElement::attributedStringForTextMarkerRangeWithOptions):

LayoutTests:

* accessibility/mac/attributed-string: Added.
* accessibility/mac/attributed-string/attributed-string-for-range-expected.txt: Added.
* accessibility/mac/attributed-string/attributed-string-for-range-with-options-expected.txt: Added.
* accessibility/mac/attributed-string/attributed-string-for-range-with-options.html: Added.
* accessibility/mac/attributed-string/attributed-string-for-range.html: Added.
* accessibility/mac/bounds-for-range-expected.txt:

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

17 months agoStandardize terminology for marked text
dbates@webkit.org [Tue, 27 Feb 2018 22:35:47 +0000 (22:35 +0000)]
Standardize terminology for marked text
https://bugs.webkit.org/show_bug.cgi?id=180999

Reviewed by Zalan Bujtas.

The name MarkerSubrange is a misnomer for a data structure that associates a text subrange with a type
and optional document marker. In particular, a MarkerSubrange may not always correspond to a document
marker. For instance, selected text is represented using a MarkerSubrange that does not have a
corresponding document marker. Let's standardize on the phrase "marked text" as the canonical way to
describe these tagged text subranges.

Source/WebCore:

* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* rendering/InlineTextBox.cpp:
(WebCore::InlineTextBox::localSelectionRect const):
(WebCore::InlineTextBox::MarkedTextStyle::areBackgroundMarkedTextStylesEqual):
(WebCore::InlineTextBox::MarkedTextStyle::areForegroundMarkedTextStylesEqual):
(WebCore::InlineTextBox::MarkedTextStyle::areDecorationMarkedTextStylesEqual):
(WebCore::InlineTextBox::StyledMarkedText::StyledMarkedText):
(WebCore::createMarkedTextFromSelectionInBox):
(WebCore::InlineTextBox::paint):
(WebCore::InlineTextBox::paintPlatformDocumentMarkers):
(WebCore::InlineTextBox::paintPlatformDocumentMarker):
(WebCore::InlineTextBox::computeStyleForUnmarkedMarkedText const):
(WebCore::InlineTextBox::resolveStyleForMarkedText):
(WebCore::InlineTextBox::subdivideAndResolveStyle):
(WebCore::InlineTextBox::coalesceAdjacentMarkedTexts):
(WebCore::InlineTextBox::collectMarkedTextsForDraggedContent):
(WebCore::InlineTextBox::collectMarkedTextsForDocumentMarkers):
(WebCore::InlineTextBox::paintMarkedTexts):
(WebCore::InlineTextBox::paintMarkedTextBackground):
(WebCore::InlineTextBox::paintMarkedTextForeground):
(WebCore::InlineTextBox::paintMarkedTextDecoration):
(WebCore::InlineTextBox::paintCompositionBackground):
(WebCore::InlineTextBox::MarkerSubrangeStyle::areBackgroundMarkerSubrangeStylesEqual): Deleted.
(WebCore::InlineTextBox::MarkerSubrangeStyle::areForegroundMarkerSubrangeStylesEqual): Deleted.
(WebCore::InlineTextBox::MarkerSubrangeStyle::areDecorationMarkerSubrangeStylesEqual): Deleted.
(WebCore::InlineTextBox::StyledMarkerSubrange::StyledMarkerSubrange): Deleted.
(WebCore::createMarkerSubrangeFromSelectionInBox): Deleted.
(WebCore::InlineTextBox::computeStyleForUnmarkedMarkerSubrange const): Deleted.
(WebCore::InlineTextBox::resolveStyleForSubrange): Deleted.
(WebCore::InlineTextBox::coalesceAdjacentSubranges): Deleted.
(WebCore::InlineTextBox::collectSubrangesForDraggedContent): Deleted.
(WebCore::InlineTextBox::collectSubrangesForDocumentMarkers): Deleted.
(WebCore::InlineTextBox::paintMarkerSubranges): Deleted.
(WebCore::InlineTextBox::paintTextSubrangeBackground): Deleted.
(WebCore::InlineTextBox::paintTextSubrangeForeground): Deleted.
(WebCore::InlineTextBox::paintTextSubrangeDecoration): Deleted.
* rendering/InlineTextBox.h:
(WebCore::InlineTextBox::paintMarkedTexts):
(WebCore::InlineTextBox::paintMarkerSubranges): Deleted.
* rendering/MarkedText.cpp: Renamed from Source/WebCore/rendering/MarkerSubrange.cpp.
(WebCore::subdivide):
* rendering/MarkedText.h: Renamed from Source/WebCore/rendering/MarkerSubrange.h.
(WebCore::MarkedText::MarkedText):
(WebCore::MarkedText::isEmpty const):
(WebCore::MarkedText::operator!= const):
(WebCore::MarkedText::operator== const):

Tools:

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebCore/MarkedText.cpp: Added.
(WebCore::operator<<):
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WebCore/MarkerSubrange.cpp: Removed.

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

17 months ago[Win64] JSCOnly compile error using VS2017 and cmake
commit-queue@webkit.org [Tue, 27 Feb 2018 22:12:59 +0000 (22:12 +0000)]
[Win64] JSCOnly compile error using VS2017 and cmake
https://bugs.webkit.org/show_bug.cgi?id=183176

Patch by Karlen Simonyan <szkarlen@gmail.com> on 2018-02-27
Reviewed by Alex Christensen.

* wtf/PlatformJSCOnly.cmake:

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

17 months agoUnreviewed, roll out r228430.
cdumez@apple.com [Tue, 27 Feb 2018 21:47:57 +0000 (21:47 +0000)]
Unreviewed, roll out r228430.

Roll out r228430 now that it is no longer needed after r228852.

No new tests, initial fix is still covered by WebKit.RespondToPolicyForNavigationResponseAsynchronously
API test.

* loader/FrameLoader.cpp:
(WebCore::FrameLoader::stopLoading):
* loader/NavigationScheduler.cpp:
(WebCore::NavigationScheduler::schedule):

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

17 months agoUnreviewed, marking a number of Web Animations WPT tests non-flaky.
graouts@webkit.org [Tue, 27 Feb 2018 21:08:50 +0000 (21:08 +0000)]
Unreviewed, marking a number of Web Animations WPT tests non-flaky.

* TestExpectations:

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

17 months ago[Web Animations] Correct implementation of pending tasks and promises
graouts@webkit.org [Tue, 27 Feb 2018 21:05:02 +0000 (21:05 +0000)]
[Web Animations] Correct implementation of pending tasks and promises
https://bugs.webkit.org/show_bug.cgi?id=183161

Reviewed by Dean Jackson.

LayoutTests/imported/w3c:

Update test expectations with progressions (+32 WPT PASS).

* web-platform-tests/web-animations/interfaces/Animatable/animate-no-browsing-context-expected.txt:
* web-platform-tests/web-animations/interfaces/Animation/finish-expected.txt:
* web-platform-tests/web-animations/interfaces/Animation/finished-expected.txt:
* web-platform-tests/web-animations/interfaces/Animation/onfinish-expected.txt:
* web-platform-tests/web-animations/interfaces/Animation/pause-expected.txt:
* web-platform-tests/web-animations/interfaces/Animation/pending-expected.txt:
* web-platform-tests/web-animations/interfaces/Animation/startTime-expected.txt:
* web-platform-tests/web-animations/timing-model/animations/canceling-an-animation-expected.txt:
* web-platform-tests/web-animations/timing-model/animations/pausing-an-animation-expected.txt:
* web-platform-tests/web-animations/timing-model/animations/play-states-expected.txt:
* web-platform-tests/web-animations/timing-model/animations/reversing-an-animation-expected.txt:
* web-platform-tests/web-animations/timing-model/animations/set-the-animation-start-time-expected.txt:
* web-platform-tests/web-animations/timing-model/animations/set-the-target-effect-of-an-animation-expected.txt:
* web-platform-tests/web-animations/timing-model/animations/set-the-timeline-of-an-animation-expected.txt:

Source/WebCore:

We had an incorrect implementation of the spec due to two misinterpretations.

The first one is about pending tasks (play and pause) which the spec says should
be performed by "scheduling a task". In WebCore, this means using postTask() on a
ScriptExecutionContext, such as Document. One of the big practical changes is that
calling play() on an animation correctly sets its startTime to null (unresolved)
immediately after the call to play() returns before setting it to a resolved value
when the task is performed asynchronously. As a result, the playState is now always
accurate.

The second one is about promises where new promises need to be created in certain
situations called out by the spec. We used to call clear() on them, but this merely
resets the fulfillment or rejection state of the promise, while the spec requires
a different object to be returned for the promise. We now create our promises using
makeUniqueRef<> when new promise objects are expected to be created.

This patch also corrects a few smaller bugs and spec compliant issues, called out
below, related to pending tasks and promises uncovered while looking at relevant
WPT tests.

* animation/DocumentTimeline.h: Expose the Document used to create this timeline such
that it may be used by WebAnimation objects registered for this timeline when scheduling
a task is required via postTask().
* animation/WebAnimation.cpp:
(WebCore::WebAnimation::WebAnimation):
(WebCore::WebAnimation::setBindingsStartTime):
(WebCore::WebAnimation::setCurrentTime):
(WebCore::WebAnimation::cancel): Ensure the finished promise has not already been fulfilled
before rejecting it. While the spec does not specifically call this out, a promise may not
be rejected after being fulfilled, and we would hit an ASSERT if we didn't also check that
it was in the correct pending state before attemping to reject it.
(WebCore::WebAnimation::resetPendingTasks):
(WebCore::WebAnimation::finish):
(WebCore::WebAnimation::updateFinishedState):
(WebCore::WebAnimation::finishNotificationSteps):
(WebCore::WebAnimation::play): We used to only check for a pending pause task before canceling
that task, but the spec says to check for either a pending pause or play task (ie. pending())
and to cancel whichever is scheduled.
(WebCore::WebAnimation::runPendingPlayTask): We were missing an assertion called out by the
spec when running a pending task.
(WebCore::WebAnimation::pause):
(WebCore::WebAnimation::runPendingPauseTask):
(WebCore::WebAnimation::updatePendingTasks): We now use postTask() on the animation's associated
timeline's document to schedule pending tasks for which the criteria to run are met, ie. there
is an associated timeline.
* animation/WebAnimation.h:

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

17 months agoMake it possible to set suggestions in extra zoom mode.
commit-queue@webkit.org [Tue, 27 Feb 2018 20:14:01 +0000 (20:14 +0000)]
Make it possible to set suggestions in extra zoom mode.
https://bugs.webkit.org/show_bug.cgi?id=183154
<rdar://problem/35227450>

Patch by Yongjun Zhang <yongjun_zhang@apple.com> on 2018-02-27
Reviewed by Tim Horton.

In extra zoom mode, when presenting WKFocusedFormControlViewController, make it the inputDelegate for
WKContentView. This is needed to ensure we can capture/cache the suggestions when _WKInputSession's
suggestions is updated. Later, when we present WKTextInputViewController, we can pass the cached
suggestions.

* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView presentFocusedFormControlViewController:]): Set _focusedFormControlViewController as
    the inputDelegate for WKContentView.
(-[WKContentView dismissFocusedFormControlViewController:]): Null the inputDelegate on dismissal.
(-[WKContentView presentTextInputViewController:]): Pass the suggestions from WKFocusedFormControlViewController to
    WKTextInputViewController when the latter is presented.
(-[WKContentView textInputController:didCommitText:]): Call the new delegate method textInputController:didCommitText:withSuggestion:.
(-[WKContentView textInputController:didCommitText:withSuggestion:]): When a suggestions is selected, insert the
    suggestion which will notify the client.
(-[WKContentView focusedFormControllerDidUpdateSuggestions:]): Called when the suggestion is updated after the input
    view controller is presented.

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

17 months agoStop using deprecated CADisplay SPI
timothy_horton@apple.com [Tue, 27 Feb 2018 18:21:14 +0000 (18:21 +0000)]
Stop using deprecated CADisplay SPI
https://bugs.webkit.org/show_bug.cgi?id=183150
<rdar://problem/37918297>

Reviewed by Simon Fraser.

* pal/spi/cocoa/QuartzCoreSPI.h:
Switch to the more modern way of getting the display name.

* Platform/spi/ios/FrontBoardServicesSPI.h: Added.
* Platform/spi/ios/UIKitSPI.h:
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _snapshotRect:intoImageOfWidth:completionHandler:]):
* WebKit.xcodeproj/project.pbxproj:
Switch to the more modern way of getting the display name.

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

17 months agoUnreviewed, rolling out r229055.
ryanhaddad@apple.com [Tue, 27 Feb 2018 18:04:36 +0000 (18:04 +0000)]
Unreviewed, rolling out r229055.

Breaks internal builds.

Reverted changeset:

"Stop using deprecated CADisplay SPI"
https://bugs.webkit.org/show_bug.cgi?id=183150
https://trac.webkit.org/changeset/229055

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

17 months agowebkitpy Bugzilla transactions should retry on URLError
aakash_jain@apple.com [Tue, 27 Feb 2018 17:54:13 +0000 (17:54 +0000)]
webkitpy Bugzilla transactions should retry on URLError
https://bugs.webkit.org/show_bug.cgi?id=183156

Reviewed by Alexey Proskuryakov.

* Scripts/webkitpy/common/net/bugzilla/bugzilla.py:
(Bugzilla): Use NetworkTransaction.
(Bugzilla._fetch_bug_page_by_url):
(Bugzilla.bug_id_for_attachment_id):
(Bugzilla.get_bug_id_for_attachment_id):

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

17 months ago[Extra zoom mode] Implement additional SPI for adjusting viewport shrink-to-fit behavior
wenson_hsieh@apple.com [Tue, 27 Feb 2018 17:16:31 +0000 (17:16 +0000)]
[Extra zoom mode] Implement additional SPI for adjusting viewport shrink-to-fit behavior
https://bugs.webkit.org/show_bug.cgi?id=183100
<rdar://problem/37840987>

Reviewed by Tim Horton.

Source/WebCore:

Introduce new customization options to ViewportConfiguration. The first is m_forceHorizontalShrinkToFit, which
(when set to true) forces the viewport to scale using shrink-to-fit heuristics, regardless of whether
"shrink-to-fit=no" is specified via viewport parameters or if content width did not exceed minimum layout size.
The second is m_viewSize, which reflects the true size of the viewport. See WebKit ChangeLog for more details.

Tests: ViewportSizingTests.ForceShrinkToFitViewportOverridesViewportParameters
       ViewportSizingTests.ShrinkToFitViewportWithMinimumAllowedLayoutWidth

* page/ViewportConfiguration.cpp:
(WebCore::ViewportConfiguration::ViewportConfiguration):
(WebCore::ViewportConfiguration::setMinimumLayoutSize):

Plumb the real size of the view alongside the minimum layout size when updating the minimum layout size.

(WebCore::ViewportConfiguration::setForceHorizontalShrinkToFit):
(WebCore::ViewportConfiguration::shouldIgnoreHorizontalScalingConstraints const):

Bail early and return true if forceHorizontalShrinkToFit is set. This forces shrink-to-fit even in cases where
"shrink-to-fit" is set to "no", or content dimensions don't exceed layout dimensions.

(WebCore::ViewportConfiguration::initialScaleFromSize const):

Use view dimensions rather than minimum layout dimensions when computing the initial scale. Minimum layout size
is no longer always equal to the size of the view if the client has specified a minimum allowed layout width. As
such, when computing the initial scale, to ensure that the content (which was laid out using the minimum layout
size) fits within the real viewport, we need to divide real viewport dimensions by content dimensions.

(WebCore::ViewportConfiguration::minimumScale const):

Similarly, use view size instead of minimum layout size to compute minimum scale.

(WebCore::ViewportConfiguration::description const):
* page/ViewportConfiguration.h:

Source/WebKit:

Add new SPI hooks to provide finer control over certain aspects of the shrink-to-fit viewport heuristic.
Currently, in certain cases of iPad multitasking, Safari allows shrinking content to fit by default. This means
that even when "width=device-width" is used, if the contents of the page are too wide to fit within the
viewport's width, we'll adjust the initial scale such that the viewport can fit all of the content.

However, in certain viewport dimensions, this heuristic is insufficient to ensure that pages are laid out and
displayed properly within the viewport. Namely, one could imagine that an element with a hard-coded width that
is larger than the real viewport width would cause all other elements with dimensions relative to the body to be
excessively shrunk down once shrink-to-fit is applied, so the page would still look broken even if the contents
of the page all fit within the viewport.

To mitigate this, we decouple the notions of minimum layout size from the size of the actual viewport (which we
simply refer to as "view size"). This allows us to introduce a mechanism where we lay out the page at a given
minimum layout size that is larger than the size of the view; later, when we determine the initial scale, we
then apply shrink-to-fit scaling using the view size rather than the minimum layout size. This grants us the
ability to lay out content as if our view were large, but still ensure that the contents of the page fit within
the actual view.

* Shared/VisibleContentRectUpdateInfo.cpp:
(WebKit::VisibleContentRectUpdateInfo::encode const):
(WebKit::VisibleContentRectUpdateInfo::decode):
(WebKit::operator<<):
* Shared/VisibleContentRectUpdateInfo.h:
(WebKit::VisibleContentRectUpdateInfo::VisibleContentRectUpdateInfo):
(WebKit::VisibleContentRectUpdateInfo::forceHorizontalShrinkToFit const):
(WebKit::operator==):

Plumb the forceHorizontalShrinkToFit flag through VisibleContentRectUpdateInfo.

* Shared/WebPageCreationParameters.cpp:
(WebKit::WebPageCreationParameters::encode const):
(WebKit::WebPageCreationParameters::decode):
* Shared/WebPageCreationParameters.h:

Plumb viewSize through IPC to WebPage.

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

Start off WKWebView flags at their initial values.

(-[WKWebView _minimumAllowedLayoutWidth]):
(-[WKWebView _setMinimumAllowedLayoutWidth:]):

This provides the minimum width at which the page will lay out, such that if the view width dips below this
value, we'll use this minimum allowed layout width instead. 0 by default.

(-[WKWebView activeMinimumLayoutSizes:]):

Refactor this from a static function to a helper method on WKWebView that computes both the minimum layout size
(which takes minimum allowed layout width into account) as well as the real view size. Refactor all call sites
to use this new method, and also propagate the view size down via IPC, alongside the minimum layout size.

(-[WKWebView _dispatchSetMinimumLayoutSize:viewSize:]):
(-[WKWebView _frameOrBoundsChanged]):
(-[WKWebView _setMinimumLayoutSizeOverride:]):
(-[WKWebView _setForceHorizontalViewportShrinkToFit:]):
(-[WKWebView _forceHorizontalViewportShrinkToFit]):

Setting this flag to YES forces us to always shrink-to-fit in the horizontal axis. NO by default.

(-[WKWebView _beginAnimatedResizeWithUpdates:]):
(-[WKWebView _endAnimatedResize]):
(activeMinimumLayoutSize): Deleted.

More refactoring to replace activeMinimumLayoutSize() with -activeMinimumLayoutSizes:.

(-[WKWebView _dispatchSetMinimumLayoutSize:]): Deleted.
* UIProcess/API/Cocoa/WKWebViewPrivate.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::creationParameters):
* UIProcess/WebPageProxy.h:
* UIProcess/ios/WKContentView.mm:
(-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:obscuredInsets:unobscuredSafeAreaInsets:inputViewBounds:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:enclosedInScrollableAncestorView:]):

Pass _forceHorizontalViewportShrinkToFit into the visible content rect update.

* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::dynamicViewportSizeUpdate):
(WebKit::WebPageProxy::setViewportConfigurationMinimumLayoutSize):

Plumb viewSize alongside the existing minimumLayoutSize.

* WebProcess/WebPage/WebPage.cpp:
(WebKit::m_credentialsMessenger):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::setViewportConfigurationMinimumLayoutSize):
(WebKit::WebPage::dynamicViewportSizeUpdate):
(WebKit::WebPage::updateVisibleContentRects):

Set forceHorizontalShrinkToFit on the viewport configuration here.

Tools:

Add API tests that exercise -_setMinimumAllowedLayoutWidth: and -_setForceHorizontalViewportShrinkToFit:. See
WebKit ChangeLog for more detail.

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/ios/ViewportSizingTests.mm: Added.
(TestWebKitAPI::while):
(viewportTestPageMarkup):
(TestWebKitAPI::TEST):

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

17 months agoUnreviewed, fix the debug build after r228877.
wenson_hsieh@apple.com [Tue, 27 Feb 2018 16:43:22 +0000 (16:43 +0000)]
Unreviewed, fix the debug build after r228877.

In the case where CAN_DISALLOW_USER_INSTALLED_FONTS is enabled, this function doesn't return anything when
allowUserInstalledFonts != AllowUserInstalledFonts::No. Fix the build by moving `return nullptr;` back out of
the `#else`.

* platform/graphics/cocoa/FontCacheCoreText.cpp:
(WebCore::installedFontMandatoryAttributes):

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

17 months agoPotential privacy issue: DNS prefetching can be re-enabled
commit-queue@webkit.org [Tue, 27 Feb 2018 16:39:11 +0000 (16:39 +0000)]
Potential privacy issue: DNS prefetching can be re-enabled
https://bugs.webkit.org/show_bug.cgi?id=182924

Patch by Milan Crha <mcrha@redhat.com> on 2018-02-27
Reviewed by Michael Catanzaro.

* dom/Document.cpp:
(WebCore::Document::parseDNSPrefetchControlHeader):

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

17 months agoRelayout frames after AsyncFrameScrolling or FrameFlattening option is changed
fred.wang@free.fr [Tue, 27 Feb 2018 14:00:02 +0000 (14:00 +0000)]
Relayout frames after AsyncFrameScrolling or FrameFlattening option is changed
https://bugs.webkit.org/show_bug.cgi?id=183081

Patch by Frederic Wang <fwang@igalia.com> on 2018-02-27
Reviewed by Antonio Gomes.

Add a test to check whether an iframe changes its flattening status after one of the option
AsyncFrameScrolling/FrameFlattening is enabled/disabled.

* platform/ios-simulator/TestExpectations: Remove failure.
* platform/ios/fast/frames/flattening/iframe-flattening-async-frame-scrolling-dynamic-expected.txt: Added.
* platform/ios/fast/frames/flattening/iframe-flattening-async-frame-scrolling-dynamic.html: Added.

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

17 months ago[Web Animations] Implement the procedure to set the target effect of an animation
graouts@webkit.org [Tue, 27 Feb 2018 13:03:03 +0000 (13:03 +0000)]
[Web Animations] Implement the procedure to set the target effect of an animation
https://bugs.webkit.org/show_bug.cgi?id=183146

Reviewed by Dean Jackson.

We only had a partial implementation of setEffect() and we now update it to cover the entire
implementation as mandated by the spec. While this doesn't yield any WPT results changes, this
patch will help getting a significant number of new PASS results when we get around to implement
correct support for async procedures (pending pause/play tasks and promises) in the next patch.

* animation/WebAnimation.cpp:
(WebCore::WebAnimation::setEffect):

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

17 months ago[Web Animations] Update the playState implementation
graouts@webkit.org [Tue, 27 Feb 2018 13:00:29 +0000 (13:00 +0000)]
[Web Animations] Update the playState implementation
https://bugs.webkit.org/show_bug.cgi?id=183145

Reviewed by Dean Jackson.

LayoutTests/imported/w3c:

Update test expectations with slightly different failures later on in a couple of tests.

* web-platform-tests/web-animations/timing-model/animations/set-the-timeline-of-an-animation-expected.txt:

Source/WebCore:

The Web Animations spec has changed since we first implemented the playState property and the "pending"
enum value has been dropped since then (there is a separate "pending" property which we also implement).
We update our implementation to match the latest spec text. This does not change WPT test results a lot,
but this patch will help getting a significant number of new PASS results when we get around to implementing
correct support for async procedures (pending pause/play tasks and promises) in a couple of patches.

* animation/WebAnimation.cpp:
(WebCore::WebAnimation::playState const):
* animation/WebAnimation.h:
* animation/WebAnimation.idl:

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

17 months agoUnreviewed, skip FTL tests if FTL is disabled
utatane.tea@gmail.com [Tue, 27 Feb 2018 09:36:28 +0000 (09:36 +0000)]
Unreviewed, skip FTL tests if FTL is disabled
https://bugs.webkit.org/show_bug.cgi?id=183071

JSTests:

* stress/has-indexed-property-array-storage-ftl.js:
* stress/has-indexed-property-slow-put-array-storage-ftl.js:

Tools:

* Scripts/run-jsc-stress-tests:

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

17 months agoAddress post-review comment after r229049.
wenson_hsieh@apple.com [Tue, 27 Feb 2018 08:06:41 +0000 (08:06 +0000)]
Address post-review comment after r229049.
https://bugs.webkit.org/show_bug.cgi?id=183142

Reviewed by Tim Horton.

Wrap a newly added string literal with ASCIILiteral.

* rendering/RenderThemeIOS.mm:
(WebCore::RenderThemeIOS::extraDefaultStyleSheet):

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

17 months agoStop using deprecated CADisplay SPI
timothy_horton@apple.com [Tue, 27 Feb 2018 08:00:57 +0000 (08:00 +0000)]
Stop using deprecated CADisplay SPI
https://bugs.webkit.org/show_bug.cgi?id=183150
<rdar://problem/37918297>

Reviewed by Simon Fraser.

Source/WebCore/PAL:

* pal/spi/cocoa/QuartzCoreSPI.h:
Switch to the more modern way of getting the display name.

Source/WebKit:

* Platform/spi/ios/FrontBoardServicesSPI.h: Added.
* Platform/spi/ios/UIKitSPI.h:
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _snapshotRect:intoImageOfWidth:completionHandler:]):
* WebKit.xcodeproj/project.pbxproj:
Switch to the more modern way of getting the display name.

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

17 months agoModernize FINALIZE_CODE and peer macros to use __VA_ARGS__ arguments.
mark.lam@apple.com [Tue, 27 Feb 2018 07:50:54 +0000 (07:50 +0000)]
Modernize FINALIZE_CODE and peer macros to use __VA_ARGS__ arguments.
https://bugs.webkit.org/show_bug.cgi?id=183159
<rdar://problem/37930837>

Reviewed by Keith Miller.

Source/JavaScriptCore:

* assembler/LinkBuffer.h:
* assembler/testmasm.cpp:
(JSC::compile):
* b3/B3Compile.cpp:
(JSC::B3::compile):
* b3/air/testair.cpp:
* b3/testb3.cpp:
(JSC::B3::testEntrySwitchSimple):
(JSC::B3::testEntrySwitchNoEntrySwitch):
(JSC::B3::testEntrySwitchWithCommonPaths):
(JSC::B3::testEntrySwitchWithCommonPathsAndNonTrivialEntrypoint):
(JSC::B3::testEntrySwitchLoop):
* bytecode/InlineAccess.cpp:
(JSC::linkCodeInline):
(JSC::InlineAccess::rewireStubAsJump):
* bytecode/PolymorphicAccess.cpp:
(JSC::PolymorphicAccess::regenerate):
* dfg/DFGJITFinalizer.cpp:
(JSC::DFG::JITFinalizer::finalize):
(JSC::DFG::JITFinalizer::finalizeFunction):
* dfg/DFGOSRExit.cpp:
(JSC::DFG::OSRExit::compileOSRExit):
* dfg/DFGThunks.cpp:
(JSC::DFG::osrExitThunkGenerator):
(JSC::DFG::osrExitGenerationThunkGenerator):
(JSC::DFG::osrEntryThunkGenerator):
* ftl/FTLJITFinalizer.cpp:
(JSC::FTL::JITFinalizer::finalizeCommon):
* ftl/FTLLazySlowPath.cpp:
(JSC::FTL::LazySlowPath::generate):
* ftl/FTLOSRExitCompiler.cpp:
(JSC::FTL::compileStub):
* ftl/FTLThunks.cpp:
(JSC::FTL::genericGenerationThunkGenerator):
(JSC::FTL::slowPathCallThunkGenerator):
* jit/ExecutableAllocator.cpp:
* jit/JIT.cpp:
(JSC::JIT::link):
* jit/JITMathIC.h:
(JSC::isProfileEmpty):
* jit/JITOpcodes.cpp:
(JSC::JIT::privateCompileHasIndexedProperty):
* jit/JITOpcodes32_64.cpp:
(JSC::JIT::privateCompileHasIndexedProperty):
* jit/JITPropertyAccess.cpp:
(JSC::JIT::stringGetByValStubGenerator):
(JSC::JIT::privateCompileGetByVal):
(JSC::JIT::privateCompileGetByValWithCachedId):
(JSC::JIT::privateCompilePutByVal):
(JSC::JIT::privateCompilePutByValWithCachedId):
* jit/JITPropertyAccess32_64.cpp:
(JSC::JIT::stringGetByValStubGenerator):
* jit/JITStubRoutine.h:
* jit/Repatch.cpp:
(JSC::linkPolymorphicCall):
* jit/SpecializedThunkJIT.h:
(JSC::SpecializedThunkJIT::finalize):
* jit/ThunkGenerators.cpp:
(JSC::throwExceptionFromCallSlowPathGenerator):
(JSC::linkCallThunkGenerator):
(JSC::linkPolymorphicCallThunkGenerator):
(JSC::virtualThunkFor):
(JSC::nativeForGenerator):
(JSC::arityFixupGenerator):
(JSC::unreachableGenerator):
(JSC::boundThisNoArgsFunctionCallGenerator):
* llint/LLIntThunks.cpp:
(JSC::LLInt::generateThunkWithJumpTo):
* wasm/WasmBBQPlan.cpp:
(JSC::Wasm::BBQPlan::complete):
* wasm/WasmBinding.cpp:
(JSC::Wasm::wasmToWasm):
* wasm/WasmOMGPlan.cpp:
(JSC::Wasm::OMGPlan::work):
* wasm/WasmThunks.cpp:
(JSC::Wasm::throwExceptionFromWasmThunkGenerator):
(JSC::Wasm::throwStackOverflowFromWasmThunkGenerator):
(JSC::Wasm::triggerOMGTierUpThunkGenerator):
* wasm/js/WasmToJS.cpp:
(JSC::Wasm::handleBadI64Use):
(JSC::Wasm::wasmToJS):
* yarr/YarrJIT.cpp:
(JSC::Yarr::YarrGenerator::compile):

Source/WebCore:

No new tests needed because this is just a refactoring patch.

* cssjit/SelectorCompiler.cpp:
(WebCore::SelectorCompiler::SelectorCodeGenerator::compile):

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

17 months ago[FTL] Support PutByVal(ArrayStorage/SlowPutArrayStorage)
utatane.tea@gmail.com [Tue, 27 Feb 2018 07:32:14 +0000 (07:32 +0000)]
[FTL] Support PutByVal(ArrayStorage/SlowPutArrayStorage)
https://bugs.webkit.org/show_bug.cgi?id=182965

Reviewed by Saam Barati.

JSTests:

* stress/put-by-val-array-storage.js: Added.
(shouldBe):
(testArrayStorageInBounds):
* stress/put-by-val-direct-out-of-bounds-setter.js: Added.
(shouldBe):
(testInt32.createBuiltin):
(set for):
* stress/put-by-val-slow-put-array-storage.js: Added.
(shouldBe):
(testArrayStorageInBounds):

Source/JavaScriptCore:

This patch extends FTL coverage for PutByVal by adding ArrayStorage and SlwoPutArrayStorage support.
Basically large part of the patch is porting from DFG code. Since PutByVal already emits CheckInBounds
for InBounds case, we do not have OutOfBounds check for that case.
This is the last change for FTL to support all the types of DFG nodes except for CreateThis.

* dfg/DFGOperations.cpp:
* dfg/DFGOperations.h:
* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::compileDoublePutByVal):
* dfg/DFGSpeculativeJIT64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* ftl/FTLCapabilities.cpp:
(JSC::FTL::canCompile):
* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::compilePutByVal):
(JSC::FTL::DFG::LowerDFGToB3::contiguousPutByValOutOfBounds):
For consistency, we use operationPutByValXXX and operationPutByValDirectXXX.
But except for SlowPutArrayStorage case, basically it is meaningless since
we do not have indexed accessors.

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

17 months agoRemoved references to files that were removed in r228912.
mitz@apple.com [Tue, 27 Feb 2018 03:00:50 +0000 (03:00 +0000)]
Removed references to files that were removed in r228912.

* WebCore.xcodeproj/project.pbxproj: Removed references to SourcesIOS.txt and SourcesMac.txt.

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

17 months ago[Extra zoom mode] Tweak UA stylesheet to improve legibility of rendered text
wenson_hsieh@apple.com [Tue, 27 Feb 2018 01:32:06 +0000 (01:32 +0000)]
[Extra zoom mode] Tweak UA stylesheet to improve legibility of rendered text
https://bugs.webkit.org/show_bug.cgi?id=183142
<rdar://problem/37912966>

Reviewed by Tim Horton.

Force text-size-adjust and hyphens to be always on in EXTRA_ZOOM_MODE. To accomplish this, we override the extra
style sheet in RenderTheme to include these two style rules.

* rendering/RenderThemeIOS.h:
* rendering/RenderThemeIOS.mm:
(WebCore::RenderThemeIOS::extraDefaultStyleSheet):

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

17 months agoFix WebCore includes within WebKitLegacy
don.olmstead@sony.com [Tue, 27 Feb 2018 01:31:41 +0000 (01:31 +0000)]
Fix WebCore includes within WebKitLegacy
https://bugs.webkit.org/show_bug.cgi?id=183147

Reviewed by Tim Horton.

Source/WebCore:

No new tests. No change in behavior.

* PlatformWin.cmake:
* platform/win/GDIUtilities.h:

Source/WebKitLegacy:

* CMakeLists.txt:

Source/WebKitLegacy/win:

* Plugins/PluginDatabase.cpp:
* Plugins/PluginDatabaseWin.cpp:
* Plugins/PluginDebug.cpp:
* Plugins/PluginDebug.h:
* Plugins/PluginMainThreadScheduler.cpp:
* Plugins/PluginMessageThrottlerWin.cpp:
* Plugins/PluginMessageThrottlerWin.h:
* Plugins/PluginPackage.cpp:
* Plugins/PluginPackage.h:
* Plugins/PluginPackageWin.cpp:
* Plugins/PluginStream.cpp:
* Plugins/PluginStream.h:
* Plugins/PluginView.cpp:
* Plugins/PluginView.h:
* Plugins/PluginViewWin.cpp:
* Plugins/npapi.cpp:
* WebCoreSupport/WebChromeClient.cpp:
* WebCoreSupport/WebContextMenuClient.cpp:
* WebCoreSupport/WebFrameLoaderClient.cpp:
* WebCoreSupport/WebInspectorClient.cpp:
* WebCoreSupport/WebPlatformStrategies.cpp:
* WebFrame.cpp:
* WebKitMessageLoop.cpp:
* WebView.cpp:
* storage/WebDatabaseProvider.cpp:

Tools:

* MiniBrowser/win/ResourceLoadDelegate.cpp:

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

17 months agoAdd some more release logging related to DocumentWriter::addData crash
commit-queue@webkit.org [Tue, 27 Feb 2018 00:20:01 +0000 (00:20 +0000)]
Add some more release logging related to DocumentWriter::addData crash
https://bugs.webkit.org/show_bug.cgi?id=183141

Patch by Youenn Fablet <youenn@apple.com> on 2018-02-26
Reviewed by Chris Dumez.

No change of behavior.
Add some additional release logging to verify whether DocumentWriter::begin was called and exited before updating its state.

* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::commitData):
* loader/DocumentWriter.cpp:
(WebCore::DocumentWriter::begin):
* loader/DocumentWriter.h:

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

17 months agoCaches::m_storage should be set to null in case of error at initialization time
commit-queue@webkit.org [Tue, 27 Feb 2018 00:04:06 +0000 (00:04 +0000)]
Caches::m_storage should be set to null in case of error at initialization time
https://bugs.webkit.org/show_bug.cgi?id=183068

Patch by Youenn Fablet <youenn@apple.com> on 2018-02-26
Reviewed by Chris Dumez.

In case of error, we need to set m_storage back to nullptr so that
next tries to initialize it will restart from scratch.
If we do not set it to nullptr, we end up storing the initialize
callback in a queue and the callback will never be called.

This is difficult to test as we need the following conditions:
- we need to have an error case, like a disk writing error
- we need the web app to open a cache in two different pages/frames at about the same time.

* NetworkProcess/cache/CacheStorageEngineCaches.cpp:
(WebKit::CacheStorage::Caches::initialize):

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

17 months agoWeb Inspector: Canvas Tab: Scroll into view / Inspect element if Canvas has DOM node
webkit@devinrousso.com [Mon, 26 Feb 2018 23:52:09 +0000 (23:52 +0000)]
Web Inspector: Canvas Tab: Scroll into view / Inspect element if Canvas has DOM node
https://bugs.webkit.org/show_bug.cgi?id=181769

Reviewed by Matt Baker.

* Localizations/en.lproj/localizedStrings.js:

* UserInterface/Images/Markup.svg: Added.

* UserInterface/Views/CanvasContentView.js:
(WI.CanvasContentView):
(WI.CanvasContentView.prototype.initialLayout):
(WI.CanvasContentView.prototype._canvasElementButtonClicked):

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

17 months agoUnreviewed, rolling out r226330.
commit-queue@webkit.org [Mon, 26 Feb 2018 23:20:22 +0000 (23:20 +0000)]
Unreviewed, rolling out r226330.
https://bugs.webkit.org/show_bug.cgi?id=183152

incorrectly assumes enumeration callback happens once
(Requested by alexchristensen on #webkit).

Reverted changeset:

"Use BlockPtrs and lambdas instead of new/delete to pass
parameters to blocks in WebViewImpl::performDragOperation"
https://bugs.webkit.org/show_bug.cgi?id=180795
https://trac.webkit.org/changeset/226330

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

17 months agoFix up ChangeLog description for r229041 to clarify that we are skipping tests on...
dbates@webkit.org [Mon, 26 Feb 2018 21:38:39 +0000 (21:38 +0000)]
Fix up ChangeLog description for r229041 to clarify that we are skipping tests on GTK and WPE.

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

17 months agotestRunner.setWindowIsKey() has no effect on the web process side in WebKit2
dbates@webkit.org [Mon, 26 Feb 2018 21:31:32 +0000 (21:31 +0000)]
testRunner.setWindowIsKey() has no effect on the web process side in WebKit2
https://bugs.webkit.org/show_bug.cgi?id=81736
<rdar://problem/11088268>

Remove some tests from the platform-independent WebKit2 TestExpectation file that
now pass on iOS and Mac following r189959 and r211910, respectively. Mark these
tests are failing on GTK and WPE. For GTK we need to fix <https://bugs.webkit.org/show_bug.cgi?id=183140>
For WPE we need to fix <https://bugs.webkit.org/show_bug.cgi?id=183144>.

The test fast/selectors/querySelector-window-inactive.html still fails on WebKit2,
but for a different reason. See <https://bugs.webkit.org/show_bug.cgi?id=183140>
for more details.

* platform/gtk/TestExpectations:
* platform/wk2/TestExpectations:
* platform/wpe/TestExpectations:

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

17 months ago[Web Animations] Implement the procedure to set the start time
graouts@webkit.org [Mon, 26 Feb 2018 21:15:09 +0000 (21:15 +0000)]
[Web Animations] Implement the procedure to set the start time
https://bugs.webkit.org/show_bug.cgi?id=183137

Reviewed by Dean Jackson.

LayoutTests/imported/w3c:

Update test expectations with progressions.

* web-platform-tests/web-animations/timing-model/animations/set-the-animation-start-time-expected.txt:

Source/WebCore:

Implement the procedure to set the start time as setBindingsStartTime() and use the setStartTime() method as
an internal method to set the m_startTime instance variable and invalidate the timing model rather than run
the entire procedure which should only be called when setting the "startTime" property through the JS API.

* animation/WebAnimation.cpp:
(WebCore::WebAnimation::setTimeline):
(WebCore::WebAnimation::setBindingsStartTime):
(WebCore::WebAnimation::setStartTime):
(WebCore::WebAnimation::silentlySetCurrentTime):
(WebCore::WebAnimation::finish):
(WebCore::WebAnimation::updateFinishedState):
(WebCore::WebAnimation::runPendingPlayTask):
(WebCore::WebAnimation::runPendingPauseTask):

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

17 months agoRelease assertion in WebPage::updatePreferences
rniwa@webkit.org [Mon, 26 Feb 2018 20:44:50 +0000 (20:44 +0000)]
Release assertion in WebPage::updatePreferences
https://bugs.webkit.org/show_bug.cgi?id=183075

Reviewed by Youenn Fablet and Chris Dumez.

Replaced the release assertion added in r228589 with a more graceful disabling of the feature when the entitlement is missing.

* StorageProcess/StorageProcess.cpp:
(WebKit::StorageProcess::didReceiveMessage): Added an early exit with an entitlement check to disable the feature.
(WebKit::StorageProcess::initializeWebsiteDataStore): Ditto.
(WebKit::StorageProcess::createStorageToWebProcessConnection): Replaced the release assertion with a debug assertion.
(WebKit::StorageProcess::swServerForSession): Removed the assertion. This code can be reached when the service worker is disabled.
(WebKit::StorageProcess::registerSWServerConnection): Replaced the release assertion with a debug assertion.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::updatePreferences): Disable the feature instead of crashing when the entitlement is missing.

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

17 months agovalidateStackAccess should not validate if the offset is within the stack bounds
sbarati@apple.com [Mon, 26 Feb 2018 20:42:39 +0000 (20:42 +0000)]
validateStackAccess should not validate if the offset is within the stack bounds
https://bugs.webkit.org/show_bug.cgi?id=183067
<rdar://problem/37749988>

Reviewed by Mark Lam.

JSTests:

* stress/dont-validate-stack-offset-in-b3-because-it-might-be-guarded-by-control-flow.js: Added.
(assert):
(test.a):
(test.b):
(test):

Source/JavaScriptCore:

The validation rule was saying that any load from the stack must be
within the stack bounds of the frame. However, it's natural for a user
of B3 to emit code that may be outside of B3's stack bounds, but guard
such a load with a branch. The FTL does exactly this with GetMyArgumentByVal.
B3 is wrong to assert that this is a static property about all stack loads.

* b3/B3Validate.cpp:

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

17 months ago[Curl] Cookies are not being added to the Cookie field in Request Headers
commit-queue@webkit.org [Mon, 26 Feb 2018 20:02:40 +0000 (20:02 +0000)]
[Curl] Cookies are not being added to the Cookie field in Request Headers
https://bugs.webkit.org/show_bug.cgi?id=183095

Patch by Christopher Reid <chris.reid@sony.com> on 2018-02-26
Reviewed by Alex Christensen.

Populating the Cookie request header field now that cookies are no longer handled in libcurl.

* platform/network/curl/CookieJarCurlDatabase.cpp: Renaming the httpOnly variable as its actual use wasn't clear
* platform/network/curl/ResourceHandleCurl.cpp:

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

17 months agoRegression(r223431): Crash under didReceiveChallenge in NetworkSessionCocoa
cdumez@apple.com [Mon, 26 Feb 2018 19:53:09 +0000 (19:53 +0000)]
Regression(r223431): Crash under didReceiveChallenge in NetworkSessionCocoa
https://bugs.webkit.org/show_bug.cgi?id=183134
<rdar://problem/36339049>

Reviewed by Alex Christensen.

Like other delegates functions in this file, it is possible for didReceiveChallenge to get called
after _session has been nulled out. Other delegate functions already had early returns when
_session is null. However, such early return was missing in didReceiveChallenge.

This patch ends the early return to didReceiveChallenge so that we do not end up calling
_session->downloadID(taskIdentifier) on a null _session.

* NetworkProcess/cocoa/NetworkSessionCocoa.mm:
(-[WKNetworkSessionDelegate URLSession:task:didReceiveChallenge:completionHandler:]):

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

17 months ago[Web Animations] Ensure setting the hold time invalidates the timing model
graouts@webkit.org [Mon, 26 Feb 2018 19:43:50 +0000 (19:43 +0000)]
[Web Animations] Ensure setting the hold time invalidates the timing model
https://bugs.webkit.org/show_bug.cgi?id=183136

Reviewed by Dean Jackson.

LayoutTests/imported/w3c:

Update test expectations with progressions.

* web-platform-tests/css/css-multicol/multicol-gap-animation-001-expected.txt:
* web-platform-tests/web-animations/animation-model/keyframe-effects/effect-value-iteration-composite-operation-expected.txt:
* web-platform-tests/web-animations/interfaces/Animation/cancel-expected.txt:
* web-platform-tests/web-animations/interfaces/Animation/finish-expected.txt:
* web-platform-tests/web-animations/interfaces/KeyframeEffect/iterationComposite-expected.txt:

Source/WebCore:

We used to always set the m_holdTime member variable directly, but the computation of the currentTime
depends on the value of m_holdTime, so setting the hold time should invalidate the timing model as well
as setting the m_holdTime member variable. In this patch we add a new setHoldTime() private method that
sets the member variable and invalidates the timing model.

* animation/WebAnimation.cpp:
(WebCore::WebAnimation::setTimeline):
(WebCore::WebAnimation::setHoldTime):
(WebCore::WebAnimation::silentlySetCurrentTime):
(WebCore::WebAnimation::setCurrentTime):
(WebCore::WebAnimation::cancel):
(WebCore::WebAnimation::finish):
(WebCore::WebAnimation::updateFinishedState):
(WebCore::WebAnimation::play):
(WebCore::WebAnimation::runPendingPlayTask):
(WebCore::WebAnimation::pause):
(WebCore::WebAnimation::runPendingPauseTask):
* animation/WebAnimation.h:

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

17 months ago[WinCairo] WebKit2_C.h should be included for TestWebKit
commit-queue@webkit.org [Mon, 26 Feb 2018 19:08:33 +0000 (19:08 +0000)]
[WinCairo] WebKit2_C.h should be included for TestWebKit
https://bugs.webkit.org/show_bug.cgi?id=182682

Patch by Yousuke Kimoto <yousuke.kimoto@sony.com> on 2018-02-26
Reviewed by Yusuke Suzuki.

.:

Added a new definition "BUILDING_WIN_CAIRO_WEBKIT" to specify
the wincairo webkit build.

* Source/cmake/OptionsWinCairo.cmake:

Tools:

* TestWebKitAPI/config.h:

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

17 months agoMessagePort is not always destroyed in the right thread
commit-queue@webkit.org [Mon, 26 Feb 2018 18:01:12 +0000 (18:01 +0000)]
MessagePort is not always destroyed in the right thread
https://bugs.webkit.org/show_bug.cgi?id=183053

Patch by Youenn Fablet <youenn@apple.com> on 2018-02-26
Reviewed by Chris Dumez.

Source/WebCore:

Make existingMessagePortForIdentifier take a lambda so that we hold the lock until there
is no longer a need to keep the MessagePort around.
This is very time sensitive and does not happen a lot when running WPT tests.

Update existing call sites to pass a lambda.

* dom/MessagePort.cpp:
(WebCore::MessagePort::existingMessagePortForIdentifier):
* dom/MessagePort.h:
* dom/messageports/MessagePortChannelProviderImpl.cpp:
(WebCore::MessagePortChannelProviderImpl::postMessageToRemote):
(WebCore::MessagePortChannelProviderImpl::checkProcessLocalPortForActivity):

Source/WebKit:

Update code to pass a lambda to MessagePort::existingMessagePortForIdentifier.

* WebProcess/WebCoreSupport/WebMessagePortChannelProvider.cpp:
(WebKit::WebMessagePortChannelProvider::checkProcessLocalPortForActivity):
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::messagesAvailableForPort):

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

17 months agoUnreviewed, rolling out r226745.
commit-queue@webkit.org [Mon, 26 Feb 2018 17:38:14 +0000 (17:38 +0000)]
Unreviewed, rolling out r226745.
https://bugs.webkit.org/show_bug.cgi?id=183132

This is breaking some websites (Requested by youenn on
#webkit).

Reverted changeset:

"Use no-cache fetch mode when loading main documents with
location.reload()"
https://bugs.webkit.org/show_bug.cgi?id=181285
https://trac.webkit.org/changeset/226745

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

17 months agoUnreviewed, USE_GSTREAMER_PLAYBIN3 build fix.
philn@webkit.org [Mon, 26 Feb 2018 16:25:45 +0000 (16:25 +0000)]
Unreviewed, USE_GSTREAMER_PLAYBIN3 build fix.

* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
There is no such ENABLE_GSTREAMER_PLAYBIN3.

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

17 months agoUnreviewed, manual rollout of r228866 causing EGL_BAD_CONTEXT errors
philn@webkit.org [Mon, 26 Feb 2018 14:34:41 +0000 (14:34 +0000)]
Unreviewed, manual rollout of r228866 causing EGL_BAD_CONTEXT errors

* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
(WebCore::MediaPlayerPrivateGStreamerBase::ensureGstGLContext):
Create an EGL display, even in Wayland.

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

17 months ago[WebVR][OpenVR] Retrieve displayId and the z-depth of eye view frustum
svillar@igalia.com [Mon, 26 Feb 2018 13:37:55 +0000 (13:37 +0000)]
[WebVR][OpenVR] Retrieve displayId and the z-depth of eye view frustum
https://bugs.webkit.org/show_bug.cgi?id=182999

Reviewed by Žan Doberšek.

Retrieve the z-depth of the eye view frustum and the HMD unique id.
The unique identifier is generated by the VRPlatormManager whereas
we use the default values from the spec for the z-depth (those can
be changed by applications later via JavaScript).

Once this lands the only remaining data to be retrieved from VR
backends for VRDisplay is the pose (getPose() call) and the frame
data (getFrameData() call).

* Modules/webvr/VRDisplay.cpp:
(WebCore::VRDisplay::VRDisplay):
(WebCore::VRDisplay::displayId const): Deleted.
(WebCore::VRDisplay::displayName const): Deleted.
(WebCore::VRDisplay::depthNear const): Deleted.
(WebCore::VRDisplay::setDepthNear): Deleted.
(WebCore::VRDisplay::depthFar const): Deleted.
(WebCore::VRDisplay::setDepthFar): Deleted.
* Modules/webvr/VRDisplay.h:
(WebCore::VRDisplay::displayId const): Moved implementation from
source file.
(WebCore::VRDisplay::displayName const): Ditto.
(WebCore::VRDisplay::depthNear const):
(WebCore::VRDisplay::setDepthNear):
(WebCore::VRDisplay::depthFar const):
(WebCore::VRDisplay::setDepthFar):
* platform/vr/VRManager.cpp:
(WebCore::VRManager::generateUniqueDisplayIdentifier):
* platform/vr/VRManager.h:
* platform/vr/VRPlatformDisplay.h:
* platform/vr/openvr/VRPlatformDisplayOpenVR.cpp:
(WebCore::VRPlatformDisplayOpenVR::VRPlatformDisplayOpenVR):

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

17 months agoFix build error with !LOG_DISABLED
cturner@igalia.com [Mon, 26 Feb 2018 13:07:41 +0000 (13:07 +0000)]
Fix build error with !LOG_DISABLED
https://bugs.webkit.org/show_bug.cgi?id=183049

Reviewed by Philippe Normand.

The following error message was being reported when doing a
release build with -DLOG_DISABLED=0:

../../Source/WebCore/dom/messageports/MessagePortChannel.cpp: In member function ‘void WebCore::MessagePortChannel::entanglePortWithProcess(const WebCore::MessagePortIdentifier&, WebCore::ProcessIdentifier)’:

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

17 months ago[GStreamer] User current executable name instead of g_get_prgname() for gst_init
carlosgc@webkit.org [Mon, 26 Feb 2018 09:43:50 +0000 (09:43 +0000)]
[GStreamer] User current executable name instead of g_get_prgname() for gst_init
https://bugs.webkit.org/show_bug.cgi?id=183119

Reviewed by Philippe Normand.

Source/WebCore:

g_get_prgname() is only set for programs using GOptionContext, calling gtk_init or explicitly calling
g_set_prgname(). Use WTF::getCurrentExecutableName() instead.

* platform/graphics/gstreamer/GStreamerUtilities.cpp:
(WebCore::initializeGStreamer):

Source/WTF:

Add getCurrentExecutableName() helper function to get the name of the current executable.

* wtf/glib/GLibUtilities.cpp:
(getCurrentExecutableName): Get the basename of getCurrentExecutablePath() falling back to g_get_prgname().
* wtf/glib/GLibUtilities.h:

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

17 months agoUnreviewed, skip FTL tests if FTL is disabled
utatane.tea@gmail.com [Mon, 26 Feb 2018 08:57:48 +0000 (08:57 +0000)]
Unreviewed, skip FTL tests if FTL is disabled
https://bugs.webkit.org/show_bug.cgi?id=183071

* stress/has-indexed-property-array-storage-ftl.js:
* stress/has-indexed-property-slow-put-array-storage-ftl.js:

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

17 months ago[CMake][OpenVR] Linkage errors happen because only OpenVR is compiled with -stdlib...
commit-queue@webkit.org [Mon, 26 Feb 2018 08:01:12 +0000 (08:01 +0000)]
[CMake][OpenVR] Linkage errors happen because only OpenVR is compiled with -stdlib=libc++ if Clang is used
https://bugs.webkit.org/show_bug.cgi?id=183116

Patch by Fujii Hironori <Hironori.Fujii@sony.com> on 2018-02-26
Reviewed by Žan Doberšek.

OpenVR has a option USE_LIBCXX to enable/disable that behavior. Let's disable it.

* Source/CMakeLists.txt: Added a option command for USE_LIBCXX to set OFF as default.

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

17 months ago[WK2] http/tests/navigation/new-window-redirect-history.html crashes
commit-queue@webkit.org [Mon, 26 Feb 2018 02:50:31 +0000 (02:50 +0000)]
[WK2] http/tests/navigation/new-window-redirect-history.html crashes
https://bugs.webkit.org/show_bug.cgi?id=127683

Patch by Fujii Hironori <Hironori.Fujii@sony.com> on 2018-02-25
Reviewed by Dan Bernstein.

Tools:

m_previousTestBackForwardListItem was null for the new window.
m_previousTestBackForwardListItem is initialized only for the main
window in InjectedBundlePage::prepare.

* WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
(WTR::InjectedBundlePage::dumpBackForwardList):
Do null-check of m_previousTestBackForwardListItem.

LayoutTests:

* platform/ios-wk2/TestExpectations:
Unmarked http/tests/navigation/new-window-redirect-history.html.
* platform/wk2/TestExpectations: Ditto.

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

17 months agoVarious crashes in WebKitTestRunner, especially when system is under heavy load
ap@apple.com [Mon, 26 Feb 2018 02:18:24 +0000 (02:18 +0000)]
Various crashes in WebKitTestRunner, especially when system is under heavy load
https://bugs.webkit.org/show_bug.cgi?id=183109

Reviewed by Tim Horton.

WebKitTestRunner had many places where it sent messages to WebContent with a timeout,
but it didn't handle the timeout when it did occur. Nearly all of those would result
in logic errors and failing tests, and most would even result in stack corruption,
as the response handler modified local variables.

There is only one timeout scenario that we actually mean to handle in WKTR. That's
when a test freezes after it is done (e.g. an infinite loop in beforeunload) - we don't
want to blame the next test for freezing, so we silently relaunch WebContent.
Everything else is cargo cult code that never worked.

This patch addresses the crashes, and actually makes tests pass a lot more on an
overloaded system.

* WebKitTestRunner/TestController.cpp:
(WTR::TestController::resetStateToConsistentValues): Moved m_doneResetting assignment
to where it's actually needed, for clarity.
(WTR::TestController::reattachPageToWebProcess): This function used to always hit
and ignore message timeout, as m_doneResetting is only updated by navigation callback
when the state is Resetting. This change makes it faster.
(WTR::TestController::platformResetStateToConsistentValues): Style fix.
(WTR::TestController::clearServiceWorkerRegistrations): Timing out here wasn't
handled in a meaningful manner, and would even corrupt the stack.
(WTR::TestController::clearDOMCache): Ditto.
(WTR::TestController::clearDOMCaches): Ditto.
(WTR::TestController::hasDOMCache): Ditto.
(WTR::TestController::domCacheSize): Ditto.
(WTR::TestController::isStatisticsPrevalentResource): Ditto.
(WTR::TestController::isStatisticsRegisteredAsSubFrameUnder): Ditto.
(WTR::TestController::isStatisticsRegisteredAsRedirectingTo): Ditto.
(WTR::TestController::isStatisticsHasHadUserInteraction): Ditto.
(WTR::TestController::isStatisticsGrandfathered): Ditto.
(WTR::TestController::statisticsUpdateCookiePartitioning): Ditto.
(WTR::TestController::statisticsSetShouldPartitionCookiesForHost): Ditto.
(WTR::TestController::statisticsClearInMemoryAndPersistentStore): Ditto.
(WTR::TestController::statisticsClearInMemoryAndPersistentStoreModifiedSinceHours): Ditto.
(WTR::TestController::statisticsClearThroughWebsiteDataRemoval): Ditto.

* WebKitTestRunner/TestInvocation.cpp:
(WTR::TestInvocation::shortTimeout const): Made shortTimeout shorter (on a hunch).
(WTR::TestInvocation::invoke): Removed a timeout waiting for initial response. There
is never a logical reason for such a timeout, as we always have a new or responsive
WebContent process here.
(WTR::TestInvocation::dumpResults): Removed another timeout that we don't know how to
properly handle.
(WTR::TestInvocation::didReceiveMessageFromInjectedBundle): Removed assignment to
m_errorMessage, which had no effect in this context.

* WebKitTestRunner/TestInvocation.h: Removed no longer used code.

* WebKitTestRunner/cocoa/TestControllerCocoa.mm:
(WTR::TestController::cocoaResetStateToConsistentValues): Use a named constant for
no timeout.

* WebKitTestRunner/ios/TestControllerIOS.mm:
(WTR::TestController::platformConfigureViewForTest): Removed a useless timeout.
Not sure if timing out here would corrupt the stack or not, but there is no reason
to impose arbitrary limits on individual steps of a test.

* WebKitTestRunner/mac/TestControllerMac.mm:
(WTR::TestController::platformConfigureViewForTest): Use a named constant for
no timeout.

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

17 months agoFont smoothing doesn't get disabled if the preference is set before launching WebCont...
ap@apple.com [Mon, 26 Feb 2018 02:13:09 +0000 (02:13 +0000)]
Font smoothing doesn't get disabled if the preference is set before launching WebContent process
https://bugs.webkit.org/show_bug.cgi?id=183108

Reviewed by Tim Horton.

* WebProcess/WebProcess.cpp: (WebKit::WebProcess::initializeWebProcess):
Fix the bug. While at it, also avoid the anti-pattern in setAlwaysUsesComplexTextCodePath.

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

17 months ago[Extra zoom mode] Disable downloadable binary fonts by default
wenson_hsieh@apple.com [Sun, 25 Feb 2018 22:36:37 +0000 (22:36 +0000)]
[Extra zoom mode] Disable downloadable binary fonts by default
https://bugs.webkit.org/show_bug.cgi?id=183102
<rdar://problem/37860699>

Reviewed by Tim Horton.

Disable downloadable binary fonts by default in extra zoom mode by making the initial value of
`downloadableBinaryFontsEnabled` conditional. Layout tests are not possible at this time; test to be added once
layout test support is in place.

* page/Settings.yaml:
* page/SettingsBase.cpp:
(WebCore::SettingsBase::defaultDownloadableBinaryFontsEnabled):
* page/SettingsBase.h:

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

17 months agoUnreviewed. Change my status to committer.
ajuma@chromium.org [Sun, 25 Feb 2018 21:48:13 +0000 (21:48 +0000)]
Unreviewed. Change my status to committer.

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

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

17 months agoUnreviewed GTK Debug build fix after r228942.
philn@webkit.org [Sun, 25 Feb 2018 19:37:35 +0000 (19:37 +0000)]
Unreviewed GTK Debug build fix after r228942.

* UIProcess/API/glib/IconDatabase.cpp:
(WebKit::IconDatabase::iconDatabaseSyncThread):
(WebKit::IconDatabase::syncThreadMainLoop):
(WebKit::IconDatabase::readFromDatabase):
(WebKit::IconDatabase::writeToDatabase):
(WebKit::IconDatabase::cleanupSyncThread):

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

17 months agoService workers do not work well inside Web.app
cdumez@apple.com [Sun, 25 Feb 2018 19:02:15 +0000 (19:02 +0000)]
Service workers do not work well inside Web.app
https://bugs.webkit.org/show_bug.cgi?id=183105
<rdar://problem/37864140>

Reviewed by Youenn Fablet.

Source/WebCore:

SessionID::defaultSessionID() was hardcoded in the ServiceWorkerThread constructor
instead of using the sessionID of the SWServer that created the service worker thread.
As a result, when the Service Worker would establish a SWClientConnection to the
server, it would use the wrong sessionID and would end up using a different SWServer
(Since we have a different SWServer instance per sessionID). As a result,
ServiceWorkerRegistration / ServiceWorker objects inside the service worker would not
be kept in sync with the server (since they registered themselves with the wrong
SWServer).

Covered by new API test.

* workers/service/ServiceWorkerContextData.cpp:
(WebCore::ServiceWorkerContextData::isolatedCopy const):
* workers/service/ServiceWorkerContextData.h:
(WebCore::ServiceWorkerContextData::encode const):
(WebCore::ServiceWorkerContextData::decode):
* workers/service/context/ServiceWorkerThread.cpp:
(WebCore::ServiceWorkerThread::ServiceWorkerThread):
* workers/service/context/ServiceWorkerThreadProxy.cpp:
(WebCore::createPageForServiceWorker):
(WebCore::ServiceWorkerThreadProxy::ServiceWorkerThreadProxy):
* workers/service/server/RegistrationDatabase.cpp:
(WebCore::RegistrationDatabase::importRecords):
* workers/service/server/RegistrationStore.h:
(WebCore::RegistrationStore::server):
* workers/service/server/SWServer.cpp:
(WebCore::SWServer::updateWorker):
* workers/service/server/SWServerWorker.cpp:
(WebCore::SWServerWorker::contextData const):

Source/WebKit:

* StorageProcess/StorageProcess.cpp:
(WebKit::StorageProcess::didReceiveMessage):
We were failing to forward IPC messages to the ChildProcess class here. As a result,
the ChildProcess::RegisterURLSchemeServiceWorkersCanHandle IPC was being ignored
by the StorageProcess.

Tools:

Add API test coverage.

* TestWebKitAPI/Tests/WebKitCocoa/ServiceWorkerBasic.mm:

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

17 months ago[build.webkit.org] unit-tests fail if buildbot 0.8.6p1 is not installed locally
aakash_jain@apple.com [Sun, 25 Feb 2018 18:38:36 +0000 (18:38 +0000)]
[build.webkit.org] unit-tests fail if buildbot 0.8.6p1 is not installed locally
https://bugs.webkit.org/show_bug.cgi?id=183103

Reviewed by Alexey Proskuryakov.

* BuildSlaveSupport/build.webkit.org-config/steps_unittest.py: Removed extra imports.

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

17 months agoUnreviewed, fix the TestWebKitAPI build after r228825.
wenson_hsieh@apple.com [Sat, 24 Feb 2018 23:30:16 +0000 (23:30 +0000)]
Unreviewed, fix the TestWebKitAPI build after r228825.

I removed a `>= iOS 11` check in r228825, but forgot that this was also neeed to guard against tvOS and watchOS
builds. This fixes the build by restoring the compile-time guard and also makes it explicit for these platforms.

* TestWebKitAPI/Tests/ios/ActionSheetTests.mm:

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

17 months agoNull-dereference of the second argument `resource` of DocumentLoader::scheduleSubstit...
commit-queue@webkit.org [Sat, 24 Feb 2018 22:06:39 +0000 (22:06 +0000)]
Null-dereference of the second argument `resource` of DocumentLoader::scheduleSubstituteResourceLoad
https://bugs.webkit.org/show_bug.cgi?id=182920

Patch by Fujii Hironori <Hironori.Fujii@sony.com> on 2018-02-24
Reviewed by Darin Adler.

A test case
imported/w3c/web-platform-tests/html/browsers/offline/appcache/workers/appcache-worker.html
always crashes due to a null-dereference if compiled and optimized
by GCC 7.2. The second argument `resource` of
DocumentLoader::scheduleSubstituteResourceLoad can be null if the
resource can't be found in cache. I guess GCC optimizes inline
HashMap::add based on assuming the `resource` never becomes null
because its type is SubstituteResource&.

This changes introduces a new method
DocumentLoader::scheduleCannotShowURLError because it looks tricky
to pass a nullptr to the second argument of
scheduleSubstituteResourceLoad.

No new tests (Covered by existing tests).

* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::scheduleCannotShowURLError): Added a new method.
* loader/DocumentLoader.h:
* loader/appcache/ApplicationCacheHost.cpp:
(WebCore::ApplicationCacheHost::maybeLoadResource):
Call scheduleCannotShowURLError if the resource not found in the appcache.

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

17 months agoPrepare for ExtendedColor changes (first step)
darin@apple.com [Sat, 24 Feb 2018 21:47:52 +0000 (21:47 +0000)]
Prepare for ExtendedColor changes (first step)
https://bugs.webkit.org/show_bug.cgi?id=182904

Reviewed by Sam Weinig.

Source/WebCore:

* css/CSSValuePool.cpp:
(WebCore::CSSValuePool::createColorValue): Use HashMap::ensure.
(WebCore::CSSValuePool::createFontFamilyValue): Ditto.
(WebCore::CSSValuePool::createFontFaceValue): Ditto.

* css/parser/CSSParserFastPaths.cpp:
(WebCore::CSSParserFastPaths::maybeParseValue): Tightened up
the logic a bit.

* html/canvas/CanvasRenderingContext2D.cpp: Removed many unneeded includes.

* inspector/InspectorCanvas.cpp:
(WebCore::InspectorCanvas::recordAction): Updated for Ref instead of
RefPtr and to use move semantics.
(WebCore::buildArrayForAffineTransform): Return Ref instead of RefPtr.
(WebCore::buildArrayForVector): Ditto.
(WebCore::InspectorCanvas::buildInitialState): Ditto. Also use auto more.
(WebCore::InspectorCanvas::buildAction): Ditto.
(WebCore::InspectorCanvas::buildArrayForCanvasGradient): Ditto.
(WebCore::InspectorCanvas::buildArrayForCanvasPattern): Ditto.
(WebCore::InspectorCanvas::buildArrayForImageData): Ditto.
* inspector/InspectorCanvas.h: Updated for the above. Also us "using" instead
of typedef and removed unneeded ErrorString typedef and some includes.

* page/DragController.cpp:
(WebCore::DragController::concludeEditDrag): Use auto and Ref.

* platform/DragData.h: Used pragma once and reorganized includes a bit.

* platform/graphics/ImageFrame.h:
(WebCore::ImageFrame::frameBytes const): Use uint32_t instead of RGBA32 to
prepare for removal of the RGBA32 type coming in a future patch.
* platform/graphics/ImageSource.cpp:
(WebCore::ImageSource::cacheNativeImageAtIndex): Ditto.
(WebCore::ImageSource::canUseAsyncDecoding): Ditto.

* platform/graphics/cocoa/GraphicsContextCocoa.mm: Tweaked #if for Mac-only
code to use PLATFORM(MAC) to be easier to read.
(WebCore::GraphicsContext::focusRingColor): Use sRGBColorSpaceRef instead of
calling CGColorSpaceCreateWithName each time.

* platform/graphics/texmap/TextureMapperFPSCounter.cpp: Added include needed
now that it was removed from some header.

* platform/graphics/win/GraphicsContextPlatformPrivateDirect2D.h: Use uint32_t
instead of RGBA32 to prepare for removal of the RGBA32 type coming in a future patch.
* platform/image-decoders/ScalableImageDecoder.cpp:
(WebCore::ScalableImageDecoder::frameBytesAtIndex const): Ditto.
* platform/image-decoders/cairo/ImageBackingStoreCairo.cpp:
(WebCore::ImageBackingStore::image const): Ditto.
* platform/image-decoders/gif/GIFImageDecoder.cpp:
(WebCore::GIFImageDecoder::haveDecodedRow): Ditto.
* platform/image-decoders/jpeg/JPEGImageDecoder.cpp:
(WebCore::setPixel): Ditto.
(WebCore::JPEGImageDecoder::outputScanlines): Ditto.
* platform/image-decoders/png/PNGImageDecoder.cpp:
(WebCore::PNGImageDecoder::rowAvailable): Ditto.
(WebCore::PNGImageDecoder::frameComplete): Ditto.
* platform/image-decoders/webp/WEBPImageDecoder.cpp:
(WebCore::WEBPImageDecoder::decodeFrame): Ditto.
(WebCore::WEBPImageDecoder::applyPostProcessing): Ditto.

* platform/mac/PlatformPasteboardMac.mm:
(WebCore::PlatformPasteboard::color): Added comments.

* rendering/EllipsisBox.cpp:
(WebCore::EllipsisBox::paintSelection): Use Color::isVisible.

Source/WebKitLegacy/mac:

* Misc/WebKitNSStringExtras.mm:
(-[NSString _web_drawAtPoint:font:textColor:]): Use colorFromNSColor.

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

17 months agoUnreviewed WPE breakage fix.
zandobersek@gmail.com [Sat, 24 Feb 2018 11:31:53 +0000 (11:31 +0000)]
Unreviewed WPE breakage fix.

* WebProcess/wpe/WebProcessMainWPE.cpp: Call g_set_prgname() in WebProcess
to prepare the GLib state for subsequent GStreamer initialization.

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