WebKit-https.git
2 years agoAdd basic support for getting a ImageBitmapRenderingContext
commit-queue@webkit.org [Fri, 6 Oct 2017 21:29:01 +0000 (21:29 +0000)]
Add basic support for getting a ImageBitmapRenderingContext
https://bugs.webkit.org/show_bug.cgi?id=177983

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

Source/WebCore:

Add initial support for ImageBitmapRenderingContext.

* CMakeLists.txt:
* DerivedSources.make:
* WebCore.xcodeproj/project.pbxproj:

    Add new files.

* dom/Document.cpp:
* dom/Document.h:
* dom/Document.idl:

    Add ImageBitmapRenderingContext to RenderingContext variant so it wil be able to
    be used with Document.getCSSCanvasContext.

* html/HTMLCanvasElement.h:
* html/HTMLCanvasElement.cpp:
(WebCore::HTMLCanvasElement::setHeight):
(WebCore::HTMLCanvasElement::setWidth):

    Throw an exception if the context is in the placeholder mode (which we
    signify via a special PlaceholderRenderingContext) as speced. This can't
    currently be hit, as setting a placeholder requires offscreen canvas
    support, coming soon.

(WebCore::HTMLCanvasElement::getContext):

    Re-work to match the spec's matrix of options, adding in support
    for 'bitmaprenderer'/ ImageBitmapRenderingContext type as well as
    the placeholder mode.

(WebCore::HTMLCanvasElement::createContext2d):
(WebCore::HTMLCanvasElement::getContext2d):
(WebCore::HTMLCanvasElement::isWebGLType):
(WebCore::HTMLCanvasElement::createContextWebGL):
(WebCore::HTMLCanvasElement::getContextWebGL):
(WebCore::HTMLCanvasElement::createContextWebGPU):
(WebCore::HTMLCanvasElement::getContextWebGPU):
(WebCore::HTMLCanvasElement::isBitmapRendererType):
(WebCore::HTMLCanvasElement::createContextBitmapRenderer):
(WebCore::HTMLCanvasElement::getContextBitmapRenderer):

    Split creation out of the get functions so it can be called
    by getContext, where we know if the canvas is null or not.

* html/HTMLCanvasElement.idl:

    Add ImageBitmapRenderingContext to RenderingContext variant so it wil be able to
    be used with HTMLCanvasElement.getContext.

* html/canvas/CanvasRenderingContext.h:
(WebCore::CanvasRenderingContext::isBitmapRenderer const):
(WebCore::CanvasRenderingContext::isPlaceholder const):

    Add predicates for ImageBitmapRenderingContext and
    PlaceholderRenderingContext.

* html/canvas/ImageBitmapRenderingContext.cpp: Added.
(WebCore::ImageBitmapRenderingContext::ImageBitmapRenderingContext):
* html/canvas/ImageBitmapRenderingContext.h: Added.
* html/canvas/ImageBitmapRenderingContext.idl: Added.
* html/canvas/PlaceholderRenderingContext.cpp: Added.
(WebCore::PlaceholderRenderingContext::PlaceholderRenderingContext):
* html/canvas/PlaceholderRenderingContext.h: Added.

    Add stubbed out implementations for the new contexts.

LayoutTests:

* js/dom/global-constructors-attributes-expected.txt:
* platform/gtk/js/dom/global-constructors-attributes-expected.txt:
* platform/mac-elcapitan-wk2/js/dom/global-constructors-attributes-expected.txt:
* platform/mac-elcapitan/js/dom/global-constructors-attributes-expected.txt:
* platform/mac-sierra-wk1/js/dom/global-constructors-attributes-expected.txt:
* platform/mac-sierra/js/dom/global-constructors-attributes-expected.txt:
* platform/mac-wk1/js/dom/global-constructors-attributes-expected.txt:
* platform/mac-yosemite/js/dom/global-constructors-attributes-expected.txt:
* platform/mac/js/dom/global-constructors-attributes-expected.txt:
* platform/win/js/dom/global-constructors-attributes-expected.txt:
* platform/wpe/js/dom/global-constructors-attributes-expected.txt:

    Update test results.

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

2 years agoMark inspector/canvas/create-context-2d.html as flaky.
ryanhaddad@apple.com [Fri, 6 Oct 2017 21:08:30 +0000 (21:08 +0000)]
Mark inspector/canvas/create-context-2d.html as flaky.
https://bugs.webkit.org/show_bug.cgi?id=178028

Unreviewed test gardening.

* platform/mac/TestExpectations:

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

2 years agoNetflix playback fails with S7353 error
jer.noble@apple.com [Fri, 6 Oct 2017 21:02:11 +0000 (21:02 +0000)]
Netflix playback fails with S7353 error
https://bugs.webkit.org/show_bug.cgi?id=178023

Reviewed by Dean Jackson.

On certain platforms, WebCoreDecompressionSession will fail to produce CVImageBuffers when presented with
encrypted content. On those platforms, the seek() command will fail, because frames at the destination time
cannot be decoded. This occurs for Netflix because the <video> element is not in the DOM at decode time.

Only create a WebCoreDecompressionSession in MediaPlayerPrivateMediaSourceAVFObjC when we have explicitly
been asked to paint into a WebGL canvas.

* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::acceleratedRenderingStateChanged):

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

2 years agoSkipped http/tests/cache/disk-cache/disk-cache-validation-no-body.html on El Capitan...
jlewis3@apple.com [Fri, 6 Oct 2017 20:14:40 +0000 (20:14 +0000)]
Skipped http/tests/cache/disk-cache/disk-cache-validation-no-body.html on El Capitan Release.
https://bugs.webkit.org/show_bug.cgi?id=178019

Unreviewed test gardening.

* platform/mac-wk2/TestExpectations:

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

2 years agoReplace some stack raw pointers with RefPtrs within WebCore/dom
jiewen_tan@apple.com [Fri, 6 Oct 2017 20:10:25 +0000 (20:10 +0000)]
Replace some stack raw pointers with RefPtrs within WebCore/dom
https://bugs.webkit.org/show_bug.cgi?id=177852
<rdar://problem/34804487>

Reviewed by Ryosuke Niwa.

This is an effort to reduce raw pointer usage in DOM code. In this patch,
stack raw pointers that could be freed during their lifetime because of
event dispatching, layout updating and etc are selected. All selections are
basing on code speculation.

No changes in behaviours.

* dom/ContainerNodeAlgorithms.cpp:
(WebCore::addChildNodesToDeletionQueue):
Escalate the RefPtr to where node is first defined.
* dom/Document.cpp:
(WebCore::Document::setVisualUpdatesAllowed):
(WebCore::Document::updateLayout):
(WebCore::Document::updateLayoutIfDimensionsOutOfDate):
Possible layout updates during their lifetime.
(WebCore::Document::implicitClose):
Possible event dispatching during its lifetime.
(WebCore::Document::nodeChildrenWillBeRemoved):
(WebCore::Document::nodeWillBeRemoved):
Possible node removal during their lifetime.
(WebCore::command):
Possible layout updates during its lifetime.
* dom/DocumentMarkerController.cpp:
(WebCore::DocumentMarkerController::renderedRectsForMarkers):
Possible layout updates during its lifetime.
* dom/Element.cpp:
(WebCore::Element::removedFrom):
 Possible event dispatching during its lifetime.
(WebCore::checkForSiblingStyleChanges):
Possible layout updates during their lifetime.
* dom/MouseRelatedEvent.cpp:
(WebCore::MouseRelatedEvent::computeRelativePosition):
Possible layout updates during its lifetime.
* dom/RadioButtonGroups.cpp:
(WebCore::RadioButtonGroup::setCheckedButton):
Possible layout updates during its lifetime.
* dom/SlotAssignment.cpp:
(WebCore::SlotAssignment::didChangeSlot):
Possible layout updates during its lifetime.

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

2 years agoAdd try-bot button on perf analysis status page.
dewei_zhu@apple.com [Fri, 6 Oct 2017 19:54:51 +0000 (19:54 +0000)]
Add try-bot button on perf analysis status page.
https://bugs.webkit.org/show_bug.cgi?id=177995

Reviewed by Ryosuke Niwa.

Add 'Create' button on analysis status top-left corner to create trybot analysis task.

* public/v3/pages/analysis-category-toolbar.js:
(AnalysisCategoryToolbar.cssTemplate):

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

2 years ago[iOS] Tweak support for classifying form controls (followup to r222487)
wenson_hsieh@apple.com [Fri, 6 Oct 2017 18:53:00 +0000 (18:53 +0000)]
[iOS] Tweak support for classifying form controls (followup to r222487)
https://bugs.webkit.org/show_bug.cgi?id=177917
<rdar://problem/34820122>

Reviewed by Dean Jackson.

Source/WebKit:

This patch follows up with <http://trac.webkit.org/r222487>. It combines the functionality of two SPI hooks
implemented on WKContentView into a single method that vends a context dictionary, and additionally addresses an
issue with the original implementation, wherein some cached state on WebPageProxy is set upon starting node
assistance, but is never unset when stopping node assistance, nor set anywhere else. See per-method comments for
more detail.

* UIProcess/WebPageProxy.h:

Remove members m_acceptsAutofilledLoginCredentials and m_representingPageURL from WebPageProxy. This state is
retrieved from the AssistedNodeInformation struct when starting node assistance, but is never reset anywhere
else. Instead of introducing new members to remember this state, we can just use the WKContentView's current
assisted node information.

This also means that programmatically focusing forms (without user gesture) will no longer cause WKContentView
to accept autofilled login credentials, since we bail out of node assistance and don't begin an input session.

* UIProcess/ios/WKContentView.mm:
(-[WKContentView acceptsAutofilledLoginCredentials]): Deleted.
(-[WKContentView representingPageURL]): Deleted.
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _autofillContext]):

Merge functionality of the previous two SPI hooks, such that -_autofillContext will return a non-null dictionary
containing the URL of the focused element's document if and only if WKContentView accepts autofilled login
credentials, and there exists a representing page URL.

When the page stops assisting the focused node, we set the AssistedNodeInformation's element type to None, so we
additionally bail and return nil if the element type is None. As an aside, it seems a more reasonable approach to
resetting state upon stopping node assistance is to just completely reset _assistedNodeInformation to its initial
value, i.e. via _assistedNodeInformation = { }. It's not clear whether there are behaviors relying on the fact
that all members but the element type in the content view's assisted node information could be stale, so this
seems worthy of some investigation.

* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::startAssistingNode):
(WebKit::WebPageProxy::acceptsAutofilledLoginCredentials): Deleted.
(WebKit::WebPageProxy::representingPageURL): Deleted.

Source/WebKitLegacy/mac:

Implement _autofillContext in legacy WebKit, and remove the two previous SPI hooks.

* DOM/DOMHTMLInputElement.mm:
(-[DOMHTMLInputElement _autofillContext]):
(-[DOMHTMLInputElement acceptsAutofilledLoginCredentials]): Deleted.
(-[DOMHTMLInputElement representingPageURL]): Deleted.

Tools:

Minor cleanup around autofill API tests added in r222487. Additionally, augments some of these API tests to
verify that after blurring the focused element, the content view no longer accepts autofill credentials (see
WebKit ChangeLog for more details). Also augments tests to verify that the URL in the autofill context matches
the document URL.

* TestWebKitAPI/Tests/ios/WKWebViewAutofillTests.mm:

Remove the USE(APPLE_INTERNAL_SDK) guard for these API tests.

(newUIKeyboardLoginCredentialsSuggestion):

Add a stub implementation of UIKeyboardLoginCredentialsSuggestion. This allows
[UIKeyboardLoginCredentialsSuggestion new] to return a nonnull object, which allows these API tests to verify
that the credential filling codepath works as intended without any additional UIKit changes. Currently, tests
for the value of username and password fields are passing even though the fields are not being populated because
the expected string values are null, and the observed value is an empty string. We instead check the literal
string values here instead of credentialSuggestion's properties, so that tests verifying the behavior of
-insertTextSuggestion: will require username and password inputs to be populated.

(-[TestInputDelegate _webView:focusShouldStartInputSession:]):
(-[AutofillTestView initWithFrame:]):
(-[AutofillTestView _autofillInputView]):
(-[AutofillTestView textInputHasAutofillContext]):
(TestWebKitAPI::TEST):

Add an additional API test to verify that programmatic focus without user interaction (and also without testing
overrides) does not activate autofill.

(createUIKeyboardLoginCredentialsSuggestion): Deleted.
(-[WKWebView _privateTextInput]): Deleted.
* TestWebKitAPI/ios/UIKitSPI.h:

Minor gardening to remove iOS version >= 11 guards that are now unnecessary. Additionally, add some more private
header imports (with corresponding interface definitions for building and running with the public SDK).

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

2 years agoRootInlineBox should not hold a raw pointer to RenderObject
zalan@apple.com [Fri, 6 Oct 2017 18:47:47 +0000 (18:47 +0000)]
RootInlineBox should not hold a raw pointer to RenderObject
https://bugs.webkit.org/show_bug.cgi?id=178018
<rdar://problem/34859256>

Reviewed by Simon Fraser.

Not resetting the line break object could lead to dereferencing a stale renderer.

Covered by existing tests.

* rendering/RootInlineBox.cpp:
(WebCore::RootInlineBox::RootInlineBox):
(WebCore::RootInlineBox::setLineBreakInfo):
* rendering/RootInlineBox.h:
(WebCore::RootInlineBox::lineBreakObj const):

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

2 years ago[WinCairo] Add shared curl files
commit-queue@webkit.org [Fri, 6 Oct 2017 18:12:14 +0000 (18:12 +0000)]
[WinCairo] Add shared curl files
https://bugs.webkit.org/show_bug.cgi?id=177999

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

* PlatformWin.cmake:
* Shared/Authentication/curl/AuthenticationManagerCurl.cpp: Added.
(WebKit::AuthenticationManager::receivedCredential):
(WebKit::AuthenticationManager::receivedRequestToContinueWithoutCredential):
(WebKit::AuthenticationManager::receivedCancellation):
(WebKit::AuthenticationManager::receivedRequestToPerformDefaultHandling):
(WebKit::AuthenticationManager::receivedChallengeRejection):
* Shared/curl/WebCoreArgumentCodersCurl.cpp: Added.
(IPC::ArgumentCoder<ResourceRequest>::encodePlatformData):
(IPC::ArgumentCoder<ResourceRequest>::decodePlatformData):
(IPC::ArgumentCoder<CertificateInfo>::encode):
(IPC::ArgumentCoder<CertificateInfo>::decode):
(IPC::ArgumentCoder<ResourceError>::encodePlatformData):
(IPC::ArgumentCoder<ResourceError>::decodePlatformData):
(IPC::ArgumentCoder<ProtectionSpace>::encodePlatformData):
(IPC::ArgumentCoder<ProtectionSpace>::decodePlatformData):
(IPC::ArgumentCoder<Credential>::encodePlatformData):
(IPC::ArgumentCoder<Credential>::decodePlatformData):

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

