WebKit-https.git
3 years agoWebDriver: Add support to import and run W3C tests
carlosgc@webkit.org [Thu, 26 Oct 2017 10:58:17 +0000 (10:58 +0000)]
WebDriver: Add support to import and run W3C tests
https://bugs.webkit.org/show_bug.cgi?id=177304

Reviewed by Brian Burg.

Tools:

WPT has now several WebDriver tests, and new ones are going to be added to cover the whole spec. This patch
adds the initial support for running W3C tests. The script import-w3c-webdriver-tests reuses parts of the W3C
test downloader to download the tests and required tools from WPT repository into WebDriverTests
directory. Tests can be run with run-webdriver-tests, a new script that works similar to other test runner
scripts. For now it shows a summary at the end of the execution, there aren't expectations yet, since we are not
ready to run those tests in the bots. Once we are ready to properly run the tests, we can add the expectations
support and run the tests in the bots.

* Scripts/import-w3c-webdriver-tests: Added.
* Scripts/run-webdriver-tests: Added.
* Scripts/webkitpy/style/checker.py: Skip WebDriverTests directory since it only contains third-party python
code.
* Scripts/webkitpy/thirdparty/__init__.py: Add support to autodownload mozlog and mozprocess since they are
required by the WebDriver tests.
* Scripts/webkitpy/webdriver_tests/__init__.py: Added.
* Scripts/webkitpy/webdriver_tests/webdriver_driver.py: Added.
* Scripts/webkitpy/webdriver_tests/webdriver_driver_gtk.py: Added.
* Scripts/webkitpy/webdriver_tests/webdriver_test_result.py: Added.
* Scripts/webkitpy/webdriver_tests/webdriver_test_runner.py: Added.
* Scripts/webkitpy/webdriver_tests/webdriver_test_runner_w3c.py: Added.
* Scripts/webkitpy/webdriver_tests/webdriver_w3c_executor.py: Added.
* Scripts/webkitpy/webdriver_tests/webdriver_w3c_web_server.py: Added.

WebDriverTests:

Add json file used by the importer and the result of running the importer.

* imported/w3c/importer.json: Added.
* imported/w3c/tools/pytest/: Added.
* imported/w3c/tools/webdriver/: Added.
* imported/w3c/tools/wptrunner/: Added.
* imported/w3c/webdriver/: Added.

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

3 years ago[GTK] Web Inspector: Add CanvasOverview.svg and Canvas.svg
commit-queue@webkit.org [Thu, 26 Oct 2017 10:44:55 +0000 (10:44 +0000)]
[GTK] Web Inspector: Add CanvasOverview.svg and Canvas.svg
https://bugs.webkit.org/show_bug.cgi?id=178426

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

* UserInterface/Images/gtk/Canvas.svg: Added.
* UserInterface/Images/gtk/CanvasOverview.svg: Added.

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

3 years ago[MSE][GStreamer] Fix hang on clearing/destroying AppendPipeline
eocanha@igalia.com [Thu, 26 Oct 2017 10:31:39 +0000 (10:31 +0000)]
[MSE][GStreamer] Fix hang on clearing/destroying AppendPipeline
https://bugs.webkit.org/show_bug.cgi?id=178819

Reviewed by Xabier Rodriguez-Calvar.

The deadlock may occur when UI thread tries to clear pipeline in
AppendPipeline::clearPlayerPrivate() while parser thread tries to change
pipeline state to pause holding the stream lock in
AppendPipeline::connectDemuxerSrcPadToAppsinkFromAnyThread()

This patch is authored by Eugene Mutavchi <Ievgen_Mutavchi@comcast.com>

* platform/graphics/gstreamer/mse/AppendPipeline.cpp:
(WebCore::AppendPipeline::connectDemuxerSrcPadToAppsinkFromAnyThread):
Return if there's no player private.

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

3 years agoAssert that no script is executed during style recalc
rniwa@webkit.org [Thu, 26 Oct 2017 08:46:02 +0000 (08:46 +0000)]
Assert that no script is executed during style recalc
https://bugs.webkit.org/show_bug.cgi?id=178845
<rdar://problem/35106129>

Reviewed by Antti Koivisto.

This patch adds NoEventDispatchAssertion to Document::updateStyle and Document::updateStyleIfNeeded
to make sure we don't start mutating DOM in the middle of a style update.

Added NoEventDispatchAssertion::EventAllowedScope for various places in SVGUseElement to update its
shadow tree since that happens while updating the style.

No new tests since there should be no behavioral change.

* dom/Document.cpp:
(WebCore::Document::resolveStyle): Added NoEventDispatchAssertion while flushing pending stylesheets
and calling FrameView::willRecalcStyle, and while the style tree solver is in works. Also moved in
the code to update the selection and schedule to dispatch a fake mouse event into the same scope.
Also increment m_styleRecalcCount in the same code since post resolution callbacks could run author
scripts which in turn trigger another (recursive) style recalc.
(WebCore::Document::updateStyleIfNeeded): Put everything but the call to resolveStyle in a scope with
NoEventDispatchAssertion.
* dom/Element.cpp:
(WebCore::Element::cloneElementWithChildren): Added NoEventDispatchAssertion::EventAllowedScope to the
newly cloned element for SVG use element's shadow tree.
(WebCore::Element::cloneElementWithoutChildren): Ditto.
* dom/EventDispatcher.cpp:
(WebCore::EventDispatcher::dispatchEvent): Make the assertion more precise to workaround the fact SVG
use elements update its shadow tree in the middle of style updates. Also removed a redundant assertion
since the result of NoEventDispatchAssertion::isEventDispatchAllowedInSubtree cannot chance without
pushing or popoing the stack frame.
* svg/SVGUseElement.cpp:
(WebCore::SVGUseElement::clearShadowTree):
(WebCore::SVGUseElement::updateShadowTree): Added NoEventDispatchAssertion to the user-agent shadow root
of a SVG use element. Since this is a newly created shadow tree which hasn't been exposed to author
scripts, it's safe to mutate them during the style recalc even though it's not the best design.
(WebCore::SVGUseElement::cloneTarget const): Ditto.
(WebCore::SVGUseElement::expandUseElementsInShadowTree const): Ditto.
(WebCore::SVGUseElement::expandSymbolElementsInShadowTree const): Ditto.
(WebCore::SVGUseElement::transferEventListenersToShadowTree const):

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

3 years agoLayoutTest http/tests/security/clipboard/copy-paste-html-cross-origin-iframe-across...
rniwa@webkit.org [Thu, 26 Oct 2017 07:10:05 +0000 (07:10 +0000)]
LayoutTest http/tests/security/clipboard/copy-paste-html-cross-origin-iframe-across-origin.html is a flaky failure
https://bugs.webkit.org/show_bug.cgi?id=178828

Reviewed by Wenson Hsieh.

Removed the superflous call to finishJSTest after 3s.

* http/tests/security/clipboard/copy-paste-html-cross-origin-iframe-across-origin.html:

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

3 years agoMove platform Cocoa sources to unified sources
keith_miller@apple.com [Thu, 26 Oct 2017 07:07:51 +0000 (07:07 +0000)]
Move platform Cocoa sources to unified sources
https://bugs.webkit.org/show_bug.cgi?id=178851

Rubber-stamped by Tim Horton.

* SourcesCocoa.txt:
* WebCore.xcodeproj/project.pbxproj:

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

3 years agoStart moving Cocoa specific unified sources
keith_miller@apple.com [Thu, 26 Oct 2017 06:21:35 +0000 (06:21 +0000)]
Start moving Cocoa specific unified sources
https://bugs.webkit.org/show_bug.cgi?id=178850

Rubber-stamped by Tim Horton.

* PlatformMac.cmake:
* SourcesCocoa.txt:
* WebCore.xcodeproj/project.pbxproj:

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

3 years ago[HarfBuzz] ComplexTextRun should initialize direction from the harfbuzz buffer
carlosgc@webkit.org [Thu, 26 Oct 2017 06:03:35 +0000 (06:03 +0000)]
[HarfBuzz] ComplexTextRun should initialize direction from the harfbuzz buffer
https://bugs.webkit.org/show_bug.cgi?id=178788

Reviewed by Michael Catanzaro.

Instead of using the TextRun direction. If the TextRun is ltr, but the harfbuzz buffer is rtl, the character
indexes will be swapped in m_coreTextIndices.

* platform/graphics/ComplexTextController.h:
(WebCore::ComplexTextController::ComplexTextRun::create): Remove the ltr parameter.
* platform/graphics/harfbuzz/ComplexTextControllerHarfBuzz.cpp:
(WebCore::ComplexTextController::ComplexTextRun::ComplexTextRun): Initialize m_isLTR using hb_buffer_get_direction().
(WebCore::ComplexTextController::collectComplexTextRunsForCharacters): Do not pass ltr to ComplexTextRun::create().

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

3 years agoMove remaining platform independent sources to unified sources
keith_miller@apple.com [Thu, 26 Oct 2017 05:23:12 +0000 (05:23 +0000)]
Move remaining platform independent sources to unified sources
https://bugs.webkit.org/show_bug.cgi?id=178849

Rubber-stamped by Tim Horton.

* CMakeLists.txt:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:

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

3 years agoMove plugins and rendering to unified sources
keith_miller@apple.com [Thu, 26 Oct 2017 04:57:44 +0000 (04:57 +0000)]
Move plugins and rendering to unified sources
https://bugs.webkit.org/show_bug.cgi?id=178848

Rubber-stamped by Tim Horton.

* CMakeLists.txt:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:

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

3 years agoUnreviewed, add FEMorphology.cpp back to the regular build after r224003.
keith_miller@apple.com [Thu, 26 Oct 2017 04:27:59 +0000 (04:27 +0000)]
Unreviewed, add FEMorphology.cpp back to the regular build after r224003.

* WebCore.xcodeproj/project.pbxproj:

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

3 years agoUnreviewed, Windows build fix.
keith_miller@apple.com [Thu, 26 Oct 2017 04:24:02 +0000 (04:24 +0000)]
Unreviewed, Windows build fix.

* Sources.txt:

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

3 years agoWeb Inspector: provide a way to enable/disable event listeners
webkit@devinrousso.com [Thu, 26 Oct 2017 04:07:59 +0000 (04:07 +0000)]
Web Inspector: provide a way to enable/disable event listeners
https://bugs.webkit.org/show_bug.cgi?id=177451
<rdar://problem/34994925>

Reviewed by Joseph Pecoraro.

Source/JavaScriptCore:

* inspector/protocol/DOM.json:
Add `setEventListenerDisabled` command that enables/disables a specific event listener
during event dispatch. When a disabled event listener is fired, the listener's callback will
not be called.

Source/WebCore:

Test: inspector/dom/setEventListenerDisabled.html

* dom/EventTarget.cpp:
(WebCore::EventTarget::fireEventListeners):
Add InspectorInstrumentation call to isEventListenerDisabled. If true, the event listener's
callback will not be called.

* inspector/InspectorDOMAgent.h:
* inspector/InspectorDOMAgent.cpp:
(WebCore::InspectorDOMAgent::discardBindings):
(WebCore::InspectorDOMAgent::getEventListenersForNode):
(WebCore::InspectorDOMAgent::setEventListenerDisabled):
(WebCore::InspectorDOMAgent::buildObjectForEventListener):
(WebCore::InspectorDOMAgent::willRemoveEventListener):
(WebCore::InspectorDOMAgent::isEventListenerDisabled):
Introduce a mapping of `EventListener*` to `InspectorEventListener`, a struct for uniquely
identifying event listeners so they can be referenced from the frontend. We only add items
to this mapping when `getEventListenersForNode` is called, as that is when EventListener
data is sent to the frontend. This allows us to defer creating an Inspector "mirror" object
for each EventListener until it is needed. Items are removed whenever an event listener is
removed or when the document changes.

* inspector/InspectorInstrumentation.h:
(WebCore::InspectorInstrumentation::isEventListenerDisabled):
* inspector/InspectorInstrumentation.cpp:
(WebCore::InspectorInstrumentation::willRemoveEventListenerImpl):
(WebCore::InspectorInstrumentation::isEventListenerDisabledImpl):
Pass additional parameters to InspectorDOMAgent so it can determine if the event listener
actually exists. If not, don't dispatch an event to the frontend as nothing will change.

Source/WebInspectorUI:

* Localizations/en.lproj/localizedStrings.js:

* UserInterface/Controllers/DOMTreeManager.js:
(WI.DOMTreeManager.prototype.setEventListenerDisabled):

* UserInterface/Views/DOMNodeDetailsSidebarPanel.js:
(WI.DOMNodeDetailsSidebarPanel.prototype.attached):
(WI.DOMNodeDetailsSidebarPanel.prototype.detached):
(WI.DOMNodeDetailsSidebarPanel.prototype._eventListenersChanged):
(WI.DOMNodeDetailsSidebarPanel.prototype.addEventListeners): Deleted.
(WI.DOMNodeDetailsSidebarPanel.prototype.removeEventListeners): Deleted.
Listen for `WI.DOMNode.Event.EventListenersChanged` on all instances of WI.DOMNode, since we
will still want to refresh the event listeners section in the event that an event listener
is removed from a parent node.

* UserInterface/Views/EventListenerSectionGroup.js:
(WI.EventListenerSectionGroup):
(WI.EventListenerSectionGroup.prototype._eventText):
(WI.EventListenerSectionGroup.prototype._nodeTextOrLink):
(WI.EventListenerSectionGroup.prototype._createDisabledToggleElement):
(WI.EventListenerSectionGroup.prototype._createDisabledToggleElement.updateTitle):
* UserInterface/Views/EventListenerSectionGroup.css:
(.event-listener-section > .content input[type="checkbox"]):

* UserInterface/Views/DetailsSectionSimpleRow.js:
(WI.DetailsSectionSimpleRow.prototype.get label):
(WI.DetailsSectionSimpleRow.prototype.set label):

LayoutTests:

* inspector/dom/setEventListenerDisabled-expected.txt: Added.
* inspector/dom/setEventListenerDisabled.html: Added.

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

3 years agoMove Platform to unified sources.
keith_miller@apple.com [Thu, 26 Oct 2017 03:59:25 +0000 (03:59 +0000)]
Move Platform to unified sources.
https://bugs.webkit.org/show_bug.cgi?id=178829

Rubber-stamped by Tim Horton.

* CMakeLists.txt:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* platform/Cursor.cpp:
* platform/sql/SQLiteDatabase.h:

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

3 years agomessageEvent.source can also be a ServiceWorker
cdumez@apple.com [Thu, 26 Oct 2017 02:57:08 +0000 (02:57 +0000)]
messageEvent.source can also be a ServiceWorker
https://bugs.webkit.org/show_bug.cgi?id=178839

Reviewed by Brady Eidson.

messageEvent.source can also be a ServiceWorker:
- https://html.spec.whatwg.org/multipage/comms.html#messageeventsource

This enables calling postMessage() from a ServiceWorker via Bug 178794.

* dom/MessageEvent.cpp:
(WebCore::MessageEvent::source const): Deleted.
* dom/MessageEvent.h:
* dom/MessageEvent.idl:

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

3 years agoStyle::Scope::flushPendingUpdate() can replace the entire document in XSLTProcessor...
rniwa@webkit.org [Thu, 26 Oct 2017 00:30:03 +0000 (00:30 +0000)]
Style::Scope::flushPendingUpdate() can replace the entire document in XSLTProcessor::createDocumentFromSource
https://bugs.webkit.org/show_bug.cgi?id=178715
<rdar://problem/35144665>

Reviewed by Brent Fulgham.

Apply XLS tranforms when a 0s timer fires or the document finishes parsing or loading whichever comes first
instead of in the middle of collecting a list of stylesheets.

