WebKit-https.git
14 months agoEWS for security bugs
dbates@webkit.org [Thu, 21 Jun 2018 22:14:01 +0000 (22:14 +0000)]
EWS for security bugs
https://bugs.webkit.org/show_bug.cgi?id=186291
<rdar://problem/40829658>

In r232979, I inadvertently removed a line of code in _parse_authorized_api_keys() to define a local called api_keys.
Add this code back.

* QueueStatusServer/config/authorization.py:
(_parse_authorized_api_keys):

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

14 months agoUnreviewed, rolling out r232884.
commit-queue@webkit.org [Thu, 21 Jun 2018 21:42:59 +0000 (21:42 +0000)]
Unreviewed, rolling out r232884.
https://bugs.webkit.org/show_bug.cgi?id=186891

"Introduced assertion failure in ~DisplayRefreshMonitorMac()."
(Requested by perarne on #webkit).

Reverted changeset:

"DisplayRefreshMonitorMac should hold a weak pointer to
WebPage."
https://bugs.webkit.org/show_bug.cgi?id=186683
https://trac.webkit.org/changeset/232884

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

14 months ago[Fullscreen] Page sometimes ends up with an incorrect zoom level after entering fulls...
jer.noble@apple.com [Thu, 21 Jun 2018 21:23:12 +0000 (21:23 +0000)]
[Fullscreen] Page sometimes ends up with an incorrect zoom level after entering fullscreen
https://bugs.webkit.org/show_bug.cgi?id=186822

Reviewed by Simon Fraser.

Source/WebCore:

* dom/Document.cpp:
(WebCore::Document::setOverrideViewportArguments):
(WebCore::Document::updateViewportArguments):
* dom/Document.h:

Source/WebKit:

Set the minimum zoom, maximum zoom, zoom bouncing, and user scalability settings of the
WKWebView's UIScrollView upon entering fullscreen, and restore those same settings upon
exit. Override the viewport arguments upon entering fullscreen, restore them upon exit.

* Platform/IPC/ArgumentCoder.h:
* Shared/WebCoreArgumentCoders.cpp:
(IPC::ArgumentCoder<ViewportArguments>::decode):
* Shared/WebCoreArgumentCoders.h:
* UIProcess/WebPageProxy.h:
(WebKit::WebPageProxy::forceAlwaysUserScalable const):
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::setOverrideViewportArguments):
* UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm:
(WebKit::WKWebViewState::applyTo):
(WebKit::WKWebViewState::store):
(-[WKFullScreenWindowController enterFullScreen]):
(-[WKFullScreenWindowController beganExitFullScreenWithInitialFrame:finalFrame:]):
* WebProcess/WebPage/WebPage.h:
(WebKit::WebPage::forceAlwaysUserScalable const):
* WebProcess/WebPage/WebPage.messages.in:
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::setOverrideViewportArguments):

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

14 months agoEWS should not try to post comments or upload result archives to security-sensitive
dbates@webkit.org [Thu, 21 Jun 2018 21:11:28 +0000 (21:11 +0000)]
EWS should not try to post comments or upload result archives to security-sensitive
bugs unless it has access
https://bugs.webkit.org/show_bug.cgi?id=186831

Reviewed by Lucas Forschler.

Following r232979 security-sensitive patches are uploaded to the status server so
that they can be retrieved and processed by EWS bots without the need for Bugzilla
security bug access. Although the EWS machinery is robust against unexpected exceptions,
including exceptions raised when interacting with Bugzilla bugs/attachments with
insufficient credentials, we should not depend on such defenses as they cause webkit-
patch to log a message for the "unexpected" exception. We should reserve such logging
for truly unexpected exceptions that indicate a programming mistake that we need to fix.

* Scripts/webkitpy/tool/commands/earlywarningsystem.py:
(AbstractEarlyWarningSystem._post_reject_message_on_bug): Bail out early if we cannot
access the bug.
* Scripts/webkitpy/tool/commands/queues.py:
(PatchProcessingQueue._can_access_bug): Added.
(PatchProcessingQueue._upload_results_archive_for_patch): Only add an attachment if we
can access the bug.
(CommitQueue.process_work_item): Only post a rejection comment (i.e. call CommitterValidatorreject_patch_from_commit_queue())
if we can access the bug.

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

14 months agoFix for https://bugs.webkit.org/show_bug.cgi?id=185790
lforschler@apple.com [Thu, 21 Jun 2018 20:58:52 +0000 (20:58 +0000)]
Fix for https://bugs.webkit.org/show_bug.cgi?id=185790

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

14 months agoRenderSVGInline has to be inline always regardless of its css display value
said@apple.com [Thu, 21 Jun 2018 20:54:32 +0000 (20:54 +0000)]
RenderSVGInline has to be inline always regardless of its css display value
https://bugs.webkit.org/show_bug.cgi?id=186656

Reviewed by Zalan Bujtas.

Source/WebCore:

According to https://www.w3.org/TR/SVG2/text.html#TextLayout, the <text>
element has to be laid out as if it were a block element and any <tspan>,
<textPath>, <a> and <tref> descendants were inline elements.

If a css rule, which contains the property "display: block;", is applied
to any of children of a <text> element, this property has to be ignored.

We currently ignore this property in RenderSVGInline::updateFromStyle()
by forcing setInline(true). But we do not do the same thing in
RenderTreeBuilder::normalizeTreeAfterStyleChange(). In fact we allow
making the children of the <text> element to be non-inline. This puts
the render tree in weired state and causes many assertions to fire while
laying out RenderSVGText.

Test: svg/dom/svg-inline-text-display-block-crash.html

* rendering/updating/RenderTreeBuilder.cpp:
(WebCore::RenderTreeBuilder::normalizeTreeAfterStyleChange):

LayoutTests:

* svg/dom/svg-inline-text-display-block-crash-expected.txt: Added.
* svg/dom/svg-inline-text-display-block-crash.html: Added.

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

14 months agoDo not reuse generated inline renderer for the first letter.
zalan@apple.com [Thu, 21 Jun 2018 20:34:14 +0000 (20:34 +0000)]
Do not reuse generated inline renderer for the first letter.
https://bugs.webkit.org/show_bug.cgi?id=186657
<rdar://problem/41157892>

Reviewed by Simon Fraser.

Source/WebCore:

When the first letter pseudo element is present, we construct a dedicated subtree for its content like this:

<div><span>foobar</span></div> -> with ::first-letter on the <div>
DIV RenderBlock
    SPAN RenderInline
        RenderInline (generated wrapper for the first letter content)
            RenderText (fist letter content)
        RenderText (remaining text content)

"display: contents" on the <span> forces us not to construct a RenderInline for the <span> (or just come up with a wrapper at best).
FirstLetter::createRenderers logic needs to check for such cases and pick the correct parent for the first letter subtree accordingly.

Test: fast/text/first-letter-with-display-contents-crash.html
      imported/w3c/web-platform-tests/css/css-display/display-contents-first-letter-002.html is not crashing anymore either.

* rendering/updating/RenderTreeBuilderFirstLetter.cpp:
(WebCore::RenderTreeBuilder::FirstLetter::createRenderers):

LayoutTests:

* fast/text/first-letter-with-display-contents-crash-expected.txt: Added.
* fast/text/first-letter-with-display-contents-crash.html: Added.

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

14 months agocheck-webkit-style should warn about exported inline functions
krollin@apple.com [Thu, 21 Jun 2018 20:10:15 +0000 (20:10 +0000)]
check-webkit-style should warn about exported inline functions
https://bugs.webkit.org/show_bug.cgi?id=186861
<rdar://problem/41303668>

Reviewed by Brent Fulgham.

When checking binaries compiled with LTO enabled, WebKit's
check-for-weak-vtables-and-externals script can complain about
exported inline functions. For instance, in
Source/WebCore/page/scrolling/ScrollingTree.h, the following:

WEBCORE_EXPORT virtual void reportSynchronousScrollingReasonsChanged(MonotonicTime, SynchronousScrollingReasons) { }
WEBCORE_EXPORT virtual void reportExposedUnfilledArea(MonotonicTime, unsigned /* unfilledArea */) { }

Can result in the following error messages:

ERROR: WebCore has a weak external symbol in it (.../OpenSource/WebKitBuild/Release/WebCore.framework/Versions/A/WebCore)
ERROR: A weak external symbol is generated when a symbol is defined in multiple compilation units and is also marked as being exported from the library.
ERROR: A common cause of weak external symbols is when an inline function is listed in the linker export file.
ERROR: symbol __ZN7WebCore13ScrollingTree25reportExposedUnfilledAreaEN3WTF13MonotonicTimeEj
ERROR: symbol __ZN7WebCore13ScrollingTree40reportSynchronousScrollingReasonsChangedEN3WTF13MonotonicTimeEj

Unfortunately, these errors are only emitted when LTO is enabled,
meaning that a developer could check-in a file that will fail an LTO
build if they don't build with that option locally. Therefore, try to
head this off by updating check-webkit-style to identify and warn
about these cases (which includes when an export macro is applied
directly to an inline method as well as when an inline method is part
of an exported class).

* Scripts/webkitpy/style/checkers/cpp.py:
(_FunctionState.begin):
(_FunctionState.export_macro):
(_ClassInfo.__init__):
(check_for_non_standard_constructs):
(check_function_definition):
(process_line):
(CppChecker):
* Scripts/webkitpy/style/checkers/cpp_unittest.py:
(FunctionDetectionTest.perform_function_detection):
(FunctionDetectionTest.test_webcore_export):

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

14 months agoJSPerformanceObserverCallback creates a GC strongly-referenced Function that is never...
cdumez@apple.com [Thu, 21 Jun 2018 19:04:02 +0000 (19:04 +0000)]
JSPerformanceObserverCallback creates a GC strongly-referenced Function that is never cleaned up
https://bugs.webkit.org/show_bug.cgi?id=186873
<rdar://problem/41271574>

Reviewed by Simon Fraser.

Source/WebCore:

Add [IsWeakCallback] to PerformanceObserverCallback interface so that the generated
JSPerformanceObserverCallback uses a JSC::Weak instead of a JSC::Strong to store the
js function. To keep the function alive, add [JSCustomMarkFunction] to PerformanceObserver
interface and have its visitAdditionalChildren() visit the callback's js function.
Finally, because we want the callback to still be called even if the JS does not keep
the PerformanceObserver wrapper alive, add [CustomIsReachable] to PerformanceObserver
interface and have its isReachableFromOpaqueRoots() return true if the observer is
registered (i.e. it may need to call the callback in the future).

I have confirmed locally, that the Performance / PerformanceObserver / Document
objects properly get destroyed if I navigate away from a page that had a performance
observer and trigger a memory pressure warning. Also,
`notifyutil -p com.apple.WebKit.showAllDocuments` no longer shows the old document.

Tests: performance-api/performance-observer-callback-after-gc.html
       performance-api/performance-observer-no-document-leak.html

* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSPerformanceObserverCustom.cpp: Added.
(WebCore::JSPerformanceObserver::visitAdditionalChildren):
(WebCore::JSPerformanceObserverOwner::isReachableFromOpaqueRoots):
* bindings/js/ScriptController.cpp:
* page/PerformanceObserver.cpp:
(WebCore::PerformanceObserver::disassociate):
* page/PerformanceObserver.h:
(WebCore::PerformanceObserver::isRegistered const):
(WebCore::PerformanceObserver::callback):
* page/PerformanceObserver.idl:
* page/PerformanceObserverCallback.h:
* page/PerformanceObserverCallback.idl:

LayoutTests:

* performance-api/performance-observer-callback-after-gc-expected.txt: Added.
* performance-api/performance-observer-callback-after-gc.html: Added.
Add layout test to make sure that a performance observer's callback still gets called, even if
the JS does not keep the performance observer alive.

* performance-api/performance-observer-no-document-leak-expected.txt: Added.
* performance-api/performance-observer-no-document-leak.html: Added.
* performance-api/resources/performance-observer-no-document-leak-frame.html: Added.
Add layout test coverage to make sure the document does not leak if PerformanceObserver was
used.

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

14 months ago[Fullscreen] Use secondary glyph style for fullscreen controls
jer.noble@apple.com [Thu, 21 Jun 2018 18:59:12 +0000 (18:59 +0000)]
[Fullscreen] Use secondary glyph style for fullscreen controls
https://bugs.webkit.org/show_bug.cgi?id=186862
<rdar://problem/41212210>

Reviewed by Tim Horton.

Source/WebCore/PAL:

* pal/spi/cocoa/AVKitSPI.h:

Source/WebKit:

Adopt AVBackgroundView, and use its predefined enums to set the material and tint styles for
the fullscreen controls.

* UIProcess/ios/fullscreen/WKFullScreenViewController.mm:
(-[WKFullScreenViewController loadView]):
* UIProcess/ios/fullscreen/WKFullscreenStackView.h:
* UIProcess/ios/fullscreen/WKFullscreenStackView.mm:
(-[WKFullscreenStackView init]):
(-[WKFullscreenStackView dealloc]):
(-[WKFullscreenStackView addArrangedSubview:applyingMaterialStyle:tintEffectStyle:]):
(-[WKFullscreenStackView layoutSubviews]):
(+[WKFullscreenStackView baseEffects]): Deleted.
(+[WKFullscreenStackView configureView:forTintEffectWithColor:filterType:]): Deleted.
(+[WKFullscreenStackView configureView:withBackgroundFillOfColor:opacity:filter:]): Deleted.
(+[WKFullscreenStackView secondaryMaterialOverlayView]): Deleted.
(+[WKFullscreenStackView applyPrimaryGlyphTintToView:]): Deleted.
(+[WKFullscreenStackView applySecondaryGlyphTintToView:]): Deleted.
(-[WKFullscreenStackView initWithArrangedSubviews:axis:]): Deleted.
(-[WKFullscreenStackView setTargetViewForSecondaryMaterialOverlay:]): Deleted.
(-[WKFullscreenStackView contentView]): Deleted.
(-[WKFullscreenStackView _setArrangedSubviews:axis:]): Deleted.
(-[WKFullscreenStackView setBounds:]): Deleted.
(-[WKFullscreenStackView updateConstraints]): Deleted.

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