2 years agoWeb Inspector: Network Tab - Make selection in the table more reliable (mousedown...
commit-queue@webkit.org [Fri, 6 Oct 2017 18:03:17 +0000 (18:03 +0000)]
Web Inspector: Network Tab - Make selection in the table more reliable (mousedown instead of click)
https://bugs.webkit.org/show_bug.cgi?id=177990

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

* UserInterface/Views/NetworkTableContentView.js:
(WI.NetworkTableContentView.prototype.tableCellClicked): Deleted.
* UserInterface/Views/Table.js:
(WI.Table.prototype._handleMouseDown):
(WI.Table.prototype._handleClick): Deleted.
Switch to mousedown.

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

2 years agoRemoving some dead code in RTCPeerConnection
commit-queue@webkit.org [Fri, 6 Oct 2017 16:59:41 +0000 (16:59 +0000)]
Removing some dead code in RTCPeerConnection
https://bugs.webkit.org/show_bug.cgi?id=178011

Patch by Youenn Fablet <youenn@apple.com> on 2017-10-06
Reviewed by Alejandro G. Castro.

No change of behavior.
Removing code used by non-libwebrtc WebRTC backends.

* Modules/mediastream/RTCPeerConnection.cpp:
(WebCore::RTCPeerConnection::addTrack):
(WebCore::RTCPeerConnection::removeTrack):
(WebCore::RTCPeerConnection::completeAddTransceiver):

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

2 years agoImageBitmap API stubs
dino@apple.com [Fri, 6 Oct 2017 16:51:47 +0000 (16:51 +0000)]
ImageBitmap API stubs
https://bugs.webkit.org/show_bug.cgi?id=177984
<rdar://problem/34848023>

Patch by Sam and Dean.
Reviewed by Dean and Sam.

Source/WebCore:

Add the IDL for ImageBitmap and ImageBitmapOptions, plus some
stub implementations (complete with all the algorithms from
the HTML specification as comments).

* CMakeLists.txt: Add the new files.
* DerivedSources.make: Create the JS bindings for ImageBitmap and ImageBitmapOptions.
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/CallTracerTypes.h:
* html/ImageBitmap.cpp: Added.
(WebCore::ImageBitmap::create):
(WebCore::ImageBitmap::createPromise):
(WebCore::ImageBitmap::ImageBitmap):
(WebCore::ImageBitmap::~ImageBitmap):
(WebCore::ImageBitmap::width const):
(WebCore::ImageBitmap::height const):
(WebCore::ImageBitmap::close):
* html/ImageBitmap.h: Added.
(WebCore::ImageBitmap::isDetached const):
* html/ImageBitmap.idl: Copied from Source/WebCore/html/canvas/CanvasDrawImage.idl.
* html/ImageBitmapOptions.h: Copied from Source/WebCore/html/canvas/CanvasDrawImage.idl.
* html/ImageBitmapOptions.idl: Copied from Source/WebCore/html/canvas/CanvasDrawImage.idl.
* html/canvas/CanvasDrawImage.idl:
* html/canvas/CanvasFillStrokeStyles.idl:
* html/canvas/CanvasRenderingContext2D.cpp:
(WebCore::size):
(WebCore::CanvasRenderingContext2D::drawImage):
(WebCore::CanvasRenderingContext2D::createPattern):
* html/canvas/CanvasRenderingContext2D.h:
* inspector/InspectorCanvas.cpp:
(WebCore::InspectorCanvas::indexForData):
(WebCore::InspectorCanvas::buildAction):
(WebCore::InspectorCanvas::buildArrayForImageBitmap):
* inspector/InspectorCanvas.h:
* inspector/RecordingSwizzleTypes.h:

LayoutTests:

New global constructors, so go through the pain of updating all
the platform results :(

* js/dom/global-constructors-attributes-expected.txt:
* platform/gtk/js/dom/global-constructors-attributes-expected.txt:
* platform/mac-elcapitan-wk2/js/dom/global-constructors-attributes-expected.txt:
* platform/mac-elcapitan/js/dom/global-constructors-attributes-expected.txt:
* platform/mac-sierra-wk2/js/dom/global-constructors-attributes-expected.txt:
* platform/mac-sierra/js/dom/global-constructors-attributes-expected.txt:
* platform/mac-wk1/js/dom/global-constructors-attributes-expected.txt:
* platform/mac-wk2/js/dom/global-constructors-attributes-expected.txt:
* platform/mac-yosemite/js/dom/global-constructors-attributes-expected.txt:
* platform/mac/js/dom/global-constructors-attributes-expected.txt:
* platform/win/js/dom/global-constructors-attributes-expected.txt:
* platform/wpe/js/dom/global-constructors-attributes-expected.txt:

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

2 years agoCreate bindings for WebGL2's versions of texImage2D.
Ms2ger@igalia.com [Fri, 6 Oct 2017 16:49:50 +0000 (16:49 +0000)]
Create bindings for WebGL2's versions of texImage2D.
https://bugs.webkit.org/show_bug.cgi?id=178006

Reviewed by Dean Jackson.

No new tests: not much point in adding tests now; this method doesn't
do anything anyway.

* html/canvas/WebGL2RenderingContext.cpp:
(WebCore::WebGL2RenderingContext::texImage2D):
* html/canvas/WebGL2RenderingContext.h:
* html/canvas/WebGL2RenderingContext.idl:
* html/canvas/WebGLRenderingContext.idl:
* html/canvas/WebGLRenderingContextBase.idl:

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

2 years agoSandbox rules block PluginProcess using "File Open/Save" dialogs
bfulgham@apple.com [Fri, 6 Oct 2017 16:40:53 +0000 (16:40 +0000)]
Sandbox rules block PluginProcess using "File Open/Save" dialogs
https://bugs.webkit.org/show_bug.cgi?id=177965
<rdar://problem/33976846>

Reviewed by Alexey Proskuryakov.

Update the PluginProcess sandboxes to allow the same XPC services as
the WebContent process. Also allow access to the openAndSavePanelServices.

* PluginProcess/mac/com.apple.WebKit.plugin-common.sb.in:

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

2 years agoWeb Inspector: Improve setting the default / initial sort of a Table
commit-queue@webkit.org [Fri, 6 Oct 2017 16:37:56 +0000 (16:37 +0000)]
Web Inspector: Improve setting the default / initial sort of a Table
https://bugs.webkit.org/show_bug.cgi?id=177989

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

* UserInterface/Views/NetworkTableContentView.js:
(WI.NetworkTableContentView.prototype.initialLayout):
Set the default / initial sort.

* UserInterface/Views/Table.js:
(WI.Table):
(WI.Table.prototype.set sortOrder):
(WI.Table.prototype.set sortColumnIdentifier):
During setup we should always update header views.

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

2 years agoUse one Scavenger thread for all Heaps
fpizlo@apple.com [Fri, 6 Oct 2017 16:34:41 +0000 (16:34 +0000)]
Use one Scavenger thread for all Heaps
https://bugs.webkit.org/show_bug.cgi?id=174973

Reviewed by JF Bastien.

This combines the scavengers from all Heap instances into a single scavenger. It also combines
the accounting for deciding when to run. Each Heap still controls what it means to scavenge
itself (it's all in Heap::scavenge) but the policy decisions are all controlled by Scavenger.
Because Scavenger is also the only thing that needs an AsyncTask, this removes AsyncTask and
moves all of AsyncTask's logic into Scavenger.

This appears to be a 1% progression on JetStream (with high statistical confidence: p = 0.0049).

* bmalloc.xcodeproj/project.pbxproj:
* bmalloc/AsyncTask.h: Removed.
* bmalloc/Heap.cpp:
(bmalloc::Heap::Heap):
(bmalloc::Heap::allocateSmallChunk):
(bmalloc::Heap::allocateSmallPage):
(bmalloc::Heap::deallocateSmallLine):
(bmalloc::Heap::splitAndAllocate):
(bmalloc::Heap::tryAllocateLarge):
(bmalloc::Heap::shrinkLarge):
(bmalloc::Heap::deallocateLarge):
(bmalloc::Heap::concurrentScavenge): Deleted.
(bmalloc::Heap::scheduleScavengerIfUnderMemoryPressure): Deleted.
(bmalloc::Heap::scheduleScavenger): Deleted.
* bmalloc/Heap.h:
* bmalloc/Scavenger.cpp:
(bmalloc::Scavenger::Scavenger):
(bmalloc::Scavenger::run):
(bmalloc::Scavenger::runHoldingLock):
(bmalloc::Scavenger::runSoon):
(bmalloc::Scavenger::runSoonHoldingLock):
(bmalloc::Scavenger::didStartGrowing):
(bmalloc::Scavenger::scheduleIfUnderMemoryPressure):
(bmalloc::Scavenger::scheduleIfUnderMemoryPressureHoldingLock):
(bmalloc::Scavenger::schedule):
(bmalloc::Scavenger::threadEntryPoint):
(bmalloc::Scavenger::threadRunLoop):
(bmalloc::Scavenger::setSelfQOSClass):
* bmalloc/Scavenger.h:
(bmalloc::Scavenger::willRun):
(bmalloc::Scavenger::willRunSoon):

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

2 years agoAvoid integer overflow in DFGStrengthReduction.cpp
rmorisset@apple.com [Fri, 6 Oct 2017 16:33:42 +0000 (16:33 +0000)]
Avoid integer overflow in DFGStrengthReduction.cpp
https://bugs.webkit.org/show_bug.cgi?id=177944

Reviewed by Saam Barati.

The check that we won't do integer overflow by negating INT32_MIN was itself an integer overflow.
I think that signed integer overflow is undefined behaviour in C, so I replace it by an explicit check that value != INT32_MIN instead.

* dfg/DFGStrengthReductionPhase.cpp:
(JSC::DFG::StrengthReductionPhase::handleNode):

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

2 years agoAdd (entirely incorrect) fetching of ServiceWorker scripts.
beidson@apple.com [Fri, 6 Oct 2017 16:20:04 +0000 (16:20 +0000)]
Add (entirely incorrect) fetching of ServiceWorker scripts.
https://bugs.webkit.org/show_bug.cgi?id=176179

Reviewed by Andy Estes.

Source/WebCore:

No new tests (Covered by changes to existing tests).

When the Storage process is running the "Update" algorithm and a ServiceWorker script file needs to be fetched, this patch:
  - Messages back to the WebContent process that started the register/update job
  - Executes a FetchLoad in that script context for the script
  - Sends the results back to the Storage process

We don't do anything with the results yet.

Soon.

* WebCore.xcodeproj/project.pbxproj:

* workers/WorkerScriptLoader.cpp:
(WebCore::WorkerScriptLoader::didFail):
* workers/WorkerScriptLoader.h:
(WebCore::WorkerScriptLoader::error const):

* workers/WorkerScriptLoaderClient.h:
(WebCore::WorkerScriptLoaderClient::~WorkerScriptLoaderClient):
(WebCore::WorkerScriptLoaderClient::didReceiveResponse): Deleted.
(WebCore::WorkerScriptLoaderClient::notifyFinished): Deleted.

* workers/service/ServiceWorkerContainer.cpp:
(WebCore::ServiceWorkerContainer::startScriptFetchForJob):
(WebCore::ServiceWorkerContainer::jobFinishedLoadingScript):
(WebCore::ServiceWorkerContainer::jobFailedLoadingScript):
* workers/service/ServiceWorkerContainer.h:

* workers/service/ServiceWorkerFetchResult.h: Copied from Source/WebCore/workers/service/server/SWClientConnection.h.
(WebCore::ServiceWorkerFetchResult::encode const):
(WebCore::ServiceWorkerFetchResult::decode):

* workers/service/ServiceWorkerJob.cpp:
(WebCore::ServiceWorkerJob::startScriptFetch):
(WebCore::ServiceWorkerJob::fetchScriptWithContext):
(WebCore::ServiceWorkerJob::didReceiveResponse):
(WebCore::ServiceWorkerJob::notifyFinished):
* workers/service/ServiceWorkerJob.h:
* workers/service/ServiceWorkerJobClient.h:

* workers/service/server/SWClientConnection.cpp:
(WebCore::SWClientConnection::finishedFetchingScript):
(WebCore::SWClientConnection::failedFetchingScript):
(WebCore::SWClientConnection::startScriptFetchForServer):
* workers/service/server/SWClientConnection.h:

* workers/service/server/SWServer.cpp:
(WebCore::SWServer::Connection::finishFetchingScriptInServer):
(WebCore::SWServer::startScriptFetch):
(WebCore::SWServer::scriptFetchFinished):
* workers/service/server/SWServer.h:

* workers/service/server/SWServerRegistration.cpp:
(WebCore::SWServerRegistration::scriptFetchFinished):
(WebCore::SWServerRegistration::runUpdateJob):
(WebCore::SWServerRegistration::startScriptFetchFromMainThread):
(WebCore::SWServerRegistration::startScriptFetchForCurrentJob):
* workers/service/server/SWServerRegistration.h:

Source/WebKit:

* StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
(WebKit::WebSWServerConnection::startScriptFetchInClient):
* StorageProcess/ServiceWorker/WebSWServerConnection.h:
* StorageProcess/ServiceWorker/WebSWServerConnection.messages.in:

* WebProcess/Storage/WebSWClientConnection.cpp:
(WebKit::WebSWClientConnection::finishFetchingScriptInServer):
* WebProcess/Storage/WebSWClientConnection.h:
* WebProcess/Storage/WebSWClientConnection.messages.in:

LayoutTests:

* http/tests/workers/service/basic-register-exceptions-expected.txt:
* http/tests/workers/service/basic-register-expected.txt:
* http/tests/workers/service/resources/basic-register-exceptions.js:
* http/tests/workers/service/resources/basic-register.js:
* http/tests/workers/service/resources/registration-task-queue-scheduling-1.js:

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

2 years agoRebaseline js/dom/global-constructors-attributes.html
ryanhaddad@apple.com [Fri, 6 Oct 2017 15:06:25 +0000 (15:06 +0000)]
Rebaseline js/dom/global-constructors-attributes.html

Unreviewed test gardening.

* platform/mac-elcapitan-wk2/js/dom/global-constructors-attributes-expected.txt:
* platform/mac-sierra/js/dom/global-constructors-attributes-expected.txt:
* platform/mac/js/dom/global-constructors-attributes-expected.txt:

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

2 years agoSkip editing/pasteboard/data-transfer-items.html on iOS.
ryanhaddad@apple.com [Fri, 6 Oct 2017 15:01:48 +0000 (15:01 +0000)]
Skip editing/pasteboard/data-transfer-items.html on iOS.
https://bugs.webkit.org/show_bug.cgi?id=177961

Unreviewed test gardening.

* platform/ios/TestExpectations:

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

2 years agoMinor WeakPtr improvements
antti@apple.com [Fri, 6 Oct 2017 13:08:58 +0000 (13:08 +0000)]
Minor WeakPtr improvements
https://bugs.webkit.org/show_bug.cgi?id=177958

Reviewed by Sam Weinig.

Source/WTF:

* wtf/WeakPtr.h:
(WTF::WeakPtr::operator bool const):

    Make explicit.

(WTF::WeakPtrFactory::createWeakPtr const):
(WTF::makeWeakPtr):

    Remove templating from createWeakPtr, makeWeakPtr() is now the
    canonical way to make derived-type WeakPtrs.

Tools:

* TestWebKitAPI/Tests/WTF/WeakPtr.cpp:
(TestWebKitAPI::TEST):
(TestWebKitAPI::Base::createWeakPtr): Deleted.

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

2 years agoUnreviewed. Fix parsing of GTK unit tests output in bot configuration.
carlosgc@webkit.org [Fri, 6 Oct 2017 13:05:57 +0000 (13:05 +0000)]
Unreviewed. Fix parsing of GTK unit tests output in bot configuration.

* BuildSlaveSupport/build.webkit.org-config/master.cfg:
(RunGtkAPITests.commandComplete): Remove trailing ':' from the regular expression.

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

2 years ago[Cairo] Create Cairo patterns from Gradient objects on-the-fly
zandobersek@gmail.com [Fri, 6 Oct 2017 10:44:53 +0000 (10:44 +0000)]
[Cairo] Create Cairo patterns from Gradient objects on-the-fly
https://bugs.webkit.org/show_bug.cgi?id=177947

Reviewed by Carlos Garcia Campos.

Stop caching cairo_pattern_t objects for a specific global alpha value
in the Gradient class. Instead, create these as required, for whatever
alpha value. This drops some efficiency benefits in exchange for better
Cairo operation isolation, while also matching the same approach that
is used in the Pattern implementation for Cairo.

Introduce the createPlatformGradient() method for Cairo, resuing the
implementation of platformGradient() that's now removed. The
Cairo-specific setPlatformGradientSpaceTransform() method is also
removed since there's no cached cairo_pattern_t object that we can
update. The Cairo-specific m_platformGradientAlpha member float is also
deleted.

Gradient::fill() and prepareCairoContextSource() are the only two places
that need to create a cairo_pattern_t object off of Gradient, so they
are updated accordingly.

No new tests -- no changes in behavior.

* platform/graphics/Gradient.cpp:
(WebCore::Gradient::setGradientSpaceTransform):
(WebCore::Gradient::setPlatformGradientSpaceTransform): Deleted.
* platform/graphics/Gradient.h:
* platform/graphics/cairo/GradientCairo.cpp:
(WebCore::Gradient::platformDestroy):
(WebCore::Gradient::createPlatformGradient):
(WebCore::Gradient::fill):
(WebCore::Gradient::platformGradient): Deleted.
(WebCore::Gradient::setPlatformGradientSpaceTransform): Deleted.
* platform/graphics/cairo/PlatformContextCairo.cpp:
(WebCore::prepareCairoContextSource):

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

2 years agoCreate bindings for WebGL2's versions of compressedTexImage2D.
Ms2ger@igalia.com [Fri, 6 Oct 2017 10:22:37 +0000 (10:22 +0000)]
Create bindings for WebGL2's versions of compressedTexImage2D.
https://bugs.webkit.org/show_bug.cgi?id=177481

Reviewed by Žan Doberšek.

No new tests: not much point in adding tests now; this method doesn't
do anything anyway.

* html/canvas/WebGL2RenderingContext.cpp:
(WebCore::WebGL2RenderingContext::compressedTexImage2D):
* html/canvas/WebGL2RenderingContext.h:
* html/canvas/WebGL2RenderingContext.idl:
* html/canvas/WebGLRenderingContext.idl:
* html/canvas/WebGLRenderingContextBase.idl:

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

2 years ago[GTK] 2 text tests failing since r222838
tpopela@redhat.com [Fri, 6 Oct 2017 10:16:51 +0000 (10:16 +0000)]
[GTK] 2 text tests failing since r222838
https://bugs.webkit.org/show_bug.cgi?id=177938

Reviewed by Carlos Garcia Campos.

These tests are passing after r222907

* platform/gtk/TestExpectations:

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

2 years ago[GStreamer][MSE] Likely race condition causes WTF::Deque to crash on debug
eocanha@igalia.com [Fri, 6 Oct 2017 09:43:25 +0000 (09:43 +0000)]
[GStreamer][MSE] Likely race condition causes WTF::Deque to crash on debug
https://bugs.webkit.org/show_bug.cgi?id=177410

Reviewed by Xabier Rodriguez-Calvar.

Deque keeps a chain of iterators which is updated as iterators are
created/destroyed. This can cause problems when iterators are created
from multiple threads as they are now, sometimes without proper
locking because it's not actually needed.

For instance, the lock in PlaybackPipeline::enqueueSample() is not
needed because none of the accesses are actually risky. Locking there
just to make Deque happy would only cause a performance penalty on the
readers working in other threads.

No new tests.

* platform/graphics/gstreamer/mse/PlaybackPipeline.cpp:
(WebCore::PlaybackPipeline::addSourceBuffer): Use Vector instead of
Deque.
(WebCore::PlaybackPipeline::removeSourceBuffer): Ditto.
(WebCore::PlaybackPipeline::enqueueSample): Remove lock and explain
why it's not needed.
* platform/graphics/gstreamer/mse/WebKitMediaSourceGStreamer.cpp:
(webKitMediaSrcFinalize): Use Vector.
* platform/graphics/gstreamer/mse/WebKitMediaSourceGStreamerPrivate.h:
Use Vector.

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

2 years agoRemove dead code from Pattern
zandobersek@gmail.com [Fri, 6 Oct 2017 09:30:58 +0000 (09:30 +0000)]
Remove dead code from Pattern
https://bugs.webkit.org/show_bug.cgi?id=177945

Reviewed by Carlos Garcia Campos.

Drop the platormDestroy() and setPlatformPatternSpaceTransform() methods
from the Pattern class -- these were empty implementations, with no port
providing their own. The destructor is defaulted in the implementation
file. The m_pattern member variable is also dropped as it was unused.

No new tests -- no change in behavior.

* platform/graphics/Pattern.cpp:
(WebCore::Pattern::setPatternSpaceTransform):
(WebCore::Pattern::~Pattern): Deleted.
(WebCore::Pattern::platformDestroy): Deleted.
(WebCore::Pattern::setPlatformPatternSpaceTransform): Deleted.
* platform/graphics/Pattern.h:

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

2 years agoDisable bmalloc when running Valgrind
cturner@igalia.com [Fri, 6 Oct 2017 09:01:22 +0000 (09:01 +0000)]
Disable bmalloc when running Valgrind
https://bugs.webkit.org/show_bug.cgi?id=177923

Reviewed by Carlos Alberto Lopez Perez.

* Scripts/webkitpy/port/gtk.py:
(GtkPort.setup_environ_for_server):

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

2 years ago[GTK][Clang] Build fix after r222926
clopez@igalia.com [Fri, 6 Oct 2017 08:52:33 +0000 (08:52 +0000)]
[GTK][Clang] Build fix after r222926
https://bugs.webkit.org/show_bug.cgi?id=175384

Unreviewed build fix.

* css/CSSFontFace.cpp:
(WebCore::CSSFontFace::setStatus):

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

2 years agoImplement TestController::platformContext() for WPE, returning the
zandobersek@gmail.com [Fri, 6 Oct 2017 08:36:36 +0000 (08:36 +0000)]
Implement TestController::platformContext() for WPE, returning the
m_context pointer as the GTK+ port does. This fixes the crashes on
the WPE testers.

Rubber-stamped by Carlos Garcia Campos.

* WebKitTestRunner/wpe/TestControllerWPE.cpp:
(WTR::TestController::platformContext):

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

2 years ago[GTK][WPE] Add API to configure and enable resource load statistics
carlosgc@webkit.org [Fri, 6 Oct 2017 07:47:01 +0000 (07:47 +0000)]
[GTK][WPE] Add API to configure and enable resource load statistics
https://bugs.webkit.org/show_bug.cgi?id=177943

Reviewed by Michael Catanzaro.

Source/WebKit:

Add new WebKitWebsiteDataManager construct only property to set the directory where the persistent stats are
stored, and methods to enable resource load statistics and query whether it's currently enabled. Also add a new
Website data type to be able to remove the persistent stats using WebKitWebsiteDataManager existing API.

* UIProcess/API/glib/WebKitWebContext.cpp:
(websiteDataStoreConfigurationForWebProcessPoolConfiguration):
(webkitWebContextConstructed):
* UIProcess/API/glib/WebKitWebsiteData.cpp:
(recordContainsSupportedDataTypes):
(toWebKitWebsiteDataTypes):
* UIProcess/API/glib/WebKitWebsiteDataManager.cpp:
(webkitWebsiteDataManagerGetProperty):
(webkitWebsiteDataManagerSetProperty):
(webkitWebsiteDataManagerConstructed):
(webkit_website_data_manager_class_init):
(webkitWebsiteDataManagerGetDataStore):
(webkit_website_data_manager_get_resource_load_stats_directory):
(webkit_website_data_manager_set_resource_load_stats_enabled):
(webkit_website_data_manager_get_resource_load_stats_enabled):
(toWebsiteDataTypes):
* UIProcess/API/gtk/WebKitWebsiteData.h:
* UIProcess/API/gtk/WebKitWebsiteDataManager.h:
* UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
* UIProcess/API/wpe/WebKitWebsiteData.h:
* UIProcess/API/wpe/WebKitWebsiteDataManager.h:

Tools:

Add a command line option to enable intelligent tracking prevention to MiniBrowser and tests cases to check the
new API.

* MiniBrowser/gtk/main.c:
(main):
* TestWebKitAPI/Tests/WebKitGLib/TestWebsiteData.cpp:
(serverCallback):
(testWebsiteDataConfiguration):
(testWebsiteDataEphemeral):
(testWebsiteDataResourceLoadStats):
(beforeAll):
* TestWebKitAPI/glib/WebKitGLib/TestMain.h:
(Test::Test):
* TestWebKitAPI/glib/WebKitGLib/WebViewTest.cpp:
(directoryChangedCallback):
(WebViewTest::waitUntilFileExists):
* TestWebKitAPI/glib/WebKitGLib/WebViewTest.h:

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

2 years ago[MSE][GStreamer] Seek on youtube.com/tv fails after r217185
eocanha@igalia.com [Fri, 6 Oct 2017 07:44:11 +0000 (07:44 +0000)]
[MSE][GStreamer] Seek on youtube.com/tv fails after r217185
https://bugs.webkit.org/show_bug.cgi?id=177976

Reviewed by Jer Noble.

Covered by existing tests.

* Modules/mediasource/MediaSource.cpp:
(WebCore::MediaSource::seekToTime): Only call waitForSeekCompleted()
when the time is not buffered when using GStreamer.

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

2 years ago[MSE] Dead code in SourceBuffer::appendBufferTimerFired()
eocanha@igalia.com [Fri, 6 Oct 2017 07:43:53 +0000 (07:43 +0000)]
[MSE] Dead code in SourceBuffer::appendBufferTimerFired()
https://bugs.webkit.org/show_bug.cgi?id=177951

Reviewed by Jer Noble.

Covered by LayoutTests/imported/w3c/web-platform-tests/media-source/mediasource-append-buffer.html.

* Modules/mediasource/SourceBuffer.cpp:
(WebCore::SourceBuffer::appendBufferTimerFired): Remove redundant code.

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

2 years agoSplit StaticPasteboard::writeString into writeString and writeStringInCustomData
rniwa@webkit.org [Fri, 6 Oct 2017 07:30:20 +0000 (07:30 +0000)]
Split StaticPasteboard::writeString into writeString and writeStringInCustomData
https://bugs.webkit.org/show_bug.cgi?id=177991

Reviewed by Wenson Hsieh.

Split writeString into the one that writes into the plaform pasteboard natively and the custom pasteboard data like we did
in r222680 for readString and readStringInCustomData.

* dom/DataTransfer.cpp:
(WebCore::DataTransfer::setData):
(WebCore::DataTransfer::setDataFromItemList): Extracted out of setData.
* dom/DataTransfer.h:
* dom/DataTransferItemList.cpp:
(WebCore::DataTransferItemList::add):
* platform/StaticPasteboard.cpp:
(WebCore::updateTypes): Extacted out of writeString.
(WebCore::StaticPasteboard::writeString):
(WebCore::StaticPasteboard::writeStringInCustomData):
* platform/StaticPasteboard.h:

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

2 years ago[WebGL] Safari performance is slow due to high MSAA usage
dino@apple.com [Fri, 6 Oct 2017 06:52:16 +0000 (06:52 +0000)]
[WebGL] Safari performance is slow due to high MSAA usage
https://bugs.webkit.org/show_bug.cgi?id=177949
<rdar://problem/34835619>

Reviewed by Sam Weinig.

On some hardware, typically integrated GPUs, using MSAA with a sample
count above 4 produces bad performance. Limit the number of samples to
4 universally.

* platform/graphics/opengl/GraphicsContext3DOpenGL.cpp:
(WebCore::GraphicsContext3D::reshapeFBOs):

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

2 years ago[GTK][WPE] All resource load statistics tests added in r212183 crash in GTK bots...
carlosgc@webkit.org [Fri, 6 Oct 2017 06:48:38 +0000 (06:48 +0000)]
[GTK][WPE] All resource load statistics tests added in r212183 crash in GTK bots, timeout in GTK and WPE bots since r219049
https://bugs.webkit.org/show_bug.cgi?id=168171

Reviewed by Chris Dumez.

Source/WebCore:

Add an implementation of FileMonitor for GLib based ports.

* PlatformGTK.cmake:
* PlatformWPE.cmake:
* platform/FileMonitor.cpp:
* platform/FileMonitor.h:
* platform/glib/FileMonitorGLib.cpp: Added.
(WebCore::FileMonitor::FileMonitor):
(WebCore::FileMonitor::~FileMonitor):
(WebCore::FileMonitor::fileChangedCallback):
(WebCore::FileMonitor::didChange):

Source/WebKit:

Add C API to handle all resource load statistics requests made by the layout tests.

* UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
(WKWebsiteDataStoreSetStatisticsLastSeen):
(WKWebsiteDataStoreSetStatisticsPrevalentResource):
(WKWebsiteDataStoreIsStatisticsPrevalentResource):
(WKWebsiteDataStoreSetStatisticsHasHadUserInteraction):
(WKWebsiteDataStoreIsStatisticsHasHadUserInteraction):
(WKWebsiteDataStoreSetStatisticsGrandfathered):
(WKWebsiteDataStoreIsStatisticsGrandfathered):
(WKWebsiteDataStoreSetStatisticsSubframeUnderTopFrameOrigin):
(WKWebsiteDataStoreSetStatisticsSubresourceUnderTopFrameOrigin):
(WKWebsiteDataStoreSetStatisticsSubresourceUniqueRedirectTo):
(WKWebsiteDataStoreSetStatisticsTimeToLiveUserInteraction):
(WKWebsiteDataStoreSetStatisticsTimeToLiveCookiePartitionFree):
(WKWebsiteDataStoreStatisticsProcessStatisticsAndDataRecords):
(WKWebsiteDataStoreStatisticsUpdateCookiePartitioning):
(WKWebsiteDataStoreSetStatisticsShouldPartitionCookiesForHost):
(WKWebsiteDataStoreStatisticsSubmitTelemetry):
(WKWebsiteDataStoreSetStatisticsNotifyPagesWhenDataRecordsWereScanned):
(WKWebsiteDataStoreSetStatisticsShouldClassifyResourcesBeforeDataRecordsRemoval):
(WKWebsiteDataStoreSetStatisticsNotifyPagesWhenTelemetryWasCaptured):
(WKWebsiteDataStoreSetStatisticsMinimumTimeBetweenDataRecordsRemoval):
(WKWebsiteDataStoreSetStatisticsGrandfatheringTime):
(WKWebsiteDataStoreSetStatisticsMaxStatisticsEntries):
(WKWebsiteDataStoreSetStatisticsPruneEntriesDownTo):
(WKWebsiteDataStoreStatisticsClearInMemoryAndPersistentStore):
(WKWebsiteDataStoreStatisticsClearInMemoryAndPersistentStoreModifiedSinceHours):
(WKWebsiteDataStoreStatisticsClearThroughWebsiteDataRemoval):
(WKWebsiteDataStoreStatisticsResetToConsistentState):
* UIProcess/API/C/WKWebsiteDataStoreRef.h:

Tools:

Implement all resource load statistics functions in TestController using the C API. Also enable the FileMonitor
unit test. This test requires a platform implementation of Util::run(), so I've added UtilitiesGLib.cpp with an
iplementation common to glib based ports using WTF RunLoop abstraction.

* TestWebKitAPI/PlatformGTK.cmake:
* TestWebKitAPI/PlatformWPE.cmake:
* TestWebKitAPI/Tests/WebCore/FileMonitor.cpp:
* TestWebKitAPI/glib/UtilitiesGLib.cpp: Copied from Source/WebKit/UIProcess/API/C/WKWebsiteDataStoreRef.h.
(TestWebKitAPI::Util::run):
(TestWebKitAPI::Util::spinRunLoop):
(TestWebKitAPI::Util::sleep):
* TestWebKitAPI/gtk/PlatformUtilitiesGtk.cpp:
* TestWebKitAPI/wpe/PlatformUtilitiesWPE.cpp:
* WebKitTestRunner/TestController.cpp:
(WTR::TestController::platformAdjustContext):
(WTR::TestController::setStatisticsLastSeen):
(WTR::TestController::setStatisticsPrevalentResource):
(WTR::ResourceStatisticsCallbackContext::ResourceStatisticsCallbackContext):
(WTR::resourceStatisticsCallback):
(WTR::TestController::isStatisticsPrevalentResource):
(WTR::TestController::setStatisticsHasHadUserInteraction):
(WTR::TestController::isStatisticsHasHadUserInteraction):
(WTR::TestController::setStatisticsGrandfathered):
(WTR::TestController::isStatisticsGrandfathered):
(WTR::TestController::setStatisticsSubframeUnderTopFrameOrigin):
(WTR::TestController::setStatisticsSubresourceUnderTopFrameOrigin):
(WTR::TestController::setStatisticsSubresourceUniqueRedirectTo):
(WTR::TestController::setStatisticsTimeToLiveUserInteraction):
(WTR::TestController::setStatisticsTimeToLiveCookiePartitionFree):
(WTR::TestController::statisticsProcessStatisticsAndDataRecords):
(WTR::TestController::statisticsUpdateCookiePartitioning):
(WTR::TestController::statisticsSetShouldPartitionCookiesForHost):
(WTR::TestController::statisticsSubmitTelemetry):
(WTR::TestController::setStatisticsNotifyPagesWhenDataRecordsWereScanned):
(WTR::TestController::setStatisticsShouldClassifyResourcesBeforeDataRecordsRemoval):
(WTR::TestController::setStatisticsNotifyPagesWhenTelemetryWasCaptured):
(WTR::TestController::setStatisticsMinimumTimeBetweenDataRecordsRemoval):
(WTR::TestController::setStatisticsGrandfatheringTime):
(WTR::TestController::setStatisticsMaxStatisticsEntries):
(WTR::TestController::setStatisticsPruneEntriesDownTo):
(WTR::TestController::statisticsClearInMemoryAndPersistentStore):
(WTR::TestController::statisticsClearInMemoryAndPersistentStoreModifiedSinceHours):
(WTR::TestController::statisticsClearThroughWebsiteDataRemovalCallback):
(WTR::TestController::statisticsClearThroughWebsiteDataRemoval):
(WTR::TestController::statisticsResetToConsistentState):
* WebKitTestRunner/TestController.h:

LayoutTests:

Unskip the tests.

* platform/wpe/TestExpectations:
* platform/wpe/TestExpectations:

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

2 years agoLots of missing frames in YouTube360 when fullscreen on MacBook
dino@apple.com [Fri, 6 Oct 2017 06:37:16 +0000 (06:37 +0000)]
Lots of missing frames in YouTube360 when fullscreen on MacBook
https://bugs.webkit.org/show_bug.cgi?id=177903
<rdar://problem/33273300>

Reviewed by Sam Weinig.

Source/WebCore:

Our compositing path for WebGL on macOS was too slow, requiring a copy
of the framebuffer into another GL context. Replace this by having
WebGL render into a texture that is backed by an IOSurface, and then
set the WebGLLayer to use the IOSurface as contents.

Covered by the existing WebGL tests.

* platform/graphics/GraphicsContext3D.h:
(WebCore::GraphicsContext3D::platformTexture const): We no longer use the
framebuffer object outside the class, so change this to return the GL texture
that the framebuffer is rendering in to. It was kind-of strange that it was
named this way originally.
Also make endPaint available on macOS, and add the definitions for
createIOSurfaceBackingStore and updateFramebufferTextureBackingStoreFromLayer.

* platform/graphics/cocoa/GraphicsContext3DCocoa.mm:
(WebCore::GraphicsContext3D::GraphicsContext3D): Now that we're using an IOSurface,
we're binding to a new attachment point, GL_TEXTURE_RECTANGLE.
(WebCore::GraphicsContext3D::endPaint): This is now being called on macOS and iOS,
so add a comment that explains the extra work that iOS needs to do. At some future
point it would be nice to make this slightly cleaner, so that iOS and macOS are
more similar.
(WebCore::GraphicsContext3D::allocateIOSurfaceBackingStore): New function that calls
into the corresponding WebGLLayer function.
(WebCore::GraphicsContext3D::updateFramebufferTextureBackingStoreFromLayer): Ditto.

* platform/graphics/opengl/GraphicsContext3DOpenGL.cpp:
(WebCore::wipeAlphaChannelFromPixels): Both readPixels and drawing a WebGL context
into another buffer need to fill out the alpha channel if this context was
created without one, otherwise the IOSurface backing store will happily provide
what might be non-zero values.
(WebCore::GraphicsContext3D::readPixelsAndConvertToBGRAIfNecessary): Call the helper above.
(WebCore::GraphicsContext3D::reshapeFBOs): Add more code to call into the macOS-specific
function to use an IOSurface as the framebuffer texture.
(WebCore::GraphicsContext3D::readPixels): Call the helper above.

* platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
(PlatformCALayerCocoa::copyContentsFromLayer): Replace the use of the
deprecated setContentsChanged with reloadValueForKeyPath.

* platform/graphics/cocoa/WebGLLayer.h: The macOS implementation now
inherits from CALayer directly rather than CAOpenGLLayer. It also adds
a few member variables to handle the IOSurfaces used for triple buffering.

* platform/graphics/cocoa/WebGLLayer.mm:
(-[WebGLLayer initWithGraphicsContext3D:]): If we were created without an
alpha channel, tell CA that we're an opaque layer. Also set the layer's transform
to identity, so that it calls into the code below to flip the contents.
(-[WebGLLayer setTransform:]): Because an IOSurface is used for the layer contents,
we don't get a chance to flip the drawing the way we do via the drawInContext delegate.
Instead we have to apply a scale(1, -1) transform on top of the layer transform to
make sure the layer is rendered right-way up.
(-[WebGLLayer setAnchorPoint:]): Ditto, except we have to assume the anchor point is
at the bottom of the layer, so flip the Y value.
(-[WebGLLayer display]): Swap between the drawing buffer and the contents buffer, and
then get a new buffer ready for display.
(createAppropriateIOSurface): Helper.
(-[WebGLLayer allocateIOSurfaceBackingStoreWithSize:usingAlpha:]): Initializes the
IOSurfaces used for drawing buffers.
(-[WebGLLayer bindFramebufferToNextAvailableSurface]): Take the next available IOSurface and
make it the drawing buffer (binding in to WebGL at the same time).
(-[WebGLLayer copyCGLPixelFormatForDisplayMask:]): Deleted.
(-[WebGLLayer copyCGLContextForPixelFormat:]): Deleted.
(-[WebGLLayer drawInCGLContext:pixelFormat:forLayerTime:displayTime:]): Deleted.

* platform/graphics/mac/WebLayer.mm: Remove the definition of reloadValueForKeyPath.

Source/WebCore/PAL:

Add reloadValueForKeyPath to replace setContentsChanged on CALayer.

* pal/spi/cocoa/QuartzCoreSPI.h:

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

2 years agoUpdate Source/ThirdParty/woff2 to 22c256bc457777744ba14b7325a6e8e0e7dec91c
commit-queue@webkit.org [Fri, 6 Oct 2017 06:32:57 +0000 (06:32 +0000)]
Update Source/ThirdParty/woff2 to 22c256bc457777744ba14b7325a6e8e0e7dec91c
https://bugs.webkit.org/show_bug.cgi?id=177994

Patch by Frederic Wang <fwang@igalia.com> on 2017-10-05
Reviewed by Michael Catanzaro.

Source/ThirdParty:

* woff2/CMakeLists.txt: Also consider the directory for public headers.
* woff2/README.webkit:
* woff2/include/woff2/decode.h: Renamed from Source/ThirdParty/woff2/src/woff2_dec.h.
* woff2/include/woff2/encode.h: Renamed from Source/ThirdParty/woff2/src/woff2_enc.h.
(woff2::WOFF2Params::WOFF2Params):
* woff2/include/woff2/output.h: Renamed from Source/ThirdParty/woff2/src/woff2_out.h.
(woff2::WOFF2Out::~WOFF2Out):
(woff2::WOFF2StringOut::MaxSize):
* woff2/src/buffer.h:
* woff2/src/convert_woff2ttf_*.cc:
* woff2/src/file.h:
* woff2/src/font.cc:
* woff2/src/font.h:
* woff2/src/glyph.cc:
* woff2/src/glyph.h:
* woff2/src/normalize.cc:
* woff2/src/normalize.h:
* woff2/src/port.h:
* woff2/src/round.h:
* woff2/src/store_bytes.h:
* woff2/src/table_tags.cc:
* woff2/src/table_tags.h:
* woff2/src/transform.cc:
* woff2/src/transform.h:
* woff2/src/variable_length.cc:
* woff2/src/variable_length.h:
* woff2/src/woff2_common.cc:
* woff2/src/woff2_common.h:
* woff2/src/woff2_compress.cc:
* woff2/src/woff2_dec.cc:
* woff2/src/woff2_decompress.cc:
* woff2/src/woff2_enc.cc:
* woff2/src/woff2_info.cc:
* woff2/src/woff2_out.cc:
* woff2/update.sh: Also consider directory for public headers.

Source/WebCore:

No new tests, already covered by existing tests.

* CMakeLists.txt: Include the directory for public headers instead.
* platform/graphics/WOFFFileFormat.cpp: Use the public header
woff2/decode.h and do not use the "wOF2" constant from private headers.
(WebCore::isWOFF):
(WebCore::convertWOFFToSfnt):

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

2 years agoWeb Inspector: Styles Redesign: Add support for keyboard navigation (Tab, Shift-Tab...
nvasilyev@apple.com [Fri, 6 Oct 2017 05:48:19 +0000 (05:48 +0000)]
Web Inspector: Styles Redesign: Add support for keyboard navigation (Tab, Shift-Tab, Enter, Esc)
https://bugs.webkit.org/show_bug.cgi?id=177711

Reviewed by Joseph Pecoraro.

Source/WebInspectorUI:

Enter, Tab, Shift-Tab should commit changes.
Escape should discard changes.

Tab and Enter should navigate forward (focus on the next field).
Shift-Tab should navigate backward (focus on the previous field).
Esc should not change the focus.

When navigating forward from:

- Selector: Focus on the first property name. If it doesn’t exist, create a blank property.

- Property name:
  - If property name is blank, discard the property and focus on the next editable field (property name or selector of the next rule).
  - If property is not blank, focus on the value.

- Property value:
  - If the last value in the rule, create a blank property and focus on its name.
  - If not the last value in the rule, focus on the next editable field (property name or selector of the next rule).

When navigating backward from:

- Selector: create a blank property on the previous editable rule and focus on its name.

- Property name:
  - Focus on the rule's selector.

- Property value:
  - Focus on the property name.

* UserInterface/Base/Utilities.js:
(Event.prototype.stop):
* UserInterface/Main.html:
Add new files. Keep one class per file.

* UserInterface/Models/CSSProperty.js:
(WI.CSSProperty.prototype.remove):
(WI.CSSProperty.prototype.set name):
(WI.CSSProperty.prototype.set rawValue):
(WI.CSSProperty.prototype.get editable):
(WI.CSSProperty.prototype._updateStyleText):
(WI.CSSProperty.prototype._updateOwnerStyleText):
Update indices and ranges of properties following the edited one to prevent data corruption.

* UserInterface/Models/CSSStyleDeclaration.js:
(WI.CSSStyleDeclaration.prototype.get selectorEditable):
(WI.CSSStyleDeclaration.prototype.set text):
(WI.CSSStyleDeclaration.prototype.newBlankProperty):
(WI.CSSStyleDeclaration.prototype.shiftPropertiesAfter):
(WI.CSSStyleDeclaration.prototype._rangeAfterPropertyAtIndex):
Implement adding new blank properties.

* UserInterface/Models/TextRange.js:
(WI.TextRange.prototype.cloneAndModify):
Add an assert to catch negative number errors.

(WI.TextRange.prototype.collapseToEnd):
Add a utility function akin Selection.prototype.collapseToEnd.

* UserInterface/Views/CSSStyleDeclarationTextEditor.js:
(WI.CSSStyleDeclarationTextEditor.prototype._handleShiftTabKey):
(WI.CSSStyleDeclarationTextEditor.prototype._handleTabKey):
(WI.CSSStyleDeclarationTextEditor.prototype._formattedContent):
Move PrefixWhitespace from a view to a model (WI.CSSStyleDeclaration.PrefixWhitespace),
since it's already used in the model.

* UserInterface/Views/SpreadsheetCSSStyleDeclarationEditor.css:
(.spreadsheet-style-declaration-editor :matches(.name, .value).editing):
* UserInterface/Views/SpreadsheetCSSStyleDeclarationEditor.js:
(WI.SpreadsheetCSSStyleDeclarationEditor):
(WI.SpreadsheetCSSStyleDeclarationEditor.prototype.layout):
(WI.SpreadsheetCSSStyleDeclarationEditor.prototype.startEditingFirstProperty):
(WI.SpreadsheetCSSStyleDeclarationEditor.prototype.startEditingLastProperty):
(WI.SpreadsheetCSSStyleDeclarationEditor.prototype.spreadsheetCSSStyleDeclarationEditorFocusMoved):
(WI.SpreadsheetCSSStyleDeclarationEditor.prototype.spreadsheetStylePropertyRemoved):
(WI.SpreadsheetCSSStyleDeclarationEditor.prototype.get _propertiesToRender):
(WI.SpreadsheetCSSStyleDeclarationEditor.prototype._addBlankProperty):
(WI.SpreadsheetCSSStyleDeclarationEditor.prototype._isFocused):
(WI.SpreadsheetCSSStyleDeclarationEditor.prototype._propertiesChanged):
Give SpreadsheetCSSStyleDeclarationEditor a delegate so that it can move focus to a CSS selector, or previous and next CSS rules.

* UserInterface/Views/SpreadsheetCSSStyleDeclarationSection.js:
(WI.SpreadsheetCSSStyleDeclarationSection):
(WI.SpreadsheetCSSStyleDeclarationSection.prototype.get propertiesEditor):
(WI.SpreadsheetCSSStyleDeclarationSection.prototype.get editable):
(WI.SpreadsheetCSSStyleDeclarationSection.prototype.initialLayout):
(WI.SpreadsheetCSSStyleDeclarationSection.prototype.startEditingRuleSelector):
(WI.SpreadsheetCSSStyleDeclarationSection.prototype.cssStyleDeclarationTextEditorStartEditingRuleSelector):
(WI.SpreadsheetCSSStyleDeclarationSection.prototype.spreadsheetSelectorFieldDidChange):
(WI.SpreadsheetCSSStyleDeclarationSection.prototype.cssStyleDeclarationEditorStartEditingAdjacentRule):
Give SpreadsheetCSSStyleDeclarationSection a delegate so that it can move focus to previous and next CSS rules.

* UserInterface/Views/SpreadsheetRulesStyleDetailsPanel.js:
(WI.SpreadsheetRulesStyleDetailsPanel.prototype.refresh):
(WI.SpreadsheetRulesStyleDetailsPanel.prototype.cssStyleDeclarationSectionStartEditingNextRule):
(WI.SpreadsheetRulesStyleDetailsPanel.prototype.cssStyleDeclarationSectionStartEditingPreviousRule):
(WI.SpreadsheetRulesStyleDetailsPanel):
Implement focusing on the next and previous CSS rules.

* UserInterface/Views/SpreadsheetSelectorField.js: Added.
(WI.SpreadsheetSelectorField):
(WI.SpreadsheetSelectorField.prototype.get editing):
(WI.SpreadsheetSelectorField.prototype.startEditing):
(WI.SpreadsheetSelectorField.prototype.stopEditing):
(WI.SpreadsheetSelectorField.prototype._selectText):
(WI.SpreadsheetSelectorField.prototype._handleClick):
(WI.SpreadsheetSelectorField.prototype._handleFocus):
(WI.SpreadsheetSelectorField.prototype._handleBlur):
(WI.SpreadsheetSelectorField.prototype._handleKeyDown):
Move SpreadsheetSelectorField into its own file.

* UserInterface/Views/SpreadsheetStyleProperty.js: Added.
(WI.SpreadsheetStyleProperty):
(WI.SpreadsheetStyleProperty.prototype.get element):
(WI.SpreadsheetStyleProperty.prototype.get nameTextField):
(WI.SpreadsheetStyleProperty.prototype.get valueTextField):
(WI.SpreadsheetStyleProperty.prototype._remove):
(WI.SpreadsheetStyleProperty.prototype._update):
(WI.SpreadsheetStyleProperty.prototype.spreadsheetTextFieldDidChange):
(WI.SpreadsheetStyleProperty.prototype.spreadsheetTextFieldDidCommit):
(WI.SpreadsheetStyleProperty.prototype.spreadsheetTextFieldDidBlur):
(WI.SpreadsheetStyleProperty.prototype._handleNameChange):
(WI.SpreadsheetStyleProperty.prototype._handleValueChange):
Move SpreadsheetStyleProperty into its own file.

* UserInterface/Views/SpreadsheetTextField.js: Added.
(WI.SpreadsheetTextField):
(WI.SpreadsheetTextField.prototype.get element):
(WI.SpreadsheetTextField.prototype.get editing):
(WI.SpreadsheetTextField.prototype.get value):
(WI.SpreadsheetTextField.prototype.set value):
(WI.SpreadsheetTextField.prototype.startEditing):
(WI.SpreadsheetTextField.prototype.stopEditing):
(WI.SpreadsheetTextField.prototype._selectText):
(WI.SpreadsheetTextField.prototype._discardChange):
(WI.SpreadsheetTextField.prototype._handleFocus):
(WI.SpreadsheetTextField.prototype._handleBlur):
(WI.SpreadsheetTextField.prototype._handleKeyDown):
(WI.SpreadsheetTextField.prototype._handleInput):
Introduce SpreadsheetTextField that is used for editing CSS property names and values.

LayoutTests:

Add tests for WI.CSSProperty.prototype.remove.

* inspector/css/css-property-expected.txt:
* inspector/css/css-property.html:

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

2 years agoRebaseline fast/dom/navigator-detached-no-crash.html.
ryanhaddad@apple.com [Fri, 6 Oct 2017 05:04:42 +0000 (05:04 +0000)]
Rebaseline fast/dom/navigator-detached-no-crash.html.
https://bugs.webkit.org/show_bug.cgi?id=177261

Unreviewed test gardening.

* fast/dom/navigator-detached-no-crash-expected.txt:
* platform/mac-elcapitan-wk2/fast/dom/navigator-detached-no-crash-expected.txt:

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

2 years agoUnreviewed, rolling out r222951 and r222952.
ryanhaddad@apple.com [Fri, 6 Oct 2017 05:00:18 +0000 (05:00 +0000)]
Unreviewed, rolling out r222951 and r222952.
https://bugs.webkit.org/show_bug.cgi?id=177992

"Broke the iOS build and introduced a webgl LayoutTest
failure." (Requested by ryanhaddad on #webkit).

Reverted changesets:

"Lots of missing frames in YouTube360 when fullscreen on
MacBook"
https://bugs.webkit.org/show_bug.cgi?id=177903
http://trac.webkit.org/changeset/222951

"Lots of missing frames in YouTube360 when fullscreen on
MacBook"
https://bugs.webkit.org/show_bug.cgi?id=177903
http://trac.webkit.org/changeset/222952

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

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

2 years agoDataTransfer shouldn't contain text/html when performing Paste and Match Style
rniwa@webkit.org [Fri, 6 Oct 2017 03:51:35 +0000 (03:51 +0000)]
DataTransfer shouldn't contain text/html when performing Paste and Match Style
https://bugs.webkit.org/show_bug.cgi?id=174165
<rdar://problem/33138027>

Reviewed by Wenson Hsieh.

Source/WebCore:

When performing Paste and Match Style, only expose the plain text by creating a StaticPasteboard with plain text content.

This patch introduces ClipboardEventKind enum class to differentiate regular paste and paste and match style (internally
called as pasteAsPlainText) since both operations use "paste" event.

Tests: editing/pasteboard/data-transfer-get-data-on-paste-as-plain-text-when-custom-pasteboard-data-disabled.html
       editing/pasteboard/data-transfer-get-data-on-paste-as-plain-text.html

* dom/DataTransfer.cpp:
(WebCore::DataTransfer::createForCopyAndPaste): Made this function take Pasteboard as an argument.
* dom/DataTransfer.h:
* editing/Editor.cpp:
(WebCore::ClipboardEventKind): Added.
(WebCore::eventNameForClipboardEvent): Added.
(WebCore::createDataTransferForClipboardEvent): Added.
(WebCore::dispatchClipboardEvent):
(WebCore::Editor::canDHTMLCut):
(WebCore::Editor::canDHTMLCopy):
(WebCore::Editor::canDHTMLPaste):
(WebCore::Editor::tryDHTMLCopy):
(WebCore::Editor::tryDHTMLCut):
(WebCore::Editor::tryDHTMLPaste): Deleted.
(WebCore::Editor::paste):
(WebCore::Editor::pasteAsPlainText):
* platform/ios/PasteboardIOS.mm:
(WebCore::Pasteboard::addHTMLClipboardTypesForCocoaType): Add "text/html" when public.html UTI is in the pasteboard
even when the custom pasteboard data is disabled. We continue to add public.html in the case some app dependent on
seeing "public.html" in dataTransfer.types.

LayoutTests:

Added regression tests for pasting as plain text.

* editing/pasteboard/data-transfer-get-data-on-paste-as-plain-text-expected.txt: Added.
* editing/pasteboard/data-transfer-get-data-on-paste-as-plain-text-when-custom-pasteboard-data-disabled-expected.txt: Added.
* editing/pasteboard/data-transfer-get-data-on-paste-as-plain-text-when-custom-pasteboard-data-disabled.html: Added.
* editing/pasteboard/data-transfer-get-data-on-paste-as-plain-text.html: Added.

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

2 years agoFix the Mac CMake build
timothy_horton@apple.com [Fri, 6 Oct 2017 03:06:35 +0000 (03:06 +0000)]
Fix the Mac CMake build
https://bugs.webkit.org/show_bug.cgi?id=177985

Unreviewed build fix.

* CMakeLists.txt:
* PlatformMac.cmake:
After r222917, there's one more piece of WebKitSystemInterface left.
And some missing bits of PaymentRequest.

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

2 years agoJSC generate unified sources doesn't need to run during installhdrs.
keith_miller@apple.com [Fri, 6 Oct 2017 03:01:57 +0000 (03:01 +0000)]
JSC generate unified sources doesn't need to run during installhdrs.
https://bugs.webkit.org/show_bug.cgi?id=177640

Reviewed by Dan Bernstein.

generate unified sources doesn't need to have a xcconfig file
since we don't have any feature defines. Also, remove the plist
because there's no plist for this...

* JavaScriptCore.xcodeproj/project.pbxproj:

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

2 years agoRenderTable should not hold section raw pointers
zalan@apple.com [Fri, 6 Oct 2017 02:41:35 +0000 (02:41 +0000)]
RenderTable should not hold section raw pointers
https://bugs.webkit.org/show_bug.cgi?id=177977
<rdar://problem/34846034>

Reviewed by Simon Fraser.

This enables us to remove forced recalcSections calls.

Covered by existing tests.

* rendering/RenderTable.cpp:
(WebCore::RenderTable::RenderTable):
(WebCore::resetSectionPointerIfNotBefore):
(WebCore::RenderTable::addChild):
(WebCore::RenderTable::recalcSections const):
(WebCore::RenderTable::sectionAbove const):
* rendering/RenderTable.h:
(WebCore::RenderTable::header const):
(WebCore::RenderTable::footer const):
(WebCore::RenderTable::firstBody const):
(WebCore::RenderTable::topSection const):

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

2 years agoLots of missing frames in YouTube360 when fullscreen on MacBook
dino@apple.com [Fri, 6 Oct 2017 02:36:20 +0000 (02:36 +0000)]
Lots of missing frames in YouTube360 when fullscreen on MacBook
https://bugs.webkit.org/show_bug.cgi?id=177903
<rdar://problem/33273300>

iOS build fix.

* platform/graphics/opengl/GraphicsContext3DOpenGL.cpp:

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

2 years agoLots of missing frames in YouTube360 when fullscreen on MacBook
dino@apple.com [Fri, 6 Oct 2017 02:31:39 +0000 (02:31 +0000)]
Lots of missing frames in YouTube360 when fullscreen on MacBook
https://bugs.webkit.org/show_bug.cgi?id=177903
<rdar://problem/33273300>

Reviewed by Sam Weinig.

Our compositing path for WebGL on macOS was too slow, requiring a copy
of the framebuffer into another GL context. Replace this by having
WebGL render into a texture that is backed by an IOSurface, and then
set the WebGLLayer to use the IOSurface as contents.

Covered by the existing WebGL tests.

* platform/graphics/GraphicsContext3D.h:
(WebCore::GraphicsContext3D::platformTexture const): We no longer use the
framebuffer object outside the class, so change this to return the GL texture
that the framebuffer is rendering in to. It was kind-of strange that it was
named this way originally.
Also make endPaint available on macOS, and add the definitions for
createIOSurfaceBackingStore and updateFramebufferTextureBackingStoreFromLayer.

* platform/graphics/cocoa/GraphicsContext3DCocoa.mm:
(WebCore::GraphicsContext3D::GraphicsContext3D): Now that we're using an IOSurface,
we're binding to a new attachment point, GL_TEXTURE_RECTANGLE.
(WebCore::GraphicsContext3D::endPaint): This is now being called on macOS and iOS,
so add a comment that explains the extra work that iOS needs to do. At some future
point it would be nice to make this slightly cleaner, so that iOS and macOS are
more similar.
(WebCore::GraphicsContext3D::allocateIOSurfaceBackingStore): New function that calls
into the corresponding WebGLLayer function.
(WebCore::GraphicsContext3D::updateFramebufferTextureBackingStoreFromLayer): Ditto.

* platform/graphics/opengl/GraphicsContext3DOpenGL.cpp:
(WebCore::wipeAlphaChannelFromPixels): Both readPixels and drawing a WebGL context
into another buffer need to fill out the alpha channel if this context was
created without one, otherwise the IOSurface backing store will happily provide
what might be non-zero values.
(WebCore::GraphicsContext3D::readPixelsAndConvertToBGRAIfNecessary): Call the helper above.
(WebCore::GraphicsContext3D::reshapeFBOs): Add more code to call into the macOS-specific
function to use an IOSurface as the framebuffer texture.
(WebCore::GraphicsContext3D::readPixels): Call the helper above.

* platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
(PlatformCALayerCocoa::copyContentsFromLayer): Replace the use of the
deprecated setContentsChanged with reloadValueForKeyPath.

* platform/graphics/cocoa/WebGLLayer.h: The macOS implementation now
inherits from CALayer directly rather than CAOpenGLLayer. It also adds
a few member variables to handle the IOSurfaces used for triple buffering.

* platform/graphics/cocoa/WebGLLayer.mm:
(-[WebGLLayer initWithGraphicsContext3D:]): If we were created without an
alpha channel, tell CA that we're an opaque layer. Also set the layer's transform
to identity, so that it calls into the code below to flip the contents.
(-[WebGLLayer setTransform:]): Because an IOSurface is used for the layer contents,
we don't get a chance to flip the drawing the way we do via the drawInContext delegate.
Instead we have to apply a scale(1, -1) transform on top of the layer transform to
make sure the layer is rendered right-way up.
(-[WebGLLayer setAnchorPoint:]): Ditto, except we have to assume the anchor point is
at the bottom of the layer, so flip the Y value.
(-[WebGLLayer display]): Swap between the drawing buffer and the contents buffer, and
then get a new buffer ready for display.
(createAppropriateIOSurface): Helper.
(-[WebGLLayer allocateIOSurfaceBackingStoreWithSize:usingAlpha:]): Initializes the
IOSurfaces used for drawing buffers.
(-[WebGLLayer bindFramebufferToNextAvailableSurface]): Take the next available IOSurface and
make it the drawing buffer (binding in to WebGL at the same time).
(-[WebGLLayer copyCGLPixelFormatForDisplayMask:]): Deleted.
(-[WebGLLayer copyCGLContextForPixelFormat:]): Deleted.
(-[WebGLLayer drawInCGLContext:pixelFormat:forLayerTime:displayTime:]): Deleted.

* platform/graphics/mac/WebLayer.mm: Remove the definition of reloadValueForKeyPath.

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

2 years agoREGRESSION(r222868): Web Inspector: Timeline ScopeBar Navigation Bar items too large
commit-queue@webkit.org [Fri, 6 Oct 2017 01:30:40 +0000 (01:30 +0000)]
REGRESSION(r222868): Web Inspector: Timeline ScopeBar Navigation Bar items too large
https://bugs.webkit.org/show_bug.cgi?id=177979

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

* UserInterface/Views/ButtonNavigationItem.css:
(.navigation-bar .item.button.text-only):
Make the height of text-only items the size of the text, not 100%.

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

2 years agoAdd "display" to FontFace Javascript object
mmaxfield@apple.com [Fri, 6 Oct 2017 01:25:01 +0000 (01:25 +0000)]
Add "display" to FontFace Javascript object
https://bugs.webkit.org/show_bug.cgi?id=175383
<rdar://problem/33813239>

Reviewed by Simon Fraser.

Source/WebCore:

We already have all the necessary infrastructure. Just hook it up to the .idl file!

Test: fast/text/font-loading-font-display.html

* css/CSSFontFace.h:
* css/CSSPrimitiveValueMappings.h:
* css/FontFace.cpp:
(WebCore::FontFace::create):
(WebCore::FontFace::setDisplay):
(WebCore::FontFace::display const):
* css/FontFace.h:
* css/FontFace.idl:

LayoutTests:

* fast/text/font-loading-font-display-expected.txt: Added.
* fast/text/font-loading-font-display.html: Added.

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

2 years agoUnreviewed, use std::vector instead of variable length array
utatane.tea@gmail.com [Fri, 6 Oct 2017 01:15:36 +0000 (01:15 +0000)]
Unreviewed, use std::vector instead of variable length array
https://bugs.webkit.org/show_bug.cgi?id=177856

This is OK because originally this code uses dispatch queue, which
should have allocation inside it too.

* MallocBench/MallocBench/message.cpp:
(benchmark_message_many):

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

2 years agoUnreviewed, tapi builds without optimization so we should have TAPI passes -DRELEASE_...
keith_miller@apple.com [Fri, 6 Oct 2017 00:36:44 +0000 (00:36 +0000)]
Unreviewed, tapi builds without optimization so we should have TAPI passes -DRELEASE_WITHOUT_OPTIMIZATIONS.

Source/WebKit:

* Configurations/Base.xcconfig:

Source/WebKitLegacy/mac:

* Configurations/WebKitLegacy.xcconfig:

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

2 years ago[Cocoa] Enable ENABLE_ENCRYPTED_MEDIA build-time setting
jer.noble@apple.com [Fri, 6 Oct 2017 00:13:23 +0000 (00:13 +0000)]
[Cocoa] Enable ENABLE_ENCRYPTED_MEDIA build-time setting
https://bugs.webkit.org/show_bug.cgi?id=177261

Reviewed by Eric Carlson.

Source/JavaScriptCore:

* Configurations/FeatureDefines.xcconfig:

Source/WebCore:

Enable ENCRYPTED_MEDIA, and make the changes required for ENABLED_MEDIA and LEGACY_ENABLED_MEDIA
to co-exist while both enabled simultaneously.

* Configurations/FeatureDefines.xcconfig:
* Modules/encryptedmedia/legacy/LegacyCDM.cpp:
(WebCore::LegacyCDM::registerCDMFactory):
(WebCore::LegacyCDM::supportsKeySystem):
(WebCore::LegacyCDM::keySystemSupportsMimeType):
(WebCore::LegacyCDM::create):
(WebCore::LegacyCDM::LegacyCDM):
(WebCore::LegacyCDM::~LegacyCDM):
(WebCore::LegacyCDM::supportsMIMEType const):
(WebCore::LegacyCDM::createSession):
(WebCore::LegacyCDM::mediaPlayer const):
(WebCore::CDM::registerCDMFactory): Deleted.
(WebCore::CDM::supportsKeySystem): Deleted.
(WebCore::CDM::keySystemSupportsMimeType): Deleted.
(WebCore::CDM::create): Deleted.
(WebCore::CDM::CDM): Deleted.
(WebCore::CDM::~CDM): Deleted.
(WebCore::CDM::supportsMIMEType const): Deleted.
(WebCore::CDM::createSession): Deleted.
(WebCore::CDM::mediaPlayer const): Deleted.
* Modules/encryptedmedia/legacy/LegacyCDM.h:
(WebCore::LegacyCDMClient::~LegacyCDMClient):
(WebCore::LegacyCDM::client const):
(WebCore::LegacyCDM::setClient):
(WebCore::CDMClient::~CDMClient): Deleted.
(WebCore::CDM::keySystem const): Deleted.
(WebCore::CDM::client const): Deleted.
(WebCore::CDM::setClient): Deleted.
* Modules/encryptedmedia/legacy/LegacyCDMPrivate.h:
* Modules/encryptedmedia/legacy/LegacyCDMPrivateClearKey.cpp:
(WebCore::LegacyCDMPrivateClearKey::supportsKeySystem):
(WebCore::LegacyCDMPrivateClearKey::supportsKeySystemAndMimeType):
(WebCore::LegacyCDMPrivateClearKey::supportsMIMEType):
(WebCore::LegacyCDMPrivateClearKey::createSession):
(WebCore::CDMPrivateClearKey::supportsKeySystem): Deleted.
(WebCore::CDMPrivateClearKey::supportsKeySystemAndMimeType): Deleted.
(WebCore::CDMPrivateClearKey::supportsMIMEType): Deleted.
(WebCore::CDMPrivateClearKey::createSession): Deleted.
* Modules/encryptedmedia/legacy/LegacyCDMPrivateClearKey.h:
(WebCore::LegacyCDMPrivateClearKey::LegacyCDMPrivateClearKey):
(WebCore::LegacyCDMPrivateClearKey::~LegacyCDMPrivateClearKey):
(WebCore::CDMPrivateClearKey::CDMPrivateClearKey): Deleted.
(WebCore::CDMPrivateClearKey::~CDMPrivateClearKey): Deleted.
* Modules/encryptedmedia/legacy/LegacyCDMPrivateMediaPlayer.cpp:
(WebCore::CDMPrivateMediaPlayer::createSession):
* Modules/encryptedmedia/legacy/LegacyCDMPrivateMediaPlayer.h:
(WebCore::CDMPrivateMediaPlayer::CDMPrivateMediaPlayer):
(WebCore::CDMPrivateMediaPlayer::cdm const):
* Modules/encryptedmedia/legacy/LegacyCDMSessionClearKey.cpp:
(WebCore::CDMSessionClearKey::CDMSessionClearKey):
* Modules/encryptedmedia/legacy/LegacyCDMSessionClearKey.h:
* Modules/encryptedmedia/legacy/WebKitMediaKeySession.h:
* Modules/encryptedmedia/legacy/WebKitMediaKeys.cpp:
(WebCore::WebKitMediaKeys::create):
(WebCore::WebKitMediaKeys::WebKitMediaKeys):
(WebCore::WebKitMediaKeys::isTypeSupported):
(WebCore::WebKitMediaKeys::cdmMediaPlayer const):
* Modules/encryptedmedia/legacy/WebKitMediaKeys.h:
* WebCore.xcodeproj/project.pbxproj:
* platform/encryptedmedia/CDMFactory.cpp:
(WebCore::CDMFactory::platformRegisterFactories):
* platform/encryptedmedia/clearkey/CDMClearKey.cpp:
(WebCore::ClearKeyState::singleton):
(WebCore::parseJSONObject):
(WebCore::parseLicenseFormat):
(WebCore::parseLicenseReleaseAcknowledgementFormat):
(WebCore::CDMFactoryClearKey::singleton):
(WebCore::containsPersistentLicenseType):
(WebCore::CDMInstanceClearKey::keySystem const):
* platform/encryptedmedia/clearkey/CDMClearKey.h:
* platform/graphics/LegacyCDMSession.h:
(WebCore::LegacyCDMSessionClient::~LegacyCDMSessionClient):
(WebCore::CDMSession::type):
(WebCore::CDMSessionClient::~CDMSessionClient): Deleted.
* platform/graphics/MediaPlayer.cpp:
(WebCore::MediaPlayer::createSession):
* platform/graphics/MediaPlayer.h:
* platform/graphics/MediaPlayerPrivate.h:
(WebCore::MediaPlayerPrivateInterface::createSession):
* platform/graphics/avfoundation/CDMPrivateMediaSourceAVFObjC.h:
(WebCore::CDMPrivateMediaSourceAVFObjC::CDMPrivateMediaSourceAVFObjC):
(WebCore::CDMPrivateMediaSourceAVFObjC::cdm const):
* platform/graphics/avfoundation/CDMPrivateMediaSourceAVFObjC.mm:
(WebCore::CDMPrivateMediaSourceAVFObjC::createSession):
* platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
(WebCore::MediaPlayerPrivateAVFoundationCF::createSession):
* platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.h:
* platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.h:
* platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.mm:
(WebCore::CDMSessionAVContentKeySession::CDMSessionAVContentKeySession):
(WebCore::CDMSessionAVContentKeySession::update):
* platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.h:
* platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.mm:
(WebCore::CDMSessionAVFoundationObjC::CDMSessionAVFoundationObjC):
(WebCore::CDMSessionAVFoundationObjC::generateKeyRequest):
(WebCore::CDMSessionAVFoundationObjC::playerDidReceiveError):
* platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.h:
* platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.mm:
(WebCore::CDMSessionAVStreamSession::CDMSessionAVStreamSession):
* platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.h:
* platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.mm:
(WebCore::CDMSessionMediaSourceAVFObjC::CDMSessionMediaSourceAVFObjC):
(WebCore::CDMSessionMediaSourceAVFObjC::layerDidReceiveError):
(WebCore::CDMSessionMediaSourceAVFObjC::rendererDidReceiveError):
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::nativeImageForCurrentTime):
(WebCore::MediaPlayerPrivateAVFoundationObjC::createSession):
* testing/Internals.cpp:
(WebCore::Internals::initializeMockCDM):
* testing/LegacyMockCDM.cpp:
(WebCore::LegacyMockCDM::supportsKeySystem):
(WebCore::LegacyMockCDM::supportsKeySystemAndMimeType):
(WebCore::LegacyMockCDM::supportsMIMEType):
(WebCore::LegacyMockCDM::createSession):
(WebCore::MockCDMSession::MockCDMSession):
(WebCore::MockCDM::supportsKeySystem): Deleted.
(WebCore::MockCDM::supportsKeySystemAndMimeType): Deleted.
(WebCore::MockCDM::supportsMIMEType): Deleted.
(WebCore::MockCDM::createSession): Deleted.
* testing/LegacyMockCDM.h:
(WebCore::LegacyMockCDM::LegacyMockCDM):
(WebCore::LegacyMockCDM::~LegacyMockCDM):
(WebCore::MockCDM::MockCDM): Deleted.
(WebCore::MockCDM::~MockCDM): Deleted.
* testing/MockCDMFactory.cpp:
(WebCore::MockCDMInstance::keySystem const):

Source/WebCore/PAL:

* Configurations/FeatureDefines.xcconfig:

Source/WebKit:

* Configurations/FeatureDefines.xcconfig:

Source/WebKitLegacy/mac:

* Configurations/FeatureDefines.xcconfig:

Tools:

* TestWebKitAPI/Configurations/FeatureDefines.xcconfig:

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

2 years agobmalloc mutex should be adaptive
fpizlo@apple.com [Thu, 5 Oct 2017 23:48:10 +0000 (23:48 +0000)]
bmalloc mutex should be adaptive
https://bugs.webkit.org/show_bug.cgi?id=177839

Reviewed by Michael Saboff.

Source/bmalloc:

This pulls the WordLock algorithm into bmalloc, mostly by copy-pasting the code. We need to
copy paste because sometimes we build WTF without bmalloc, so WTF cannot rely on bmalloc for
anything other than malloc.

Reland after fixing ancient WordLock bug: the notify_one has to happen with the lock held
to ensure it doesn't run after that thread has died.

* bmalloc/Algorithm.h:
(bmalloc::compareExchangeWeak):
(bmalloc::compareExchangeStrong):
* bmalloc/PerThread.h:
* bmalloc/StaticMutex.cpp:
(bmalloc::StaticMutex::lockSlow):
(bmalloc::StaticMutex::unlockSlow):
(bmalloc::StaticMutex::lockSlowCase): Deleted.
* bmalloc/StaticMutex.h:
(bmalloc::StaticMutex::try_lock):
(bmalloc::StaticMutex::isLocked const):
(bmalloc::StaticMutex::init):
(bmalloc::StaticMutex::tryLock):
(bmalloc::StaticMutex::lock):
(bmalloc::StaticMutex::unlock):
(bmalloc::sleep): Deleted.
(bmalloc::waitUntilFalse): Deleted.

Source/WTF:

Add some comments that I thought of while copy-pasting this code.

Reland after fixing ancient WordLock bug: the notify_one has to happen with the lock held
to ensure it doesn't run after that thread has died.

* wtf/LockAlgorithmInlines.h:
* wtf/WordLock.cpp:

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

2 years agoAdd ObjC equivalent of WKPageNavigationClient.didChangeBackForwardList
achristensen@apple.com [Thu, 5 Oct 2017 23:18:36 +0000 (23:18 +0000)]
Add ObjC equivalent of WKPageNavigationClient.didChangeBackForwardList
https://bugs.webkit.org/show_bug.cgi?id=177966
<rdar://problem/22387135>

Reviewed by Tim Horton.

Source/WebKit:

* UIProcess/API/APINavigationClient.h:
(API::NavigationClient::didChangeBackForwardList):
* UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h:
* UIProcess/Cocoa/NavigationState.h:
* UIProcess/Cocoa/NavigationState.mm:
(WebKit::NavigationState::setNavigationDelegate):
(WebKit::NavigationState::NavigationClient::didFailToInitializePlugIn):
(WebKit::NavigationState::NavigationClient::didChangeBackForwardList):
(WebKit::NavigationState::NavigationClient::willPerformClientRedirect):
(WebKit::NavigationState::NavigationClient::didCancelClientRedirect):
(WebKit::NavigationState::NavigationClient::renderingProgressDidChange):
(WebKit::NavigationState::NavigationClient::canAuthenticateAgainstProtectionSpace):
(WebKit::NavigationState::NavigationClient::processDidTerminate):
(WebKit::NavigationState::NavigationClient::processDidBecomeResponsive):
(WebKit::NavigationState::NavigationClient::processDidBecomeUnresponsive):
(WebKit::NavigationState::NavigationClient::webCryptoMasterKey):
(WebKit::NavigationState::NavigationClient::didFinishLoadForQuickLookDocumentInMainFrame):
(WebKit::NavigationState::HistoryClient::didNavigateWithNavigationData):
(WebKit::NavigationState::HistoryClient::didPerformClientRedirect):
(WebKit::NavigationState::HistoryClient::didPerformServerRedirect):
(WebKit::NavigationState::HistoryClient::didUpdateHistoryTitle):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::didChangeBackForwardList):

Tools:

* TestWebKitAPI/Tests/WebKitCocoa/Navigation.mm:
(-[ListItemDelegate _webView:backForwardListItemAdded:removed:]):
(-[ListItemDelegate webView:didFinishNavigation:]):
(TEST):

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

2 years agoAdd ObjC SPI with userInfo corresponding to WKPageNavigationClient's decidePolicyForN...
achristensen@apple.com [Thu, 5 Oct 2017 23:14:15 +0000 (23:14 +0000)]
Add ObjC SPI with userInfo corresponding to WKPageNavigationClient's decidePolicyForNavigationAction, didStartProvisionalNavigation, and didFailNavigation
https://bugs.webkit.org/show_bug.cgi?id=177974
<rdar://problem/22888802>

Reviewed by Tim Horton.

* UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h:
* UIProcess/Cocoa/NavigationState.h:
* UIProcess/Cocoa/NavigationState.mm:
(WebKit::NavigationState::setNavigationDelegate):
(WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction):
(WebKit::NavigationState::NavigationClient::didStartProvisionalNavigation):
(WebKit::NavigationState::NavigationClient::didFailNavigationWithError):
* UIProcess/Cocoa/UIDelegate.mm:
(WebKit::UIDelegate::ContextMenuClient::menuFromProposedMenu):

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

2 years agoStorage Access API: Web process should ask UI process for grant/deny
wilander@apple.com [Thu, 5 Oct 2017 23:05:02 +0000 (23:05 +0000)]
Storage Access API: Web process should ask UI process for grant/deny
https://bugs.webkit.org/show_bug.cgi?id=176941
<rdar://problem/34440036>

Reviewed by Chris Dumez and Sam Weinig.

Source/WebCore:

Tests: http/tests/storageAccess/request-and-grant-storage-access-cross-origin-non-sandboxed-iframe.html
       http/tests/storageAccess/request-and-grant-storage-access-cross-origin-sandboxed-iframe-from-prevalent-domain-with-user-interaction.html
       http/tests/storageAccess/request-and-grant-storage-access-cross-origin-sandboxed-iframe-from-prevalent-domain-without-user-interaction.html

This patch changes Document::requestStorageAccess() so that it
calls the ChromeClient instead of the ResourceLoadObserver to
request storage access on behalf of the iframe.
The patch also changes how the promise is used, from returning
a boolean to either resolving or rejecting to signal grant/deny
access respectively.

* dom/Document.cpp:
(WebCore::Document::requestStorageAccess):
* dom/Document.idl:
* loader/ResourceLoadObserver.cpp:
(WebCore::ResourceLoadObserver::registerStorageAccess): Deleted.
* loader/ResourceLoadObserver.h:
* page/ChromeClient.h:

Source/WebKit:

This patch adds infrastructure to let WebCore::Document call
WebKit::WebResourceLoadStatisticsStore and ask for storage
access on behalf of an iframe. The communication goes through
the ChromeClient since we might want to add a native prompt.
From the ChromeClient it continues to the WebPage which
messages the WebPageProxy. The WebPageProxy calls the
WebsiteDataStore which owns the WebResourceLoadStatisticsStore.
A uint64_t is used to match the right callback with the boolean
result.

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::requestStorageAccess):
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* UIProcess/WebResourceLoadStatisticsStore.cpp:
(WebKit::WebResourceLoadStatisticsStore::requestStorageAccess):
* UIProcess/WebResourceLoadStatisticsStore.h:
* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::WebsiteDataStore::requestStorageAccess):
* UIProcess/WebsiteData/WebsiteDataStore.h:
* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::requestStorageAccess):
* WebProcess/WebCoreSupport/WebChromeClient.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::nextRequestStorageAccessContextId):
(WebKit::WebPage::requestStorageAccess):
(WebKit::WebPage::storageAccessResponse):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:

LayoutTests:

The iframes now communicate the results back to the top frame through postMessage.
Also, denied access results in a rejected promise which is handled in these
changed test cases.

* http/tests/storageAccess/request-and-deny-storage-access-cross-origin-iframe-expected.txt:
* http/tests/storageAccess/request-and-deny-storage-access-cross-origin-iframe.html:
* http/tests/storageAccess/request-and-deny-storage-access-cross-origin-sandboxed-iframe-expected.txt:
* http/tests/storageAccess/request-and-deny-storage-access-cross-origin-sandboxed-iframe.html:
* http/tests/storageAccess/request-and-grant-storage-access-cross-origin-iframe-expected.txt: Removed.
* http/tests/storageAccess/request-and-grant-storage-access-cross-origin-iframe.html: Removed.
    Renamed to request-and-grant-storage-access-cross-origin-non-sandboxed-iframe.html.
* http/tests/storageAccess/request-and-grant-storage-access-cross-origin-non-sandboxed-iframe-expected.txt: Added.
* http/tests/storageAccess/request-and-grant-storage-access-cross-origin-non-sandboxed-iframe.html: Added.
    See comment above on renaming.
* http/tests/storageAccess/request-and-grant-storage-access-cross-origin-sandboxed-iframe-expected.txt:
* http/tests/storageAccess/request-and-grant-storage-access-cross-origin-sandboxed-iframe-from-prevalent-domain-with-user-interaction-expected.txt: Added.
* http/tests/storageAccess/request-and-grant-storage-access-cross-origin-sandboxed-iframe-from-prevalent-domain-with-user-interaction.html: Added.
* http/tests/storageAccess/request-and-grant-storage-access-cross-origin-sandboxed-iframe-from-prevalent-domain-without-user-interaction-expected.txt: Added.
* http/tests/storageAccess/request-and-grant-storage-access-cross-origin-sandboxed-iframe-from-prevalent-domain-without-user-interaction.html: Added.
    Two new test cases added for the new logic in WebKit::WebResourceLoadStatisticsStore.