* dom/Document.cpp:
(WebCore::Document::Document): Initialize the newly added timer.
(WebCore::Document::implicitClose): Apply any pending XSLT before we fire load events since some of the event
handlers may be expecting to see the document after XSLT had been applied.
(WebCore::Document::scheduleToApplyXSLTransforms): Added.
(WebCore::Document::applyPendingXSLTransformsNowIfScheduled): Added.
(WebCore::Document::applyPendingXSLTransformsTimerFired): Added. Moved the logic to apply XSL transforms from
Style::Scope::collectActiveStyleSheets, and merged applyXSLTransform into this function.
(WebCore::Document::applyXSLTransform): Deleted.
(WebCore::Document::finishedParsing): Apply XSLT right before updating the style. This is where used to apply
inline XSLT and it happens much earlier than implicitClose.
* dom/Document.h:
* dom/ProcessingInstruction.cpp:
(WebCore::ProcessingInstruction::checkStyleSheet): Schedule XSLT in the document instead of flushing pending
stylesheets, which would have synchronously applied XSLT. We can't apply XSLT synchronously here because this
function can be called from a non-script-resilient call stack.
(WebCore::ProcessingInstruction::sheetLoaded): Ditto.
* style/StyleScope.cpp:
(WebCore::Style::Scope::collectXSLTransforms): Added.
(WebCore::Style::Scope::collectActiveStyleSheets): Removed the code to apply XSLT. Skip ProcessingInstructions
that applies XSLT. Also use RefPtr<StyleSheet> instead of a raw pointer to store StyleSheet.
* style/StyleScope.h:
* xml/parser/XMLDocumentParserLibxml2.cpp:
(WebCore::XMLDocumentParser::doEnd): Apply any pending XSLTs synchronously here as the comment suggests.

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

3 years agoWeb Inspector: Canvas Tab: starting a second recording doesn't show red titlebar...
webkit@devinrousso.com [Wed, 25 Oct 2017 23:50:11 +0000 (23:50 +0000)]
Web Inspector: Canvas Tab: starting a second recording doesn't show red titlebar if the first recording was empty
https://bugs.webkit.org/show_bug.cgi?id=178805
<rdar://problem/35176303>

Reviewed by Brian Burg.

Source/WebCore:

No new tests, updated existing tests.

* inspector/InspectorCanvasAgent.cpp:
(WebCore::InspectorCanvasAgent::didFinishRecordingCanvasFrame):
If the recording was stopped and had no data, reset the CallTracingActive flag to false.

LayoutTests:

* inspector/canvas/recording-2d-expected.txt:
* inspector/canvas/recording-2d.html:

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

3 years agoWeb Inspector: replace TypeVerifier with subclasses of WI.Collection
webkit@devinrousso.com [Wed, 25 Oct 2017 23:49:05 +0000 (23:49 +0000)]
Web Inspector: replace TypeVerifier with subclasses of WI.Collection
https://bugs.webkit.org/show_bug.cgi?id=178045
<rdar://problem/35174307>

Reviewed by Brian Burg.

Source/WebInspectorUI:

* UserInterface/Models/Collection.js:
(WI.Collection):
(WI.Collection.prototype.get displayName):
(WI.Collection.prototype.objectIsRequiredType):
(WI.Collection.prototype.add):
(WI.Collection.prototype.get typeVerifier): Deleted.
Instead of exposing the typeVerifier, we create a public predicate that returns whether the
given object matches the expected type of the Collection. Subclasses can override it to
limit the scope of the collection to a particular type.

* UserInterface/Models/CollectionTypes.js:
(WI.FrameCollection.prototype.get displayName):
(WI.FrameCollection.prototype.objectIsRequiredType):
(WI.FrameCollection): Deleted.
(WI.ScriptCollection.prototype.get displayName):
(WI.ScriptCollection.prototype.objectIsRequiredType):
(WI.ScriptCollection): Deleted.
(WI.CSSStyleSheetCollection.prototype.get displayName):
(WI.CSSStyleSheetCollection.prototype.objectIsRequiredType):
(WI.CSSStyleSheetCollection): Deleted.
(WI.CanvasCollection.prototype.get displayName):
(WI.CanvasCollection.prototype.objectIsRequiredType):
(WI.CanvasCollection): Deleted.
(WI.ShaderProgramCollection.prototype.get displayName):
(WI.ShaderProgramCollection.prototype.objectIsRequiredType):
(WI.ShaderProgramCollection): Deleted.
(WI.RecordingCollection.prototype.get displayName):
(WI.RecordingCollection.prototype.objectIsRequiredType):
(WI.RecordingCollection): Deleted.
* UserInterface/Models/ResourceCollection.js:
(WI.ResourceCollection):
(WI.ResourceCollection.prototype.get displayName):
(WI.ResourceCollection.prototype.objectIsRequiredType):
(WI.ResourceCollection.verifierForType): Deleted.
* UserInterface/Views/TreeOutlineGroup.js:
(WI.TreeOutlineGroup.prototype.objectIsRequiredType):
(WI.TreeOutlineGroup): Deleted.
Introduce additional subclasses of Collection for other model types. Modify existing
subclasses to remove `typeVerifier` and instead extend `objectIsRequiredType`.

* UserInterface/Models/Canvas.js:
(WI.Canvas):
* UserInterface/Models/Frame.js:
(WI.Frame):
* UserInterface/Protocol/Target.js:
(WI.Target):
* UserInterface/Views/ResourceSidebarPanel.js:
(WI.ResourceSidebarPanel.prototype.treeElementForRepresentedObject):
(WI.ResourceSidebarPanel.prototype._addScript):

* UserInterface/Views/CollectionContentView.js:
(WI.CollectionContentView):
(WI.CollectionContentView.titleForCollection): Delete.
* UserInterface/Views/ResourceCollectionContentView.js:
(WI.ResourceCollectionContentView):
Require that subclasses of Collection override `get displayName` if the CollectionContentView
is not provided with a `contentPlaceholderText`.

(WI.CollectionContentView.prototype.initialLayout):
We don't need to create and add ContentView for each item of the Collection, as this is
already done by attached().

(WI.CollectionContentView.prototype._showContentPlaceholder):
Remove the 250ms delay before showing the placeholder TitleView.

* UserInterface/Views/FolderizedTreeElement.js:
(WI.FolderizedTreeElement.prototype._settingsForRepresentedObject):

LayoutTests:

* inspector/unit-tests/collection-expected.txt:
* inspector/unit-tests/collection.html:

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

3 years agoMove html to unified sources
keith_miller@apple.com [Wed, 25 Oct 2017 23:47:26 +0000 (23:47 +0000)]
Move html to unified sources
https://bugs.webkit.org/show_bug.cgi?id=178709

Reviewed by Alex Christensen.

* CMakeLists.txt:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:

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

3 years ago[Curl] Delete temporally downloaded file when it cancelled
commit-queue@webkit.org [Wed, 25 Oct 2017 23:39:09 +0000 (23:39 +0000)]
[Curl] Delete temporally downloaded file when it cancelled
https://bugs.webkit.org/show_bug.cgi?id=134393

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

* platform/network/curl/CurlRequest.cpp:
(WebCore::CurlRequest::didCancelTransfer):
(WebCore::CurlRequest::writeDataToDownloadFileIfEnabled):
(WebCore::CurlRequest::closeDownloadFile):
(WebCore::CurlRequest::cleanupDownloadFile):
* platform/network/curl/CurlRequest.h:

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

3 years agoAdd service worker handle fetch support for all subresource requests
commit-queue@webkit.org [Wed, 25 Oct 2017 23:32:49 +0000 (23:32 +0000)]
Add service worker handle fetch support for all subresource requests
https://bugs.webkit.org/show_bug.cgi?id=178769

Patch by Youenn Fablet <youenn@apple.com> on 2017-10-25
Reviewed by Chris Dumez.

Source/WebCore:

Test: http/tests/workers/service/image-fetch.https.html

Moving DocumentThreadableLoader logic to CachedResourceLoader to apply it for all resource loads.
Setting the selected service worker identifier for subresource only at the moment.

Testing is limited to images, future wpt tests should cover other subresource cases.

* loader/DocumentThreadableLoader.cpp:
(WebCore::DocumentThreadableLoader::DocumentThreadableLoader):
* loader/cache/CachedResourceLoader.cpp:
(WebCore::CachedResourceLoader::prepareFetch):
* loader/cache/CachedResourceRequest.cpp:
(WebCore::CachedResourceRequest::setSelectedServiceWorkerIdentifierIfNeeded):
* loader/cache/CachedResourceRequest.h:

LayoutTests:

* http/tests/workers/service/image-fetch.https-expected.txt: Added.
* http/tests/workers/service/image-fetch.https.html: Added.
* http/tests/workers/service/resources/image-fetch-worker.js: Added.
(event.event.request.url.indexOf):
(event.event.request.url.endsWith):
* http/tests/workers/service/resources/image-fetch.js: Added.
(done):
(async.loadedImage):
(async.erroredImage):
(async.logStatus):
(async.test):

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

3 years agoNetwork process crash under WebKit::AuthenticationManager::rejectProtectionSpaceAndCo...
pvollan@apple.com [Wed, 25 Oct 2017 23:24:15 +0000 (23:24 +0000)]
Network process crash under WebKit::AuthenticationManager::rejectProtectionSpaceAndContinueForSingleChallenge.
https://bugs.webkit.org/show_bug.cgi?id=160234
rdar://problem/30675510

Reviewed by Geoffrey Garen.

An exception is raised because we call the method rejectProtectionSpaceAndContinueWithChallenge on the CFNetwork
challenge sender, which does not implement this optional method. The methods on the authentication challenge
sender are deprecated when network session is used, so we should not call them in that case.

* Shared/Authentication/AuthenticationManager.cpp:
(WebKit::AuthenticationManager::useCredentialForSingleChallenge):
(WebKit::AuthenticationManager::continueWithoutCredentialForSingleChallenge):
(WebKit::AuthenticationManager::cancelSingleChallenge):
(WebKit::AuthenticationManager::performDefaultHandlingForSingleChallenge):
(WebKit::AuthenticationManager::rejectProtectionSpaceAndContinueForSingleChallenge):
* Shared/Authentication/cocoa/AuthenticationManagerCocoa.mm:
(WebKit::AuthenticationManager::receivedCredential):
(WebKit::AuthenticationManager::receivedRequestToContinueWithoutCredential):
(WebKit::AuthenticationManager::receivedCancellation):
(WebKit::AuthenticationManager::receivedRequestToPerformDefaultHandling):
(WebKit::AuthenticationManager::receivedChallengeRejection):
* Shared/Authentication/soup/AuthenticationManagerSoup.cpp:

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

3 years agoAliasing of text in CSS specs is blocky and ugly
simon.fraser@apple.com [Wed, 25 Oct 2017 23:21:38 +0000 (23:21 +0000)]
Aliasing of text in CSS specs is blocky and ugly
https://bugs.webkit.org/show_bug.cgi?id=174946
Source/WebCore:

rdar://problem/33594542

Reviewed by Dean Jackson.

The PaintedContentRequest relating to subpixel-antialiased text was failing to be
satisfied if the text content in a composited layer was nested inside descendant
RenderLayers, because RenderLayer::isVisuallyNonEmpty() returned early. If this
function is passed a request, we can't return until we've satisfied the request
(which triggers the checking of descendant layers).

Test: compositing/contents-format/subpixel-antialiased-nested-layer.html

* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::calculateClipRects const):

LayoutTests:

Reviewed by Dean Jackson.

* compositing/contents-format/subpixel-antialiased-nested-layer-expected.txt: Added.
* compositing/contents-format/subpixel-antialiased-nested-layer.html: Added.

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

3 years agoWeb Inspector: Canvas Tab: clicking on a canvas card causes details sidebar to show...
webkit@devinrousso.com [Wed, 25 Oct 2017 23:13:19 +0000 (23:13 +0000)]
Web Inspector: Canvas Tab: clicking on a canvas card causes details sidebar to show and mess up card arrangement
https://bugs.webkit.org/show_bug.cgi?id=178803
<rdar://problem/35176082>

Reviewed by Brian Burg.

* Localizations/en.lproj/localizedStrings.js:
* UserInterface/Views/CanvasDetailsSidebarPanel.css:
(.sidebar > .panel.details.canvas > .content > .empty-content-placeholder):
(.sidebar > .panel.details.canvas > .content > .empty-content-placeholder > .message):
* UserInterface/Views/CanvasDetailsSidebarPanel.js:
(WI.CanvasDetailsSidebarPanel):
(WI.CanvasDetailsSidebarPanel.prototype.inspect):
(WI.CanvasDetailsSidebarPanel.prototype.initialLayout):
(WI.CanvasDetailsSidebarPanel.prototype.layout):

* UserInterface/Views/RecordingNavigationSidebarPanel.js:
(WI.RecordingNavigationSidebarPanel.disallowInstanceForClass): Deleted.
* UserInterface/Views/RecordingStateDetailsSidebarPanel.js:
(WI.RecordingStateDetailsSidebarPanel.disallowInstanceForClass): Deleted.
* UserInterface/Views/RecordingTraceDetailsSidebarPanel.js:
(WI.RecordingTraceDetailsSidebarPanel.disallowInstanceForClass): Deleted.
Drive-by: these sidebar panels are now only used by the Canvas tab, so we no longer need to
provide support for multiple instances of them.

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

3 years agoMove DNS resolution outside of NetworkRTCProvider
commit-queue@webkit.org [Wed, 25 Oct 2017 22:27:06 +0000 (22:27 +0000)]
Move DNS resolution outside of NetworkRTCProvider
https://bugs.webkit.org/show_bug.cgi?id=178796

Patch by Youenn Fablet <youenn@apple.com> on 2017-10-25
Reviewed by Geoffrey Garen.

       Tested through manual testing on external STUN servers.
       Moving NetworkRTCProvider::Resolver into NetworkRTCResolver.
       Updating the implementation to use a completion handler.

* NetworkProcess/webrtc/NetworkRTCProvider.cpp:
(WebKit::NetworkRTCProvider::createResolver):
* NetworkProcess/webrtc/NetworkRTCProvider.h:
* NetworkProcess/webrtc/NetworkRTCResolver.cpp:
(WebKit::NetworkRTCResolver::NetworkRTCResolver):
(WebKit::NetworkRTCResolver::~NetworkRTCResolver):
(WebKit::NetworkRTCResolver::start):
(WebKit::NetworkRTCResolver::stop):
(WebKit::NetworkRTCResolver::completed):
(WebKit::NetworkRTCProvider::Resolver::~Resolver): Deleted.
(WebKit::NetworkRTCProvider::stop): Deleted.
(WebKit::NetworkRTCProvider::resolutionCompleted): Deleted.
* NetworkProcess/webrtc/NetworkRTCResolver.h:
* WebKit.xcodeproj/project.pbxproj:

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

3 years agoUnreviewed, rolling out r223691 and r223729.
commit-queue@webkit.org [Wed, 25 Oct 2017 22:15:39 +0000 (22:15 +0000)]
Unreviewed, rolling out r223691 and r223729.
https://bugs.webkit.org/show_bug.cgi?id=178834