14 months ago[Web Animations] Make imported/mozilla/css-animations/test_animation-ready.html pass...
graouts@webkit.org [Thu, 21 Jun 2018 18:54:45 +0000 (18:54 +0000)]
[Web Animations] Make imported/mozilla/css-animations/test_animation-ready.html pass reliably
https://bugs.webkit.org/show_bug.cgi?id=183830
<rdar://problem/40997539>

Reviewed by Dean Jackson.

LayoutTests/imported/mozilla:

Mark progressions in the Mozilla CSS Animations tests.

* css-animations/test_animation-ready-expected.txt:

Source/WebCore:

The CSS Animations Level 2 spec explains how the Web Animations API and CSS Animations interact and requires
pending styles changes on the target element of a CSS Animation to be flushed when using a Web Animations API
on it in order to ensure that any animation- CSS property is accounted for.

* animation/CSSAnimation.cpp:
(WebCore::CSSAnimation::bindingsStartTime const):
(WebCore::CSSAnimation::setBindingsStartTime):
(WebCore::CSSAnimation::bindingsCurrentTime const):
(WebCore::CSSAnimation::setBindingsCurrentTime):
(WebCore::CSSAnimation::bindingsPlayState const):
(WebCore::CSSAnimation::bindingsPending const):
(WebCore::CSSAnimation::bindingsReady):
(WebCore::CSSAnimation::bindingsFinished):
(WebCore::CSSAnimation::bindingsPlay):
(WebCore::CSSAnimation::bindingsPause):
(WebCore::CSSAnimation::flushPendingStyleChanges const):
* animation/CSSAnimation.h:
* animation/WebAnimation.h:
(WebCore::WebAnimation::bindingsPlayState const):
(WebCore::WebAnimation::bindingsPending const):
(WebCore::WebAnimation::bindingsReady):
(WebCore::WebAnimation::bindingsFinished):
(WebCore::WebAnimation::bindingsPlay):
(WebCore::WebAnimation::bindingsPause):
* animation/WebAnimation.idl:

LayoutTests:

This test now passes reliably.

* TestExpectations:

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

14 months ago[ews-build] unit-tests fail when run from another directory
aakash_jain@apple.com [Thu, 21 Jun 2018 18:51:35 +0000 (18:51 +0000)]
[ews-build] unit-tests fail when run from another directory
https://bugs.webkit.org/show_bug.cgi?id=186872

Reviewed by Lucas Forschler.

* BuildSlaveSupport/ews-build/loadConfig.py:
(loadBuilderConfig): Add support for passing master_prefix_path.
* BuildSlaveSupport/ews-build/loadConfig_unittest.py:
(ConfigDotJSONTest.test_configuration): Set master_prefix_path as current directory.

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

14 months ago[Fullscreen] Suspend page (and pause video) while phishing warning is presented
jer.noble@apple.com [Thu, 21 Jun 2018 18:47:46 +0000 (18:47 +0000)]
[Fullscreen] Suspend page (and pause video) while phishing warning is presented
https://bugs.webkit.org/show_bug.cgi?id=186856
<rdar://problem/41212444>

Reviewed by Tim Horton.

Source/WebCore:

Pause the media element when the page is suspended, and unpause when the page resumes.

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::HTMLMediaElement):
(WebCore::HTMLMediaElement::suspend):
(WebCore::HTMLMediaElement::resume):
* html/HTMLMediaElement.h:

Source/WebKit:

* UIProcess/ios/fullscreen/WKFullScreenViewController.mm:
(-[WKFullScreenViewController _showPhishingAlert]):

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

14 months agoflattenDictionaryStruture needs to zero inline storage.
keith_miller@apple.com [Thu, 21 Jun 2018 18:44:02 +0000 (18:44 +0000)]
flattenDictionaryStruture needs to zero inline storage.
https://bugs.webkit.org/show_bug.cgi?id=186869

Reviewed by Saam Barati.

JSTests:

* stress/flatten-object-zero-unused-inline-properties.js: Added.

Source/JavaScriptCore:

This patch also adds the assetion that unused property storage is
zero or JSValue() to putDirectInternal. Additionally, functions
have been added to $vm that flatten dictionary objects and return
the inline capacity of an object.

* runtime/JSObjectInlines.h:
(JSC::JSObject::putDirectInternal):
* runtime/Structure.cpp:
(JSC::Structure::flattenDictionaryStructure):
* tools/JSDollarVM.cpp:
(JSC::functionInlineCapacity):
(JSC::functionFlattenDictionaryObject):
(JSC::JSDollarVM::finishCreation):

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

14 months agoAdd support for using localhost worker in OpenSource EWS Buildbot
aakash_jain@apple.com [Thu, 21 Jun 2018 18:42:28 +0000 (18:42 +0000)]
Add support for using localhost worker in OpenSource EWS Buildbot
https://bugs.webkit.org/show_bug.cgi?id=186871

Reviewed by Lucas Forschler.

* BuildSlaveSupport/ews-build/loadConfig.py:
(loadBuilderConfig): Added a worker named 'local-worker' if use_localhost_worker option is used.
* BuildSlaveSupport/ews-build/master.cfg: Check BUILDBOT_TESTING environment variable and use_localhost_worker if so.

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

14 months agoAdd force schedulers to OpenSource EWS Buildbot
aakash_jain@apple.com [Thu, 21 Jun 2018 18:35:37 +0000 (18:35 +0000)]
Add force schedulers to OpenSource EWS Buildbot
https://bugs.webkit.org/show_bug.cgi?id=186876

Reviewed by Lucas Forschler.

* BuildSlaveSupport/ews-build/loadConfig.py:
(loadBuilderConfig): Added support for ForceScheduler.

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

14 months agoUnreviewed, rolling out r232989.
david_fenton@apple.com [Thu, 21 Jun 2018 18:24:23 +0000 (18:24 +0000)]
Unreviewed, rolling out r232989.

Causes API regressions on macOS

Reverted changeset:

"REGRESSION (r231850): Cookie file cannot be read or written
by network process"
https://bugs.webkit.org/show_bug.cgi?id=186806
https://trac.webkit.org/changeset/232989

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

14 months ago[WSL] Merge WSL_type.ott and WSL_exec.ott
rmorisset@apple.com [Thu, 21 Jun 2018 16:44:07 +0000 (16:44 +0000)]
[WSL] Merge WSL_type.ott and WSL_exec.ott
https://bugs.webkit.org/show_bug.cgi?id=186310

Rubberstamped by Filip Pizlo.

I moved the execution rules into WSL_type.ott, that was renamed WSL.ott.
I also changed the execution judgements:
- they now emit memory events instead of having an explicit store (so they can be connected later to a memory model)
- the environment is now unchangeable (except inside blocks, which are the only place that variable declarations can appear)
- various rules were simplified.

* WebGPUShadingLanguageRI/SpecWork/WSL.ott: Copied from Tools/WebGPUShadingLanguageRI/SpecWork/WSL_type.ott.
* WebGPUShadingLanguageRI/SpecWork/WSL_exec.ott: Removed.
* WebGPUShadingLanguageRI/SpecWork/WSL_type.ott: Removed.

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

14 months agoUpdate TestExpectations for http/wpt/service-workers/third-party-registration.html.
ryanhaddad@apple.com [Thu, 21 Jun 2018 15:48:42 +0000 (15:48 +0000)]
Update TestExpectations for http/wpt/service-workers/third-party-registration.html.
https://bugs.webkit.org/show_bug.cgi?id=183860

Unreviewed test gardening.

* platform/ios-wk2/TestExpectations: Mark as a flaky timeout.

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

14 months agoUse IsoCellSets to track Executables with clearable code.
mark.lam@apple.com [Thu, 21 Jun 2018 15:09:40 +0000 (15:09 +0000)]
Use IsoCellSets to track Executables with clearable code.
https://bugs.webkit.org/show_bug.cgi?id=186877

Reviewed by Filip Pizlo.

Here’s an example of the results that this fix may yield:
1. The workload: load cnn.com, wait for it to fully load, scroll down and up.
2. Statistics on memory touched and memory freed by VM::deleteAllCode():

   Visiting Executables:
                                                Old             New
   Number of objects visited:                   70897           14264
   Number of objects with deletable code:       14264 (20.1%)   14264 (100%)
   Number of memory pages visited:              3224            1602
   Number of memory pages with deletable code:  1602 (49.7%)    1602 (100%)

   Visitng UnlinkedFunctionExecutables:
                                                Old             New
   Number of objects visited:                   105454          17231
   Number of objects with deletable code:       42319 (20.1%)   17231 (100%) **
   Number of memory pages visited:              4796            1349
   Number of memory pages with deletable code:  4013 (83.7%)    1349 (100%)

** The number of objects differ because the old code only visit unlinked
   executables indirectly via linked executables, whereas the new behavior visit
   all unlinked executables with deletable code directly.  This means:

   a. we used to not visit unlinked executables that have not been linked yet
      i.e. deleteAllCode() may not delete all code (especially code that is not
      used).
   b. we had to visit all linked executables to check if they of type
      FunctionExecutable, before going on to visit their unlinked executable, and
      this includes the ones that do not have deletable code.  This means that we
      would touch more memory in the process.

   Both of these these issues are now fixed with the new code.

This code was tested with manually inserted instrumentation to track the above
statistics.  It is not feasible to write an automated test for this without
leaving a lot of invasive instrumentation in the code.

* bytecode/UnlinkedFunctionExecutable.cpp:
(JSC::UnlinkedFunctionExecutable::unlinkedCodeBlockFor):
* bytecode/UnlinkedFunctionExecutable.h:
* heap/CodeBlockSetInlines.h:
(JSC::CodeBlockSet::iterateViaSubspaces):
* heap/Heap.cpp:
(JSC::Heap::deleteAllCodeBlocks):
(JSC::Heap::deleteAllUnlinkedCodeBlocks):
(JSC::Heap::deleteUnmarkedCompiledCode):
(JSC::Heap::clearUnmarkedExecutables): Deleted.
(JSC::Heap::addExecutable): Deleted.
* heap/Heap.h:
* runtime/DirectEvalExecutable.h:

* runtime/ExecutableBase.cpp:
(JSC::ExecutableBase::hasClearableCode const):
- this is written based on the implementation of ExecutableBase::clearCode().

* runtime/ExecutableBase.h:
* runtime/FunctionExecutable.h:
* runtime/IndirectEvalExecutable.h:
* runtime/ModuleProgramExecutable.h:
* runtime/ProgramExecutable.h:
* runtime/ScriptExecutable.cpp:
(JSC::ScriptExecutable::clearCode):
(JSC::ScriptExecutable::installCode):
* runtime/ScriptExecutable.h:
(JSC::ScriptExecutable::finishCreation):
* runtime/VM.cpp:
(JSC::VM::VM):
* runtime/VM.h:
(JSC::VM::ScriptExecutableSpaceAndSet::ScriptExecutableSpaceAndSet):
(JSC::VM::ScriptExecutableSpaceAndSet::clearableCodeSetFor):
(JSC::VM::forEachScriptExecutableSpace):
(JSC::VM::UnlinkedFunctionExecutableSpaceAndSet::UnlinkedFunctionExecutableSpaceAndSet):
(JSC::VM::UnlinkedFunctionExecutableSpaceAndSet::clearableCodeSetFor):

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

14 months ago[test262-runner] Improve failures output
commit-queue@webkit.org [Thu, 21 Jun 2018 14:00:51 +0000 (14:00 +0000)]
[test262-runner] Improve failures output
https://bugs.webkit.org/show_bug.cgi?id=186858

Patch by Leo Balter <leonardo.balter@gmail.com> on 2018-06-21
Reviewed by Michael Saboff.

* Scripts/test262/Runner.pm:
(main):
(processResult):

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

14 months ago[Tools] add a --debug option to test262/Runner.pm for buildbots
caitp@igalia.com [Thu, 21 Jun 2018 13:57:50 +0000 (13:57 +0000)]
[Tools] add a --debug option to test262/Runner.pm for buildbots
https://bugs.webkit.org/show_bug.cgi?id=186113

Reviewed by Michael Saboff.

test262-runner runs Debug builds by default, but this allows us to be
explicit about it in buildbots.

* Scripts/test262/Runner.pm:
(processCLI):

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

14 months agoBad optional access in WebCore::ContentSecurityPolicySource::portMatches
mcatanzaro@igalia.com [Thu, 21 Jun 2018 13:37:05 +0000 (13:37 +0000)]
Bad optional access in WebCore::ContentSecurityPolicySource::portMatches
https://bugs.webkit.org/show_bug.cgi?id=186535

Reviewed by Daniel Bates.

Make sure the ports have explicit values before dereferencing them.

This is hard to test. If the layout test script-src-parsing-implicit-and-explicit-port-number
continues to pass for WebKitLegacy, then I have at least probably not broken anything. To
reproduce the crash in a layout test that I can run, I think I would need to implement
internals.registerDefaultPortForProtocol for modern WebKit, which is too much work for this
crash. Otherwise, we'd need to run the test server on port 80, which would be unfriendly.

* page/csp/ContentSecurityPolicySource.cpp:
(WebCore::ContentSecurityPolicySource::portMatches const):

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

14 months ago[GTK] WebDriver: allow applying host-specific TLS certificates for automated sessions
zandobersek@gmail.com [Thu, 21 Jun 2018 11:03:58 +0000 (11:03 +0000)]
[GTK] WebDriver: allow applying host-specific TLS certificates for automated sessions
https://bugs.webkit.org/show_bug.cgi?id=186884

Reviewed by Carlos Garcia Campos.

Source/JavaScriptCore:

Add a tuple array input parameter to the StartAutomationSession DBus
message, representing a list of host-and-certificate pairs that have to
be allowed for a given session. This array is then unpacked and used to
fill out the certificates Vector object in the SessionCapabilities
struct.