* http/tests/storageAccess/request-and-grant-storage-access-cross-origin-sandboxed-iframe.html:
* http/tests/storageAccess/request-and-grant-storage-access-cross-origin-sandboxed-nested-iframe-expected.txt:
* http/tests/storageAccess/request-and-grant-storage-access-cross-origin-sandboxed-nested-iframe.html:
* http/tests/storageAccess/request-storage-access-cross-origin-sandboxed-iframe-with-unique-origin-expected.txt:
* http/tests/storageAccess/request-storage-access-cross-origin-sandboxed-iframe-with-unique-origin.html:
* http/tests/storageAccess/request-storage-access-cross-origin-sandboxed-iframe-without-allow-token-expected.txt:
* http/tests/storageAccess/request-storage-access-cross-origin-sandboxed-iframe-without-allow-token.html:
* http/tests/storageAccess/request-storage-access-same-origin-iframe-expected.txt:
* http/tests/storageAccess/request-storage-access-same-origin-iframe.html:
* http/tests/storageAccess/request-storage-access-same-origin-sandboxed-iframe-expected.txt:
* http/tests/storageAccess/request-storage-access-same-origin-sandboxed-iframe-without-allow-token-expected.txt:
* http/tests/storageAccess/request-storage-access-same-origin-sandboxed-iframe-without-allow-token.html:
* http/tests/storageAccess/request-storage-access-same-origin-sandboxed-iframe.html:
* http/tests/storageAccess/request-storage-access-top-frame-expected.txt:
* http/tests/storageAccess/request-storage-access-top-frame.html:
* http/tests/storageAccess/resources/request-storage-access-iframe.html:
* platform/mac-wk2/TestExpectations:
    Added the new tests as [ Pass ].

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