Broke Speedometer 2 React-Redux-TodoMVC test case (Requested
by rniwa on #webkit).

Reverted changesets:

"Turn recursive tail calls into loops"
https://bugs.webkit.org/show_bug.cgi?id=176601
https://trac.webkit.org/changeset/223691

"REGRESSION(r223691): DFGByteCodeParser.cpp:1483:83: warning:
comparison is always false due to limited range of data type
[-Wtype-limits]"
https://bugs.webkit.org/show_bug.cgi?id=178543
https://trac.webkit.org/changeset/223729

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

3 years ago[MediaStream] Clear cached gUM prompt state
eric.carlson@apple.com [Wed, 25 Oct 2017 22:15:05 +0000 (22:15 +0000)]
[MediaStream] Clear cached gUM prompt state
https://bugs.webkit.org/show_bug.cgi?id=178754
<rdar://problem/32742356>

Reviewed by Youenn Fablet.

Source/WebKit:

* Shared/WebPreferences.yaml: Define new settings.

* Shared/WebPreferencesDefinitionsBase.h: New default values.

* UIProcess/API/C/WKPreferences.cpp:
(WKPreferencesSetInactiveMediaCaptureSteamRepromptIntervalInMinutes): New.
(WKPreferencesGetInactiveMediaCaptureSteamRepromptIntervalInMinutes): Ditto.
* UIProcess/API/C/WKPreferencesRefPrivate.h:

* UIProcess/API/Cocoa/WKPreferences.mm:
(-[WKPreferences _inactiveMediaCaptureSteamRepromptIntervalInMinutes]): Ditto.
(-[WKPreferences _setInactiveMediaCaptureSteamRepromptIntervalInMinutes:]): Ditto.
* UIProcess/API/Cocoa/WKPreferencesPrivate.h:

* UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
(WebKit::UserMediaPermissionRequestManagerProxy::UserMediaPermissionRequestManagerProxy): Initialize
the timer.
(WebKit::UserMediaPermissionRequestManagerProxy::createRequest): Remove unneeded namespace.
(WebKit::toWebCore): Remove unneeded breaks.
(WebKit::UserMediaPermissionRequestManagerProxy::searchForGrantedRequest const): Remove unneeded namespace.
(WebKit::UserMediaPermissionRequestManagerProxy::wasRequestDenied): Ditto.
(WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame): Ditto.
(WebKit::UserMediaPermissionRequestManagerProxy::getUserMediaPermissionInfo): Ditto.
(WebKit::UserMediaPermissionRequestManagerProxy::enumerateMediaDevicesForFrame): Ditto.
(WebKit::UserMediaPermissionRequestManagerProxy::syncWithWebCorePrefs const): Ditto.
(WebKit::UserMediaPermissionRequestManagerProxy::captureStateChanged): Set the watchdog timer
to the correct interval based on capture state.
(WebKit::UserMediaPermissionRequestManagerProxy::watchdogTimerFired): Clear cached state.
* UIProcess/UserMediaPermissionRequestManagerProxy.h:

Tools:

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: Add new test

* TestWebKitAPI/Tests/WebKit/GetUserMediaReprompt.mm: Added.
(-[GetUserMediaRepromptUIDelegate _webView:requestUserMediaAuthorizationForDevices:url:mainFrameURL:decisionHandler:]):
(-[GetUserMediaRepromptUIDelegate _webView:checkUserMediaPermissionForURL:mainFrameURL:frameIdentifier:decisionHandler:]):
(TestWebKitAPI::TEST):

* TestWebKitAPI/Tests/WebKit/getUserMedia.html:

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

3 years agoAdd committer status for Ross Kirsling
ross.kirsling@sony.com [Wed, 25 Oct 2017 22:06:51 +0000 (22:06 +0000)]
Add committer status for Ross Kirsling
https://bugs.webkit.org/show_bug.cgi?id=178832

Unreviewed.

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

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

3 years agoUnreviewed, add missing copyright header to ServiceWorkerClientType.idl.
cdumez@apple.com [Wed, 25 Oct 2017 21:47:13 +0000 (21:47 +0000)]
Unreviewed, add missing copyright header to ServiceWorkerClientType.idl.

* workers/service/ServiceWorkerClientType.idl:

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

3 years agoMake toJS() do the right thing for ServiceWorkerClient
cdumez@apple.com [Wed, 25 Oct 2017 21:36:39 +0000 (21:36 +0000)]
Make toJS() do the right thing for ServiceWorkerClient
https://bugs.webkit.org/show_bug.cgi?id=178816

Reviewed by Youenn Fablet.

Make toJS() do the right thing for ServiceWorkerClient. In particular,
it needs to construct a JSServiceWorkerWindowClient wrapper if the
implementation object is a ServiceWorkerWindowClient.

Also, ServiceWorkerClient does not need to be an ActiveDOMObject as
it does not have any long-running tasks. Make it a ContextDestructionObject
instead for now.

* CMakeLists.txt:
* DerivedSources.make:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* workers/service/ServiceWorkerClient.cpp:
(WebCore::ServiceWorkerClient::postMessage):
* workers/service/ServiceWorkerClient.h:
(WebCore::ServiceWorkerClient::create):
* workers/service/ServiceWorkerClient.idl:
* workers/service/ServiceWorkerClientType.h: Copied from Source/WebCore/workers/service/ServiceWorkerClient.idl.
* workers/service/ServiceWorkerClientType.idl: Added.
* workers/service/ServiceWorkerClients.h:
* workers/service/ServiceWorkerClients.idl:

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

3 years agoWhen navigating back to a page, compositing layers may not use accelerated drawing
simon.fraser@apple.com [Wed, 25 Oct 2017 21:32:08 +0000 (21:32 +0000)]
When navigating back to a page, compositing layers may not use accelerated drawing
https://bugs.webkit.org/show_bug.cgi?id=178749
rdar://problem/35158946

Reviewed by Dean Jackson.
Source/WebCore:

There were two issues with setting GraphicsLayerCA's "acceleratesDrawing" state which
occurred on back navigation, related to the ordering of style recalcs and layout.

First, at style recalc time, we created a RenderLayerCompositor but hadn't yet called
its cacheAcceleratedCompositingFlags(), so any layers created during style update
didn't get accelerated drawing. Fix by making cacheAcceleratedCompositingFlags() internal
to RenderLayerCompositor and calling it from willRecalcStyle() and updateCompositingLayers().

Secondly, GraphicsLayerCA::commitLayerChangesBeforeSublayers() needs to updateAcceleratesDrawing()
before updating tiles, so that new tiles fetch the right acceleratesDrawing state from
the TileController.

Test: compositing/accelerated-layers-after-back.html

* page/FrameView.cpp:
(WebCore::FrameView::updateCompositingLayersAfterLayout):
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::commitLayerChangesBeforeSublayers):
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::willRecalcStyle):
(WebCore::RenderLayerCompositor::didRecalcStyleWithNoPendingLayout):
(WebCore::RenderLayerCompositor::updateCompositingLayers):
* rendering/RenderLayerCompositor.h:

Source/WebKit:

Avoid assertions when a test enables accelerated drawing (which we can't support
in the iOS simulator).

* Shared/RemoteLayerTree/RemoteLayerBackingStore.mm:
(WebKit::RemoteLayerBackingStore::ensureBackingStore):

Tools:

Fix WTR and DRT to parse "useAcceleratedDrawing" out of "webkit-test-runner" options
and use it to set the state of the web view.

* DumpRenderTree/TestOptions.h:
* DumpRenderTree/TestOptions.mm:
(TestOptions::TestOptions):
* DumpRenderTree/mac/DumpRenderTree.mm:
(setWebPreferencesForTestOptions):
* WebKitTestRunner/TestController.cpp:
(WTR::TestController::resetPreferencesToConsistentValues):
(WTR::updateTestOptionsFromTestHeader):
* WebKitTestRunner/TestOptions.h:
(WTR::TestOptions::hasSameInitializationOptions const):

LayoutTests:

Moved iframes/resources/page-cache-helper.html up to compositing/resources/go-back.html.

* compositing/accelerated-layers-after-back-expected.txt: Added.
* compositing/accelerated-layers-after-back.html: Added.
* compositing/iframes/page-cache-layer-tree.html:
* compositing/page-cache-back-crash.html:
* compositing/resources/go-back.html: Renamed from LayoutTests/compositing/iframes/resources/page-cache-helper.html.
* platform/ios/compositing/accelerated-layers-after-back-expected.txt: Added.

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

3 years agoWeb Inspector: Display fetch() initiated loads as "fetch" instead of "xhr" in the...
commit-queue@webkit.org [Wed, 25 Oct 2017 21:30:16 +0000 (21:30 +0000)]
Web Inspector: Display fetch() initiated loads as "fetch" instead of "xhr" in the Network Tab
https://bugs.webkit.org/show_bug.cgi?id=178826

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2017-10-25
Reviewed by Youenn Fablet.

* UserInterface/Views/NetworkTableContentView.js:
(WI.NetworkTableContentView.shortDisplayNameForResourceType):
Fetch and XHR loads are still grouped under the succinct "XHR" filter, but
at least display the better type name in the "Type" column of the table.

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

3 years agoLayoutTest http/tests/loading/basic-credentials-sent-automatically.html is flaky
achristensen@apple.com [Wed, 25 Oct 2017 21:19:19 +0000 (21:19 +0000)]
LayoutTest http/tests/loading/basic-credentials-sent-automatically.html is flaky
https://bugs.webkit.org/show_bug.cgi?id=159427

Reviewed by Youenn Fablet.

Use setTimeout to make load delegate callback printing more deterministic.
The important part is that the credentials are printed, and they still are.

* http/tests/loading/basic-credentials-sent-automatically-expected.txt:
* http/tests/loading/basic-credentials-sent-automatically.html:
* platform/mac/TestExpectations:
* platform/wk2/http/tests/loading/basic-credentials-sent-automatically-expected.txt:

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

3 years agoEnable ServiceWorker to fetch resources
commit-queue@webkit.org [Wed, 25 Oct 2017 21:17:46 +0000 (21:17 +0000)]
Enable ServiceWorker to fetch resources
https://bugs.webkit.org/show_bug.cgi?id=178673

Patch by Youenn Fablet <youenn@apple.com> on 2017-10-25
Reviewed by Brady Eidson.

Source/WebCore:

Test: http/tests/workers/service/service-worker-fetch.html

Allow reusing of EmptyFrameLoaderClient for network loading in WebKit Service Worker environment.
Allow overriding the creation of a document loader, pageID, frameID and sessionID getters.

Allow the possibility to create synthetic documents for all ports.

Beefing up ServiceWorkerThreadProxy as it owns a Document and a Page that do nothing but server
the purpose of loading resources for a service worker thread.

* WebCore.xcodeproj/project.pbxproj:
* loader/DocumentLoader.h:
(WebCore::DocumentLoader::setResponse):
* loader/EmptyClients.cpp:
(WebCore::EmptyFrameLoaderClient::sessionID const):
(WebCore::EmptyFrameLoaderClient::createNetworkingContext):
(WebCore::createEmptyFrameNetworkingContext):
* loader/EmptyClients.h:
* loader/EmptyFrameLoaderClient.h: Added.
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::initForSynthesizedDocument):
* loader/FrameLoader.h:
* loader/FrameLoaderClient.h:
* workers/service/context/ServiceWorkerThread.cpp:
(WebCore::ServiceWorkerThread::ServiceWorkerThread):
(WebCore::m_workerObjectProxy):
* workers/service/context/ServiceWorkerThread.h:
* workers/service/context/ServiceWorkerThreadProxy.cpp:
(WebCore::ServiceWorkerThreadProxy::create):
(WebCore::createPageForServiceWorker):
(WebCore::ServiceWorkerThreadProxy::ServiceWorkerThreadProxy):
(WebCore::ServiceWorkerThreadProxy::postTaskToLoader):
* workers/service/context/ServiceWorkerThreadProxy.h:
Test: http/tests/workers/service/service-worker-fetch.html

Source/WebKit:

ServiceWorkerContextManager makes use of the new ServiceWorkerThreadProxy.
It creates the necessary environment for the thread to make use of network loads, web sockets and cache storage.
Fetch is functional with these changes.

ServiceWorkerProcessProxy is introduced as a UIProcess proxy to the service worker process.
This process proxy is responsible to give the pageID used by all service worker thread instances for network loads.
ServiceWorkerContextManager is responsible to give a unique frameID for all service worker threads.
This is necessary as these two ids are currently needed for any network load.

ServiceWorkerThreadProxy creates its own FrameLoaderClient which is now used to get pageID, frameID and sessionID.

* UIProcess/ServiceWorkerProcessProxy.cpp: Added.
(WebKit::ServiceWorkerProcessProxy::ServiceWorkerProcessProxy):
(WebKit::m_serviceWorkerPageID):
(WebKit::ServiceWorkerProcessProxy::~ServiceWorkerProcessProxy):
(WebKit::ServiceWorkerProcessProxy::start):
* UIProcess/ServiceWorkerProcessProxy.h: Added.
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::getWorkerContextProcessConnection):
(WebKit::WebProcessPool::createNewWebProcess):
(WebKit::WebProcessPool::initializeNewWebProcess):
(WebKit::WebProcessPool::disconnectProcess):
(WebKit::WebProcessPool::createNewWebProcessRespectingProcessCountLimit):
(WebKit::WebProcessPool::createWebPage):
* UIProcess/WebProcessPool.h:
* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::generatePageID):
* UIProcess/WebProcessProxy.h:
* WebKit.xcodeproj/project.pbxproj:
* WebProcess/Network/WebLoaderStrategy.cpp:
(WebKit::WebLoaderStrategy::scheduleLoad):
(WebKit::WebLoaderStrategy::scheduleLoadFromNetworkProcess):
(WebKit::WebLoaderStrategy::startPingLoad):
* WebProcess/Network/WebLoaderStrategy.h:
* WebProcess/Storage/ServiceWorkerContextManager.cpp:
(WebKit::ServiceWorkerContextManager::ServiceWorkerContextManager):
(WebKit::ServiceWorkerContextManager::startServiceWorker):
(WebKit::ServiceWorkerContextManager::startFetch):
* WebProcess/Storage/ServiceWorkerContextManager.h:
* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::pageID const):
(WebKit::WebFrameLoaderClient::frameID const):
(WebKit::WebFrameLoaderClient::sessionID const):
* WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::getWorkerContextConnection):
* WebProcess/WebProcess.h:
* WebProcess/WebProcess.messages.in:

Source/WebKitLegacy/mac:

* WebCoreSupport/WebFrameLoaderClient.mm:
(WebFrameLoaderClient::pageID const):
(WebFrameLoaderClient::frameID const):
(WebFrameLoaderClient::sessionID const):

Added implementation to the new getters.
They are noop in the context of WK1.

Source/WebKitLegacy/win:

Added implementation to the new getters.
They are noop in the context of WK1.

* WebCoreSupport/WebFrameLoaderClient.cpp:
(WebFrameLoaderClient::pageID const):
(WebFrameLoaderClient::frameID const):
(WebFrameLoaderClient::sessionID const):
* WebCoreSupport/WebFrameLoaderClient.h:

LayoutTests:

* http/tests/workers/service/resources/service-worker-fetch-worker.js: Added.
* http/tests/workers/service/resources/service-worker-fetch.js: Added.
* http/tests/workers/service/service-worker-fetch-expected.txt: Added.
* http/tests/workers/service/service-worker-fetch.html: Added.

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

3 years agoREGRESSION(r223937): Use of -fobjc-weak causes build failures with older compilers
msaboff@apple.com [Wed, 25 Oct 2017 21:12:38 +0000 (21:12 +0000)]
REGRESSION(r223937): Use of -fobjc-weak causes build failures with older compilers
https://bugs.webkit.org/show_bug.cgi?id=178825

Reviewed by Mark Lam.

Enable ARC for ARM64_32.  This eliminate the need for setting CLANG_ENABLE_OBJC_WEAK.

* Configurations/ToolExecutable.xcconfig:

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

3 years agoWeb Inspector: Canvas Tab: selected canvas card loses selection outline style while...
webkit@devinrousso.com [Wed, 25 Oct 2017 21:12:00 +0000 (21:12 +0000)]
Web Inspector: Canvas Tab: selected canvas card loses selection outline style while recording
https://bugs.webkit.org/show_bug.cgi?id=178814
<rdar://problem/35177317>

Reviewed by Brian Burg.

* UserInterface/Views/CanvasOverviewContentView.css:
(.content-view.canvas-overview .content-view.canvas):
(.content-view.canvas-overview .content-view.canvas > :matches(header, .preview, footer)):
(.content-view.canvas-overview .content-view.canvas.selected > :matches(.preview, footer),):
(.content-view.canvas-overview .content-view.canvas > header):
(.content-view.canvas-overview .content-view.canvas.is-recording > header):
(.content-view.canvas-overview .content-view.canvas > .preview):
(.content-view.canvas-overview .content-view.canvas > footer):
(.content-view.canvas-overview .content-view.canvas.selected:not(.is-recording)): Deleted.
Instead of applying the border to the entire element, apply parts of the border to each of
its children so that we can choose what colors to use for each part.

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