* inspector/remote/RemoteInspector.h: Add a GLib-specific Vector of
String pairs representing hosts and the certificate file paths.
* inspector/remote/glib/RemoteInspectorServer.cpp:

Source/WebDriver:

Start handling the 'certificates' capability for the GTK+ port. This is
a list of host-certificate pairs that should be marked as allowed for a
given automation session. This object should be positioned inside the
'webkitgtk:browserOptions' dictionary in the capabilities JSON.

* Capabilities.h:
* glib/SessionHostGlib.cpp:
(WebDriver::SessionHost::startAutomationSession): Include any
host-certificate pairs in the StartAutomationSession DBus message.
* gtk/WebDriverServiceGtk.cpp:
(WebDriver::WebDriverService::platformValidateCapability const):
Properly validate the 'certificates' value, if present.
(WebDriver::WebDriverService::platformParseCapabilities const):
Properly parse the 'certificates' value, if present, and extract the
host-certificate pairs.

Source/WebKit:

* UIProcess/API/glib/WebKitAutomationSession.cpp:
(webkitAutomationSessionCreate): Handle any host-certificate pair that's
been set for this session, creating a GTlsCertificate object through
loading from the specified certificate path and marking that certificate
as allowed for the specified host through the
webkit_web_context_allow_tls_certificate_for_host() API.

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

14 months agoRegression(r226990) : Crash under WebCore::Page::applicationWillResignActive
cdumez@apple.com [Thu, 21 Jun 2018 11:01:08 +0000 (11:01 +0000)]
Regression(r226990) : Crash under WebCore::Page::applicationWillResignActive
https://bugs.webkit.org/show_bug.cgi?id=186850
<rdar://problem/37394469>

Reviewed by Eric Carlson.

Make sure m_page is not null before calling applicationWillResignActive(). m_page
gets nulled out when WebPage::close() is called. The crash trace seems to indicate
we're calling applicationWillResignActive() on a Page that is dead since we crash
accessing Page::mainFrame().

* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::applicationWillResignActive):

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

14 months ago[GStreamer] ASSERTION FAILED: end.isValid() in PlatformTimeRanges::add
Hironori.Fujii@sony.com [Thu, 21 Jun 2018 10:14:55 +0000 (10:14 +0000)]
[GStreamer] ASSERTION FAILED: end.isValid() in PlatformTimeRanges::add
https://bugs.webkit.org/show_bug.cgi?id=186880

Reviewed by Xabier Rodriguez-Calvar.

Source/WebCore:

Bug 180253 has added assertions the arugments `start` and `end` is
valid MediaTime in PlatformTimeRanges::add. Since then, some
LayoutTests fail due to the assertion failure.

The invalid MediaTime is added into the PlatformTimeRanges in
MediaPlayerPrivateGStreamer::buffered. Before adding MediaTime,
original implementation checks MediaTime::operator bool() returns
true. But, this method returns true if the time value is invalid.
Then, PlatformTimeRanges::add is called with an invalid MediaTime.

No new tests (No behavior change).

* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::buffered const): Check
maxTimeLoaded() is valid before adding to `timeRanges`.

LayoutTests:

* platform/gtk/TestExpectations: Removed Crash marks of
compositing/geometry/clipped-video-controller.html,
fast/canvas/webgl/oes-texture-half-float-with-video.html,
fast/canvas/webgl/tex-image-and-sub-image-2d-with-video-rgb565.html,
fast/canvas/webgl/tex-image-and-sub-image-2d-with-video-rgba5551.html,
fast/canvas/webgl/tex-image-and-sub-image-2d-with-video.html,
fast/events/media-focus-in-standalone-media-document.html,
fullscreen/video-controls-timeline.html,
http/tests/appcache/video.html, and compositing/video/poster.html.

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

14 months ago[GTK] http/tests/misc/bubble-drag-events.html crashes
Hironori.Fujii@sony.com [Thu, 21 Jun 2018 09:54:30 +0000 (09:54 +0000)]
[GTK] http/tests/misc/bubble-drag-events.html crashes
https://bugs.webkit.org/show_bug.cgi?id=182352

Reviewed by Carlos Garcia Campos.

Source/WebKit:

PingLoad::didFinish was called twice if it is used with
NetworkDataTaskSoup. PingLoad is not a ref-counted object. It is
destructed when PingLoad::didFinish is called.

PingLoad::didReceiveChallenge calls the ChallengeCompletionHandler
with AuthenticationChallengeDisposition::Cancel to cancel the
challenge and calls PingLoad::didFinish.

NetworkDataTaskSoup::continueAuthenticate calls
didReceiveChallenge with a ChallengeCompletionHandler which calls
didCompleteWithError. PingLoad::didCompleteWithError calls
PingLoad::didFinish.

didCompleteWithError callback should not be called in the
ChallengeCompletionHandler.

* NetworkProcess/soup/NetworkDataTaskSoup.cpp:
(WebKit::NetworkDataTaskSoup::continueAuthenticate): Do not call
didFail() in the ChallengeCompletionHandler. Call
invalidateAndCancel() instead.

LayoutTests:

* platform/gtk/TestExpectations:
Marked http/tests/misc/bubble-drag-events.html as [ Failure ] not
[ Failure Timeout Crash ].
Unmarked http/tests/misc/cached-scripts.html.

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

14 months agoUnreviewed WPE gardening. Handle various timeouts by adjusting or
zandobersek@gmail.com [Thu, 21 Jun 2018 09:27:33 +0000 (09:27 +0000)]
Unreviewed WPE gardening. Handle various timeouts by adjusting or
adding the appropriate test expectations.

* platform/wpe/TestExpectations:

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

14 months agorun-gtk-tests (glib/common.py) cannot determine build directory when webKitBranchBuil...
carlosgc@webkit.org [Thu, 21 Jun 2018 08:54:02 +0000 (08:54 +0000)]
run-gtk-tests (glib/common.py) cannot determine build directory when webKitBranchBuild=true
https://bugs.webkit.org/show_bug.cgi?id=185643

Reviewed by Frédéric Wang.

Check if webKitBranchBuild is true in git config to add the branch name to the build path.

* Scripts/webkitpy/common/checkout/scm/git.py:
(Git.read_git_config): Add output_type parameter.
(Git.read_config): Call read_git_config with cws and executive.
(Git._upstream_branch): Use read_config().
(Git._assert_can_squash): Ditto.
(Git.remote_branch_ref): Ditto.
* Scripts/webkitpy/common/checkout/scm/scm_unittest.py:
(GitSVNTest.test_read_git_config):
* glib/common.py:
(get_build_path):

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

14 months agoFix leaks in WebCore found by clang static analyzer in deep mode
ddkilzer@apple.com [Thu, 21 Jun 2018 03:04:56 +0000 (03:04 +0000)]
Fix leaks in WebCore found by clang static analyzer in deep mode
<https://webkit.org/b/186865>

Reviewed by Joseph Pecoraro.

* platform/mac/WebCoreNSURLExtras.mm:
(WebCore::mapHostNames): Fix leak of an empty NSMutableArray
during an early return.  RetainPtr<> is not used here since
a pointer to the NSMutableArray * is passed around.
* platform/mediastream/mac/ScreenDisplayCaptureSourceMac.mm:
(WebCore::ScreenDisplayCaptureSourceMac::createDisplayStream):
Fix leak of a CGDisplayModeRef during an early return.

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

14 months agorebaseline failing High Sierra WebCryptoAPI tests (added extra new line).
david_fenton@apple.com [Thu, 21 Jun 2018 01:28:19 +0000 (01:28 +0000)]
rebaseline failing High Sierra WebCryptoAPI tests (added extra new line).
https://bugs.webkit.org/show_bug.cgi?id=186863

Unreviewed test gardening.

* platform/mac/imported/w3c/web-platform-tests/WebCryptoAPI/generateKey/successes_RSA-PSS.https.any-expected.txt:
* platform/mac/imported/w3c/web-platform-tests/WebCryptoAPI/generateKey/successes_RSA-PSS.https.any.worker-expected.txt:

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

14 months agoWeb Inspector: All non-Same-Site cookies are marked as Same-Site Strict in Storage tab
dbates@webkit.org [Thu, 21 Jun 2018 00:08:53 +0000 (00:08 +0000)]
Web Inspector: All non-Same-Site cookies are marked as Same-Site Strict in Storage tab
https://bugs.webkit.org/show_bug.cgi?id=186867
<rdar://problem/41175424>

Reviewed by Matt Baker.

Fixes an issue where cookies that do not have a Same-Site policy would be marked up as Same-
Site Strict in Web Inspector's cookie storage content view (under the storage tab).

* UserInterface/Views/CookieStorageContentView.js:
(WI.CookieStorageContentView.prototype._rebuildTable): Only compute the display name if
we cookie.sameSite is non-null and is not WI.Cookie.SameSiteType.None. Moreover, remove
an extraneous call to WI.Cookie.parseSameSiteAttributeValue() as cookie.SameSite represents
the already parsed value (one of the WI.Cookie.SameSiteType-scoped values).

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

14 months agoLayout Test imported/mozilla/css-animations/test_pseudoElement-get-animations.html...
pvollan@apple.com [Thu, 21 Jun 2018 00:06:47 +0000 (00:06 +0000)]
Layout Test imported/mozilla/css-animations/test_pseudoElement-get-animations.html is failing.
https://bugs.webkit.org/show_bug.cgi?id=186868

Unreviewed test gardening.

* platform/win/TestExpectations:

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

14 months ago[WebKit on watchOS] Fixed position elements sometimes flicker when scrolling
wenson_hsieh@apple.com [Wed, 20 Jun 2018 23:57:21 +0000 (23:57 +0000)]
[WebKit on watchOS] Fixed position elements sometimes flicker when scrolling
https://bugs.webkit.org/show_bug.cgi?id=186860
<rdar://problem/39953563>

Reviewed by Tim Horton.

Source/WebKit:

Remove conditional guards that are no longer necessary, now that the oldest iOS version our builders support is
iOS 11. Conditionalizing this logic only for iOS 11+ meant that on watchOS, we're always falling down the path
where we don't schedule a visible content rect update until the next runloop, which makes it possible for a
remote layer tree transaction to arrive and cause us to update the scrolling tree with stale viewport geometry.

Test: WKScrollViewTests.PositionFixedLayerAfterScrolling

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

Tools:

Add a new API test to exercise a race condition between receiving remote layer tree commits and updating visible
content rects which would result in the compositing layer for a fixed position element sometimes appearing in
the wrong place. See WebKit ChangeLog for more details.

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKitCocoa/fixed-nav-bar.html: Added.
* TestWebKitAPI/Tests/ios/WKScrollViewTests.mm: Added.
(traverseLayerTree):
(TEST):

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

14 months agoAttributeError: StatusServer instance has no attribute '_api_key' thrown when process...
dbates@webkit.org [Wed, 20 Jun 2018 23:04:34 +0000 (23:04 +0000)]
AttributeError: StatusServer instance has no attribute '_api_key' thrown when processing a patch
https://bugs.webkit.org/show_bug.cgi?id=186852

Fixes an issue where StatusServer._api_key may not be defined. This issue manifests itself
in a Python AttributeError exception when an EWS bot tries to fetch the next patch to process.

Currently StatusServer._api_key is only defined when either the environment variable WEBKIT_STATUS_API_KEY
or the Git configuration key webkit.status_api_key has a non-empty value. Instead we should
always define StatusServer._api_key in the StatusServer constructor.

* Scripts/webkitpy/common/net/statusserver.py:
(StatusServer.__init__):

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

14 months agorebaseline WebCryptoAPI tests for High Sierra.
david_fenton@apple.com [Wed, 20 Jun 2018 22:04:06 +0000 (22:04 +0000)]
rebaseline WebCryptoAPI tests for High Sierra.
https://bugs.webkit.org/show_bug.cgi?id=186863

Unreviewed test gardening.

* platform/mac-sierra/imported/w3c/web-platform-tests/WebCryptoAPI/generateKey/successes_RSA-PSS.https.any-expected.txt: Added.
* platform/mac-sierra/imported/w3c/web-platform-tests/WebCryptoAPI/generateKey/successes_RSA-PSS.https.any.worker-expected.txt: Added.
* platform/mac/imported/w3c/web-platform-tests/WebCryptoAPI/generateKey/successes_RSA-PSS.https.any-expected.txt: Added.
* platform/mac/imported/w3c/web-platform-tests/WebCryptoAPI/generateKey/successes_RSA-PSS.https.any.worker-expected.txt: Added.

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

14 months agoUnreviewed, fix the watchOS build after r233016.
wenson_hsieh@apple.com [Wed, 20 Jun 2018 21:26:43 +0000 (21:26 +0000)]
Unreviewed, fix the watchOS build after r233016.

* page/EventHandler.cpp:
(WebCore::EventHandler::selectionExtentRespectingEditingBoundary):

Move this helper out of the ENABLE(DRAG_SUPPORT) guard.

* page/EventHandler.h:

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

14 months ago[WPE] Some fixups on webkit.org page
rego@igalia.com [Wed, 20 Jun 2018 20:24:56 +0000 (20:24 +0000)]
[WPE] Some fixups on webkit.org page
https://bugs.webkit.org/show_bug.cgi?id=186844

Unreviewed as the content is not modified, only some minor fixups on the format.

* wpe.md: Remove title as it's already provided by the website CMS.
Avoid breaking lines at 80 chars as it's not rendered as expected.

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

14 months agoAnimationList wastes 60KB of vector capacity
simon.fraser@apple.com [Wed, 20 Jun 2018 20:23:16 +0000 (20:23 +0000)]
AnimationList wastes 60KB of vector capacity
https://bugs.webkit.org/show_bug.cgi?id=186701

Reviewed by Chris Dumez.

AnimationList was the second most wasteful call site for Vector capacity on theverge.com,
wasting almost 60KB. Lists had between 1 and 3 entries, so give AnimationList's vector of
Animations a min capacity of zero so it doesn't grow in increments of 16.