2 years agoWeb Inspector: EventLoop::cycle() should not send nil NSEvents
bburg@apple.com [Thu, 5 Oct 2017 23:02:52 +0000 (23:02 +0000)]
Web Inspector: EventLoop::cycle() should not send nil NSEvents
https://bugs.webkit.org/show_bug.cgi?id=177971
<rdar://problem/20387399>

Reviewed by Joseph Pecoraro.

It is possible for the next matching event to be nil.
WebKit clients don't expect to be sent a nil NSEvent, so add a null check here.

* platform/mac/EventLoopMac.mm:
(WebCore::EventLoop::cycle):

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

2 years agoUnreviewed, rolling out r222929.
ryanhaddad@apple.com [Thu, 5 Oct 2017 22:52:27 +0000 (22:52 +0000)]
Unreviewed, rolling out r222929.

Caused assertion failures during LayoutTests.

Reverted changeset:

"Only add prototypes to the PrototypeMap if they're not
already present"
https://bugs.webkit.org/show_bug.cgi?id=177952
http://trac.webkit.org/changeset/222929

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

2 years agoDrop unused parameters for CookiesStrategy::cookiesEnabled()
cdumez@apple.com [Thu, 5 Oct 2017 22:43:02 +0000 (22:43 +0000)]
Drop unused parameters for CookiesStrategy::cookiesEnabled()
https://bugs.webkit.org/show_bug.cgi?id=177957

Reviewed by Alex Christensen.

Source/WebCore:

* loader/CookieJar.cpp:
(WebCore::cookiesEnabled):
* platform/CookiesStrategy.h:
* platform/network/PlatformCookieJar.h:
* platform/network/cf/CookieJarCFNet.cpp:
(WebCore::cookiesEnabled):
* platform/network/curl/CookieJarCurl.cpp:
(WebCore::CookieJarCurlFileSystem::cookiesEnabled):
(WebCore::cookiesEnabled):
* platform/network/curl/CookieJarCurl.h:
* platform/network/mac/CookieJarMac.mm:
(WebCore::cookiesEnabled):
* platform/network/soup/CookieJarSoup.cpp:
(WebCore::cookiesEnabled):

Source/WebKit:

* NetworkProcess/NetworkConnectionToWebProcess.cpp:
(WebKit::NetworkConnectionToWebProcess::cookiesEnabled):
* NetworkProcess/NetworkConnectionToWebProcess.h:
* NetworkProcess/NetworkConnectionToWebProcess.messages.in:
* WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
(WebKit::WebPlatformStrategies::cookiesEnabled):
* WebProcess/WebCoreSupport/WebPlatformStrategies.h:

Source/WebKitLegacy/mac:

* WebCoreSupport/WebPlatformStrategies.h:
* WebCoreSupport/WebPlatformStrategies.mm:
(WebPlatformStrategies::cookiesEnabled):

Source/WebKitLegacy/win:

* WebCoreSupport/WebPlatformStrategies.cpp:
(WebPlatformStrategies::cookiesEnabled):
* WebCoreSupport/WebPlatformStrategies.h:

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

2 years agocheck-webkit-style erroneously requires a space between the carrot and brace in obj...
megan_gardner@apple.com [Thu, 5 Oct 2017 22:41:15 +0000 (22:41 +0000)]
check-webkit-style erroneously requires a space between the carrot and brace in obj-c blocks.
https://bugs.webkit.org/show_bug.cgi?id=177897