3 years agoWeb Inspector: [PARITY] Styles Redesign: Add color gradient, bezier curve, and spring...
nvasilyev@apple.com [Wed, 25 Oct 2017 21:09:45 +0000 (21:09 +0000)]
Web Inspector: [PARITY] Styles Redesign: Add color gradient, bezier curve, and spring inline widgets
https://bugs.webkit.org/show_bug.cgi?id=178404
<rdar://problem/35035992>

Reviewed by Devin Rousso.

Add inline widgets for the following CSS values:
- Gradients, e.g. `background-image: linear-gradient(yellow, orange)`
- Bezier curves, e.g. `transition-timing-function: cubic-bezier(0.68, -0.55, 0.265, 1.55)`
- Spring functions, e.g. `transition-timing-function: spring(1, 2, 2, 4)`

* UserInterface/Models/Color.js:
(WI.Color.prototype.toString):
Don't throw. The are never try/catch blocks on the callsites.

* UserInterface/Views/SpreadsheetStyleProperty.js:
(WI.SpreadsheetStyleProperty.prototype._renderValue):
(WI.SpreadsheetStyleProperty.prototype._createInlineSwatch):
(WI.SpreadsheetStyleProperty.prototype._addGradientTokens):
(WI.SpreadsheetStyleProperty.prototype._addColorTokens):
(WI.SpreadsheetStyleProperty.prototype._addTimingFunctionTokens):

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

3 years agoVersioning.
jmarcell@apple.com [Wed, 25 Oct 2017 20:44:29 +0000 (20:44 +0000)]
Versioning.

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

3 years agoFix a bug in syncing script that test/build syncer is never set.
dewei_zhu@apple.com [Wed, 25 Oct 2017 19:48:57 +0000 (19:48 +0000)]
Fix a bug in syncing script that test/build syncer is never set.
https://bugs.webkit.org/show_bug.cgi?id=178772

Reviewed by Ryosuke Niwa.

Neither 'buildSyncer' nor 'testSyncer' is ever set.
Added a unit test to cover this case.

* server-tests/tools-sync-buildbot-integration-tests.js:
(createTriggerable): Refactor it to allow customized name.
* tools/js/buildbot-triggerable.js:
(BuildbotTriggerable.prototype._pullBuildbotOnAllSyncers): Update syncer info accordingly.
(BuildbotTriggerable._testGroupMapForBuildRequests): Initialize build and test syncer to null.

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

3 years agoUNPACK_FLIP_Y is broken for MSE-backed videos
jer.noble@apple.com [Wed, 25 Oct 2017 19:42:16 +0000 (19:42 +0000)]
UNPACK_FLIP_Y is broken for MSE-backed videos
https://bugs.webkit.org/show_bug.cgi?id=178774

Reviewed by Dean Jackson.

Source/WebCore:

The global GLSL variable gl_Position can apparently only be set once, and any modifications
made after that initial set are ignored. So rather than implement flipping by changing
gl_Position.y, flip the texture coordinates instead.

Drive-by fix: some of the constants used in VideoTextureCopierCV are not defined on older
macOS versions, so make them optional.

Tests: fast/canvas/webgl/texImage2D-mse-flipY-false.html
       fast/canvas/webgl/texImage2D-mse-flipY-true.html

* platform/graphics/cv/VideoTextureCopierCV.cpp:
(WebCore::transferFunctionFromString):
(WebCore::VideoTextureCopierCV::initializeUVContextObjects):
* platform/cocoa/CoreVideoSoftLink.cpp:
* platform/cocoa/CoreVideoSoftLink.h:

LayoutTests:

* fast/canvas/webgl/resources/orientation-flipped-fragmented.mp4: Added.
* fast/canvas/webgl/resources/orientation-normal-fragmented.mp4: Added.
* fast/canvas/webgl/texImage2D-mse-flipY-false-expected.txt: Added.
* fast/canvas/webgl/texImage2D-mse-flipY-false.html: Added.
* fast/canvas/webgl/texImage2D-mse-flipY-true-expected.txt: Added.
* fast/canvas/webgl/texImage2D-mse-flipY-true.html: Added.
* platform/ios/TestExpectations:

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

3 years ago[Service Worker] Add stubs for serviceWorkerClient.type
cdumez@apple.com [Wed, 25 Oct 2017 19:36:08 +0000 (19:36 +0000)]
[Service Worker] Add stubs for serviceWorkerClient.type
https://bugs.webkit.org/show_bug.cgi?id=178812

Reviewed by Youenn Fablet.

Add stubs for serviceWorkerClient.type to match the latest specification:
- https://w3c.github.io/ServiceWorker/#enumdef-clienttype

* CMakeLists.txt:
* DerivedSources.make:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* workers/service/ServiceWorkerClient.cpp:
(WebCore::ServiceWorkerClient::type const):
* workers/service/ServiceWorkerClient.h:
* workers/service/ServiceWorkerClient.idl:
* workers/service/ServiceWorkerClientType.h: Added.
* workers/service/ServiceWorkerClientType.idl: Added.
* workers/service/ServiceWorkerClients.h:
* workers/service/ServiceWorkerClients.idl:

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

3 years agoMove mathml and page to unified souces
keith_miller@apple.com [Wed, 25 Oct 2017 19:27:05 +0000 (19:27 +0000)]
Move mathml and page to unified souces
https://bugs.webkit.org/show_bug.cgi?id=178770

Rubber-stamped by Tim Horton.

* CMakeLists.txt:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:

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

3 years agoFix implicit cast of enum, which seems to break the windows build of unified sources.
keith_miller@apple.com [Wed, 25 Oct 2017 19:06:42 +0000 (19:06 +0000)]
Fix implicit cast of enum, which seems to break the windows build of unified sources.
https://bugs.webkit.org/show_bug.cgi?id=178822

Reviewed by Saam Barati.

* bytecode/DFGExitProfile.h:
(JSC::DFG::FrequentExitSite::hash const):

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

3 years agoWeb Inspector: Styles Redesign: Newly added invalid property isn't immediately shown...
nvasilyev@apple.com [Wed, 25 Oct 2017 19:02:28 +0000 (19:02 +0000)]
Web Inspector: Styles Redesign: Newly added invalid property isn't immediately shown as invalid
https://bugs.webkit.org/show_bug.cgi?id=178488

Reviewed by Brian Burg.

* UserInterface/Models/CSSStyleDeclaration.js:
(WI.CSSStyleDeclaration.prototype.newBlankProperty):
Call this.update to update _properties, _allProperties, _visibleProperties, and _allVisibleProperties.

* UserInterface/Views/SpreadsheetCSSStyleDeclarationEditor.css:
(.spreadsheet-style-declaration-editor .property:matches(.invalid-name, .other-vendor, .overridden):not(.disabled)):
(.spreadsheet-style-declaration-editor .property.invalid-name:not(.disabled)):
(.spreadsheet-style-declaration-editor .property.invalid-value:not(.disabled) .value):
When the property name is valid, but the value isn't, display red line-through only for the value.
This is how it works in the old styles sidebar as well.

* UserInterface/Views/SpreadsheetCSSStyleDeclarationEditor.js:
(WI.SpreadsheetCSSStyleDeclarationEditor.prototype._propertiesChanged):
(WI.SpreadsheetCSSStyleDeclarationEditor):
* UserInterface/Views/SpreadsheetStyleProperty.js:
(WI.SpreadsheetStyleProperty):
(WI.SpreadsheetStyleProperty.prototype.updateClassNames):
(WI.SpreadsheetStyleProperty.prototype._update):
Introduce updateClassNames method. Unlike _update, it doesn't change text selection or focus and
can be safely called on a property while it's being edited.

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

3 years agofast/images/animated-gif-paint-after-animation.html flaky crash
commit-queue@webkit.org [Wed, 25 Oct 2017 18:54:58 +0000 (18:54 +0000)]
fast/images/animated-gif-paint-after-animation.html flaky crash
https://bugs.webkit.org/show_bug.cgi?id=178510

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

ScalableImageDecoder was accessed from the main thread and the
image decoding thread without a mutex.

No new tests because there is no behavior change.

* platform/image-decoders/ScalableImageDecoder.h: Add m_mutex. Lock the mutex in setData.
* platform/image-decoders/ScalableImageDecoder.cpp:
(WebCore::ScalableImageDecoder::frameIsCompleteAtIndex const): Lock the mutex.
(WebCore::ScalableImageDecoder::frameHasAlphaAtIndex const): Ditto.
(WebCore::ScalableImageDecoder::frameBytesAtIndex const): Ditto.
(WebCore::ScalableImageDecoder::frameDurationAtIndex const): Ditto.
(WebCore::ScalableImageDecoder::createFrameImageAtIndex): Ditto.

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

3 years agoMark http/tests/loading/basic-credentials-sent-automatically.html as flaky.
ryanhaddad@apple.com [Wed, 25 Oct 2017 18:42:11 +0000 (18:42 +0000)]
Mark http/tests/loading/basic-credentials-sent-automatically.html as flaky.
https://bugs.webkit.org/show_bug.cgi?id=159427

Unreviewed test gardening.

* platform/mac/TestExpectations:

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

3 years ago[WinCairo] Add WebKit platform files for wincairo webkit
commit-queue@webkit.org [Wed, 25 Oct 2017 18:38:48 +0000 (18:38 +0000)]
[WinCairo] Add WebKit platform files for wincairo webkit
https://bugs.webkit.org/show_bug.cgi?id=178000

Patch by Yousuke Kimoto <yousuke.kimoto@sony.com> on 2017-10-25
Reviewed by Alex Christensen.

* Platform/Module.h:
* Platform/SharedMemory.h:
(WebKit::SharedMemory::handle const):
* Platform/win/LoggingWin.cpp: Added. It is based on Source/WebCore/platform/win/LoggingWin.cpp
(WebKit::logLevelString):
* Platform/win/ModuleWin.cpp: Added.
(WebKit::Module::load):
(WebKit::Module::unload):
(WebKit::Module::platformFunctionPointer const):
* Platform/win/SharedMemoryWin.cpp: Added.
(WebKit::SharedMemory::Handle::Handle):
(WebKit::SharedMemory::Handle::~Handle):
(WebKit::SharedMemory::Handle::isNull const):
(WebKit::SharedMemory::Handle::encode const):
(WebKit::SharedMemory::Handle::clear):
(WebKit::getDuplicatedHandle):
(WebKit::SharedMemory::Handle::decode):
(WebKit::protectAttribute):
(WebKit::SharedMemory::allocate):
(WebKit::SharedMemory::create):
(WebKit::accessRights):
(WebKit::SharedMemory::map):
(WebKit::SharedMemory::adopt):
(WebKit::SharedMemory::~SharedMemory):
(WebKit::SharedMemory::createHandle):
(WebKit::SharedMemory::systemPageSize):
* PlatformWin.cmake:

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

3 years agoUnreviewed, rolling out r222945.
commit-queue@webkit.org [Wed, 25 Oct 2017 18:32:46 +0000 (18:32 +0000)]
Unreviewed, rolling out r222945.
https://bugs.webkit.org/show_bug.cgi?id=178818

"It made WasmBench crash" (Requested by saamyjoon on #webkit).

Reverted changeset:

"bmalloc mutex should be adaptive"
https://bugs.webkit.org/show_bug.cgi?id=177839
https://trac.webkit.org/changeset/222945

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

3 years agoAdd support for unregistering a service worker
cdumez@apple.com [Wed, 25 Oct 2017 18:28:54 +0000 (18:28 +0000)]
Add support for unregistering a service worker
https://bugs.webkit.org/show_bug.cgi?id=178735

Reviewed by Brady Eidson.

Source/WebCore:

Add support for unregistering a service worker:
- https://w3c.github.io/ServiceWorker/#navigator-service-worker-unregister

Test: http/tests/workers/service/basic-unregister.https.html

* workers/service/ServiceWorkerContainer.cpp:
(WebCore::ServiceWorkerContainer::addRegistration):
(WebCore::ServiceWorkerContainer::removeRegistration):
(WebCore::ServiceWorkerContainer::jobResolvedWithUnregistrationResult):
* workers/service/ServiceWorkerContainer.h:
* workers/service/ServiceWorkerJob.cpp:
(WebCore::ServiceWorkerJob::resolvedWithUnregistrationResult):
* workers/service/ServiceWorkerJob.h:
* workers/service/ServiceWorkerJobClient.h:
* workers/service/ServiceWorkerJobData.h:
(WebCore::ServiceWorkerJobData::encode const):
(WebCore::ServiceWorkerJobData::decode):
* workers/service/ServiceWorkerJobType.h:
* workers/service/ServiceWorkerRegistration.cpp:
(WebCore::containerForScriptExecutionContext):
(WebCore::ServiceWorkerRegistration::unregister):
* workers/service/server/SWClientConnection.cpp:
(WebCore::SWClientConnection::registrationJobResolvedInServer):
(WebCore::SWClientConnection::unregistrationJobResolvedInServer):
* workers/service/server/SWClientConnection.h:
* workers/service/server/SWServer.cpp:
(WebCore::SWServer::resolveRegistationJob):
(WebCore::SWServer::resolveUnregistrationJob):
* workers/service/server/SWServer.h:
* workers/service/server/SWServerRegistration.cpp:
(WebCore::SWServerRegistration::scriptContextStarted):
(WebCore::SWServerRegistration::startNextJob):
(WebCore::SWServerRegistration::runUnregisterJob):
(WebCore::SWServerRegistration::resolveWithRegistrationOnMainThread):
(WebCore::SWServerRegistration::resolveWithUnregistrationResultOnMainThread):
(WebCore::SWServerRegistration::resolveCurrentRegistrationJob):
(WebCore::SWServerRegistration::resolveCurrentUnregistrationJob):
* workers/service/server/SWServerRegistration.h:

Source/WebKit:

Add support for unregistering a service worker:
- https://w3c.github.io/ServiceWorker/#navigator-service-worker-unregister

* StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
(WebKit::WebSWServerConnection::resolveRegistrationJobInClient):
(WebKit::WebSWServerConnection::resolveUnregistrationJobInClient):
* StorageProcess/ServiceWorker/WebSWServerConnection.h:
* WebProcess/Storage/WebSWClientConnection.messages.in:

LayoutTests:

Add layout test coverage.

* http/tests/workers/service/basic-unregister.https-expected.txt: Added.
* http/tests/workers/service/basic-unregister.https.html: Added.
* http/tests/workers/service/resources/basic-unregister.js: Added.

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

3 years agoMediaSessionManager* needs to catch Obj-C exceptions
simon.fraser@apple.com [Wed, 25 Oct 2017 18:21:41 +0000 (18:21 +0000)]
MediaSessionManager* needs to catch Obj-C exceptions
https://bugs.webkit.org/show_bug.cgi?id=178813

Reviewed by Tim Horton.

Wrap all calls out to Objective-C with BEGIN_BLOCK_OBJC_EXCEPTIONS/END_BLOCK_OBJC_EXCEPTIONS.

* platform/audio/ios/MediaSessionManagerIOS.mm:
(WebCore::MediaSessionManageriOS::MediaSessionManageriOS):
(WebCore::MediaSessionManageriOS::~MediaSessionManageriOS):
(WebCore::MediaSessionManageriOS::hasWirelessTargetsAvailable):
(WebCore::MediaSessionManageriOS::configureWireLessTargetMonitoring):
(WebCore::MediaSessionManageriOS::updateNowPlayingInfo):
(WebCore::MediaSessionManageriOS::externalOutputDeviceAvailableDidChange):
(-[WebMediaSessionHelper allocateVolumeView]):
(-[WebMediaSessionHelper initWithCallback:]):
* platform/audio/mac/MediaSessionManagerMac.mm:
(WebCore::MediaSessionManagerMac::updateNowPlayingInfo):

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

3 years ago[Payment Request] Implement the "user aborts the payment request" algorithm
aestes@apple.com [Wed, 25 Oct 2017 18:00:28 +0000 (18:00 +0000)]
[Payment Request] Implement the "user aborts the payment request" algorithm
https://bugs.webkit.org/show_bug.cgi?id=178810

Reviewed by Tim Horton.

Source/WebCore:

* Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp:
(WebCore::ApplePayPaymentHandler::didCancelPaymentSession):
* Modules/applepay/paymentrequest/ApplePayPaymentHandler.h:
* Modules/paymentrequest/PaymentRequest.cpp:
(WebCore::PaymentRequest::cancel):
* Modules/paymentrequest/PaymentRequest.h:
* testing/MockPaymentCoordinator.cpp:
(WebCore::MockPaymentCoordinator::cancelPayment):
* testing/MockPaymentCoordinator.h:
* testing/MockPaymentCoordinator.idl:

LayoutTests:

* http/tests/paymentrequest/payment-request-show-method.https-expected.txt:
* http/tests/paymentrequest/payment-request-show-method.https.html:

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

3 years agoMark test262.yaml/test262/test/language/statements/try/tco-catch.js as passing.
ryanhaddad@apple.com [Wed, 25 Oct 2017 17:42:20 +0000 (17:42 +0000)]
Mark test262.yaml/test262/test/language/statements/try/tco-catch.js as passing.
https://bugs.webkit.org/show_bug.cgi?id=178592

Unreviewed test gardening.

* test262.yaml:

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

3 years agoAutoplay muted videos still stop playback of other streaming apps in the background
jer.noble@apple.com [Wed, 25 Oct 2017 17:39:47 +0000 (17:39 +0000)]
Autoplay muted videos still stop playback of other streaming apps in the background
https://bugs.webkit.org/show_bug.cgi?id=177920

Reviewed by Eric Carlson.

When creating a new <video> or <audio> element, the global AudioSession can sometimes have
its sessionCategory() set to "MediaPlayback", even if the element does not yet have a
source. This is because the constructor for the MediaElementSession is called before
m_isPlayingToWirelessTarget is initialized, and so in the MediaElementSession constructor,
the media element's m_isPlayingToWirelessTarget ivar is sometimes (uninitialized) true.

We could move the MediaElementSession ivar to the very end of the header, so it's
initialized last, but that still leaves the possibility of the MediaElementSession et. all
calling into the HTMLMediaElement before it's subclass's constructors have a chance to
initialize their own ivars (much less their vtables). So instead, we'll create and set the
MediaElementSession in a finishInitialization() method called from the HTMLVideoElement and
HTMLAudioElement's create() factory methods.

* html/HTMLAudioElement.cpp:
(WebCore::HTMLAudioElement::create):
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::HTMLMediaElement):
(WebCore::HTMLMediaElement::finishInitialization):
* html/HTMLMediaElement.h:
* html/HTMLVideoElement.cpp:
(WebCore::HTMLVideoElement::create):

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