Also shrink Animation from 88 bytes to 72 bytes by optimizing packing.

* platform/animation/Animation.cpp:
(WebCore::Animation::Animation):
(WebCore::Animation::operator=):
(WebCore::Animation::animationsMatch const):
* platform/animation/Animation.h:
(WebCore::Animation::animationMode const):
(WebCore::Animation::setAnimationMode):
* platform/animation/AnimationList.h:

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

14 months agoContentSecurityPolicySourceList wastes 51KB of Vector capacity on cnn.com
simon.fraser@apple.com [Wed, 20 Jun 2018 19:39:00 +0000 (19:39 +0000)]
ContentSecurityPolicySourceList wastes 51KB of Vector capacity on cnn.com
https://bugs.webkit.org/show_bug.cgi?id=186706

Reviewed by Chris Dumez.

Make ContentSecurityPolicySourceList::parse() call shrinkToFit() on m_list
after parsing to eliminate wasted vector capacity.

Shrink ContentSecurityPolicySource down to 40 bytes by optimizing packing.

* page/csp/ContentSecurityPolicySource.cpp:
(WebCore::ContentSecurityPolicySource::ContentSecurityPolicySource):
* page/csp/ContentSecurityPolicySource.h:
* page/csp/ContentSecurityPolicySourceList.cpp:
(WebCore::ContentSecurityPolicySourceList::matches const):
(WebCore::ContentSecurityPolicySourceList::parse):
(WebCore::ContentSecurityPolicySourceList::matches): Deleted.
* page/csp/ContentSecurityPolicySourceList.h:

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

14 months agoExpand concurrent GC assertion to accept JSValue() or 0
keith_miller@apple.com [Wed, 20 Jun 2018 18:19:46 +0000 (18:19 +0000)]
Expand concurrent GC assertion to accept JSValue() or 0
https://bugs.webkit.org/show_bug.cgi?id=186855

Reviewed by Mark Lam.

We tend to set unused property slots to either JSValue() or 0
depending on the context. On 64-bit these are the same but on
32-bit JSValue() has a NaN tag. This patch makes it so we
the accept either JSValue() or 0.

* runtime/JSObjectInlines.h:
(JSC::JSObject::prepareToPutDirectWithoutTransition):

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

14 months agoUnreviewed GTK+ test gardening.
aboya@igalia.com [Wed, 20 Jun 2018 17:30:42 +0000 (17:30 +0000)]
Unreviewed GTK+ test gardening.
https://bugs.webkit.org/show_bug.cgi?id=186854

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

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

14 months agoRestrict Selection in contenteditable the extent of that contenteditable
megan_gardner@apple.com [Wed, 20 Jun 2018 17:22:57 +0000 (17:22 +0000)]
Restrict Selection in contenteditable the extent of that contenteditable
https://bugs.webkit.org/show_bug.cgi?id=186792

Reviewed by Wenson Hsieh.

Source/WebCore:

My system currently will not allow me to run tests. I will add one when I can update.

Expose the already existing funcitonality to restrict a selection to a single contentenditable

* page/EventHandler.cpp:
(WebCore::EventHandler::selectionExtentRespectingEditingBoundary):
(WebCore::selectionExtentRespectingEditingBoundary): Deleted.
* page/EventHandler.h:
* rendering/HitTestResult.h:

Source/WebKit:

We have not been checking to make sure that when we make a selection that it is restricted to
a single content editable on iOS. There is functionality to ensure this on mac, so it has been
exposed and utilized for restricting the extent of a selection.

* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::updateSelectionWithTouches):

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

14 months ago[Armv7] Linkbuffer: executableOffsetFor() fails for location 2
guijemont@igalia.com [Wed, 20 Jun 2018 17:16:21 +0000 (17:16 +0000)]
[Armv7] Linkbuffer: executableOffsetFor() fails for location 2
https://bugs.webkit.org/show_bug.cgi?id=186765

Reviewed by Michael Saboff.

This widens the check for 0 so that we handle that case more correctly.

* assembler/LinkBuffer.h:
(JSC::LinkBuffer::executableOffsetFor):

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

14 months agoCSSFontFace wastes 59KB of Vector capacity on nytimes.com
simon.fraser@apple.com [Wed, 20 Jun 2018 17:13:57 +0000 (17:13 +0000)]
CSSFontFace wastes 59KB of Vector capacity on nytimes.com
https://bugs.webkit.org/show_bug.cgi?id=186708

Reviewed by Anders Carlsson.

Most CSSFontFace have one or two CSSFontFaceSource so don't allocate
vector capacity in the default 16-size chunks.

* css/CSSFontFace.h:

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

14 months ago[WSL] Add details to the sphinx outline
rmorisset@apple.com [Wed, 20 Jun 2018 17:07:43 +0000 (17:07 +0000)]
[WSL] Add details to the sphinx outline
https://bugs.webkit.org/show_bug.cgi?id=186310

Rubberstamped by Filip Pizlo.

Mostly improving the sphinx outline.
Also started moving the execution rules to WSL_type.ott (which will eventually become WSL.ott).
Tried formalizing the gathering of declarations into the environment, but I think I will scratch it.
It is both trivial to do (and to explain in english) and a bit of a pain to formalize.

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

14 months ago[WPE] Add page for webkit.org
rego@igalia.com [Wed, 20 Jun 2018 15:51:51 +0000 (15:51 +0000)]
[WPE] Add page for webkit.org
https://bugs.webkit.org/show_bug.cgi?id=186844

Reviewed by Michael Catanzaro.

* wpe.md: Added.

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

14 months agoUnreviewed, rolling out r232844.
commit-queue@webkit.org [Wed, 20 Jun 2018 13:53:41 +0000 (13:53 +0000)]
Unreviewed, rolling out r232844.
https://bugs.webkit.org/show_bug.cgi?id=186843

"Too many flakiness on the tests, so the EWS bots cant process
patches correctly" (Requested by clopez on #webkit).

Reverted changeset:

"[GTK] Enable tests on the GTK EWS queue"
https://bugs.webkit.org/show_bug.cgi?id=186559
https://trac.webkit.org/changeset/232844

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

14 months ago[Web Animations] Make imported/mozilla/css-transitions/test_element-get-animations...
graouts@webkit.org [Wed, 20 Jun 2018 11:48:39 +0000 (11:48 +0000)]
[Web Animations] Make imported/mozilla/css-transitions/test_element-get-animations.html pass reliably
https://bugs.webkit.org/show_bug.cgi?id=183841
<rdar://problem/40998101>

Reviewed by Dean Jackson.

LayoutTests/imported/mozilla:

Mark progressions in the Mozilla CSS Transitions and CSS Animations tests.

* css-animations/test_element-get-animations-expected.txt:
* css-transitions/test_element-get-animations-expected.txt:

Source/WebCore:

We must ignore CSS Animations with "animation-name: none".

* animation/AnimationTimeline.cpp:
(WebCore::AnimationTimeline::updateCSSAnimationsForElement):

LayoutTests:

This test now passes reliably.

* TestExpectations:

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

14 months ago[GTK][ThreadedRendering][Nicosia] Themed elements cannot be rendered using threaded...
magomez@igalia.com [Wed, 20 Jun 2018 11:05:57 +0000 (11:05 +0000)]
[GTK][ThreadedRendering][Nicosia] Themed elements cannot be rendered using threaded rendering
https://bugs.webkit.org/show_bug.cgi?id=186840

Reviewed by Carlos Garcia Campos.

Disable threaded rendering for GTK port.

* platform/graphics/nicosia/NicosiaPaintingEngine.cpp:
(Nicosia::PaintingEngine::create):

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

14 months ago[GTK] ASSERTION FAILED: url == m_string in UserAgentQuirks test
commit-queue@webkit.org [Wed, 20 Jun 2018 10:56:49 +0000 (10:56 +0000)]
[GTK] ASSERTION FAILED: url == m_string in UserAgentQuirks test
https://bugs.webkit.org/show_bug.cgi?id=186838

This URL constructor expects canonicalized input, so fix the passed URL.

Patch by Rob Buis <rbuis@igalia.com> on 2018-06-20
Reviewed by Frédéric Wang.

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

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

14 months ago[WSL] Make the typing rules explicit about resolving type syntax
rmorisset@apple.com [Wed, 20 Jun 2018 10:55:53 +0000 (10:55 +0000)]
[WSL] Make the typing rules explicit about resolving type syntax

Rubberstamped by Filip Pizlo.

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

14 months ago[GTK][WPE][Nicosia] Add name for Nicosia Painting Threads
utatane.tea@gmail.com [Wed, 20 Jun 2018 09:00:27 +0000 (09:00 +0000)]
[GTK][WPE][Nicosia] Add name for Nicosia Painting Threads
https://bugs.webkit.org/show_bug.cgi?id=186836

Reviewed by Carlos Garcia Campos.

Source/WebCore:

Use "PaintingThread" name.

* platform/graphics/nicosia/NicosiaPaintingEngineThreaded.cpp:
(Nicosia::PaintingEngineThreaded::PaintingEngineThreaded):

Source/WTF:

AutomaticThread can take a name for the generated threads now.
This patch adds the above ability to WorkerPool.

* wtf/WorkerPool.cpp:
(WTF::WorkerPool::WorkerPool):
* wtf/WorkerPool.h:
(WTF::WorkerPool::create):
(WTF::WorkerPool::name const):

Tools:

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

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

14 months ago[WPE] Remove warnings by setting nullptr for unused listeners
utatane.tea@gmail.com [Wed, 20 Jun 2018 08:23:45 +0000 (08:23 +0000)]
[WPE] Remove warnings by setting nullptr for unused listeners
https://bugs.webkit.org/show_bug.cgi?id=186835

Reviewed by Carlos Garcia Campos.

frame, axis_source, axis_stop, and axis_discrete are unused.
Setting nullptr explicitly to remove warnings in GCC.

* wpe/backends/WindowViewBackend.cpp:

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

14 months ago[Web Animations] Make imported/mozilla/css-animations/test_pseudoElement-get-animatio...
graouts@webkit.org [Wed, 20 Jun 2018 07:07:34 +0000 (07:07 +0000)]
[Web Animations] Make imported/mozilla/css-animations/test_pseudoElement-get-animations.html pass reliably
https://bugs.webkit.org/show_bug.cgi?id=183818
<rdar://problem/40997015>

Reviewed by Dean Jackson.

LayoutTests/imported/mozilla:

Mark progressions in the Mozilla CSS Transitions and CSS Animations tests.

* css-animations/test_pseudoElement-get-animations-expected.txt:
* css-transitions/test_element-get-animations-expected.txt:

Source/WebCore:

We add a new opt-in flag to return sorted animations when calling AnimationTimeline::animationsForElement() so that
Element::getAnimations() can opt into returning animations sorted by the rules defined by the CSS Transitions spec.
The rule is that CSS Transitions must be sorted prior to CSS Animations and regular Web Animations, and then sorted
by the time they were generated and, if generated at the same time, sorted alphabetically based on the transitioned
property. To be able to accomodate this, we add a new generationTime() method to CSSTransition.

* animation/AnimationTimeline.cpp:
(WebCore::AnimationTimeline::animationsForElement const):
(WebCore::AnimationTimeline::updateCSSTransitionsForElement):
* animation/AnimationTimeline.h:
* animation/CSSTransition.cpp:
(WebCore::CSSTransition::create):
(WebCore::CSSTransition::CSSTransition):
* animation/CSSTransition.h:
* dom/Element.cpp:
(WebCore::Element::getAnimations):

LayoutTests:

This test now passes reliably.

* TestExpectations:

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

14 months agoFix broken assertion on 32-bit
keith_miller@apple.com [Wed, 20 Jun 2018 06:37:50 +0000 (06:37 +0000)]
Fix broken assertion on 32-bit
https://bugs.webkit.org/show_bug.cgi?id=186830

Reviewed by Mark Lam.

The assertion was intended to catch concurrent GC issues. We don't
run them on 32-bit so we don't need this assertion there. The
assertion was broken because zero is not JSValue() on 32-bit.

* runtime/JSObjectInlines.h:
(JSC::JSObject::prepareToPutDirectWithoutTransition):

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

14 months ago[Curl] Allow passing contents of Root CA data directly.
Basuke.Suzuki@sony.com [Wed, 20 Jun 2018 02:58:26 +0000 (02:58 +0000)]
[Curl] Allow passing contents of Root CA data directly.
https://bugs.webkit.org/show_bug.cgi?id=185782

Currently the data must be in a file and set by its path. This patch
allow application to set root CA data by passing binary data directly.

Reviewed by Yusuke Suzuki.

No new tests. Tested internally.

* platform/network/curl/CurlRequest.cpp:
(WebCore::CurlRequest::setupTransfer):
* platform/network/curl/CurlSSLHandle.cpp:
(WebCore::CurlSSLHandle::CurlSSLHandle):
(WebCore::CurlSSLHandle::getCACertPathEnv):
(WebCore::CurlSSLHandle::setCACertPath):
(WebCore::CurlSSLHandle::setCACertData):
(WebCore::CurlSSLHandle::clearCACertInfo):
* platform/network/curl/CurlSSLHandle.h:
(WebCore::CurlSSLHandle::getCipherList const):
(WebCore::CurlSSLHandle::getSignatureAlgorithmsList const):
(WebCore::CurlSSLHandle::getCurvesList const):
(WebCore::CurlSSLHandle::setCipherList):
(WebCore::CurlSSLHandle::setSignatureAlgorithmsList):
(WebCore::CurlSSLHandle::setCurvesList):
(WebCore::CurlSSLHandle::setIgnoreSSLErrors):
(WebCore::CurlSSLHandle::getCACertInfo const):
(WebCore::CurlSSLHandle::getCACertPath const): Deleted.
(WebCore::CurlSSLHandle::setCACertPath): Deleted.
* platform/network/curl/CurlSSLVerifier.cpp:
(WebCore::CurlSSLVerifier::CurlSSLVerifier):

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