Reviewed by Dan Bernstein and Jonathan Bedard.

Remove the check for a space between ^ and {,
as this is valid and expected Obj-C. Now check to make sure there is
no space at all between ^ and {, and also that there is a space between
the end of an argument list and the {.

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

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

2 years agoRenderListItem should not hold raw pointers to RenderListMarker.
zalan@apple.com [Thu, 5 Oct 2017 22:40:05 +0000 (22:40 +0000)]
RenderListItem should not hold raw pointers to RenderListMarker.
https://bugs.webkit.org/show_bug.cgi?id=177968
<rdar://problem/34842943>

Reviewed by Antti Koivisto.

Now we don't need to unregister the marker from the list item explicitly.

Covered by existing tests.

* rendering/RenderListItem.cpp:
(WebCore::RenderListItem::RenderListItem):
(WebCore::RenderListItem::willBeDestroyed):
(WebCore::RenderListItem::positionListMarker):
* rendering/RenderListItem.h:
* rendering/RenderListMarker.cpp:
(WebCore::RenderListMarker::willBeDestroyed):
* style/RenderTreeUpdaterListItem.cpp:
(WebCore::RenderTreeUpdater::ListItem::updateMarker):

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

2 years agoUpdate Webkit Style webpage to include Obj-C blocks
megan_gardner@apple.com [Thu, 5 Oct 2017 22:32:55 +0000 (22:32 +0000)]
Update Webkit Style webpage to include Obj-C blocks
https://bugs.webkit.org/show_bug.cgi?id=177906

Reviewed by Tim Horton.

* code-style.md:

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

2 years agoRenderSVGRoot should check the renderers inside its visualOverflowRect for hit testin...
commit-queue@webkit.org [Thu, 5 Oct 2017 21:54:16 +0000 (21:54 +0000)]
RenderSVGRoot should check the renderers inside its visualOverflowRect for hit testing if the overflow is visible
https://bugs.webkit.org/show_bug.cgi?id=177953
<rdar://problem/34788389>

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

Source/WebCore:

Test: svg/hittest/svg-visual-overflow-rect.html

If an SVGElement is positioned outside the rectangle of the root element,
it can still be drawn if the root element has "overflow: visible" applied.
But since SVGElement can be drawn in this case, it should be accessible
through nodeAtPoint() which is used for hit testing.

* rendering/svg/RenderSVGRoot.cpp:
(WebCore::RenderSVGRoot::nodeAtPoint):

LayoutTests:

* svg/hittest/svg-visual-overflow-rect-expected.html: Added.
* svg/hittest/svg-visual-overflow-rect.html: Added.

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

2 years agoMark 4 fast/text layout tests as flaky on Windows.
pvollan@apple.com [Thu, 5 Oct 2017 21:31:00 +0000 (21:31 +0000)]
Mark 4 fast/text layout tests as flaky on Windows.
https://bugs.webkit.org/show_bug.cgi?id=177964

Unreviewed test gardening.

* platform/win/TestExpectations:

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

2 years agoRenderButton should not hold raw pointers to its direct children.
zalan@apple.com [Thu, 5 Oct 2017 21:14:44 +0000 (21:14 +0000)]
RenderButton should not hold raw pointers to its direct children.
https://bugs.webkit.org/show_bug.cgi?id=177960
<rdar://problem/34840807>

Reviewed by Antti Koivisto.

The correct way of destroying a renderer is to call ::removeFromParentAndDestroy().

Covered by existing tests.

* rendering/RenderButton.cpp:
(WebCore::RenderButton::RenderButton):
(WebCore::RenderButton::addChild):
(WebCore::RenderButton::takeChild):
(WebCore::RenderButton::updateAnonymousChildStyle const):
(WebCore::RenderButton::setText):
(WebCore::RenderButton::text const):
* rendering/RenderButton.h:

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

2 years agoAX: [iOS] Layout Test accessibility/ios-simulator/video-elements-ios.html is failing
n_wang@apple.com [Thu, 5 Oct 2017 21:07:14 +0000 (21:07 +0000)]
AX: [iOS] Layout Test accessibility/ios-simulator/video-elements-ios.html is failing
https://bugs.webkit.org/show_bug.cgi?id=177954
<rdar://problem/34838094>

We should do the isIgnored check instead of the null check.

Reviewed by Chris Fleizach.

* accessibility/ios-simulator/video-elements-ios-expected.txt:
* accessibility/ios-simulator/video-elements-ios.html:

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

2 years agoGenerate a compile error if release is built without compiler optimizations
clopez@igalia.com [Thu, 5 Oct 2017 20:39:04 +0000 (20:39 +0000)]
Generate a compile error if release is built without compiler optimizations
https://bugs.webkit.org/show_bug.cgi?id=177665

Reviewed by Brian Burg.

.:

Default to RelWithDebInfo if CMAKE_BUILD_TYPE is unset.

* CMakeLists.txt:

Source/JavaScriptCore:

Pass -DRELEASE_WITHOUT_OPTIMIZATIONS to testair.cpp and testb3.cpp because
this files are compiled with -O0 for build speed reasons after r195639.

* JavaScriptCore.xcodeproj/project.pbxproj:

Source/WTF:

For GCC and Clang, generate an error at build time that will alert
the developer that she is trying to build Release without any compiler
optimization. A build time error is much better than an unexpected
"oh, WebKit is really slow ..."  situation later.

If this was intended, then we tell the developer that she can continue
by just setting -DRELEASE_WITHOUT_OPTIMIZATIONS in the list of build
flags.

The intention of this patch is to ensure that nobody builds Release
without enabling compiler optimization by mistake.

* wtf/Compiler.h:

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

2 years agoOnly add prototypes to the PrototypeMap if they're not already present
sbarati@apple.com [Thu, 5 Oct 2017 19:58:08 +0000 (19:58 +0000)]
Only add prototypes to the PrototypeMap if they're not already present
https://bugs.webkit.org/show_bug.cgi?id=177952

Reviewed by Michael Saboff and JF Bastien.

With poly proto, we need to call PrototypeMap::add more frequently since we don't
know if the prototype is already in the map or not based solely on Structure.
PrototypeMap::add was calling WeakMap::set unconditionally, which would unconditionally
allocate a Weak handle. Allocating a Weak handle is expensive. It's at least 8x more
expensive than just checking if the prototype is in the map prior to adding it. This
patch makes the change to only add the prototype if it's not already in the map. To
do this, I've added a WeakMap::add API that just forwards into HashMap's add API.
This allows us to both only do a single hash table lookup and also to allocate only
a single Weak handle when necessary.

* runtime/PrototypeMapInlines.h:
(JSC::PrototypeMap::addPrototype):
* runtime/WeakGCMap.h:
(JSC::WeakGCMap::add):

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

2 years agoBug 177893: Disable -Wcast-qual for new clang compiler in Apple ports
ddkilzer@apple.com [Thu, 5 Oct 2017 19:12:04 +0000 (19:12 +0000)]
Bug 177893: Disable -Wcast-qual for new clang compiler in Apple ports
<https://webkit.org/b/177893>
<rdar://problem/33667497>

Reviewed by Tim Horton.

Source/WebCore:

* Configurations/Base.xcconfig:
(WARNING_CFLAGS): Remvoe -Wcast-qual until we can provide a safe
cast function that lets us re-enable the warning.

Source/WTF:

* wtf/RetainPtr.h:
(WTF::RetainPtr::fromStorageType const): Disable warnings for
-Wcast-qual until we can provide a safe cast function that lets
us re-enable the warning.

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

2 years agoMake progress toward properly-formed XPC services in the Mac CMake build
timothy_horton@apple.com [Thu, 5 Oct 2017 19:09:53 +0000 (19:09 +0000)]
Make progress toward properly-formed XPC services in the Mac CMake build
https://bugs.webkit.org/show_bug.cgi?id=177918

Reviewed by Alex Christensen.

.:

* Source/cmake/WebKitMacros.cmake:
Add a macro wrapper around 'ln'.

Source/WebKit:

* CMakeLists.txt:
* PlatformMac.cmake:
Turn on the storage process on Mac, and fix its build.
Move XPC services to Versions/A/XPCServices and add the toplevel
XPCServices as a symlink of that.
Run the XPC services' Info.plists through configure_file, and substitute
the important variables (most critically the bundle identifier).
Factor out the service setup so we don't keep duplicating it as it
gets more complicated.

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

2 years agoImplement font-display loading behaviors
mmaxfield@apple.com [Thu, 5 Oct 2017 19:02:03 +0000 (19:02 +0000)]
Implement font-display loading behaviors
https://bugs.webkit.org/show_bug.cgi?id=175384
<rdar://problem/33813243>

Reviewed by Darin Adler.

Source/WebCore:

The font-display descriptors works off of the following model of font loading:

1. When a font loads, the @font-face enters the first phase, called the "block period." Here,
text using this @font-face is rendered as invisible using a fallback font for metrics. If the
file finishes loading during this period, it is swapped in (visibly).
2. When the first phase is over, the @font-face enters the second phase, called the "swap
period." Here, text using this @font-face is rendered visibly using a fallback font. If the
file finishes loading during this period, it is swapped in.
3. When the second phase is over, the @font-face enters the third phase, called the "failure
period." Here, text using this @font-face is rendered visibly using a fallback font. If the
file finishes loading during this period, it is not swapped in (but it does live in the
network cache for subsequent page loads). This phase lasts forever.

The font-display descriptor changes the duration of these phases. For example, our default
font loading behavior can be achieved by making the first phase 3 seconds long and making the
second phase infinitely long (so the third phase is never reached).

Luckily, our CSSFontFace class already has states which correspond to each phase listed above:
Loading, TimedOut, and Failure. This patch migrates our existing 3-second timer to have logic
to correctly set the timeout duration based on the value of the font-display descriptor and
the current status(). This occurs inside CSSFontFace::setStatus().

This has implications for testing. Previously, our tests for the font loading behavior had a
single boolean that describes whether or not font loads should immediately jump to the "swap
period". Clearly, this is insufficient for testing all aspects of the font-display descriptor.
Instead, this patch deletes this existing infrastructure and instead creates three more fake
values of font-display (achieved in tests by using window.internals). These fake values make
fonts immediately jump into a particular state and stay there forever (so the timeout values
are, for example, [0, infinity, infinity] to test the swap period). This works because
CSSFontFace is smart enough to synchronously move between states that have a 0 timeout, so
there is no race between these timers and font loads.

We also need to test the behavior when a file downloads and when a file hasn't been loaded
yet (and the @font-face is in a particular state). Therefore, this patch adds another bool
which indicates whether the font subsystem should totally ignore font load events. This means
that a font will successfully download (and DOMContentLoaded will be fired, because that
uses the loading subsystem), but the font subsystem will plug its ears and ignore the load.
This means we can test the invisibility of text during the "block period" because DRT will
see that the page load has completed, but the font subsystem will pretend like the font is
still loading and draw invisibly.

Therefore, there are 6 tests: a test to test each of the 3 states an @font-face block may be
in, times 2 for whether or not we are ignoring font loads. These are more comprehensive than
the existing font loading tests which used internals.settings.setWebFontsAlwaysFallBack(),
so I deleted those tests in favor of these new ones.

Tests: fast/text/loading-block-finish.html
       fast/text/loading-block-nofinish.html
       fast/text/loading-failure-finish.html
       fast/text/loading-failure-nofinish.html
       fast/text/loading-swap-finish.html
       fast/text/loading-swap-nofinish.html

* css/CSSFontFace.cpp:
(WebCore::CSSFontFace::setLoadingBehavior):
(WebCore::CSSFontFace::fontLoadEventOccurred): Remove old testing infrastructure.
(WebCore::CSSFontFace::timeoutFired): Previously, the timer was only used for going
from Loading -> TimedOut. Now, we have to ask the status() to figure out which
state transition we should be performing.
(WebCore::CSSFontFace::allSourcesFailed const): A Failed state needs to return true
here, even if some of the sources successfully downloaded.
(WebCore::CSSFontFace::setStatus): The logic to figure out how long to set the timer
for. Also, if the timer value is 0, synchronously recurse to change the status instead
of setting a 0-delay timer.
(WebCore::CSSFontFace::fontLoaded): Remove old testing infrastructure.
(WebCore::CSSFontFace::fontTimeoutIndex const): Implement new testing infrastructure.
(WebCore::CSSFontFace::shouldIgnoreFontLoadCompletions const): Ditto.
(WebCore::CSSFontFace::pump): See comment. Also, we're allowed to be in the Failure
state in more scenarios now, so relax some of our ASSERT()s.
(WebCore::CSSFontFace::font): Ditto.
(WebCore::CSSFontFace::webFontsShouldAlwaysFallBack const): Deleted.
* css/CSSFontFace.h: Migrate to new testing infrastructure.
* css/CSSFontFaceSource.cpp:
(WebCore::CSSFontFaceSource::CSSFontFaceSource): Implement new testing infrastructure.
(WebCore::CSSFontFaceSource::shouldIgnoreFontLoadCompletions const): Ditto.
(WebCore::CSSFontFaceSource::fontLoaded): Ditto.
* css/CSSFontFaceSource.h:
* css/CSSFontSelector.cpp:
(WebCore::CSSFontSelector::beginLoadingFontSoon): Remove old testing infrastructure.
* css/CSSSegmentedFontFace.cpp: It's possible to get different values out of
CSSFontFace::font() in successive calls during the same runloop. FontRanges will
include a raw pointer to one of the values, so all the values need to be kept alive.
* page/Settings.cpp: Migrate to new testing infrastructure.
(WebCore::Settings::Settings):
(WebCore::Settings::setFontTimeoutIndex):
(WebCore::Settings::setShouldIgnoreFontLoadCompletions):
(WebCore::Settings::setWebFontsAlwaysFallBack): Deleted.
* page/Settings.h: Ditto.
(WebCore::Settings::fontTimeoutIndex const):
(WebCore::Settings::shouldIgnoreFontLoadCompletions const):
(WebCore::Settings::webFontsAlwaysFallBack const): Deleted.
* testing/InternalSettings.cpp: Ditto.
(WebCore::InternalSettings::Backup::Backup):
(WebCore::InternalSettings::Backup::restoreTo):
(WebCore::InternalSettings::setFontTimeoutIndex):
(WebCore::InternalSettings::setShouldIgnoreFontLoadCompletions):
(WebCore::InternalSettings::setWebFontsAlwaysFallBack): Deleted.
* testing/InternalSettings.h: Ditto.
* testing/InternalSettings.idl: Ditto.

LayoutTests:

Delete the tests using the old testing infrastructure and replace them
with tests that use the new testing infrastructure.

* fast/text/font-loading-system-fallback-expected.html: Removed.
* fast/text/font-loading-system-fallback.html: Removed.
* fast/text/loading-block-finish-expected.html: Added.
* fast/text/loading-block-finish.html: Added.
* fast/text/loading-block-nofinish-expected.html: Added.
* fast/text/loading-block-nofinish.html: Added.
* fast/text/loading-failure-finish-expected.html: Added.
* fast/text/loading-failure-finish.html: Added.
* fast/text/loading-failure-nofinish-expected.html: Added.
* fast/text/loading-failure-nofinish.html: Added.
* fast/text/loading-swap-finish-expected.html: Added.
* fast/text/loading-swap-finish.html: Added.
* fast/text/loading-swap-nofinish-expected.html: Added.
* fast/text/loading-swap-nofinish.html: Added.
* fast/text/web-font-load-fallback-during-loading-2-expected.html: Removed.
* fast/text/web-font-load-fallback-during-loading-2.html: Removed.
* fast/text/web-font-load-fallback-during-loading-expected.html: Removed.
* fast/text/web-font-load-fallback-during-loading.html: Removed.
* platform/gtk/TestExpectations:
* platform/ios-wk1/TestExpectations:
* platform/win/TestExpectations:

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

2 years agoUnreviewed. Disable probe OSR exit on 32-bit until it's fixed.
sbarati@apple.com [Thu, 5 Oct 2017 18:59:58 +0000 (18:59 +0000)]
Unreviewed. Disable probe OSR exit on 32-bit until it's fixed.

* runtime/Options.cpp:
(JSC::recomputeDependentOptions):

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

2 years agoLayout Test media/modern-media-controls/scrubber-support/scrubber-support-drag.html...
commit-queue@webkit.org [Thu, 5 Oct 2017 18:57:07 +0000 (18:57 +0000)]
Layout Test media/modern-media-controls/scrubber-support/scrubber-support-drag.html is flaky.
https://bugs.webkit.org/show_bug.cgi?id=174682

Patch by Antoine Quint <graouts@apple.com> on 2017-10-05
Reviewed by Dean Jackson.

This test could fail since we would start it before the time control was fully sized and only
the scrubber had bounds, but not the elapsed time label. We have to wait on both being fully
sized before starting the test and only then it is reliable.

* media/modern-media-controls/scrubber-support/scrubber-support-drag.html:
* platform/mac/TestExpectations:

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

2 years agoLayout Test media/modern-media-controls/scrubber-support/scrubber-support-click.html...
commit-queue@webkit.org [Thu, 5 Oct 2017 18:51:46 +0000 (18:51 +0000)]
Layout Test media/modern-media-controls/scrubber-support/scrubber-support-click.html is flaky
https://bugs.webkit.org/show_bug.cgi?id=177930

Patch by Antoine Quint <graouts@apple.com> on 2017-10-05
Reviewed by Dean Jackson.

In cases where this test failed, it actually worked as expected but the "timeupdate" event would be fired
twice, most likely because it was registered twice. We now use an asynchronous expectation to run the test
which should only register the event listener once and make the test more reliable.

* media/modern-media-controls/scrubber-support/scrubber-support-click-expected.txt:
* media/modern-media-controls/scrubber-support/scrubber-support-click.html:

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

2 years agoRenderMathMLFenced should not hold a raw pointer to RenderMathMLFencedOperator
zalan@apple.com [Thu, 5 Oct 2017 18:48:36 +0000 (18:48 +0000)]
RenderMathMLFenced should not hold a raw pointer to RenderMathMLFencedOperator
https://bugs.webkit.org/show_bug.cgi?id=177950
<rdar://problem/34837002>

Reviewed by Antti Koivisto.

Even though RenderMathMLFencedOperator is a child renderer, it's lifetime is not explicitly managed by
RenderMathMLFenced.

Covered by existing test cases.

* rendering/mathml/RenderMathMLFenced.cpp:
(WebCore::RenderMathMLFenced::RenderMathMLFenced):
(WebCore::RenderMathMLFenced::makeFences):
(WebCore::RenderMathMLFenced::addChild):
* rendering/mathml/RenderMathMLFenced.h:

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

2 years ago[Payment Request] Add a payment method that supports Apple Pay
aestes@apple.com [Thu, 5 Oct 2017 18:47:17 +0000 (18:47 +0000)]
[Payment Request] Add a payment method that supports Apple Pay
https://bugs.webkit.org/show_bug.cgi?id=177850

Reviewed by Youenn Fablet.

LayoutTests/imported/w3c:

* web-platform-tests/payment-request/payment-request-abort-method.https-expected.txt:
* web-platform-tests/payment-request/payment-request-show-method.https-expected.txt:

Source/WebCore:

This patch implements a payment method dictionary and a payment handler for Apple Pay.

It reuses existing Apple Pay code by:
1. Moving shared properties from ApplePayPaymentRequest to ApplePayRequestBase and having
   ApplePayPaymentRequest inherit from ApplePayRequestBase.
2. Creating an ApplePayRequest dictionary that inherits from ApplePayRequestBase and adds
   PaymentRequest-specific properties (right now that's just the version property).
3. Moving validation logic from ApplePaySession into various places that can be reused by
   PaymentRequest and ApplePayPaymentHandler.
4. Storing currency values for both ApplePaySession and PaymentRequest in Strings rather
   than integers representing whole cents, since PaymentRequest supports high-precision
   currency values.

This patch does not implement any event handling for merchant validation, payment method
changes, or shipping address/option changes. That will be handled in a follow-on.

Test: http/tests/ssl/applepay/PaymentRequest.html

* DerivedSources.make:
* Modules/applepay/ApplePayContactField.cpp: Added.
(WebCore::convertAndValidate): Moved from ApplePaySession.cpp.
* Modules/applepay/ApplePayContactField.h: Added.
* Modules/applepay/ApplePayContactField.idl: Added.
* Modules/applepay/ApplePayMerchantCapability.cpp: Added.
(WebCore::convertAndValidate): Moved from ApplePaySession.cpp.
* Modules/applepay/ApplePayMerchantCapability.h: Added.
* Modules/applepay/ApplePayMerchantCapability.idl: Added.
* Modules/applepay/ApplePayPaymentRequest.h: Moved fields shared with ApplePayRequest into ApplePayRequestBase.
* Modules/applepay/ApplePayPaymentRequest.idl: Ditto.
* Modules/applepay/ApplePayRequestBase.cpp: Added.
(WebCore::convertAndValidate): Moved from ApplePaySession.cpp.
* Modules/applepay/ApplePayRequestBase.h: Added.
* Modules/applepay/ApplePayRequestBase.idl: Added.
* Modules/applepay/ApplePaySession.cpp:
(WebCore::validateAmount): Renamed from parseAmount.
(WebCore::convertAndValidateTotal):
(WebCore::convertAndValidate):
(WebCore::parseDigit): Deleted.
(WebCore::parseAmount): Renamed to validateAmount.
* Modules/applepay/ApplePaySessionPaymentRequest.h: Changed amount from an int64_t to a String.
* Modules/applepay/ApplePayShippingMethodSelectedEvent.cpp:
(WebCore::convert):
* Modules/applepay/PaymentRequestValidator.mm: Renamed from Source/WebCore/Modules/applepay/PaymentRequestValidator.cpp.
(WebCore::PaymentRequestValidator::validateTotal): Used NSDecimalNumber to validate amounts.
(WebCore::validateShippingMethod): Ditto.
* Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp: Added.
(WebCore::ApplePayPaymentHandler::handlesIdentifier): Added. Returns true if identifier is a URL with host "apple.com" and path "/apple-pay".
(WebCore::ApplePayPaymentHandler::ApplePayPaymentHandler):
(WebCore::convert): Added. Converts PaymentRequest types to ApplePaySessionPaymentRequest types.
(WebCore::ApplePayPaymentHandler::convertData): Added. JSON-parses data into an ApplePayRequest,
then uses that along with the PaymentRequest to construct and validate an ApplePaySessionPaymentRequest.
(WebCore::ApplePayPaymentHandler::show): Added a FIXME.
* Modules/applepay/paymentrequest/ApplePayPaymentHandler.h: Added.
* Modules/applepay/paymentrequest/ApplePayRequest.h: Added.
* Modules/applepay/paymentrequest/ApplePayRequest.idl: Added. Inherits from ApplePayRequestBase and adds a required version property.
* Modules/paymentrequest/PaymentHandler.cpp: Added.
(WebCore::PaymentHandler::create): Returns a PaymentHandler subclass based on the payment method identifier.
(WebCore::PaymentHandler::~PaymentHandler):
* Modules/paymentrequest/PaymentHandler.h: Added.
* Modules/paymentrequest/PaymentRequest.cpp:
(WebCore::convertAndValidatePaymentMethodIdentifier): Added.
(WebCore::PaymentRequest::show): Removed an unnecessary call to RunLoop::dispatch().
Created a PaymentHandler for each payment method and called show() on the first available PaymentHandler.
(WebCore::PaymentRequest::abort): Removed an unnecessary call to RunLoop::dispatch().
(WebCore::PaymentRequest::canMakePayment): Ditto.
(WebCore::PaymentRequest::finishShowing): Deleted.
* Modules/paymentrequest/PaymentRequest.h:
* WebCore.xcodeproj/project.pbxproj:

Source/WebKit:

* UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
(toShippingMethod): Converted the NSDecimalNumber amount to a string rather than an integer.
(WebKit::toDecimalNumber): used -decimalNumberWithString:locale: rather than
-initWithMantissa:exponent:isNegative: to create an NSDecimalNumber.
(WebKit::toPKPaymentSummaryItem):
(WebKit::toPKShippingMethod):

LayoutTests:

* http/tests/ssl/applepay/PaymentRequest.https-expected.txt: Added.
* http/tests/ssl/applepay/PaymentRequest.https.html: Added.
* platform/mac-wk2/TestExpectations:
* platform/ios-wk2/TestExpectations:

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

2 years agoMove more multicolumn render tree mutation code to RenderTreeUpdater::MultiColumn
antti@apple.com [Thu, 5 Oct 2017 17:59:49 +0000 (17:59 +0000)]
Move more multicolumn render tree mutation code to RenderTreeUpdater::MultiColumn
https://bugs.webkit.org/show_bug.cgi?id=177942

Reviewed by Zalan Bujtas.

* rendering/RenderMultiColumnFlow.cpp:
(WebCore::RenderMultiColumnFlow::RenderMultiColumnFlow):

    Use std::unique_ptr for the spanner map for safe owenership transfer.

(WebCore::RenderMultiColumnFlow::fragmentedFlowDescendantInserted):
(WebCore::RenderMultiColumnFlow::handleSpannerRemoval):
(WebCore::RenderMultiColumnFlow::fragmentedFlowRelativeWillBeRemoved):
(WebCore::RenderMultiColumnFlow::populate): Deleted.
(WebCore::RenderMultiColumnFlow::evacuateAndDestroy): Deleted.

    This code moves to RenderTreeUpdater::MultiColumn.

* rendering/RenderMultiColumnFlow.h:
* style/RenderTreeUpdaterMultiColumn.cpp:
(WebCore::RenderTreeUpdater::MultiColumn::update):
(WebCore::RenderTreeUpdater::MultiColumn::createFragmentedFlow):
(WebCore::RenderTreeUpdater::MultiColumn::destroyFragmentedFlow):

    Use Hyatt's preferred 'fragmented flow' terminology.

* style/RenderTreeUpdaterMultiColumn.h:

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

2 years agoUnreviewed, rolling out r222893.
jlewis3@apple.com [Thu, 5 Oct 2017 17:58:55 +0000 (17:58 +0000)]
Unreviewed, rolling out r222893.

This caused multiple API failures.

Reverted changeset:

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

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

2 years agoUnreviewed. Run WebKit2 C API tests in GTK+ bots again after the last WebKit2 ->...
carlosgc@webkit.org [Thu, 5 Oct 2017 17:50:03 +0000 (17:50 +0000)]
Unreviewed. Run WebKit2 C API tests in GTK+ bots again after the last WebKit2 -> WebKit rename.

* Scripts/run-gtk-tests:
(TestRunner):
(TestRunner._run_test):

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

2 years agoRemove additional WebKitSystemInterface remnants
darin@apple.com [Thu, 5 Oct 2017 17:43:56 +0000 (17:43 +0000)]
Remove additional WebKitSystemInterface remnants
https://bugs.webkit.org/show_bug.cgi?id=177948

Reviewed by Andy Estes.

Source/WebCore:

* PlatformMac.cmake: Remove logic to select and link an appropriate
WebKitSystemInterface library.

* html/shadow/MediaControlElementTypes.h: Remove comment about matching
WebKitSystemInterface.h, now obsolete.

* rendering/RenderMediaControls.cpp: Wrap whole file in a single conditional
to make it clear that it's only used at all in this one particular case.
(wkHitTestMediaUIPart): Deleted.
(wkMeasureMediaUIPart): Deleted.
(wkDrawMediaUIPart): Deleted.
(wkDrawMediaSliderTrack): Deleted.
(WebCore::determineState): Deleted.
(WebCore::getUnzoomedRectAndAdjustCurrentContext): Deleted.
(WebCore::RenderMediaControls::adjustMediaSliderThumbSize): Call the
WKMeasureMediaUIPart instead of through an inline function to rename it.
(WebCore::RenderMediaControls::paintMediaControlsPart): Deleted.

* rendering/RenderMediaControls.h: Wrap whole file in a single conditional
to make it clear that it's only used at all in this one particular case.
Removed unneeded includes, forward declarations, and function declaration.

* rendering/RenderThemeMac.mm: Removed include of RenderMediaControls.h.

Source/WebKitLegacy:

* PlatformMac.cmake: Removed reference to deleted file WebSystemInterface.mm.

Tools:

* DumpRenderTree/PlatformMac.cmake: Removed code to link the
WebKitSystemInterface library. Left in code that points to
the WebKitLibraries directory, but maybe that can be removed by
someone who is more certain it's no longer needed.

* Scripts/copy-webkitlibraries-to-product-directory: Removed code
to copy and delete WebKitSystemInterface libraries and headers.

* WebKitTestRunner/PlatformMac.cmake: Removed code to link the
WebKitSystemInterface library. Left in code that points to
the WebKitLibraries directory, but maybe that can be removed by
someone who is more certain it's no longer needed.

WebKitLibraries:

* libWebKitSystemInterfaceElCapitan.a: Removed.
* libWebKitSystemInterfaceIOSDevice10.a: Removed.
* libWebKitSystemInterfaceIOSDevice11.a: Removed.
* libWebKitSystemInterfaceIOSSimulator10.a: Removed.
* libWebKitSystemInterfaceIOSSimulator11.a: Removed.
* libWebKitSystemInterfaceOSX10.12.a: Removed.
* libWebKitSystemInterfaceOSX10.13.a: Removed.

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

2 years agoRemove redundant LayoutStateDisabler from RenderTreeUpdaterFirstLetter
zalan@apple.com [Thu, 5 Oct 2017 17:40:14 +0000 (17:40 +0000)]
Remove redundant LayoutStateDisabler from RenderTreeUpdaterFirstLetter
https://bugs.webkit.org/show_bug.cgi?id=177946

Reviewed by Simon Fraser.

First letter is updated prior to layout.

Covered by existing tests.

* style/RenderTreeUpdaterFirstLetter.cpp:
(WebCore::updateFirstLetterStyle):

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

2 years ago[Payment Request] Factor out ApplePaySession's interface to PaymentCoordinator into...
aestes@apple.com [Thu, 5 Oct 2017 17:31:58 +0000 (17:31 +0000)]
[Payment Request] Factor out ApplePaySession's interface to PaymentCoordinator into a base class
https://bugs.webkit.org/show_bug.cgi?id=177904

Reviewed by Daniel Bates.

In a follow-on patch, something other than ApplePaySession will need to be the
PaymentCoordinator's active session during PaymentRequest sessions.

To support this, this patch factors out the ApplePaySession functions called by
PaymentCoordinator into a new base class called PaymentSession.

* Modules/applepay/ApplePaySession.h:
* Modules/applepay/PaymentCoordinator.cpp:
(WebCore::PaymentCoordinator::beginPaymentSession):
* Modules/applepay/PaymentCoordinator.h:
* Modules/applepay/PaymentSession.h: Added.
(WebCore::PaymentSession::~PaymentSession):
* WebCore.xcodeproj/project.pbxproj:

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

2 years agoUnreviewed. Try to make debug type profiler tests stop timing out.
sbarati@apple.com [Thu, 5 Oct 2017 17:18:15 +0000 (17:18 +0000)]
Unreviewed. Try to make debug type profiler tests stop timing out.

* Scripts/run-jsc-stress-tests:

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

2 years agoMove multicolumn flow clear to RenderTreeUpdater
zalan@apple.com [Thu, 5 Oct 2017 14:04:27 +0000 (14:04 +0000)]
Move multicolumn flow clear to RenderTreeUpdater
https://bugs.webkit.org/show_bug.cgi?id=177898
<rdar://problem/34820157>

Reviewed by Antti Koivisto.

There are 2 cases when we need to clear the the multicolumn flow from its container.

1. When the column renderer is not need anymore due to style change (evacuateAndDestroy).
During the subtree reparenting (moving back the descendants to the original position),
if we still had the multicolumn set on the RenderBlockFlow, RenderBlockFlow::addChild() would
put the children back under the column. -> Move the clear call to the RenderTreeUpdater.

2. When the column is detached from the tree/destroyed (willBeRemoveFromTree).
Since it does not trigger reparenting, we don't need to clear the column immediately.
We call clear to avoid accessing state column renderer. -> Use WeakPtr to
manage lifetime instead.

Covered by existing tests.

* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::setMultiColumnFlow):
(WebCore::RenderBlockFlow::clearMultiColumnFlow):
* rendering/RenderBlockFlow.h:
* rendering/RenderMultiColumnFlow.cpp:
(WebCore::RenderMultiColumnFlow::evacuateAndDestroy):
(WebCore::RenderMultiColumnFlow::willBeRemovedFromTree):
* style/RenderTreeUpdaterMultiColumn.cpp:
(WebCore::RenderTreeUpdater::MultiColumn::update):
(WebCore::RenderTreeUpdater::MultiColumn::createFragmentedFlow):

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

2 years ago[GTK][WPE] GIFImageDecoder never clears decoded frames even when told to do so
magomez@igalia.com [Thu, 5 Oct 2017 14:00:05 +0000 (14:00 +0000)]
[GTK][WPE] GIFImageDecoder never clears decoded frames even when told to do so
https://bugs.webkit.org/show_bug.cgi?id=177864

Reviewed by Carlos Garcia Campos.

Fix GIFImageDecoder::clearFrameBufferCache() so it really deletes decoded buffers, and modify
GIFImageDecoder to be able to decode frames that are not requested in the expected order.

Covered by existent tests.

* platform/image-decoders/gif/GIFImageDecoder.cpp:
(WebCore::GIFImageDecoder::findFirstRequiredFrameToDecode):
(WebCore::GIFImageDecoder::frameBufferAtIndex):
(WebCore::GIFImageDecoder::clearFrameBufferCache):
* platform/image-decoders/gif/GIFImageDecoder.h:
* platform/image-decoders/gif/GIFImageReader.cpp:
(GIFImageReader::decode):
* platform/image-decoders/gif/GIFImageReader.h:
(GIFImageReader::frameContext const):

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

2 years agoUnreviewed GTK+ gardening. Update expectations and rebaseline tests failing at r222905.
magomez@igalia.com [Thu, 5 Oct 2017 13:31:57 +0000 (13:31 +0000)]
Unreviewed GTK+ gardening. Update expectations and rebaseline tests failing at r222905.

* platform/gtk/TestExpectations:
* platform/gtk/js/dom/global-constructors-attributes-expected.txt:

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

2 years ago[WinCairo] Fix build after Bug 167956
commit-queue@webkit.org [Thu, 5 Oct 2017 10:49:45 +0000 (10:49 +0000)]
[WinCairo] Fix build after Bug 167956
https://bugs.webkit.org/show_bug.cgi?id=177921

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

FontCascade::fontForCombiningCharacterSequence wasn't defined for
WinCairo port. It should be defined if !USE(HARFBUZZ).

No new tests because there is no behavior change.

* platform/graphics/FontCascade.cpp: Use !USE(HARFBUZZ) instead of !USE(CAIRO).

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

2 years agoRemove Brotli from Source/ThirdParty
fred.wang@free.fr [Thu, 5 Oct 2017 09:32:58 +0000 (09:32 +0000)]
Remove Brotli from Source/ThirdParty
https://bugs.webkit.org/show_bug.cgi?id=177804

Patch by Frederic Wang <fwang@igalia.com> on 2017-10-03
Reviewed by Michael Catanzaro.

.:

* Source/CMakeLists.txt: Do not build ThirdParty/brotli anymore.
* Source/cmake/FindBrotliDec.cmake: Added. New cmake module to find Brotli via PkgConfig.
* Source/cmake/OptionsGTK.cmake: Expose USE_WOFF2 as a public option and use find_package
to look for brotli.

Source/ThirdParty:

* brotli/CMakeLists.txt: Removed.
* brotli/LICENSE: Removed.
* brotli/README.webkit: Removed.
* brotli/common/constants.h: Removed.
* brotli/common/dictionary.bin: Removed.
* brotli/common/dictionary.c: Removed.
* brotli/common/dictionary.h: Removed.
* brotli/common/version.h: Removed.
* brotli/dec/bit_reader.c: Removed.
* brotli/dec/bit_reader.h: Removed.
* brotli/dec/context.h: Removed.
* brotli/dec/decode.c: Removed.
* brotli/dec/huffman.c: Removed.
* brotli/dec/huffman.h: Removed.
* brotli/dec/port.h: Removed.
* brotli/dec/prefix.h: Removed.
* brotli/dec/state.c: Removed.
* brotli/dec/state.h: Removed.
* brotli/dec/transform.h: Removed.
* brotli/include/brotli/decode.h: Removed.
* brotli/include/brotli/encode.h: Removed.
* brotli/include/brotli/port.h: Removed.
* brotli/include/brotli/types.h: Removed.
* brotli/update.sh: Removed.
* woff2/CMakeLists.txt: Use Brotli's include and library paths found by CMake.

Tools:

* gtk/jhbuild.modules: Build brotli 1.0.1 from the official github repository.
* Scripts/webkitpy/style/checker.py: Remove brotli.

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

2 years agoAlign BitmapImage::LargeAnimationCutoff to a megabyte value
zandobersek@gmail.com [Thu, 5 Oct 2017 09:28:54 +0000 (09:28 +0000)]
Align BitmapImage::LargeAnimationCutoff to a megabyte value
https://bugs.webkit.org/show_bug.cgi?id=177924

Reviewed by Carlos Garcia Campos.

* platform/graphics/BitmapImage.h: Fix the 1014 multiplier used to calculate
the LargeAnimationCutoff value. It was most likely a typo.

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

2 years agoUnreviewed WPE gardening.
zandobersek@gmail.com [Thu, 5 Oct 2017 09:04:14 +0000 (09:04 +0000)]
Unreviewed WPE gardening.

Enable the http/tests/ layout tests in general, but skip the directories
that contain failing tests that still have to be cataloged.

* platform/wpe/TestExpectations:
* platform/wpe/http: Added.
* platform/wpe/http/wpt: Added.
* platform/wpe/http/wpt/resource-timing: Added.
* platform/wpe/http/wpt/resource-timing/rt-initiatorType-media-expected.txt: Added.

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

2 years agoAddress post-review feedback following r222885
wenson_hsieh@apple.com [Thu, 5 Oct 2017 08:06:16 +0000 (08:06 +0000)]
Address post-review feedback following r222885
https://bugs.webkit.org/show_bug.cgi?id=177853
<rdar://problem/34807346>

Reviewed by Ryosuke Niwa and Dan Bates.

* dom/DataTransfer.cpp:
(WebCore::DataTransfer::updateFileList):
(WebCore::DataTransfer::types const):
(WebCore::DataTransfer::filesFromPasteboardAndItemList const):
* dom/DataTransferItem.h:
(WebCore::DataTransferItem::file):
(WebCore::DataTransferItem::file const): Deleted.
* dom/DataTransferItemList.cpp:
(WebCore::DataTransferItemList::add):
(WebCore::DataTransferItemList::remove):

When removing a data transfer item, capture it in a Ref for the scope of remove(), so that it won't be destroyed
immediately after removing from the item list.

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

2 years agoUpgrade Brotli to version 1.0.1 and WOFF2 to latest upstream
fred.wang@free.fr [Thu, 5 Oct 2017 07:54:02 +0000 (07:54 +0000)]
Upgrade Brotli to version 1.0.1 and WOFF2 to latest upstream
https://bugs.webkit.org/show_bug.cgi?id=177768

Patch by Frederic Wang <fwang@igalia.com> on 2017-10-05
Reviewed by Michael Catanzaro.

* brotli/CMakeLists.txt:
* brotli/README.webkit:
* brotli/common/constants.h: Added.
* brotli/common/dictionary.bin: Added.
* brotli/common/dictionary.c: Added.
* brotli/common/dictionary.h: Added.
* brotli/common/version.h: Added.
* brotli/dec/Makefile: Removed.
* brotli/dec/bit_reader.c:
* brotli/dec/bit_reader.h:
* brotli/dec/context.h:
* brotli/dec/decode.c:
* brotli/dec/decode.h: Removed.
* brotli/dec/dictionary.c: Removed.
* brotli/dec/dictionary.h: Removed.
* brotli/dec/huffman.c:
* brotli/dec/huffman.h:
* brotli/dec/port.h:
(BrotliDump):
(BrotliRBit):
* brotli/dec/prefix.h:
* brotli/dec/state.c:
* brotli/dec/state.h:
* brotli/dec/transform.h:
* brotli/dec/types.h: Removed.
* brotli/include/brotli/decode.h: Added.
* brotli/include/brotli/encode.h: Added.
* brotli/include/brotli/port.h: Added.
* brotli/include/brotli/types.h: Added.
* brotli/update.sh:
* woff2/CMakeLists.txt:
* woff2/README.webkit:
* woff2/src/buffer.h:
(woff2::Buffer::Buffer):
(woff2::Buffer::Read):
* woff2/src/convert_woff2ttf_*.cc: Added.
* woff2/src/font.cc:
* woff2/src/glyph.cc:
* woff2/src/normalize.cc:
* woff2/src/port.h:
* woff2/src/store_bytes.h:
(woff2::Store16):
* woff2/src/variable_length.cc:
* woff2/src/woff2_common.cc:
* woff2/src/woff2_dec.cc:
* woff2/src/woff2_decompress.cc:
* woff2/src/woff2_enc.cc:
* woff2/src/woff2_info.cc: Added.

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

2 years agoMake LibWebRTCProvider port agnostic
commit-queue@webkit.org [Thu, 5 Oct 2017 07:44:35 +0000 (07:44 +0000)]
Make LibWebRTCProvider port agnostic
https://bugs.webkit.org/show_bug.cgi?id=177747

Patch by Youenn Fablet <youenn@apple.com> on 2017-10-05
Reviewed by Alex Christensen & Alex Garcia.

Source/WebCore:

No change of behavior.

LibWebRTCProvider had some Mac/iOS specific members that are now
moved to LibWebRTCProviderCocoa.
This consists in the codec factories that are VideoToolBox specific.
Introducing LibWebRTCProvider::create to allow different port implementations of LibWebRTCProvider.

* WebCore.xcodeproj/project.pbxproj:
* inspector/InspectorOverlay.cpp:
(WebCore::InspectorOverlay::overlayPage):
* platform/mediastream/libwebrtc/LibWebRTCProvider.cpp:
(WebCore::LibWebRTCProvider::create):
(WebCore::LibWebRTCProvider::factory):
(WebCore::LibWebRTCProvider::createPeerConnectionFactory):
* platform/mediastream/libwebrtc/LibWebRTCProvider.h:
* platform/mediastream/libwebrtc/LibWebRTCProviderCocoa.cpp:
(WebCore::LibWebRTCProviderCocoa::createDecoderFactory):
(WebCore::LibWebRTCProviderCocoa::createEncoderFactory):
(WebCore::LibWebRTCProviderCocoa::setActive):
* platform/mediastream/libwebrtc/LibWebRTCProviderCocoa.h:
* svg/graphics/SVGImage.cpp:
(WebCore::SVGImage::dataChanged):

Source/WebKit:

* WebProcess/Network/webrtc/LibWebRTCProvider.h: Making sure Mac/iOS provider creates the codec factories.

Source/WebKitLegacy/mac:

* WebView/WebView.mm:
(-[WebView _commonInitializationWithFrameName:groupName:]):
(-[WebView initSimpleHTMLDocumentWithStyle:frame:preferences:groupName:]):

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

2 years agoMake sure all prototypes under poly proto get added into the VM's prototype map
sbarati@apple.com [Thu, 5 Oct 2017 07:38:00 +0000 (07:38 +0000)]
Make sure all prototypes under poly proto get added into the VM's prototype map
https://bugs.webkit.org/show_bug.cgi?id=177909

Reviewed by Keith Miller.

JSTests:

* stress/poly-proto-prototype-map-having-a-bad-time.js: Added.
(assert):
(foo.C):
(foo):
(set x):

Source/JavaScriptCore:

This is an invariant of prototypes that I broke when doing poly proto. This patch fixes it.

* JavaScriptCore.xcodeproj/project.pbxproj:
* bytecode/BytecodeList.json:
* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::parseBlock):
* dfg/DFGOperations.cpp:
* runtime/CommonSlowPaths.cpp:
(JSC::SLOW_PATH_DECL):
* runtime/JSCInlines.h:
* runtime/PrototypeMap.cpp:
(JSC::PrototypeMap::addPrototype): Deleted.
* runtime/PrototypeMap.h:
* runtime/PrototypeMapInlines.h:
(JSC::PrototypeMap::isPrototype const):
(JSC::PrototypeMap::addPrototype):

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

2 years ago[Linux] Port MallocBench
utatane.tea@gmail.com [Thu, 5 Oct 2017 07:05:44 +0000 (07:05 +0000)]
[Linux] Port MallocBench
https://bugs.webkit.org/show_bug.cgi?id=177856

Reviewed by Filip Pizlo.

.:

* CMakeLists.txt:

PerformanceTests:

We would like to optimize locking in bmalloc in Linux by using futex APIs. So we should have
the way to ensure this actually improves / does not regress the performance.

This patch ports MallocBench to Linux to measure/ensure the effect of bmalloc patch in Linux.

While we replace the dispatch serial queue in message.cpp, we still use libdispatch in Benchmark.cpp
since we do not have priority mechanism in C++11 threading implementation.

We also extend run-malloc-benchmarks to accept cmake style layout of build product directory.
And we also support building MallocBench in CMake environment including CMake Mac ports.
Currently, we do not support Windows yet.

Based on the measurement, we can say the following observation. glibc's malloc performance is not
so bad. While bmalloc shows 3.8x (in geomean) performance improvement, bmalloc in Linux shows 2.0x
improvement. Since both numbers in bmalloc are similar, we can think that bmalloc's optimization is
actually working in Linux too. And even though glibc's malloc perofmrnace is not so bad, bmalloc
still offers performance improvement.

* CMakeLists.txt: Added.
* MallocBench/CMakeLists.txt: Added.
* MallocBench/MallocBench.xcodeproj/project.pbxproj:
* MallocBench/MallocBench/Benchmark.cpp:
(Benchmark::Benchmark):
(Benchmark::runOnce):
(Benchmark::currentMemoryBytes): Deleted.
* MallocBench/MallocBench/Benchmark.h:
(Benchmark::Memory::Memory): Deleted.
(Benchmark::Memory::operator-): Deleted.
* MallocBench/MallocBench/CMakeLists.txt: Added.
* MallocBench/MallocBench/CPUCount.cpp:
(cpuCount):
* MallocBench/MallocBench/Interpreter.cpp:
(Interpreter::doMallocOp):
* MallocBench/MallocBench/Memory.cpp: Added.
(currentMemoryBytes):
* MallocBench/MallocBench/Memory.h: Copied from PerformanceTests/MallocBench/MallocBench/CPUCount.cpp.
(Memory::Memory):
(Memory::operator-):
* MallocBench/MallocBench/balloon.cpp:
(benchmark_balloon):
* MallocBench/MallocBench/mbmalloc.cpp:
* MallocBench/MallocBench/message.cpp:
(WorkQueue::WorkQueue):
(WorkQueue::~WorkQueue):
(WorkQueue::dispatchAsync):
(WorkQueue::dispatchSync):
(benchmark_message_one):
(benchmark_message_many):
* MallocBench/MallocBench/nimlang.cpp:
(benchmark_nimlang):
* MallocBench/MallocBench/stress.cpp:
(SizeStream::next):
* MallocBench/MallocBench/stress_aligned.cpp:
* MallocBench/run-malloc-benchmarks:

Source/bmalloc:

* CMakeLists.txt:

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

2 years agoWeb Inspector: When scrolled Network Table reduces the number of rows it may appear...
commit-queue@webkit.org [Thu, 5 Oct 2017 06:33:56 +0000 (06:33 +0000)]
Web Inspector: When scrolled Network Table reduces the number of rows it may appear as blank
https://bugs.webkit.org/show_bug.cgi?id=177914
<rdar://problem/34827613>

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

* UserInterface/Views/Table.js:
(WI.Table.prototype._updateVisibleRows):
(WI.Table.prototype._updateFillerRowWithNewHeight):
Reduce the scrollTop when the table was scrolled and was then reloaded with a
smaller number of rows. This can happen in two ways. Either the number of rows
was reduced so much that we enter non-scrollable mode with a non-zero filler
row. This can always reset the scrollTop to 0. Or when a large number of rows
is reduced to a smaller number than our current scrollTop but still more than
fit on one screen. In that case we can reduce the scrollTop to whatever would
scroll the table to its max position.

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

2 years agoRemove WebCoreSystemInterface
achristensen@apple.com [Thu, 5 Oct 2017 06:13:51 +0000 (06:13 +0000)]
Remove WebCoreSystemInterface
https://bugs.webkit.org/show_bug.cgi?id=177916

Reviewed by Antti Koivisto.

Source/WebCore:

* Configurations/WebCore.xcconfig:
* PlatformMac.cmake:
* WebCore.xcodeproj/project.pbxproj:
* accessibility/mac/AXObjectCacheMac.mm:
* accessibility/mac/WebAccessibilityObjectWrapperBase.mm:
* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
* dom/Document.cpp:
* editing/mac/DictionaryLookup.mm:
* page/ios/FrameIOS.mm:
* page/ios/UserAgentIOS.mm:
* page/mac/EventHandlerMac.mm:
* platform/cocoa/LocalizedStringsCocoa.mm:
* platform/cocoa/ScrollController.mm:
* platform/graphics/Font.h:
* platform/graphics/avfoundation/CDMPrivateMediaSourceAVFObjC.mm:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
* platform/graphics/ca/GraphicsLayerCA.cpp:
* platform/graphics/cg/GraphicsContextCG.cpp:
* platform/graphics/cg/ImageBufferCG.cpp:
* platform/graphics/cg/PathCG.cpp:
* platform/graphics/cg/PatternCG.cpp:
* platform/graphics/cocoa/FontCascadeCocoa.mm:
* platform/graphics/cocoa/FontCocoa.mm:
* platform/graphics/cocoa/FontPlatformDataCocoa.mm:
* platform/graphics/mac/ComplexTextControllerCoreText.mm:
* platform/graphics/mac/FontCacheMac.mm:
* platform/graphics/mac/GlyphPageMac.cpp:
* platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
* platform/ios/LegacyTileCache.mm:
* platform/ios/PlatformScreenIOS.mm:
* platform/ios/VideoFullscreenInterfaceAVKit.mm:
* platform/ios/WebCoreSystemInterfaceIOS.mm: Removed.
* platform/ios/wak/WAKWindow.mm:
* platform/mac/CursorMac.mm:
* platform/mac/FileSystemMac.mm:
* platform/mac/PlatformEventFactoryMac.mm:
* platform/mac/PlatformSpeechSynthesizerMac.mm:
* platform/mac/ScrollAnimatorMac.mm:
* platform/mac/ScrollbarThemeMac.mm:
* platform/mac/ThemeMac.mm:
* platform/mac/WebCoreNSURLExtras.mm:
* platform/mac/WebCoreSystemInterface.h: Removed.
* platform/mac/WebCoreSystemInterface.mm: Removed.
* platform/mac/WebVideoFullscreenHUDWindowController.mm:
* platform/mac/WebWindowAnimation.mm:
* platform/network/cf/CookieStorageCFNet.cpp:
* platform/network/cf/CredentialStorageCFNet.cpp:
* platform/network/cf/NetworkStorageSessionCFNet.cpp:
* platform/network/cf/ResourceHandleCFNet.cpp:
* platform/network/cf/ResourceHandleCFURLConnectionDelegate.cpp:
* platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.cpp:
* platform/network/cf/ResourceRequestCFNet.cpp:
* platform/network/cf/ResourceResponseCFNet.cpp:
* platform/network/cf/SocketStreamHandleImplCFNet.cpp:
* platform/network/cf/SynchronousResourceHandleCFURLConnectionDelegate.cpp:
* platform/network/cocoa/ResourceRequestCocoa.mm:
* platform/network/ios/WebCoreURLResponseIOS.mm:
* platform/network/mac/CookieJarMac.mm:
* platform/network/mac/ResourceHandleMac.mm:
* platform/network/mac/WebCoreURLResponse.mm:
* platform/text/TextEncodingRegistry.cpp:
* rendering/RenderThemeMac.mm:

Source/WebKitLegacy/ios:

* Misc/WebUIKitSupport.mm:

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

2 years agoStop linking with WebKitSystemInterface
achristensen@apple.com [Thu, 5 Oct 2017 05:46:49 +0000 (05:46 +0000)]
Stop linking with WebKitSystemInterface
https://bugs.webkit.org/show_bug.cgi?id=177915

Reviewed by Antti Koivisto.

Source/WebKit:

* Configurations/DebugRelease.xcconfig:
* WebKit.xcodeproj/project.pbxproj:

Source/WebKitLegacy:

* WebKitLegacy.xcodeproj/project.pbxproj:

Source/WebKitLegacy/mac:

* Configurations/DebugRelease.xcconfig:
* Configurations/WebKitLegacy.xcconfig:

Tools:

* DumpRenderTree/mac/Configurations/Base.xcconfig:
* DumpRenderTree/mac/Configurations/DebugRelease.xcconfig:
* DumpRenderTree/mac/Configurations/DumpRenderTree.xcconfig:
* DumpRenderTree/mac/Configurations/DumpRenderTreeApp.xcconfig:
* WebKitTestRunner/Configurations/Base.xcconfig:
* WebKitTestRunner/Configurations/DebugRelease.xcconfig:
* WebKitTestRunner/Configurations/InjectedBundle.xcconfig:
* WebKitTestRunner/Configurations/WebKitTestRunner.xcconfig:
* WebKitTestRunner/Configurations/WebKitTestRunnerApp.xcconfig:

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

2 years agoRemove unnecessary includes of WebKitSystemInterface on Cocoa platforms
achristensen@apple.com [Thu, 5 Oct 2017 04:30:40 +0000 (04:30 +0000)]
Remove unnecessary includes of WebKitSystemInterface on Cocoa platforms
https://bugs.webkit.org/show_bug.cgi?id=177912

Reviewed by Saam Barati.

Source/WebCore:

* WebCore.xcodeproj/project.pbxproj:
Also stop compiling RenderMediaControls.cpp on Cocoa platforms.  It's not used.

Source/WebKit:

* NetworkProcess/cocoa/NetworkProcessCocoa.mm:
* NetworkProcess/mac/NetworkProcessMac.mm:
* NetworkProcess/mac/RemoteNetworkingContext.mm:
* Platform/IPC/mac/ConnectionMac.mm:
* Platform/mac/LayerHostingContext.mm:
* PluginProcess/mac/PluginProcessMac.mm:
* PluginProcess/mac/PluginProcessShim.mm:
* Shared/ios/ChildProcessIOS.mm:
* Shared/mac/ChildProcessMac.mm:
* Shared/mac/SandboxExtensionMac.mm:
* Shared/mac/WebCoreArgumentCodersMac.mm:
* Shared/mac/WebEventFactory.mm:
* StorageProcess/ios/StorageProcessIOS.mm:
* StorageProcess/mac/StorageProcessMac.mm:
* UIProcess/API/Cocoa/WKWebView.mm:
* UIProcess/Cocoa/PlaybackSessionManagerProxy.mm:
* UIProcess/Cocoa/VideoFullscreenManagerProxy.mm:
* UIProcess/Cocoa/WebProcessPoolCocoa.mm:
* UIProcess/Cocoa/WebViewImpl.mm:
* UIProcess/Plugins/mac/PluginProcessProxyMac.mm:
* UIProcess/RemoteLayerTree/RemoteLayerTreeHost.mm:
* UIProcess/RemoteLayerTree/ios/RemoteLayerTreeHostIOS.mm:
* UIProcess/mac/PageClientImplMac.mm:
* UIProcess/mac/WKTextInputWindowController.mm:
* UIProcess/mac/WebContextMenuProxyMac.mm:
* UIProcess/mac/WebPopupMenuProxyMac.mm:
* UIProcess/mac/WindowServerConnection.mm:
* WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm:
* WebProcess/Plugins/Netscape/mac/PluginProxyMac.mm:
* WebProcess/Plugins/PDF/PDFPlugin.mm:
* WebProcess/WebCoreSupport/mac/WebDragClientMac.mm:
* WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.mm:
* WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
* WebProcess/WebPage/ios/WebPageIOS.mm:
* WebProcess/WebPage/mac/WKAccessibilityWebPageObjectBase.mm:
* WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm:
* WebProcess/WebPage/mac/WebPageMac.mm:
* WebProcess/cocoa/WebProcessCocoa.mm:

Source/WebKitLegacy/ios:

* Misc/WebUIKitSupport.mm:
* WebCoreSupport/WebChromeClientIOS.mm:

Source/WebKitLegacy/mac:

* Carbon/CarbonUtils.m:
* Carbon/CarbonWindowAdapter.mm:
* Carbon/HIWebView.mm:
* DefaultDelegates/WebDefaultContextMenuDelegate.mm:
* Misc/WebNSFileManagerExtras.mm:
* Misc/WebNSPasteboardExtras.mm:
* Misc/WebNSURLExtras.mm:
* Plugins/Hosted/HostedNetscapePluginStream.mm:
* Plugins/Hosted/NetscapePluginHostManager.mm:
* Plugins/Hosted/NetscapePluginHostProxy.mm:
* Plugins/Hosted/NetscapePluginInstanceProxy.mm:
* Plugins/Hosted/WebHostedNetscapePluginView.h:
* Plugins/Hosted/WebTextInputWindowController.m:
* Plugins/WebBaseNetscapePluginView.mm:
* Plugins/WebNetscapePluginEventHandlerCarbon.mm:
* Plugins/WebNetscapePluginEventHandlerCocoa.mm:
* Plugins/WebNetscapePluginStream.mm:
* Plugins/WebNetscapePluginView.mm:
* Plugins/WebPluginDatabase.mm:
* WebCoreSupport/PopupMenuMac.mm:
* WebCoreSupport/WebChromeClient.mm:
* WebCoreSupport/WebFrameLoaderClient.mm:
* WebCoreSupport/WebInspectorClient.mm:
* WebCoreSupport/WebPlatformStrategies.mm:
* WebCoreSupport/WebSystemInterface.mm:
* WebView/WebDynamicScrollBarsView.mm:
* WebView/WebFrame.mm:
* WebView/WebFrameView.mm:
* WebView/WebFullScreenController.mm:
* WebView/WebHTMLView.mm:
* WebView/WebPreferences.mm:
* WebView/WebView.mm:

Tools:

* DumpRenderTree/mac/DumpRenderTree.mm:

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

2 years ago[JSC] Introduce import.meta
utatane.tea@gmail.com [Thu, 5 Oct 2017 03:57:38 +0000 (03:57 +0000)]
[JSC] Introduce import.meta
https://bugs.webkit.org/show_bug.cgi?id=177703

Reviewed by Filip Pizlo.

JSTests:

* modules/import-meta-syntax.js: Added.
(shouldThrow):
(shouldNotThrow):
* modules/import-meta.js: Added.
* modules/import-meta/cocoa.js: Added.
* modules/resources/assert.js:
(export.shouldNotThrow):
* stress/import-syntax.js:

Source/JavaScriptCore:

This patch adds stage 3 `import.meta`[1].
We add a new hook function moduleLoaderCreateImportMetaProperties, which creates
import meta properties object to this module. And we set this object as @meta
private variable in module environments. So module code can access this by accessing
@meta private variable.

[1]: https://github.com/tc39/proposal-import-meta

* builtins/BuiltinNames.h:
* builtins/ModuleLoaderPrototype.js:
* bytecompiler/BytecodeGenerator.cpp:
(JSC::BytecodeGenerator::BytecodeGenerator):
* jsc.cpp:
(GlobalObject::moduleLoaderCreateImportMetaProperties):
* parser/Parser.cpp:
(JSC::Parser<LexerType>::parseModuleSourceElements):
(JSC::Parser<LexerType>::parseMemberExpression):
* runtime/JSGlobalObject.cpp:
* runtime/JSGlobalObject.h:
* runtime/JSModuleLoader.cpp:
(JSC::JSModuleLoader::createImportMetaProperties):
* runtime/JSModuleLoader.h:
* runtime/JSModuleRecord.cpp:
(JSC::JSModuleRecord::link):
(JSC::JSModuleRecord::instantiateDeclarations):
* runtime/JSModuleRecord.h:
* runtime/ModuleLoaderPrototype.cpp:
(JSC::moduleLoaderPrototypeModuleDeclarationInstantiation):

Source/WebCore:

* bindings/js/JSDOMWindowBase.cpp:
* bindings/js/JSWorkerGlobalScopeBase.cpp:

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