3 years agoAttempt to fix flaky test fast/writing-mode/english-bt-text-with-spelling-marker...
dbates@webkit.org [Wed, 25 Oct 2017 17:27:24 +0000 (17:27 +0000)]
Attempt to fix flaky test fast/writing-mode/english-bt-text-with-spelling-marker.html following r223938
(https://bugs.webkit.org/show_bug.cgi?id=178759)

Call internals.updateEditorUINowIfScheduled() to force the editor UI to update and add spelling markers.

* fast/writing-mode/english-bt-text-with-spelling-marker-expected.html:
* fast/writing-mode/english-bt-text-with-spelling-marker.html:

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

3 years agoMake SharedStringHashTable less error prone
cdumez@apple.com [Wed, 25 Oct 2017 17:19:41 +0000 (17:19 +0000)]
Make SharedStringHashTable less error prone
https://bugs.webkit.org/show_bug.cgi?id=178764

Reviewed by Youenn Fablet.

SharedStringHashTable is backed by SharedMemory and this SharedMemory
may be readonly (and is when used in the WebContent process). As a result,
some of the operations on SharedStringHashTable that write to this shared
memory will crash if called and the SharedMemory is readonly.

To make this less error prone, introduce a new SharedStringHashTableReadOnly
base class for SharedStringHashTable and only keep the operations that
write to the shared memory on SharedStringHashTableReadOnly (namely, add() /
remove() / clear(). Update VisitedLinkTableController and WebSWOriginTable
to use SharedStringHashTableReadOnly since they are instantiated in the
WebContent process and use readonly shared memory.

* Shared/SharedStringHashTable.cpp:
(WebKit::SharedStringHashTableReadOnly::SharedStringHashTableReadOnly):
(WebKit::SharedStringHashTableReadOnly::~SharedStringHashTableReadOnly):
(WebKit::SharedStringHashTableReadOnly::setSharedMemory):
(WebKit::doubleHash):
(WebKit::SharedStringHashTableReadOnly::contains const):
(WebKit::SharedStringHashTableReadOnly::findSlot const):
(WebKit::SharedStringHashTable::SharedStringHashTable):
(WebKit::SharedStringHashTable::~SharedStringHashTable):
(WebKit::SharedStringHashTable::add):
(WebKit::SharedStringHashTable::remove):
(WebKit::SharedStringHashTable::clear):
* Shared/SharedStringHashTable.h:
* WebProcess/Storage/WebSWOriginTable.h:
* WebProcess/WebPage/VisitedLinkTableController.cpp:
(WebKit::VisitedLinkTableController::removeAllVisitedLinks):
* WebProcess/WebPage/VisitedLinkTableController.h:

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

3 years agoWeb Inspector: Enable WebKit logging configuration and display
eric.carlson@apple.com [Wed, 25 Oct 2017 17:18:13 +0000 (17:18 +0000)]
Web Inspector: Enable WebKit logging configuration and display
https://bugs.webkit.org/show_bug.cgi?id=177027
<rdar://problem/33964767>

Unreviewed, fix flakey test.

* inspector/console/webcore-logging-expected.txt:
* inspector/console/webcore-logging.html:

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

3 years agoSupport the TailBench9000 benchmark in run-jsc-benchmarks
rmorisset@apple.com [Wed, 25 Oct 2017 16:58:57 +0000 (16:58 +0000)]
Support the TailBench9000 benchmark in run-jsc-benchmarks
https://bugs.webkit.org/show_bug.cgi?id=178451

Reviewed by Saam Barati.

PerformanceTests:

The separation between the definition of the benchmarks (in merge-sort.js and n-body.js) and their loops (in *-run.js)
was causing trouble since the load of the js files only succeeded from the same directory. So I chose to merge them, following
the example of the other benchmarks.

* TailBench9000/merge-sort-run.js: Removed.
* TailBench9000/merge-sort.js:
* TailBench9000/n-body-run.js: Removed.
* TailBench9000/n-body.js:

Tools:

* Scripts/run-jsc-benchmarks:

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

3 years ago[css-grid] Avoid clearing the overrideContainingBlockWidth if possible
jfernandez@igalia.com [Wed, 25 Oct 2017 16:38:14 +0000 (16:38 +0000)]
[css-grid] Avoid clearing the overrideContainingBlockWidth if possible
https://bugs.webkit.org/show_bug.cgi?id=178260

Reviewed by Sergio Villar Senin.

Since the intrinsic width computation uses the same logic than the
track sizing algorithm we are clearing the overrideContainingBlockWidth
of some grid items that are required to laid out them properly.

It's very uncommon that any intrinsic size computation isn't performed
as part of a layout process. However, if it happens, once cleared the
overrideContainingBlockWidth it may lead to an incorrect layout of the
affected grid items.

This change is a defensive approach to avoid the issues caused by
such off-layout preferred size requests, which may imply recomputing
the grid container intrinsic size.

No new tests, because we are only removing some redundant logic.

* rendering/GridTrackSizingAlgorithm.cpp:
(WebCore::GridTrackSizingAlgorithmStrategy::minContentForChild const):
(WebCore::GridTrackSizingAlgorithmStrategy::maxContentForChild const):
(WebCore::GridTrackSizingAlgorithmStrategy::minSizeForChild const):
(WebCore::GridTrackSizingAlgorithmStrategy::updateOverrideContainingBlockContentSizeForChild const):
(WebCore::IndefiniteSizeStrategy::minLogicalWidthForChild const):
(WebCore::DefiniteSizeStrategy::minLogicalWidthForChild const):
* rendering/GridTrackSizingAlgorithm.h:

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

3 years agoUnreviewed follow up changing one more enum value as discussed in the bug
gns@gnome.org [Wed, 25 Oct 2017 15:11:07 +0000 (15:11 +0000)]
Unreviewed follow up changing one more enum value as discussed in the bug
https://bugs.webkit.org/show_bug.cgi?id=177810

* platform/glib/LowPowerModeNotifierGLib.cpp:
(WebCore::LowPowerModeNotifier::updateState): use NONE instead of DISCHARGING, to ensure
it will build even with older upower.

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

3 years ago[WPE] Remove GLib API functions which use Cairo
aperez@igalia.com [Wed, 25 Oct 2017 08:34:13 +0000 (08:34 +0000)]
[WPE] Remove GLib API functions which use Cairo
https://bugs.webkit.org/show_bug.cgi?id=178205

Reviewed by Michael Catanzaro.

Source/WebKit:

Add PLATFORM(GTK) guards for the parts of of the GLib API which use cairo_surface_t (web
page snapshots and favicons), and remove the affected function prototypes from public API
headers. This way, the WPE version of the API is not tied to Cairo.

* PlatformWPE.cmake:
* UIProcess/API/glib/WebKitFaviconDatabase.cpp:
* UIProcess/API/glib/WebKitFaviconDatabasePrivate.h:
* UIProcess/API/glib/WebKitInjectedBundleClient.cpp:
* UIProcess/API/glib/WebKitWebView.cpp:
(webkitWebViewConstructed):
(webkitWebViewGetProperty):
(webkitWebViewDispose):
(webkit_web_view_class_init):
(webkitWebViewLoadChanged):
* UIProcess/API/glib/WebKitWebViewPrivate.h:
* UIProcess/API/wpe/WebKitFaviconDatabase.h:
* UIProcess/API/wpe/WebKitWebView.h:
* WebProcess/InjectedBundle/API/glib/WebKitWebPage.cpp:
(webkitWebPageDidReceiveMessage):

Tools:

Add PLATFORM(GTK) guards for the API tests (or parts of them) which use cairo_surface_t (web
page snapshots and favicons) which are not available in the WPE version of the GLib API.

* TestWebKitAPI/Tests/WebKitGLib/TestWebKitFaviconDatabase.cpp:
(testNotInitialized):
(testPrivateBrowsing):
(testFaviconDatabase):
* TestWebKitAPI/Tests/WebKitGLib/TestWebKitFindController.cpp:
(testFindControllerHide):
(beforeAll):
* TestWebKitAPI/glib/WebKitGLib/WebViewTest.cpp:
* TestWebKitAPI/glib/WebKitGLib/WebViewTest.h:

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

3 years agoWeb Inspector: preserve Recordings for each Canvas after closing the Canvas tab
webkit@devinrousso.com [Wed, 25 Oct 2017 07:39:05 +0000 (07:39 +0000)]
Web Inspector: preserve Recordings for each Canvas after closing the Canvas tab
https://bugs.webkit.org/show_bug.cgi?id=178767
<rdar://problem/35167239>

Reviewed by Brian Burg.

Source/WebInspectorUI:

* UserInterface/Test.html:
Include CollectionTypes for tests.

* UserInterface/Controllers/CanvasManager.js:
(WI.CanvasManager.prototype.recordingFinished):

* UserInterface/Models/Canvas.js:
(WI.Canvas):
(WI.Canvas.prototype.get recordingCollection):

* UserInterface/Models/CollectionTypes.js:
(WI.CanvasCollection):
(WI.RecordingCollection):

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

* UserInterface/Views/CanvasTabContentView.js:
(WI.CanvasTabContentView.prototype.attached):
(WI.CanvasTabContentView.prototype._recordingAdded):

LayoutTests:

* inspector/canvas/resources/recording-utilities.js:
(TestPage.registerInitializer.window.startRecording):
Add assertions that the recording is added to the canvas' RecordingCollection.

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

3 years agoMake SERVICE_WORKER feature buildable on GTK, WPE
zandobersek@gmail.com [Wed, 25 Oct 2017 07:17:21 +0000 (07:17 +0000)]
Make SERVICE_WORKER feature buildable on GTK, WPE
https://bugs.webkit.org/show_bug.cgi?id=178574

Reviewed by Carlos Garcia Campos.

Source/WebCore:

* CMakeLists.txt: Add missing include paths and files to the build.
* Sources.txt: Add missing files to the build.
* WebCore.xcodeproj/project.pbxproj: Remove the JSDOMPromise.cpp and
JSFetchEventCustom.cpp targets, they're now built via unified sources.
* bindings/js/JSFetchEventCustom.cpp: Guard custom JSFetchEvent code
with the ENABLE(SERVICE_WORKER) guards.

Source/WebKit:

* CMakeLists.txt: Add missing files to the build.
* StorageProcess/StorageProcess.cpp:
(WebKit::StorageProcess::didGetWorkerContextProcessConnection):
IPC::Attachment object should be accessed through an rvalue reference,
making it mutable and enabling releasing the file descriptor.
* StorageProcess/StorageProcess.h: Adjust the method signature.
* WebProcess/Storage/ServiceWorkerClientFetch.cpp:
Explicitly include the ResourceError header from WebCore (using a forwarding header).
* WebProcess/Storage/WebServiceWorkerProvider.cpp:
Include the CachedResource header from WebCore (again using a forwarding header).
* WebProcess/Storage/WebServiceWorkerProvider.h: Forward-declare the WebCore::CachedResource type.

Source/WTF:

* wtf/Identified.h: Explicitly include the <atomic> header since
std::atomic<> is used in the ThreadSafeIdentified definition.

Tools:

* Scripts/webkitperl/FeatureList.pm: Add the --service-worker option
that enables the SERVICE_WORKER feature flag. For now it's enabled
on Apple's Cocoa ports (even when build-webkit isn't used for those
builds, the flag is enabled here for consistency).

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

3 years ago[Linux] Enable Gigacage in x64 Linux environment
zandobersek@gmail.com [Wed, 25 Oct 2017 06:55:36 +0000 (06:55 +0000)]
[Linux] Enable Gigacage in x64 Linux environment
https://bugs.webkit.org/show_bug.cgi?id=177745
<rdar://problem/34773148>

Reviewed by Yusuke Suzuki.

Re-enable Gigacage on x86_64 Linux platforms after it was disabled in 223877.

The cause for the revert was problems with huge coredumps being generated
while Gigacage was enabled. The feature virtually allocates about 80GB of
memory at the beginning of the process lifetime. This is not a problem in
itself since the memory range is marked as not needed through madvise(),
but all this memory was still included upon core dump generation on Linux.
Since there are reasonable limits enforced upon core dumps, these were
being truncated every time, not yielding any useful information.

To avoid this, on Linux, invocations of madvise() with the MADV_NORMAL and
MADV_DONTNEED advice parameters should be accompanied with respectively
matching MADV_DODUMP and MADV_DONTDUMP madvise() calls. This correctly
avoids core-dumping any memory that's not yet been physically allocated.

* bmalloc/Gigacage.h:
* bmalloc/VMAllocate.h:
(bmalloc::vmDeallocatePhysicalPages):
(bmalloc::vmAllocatePhysicalPages):

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

3 years agoClean up gcc build warnings about reaching the end of a non void function for webrtc...
commit-queue@webkit.org [Wed, 25 Oct 2017 06:26:58 +0000 (06:26 +0000)]
Clean up gcc build warnings about reaching the end of a non void function for webrtc classes
https://bugs.webkit.org/show_bug.cgi?id=178721

Patch by Alejandro G. Castro <alex@igalia.com> on 2017-10-24
Reviewed by Youenn Fablet.

Assert when we reach those situations and return some value after that to avoid warning.

No new tests, this is a clean up.

* Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
(WebCore::sessionDescriptionType):
(WebCore::signalingState):
(WebCore::toRTCIceConnectionState):
* Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
(WebCore::bundlePolicyfromConfiguration):
(WebCore::iceTransportPolicyfromConfiguration):

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

3 years agoREGRESSION(r222181): Web Inspector: Augmenting Agents Domains are not getting activated
commit-queue@webkit.org [Wed, 25 Oct 2017 05:37:47 +0000 (05:37 +0000)]
REGRESSION(r222181): Web Inspector: Augmenting Agents Domains are not getting activated
https://bugs.webkit.org/show_bug.cgi?id=178768
<rdar://problem/35081334>

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2017-10-24
Reviewed by Brian Burg.

* UserInterface/Base/Main.js:
Simplify event dispatch.

* UserInterface/Controllers/AppController.js:
(WI.AppController.prototype.activateExtraDomains):
Pass the domains on.

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

3 years agoRenderSVGModelObject::checkIntersection triggers layout
rniwa@webkit.org [Wed, 25 Oct 2017 01:35:45 +0000 (01:35 +0000)]
RenderSVGModelObject::checkIntersection triggers layout
https://bugs.webkit.org/show_bug.cgi?id=178710

Reviewed by Simon Fraser.

Source/WebCore:

Fixed the bug that checkIntersection and checkEnclosure no longer updates the layout after r223882.

Test: svg/custom/check-intersection-basic.svg

* svg/SVGSVGElement.cpp:
(WebCore::SVGSVGElement::collectIntersectionOrEnclosureList):
(WebCore::SVGSVGElement::checkIntersection):
(WebCore::SVGSVGElement::checkEnclosure):
* svg/SVGSVGElement.h:

LayoutTests:

Added the support for SVG documents to js-test.js, and added a basic test for checkIntersection
and checkEnclosure using it.

* resources/js-test.js:
(ensureRootElement): Added. Creates a foreignObject element inside a SVG document.
(moveForeignObjectToTopIfNeeded): Added. In SVG, z-index order is determined by the element order.
In order to make the results visible, we move the foreignObject to the top by appending to the end
of the document element.
(getOrCreate):
(debug): Run innerHTML before appendChild as setting namespaceURI before running innerHTML would
result in span's being parsed as SVG elements.
(insertStyleSheet):
(finishJSTest):
* svg/custom/check-intersection-basic-expected.txt: Added.
* svg/custom/check-intersection-basic.svg: Added.

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

3 years agoOwner commit does not necessarily exist in the same commit set for an owned commit.
dewei_zhu@apple.com [Wed, 25 Oct 2017 01:34:34 +0000 (01:34 +0000)]
Owner commit does not necessarily exist in the same commit set for an owned commit.
https://bugs.webkit.org/show_bug.cgi?id=178763

Reviewed by Ryosuke Niwa.

Remove the check based on previous incorrect assumption.
Added unit tests to cover this change.

* public/privileged-api/create-test-group.php:
* server-tests/privileged-api-create-test-group-tests.js:
(return.addTriggerableAndCreateTask.string_appeared_here.then.id.taskId.id.then):

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

3 years ago[Apple Pay] Implement a paymentmethodselected event for PaymentRequest
aestes@apple.com [Wed, 25 Oct 2017 00:52:04 +0000 (00:52 +0000)]
[Apple Pay] Implement a paymentmethodselected event for PaymentRequest
https://bugs.webkit.org/show_bug.cgi?id=178765

Reviewed by Tim Horton.

Source/WebCore:

When the Apple Pay payment method changes, fire an applepaypaymentmethodchanged event on the
PaymentRequest object. The event has a paymentMethod property and an updateWith() method
which behaves identically to PaymentRequestUpdateEvent.updateWith().

Test: http/tests/ssl/applepay/ApplePayPaymentMethodUpdateEvent.https.html

* DerivedSources.make:
* Modules/applepay/ApplePayPaymentMethod.idl:
* Modules/applepay/ApplePayPaymentMethodSelectedEvent.h:
* Modules/applepay/PaymentMethod.h:
(WebCore::PaymentMethod::PaymentMethod): Deleted.
(WebCore::PaymentMethod::pkPaymentMethod const): Deleted.
* Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp:
(WebCore::ApplePayPaymentHandler::detailsUpdated):
(WebCore::ApplePayPaymentHandler::paymentMethodUpdated):
(WebCore::ApplePayPaymentHandler::didSelectPaymentMethod):
* Modules/applepay/paymentrequest/ApplePayPaymentHandler.h:
* Modules/applepay/paymentrequest/ApplePayPaymentMethodUpdateEvent.cpp: Added.
(WebCore::ApplePayPaymentMethodUpdateEvent::ApplePayPaymentMethodUpdateEvent):
(WebCore::ApplePayPaymentMethodUpdateEvent::eventInterface const):
* Modules/applepay/paymentrequest/ApplePayPaymentMethodUpdateEvent.h: Added.
* Modules/applepay/paymentrequest/ApplePayPaymentMethodUpdateEvent.idl: Added.
* Modules/paymentrequest/PaymentHandler.h:
* Modules/paymentrequest/PaymentRequest.cpp:
(WebCore::PaymentRequest::shippingAddressChanged):
(WebCore::PaymentRequest::shippingOptionChanged):
(WebCore::PaymentRequest::dispatchEvent):
(WebCore::PaymentRequest::updateWith):
(WebCore::PaymentRequest::settleDetailsPromise):
(WebCore::PaymentRequest::dispatchUpdateEvent): Deleted.
* Modules/paymentrequest/PaymentRequest.h:
* Modules/paymentrequest/PaymentRequest.idl:
* Modules/paymentrequest/PaymentRequestUpdateEvent.cpp:
(WebCore::PaymentRequestUpdateEvent::updateWith):
* Modules/paymentrequest/PaymentRequestUpdateEvent.h:
* WebCore.xcodeproj/project.pbxproj:
* dom/EventNames.h:
* dom/EventNames.in:
* testing/MockPaymentCoordinator.cpp:
(WebCore::MockPaymentCoordinator::changePaymentMethod):
* testing/MockPaymentCoordinator.h:
* testing/MockPaymentCoordinator.idl:
* testing/MockPaymentMethod.h: Added.

LayoutTests:

* http/tests/ssl/applepay/ApplePayPaymentMethodUpdateEvent.https-expected.txt: Added.
* http/tests/ssl/applepay/ApplePayPaymentMethodUpdateEvent.https.html: Added.

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

3 years agoServiceWorkerClientFetch should return an error that is not null in case of failure
commit-queue@webkit.org [Wed, 25 Oct 2017 00:47:27 +0000 (00:47 +0000)]
ServiceWorkerClientFetch should return an error that is not null in case of failure
https://bugs.webkit.org/show_bug.cgi?id=178761

Patch by Youenn Fablet <youenn@apple.com> on 2017-10-24
Reviewed by Geoffrey Garen.

Source/WebCore:

Covered by existing tests.

As per spec, ServiceWorkerJob should not go through Service Worker Handle Fetch
for fetching scripts.

* workers/WorkerScriptLoader.cpp:
(WebCore::WorkerScriptLoader::loadAsynchronously):
* workers/WorkerScriptLoaderClient.h:
(WebCore::WorkerScriptLoaderClient::isServiceWorkerClient const):
* workers/service/ServiceWorkerJob.h:

Source/WebKit:

* WebProcess/Storage/ServiceWorkerClientFetch.cpp:
(WebKit::ServiceWorkerClientFetch::didFail): Generating a General error.

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

3 years agoUnreviewed, fix name of Perl LibXML package on Fedora
mcatanzaro@igalia.com [Wed, 25 Oct 2017 00:36:58 +0000 (00:36 +0000)]
Unreviewed, fix name of Perl LibXML package on Fedora
https://bugs.webkit.org/show_bug.cgi?id=178206
<rdar://problem/35028586>

* gtk/install-dependencies:
* wpe/install-dependencies:

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

3 years agoMove inspector and loader to unified sources.
keith_miller@apple.com [Wed, 25 Oct 2017 00:33:13 +0000 (00:33 +0000)]
Move inspector and loader to unified sources.
https://bugs.webkit.org/show_bug.cgi?id=178760

Rubber-stamped by Tim Horton.

* CMakeLists.txt:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:

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

3 years agoFix build after r223940
achristensen@apple.com [Wed, 25 Oct 2017 00:27:21 +0000 (00:27 +0000)]
Fix build after r223940

* inspector/WebConsoleAgent.cpp:

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

3 years agoFix Windows build after r223929.
achristensen@apple.com [Wed, 25 Oct 2017 00:12:28 +0000 (00:12 +0000)]
Fix Windows build after r223929.
https://bugs.webkit.org/show_bug.cgi?id=177027

* inspector/WebConsoleAgent.cpp:
(WebCore::WebConsoleAgent::getLoggingChannels):
Always initialize the variable "level".  Visual studio was complaining about the possibility of not initializing it
but this is only possible if logChannel->level is an invalid enum value.

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

3 years agoFix Windows build after r223925
achristensen@apple.com [Wed, 25 Oct 2017 00:09:35 +0000 (00:09 +0000)]
Fix Windows build after r223925
https://bugs.webkit.org/show_bug.cgi?id=178687

* html/ImageBitmap.cpp:
(WebCore::interpolationQualityForResizeQuality):
Visual Studio was complaining that not all control paths returned a value.

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

3 years agoTest fast/writing-mode/english-bt-text-with-spelling-marker.html should wait for...
dbates@webkit.org [Tue, 24 Oct 2017 23:33:03 +0000 (23:33 +0000)]
Test fast/writing-mode/english-bt-text-with-spelling-marker.html should wait for editing commands to complete
https://bugs.webkit.org/show_bug.cgi?id=178759

Reviewed by Ryosuke Niwa.

Make use of typeCharacterCommand() from (LayoutTests/editing/editing.js) to type each character
with a delay and delay test completion until all characters have been typed.

* fast/writing-mode/english-bt-text-with-spelling-marker-expected.html:
* fast/writing-mode/english-bt-text-with-spelling-marker.html:

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

3 years agoAllow OjbC Weak References when building TestAPI
msaboff@apple.com [Tue, 24 Oct 2017 22:59:51 +0000 (22:59 +0000)]
Allow OjbC Weak References when building TestAPI
https://bugs.webkit.org/show_bug.cgi?id=178748

Reviewed by Dan Bernstein.

Set TestAPI build flag Weak References in Manual Retain Release to true.

* JavaScriptCore.xcodeproj/project.pbxproj: Reverted.
* Configurations/ToolExecutable.xcconfig: Changed the flag here instead.

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

3 years agoNeed to pass non-nil argument to SimulateCrash() in bmalloc::logVMFailure()
ddkilzer@apple.com [Tue, 24 Oct 2017 22:30:15 +0000 (22:30 +0000)]
Need to pass non-nil argument to SimulateCrash() in bmalloc::logVMFailure()
<https://webkit.org/b/178740>
<rdar://problem/35154943>

Reviewed by Saam Barati.

* bmalloc/BPlatform.h:
(BUNUSED_PARAM): Define macro.
* bmalloc/Logging.cpp:
(SimulateCrash): Change third argument of SimulateCrash() to
CFStringRef since it's an NSString * in Objective-C.
(bmalloc::logVMFailure): Create a CFStringRef to use as a
description string.  Use new vmSize parameter to log size.
* bmalloc/Logging.h:
(bmalloc::logVMFailure): Update function signature to take a
size_t parameter representing vmSize.
* bmalloc/VMAllocate.h:
(bmalloc::tryVMAllocate): Pass vmSize into logVMFailure().

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

3 years agoEnable service worker to use cache storage api
commit-queue@webkit.org [Tue, 24 Oct 2017 22:28:44 +0000 (22:28 +0000)]
Enable service worker to use cache storage api
https://bugs.webkit.org/show_bug.cgi?id=178684

Patch by Youenn Fablet <youenn@apple.com> on 2017-10-24
Reviewed by Brady Eidson.

Source/WebCore:

Test: http/tests/workers/service/service-worker-cache-api.https.html

Updated WorkerLoaderProxy so that it can create a CacheStorageConnection.
Update WorkerCacheStorageConnection to take benefit of that.
This allows creating a CacheStorageConnection based on the page for regular workers and differently for Service Worker context.

Added ServiceWorkerThreadProxy as a proxy to ServiceWorkerThread.
It is in particular responsible to do proxy for loading tasks.
It implements cache API support for service worker by creating a dedicated CacheStorageConnection.

* Modules/cache/WorkerCacheStorageConnection.cpp:
(WebCore::WorkerCacheStorageConnection::create):
(WebCore::WorkerCacheStorageConnection::~WorkerCacheStorageConnection):
(WebCore::WorkerCacheStorageConnection::doOpen):
(WebCore::WorkerCacheStorageConnection::doRemove):
(WebCore::WorkerCacheStorageConnection::doRetrieveCaches):
(WebCore::WorkerCacheStorageConnection::reference):
(WebCore::WorkerCacheStorageConnection::dereference):
(WebCore::WorkerCacheStorageConnection::doRetrieveRecords):
(WebCore::WorkerCacheStorageConnection::doBatchDeleteOperation):
(WebCore::WorkerCacheStorageConnection::doBatchPutOperation):
* WebCore.xcodeproj/project.pbxproj:
* workers/WorkerLoaderProxy.h:
* workers/WorkerMessagingProxy.cpp:
(WebCore::WorkerMessagingProxy::createCacheStorageConnection):
* workers/WorkerMessagingProxy.h:
* workers/service/context/ServiceWorkerThread.cpp:
(WebCore::ServiceWorkerThread::ServiceWorkerThread):
* workers/service/context/ServiceWorkerThread.h:
* workers/service/context/ServiceWorkerThreadProxy.cpp: Added.
(WebCore::ServiceWorkerThreadProxy::create):
(WebCore::ServiceWorkerThreadProxy::ServiceWorkerThreadProxy):
(WebCore::ServiceWorkerThreadProxy::postTaskForModeToWorkerGlobalScope):
(WebCore::ServiceWorkerThreadProxy::postTaskToLoader):
(WebCore::ServiceWorkerThreadProxy::createCacheStorageConnection):
* workers/service/context/ServiceWorkerThreadProxy.h: Added.

Source/WebKit:

Passing the WebPreferences store of the default page group of the WebProcessPool to its ServiceWorker process.
ServiceWorkerContextManager then uses it to initialize the preferences accordingly.
Patch is covered by new test which is using cache api previously disabled and now enabled through the store.

Made use of the new ServiceWorkerThreadProxy in ServiceWorkerContextManager to enable a cache storage connection.
Fixed the default size of quota in WebsiteDataStore.

* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::getWorkerContextProcessConnection):
* UIProcess/WebsiteData/WebsiteDataStore.h:
* WebProcess/Storage/ServiceWorkerContextManager.cpp:
(WebKit::ServiceWorkerContextManager::ServiceWorkerContextManager):
(WebKit::ServiceWorkerContextManager::updatePreferences):
(WebKit::ServiceWorkerContextManager::startServiceWorker):
(WebKit::ServiceWorkerContextManager::startFetch):
* WebProcess/Storage/ServiceWorkerContextManager.h:
(WebKit::ServiceWorkerContextManager::ServiceWorkerContextManager): Deleted.
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::getWorkerContextConnection):
* WebProcess/WebProcess.h:
* WebProcess/WebProcess.messages.in:

LayoutTests:

* http/tests/workers/service/resources/service-worker-cache-api-worker.js: Added.
* http/tests/workers/service/resources/service-worker-cache-api.js: Added.
* http/tests/workers/service/service-worker-cache-api.https-expected.txt: Added.
* http/tests/workers/service/service-worker-cache-api.https.html: Added.

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

3 years agoSelecting and right-clicking URL-like strings with IDNA-disallowed characters in...
achristensen@apple.com [Tue, 24 Oct 2017 22:23:12 +0000 (22:23 +0000)]
Selecting and right-clicking URL-like strings with IDNA-disallowed characters in host or authority causes rendering engine crash
https://bugs.webkit.org/show_bug.cgi?id=174267

Reviewed by Tim Horton.

Source/WebKit:

* WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
(WKBundlePageCanHandleRequest):

Tools:

* TestWebKitAPI/Tests/WebKit/CanHandleRequest_Bundle.cpp:
(TestWebKitAPI::runTest):

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

3 years agoOptionally store entire ResourceRequest for ping loads
achristensen@apple.com [Tue, 24 Oct 2017 22:20:59 +0000 (22:20 +0000)]
Optionally store entire ResourceRequest for ping loads
https://bugs.webkit.org/show_bug.cgi?id=178756

Reviewed by Tim Horton.