14 months agoflattenDictionaryStructure needs to zero properties that have been compressed away
keith_miller@apple.com [Wed, 20 Jun 2018 01:28:03 +0000 (01:28 +0000)]
flattenDictionaryStructure needs to zero properties that have been compressed away
https://bugs.webkit.org/show_bug.cgi?id=186828

Reviewed by Mark Lam.

This patch fixes a bunch of crashing Mozilla tests on the bots.

* runtime/Structure.cpp:
(JSC::Structure::flattenDictionaryStructure):

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

14 months agoDirectArguments::create needs to initialize to undefined instead of the empty value
sbarati@apple.com [Wed, 20 Jun 2018 01:11:45 +0000 (01:11 +0000)]
DirectArguments::create needs to initialize to undefined instead of the empty value
https://bugs.webkit.org/show_bug.cgi?id=186818
<rdar://problem/38415177>

Reviewed by Filip Pizlo.

JSTests:

* stress/create-direct-arguments-in-osr-should-initialize-to-undefined.js: Added.
(foo):
(bar):

Source/JavaScriptCore:

The bug here is that we will emit code that just loads from DirectArguments as
long as the index is within the known capacity of the arguments object (op_get_from_arguments).
The arguments object has at least enough capacity to hold the declared parameters.
When we materialized this object in OSR exit, we initialized up to to the capacity
with JSValue(). In OSR exit, though, we only filled up to the length of the
object with actual values. So we'd end up with a DirectArguments object with
capacity minus length slots of JSValue(). To fix this, we need initialize up to
capacity with jsUndefined during construction. The invariant of this object is
that the capacity minus length slots at the end are filled in with jsUndefined.

* runtime/DirectArguments.cpp:
(JSC::DirectArguments::create):

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

14 months agoARKit badge drop shadow updates its blur radius based on page zoom
dino@apple.com [Wed, 20 Jun 2018 01:01:48 +0000 (01:01 +0000)]
ARKit badge drop shadow updates its blur radius based on page zoom
https://bugs.webkit.org/show_bug.cgi?id=186829
<rdar://problem/40738779>

Reviewed by Tim Horton.

We need to make sure the shadow blur radius takes into account the
current zoom. Thankfully, the GraphicsContext platform code already
does this, so just use it.

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

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

14 months agoCrash in sanitizeStackForVMImpl sometimes when switching threads with same VM
msaboff@apple.com [Wed, 20 Jun 2018 00:45:06 +0000 (00:45 +0000)]
Crash in sanitizeStackForVMImpl sometimes when switching threads with same VM
https://bugs.webkit.org/show_bug.cgi?id=186827

Reviewed by Saam Barati.

Need to set VM::lastStackTop before any possible calls to sanitizeStack().

* runtime/JSLock.cpp:
(JSC::JSLock::didAcquireLock):

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

14 months agoBlank viewer comes up and then auto-dismisses when device is not connected to Internet
dino@apple.com [Wed, 20 Jun 2018 00:26:17 +0000 (00:26 +0000)]
Blank viewer comes up and then auto-dismisses when device is not connected to Internet
https://bugs.webkit.org/show_bug.cgi?id=186825
<rdar://problem/40294170>

Reviewed by Tim Horton.

Source/WebCore:

Export isSuccessful() to WebKit.

* platform/network/ResourceResponseBase.h:

Source/WebKit:

Handle the case where the network load fails, and send that
error onto QuickLook.

* UIProcess/Cocoa/DownloadClient.mm:
(WebKit::DownloadClient::didReceiveResponse): Check for success.
(WebKit::DownloadClient::processDidCrash): Cancel in the case of a crash.
(WebKit::DownloadClient::didFail): Propagate the error onto QuickLook.
* UIProcess/Cocoa/SystemPreviewControllerCocoa.mm:
(-[_WKPreviewControllerDataSource failWithError:]): New method that calls
the completion handler with the error data.
(WebKit::SystemPreviewController::fail): New API method.
* UIProcess/SystemPreviewController.h:

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

14 months ago[test262-runner] Reduce flakiness of unit tests for the runner
commit-queue@webkit.org [Wed, 20 Jun 2018 00:09:27 +0000 (00:09 +0000)]
[test262-runner] Reduce flakiness of unit tests for the runner
https://bugs.webkit.org/show_bug.cgi?id=186824

Patch by Leo Balter <leonardo.balter@gmail.com> on 2018-06-19
Reviewed by Michael Saboff.

* Scripts/test262/Runner.pm:
(main):
* Scripts/webkitperl/test262_unittest/test262-runner-tests.pl:

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

14 months agoImplement IPC throttling to keep the main thread responsive when a process misbehaves
cdumez@apple.com [Wed, 20 Jun 2018 00:04:32 +0000 (00:04 +0000)]
Implement IPC throttling to keep the main thread responsive when a process misbehaves
https://bugs.webkit.org/show_bug.cgi?id=186607
<rdar://problem/41073205>

Reviewed by Geoffrey Garen.

Implement IPC throttling to keep the main thread responsive when a process misbehaves.
Instead of doing one main runloop dispatch per incoming message, we now do a single
runloop dispatch and process incoming messages in batch. We put a limit on the number
of messages to be processed in a batch (600). If the queue is larger that this limit,
we'll schedule a 0-timer to process remaining messages, giving the main runloop a chance
to process other events. Additionally, if an IPC connection keeps hitting this maximum
batch size limit, we implement back off and we'll further decrease the number of messages
we process in each batch (going as low as 60). This keeps Safari responsive enough to
allow the user to close the bad tab (even on older devices such as iPhone 5s).

Finally, if the incoming message queue becomes too large (50000), we go one step further
and kill the IPC connection in order to maintain performance / battery life.

Every time we apply throttling or terminate a connection due to throttling, we do a
RELEASE_LOG_ERROR() with useful information in order to help diagnose potential issues
in the future.

* Platform/IPC/Connection.cpp:
(IPC::Connection::Connection):
(IPC::Connection::enqueueIncomingMessage):
(IPC::Connection::MessagesThrottler::MessagesThrottler):
(IPC::Connection::MessagesThrottler::scheduleMessagesDispatch):
(IPC::Connection::MessagesThrottler::numberOfMessagesToProcess):
(IPC::Connection::dispatchIncomingMessages):
* Platform/IPC/Connection.h:
* Platform/IPC/mac/ConnectionMac.mm:
(IPC::Connection::kill):

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

14 months ago[test262-runner] Print results report to HTML
commit-queue@webkit.org [Tue, 19 Jun 2018 23:58:54 +0000 (23:58 +0000)]
[test262-runner] Print results report to HTML
https://bugs.webkit.org/show_bug.cgi?id=186790

Patch by Leo Balter <leonardo.balter@gmail.com> on 2018-06-19
Reviewed by Michael Saboff.

After runing the tests, 2 html files are created with a list to failing tests and summaries.
* Scripts/test262/Runner.pm:
(main):
(summarizeResults):
(printHTML):

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

14 months agoLayout Test imported/mozilla/css-animations/test_animation-playstate.html is failing.
pvollan@apple.com [Tue, 19 Jun 2018 23:28:15 +0000 (23:28 +0000)]
Layout Test imported/mozilla/css-animations/test_animation-playstate.html is failing.
https://bugs.webkit.org/show_bug.cgi?id=186807

Unreviewed test gardening.

* platform/win/TestExpectations:

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

14 months ago[Curl] Enable Proxy Authentication.
Basuke.Suzuki@sony.com [Tue, 19 Jun 2018 23:26:58 +0000 (23:26 +0000)]
[Curl] Enable Proxy Authentication.
https://bugs.webkit.org/show_bug.cgi?id=185266

Add support for Proxy Authentication to curl network layer.

Reviewed by Alex Christensen.

No new tests in public. Tested internally.

* platform/network/curl/AuthenticationChallenge.h:
* platform/network/curl/AuthenticationChallengeCurl.cpp:
(WebCore::AuthenticationChallenge::protectionSpaceServerTypeFromURI):
(WebCore::AuthenticationChallenge::protectionSpaceFromHandle):
(WebCore::AuthenticationChallenge::determineProxyPort):
(WebCore::AuthenticationChallenge::authenticationSchemeFromCurlAuth):
(WebCore::AuthenticationChallenge::parseRealm):
* platform/network/curl/CurlContext.cpp:
(WebCore::CurlHandle::enableProxyIfExists):
(WebCore::CurlHandle::getProxyUrl):
(WebCore::CurlHandle::getProxyAuthAvail):
(WebCore::CurlHandle::getPrimaryPort): Deleted.
* platform/network/curl/CurlContext.h:
(WebCore::CurlContext::setDefaultProxyAuthMethod):
(WebCore::CurlContext::setProxyAuthMethod):
* platform/network/curl/CurlProxySettings.cpp:
(WebCore::determineAuthMethod):
(WebCore::CurlProxySettings::setAuthMethod):
(WebCore::protocolIsInSocksFamily):
* platform/network/curl/CurlProxySettings.h:
(WebCore::CurlProxySettings::setDefaultAuthMethod):
(WebCore::CurlProxySettings::authMethod const):
* platform/network/curl/CurlRequest.cpp:
(WebCore::CurlRequest::didReceiveHeader):
* platform/network/curl/CurlResponse.h:
(WebCore::CurlResponse::isolatedCopy const):
* platform/network/curl/ResourceResponse.h:
* platform/network/curl/ResourceResponseCurl.cpp:
(WebCore::ResourceResponse::isProxyAuthenticationRequired const):

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

14 months agoUnpainted area while scrolling in Reader is white
timothy_horton@apple.com [Tue, 19 Jun 2018 23:06:09 +0000 (23:06 +0000)]
Unpainted area while scrolling in Reader is white
https://bugs.webkit.org/show_bug.cgi?id=186541
<rdar://problem/40471363>

Reviewed by Timothy Hatcher.

Source/WebCore:

New test: tiled-drawing/simple-document-with-dynamic-background-color.html

For platforms that do not use the overhang layer, we depend on
RenderView's background color to fill unpainted space.

RenderView's background color is only updated inside updateRootLayerConfiguration,
and it is possible with a simple enough page to change the document's
background color without running that code.

* page/FrameView.cpp:
(WebCore::FrameView::setTransparent):
(WebCore::FrameView::setBaseBackgroundColor):
Make use of the newly added rootBackgroundColorOrTransparencyChanged.

(WebCore::FrameView::calculateExtendedBackgroundMode const):
Update a comment, since the function it mentioned is no longer.

(WebCore::FrameView::updateTilesForExtendedBackgroundMode):
Remove this code that clears the root extended background color
if using tiles to extend in both directions. Two reasons:
1) it seems harmless to also have a root extended background color
2) this just gets clobbered by the call in RenderView::paintBoxDecorations

* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::updateCompositingLayers):
Add a bit that will do a updateConfiguration() on the root layer if no
other work needs to be done, so that we can update the root layer's
transparency or background color without doing a full layer rebuild.

(WebCore::RenderLayerCompositor::rootOrBodyStyleChanged):
Make use of the newly added rootBackgroundColorOrTransparencyChanged.

(WebCore::RenderLayerCompositor::rootBackgroundColorOrTransparencyChanged):
Change rootBackgroundTransparencyChanged to also cover color changes.
Fold setRootExtendedBackgroundColor in here, and make use of
setRootLayerConfigurationNeedsUpdate() instead of doing a full rebuild.
Previously, we would bail if the transparency state hadn't changed;
now, we'll also update the root layer's background color and the
exposed-to-WebKit extended background color if they change too.

(WebCore::RenderLayerCompositor::rootBackgroundTransparencyChanged): Deleted.
(WebCore::RenderLayerCompositor::setRootExtendedBackgroundColor): Deleted.

* rendering/RenderLayerCompositor.h:
Add setRootLayerConfigurationNeedsUpdate, remove setRootExtendedBackgroundColor,
and add both a bit indicating that the root layer configuration needs updating
and the cached view background color to make the early return in
rootBackgroundColorOrTransparencyChanged possible.

* rendering/RenderView.cpp:
(WebCore::RenderView::paintBoxDecorations):
Make use of the newly added rootBackgroundColorOrTransparencyChanged.

LayoutTests:

* tiled-drawing/background-transparency-toggle-expected.txt:
This is a progression; the extended background color now matches the color
of the page at this point (#CCCCCC is the specified body background, black
with 0.2 alpha, blended with the root's white background).

* tiled-drawing/simple-document-with-dynamic-background-color-expected.txt: Added.
* tiled-drawing/simple-document-with-dynamic-background-color.html: Added.
Added a test that ensures that dynamically changing the background color
actually applies to the RenderView background. Previously, the second layer
tree dump would have a black background where it should be red.

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

14 months agoMake SecItemShim to not send return value for SecItemAdd
jiewen_tan@apple.com [Tue, 19 Jun 2018 22:22:14 +0000 (22:22 +0000)]
Make SecItemShim to not send return value for SecItemAdd
https://bugs.webkit.org/show_bug.cgi?id=186789
<rdar://problem/40892596>

Reviewed by Brent Fulgham.

Return value of SecItemAdd is often ignored. Even if it isn't, we don't have the ability to serialize SecKeychainItemRef.
Otherwise, it would go through the weird route of serializing SecKeychainItemRef by asking Keychain for its persistent
reference. This route contradicts the purpose of SecItemShim, which is to proxy all Keychain operations to UIProcess.

Also, this patch removes the release assertion on encode(Encoder&, SecAccessControlRef) and decode(Decoder&, RetainPtr<SecAccessControlRef>&)
as they don't query Keychain.

* Shared/cf/ArgumentCodersCF.cpp:
(IPC::encode):
(IPC::decode):
* Shared/mac/SecItemShim.cpp:
(WebKit::sendSecItemRequest):
(WebKit::webSecItemAdd):
* UIProcess/mac/SecItemShimProxy.cpp:
(WebKit::SecItemShimProxy::secItemRequest):
* UIProcess/mac/SecItemShimProxy.h:
* UIProcess/mac/SecItemShimProxy.messages.in:

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

14 months agoREGRESSION (r231850): Cookie file cannot be read or written by network process
sihui_liu@apple.com [Tue, 19 Jun 2018 22:04:54 +0000 (22:04 +0000)]
REGRESSION (r231850): Cookie file cannot be read or written by network process
https://bugs.webkit.org/show_bug.cgi?id=186806
<rdar://problem/41113791>

Reviewed by Geoffrey Garen.

Default websiteDataStore may be added wrongly to network process before default session was
set, as messages were asynchronous, so the cookie storage could be improperly set.

* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::initializeNetworkProcess):
* NetworkProcess/NetworkProcessCreationParameters.cpp:
(WebKit::NetworkProcessCreationParameters::encode const):
(WebKit::NetworkProcessCreationParameters::decode):
* NetworkProcess/NetworkProcessCreationParameters.h:
* NetworkProcess/mac/RemoteNetworkingContext.mm:
(WebKit::RemoteNetworkingContext::ensureWebsiteDataStoreSession):
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::ensureNetworkProcess):

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

14 months agoUse getCurrentProcessID over getpid
don.olmstead@sony.com [Tue, 19 Jun 2018 22:02:34 +0000 (22:02 +0000)]
Use getCurrentProcessID over getpid
https://bugs.webkit.org/show_bug.cgi?id=186813

Reviewed by Alex Christensen.

* Shared/WebMemorySampler.cpp:
(WebKit::WebMemorySampler::initializeTimers):
(WebKit::WebMemorySampler::stop):
(WebKit::WebMemorySampler::writeHeaders):
* WebProcess/Storage/WebSWContextManagerConnection.cpp:
(WebKit::WebSWContextManagerConnection::installServiceWorker):

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

14 months agoCrash running check-webkit-style on webrtc/.../exceptions.py
krollin@apple.com [Tue, 19 Jun 2018 21:59:37 +0000 (21:59 +0000)]
Crash running check-webkit-style on webrtc/.../exceptions.py
https://bugs.webkit.org/show_bug.cgi?id=186816
<rdar://problem/41262553>

Reviewed by Michael Catanzaro.

It's not apparent to me why the crash is occurring. Trying to write a
unittest that checks this file in isolation does not reproduce the
crash. But the crash goes away when updating to pylint-0.25.2.

* Scripts/webkitpy/thirdparty/__init__.py:
(AutoinstallImportHook._install_pylint):

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

14 months agocpp style checker needs to know more about NOLINT
krollin@apple.com [Tue, 19 Jun 2018 21:58:30 +0000 (21:58 +0000)]
cpp style checker needs to know more about NOLINT
https://bugs.webkit.org/show_bug.cgi?id=186796

Reviewed by Aakash Jain.

Running check-webkit-style on
ThirdParty/gtest/src/gtest-internal-inl.h crashes with a KeyError as
it tries to look up information about a particular #include in a
dictionary it maintains. The problem has to do with the following
lines in gtest-internal-inl.h:

#include <gtest/gtest.h>  // NOLINT
#include <gtest/gtest-spi.h>

The NOLINT annotation will prevent the cpp-checker from processing or
even seeing that line. In skipping that line, information regarding
that line is NOT added to some internal tables. However, when the code
that checks that #includes are correctly alphabetized gets to the
"gtest-spi.h" line, it will not respect the NOLINT annotation and will
see the gtest.h line. When doing so, it runs afoul of the fact that it
hadn't seen that line before and it crashes when it tries to look up
that line in some internal records.

Fix this by catering to the possibility that a #include line may not
have been entered into these internal records.

* Scripts/webkitpy/style/checkers/cpp.py:
(check_include_line):
* Scripts/webkitpy/style/checkers/cpp_unittest.py:

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

14 months agoUnreviewed, revert some bad gardening.
mcatanzaro@igalia.com [Tue, 19 Jun 2018 21:49:02 +0000 (21:49 +0000)]
Unreviewed, revert some bad gardening.

I should not have added image results for a reftest.

* platform/gtk/imported/w3c/web-platform-tests/css/WOFF2/directory-knowntags-001-expected.png: Removed.
* platform/gtk/imported/w3c/web-platform-tests/css/WOFF2/tabledata-glyf-origlength-003-expected.png: Removed.

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

14 months agoWKWebsiteDataStoreRemoveAllServiceWorkerRegistrations does not invoke callback when...
don.olmstead@sony.com [Tue, 19 Jun 2018 21:48:44 +0000 (21:48 +0000)]
WKWebsiteDataStoreRemoveAllServiceWorkerRegistrations does not invoke callback when Service Workers disabled
https://bugs.webkit.org/show_bug.cgi?id=186809

Reviewed by Chris Dumez.

* UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
(WKWebsiteDataStoreRemoveAllServiceWorkerRegistrations):

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

14 months agoShadowChicken crashes with stack overflow in the LLInt
commit-queue@webkit.org [Tue, 19 Jun 2018 21:27:05 +0000 (21:27 +0000)]
ShadowChicken crashes with stack overflow in the LLInt
https://bugs.webkit.org/show_bug.cgi?id=186540
<rdar://problem/39682133>

Patch by Tadeu Zagallo <tzagallo@apple.com> on 2018-06-19
Reviewed by Saam Barati.

JSTests:

Add test that stack overflows and crashes on ShadowChicken when JIT is
disabled and forceDebuggerBytecodeGeneration is enabled.

* stress/llint-stack-overflow-debugging-opcodes.js: Added.
(foo):
(catch):

Source/JavaScriptCore:

Stack overflows in the LLInt were crashing in ShadowChicken when compiling
with debug opcodes because it was accessing the scope of the incomplete top
frame, which hadn't been set yet. Check that we have moved past the first
opcode (enter) and that the scope is not undefined (enter will
initialize it to undefined).

* interpreter/ShadowChicken.cpp:
(JSC::ShadowChicken::update):

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

14 months agoEWS for security bugs
dbates@webkit.org [Tue, 19 Jun 2018 21:01:19 +0000 (21:01 +0000)]
EWS for security bugs
https://bugs.webkit.org/show_bug.cgi?id=186291
<rdar://problem/40829658>

Update comment in AbstractEarlyWarningSystem.refetch_patch() to reference <https://bugs.webkit.org/show_bug.cgi?id=186817>.

* Scripts/webkitpy/tool/commands/earlywarningsystem.py:
(AbstractEarlyWarningSystem.refetch_patch):

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

14 months agoNeed to properly handle removal of worker in SWServer::unregisterServiceWorkerClient...
youenn@apple.com [Tue, 19 Jun 2018 20:53:34 +0000 (20:53 +0000)]
Need to properly handle removal of worker in SWServer::unregisterServiceWorkerClient timer lambda
https://bugs.webkit.org/show_bug.cgi?id=186674
<rdar://problem/40974812>

Reviewed by Chris Dumez.

While looping over the running workers map and trying to terminate some of the workers,
there is a chance that the map will be modified synchronously which may affect iterating the map.
This patch removes that potential threat.

* workers/service/server/SWServer.cpp:
(WebCore::SWServer::unregisterServiceWorkerClient):

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

14 months agoEWS for security bugs
dbates@webkit.org [Tue, 19 Jun 2018 20:35:03 +0000 (20:35 +0000)]
EWS for security bugs
https://bugs.webkit.org/show_bug.cgi?id=186291
<rdar://problem/40829658>

Reviewed by Lucas Forschler

Part 2 of 2.

Adds a new Bugzilla extension that will automatically CC the EWS feeder queue
on each bug that has a patch up for review, including security bugs. This allows
the WebKit OpenSource Project to use an unprivileged Bugzilla account for the
EWS feeder queue.

* extensions/EWS/Config.pm: Added.
* extensions/EWS/Extension.pm: Added.
(new): Initialize some bookkeeping variables we use to track whether we have seen
a value change event for the review flag and whether we need to CC the feeder. The latter
we need to track because we can only make changes to the CC list in the callback
bug_start_of_update().
(object_before_set): This callback is called each time a setter is called on a Bugzilla
object. Check if the review flag was set to ? and do some bookkeeping. Although tempting
to do such work in the callback flag_end_of_update() instead of object_before_set() doing
such work would come AFTER we get callback bug_start_of_update() and hence after we have
committed the CC list of the bug to the database. Moreover, the "interface to [flag_end_of_update()]
is UNSTABLE and it may change in the future" according to <https://github.com/bugzilla/bugzilla/blob/d7cf1c91949248222806f5a32f485b12eab8806f/Bugzilla/Hook.pm#L797>.
(bug_start_of_update): Add the EWS feeder queue to the list of CC members of the bug, if needed.
(config_add_panels): Adds a new panel to the Administration Parameters screen.
(isReviewFlag): Helper function that returns whether the specified Bugzilla::Object represents
the review flag.
* extensions/EWS/docs/en/rst/index-admin.rst: Added.
* extensions/EWS/lib/ParamsPanelUI.pm: Added.
(checkUser): Helper function to determine if there exists a Bugzilla user corresponding to
the specified login name.
(get_param_list): Add configurable field to the Administration Parameters screen to specify
the login name of the EWS feeder queue.
* extensions/EWS/template/en/default/admin/params/ews.html.tmpl: Added.

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

14 months agoEWS for security bugs
dbates@webkit.org [Tue, 19 Jun 2018 20:34:05 +0000 (20:34 +0000)]
EWS for security bugs
https://bugs.webkit.org/show_bug.cgi?id=186291
<rdar://problem/40829658>

Reviewed by Lucas Forschler.

Part 1 of 2.

Implements support for EWS processing of patches on security sensitive bugs. We add new
endpoints to the status server to support uploading and downloading of patches and associated
metadata. When webkit-patch submits a patch for EWS processing it will now upload the contents
and metadata for the patch to the status server if the patch is on a security sensitive bug.
We teach the EWS machinery in webkitpy to query the status server for a patch only if fetching
the patch from Bugzilla is not permitted due to an authorization error.

Fetching patches from the status server requires an API key. The API key is read from the
environment variable WEBKIT_STATUS_API_KEY or the value of the Git configuration key webkit.status_api_key
(in that order). Contact me or another Apple engineer for an API key.

Additionally, default to using HTTPS when querying the status server and expose an optional
command line option called --status-host-uses-http to use the former behavior of querying
over HTTP.