No change in behavior.
This uses less memory in the common loading case.
This will be needed for moving appcache loading to the Networking Process.
See https://bugs.webkit.org/show_bug.cgi?id=178540

* loader/cache/CachedResource.cpp:
(WebCore::CachedResource::load):
* loader/cache/CachedResource.h:
(WebCore::CachedResource::setOriginalRequest):
(WebCore::CachedResource::originalRequest const):
(WebCore::CachedResource::setOriginalRequestHeaders): Deleted.
* loader/cache/CachedResourceLoader.cpp:
(WebCore::CachedResourceLoader::requestResource):

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

3 years agoSkipped imported/w3c/web-platform-tests/html/dom/dynamic-markup-insertion/opening...
jlewis3@apple.com [Tue, 24 Oct 2017 22:19:44 +0000 (22:19 +0000)]
Skipped imported/w3c/web-platform-tests/html/dom/dynamic-markup-insertion/opening-the-input-stream/011.html on High Sierra Release.
https://bugs.webkit.org/show_bug.cgi?id=178553

Unreviewed test gardening.

* platform/mac-wk2/TestExpectations:

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

3 years agoWeb Inspector: Console Drawer resizing doesn't match cursor position
joepeck@webkit.org [Tue, 24 Oct 2017 22:11:59 +0000 (22:11 +0000)]
Web Inspector: Console Drawer resizing doesn't match cursor position
https://bugs.webkit.org/show_bug.cgi?id=178753
<rdar://problem/35160484>

Reviewed by Brian Burg.

* UserInterface/Views/ConsoleDrawer.js:
(WI.ConsoleDrawer.prototype._updateDrawerHeight):
Drive-by fix an early return that would never have worked.