* QueueStatusServer/config/authorization.py: Added.
(_path_to_authorized_api_keys_file): Returns the absolute filesystem path to the file authorized_api_keys.txt.
(_parse_authorized_api_keys):
(authorized_api_keys):
(_parse_authorization_header): Parses the API key from the Authorization header. We use a
custom authentication scheme: "apikey". See remark below for more details.
(is_authorized): Checks if the request includes an API key and whether that API key is in the
list of authorized keys (performs a case-sensitive match). The API key may be specified either
in a HTTP header Authorization or in the query string argument "apikey". When using the HTTP
headers approach the Authorization header should have the form: "Authorization: apikey X" where
X is the case-sensitive API key.
* QueueStatusServer/handlers/fetchattachment.py: Added.
(FetchAttachment):
(FetchAttachment.get):
* QueueStatusServer/handlers/releasepatch.py:
(ReleasePatch.check_processed_by_all_queues): Returns whether the specified attachment was processed by all the queues.
(ReleasePatch.post): Delete the patch from AppEngine (if we have it) once the patch was processed
by all the queues.
* QueueStatusServer/handlers/submittoews.py:
(SubmitToEWS._should_add_to_ews_queue): Fix a typo in a comment while I am working in this code.
* QueueStatusServer/handlers/uploadattachment.py: Added.
(UploadAttachment):
(UploadAttachment.get):
(UploadAttachment.post):
* QueueStatusServer/main.py: Add new routes /upload-attachment and /attachment to upload an attachment
and view an attachment (or its metadata), respectively.
* QueueStatusServer/model/attachmentdata.py: Added.
(AttachmentData):
(AttachmentData.add_attachment_data):
(AttachmentData.lookup_if_exists):
(AttachmentData.remove_attachment_data):
* QueueStatusServer/templates/uploadattachment.html: Added.
* Scripts/webkitpy/common/net/bugzilla/attachment.py:
(Attachment.committer):
(Attachment):
(Attachment.to_json): Serialize to JSON so that we can upload it to AppEngine.
(Attachment.from_json): Deserialize from JSON. This is used as part of downloading a patch from AppEngine.
* Scripts/webkitpy/common/net/bugzilla/attachment_unittest.py:
(AttachmentTest.test_convert_to_json_and_back): Added.
* Scripts/webkitpy/common/net/bugzilla/bug.py:
(Bug.groups): Returns a frozenset of groups that the bug is a member of.
(Bug.is_security_sensitive): Returns whether the bug is in group Security-Sensitive.
* Scripts/webkitpy/common/net/bugzilla/bugzilla.py:
(BugzillaQueries.fetch_attachment_ids_from_review_queue): Modified to take an optional boolean, only_security_bugs,
as to whether to only fetch attachment ids for unreviewed patches associated with security bugs. By default, we
keep the current behavior and query for the attachment ids of all unreviewed patches that the currently logged in
Bugzilla user can see, which may include patches associated with security bugs.
(Bugzilla._parse_date): Update for moved and renamed constant. See remark for class Bugzilla.
(Bugzilla._parse_bug_dictionary_from_xml): Modified to return an empty dictionary if we do not have access to view the bug.
Otherwise, extract the name of the group the bug is in.
(Bugzilla.fetch_bug): Modified to return None if we do not have access to view the bug.
(Bugzilla._parse_bug_title_from_attachment_page): Extracted out logic to parse the title of the Attachment page
from _parse_bug_id_from_attachment_page() so that it can be used from both _parse_bug_id_from_attachment_page()
and get_bug_id_for_attachment_id().
(Bugzilla): Moved class constant _bugzilla_date_format to Scripts/webkitpy/common/net/bugzilla/constants.py
and renamed it to BUGZILLA_DATE_FORMAT.
(Bugzilla.AccessError):
(Bugzilla.AccessError.__init__):
(Bugzilla._parse_bug_id_from_attachment_page): Modified to return a tuple of ("bug id", "error code") so that
the caller can know the reason the parse failed if it did. The parse will fail if we do not have access to view
the bug.
(Bugzilla.bug_id_for_attachment_id): Modified to take a boolean throw_on_access_error (default: False)
as to whether to raise a Bugzilla.AccessError exception and pass it through to get_bug_id_for_attachment_id().
(Bugzilla.get_bug_id_for_attachment_id): Modified to take a boolean throw_on_access_error (default: False)
as to whether to raise a Bugzilla.AccessError exception if we do not have access to the bug associated with
the specified attachment id.
(Bugzilla.fetch_attachment):
* Scripts/webkitpy/common/net/bugzilla/bugzilla_mock.py:
(MockBugzillaQueries.fetch_attachment_ids_from_review_queue):
(MockBugzilla):
(MockBugzilla.fetch_attachment):
(MockBugzilla.fetch_attachment_contents):
(MockBugzilla.add_patch_to_bug):
* Scripts/webkitpy/common/net/bugzilla/bugzilla_unittest.py:
* Scripts/webkitpy/common/net/bugzilla/constants.py: Added.
* Scripts/webkitpy/common/net/statusserver.py:
(StatusServer)
(StatusServer.__init__): Modified to take an boolean use_https as to whether to query the server using
HTTPS (default: True - use HTTPS).
(StatusServer.set_host): Moved logic to compute the server URL from her to _server_url().
(StatusServer.set_use_https): Added.
(StatusServer.set_api_key): Added.
(StatusServer._server_url): Added.
(StatusServer._authorization_header_name_and_value_pair): Added.
(StatusServer.results_url_for_status): Update to use _server_url().
(StatusServer._post_status_to_server): Ditto.
(StatusServer._post_svn_revision_to_server): Ditto.
(StatusServer._post_work_items_to_server): Ditto.
(StatusServer._upload_attachment_to_server): Added.
(StatusServer.upload_attachment): Added.
(StatusServer._post_work_item_to_ews): Update to use _server_url().
(StatusServer.next_work_item): Ditto.
(StatusServer._post_release_work_item): Ditto.
(StatusServer._post_release_lock): Ditto.
(StatusServer._fetch_attachment_page): Added.
(StatusServer.fetch_attachment): Added.
(StatusServer._fetch_url): Add the API Key to the request if we have one.
(StatusServer.patch_status): Update to use _server_url().
(StatusServer.svn_revision): Ditto.
* Scripts/webkitpy/common/net/statusserver_mock.py:
(MockStatusServer.upload_attachment): Added.
(MockStatusServer.fetch_attachment): Added.
* Scripts/webkitpy/tool/bot/feeders.py:
(EWSFeeder.feed): Modified to download patches on security bugs and upload them to the status server (AppEngine).
* Scripts/webkitpy/tool/commands/download.py:
(ProcessAttachmentsMixin._fetch_list_of_patches_to_process): Modified to handle the case when fetching the
bug details from Bugzilla fail, say because we are not allowed to the view the bug.
(ProcessBugsMixin._fetch_list_of_patches_to_process): Filter out None values for attachments that we failed
to fetch, say because we are not allowed to the view the bug the attachment is on.
* Scripts/webkitpy/tool/commands/earlywarningsystem.py:
(AbstractEarlyWarningSystem.refetch_patch): For now, refetch the patch from the status server. Ideally, we
need a way to ask the status server to fetch the patch again from Bugzilla (or at least its metadata) so
that the EWS can check the current state of the patch (i.e. is it still marked r?).
* Scripts/webkitpy/tool/commands/queries_unittest.py:
(QueryCommandsTest.test_patches_to_review): Update expected result.
* Scripts/webkitpy/tool/commands/queues.py:
(AbstractPatchQueue._next_patch): Fetch the patch  from the status server if we failed to fetch it from
Bugzilla because we do not have permission to view it.
* Scripts/webkitpy/tool/commands/queues_unittest.py:
* Scripts/webkitpy/tool/commands/upload_unittest.py:
(test_upload_of_security_sensitive_patch_with_no_review_and_ews): Added.
* Scripts/webkitpy/tool/main.py:
(WebKitPatch):
(WebKitPatch._status_server_api_key_from_git): Read the API key from the Git configuration key webkit.status_api_key.
(WebKitPatch._status_server_api_key): Read the API key from the environment variable WEBKIT_STATUS_API_KEY.
(WebKitPatch.handle_global_options): Read the API key and update the state of the StatusServer object, if applicable.
* Scripts/webkitpy/tool/steps/obsoletepatches.py:
(ObsoletePatches.run): Modified to handle the case when fetching the bug details from Bugzilla fail, say because we
are not allowed to the view the bug.
* Scripts/webkitpy/tool/steps/submittoews.py:
(SubmitToEWS.run): Upload the contents of the patch and the Bugzilla metadata about it to the status server
if the patch was posted to a security bug.

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

14 months ago[Web Animations] Make imported/mozilla/css-animations/test_animation-playstate.html...
graouts@webkit.org [Tue, 19 Jun 2018 20:30:55 +0000 (20:30 +0000)]
[Web Animations] Make imported/mozilla/css-animations/test_animation-playstate.html pass reliably
https://bugs.webkit.org/show_bug.cgi?id=183828
<rdar://problem/40997469>

Reviewed by Dean Jackson.

LayoutTests/imported/mozilla:

Mark a progression in the Mozilla CSS Animations tests.

* css-animations/test_animation-playstate-expected.txt:

Source/WebCore:

We need to ensure pending styles have been resolved prior to returning the play state for a CSS Animation since
it can be controlled by the animation-play-state CSS property. To that end we expose a specific bindings-only
method which we override for CSSAnimation to force a style update.

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

LayoutTests:

This test now passes reliably.

* TestExpectations:

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

14 months agoconstructArray variants should take the slow path for subclasses of Array
keith_miller@apple.com [Tue, 19 Jun 2018 20:09:15 +0000 (20:09 +0000)]
constructArray variants should take the slow path for subclasses of Array
https://bugs.webkit.org/show_bug.cgi?id=186812

Reviewed by Saam Barati and Mark Lam.

This patch fixes a crashing test in ObjectInitializationScope where we would
allocate a new structure for an indexing type change while initializing
a subclass of Array. Since the new array hasn't been fully initialized
if the GC ran it would see garbage and we might crash.

* runtime/JSArray.cpp:
(JSC::constructArray):
(JSC::constructArrayNegativeIndexed):
* runtime/JSArray.h:
(JSC::constructArray): Deleted.
(JSC::constructArrayNegativeIndexed): Deleted.

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

14 months agoQueueStatusServer: "'NoneType' object has no attribute 'message'" in ReleasePatch...
dbates@webkit.org [Tue, 19 Jun 2018 19:39:48 +0000 (19:39 +0000)]
QueueStatusServer: "'NoneType' object has no attribute 'message'" in ReleasePatch.get()
when attachment is skipped by queue
https://bugs.webkit.org/show_bug.cgi?id=186748

Reviewed by Lucas Forschler.

Fixes an issue where releasing a patch that was skipped by a queue would cause an AttributeError
in ReleasePatch.get().

When removing a patch from a queue we update queue statistics. As part of this process
we record the last message posted to the status server for the patch. Currently if a patch
is skipped by the queue when picking the next patch to process (say, we failed to fetch the
attachment) then the queue does not post a message to the status server before it asks the
status server to remove the patch from the list of patches the queue needs to process. Instead
the queue should tell the status server that it chose to skip the patch before asking for the
patch to be removed from its list of patches to process.

* Scripts/webkitpy/common/net/bugzilla/attachment.py:
(Attachment.bug_id): Return None if we do not have a bug ID. This can happen if we failed
to fetch the attachment from Bugzilla (say, Bugzilla's markup changed) or we do not have
have permission to view the Bugzilla bug.
* Scripts/webkitpy/common/net/bugzilla/attachment_unittest.py: Added.
(AttachmentTest):
(AttachmentTest.test_no_bug_id):
* Scripts/webkitpy/tool/commands/queues.py:
(AbstractPatchQueue._next_patch): Call AbstractPatchQueue._did_skip() to post a status
update to the status server and then release the work item.
* Scripts/webkitpy/tool/commands/queues_unittest.py:
(AbstractPatchQueueTest.test_next_patch): Update expected result.

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

14 months agoTest262-Runner: Improve files queue to optimize CPU usage/balancing
commit-queue@webkit.org [Tue, 19 Jun 2018 18:59:51 +0000 (18:59 +0000)]
Test262-Runner: Improve files queue to optimize CPU usage/balancing
https://bugs.webkit.org/show_bug.cgi?id=186443

Patch by Leo Balter <leonardo.balter@gmail.com> on 2018-06-19
Reviewed by Michael Saboff.

This patch creates a queue manager for to keep the child process open while the parent process feed each child with test files to run.
* Scripts/test262/Runner.pm:
(processCLI):
(main):

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

14 months ago[test262-runner] More updates to the skip list
commit-queue@webkit.org [Tue, 19 Jun 2018 18:56:31 +0000 (18:56 +0000)]
[test262-runner] More updates to the skip list
https://bugs.webkit.org/show_bug.cgi?id=186786

Patch by Leo Balter <leonardo.balter@gmail.com> on 2018-06-19
Reviewed by Michael Saboff.

* test262/config.yaml:
* test262/expectations.yaml:

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

14 months agoWasm: Any function argument of type Void should be a validation error
sbarati@apple.com [Tue, 19 Jun 2018 18:48:27 +0000 (18:48 +0000)]
Wasm: Any function argument of type Void should be a validation error
https://bugs.webkit.org/show_bug.cgi?id=186794
<rdar://problem/41140257>

Reviewed by Keith Miller.

JSTests:

* wasm/Builder.js:
(const._normalizeFunctionSignature):
* wasm/function-tests/void-argument-type-should-be-a-validation-error.js: Added.
(getBinary):
* wasm/self-test/test_BuilderJSON.js:

Source/JavaScriptCore:

* wasm/WasmModuleParser.cpp:
(JSC::Wasm::ModuleParser::parseType):

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

14 months agoRevert: Add logging when splashboardd enables WebThread
ddkilzer@apple.com [Tue, 19 Jun 2018 18:31:56 +0000 (18:31 +0000)]
Revert: Add logging when splashboardd enables WebThread
<https://webkit.org/b/186793>
<rdar://problem/41213255>

Turns out this isn't needed, so reverting r232959.

* platform/RuntimeApplicationChecks.h:
* platform/cocoa/RuntimeApplicationChecksCocoa.mm:
(WebCore::IOSApplication::isSplashBoardd): Deleted.
* platform/ios/wak/WebCoreThread.mm:
(WebThreadEnable):

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

14 months ago[WebKit on watchOS] Vend username text content type when using scribble in login...
wenson_hsieh@apple.com [Tue, 19 Jun 2018 18:09:49 +0000 (18:09 +0000)]
[WebKit on watchOS] Vend username text content type when using scribble in login fields
https://bugs.webkit.org/show_bug.cgi?id=186791
<rdar://problem/41226935>

Reviewed by Beth Dakin.

Source/WebCore:

Expose AutofillElements' autofillable username input element. See WebKit ChangeLog for more details.

* editing/ios/AutofillElements.h:
(WebCore::AutofillElements::username const):

Source/WebKit:

Vend additional context to Quickboard when focusing an element that is likely to be a username field.

Test: fast/forms/watchos/username-text-content-type.html

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

Add a new flag to tell the UI process when the currently focused element is an autofillable username input
field (using existing app autofill heuristics).

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

Add new testing SPI to grab the computed text content type for the focused element.

* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(contentTypeFromFieldName):

If `autocomplete="username"` is specified, return a username text content type. This was not originally added in
r197626 because UITextContentTypeUsername was only introduced later, in iOS 11.

(-[WKContentView textContentTypeForListViewController:]):
(-[WKContentView textContentTypeForTesting]):
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::getAssistedNodeInformation):

Tools:

Add testing support for grabbing the current text content type of the focused element.

* DumpRenderTree/ios/UIScriptControllerIOS.mm:
(WTR::UIScriptController::textContentType const):
* TestRunnerShared/UIScriptContext/Bindings/UIScriptController.idl:
* TestRunnerShared/UIScriptContext/UIScriptController.cpp:
(WTR::UIScriptController::textContentType const):
* TestRunnerShared/UIScriptContext/UIScriptController.h:
* WebKitTestRunner/ios/UIScriptControllerIOS.mm:
(WTR::UIScriptController::textContentType const):

LayoutTests:

Add a new layout test verifying that:
1. There is no text content type for a lone plain text input.
2. The text content type for a plain text input preceding a password field is "username".
3. The text content type for a lone plain text input with `autocomplete="username"` is "username".

* fast/forms/watchos/username-text-content-type-expected.txt: Added.
* fast/forms/watchos/username-text-content-type.html: Added.
* resources/ui-helper.js:
(window.UIHelper.textContentType):

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

14 months agoUnreviewed, rolling out r232947.
cdumez@apple.com [Tue, 19 Jun 2018 18:06:03 +0000 (18:06 +0000)]
Unreviewed, rolling out r232947.

Caused an API test to time out

Reverted changeset:

"Implement IPC throttling to keep the main thread responsive
when a process misbehaves"
https://bugs.webkit.org/show_bug.cgi?id=186607
https://trac.webkit.org/changeset/232947

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

14 months agoLayout Test imported/mozilla/css-transitions/test_animation-cancel.html is failing.
pvollan@apple.com [Tue, 19 Jun 2018 17:42:32 +0000 (17:42 +0000)]
Layout Test imported/mozilla/css-transitions/test_animation-cancel.html is failing.
https://bugs.webkit.org/show_bug.cgi?id=186807

Unreviewed test gardening.

* platform/win/TestExpectations:

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

14 months agoWebCoreNSURLSessionDataTaskClient::redirectReceived() calls WebCore on non-main thread
cdumez@apple.com [Tue, 19 Jun 2018 17:12:23 +0000 (17:12 +0000)]
WebCoreNSURLSessionDataTaskClient::redirectReceived() calls WebCore on non-main thread
https://bugs.webkit.org/show_bug.cgi?id=186805
<rdar://problem/36960714>

Reviewed by Youenn Fablet.

Make sure WebCoreNSURLSessionDataTaskClient::redirectReceived() dispatches to the main
thread before calling its completion handler. Otherwise, we end up calling into WebCore
on a NSOperationQueue background thread and we crash.

* platform/network/cocoa/WebCoreNSURLSession.mm:
(WebCore::WebCoreNSURLSessionDataTaskClient::redirectReceived):

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

14 months agoHTTPHeaderMap wastes 226KB of HashTable capacity on cnn.com
cdumez@apple.com [Tue, 19 Jun 2018 17:10:33 +0000 (17:10 +0000)]
HTTPHeaderMap wastes 226KB of HashTable capacity on cnn.com
https://bugs.webkit.org/show_bug.cgi?id=186735
<rdar://problem/41189164>

Reviewed by Geoffrey Garen.

Source/WebCore:

Resource requests and responses normally do not have a large amount of HTTP headers
(local testing shows 6 common headers on average and 0.3 uncommon ones).
As a result, move the internal representation of HTTPHeaderMap from HashMaps to
Vectors. Given the number of headers, the impact on performance should be negligible.
However, the new implementation uses a lot less memory. In a follow-up, we can save
even more memory by calling HTTPHeaderMap::shrinkToFit() when possible.

* loader/CrossOriginAccessControl.cpp:
(WebCore::createAccessControlPreflightRequest):
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::responseReceived):
* loader/cache/CachedRawResource.cpp:
(WebCore::CachedRawResource::canReuse const):
* platform/network/HTTPHeaderMap.cpp:
(WebCore::HTTPHeaderMap::isolatedCopy const):
(WebCore::HTTPHeaderMap::get const):
(WebCore::HTTPHeaderMap::set):
(WebCore::HTTPHeaderMap::add):
(WebCore::HTTPHeaderMap::append):
(WebCore::HTTPHeaderMap::addIfNotPresent):
(WebCore::HTTPHeaderMap::contains const):
(WebCore::HTTPHeaderMap::remove):
* platform/network/HTTPHeaderMap.h:
(WebCore::HTTPHeaderMap::CommonHeader::isolatedCopy const):
(WebCore::HTTPHeaderMap::CommonHeader::operator== const):
(WebCore::HTTPHeaderMap::UncommonHeader::isolatedCopy const):
(WebCore::HTTPHeaderMap::UncommonHeader::operator== const):
(WebCore::HTTPHeaderMap::HTTPHeaderMapConstIterator::HTTPHeaderMapConstIterator):
(WebCore::HTTPHeaderMap::HTTPHeaderMapConstIterator::updateKeyValue):
(WebCore::HTTPHeaderMap::shrinkToFit):
(WebCore::HTTPHeaderMap::commonHeaders const):
(WebCore::HTTPHeaderMap::uncommonHeaders const):
(WebCore::HTTPHeaderMap::commonHeaders):
(WebCore::HTTPHeaderMap::uncommonHeaders):
(WebCore::HTTPHeaderMap::CommonHeader::encode const):
(WebCore::HTTPHeaderMap::CommonHeader::decode):
(WebCore::HTTPHeaderMap::UncommonHeader::encode const):
(WebCore::HTTPHeaderMap::UncommonHeader::decode):
(WebCore::HTTPHeaderMap::encode const):
(WebCore::HTTPHeaderMap::decode):
* platform/network/ResourceResponseBase.cpp:
(WebCore::ResourceResponseBase::filter):
(WebCore::ResourceResponseBase::sanitizeHTTPHeaderFields):

Source/WebKit:

* NetworkProcess/cache/NetworkCacheCoders.cpp:
(WTF::Persistence::Coder<WebCore::HTTPHeaderMap>::decode):

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

14 months agoNetwork Preflights do not show in WebInspector after moving CORS checks to NetworkProcess
youenn@apple.com [Tue, 19 Jun 2018 16:46:43 +0000 (16:46 +0000)]
Network Preflights do not show in WebInspector after moving CORS checks to NetworkProcess
https://bugs.webkit.org/show_bug.cgi?id=186312
<rdar://problem/40495434>

Reviewed by Chris Dumez.

Source/WebCore:

Test: http/wpt/fetch/inspect-preflight.html

No change of behavior in regular conditions.
All intermediate requests/responses are now buffered in NetworkProcess if Web inspector shows up.
Add NetworkLoadInformation and NetworkIntermediateLoadInformation for that purpose.

Add a new LoaderStrategy method to grab this information from NetworkProcess synchronously.
Add Internals API for testing the storage by the Network Process and the sending to WebProcess.

* WebCore.xcodeproj/project.pbxproj:
* loader/LoaderStrategy.cpp:
(WebCore::LoaderStrategy::intermediateLoadInformationFromResourceLoadIdentifier):
* loader/LoaderStrategy.h:
* platform/network/NetworkLoadInformation.h: Added.
(WebCore::NetworkTransactionInformation::encode const):
(WebCore::NetworkTransactionInformation::decode):
* testing/Internals.cpp:
(WebCore::Internals::setCaptureExtraNetworkLoadMetricsEnabled):
(WebCore::Internals::ongoingLoadDescriptions):
* testing/Internals.h:
* testing/Internals.idl:

Source/WebKit:

Add buffering of all request/response of a given load, including redirections and preflights.
This buffering is switched on/off by a boolean which is switched on in case Web Inspector is launched.

Buffering is done in NetworkLoadChecker.
We add ways to retrieve preflight information from NetworkCORSPreflightChecker.

Implement LoaderStrategy new methods through sync IPC.

* NetworkProcess/NetworkCORSPreflightChecker.cpp:
(WebKit::NetworkCORSPreflightChecker::NetworkCORSPreflightChecker):
(WebKit::NetworkCORSPreflightChecker::startPreflight):
(WebKit::NetworkCORSPreflightChecker::willPerformHTTPRedirection):
(WebKit::NetworkCORSPreflightChecker::didReceiveResponseNetworkSession):
(WebKit::NetworkCORSPreflightChecker::didCompleteWithError):
(WebKit::NetworkCORSPreflightChecker::takeInformation):
* NetworkProcess/NetworkCORSPreflightChecker.h:
* NetworkProcess/NetworkConnectionToWebProcess.h:
(WebKit::NetworkConnectionToWebProcess::takeNetworkLoadInformationRequest):
(WebKit::NetworkConnectionToWebProcess::takeNetworkLoadIntermediateInformation):
(WebKit::NetworkConnectionToWebProcess::addNetworkLoadInformation):
(WebKit::NetworkConnectionToWebProcess::addNetworkLoadInformationMetrics):
(WebKit::NetworkConnectionToWebProcess::addNetworkLoadInformationResponse): Deleted.
* NetworkProcess/NetworkConnectionToWebProcess.messages.in:
* NetworkProcess/NetworkLoadChecker.cpp:
(WebKit::NetworkLoadChecker::NetworkLoadChecker):
(WebKit::NetworkLoadChecker::check):
(WebKit::NetworkLoadChecker::checkRedirection):
(WebKit::NetworkLoadChecker::checkResponse):
(WebKit::NetworkLoadChecker::checkCORSRequestWithPreflight):
(WebKit::NetworkLoadChecker::storeRedirection):
* NetworkProcess/NetworkLoadChecker.h:
(WebKit::NetworkLoadChecker::takeNetworkLoadInformation):
* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::NetworkResourceLoader::didReceiveResponse):
(WebKit::NetworkResourceLoader::willSendRedirectedRequest):
(WebKit::NetworkResourceLoader::didRetrieveCacheEntry):
* NetworkProcess/PingLoad.cpp:
(WebKit::PingLoad::PingLoad):
* Scripts/webkit/messages.py:
* WebProcess/Network/WebLoaderStrategy.cpp:
(WebKit::WebLoaderStrategy::intermediateLoadInformationFromResourceLoadIdentifier):
* WebProcess/Network/WebLoaderStrategy.h:

LayoutTests:

* http/wpt/fetch/inspect-preflight-expected.txt: Added.
* http/wpt/fetch/inspect-preflight.html: Added.
* http/wpt/fetch/resources/preflight.py: Added.
* platform/mac-wk1/TestExpectations:
* platform/win/TestExpectations:

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

14 months agoMAP_JIT is not present for minimal simulator builds
bfulgham@apple.com [Tue, 19 Jun 2018 15:55:57 +0000 (15:55 +0000)]
MAP_JIT is not present for minimal simulator builds
https://bugs.webkit.org/show_bug.cgi?id=186608

Reviewed by Darin Adler.

* Configurations/WebContent-iOS-minimalsimulator.entitlements:

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

14 months agoLayout Test imported/mozilla/css-animations/test_animation-cancel.html is a flaky...
graouts@webkit.org [Tue, 19 Jun 2018 15:37:44 +0000 (15:37 +0000)]
Layout Test imported/mozilla/css-animations/test_animation-cancel.html is a flaky failure
https://bugs.webkit.org/show_bug.cgi?id=184011

Unreviewed.

This test should pass reliably as of r232960 thanks to the fix to webkit.org/b/183821.

* TestExpectations:

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

14 months ago[Web Animations] Make imported/mozilla/css-transitions/test_animation-cancel.html...
graouts@webkit.org [Tue, 19 Jun 2018 15:33:22 +0000 (15:33 +0000)]
[Web Animations] Make imported/mozilla/css-transitions/test_animation-cancel.html pass reliably
https://bugs.webkit.org/show_bug.cgi?id=183821
<rdar://problem/40997034>

Reviewed by Dean Jackson.

LayoutTests/imported/mozilla:

Mark a progression in the Mozilla CSS Transitions tests.

* css-transitions/test_animation-cancel-expected.txt:

Source/WebCore:

If an element gets a "display: none" style RenderTreeUpdater::tearDownRenderers() will be called with a RendererUpdateCancelingAnimations
teardown type on all of its children. We need to ensure all declarative animations, and only those since regular Web Animations should be
kept active regardless of their target's style, are canceled in this situation.

* animation/AnimationTimeline.cpp:
(WebCore::AnimationTimeline::cancelDeclarativeAnimationsForElement):
* animation/AnimationTimeline.h:
* rendering/updating/RenderTreeUpdater.cpp:
(WebCore::RenderTreeUpdater::tearDownRenderers):

LayoutTests:

This test now passes reliably.

* TestExpectations:

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

14 months agoAdd logging when splashboardd enables WebThread
ddkilzer@apple.com [Tue, 19 Jun 2018 14:02:27 +0000 (14:02 +0000)]
Add logging when splashboardd enables WebThread
<https://webkit.org/b/186793>
<rdar://problem/41213255>

Reviewed by Daniel Bates.

* platform/RuntimeApplicationChecks.h:
(WebCore::IOSApplication::isSplashBoardd): Add declaration.
* platform/cocoa/RuntimeApplicationChecksCocoa.mm:
(WebCore::IOSApplication::isSplashBoardd): Add implementation.
* platform/ios/wak/WebCoreThread.mm:
(WebThreadEnable): Call RELEASE_LOG_FAULT() if this is called by
splashboardd.

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

14 months ago[GTK][WPE][Nicosia] Add environment variable to enable threaded rendering and set...
magomez@igalia.com [Tue, 19 Jun 2018 12:05:19 +0000 (12:05 +0000)]
[GTK][WPE][Nicosia] Add environment variable to enable threaded rendering and set the number of painting threads
https://bugs.webkit.org/show_bug.cgi?id=186801

Reviewed by Carlos Garcia Campos.

Add and environment variable to enable the usage of the threaded renderer and define the number
of painting threads.

No new tests.

* platform/graphics/nicosia/NicosiaPaintingEngine.cpp:
(Nicosia::PaintingEngine::create):
* platform/graphics/nicosia/NicosiaPaintingEngineThreaded.cpp:
(Nicosia::PaintingEngineThreaded::PaintingEngineThreaded):
* platform/graphics/nicosia/NicosiaPaintingEngineThreaded.h:

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

14 months ago[WSL] Improving the typing rules
rmorisset@apple.com [Tue, 19 Jun 2018 10:35:15 +0000 (10:35 +0000)]
[WSL] Improving the typing rules

Rubberstamped by Filip Pizlo.

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

14 months agoRTCRtpSender.replaceTrack(null) ends current track
youenn@apple.com [Tue, 19 Jun 2018 07:20:51 +0000 (07:20 +0000)]
RTCRtpSender.replaceTrack(null) ends current track
https://bugs.webkit.org/show_bug.cgi?id=184911
<rdar://problem/40758138>

Reviewed by Eric Carlson.

LayoutTests/imported/w3c:

* web-platform-tests/webrtc/RTCRtpSender-replaceTrack-expected.txt:

Source/WebCore:

Before the patch, when replacing the sender track by null, the previous track was stopped.
Instead of doing that, the track now stays alive and it is the realtime source that is stopped.
This ensures that the data is no longer sent while the track can still be used elsewhere.

Covered by updated and rebased tests.

* Modules/mediastream/PeerConnectionBackend.h:
* Modules/mediastream/RTCPeerConnection.cpp:
(WebCore::RTCPeerConnection::addTransceiver):
(WebCore::RTCPeerConnection::enqueueReplaceTrackTask):
(WebCore::RTCPeerConnection::replaceTrack):
* Modules/mediastream/RTCPeerConnection.h:
* Modules/mediastream/RTCRtpSender.cpp:
(WebCore::RTCRtpSender::replaceTrack):
* Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
(WebCore::updateTrackSource):
(WebCore::LibWebRTCPeerConnectionBackend::replaceTrack):
* Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.h:

LayoutTests:

Added checks for readyState to ensure the track remains live.
Split the main test into several tests to ease readability.

* webrtc/video-replace-track-to-null-expected.txt:
* webrtc/video-replace-track-to-null.html:

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