* UserInterface/Views/Main.css:
(#content):
Give the #content a flex grow of 1. This causes the space to grow as it
already was but now it does not affect the size of the fixed height sibling.

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

3 years ago[WebIDL] Support the ExportMacro attribute for dictionaries
aestes@apple.com [Tue, 24 Oct 2017 22:05:30 +0000 (22:05 +0000)]
[WebIDL] Support the ExportMacro attribute for dictionaries
https://bugs.webkit.org/show_bug.cgi?id=178752

Reviewed by Sam Weinig.

* bindings/scripts/CodeGeneratorJS.pm:
(GenerateDictionaryHeaderContent):
* bindings/scripts/test/JS/JSTestStandaloneDictionary.h:
* bindings/scripts/test/TestStandaloneDictionary.idl:

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

3 years agoWeb Inspector: Enable WebKit logging configuration and display
eric.carlson@apple.com [Tue, 24 Oct 2017 22:00:53 +0000 (22:00 +0000)]
Web Inspector: Enable WebKit logging configuration and display
https://bugs.webkit.org/show_bug.cgi?id=177027
<rdar://problem/33964767>

Reviewed by Joseph Pecoraro.

Source/JavaScriptCore:

* inspector/ConsoleMessage.cpp:
(Inspector::messageSourceValue): Inspector::Protocol::Console::ConsoleMessage ->
    Inspector::Protocol::Console::ChannelSource.
* inspector/agents/JSGlobalObjectConsoleAgent.cpp:
(Inspector::JSGlobalObjectConsoleAgent::getLoggingChannels): There are no logging channels
    specific to a JSContext yet, so return an empty channel array.
(Inspector::JSGlobalObjectConsoleAgent::setLoggingChannelLevel): No channels, return an error.
* inspector/agents/JSGlobalObjectConsoleAgent.h:

* inspector/protocol/Console.json: Add ChannelSource, ChannelLevel, and Channel. Add getLoggingChannels
    and setLoggingChannelLevel.

* inspector/scripts/codegen/generator.py: Special case "webrtc"-> "WebRTC".
* inspector/scripts/tests/generic/expected/enum-values.json-result:
* inspector/scripts/tests/generic/expected/type-declaration-array-type.json-result:
* inspector/scripts/tests/generic/expected/type-declaration-enum-type.json-result:
* inspector/scripts/tests/generic/expected/type-declaration-object-type.json-result:
* inspector/scripts/tests/generic/expected/type-requiring-runtime-casts.json-result:

* runtime/ConsoleTypes.h: Add Media and WebRTC.

Source/WebCore:

Test: inspector/console/webcore-logging.html

* dom/Document.cpp:
(WebCore::Document::~Document): Stop observing the logger.
(WebCore::Document::logger): Observe the logger.
(WebCore::Document::didLogMessage): Forward logging messages to the inspector.
* dom/Document.h:

* inspector/WebConsoleAgent.cpp:
(WebCore::WebConsoleAgent::getLoggingChannels): New, return the state of log runtime channels.
(WebCore::WebConsoleAgent::setLoggingChannelLevel): New, set the state of a channel.
* inspector/WebConsoleAgent.h:

* platform/Logging.cpp:
(WebCore::getLogChannel): New, get a log channel by name.
* platform/Logging.h:

Source/WebCore/PAL:

* pal/Logger.h:
(PAL::Logger::willLog const): Always return true for Always and Error so those messages are
    always logged to the system.
(PAL::Logger::log): Always log Always and Error to the system, but pay strict attention to level
    and channel state for logging to observers so logging only shows up in the inspector when
    explicitly enabled by the user.

Source/WebInspectorUI:

* Localizations/en.lproj/localizedStrings.js: Add new localized strings.

* UserInterface/Controllers/LogManager.js:
(WI.LogManager): Initialize _loggingChannelSources, fetch _customLoggingChannels.
(WI.LogManager.supportsLogChannels): New.
(WI.LogManager.prototype.get customLoggingChannels): New.
(WI.LogManager.prototype.get logChannelSources): New.

* UserInterface/Main.html:
* UserInterface/Models/ConsoleMessage.js: Add Media and WebRTC.

* UserInterface/Models/IssueMessage.js:
(WI.IssueMessage): Add media and webrtc.

* UserInterface/Models/LoggingChannel.js: Added.
(WI.LoggingChannel):
(WI.LoggingChannel.fromPayload):
(WI.LoggingChannel.prototype.get source):
(WI.LoggingChannel.prototype.get level):

* UserInterface/Views/LogContentView.js:
(WI.LogContentView): Add new scope buttons for "Log", "Info", and "Debug". Create log channel
    scope buttons once logging has started.
(WI.LogContentView.prototype.get navigationItems): Add the log message scope bar when necessary.
(WI.LogContentView.prototype._scopeFromMessageSource): New.
(WI.LogContentView.prototype._scopeFromMessageLevel): Don't group Info, Log, and Debug.
(WI.LogContentView.prototype._messageAdded): Force a UI update the first time a WebKit log
    message is added.

(WI.LogContentView.prototype._messageShouldBeVisible): New, deal with message source bar buttons.
(WI.LogContentView.prototype._messageSourceBarSelectionDidChange): New.
(WI.LogContentView.prototype._filterMessageElements): Deal with message source bar buttons.

* UserInterface/Views/SettingsTabContentView.js:
(WI.SettingsTabContentView.prototype._createGeneralSettingsView): Create and initialize menus
    for each log channel.

Source/WebKitLegacy/mac:

* WebCoreSupport/WebChromeClient.mm:
(stringForMessageSource): Deal with Media and WebRTC message sources.

Tools:

Allow new 'dumpJSConsoleLogInStdErr' test header to redirect log console output to stderr.

* DumpRenderTree/TestOptions.h:
* DumpRenderTree/TestOptions.mm:
(TestOptions::TestOptions):
* DumpRenderTree/mac/DumpRenderTree.mm:
(runTest):
* WebKitTestRunner/TestController.cpp:
(WTR::updateTestOptionsFromTestHeader):
(WTR::TestController::runTest):
* WebKitTestRunner/TestOptions.h:
(WTR::TestOptions::hasSameInitializationOptions const):

LayoutTests:

* inspector/console/webcore-logging-expected.txt: Added.
* inspector/console/webcore-logging.html: Added.
* platform/mac/TestExpectations: Skip new test on Yosemite and ElCapitan.
* platform/win/TestExpectations: Skip new test.

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

3 years agoAttempted build fix for Sierra.
dino@apple.com [Tue, 24 Oct 2017 21:58:48 +0000 (21:58 +0000)]
Attempted build fix for Sierra.

* html/ImageBitmap.cpp:
(WebCore::croppedSourceRectangleWithFormatting):

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

3 years agoUncaught Exception: TypeError: null is not an object (evaluating 'this.treeOutline...
commit-queue@webkit.org [Tue, 24 Oct 2017 21:55:36 +0000 (21:55 +0000)]
Uncaught Exception: TypeError: null is not an object (evaluating 'this.treeOutline.isXMLMimeType')
https://bugs.webkit.org/show_bug.cgi?id=178745

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2017-10-24
Reviewed by Brian Burg.

* UserInterface/Views/DOMTreeUpdater.js:
(WI.DOMTreeUpdater.prototype._updateModifiedNodes):
An earlier tree element update might have caused this other tree element's
waiting to be updated to actually be removed. So just skip past them.

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

3 years agoWTF: Eliminated PLATFORM checks for HAVE_MACH_EXCEPTIONS
msaboff@apple.com [Tue, 24 Oct 2017 21:48:10 +0000 (21:48 +0000)]
WTF: Eliminated PLATFORM checks for HAVE_MACH_EXCEPTIONS
https://bugs.webkit.org/show_bug.cgi?id=178747

Reviewed by Saam Barati.

Removed unnecessary PLATFORM checks as they can cause build failures
when the include file is present.

* wtf/Platform.h:

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

3 years agoImplement resizing options for ImageBitmap rendering
dino@apple.com [Tue, 24 Oct 2017 21:46:41 +0000 (21:46 +0000)]
Implement resizing options for ImageBitmap rendering
https://bugs.webkit.org/show_bug.cgi?id=178687
<rdar://problem/35135417>

Reviewed by Sam Weinig.

Source/WebCore:

Implement many of the sizing options for createImageBitmap.

Test: http/wpt/2dcontext/imagebitmap/createImageBitmap-sizing.html

* html/ImageBitmap.cpp:
(WebCore::croppedSourceRectangleWithFormatting):

    Implement the first bit of the algorithm from
    the HTML specification.

(WebCore::outputSizeForSourceRectangle):

    ... and then the second bit. Leave the rest in
    comments for now.

(WebCore::interpolationQualityForResizeQuality):

    Helper function to map ImageBitmapOptions to
    GraphicsContext.

(WebCore::ImageBitmap::createPromise):

    Implement more of the sizing algorithm.

* html/ImageBitmap.h: Origin tainting is defined to be false by default.

LayoutTests:

More ImageBitmap tests, this time focusing on sizing.

* http/wpt/2dcontext/imagebitmap/common.js:
(createCanvasOfSize):
(create9x9CanvasWith2dContext):
(create18x18CanvasWith2dContext):

    Helper functions.

* http/wpt/2dcontext/imagebitmap/createImageBitmap-sizing-expected.txt: Added.
* http/wpt/2dcontext/imagebitmap/createImageBitmap-sizing.html: Added.
* http/wpt/2dcontext/imagebitmap/drawImage-ImageBitmap.html:
* http/wpt/2dcontext/imagebitmap/resources/target-blue-dot-no-intrinsic.svg: Added.
* http/wpt/2dcontext/imagebitmap/resources/target-blue-dot.png: Renamed from LayoutTests/http/wpt/2dcontext/imagebitmap/target-blue-dot.png.
* http/wpt/2dcontext/imagebitmap/resources/target-blue-dot.svg: Added.

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

3 years ago[GTK] Web Inspector: Add Recording.svg
commit-queue@webkit.org [Tue, 24 Oct 2017 21:35:30 +0000 (21:35 +0000)]
[GTK] Web Inspector: Add Recording.svg
https://bugs.webkit.org/show_bug.cgi?id=175045

Patch by Fujii Hironori <Hironori.Fujii@sony.com> on 2017-10-24
Reviewed by Brian Burg.

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

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

3 years agoAllow OjbC Weak References when building TestAPI
msaboff@apple.com [Tue, 24 Oct 2017 21:31:01 +0000 (21:31 +0000)]
Allow OjbC Weak References when building TestAPI
https://bugs.webkit.org/show_bug.cgi?id=178748

Reviewed by Saam Barati.

Set TestAPI build flag Weak References in Manual Retain Release to true.

* JavaScriptCore.xcodeproj/project.pbxproj:

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

3 years agoAdd initial implementation for serviceWorker.postMessage()
cdumez@apple.com [Tue, 24 Oct 2017 21:22:54 +0000 (21:22 +0000)]
Add initial implementation for serviceWorker.postMessage()
https://bugs.webkit.org/show_bug.cgi?id=178534

Reviewed by Youenn Fablet.

Source/WebCore:

Add initial implementation for serviceWorker.postMessage():
- https://w3c.github.io/ServiceWorker/#service-worker-postmessage

Test: http/tests/workers/service/basic-ServiceWorker-postMessage.https.html

* CMakeLists.txt:
* DerivedSources.make:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSBindingsAllInOne.cpp:
* bindings/js/JSExtendableMessageEvent.cpp: Added.
(WebCore::JSExtendableMessageEvent::data const):
* bindings/js/WebCoreBuiltinNames.h:
* dom/Document.h:
* dom/EventNames.in:
* dom/MessagePortChannel.h:
* dom/ScriptExecutionContext.h:
* workers/WorkerGlobalScope.h:
* workers/service/ExtendableEvent.cpp:
(WebCore::ExtendableEvent::ExtendableEvent):
(WebCore::ExtendableEvent::~ExtendableEvent):
* workers/service/ExtendableEvent.h:
* workers/service/ExtendableMessageEvent.cpp: Added.
(WebCore::ExtendableMessageEvent::create):
(WebCore::ExtendableMessageEvent::ExtendableMessageEvent):
(WebCore::ExtendableMessageEvent::~ExtendableMessageEvent):
* workers/service/ExtendableMessageEvent.h: Added.
* workers/service/ExtendableMessageEvent.idl: Added.
* workers/service/ServiceWorker.cpp:
(WebCore::ServiceWorker::ServiceWorker):
(WebCore::ServiceWorker::postMessage):
(WebCore::ServiceWorker::state const):
(WebCore::ServiceWorker::scriptExecutionContext const):
* workers/service/ServiceWorker.h:
* workers/service/ServiceWorkerContainer.cpp:
(WebCore::ServiceWorkerContainer::controller const):
* workers/service/ServiceWorkerContainer.h:
* workers/service/ServiceWorkerGlobalScope.cpp:
(WebCore::ServiceWorkerGlobalScope::thread):
* workers/service/ServiceWorkerGlobalScope.h:
(isType):
* workers/service/context/ServiceWorkerThread.cpp:
(WebCore::ServiceWorkerThread::postMessageToServiceWorkerGlobalScope):
* workers/service/context/ServiceWorkerThread.h:
* workers/service/server/SWClientConnection.h:

Source/WebKit:

Add initial implementation for serviceWorker.postMessage():
- https://w3c.github.io/ServiceWorker/#service-worker-postmessage

* StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
(WebKit::WebSWServerConnection::postMessageToServiceWorkerGlobalScope):
* StorageProcess/ServiceWorker/WebSWServerConnection.h:
* StorageProcess/ServiceWorker/WebSWServerConnection.messages.in:
* WebProcess/Storage/ServiceWorkerContextManager.cpp:
(WebKit::ServiceWorkerContextManager::postMessageToServiceWorkerGlobalScope):
* WebProcess/Storage/ServiceWorkerContextManager.h:
* WebProcess/Storage/ServiceWorkerContextManager.messages.in:
* WebProcess/Storage/WebSWClientConnection.cpp:
(WebKit::WebSWClientConnection::postMessageToServiceWorkerGlobalScope):
* WebProcess/Storage/WebSWClientConnection.h:

LayoutTests:

Add layout test coverage.

* http/tests/workers/service/basic-ServiceWorker-postMessage.https-expected.txt: Added.
* http/tests/workers/service/basic-ServiceWorker-postMessage.https.html: Added.
* http/tests/workers/service/resources/basic-ServiceWorker-postMessage-worker.js: Added.
* http/tests/workers/service/resources/basic-ServiceWorker-postMessage.js: Added.

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

3 years agoWeb Inspector: allow ShaderProgram to be shown in CanvasContentView
webkit@devinrousso.com [Tue, 24 Oct 2017 21:17:17 +0000 (21:17 +0000)]
Web Inspector: allow ShaderProgram to be shown in CanvasContentView
https://bugs.webkit.org/show_bug.cgi?id=178714

Reviewed by Brian Burg.

* UserInterface/Views/CanvasDetailsSidebarPanel.js:
(WI.CanvasDetailsSidebarPanel.prototype.inspect):
Allow ShaderProgram to show the related Canvas information.

* UserInterface/Views/CanvasTabContentView.js:
(WI.CanvasTabContentView.prototype.canShowRepresentedObject):
(WI.CanvasTabContentView.prototype.showRepresentedObject):
(WI.CanvasTabContentView.prototype._canvasTreeOutlineSelectionDidChange):
If a ShaderProgram is selected in the path component, display a ShaderProgramContentView.

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

3 years agoWeb Inspector: remove canvases from Resources and experimental setting/UI
webkit@devinrousso.com [Tue, 24 Oct 2017 21:08:01 +0000 (21:08 +0000)]
Web Inspector: remove canvases from Resources and experimental setting/UI
https://bugs.webkit.org/show_bug.cgi?id=178711

Reviewed by Brian Burg.

* UserInterface/Base/Main.js:
(WI.tabContentViewClassForRepresentedObject):
* UserInterface/Base/Setting.js:
* UserInterface/Controllers/CanvasManager.js:
(WI.CanvasManager.prototype.canvasAdded):
(WI.CanvasManager.prototype.canvasRemoved):
* UserInterface/Models/Canvas.js:
* UserInterface/Models/Frame.js:
(WI.Frame):
(WI.Frame.prototype.get extraScriptCollection):
(WI.Frame.prototype.commitProvisionalLoad):
(WI.Frame.prototype.get canvasCollection): Deleted.
* UserInterface/Views/CanvasTabContentView.js:
(WI.CanvasTabContentView.isTabAllowed):
* UserInterface/Views/FrameTreeElement.js:
(WI.FrameTreeElement):
(WI.FrameTreeElement.prototype.onattach):
(WI.FrameTreeElement.prototype.ondetach):
(WI.FrameTreeElement.prototype.onpopulate):
(WI.FrameTreeElement.prototype._styleSheetAdded):
(WI.FrameTreeElement.prototype._canvasWasAdded): Deleted.
(WI.FrameTreeElement.prototype._canvasWasRemoved): Deleted.
* UserInterface/Views/ResourceSidebarPanel.js:
(WI.ResourceSidebarPanel):
(WI.ResourceSidebarPanel.prototype.matchTreeElementAgainstCustomFilters.match):
(WI.ResourceSidebarPanel.prototype.matchTreeElementAgainstCustomFilters):
(WI.ResourceSidebarPanel.prototype._treeSelectionDidChange):
* UserInterface/Views/ResourcesTabContentView.js:
(WI.ResourcesTabContentView):
(WI.ResourcesTabContentView.prototype.canShowRepresentedObject):
* UserInterface/Views/SettingsTabContentView.js:
(WI.SettingsTabContentView.prototype._createExperimentalSettingsView):

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

3 years ago[FTL] Support NewStringObject
utatane.tea@gmail.com [Tue, 24 Oct 2017 20:48:03 +0000 (20:48 +0000)]
[FTL] Support NewStringObject
https://bugs.webkit.org/show_bug.cgi?id=178737

Reviewed by Saam Barati.

JSTests:

* stress/new-string-object.js: Added.
(shouldBe):
(test):

Source/JavaScriptCore:

FTL should support NewStringObject and encourage use of NewStringObject in DFG pipeline.
After this change, we can convert `CallObjectConstructor(String)` to `NewStringObject(String)`.

* ftl/FTLAbstractHeapRepository.h:
* ftl/FTLCapabilities.cpp:
(JSC::FTL::canCompile):
* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::compileNode):
(JSC::FTL::DFG::LowerDFGToB3::compileNewStringObject):

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

3 years agoWeb Inspector: Show recordings in CanvasTabContentView
webkit@devinrousso.com [Tue, 24 Oct 2017 20:47:11 +0000 (20:47 +0000)]
Web Inspector: Show recordings in CanvasTabContentView
https://bugs.webkit.org/show_bug.cgi?id=177606
<rdar://problem/34715819>

Reviewed by Brian Burg.

Original patch by Matt Baker <mattbaker@apple.com>.

This patch folds canvas recordings into the new Canvas tab, which now
supports showing both CanvasCollections and Recordings.

When viewing recordings, a back button is shown at the start of the
navigation bar, allowing the user to return to the overview. It has been
styled with a back arrow, to make its function as clear as possible.
Like other navigation path components, the item for the recording can
clicked to select another recording taken from the same canvas.

The recording action scrubber has been moved from the content browser's
navigation bar to a more prominent location in the recording content view.
Selecting a frame tree element in the navigation sidebar no longer selects
the last action for that frame. This was changed to prevent the scrubber
position from behaving non-monotonically when selecting actions in sequential
order.

While this patch retains support for importing recordings, the feature
is not polished. Currently it is not possible to return to an imported
recording after leaving closing the view. In the future we may want to
consider including a navigation sidebar panel for the overview, which
could list canvas recordings (and eventually shaders).

* .eslintrc:
Drive-by: remove duplicate key.
* Localizations/en.lproj/localizedStrings.js:
* UserInterface/Base/Main.js:
(WI.contentLoaded):
(WI.tabContentViewClassForRepresentedObject):
* UserInterface/Main.html:
* UserInterface/Views/RecordingTabContentView.js: Removed.
Remove RecordingTabContentView.

* UserInterface/Images/Recording.svg:
New recording icon, used for tree elements and canvas preview UI.

* UserInterface/Models/Recording.js:
(WI.Recording):
(WI.Recording.prototype.get visualActionIndexes):
Visual action indexes should be computed by the recording.

* UserInterface/Views/CanvasContentView.js:
(WI.CanvasContentView):
(WI.CanvasContentView.prototype.refresh):
(WI.CanvasContentView.prototype.initialLayout):
(WI.CanvasContentView.prototype.attached):
(WI.CanvasContentView.prototype._recordingStopped):
(WI.CanvasContentView.prototype._handleRecordingSelectElementChange):
New UI for showing CanvasContentView as a CollectionView item. Includes
recordings button and select for choosing a recording to view.

* UserInterface/Views/CanvasOverviewContentView.css:
(.content-view.canvas-overview .content-view.canvas > header):
Switch to 13px, which is more frequently used.

(.content-view.canvas-overview .content-view.canvas > header .subtitle::before):
Switch to literal em dash. Surrounding spaces were ignored when using
the backslash-escaped character.

(.content-view.canvas-overview .content-view.canvas:not(:hover, .is-recording, .selected) > header > .navigation-bar):
(.content-view.canvas-overview .content-view.canvas > footer > .recordings):
(.content-view.canvas-overview .content-view.canvas > footer > .recordings::before):
(.content-view.canvas-overview .content-view.canvas > footer > .recordings > select):
(.content-view.canvas-overview .content-view.canvas > footer .recordings > select:focus):
(.content-view.canvas-overview .content-view.canvas > footer > .flexible-space):
(.popover-content > .tree-outline .item.recording > .icon):
(.popover-content > .tree-outline .item.recording:hover):
(.popover-content > .tree-outline .item.recording:hover > .icon):
(.content-view.canvas-overview .content-view.canvas:not(:hover, .is-recording) > header > .navigation-bar): Deleted.
(.content-view.canvas-overview .content-view.canvas > footer): Deleted.
New styles for the recording picker.

* UserInterface/Views/CanvasOverviewContentView.js:
(WI.CanvasOverviewContentView):
(WI.CanvasOverviewContentView.prototype.get selectionPathComponents):
(WI.CanvasOverviewContentView.prototype.contentViewAdded):
(WI.CanvasOverviewContentView.prototype.contentViewRemoved):
(WI.CanvasOverviewContentView.prototype._supplementalRepresentedObjectsDidChange):
(WI.CanvasOverviewContentView.prototype._selectedPathComponentChanged): Deleted.
(WI.CanvasOverviewContentView.prototype._supplementalRepresentedObjectsDidChange.createCanvasPathComponent): Deleted.
Canvas tree elements are now managed by CanvasTabContentView, which is
now responsible for maintaining the tree of canvas objects. For now the
tree holds canvases and recordings, but will eventually include shader programs.

* UserInterface/Views/CanvasTabContentView.css:
(.content-view.tab.canvas .navigation-bar > .item .recording > .icon):
(.content-view.tab.canvas .navigation-bar > .item > .canvas-overview > .icon): Deleted.
Add styles for recording path components.

* UserInterface/Views/CanvasTabContentView.js:
(WI.CanvasTabContentView):
(WI.CanvasTabContentView.prototype.treeElementForRepresentedObject):
(WI.CanvasTabContentView.prototype.canShowRepresentedObject):
(WI.CanvasTabContentView.prototype.showRepresentedObject):
(WI.CanvasTabContentView.prototype.shown):
(WI.CanvasTabContentView.prototype.restoreStateFromCookie):
(WI.CanvasTabContentView.prototype.attached):
(WI.CanvasTabContentView.prototype.detached):
(WI.CanvasTabContentView.prototype._canvasAdded):
(WI.CanvasTabContentView.prototype._canvasRemoved):
(WI.CanvasTabContentView.prototype._canvasTreeOutlineSelectionDidChange):
(WI.CanvasTabContentView.prototype._recordingStopped):
(WI.CanvasTabContentView.prototype._navigationSidebarImport):
(WI.CanvasTabContentView.prototype._navigationSidebarTreeOutlineSelectionChanged):
(WI.CanvasTabContentView.prototype._recordingAdded):
(WI.CanvasTabContentView.prototype._recordingActionIndexChanged):
(WI.CanvasTabContentView.prototype._updateActionIndex):
(WI.CanvasTabContentView.prototype.restoreFromCookie): Deleted.
(WI.CanvasTabContentView.prototype._overviewPathComponentClicked): Deleted.

* UserInterface/Views/ContentView.js:
(WI.ContentView.createFromRepresentedObject):

* UserInterface/Views/RecordingActionTreeElement.css:
(body:not(.window-inactive, .window-docked-inactive) .tree-outline:matches(:focus, .force-focus) .item.action.selected > .titles .parameter.swizzled,):
(body:not(.window-inactive, .window-docked-inactive) :matches(:focus, .force-focus) .item.action.selected > .titles .parameter.swizzled,): Deleted.

* UserInterface/Views/RecordingContentView.css:
(.content-view:not(.tab).recording):
(.content-view:not(.tab).recording > header):
(.content-view:not(.tab).recording > header > .slider-container):
(.content-view:not(.tab).recording > header > .slider-container > input[type=range]):
(.content-view:not(.tab).recording > header > .slider-container > input[type=range]::-webkit-slider-runnable-track):
(.content-view:not(.tab).recording > header > .slider-container > input[type=range]::-webkit-slider-thumb):
(.content-view:not(.tab).recording > .preview-container):

* UserInterface/Views/RecordingContentView.js:
(WI.RecordingContentView):
(WI.RecordingContentView.prototype.updateActionIndex):
(WI.RecordingContentView.prototype.initialLayout):
(WI.RecordingContentView.prototype.async._generateContentCanvas2D):
(WI.RecordingContentView.prototype._updateSliderValue):
(WI.RecordingContentView.prototype._sliderChanged):
(WI.RecordingContentView.prototype.get supplementalRepresentedObjects): Deleted.

* UserInterface/Views/RecordingNavigationSidebarPanel.js:
(WI.RecordingNavigationSidebarPanel.prototype.set recording):
(WI.RecordingNavigationSidebarPanel.prototype.updateActionIndex):

* UserInterface/Views/ResourceIcons.css:
(.canvas .icon):
(.canvas.canvas-2d .icon): Deleted.
(.canvas:matches(.webgl, .webgl2, .webgpu) .icon): Deleted.

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

3 years agoUnreviewed test gardening. Update inspector/network/har tests.
joepeck@webkit.org [Tue, 24 Oct 2017 20:45:02 +0000 (20:45 +0000)]
Unreviewed test gardening. Update inspector/network/har tests.

* http/tests/inspector/network/har/har-page-expected.txt:
Size of the test file changed and results needed to be updated.

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

3 years ago[mips] fix offsets of branches that have to go over a jump
guijemont@igalia.com [Tue, 24 Oct 2017 20:36:49 +0000 (20:36 +0000)]
[mips] fix offsets of branches that have to go over a jump
https://bugs.webkit.org/show_bug.cgi?id=153464

The jump() function creates 8 instructions, but the offsets of branches
meant to go over them only account for 6. In most cases, this is not an
issue as the last two instructions of jump() would be nops, but in the
rarer case where the jump destination is in a different 256 MB segment,
MIPSAssembler::linkWithOffset() will rewrite the code in a way in which
the last 4 instructions would be a 2 instruction load (lui/ori) into
$t9, a "j $t9" and then a nop. The wrong offset will mean that the
previous branches meant to go over the whole jump will branch to the
"j $t9" instruction, which would jump to whatever is currently in $t9
(since lui/ori would not be executed).

Reviewed by Michael Catanzaro.

* assembler/MacroAssemblerMIPS.h:
(JSC::MacroAssemblerMIPS::branchAdd32):
(JSC::MacroAssemblerMIPS::branchMul32):
(JSC::MacroAssemblerMIPS::branchSub32):
Fix the offsets of branches meant to go over code generated by jump().

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

3 years agoSkip fast/html/marquee-reparent-check.html on macOS debug.
ryanhaddad@apple.com [Tue, 24 Oct 2017 20:21:47 +0000 (20:21 +0000)]
Skip fast/html/marquee-reparent-check.html on macOS debug.
https://bugs.webkit.org/show_bug.cgi?id=178465

Unreviewed test gardening.

* platform/mac/TestExpectations:

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

3 years agoWeb Inspector: Layer mutations should be purely based on layerId, not based on nodeId
commit-queue@webkit.org [Tue, 24 Oct 2017 20:11:35 +0000 (20:11 +0000)]
Web Inspector: Layer mutations should be purely based on layerId, not based on nodeId
https://bugs.webkit.org/show_bug.cgi?id=178554

Patch by Ross Kirsling <ross.kirsling@sony.com> on 2017-10-24
Reviewed by Devin Rousso.

Source/WebInspectorUI:

* UserInterface/Controllers/LayerTreeManager.js:
(WI.LayerTreeManager.prototype.layerTreeMutations):
Looking for special cases involving nodeIds is incorrect, as nodeIds need not be unique in the layer list (such
as when an element and a pseudo-element thereof each give rise to a layer). A layer object marked "preserved" in
this way shares no data with its predecessor, meaning that no consumer can act upon this so-called preservation.
A preserved layer should be nothing more or less than a recycled layerId (the thing that *is* unique).

LayoutTests:

* inspector/layers/layer-tree-manager-expected.txt:
* inspector/layers/layer-tree-manager.html:

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

3 years ago[GTK] Unskip layout tests editing/deleting/delete-emoji-1.html & editing/deleting...
aperez@igalia.com [Tue, 24 Oct 2017 20:06:10 +0000 (20:06 +0000)]
[GTK] Unskip layout tests editing/deleting/delete-emoji-1.html & editing/deleting/delete-emoji-1.html
https://bugs.webkit.org/show_bug.cgi?id=178742

Unreviewed test gardening.

* platform/gtk/TestExpectations: Updated expectations for the emoji deletion layout tests.
* platform/gtk/editing/deleting/delete-emoji-1-expected.txt: Added.
* platform/gtk/editing/deleting/delete-emoji-expected.txt: Added.

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