WebKit-https.git
19 months ago[Extra zoom mode] Form control values are stale after dismissing and representing...
wenson_hsieh@apple.com [Sun, 18 Feb 2018 05:50:13 +0000 (05:50 +0000)]
[Extra zoom mode] Form control values are stale after dismissing and representing input view controllers
https://bugs.webkit.org/show_bug.cgi?id=182877
<rdar://problem/37604395>

Reviewed by Tim Horton.

Currently, when presenting an input view controller for a focused element, we populate the initial form control
value using the WKContentView's assisted node information when it was last focused. However, if the user edits
the value of a form control, dismisses to the form control view controller (while the element is still focused)
and then begins editing the field again, the initial text will be the previous value of the input, since the
AssistedNodeInformation isn't up to date.

To fix this, we introduce a mechanism to update WKContentView's AssistedNodeInformation for the current assisted
node. This overwrites _assistedNodeInformation with new information computed from the web process, as long as
the assisted node before and after the request is made in the UI process has not changed. We accomplish this by
adding an identifier to AssistedNodeInformation, which is monotonically incremented when an element is focused
in the web process. The UI process may then use this identifier to determine whether AssistedNodeInformations
are describing the same focused element.

One interesting consideration here is that a normal AssistedNodeInformation update (propagated when focusing an
element) may be deferred in the UI process until the next layer tree commit. In the absence of the assisted node
identifier check, one could imagine a scenario in which the assisted node information in the UI process gets
"updated" from a new value to an old value:

1. The web process focuses an element and sends AssistedNodeInformation `A`.
2. WKContentView calls -updateCurrentAssistedNodeInformation.
3. The web process sends AssistedNodeInformation `B`.
4. `A` is received in the UI process, but deferred.
5. The UI process receives `B` and sets _assistedNodeInformation to `B`.
6. The UI process calls -_startAssistingNode: and sets _assistedNodeInformation to `A`.

This would mean that the _assistedNodeInformation is set to an earlier value, `A`, after being set to a later
value, `B`. However, because the AssistedNodeInformation identifier in step (2) refers to the assisted node
prior to step (1), the assisted node identifier in (5) would not match this identifier, and we would simply bail
instead of overwriting assisted node information.

We use this AssistedNodeInformation update mechanism after inserting text via input view controllers, and also
after reentering edit mode from the focused form control view controller. This fixes two issues where changing
the size of the focused element after editing it results in the focused form overlay highlighting a stale frame,
and also when setting the initial text when reentering edit mode for a form control that is already focused.

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

Add a new monotonically increasing identifier (per WebPage) which associates a AssistedNodeInformation with a
focused element. In the event that the web process crashes and relaunches (thus resetting this identifier),
AssistedNodeInformation state in the UI process is now also reset (see -cleanupInteraction), so we won't end up
confusing AssistedNodeInformations computed by different WebPages between a web process crash.

* UIProcess/WebPageProxy.h:

A bit of related refactoring here to remove an unnecessary bool flag that indicates whether we have a deferred
assisted node information. Instead, just use the presence of m_deferredNodeAssistanceArguments.

* UIProcess/WebPageProxy.messages.in:

Add a AssistedNodeInformationCallback IPC message.

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

Clear out the previous AssistedNodeInformation. See above for details.

(-[WKContentView _startAssistingNode:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):
(-[WKContentView updateCurrentAssistedNodeInformation:]):

Tries to update AssistedNodeInformation for the current assisted node, invoking the completion callback when
finished. This may result in the assisted node information not being updated due to the current assisted node
changing in the time between the start of the request and the information being received in the UI process.

(-[WKContentView presentViewControllerForCurrentAssistedNode]):

Refactored from -presentViewControllerForAssistedNode:, such that it no longer takes an AssistedNodeInformation
as an argument, but rather just uses WKContentView's current _assistedNodeInformation. This was just being
called with _assistedNodeInformation from all call sites anyways.

(-[WKContentView textInputController:didCommitText:]):

Request an AssistedNodeInformation update after setting the value of a form control; if the assisted node hasn't
changed, update the focused form control overlay. This is needed to handle cases where the focused element's
frame may have changed after inserting text (e.g. due to line wrapping), and the focused form control overlay
needs to be updated to reflect this change.

(-[WKContentView focusedFormControlControllerDidBeginEditing:]):

Request an AssistedNodeInformation update before reentering edit mode; if the assisted node hasn't changed since
the start of the request, present the appropriate input view controller.

(-[WKContentView presentViewControllerForAssistedNode:]): Deleted.
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::assistedNodeInformationCallback):
(WebKit::WebPageProxy::requestAssistedNodeInformation):
(WebKit::WebPageProxy::didCommitLayerTree):
(WebKit::WebPageProxy::startAssistingNode):
(WebKit::WebPageProxy::stopAssistingNode):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::elementDidFocus):

Increment the assisted node identifier.

* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::requestAssistedNodeInformation):

Compute and return an AssistedNodeInformation.

(WebKit::WebPage::getAssistedNodeInformation):

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

19 months agoFix up ChangeLog entry for r228594 (https://bugs.webkit.org/show_bug.cgi?id=182900...
dbates@webkit.org [Sun, 18 Feb 2018 04:43:31 +0000 (04:43 +0000)]
Fix up ChangeLog entry for r228594 (https://bugs.webkit.org/show_bug.cgi?id=182900). Update bug title
and description to explain that this change was removing the code to parse the UTF-32{BE, LE} BOM and
encoding/decoding logic that is no longer needed following the removal of UTF-32{BE, LE} from the text
codec registry in r224747 (https://bugs.webkit.org/show_bug.cgi?id=179435).

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

19 months agoWeb Inspector: get rid of remaining uses of OptOutput<T>
darin@apple.com [Sat, 17 Feb 2018 19:10:15 +0000 (19:10 +0000)]
Web Inspector: get rid of remaining uses of OptOutput<T>
https://bugs.webkit.org/show_bug.cgi?id=180607

Reviewed by Brian Burg.

Source/JavaScriptCore:

* inspector/AsyncStackTrace.cpp: Removed explicit Inspector prefix from code that
is inside the Inspector namespace already. Also use auto a bit.
* inspector/AsyncStackTrace.h: Ditto.
* inspector/ConsoleMessage.cpp: Ditto.

* inspector/ContentSearchUtilities.cpp: More Inspector namespace removal and ...
(Inspector::ContentSearchUtilities::getRegularExpressionMatchesByLines): Use a
Vector instead of a unique_ptr<Vector>.
(Inspector::ContentSearchUtilities::lineEndings): Ditto.
(Inspector::ContentSearchUtilities::stylesheetCommentPattern): Deleted.
(Inspector::ContentSearchUtilities::findMagicComment): Use std::array instead of
a Vector for a fixed size array; also got rid of reinterpret_cast.
(Inspector::ContentSearchUtilities::findStylesheetSourceMapURL): Moved the regular
expression here since it's the only place it was used.

* inspector/ContentSearchUtilities.h: Cut down on unneeded includes.

* inspector/InjectedScript.cpp: Removed explicit Inspector prefix from code that
is inside the Inspector namespace already. Also use auto a bit.

* inspector/InspectorProtocolTypes.h: Removed OptOutput. Simplified assertions.
Removed base template for BindingTraits; we only need the specializations.

* inspector/ScriptCallFrame.cpp: Removed explicit Inspector prefix from code that
is inside the Inspector namespace already. Also use auto a bit.
* inspector/ScriptCallFrame.h: Ditto.
* inspector/ScriptCallStack.cpp: Ditto.
* inspector/ScriptCallStack.h: Ditto.
* inspector/agents/InspectorConsoleAgent.cpp: Ditto.
* inspector/agents/InspectorConsoleAgent.h: Ditto.

* inspector/agents/InspectorDebuggerAgent.cpp: More Inspector namespace removal and ...
(Inspector::InspectorDebuggerAgent::evaluateOnCallFrame): Use std::optional& intead of
OptOutput* for out arguments.
* inspector/agents/InspectorDebuggerAgent.h: Ditto.

* inspector/agents/InspectorHeapAgent.cpp: More Inspector namespace removal and ...
(Inspector::InspectorHeapAgent::getPreview): Use std::optional& intead of OptOutput*
for out arguments.
* inspector/agents/InspectorHeapAgent.h: Ditto.

* inspector/agents/InspectorRuntimeAgent.cpp: More Inspector namespace removal and ...
(Inspector::InspectorRuntimeAgent::parse): Use std::optional& intead of OptOutput*
for out arguments.
(Inspector::InspectorRuntimeAgent::evaluate): Ditto.
(Inspector::InspectorRuntimeAgent::callFunctionOn): Ditto.
(Inspector::InspectorRuntimeAgent::saveResult): Ditto.
* inspector/agents/InspectorRuntimeAgent.h: Ditto.

* inspector/agents/InspectorScriptProfilerAgent.cpp: More Inspector namespace removal
and removed some bogus const.
* inspector/agents/InspectorScriptProfilerAgent.h: Ditto.

* inspector/scripts/codegen/cpp_generator.py:
(CppGenerator.cpp_type_for_unchecked_formal_in_parameter): Removed some bogus const.
(CppGenerator.cpp_type_for_type_with_name): Ditto.
(CppGenerator.cpp_type_for_formal_out_parameter): Use std::optional& instead of
Inspector::Protocol::OptOutput*.
(CppGenerator.cpp_type_for_formal_async_parameter): Ditto.
(CppGenerator.cpp_type_for_stack_in_parameter): Ditto.
(CppGenerator.cpp_type_for_stack_out_parameter): Ditto.

* inspector/scripts/codegen/cpp_generator_templates.py: Removed ASSERT_DISABLED
conditional around assertion code which will now compile to nothing if ASSERT is disabled.
Build strings more simply in a few cases.

* inspector/scripts/codegen/generate_cpp_backend_dispatcher_implementation.py:
(CppBackendDispatcherImplementationGenerator._generate_async_dispatcher_class_for_domain):
Use has_value instead of isAssigned and * operator instead of getValue() since std::optional
replace OptOutput here.
(CppBackendDispatcherImplementationGenerator._generate_dispatcher_implementation_for_command):
Pass by reference instead of pointer now.

* inspector/scripts/codegen/generate_cpp_protocol_types_header.py:
Removed ASSERT_DISABLED conditional around assertion code which will now compile to nothing
if ASSERT is disabled.

* inspector/scripts/codegen/generate_cpp_protocol_types_implementation.py:
(CppProtocolTypesImplementationGenerator._generate_assertion_for_object_declaration): Generate
the assertion function unconditionally, but leave out the assertions if ASSERT_DISABLED is true.
(CppProtocolTypesImplementationGenerator): Use auto instead of writing out JSON::Object::iterator.

* inspector/scripts/codegen/generate_objc_backend_dispatcher_implementation.py:
(ObjCBackendDispatcherImplementationGenerator._generate_conversions_for_command): Build strings
more simply.

* inspector/scripts/tests/generic/expected/commands-with-async-attribute.json-result:
* inspector/scripts/tests/generic/expected/commands-with-optional-call-return-parameters.json-result:
* inspector/scripts/tests/generic/expected/events-with-optional-parameters.json-result:
* inspector/scripts/tests/generic/expected/type-requiring-runtime-casts.json-result:
Rebaselined.

Source/WebCore:

* inspector/InspectorStyleSheet.cpp:
(WebCore::buildSourceRangeObject): Take a const Vector& instead of a Vector*.
(WebCore::InspectorStyle::buildObjectForStyle const): Pass lineEndings() instead
of lineEndings().get().
(WebCore::InspectorStyle::styleWithProperties const): Ditto.
(WebCore::InspectorStyleSheet::buildObjectForSelectorList): Ditto.
(WebCore::InspectorStyleSheet::lineEndings const): Return a Vector instead of
a std::unique_ptr<Vector>.
(WebCore::InspectorStyleSheetForInlineStyle::lineEndings const): Ditto.
* inspector/InspectorStyleSheet.h: Updated for the above.

* inspector/agents/InspectorCSSAgent.h: Removed some bogus const.
* inspector/agents/InspectorCanvasAgent.cpp: Ditto.
* inspector/agents/InspectorCanvasAgent.h: Ditto.

* inspector/agents/InspectorDOMDebuggerAgent.cpp: Improved type of global strings
so we don't waste space with a pointer to the string.
(WebCore::InspectorDOMDebuggerAgent::setEventListenerBreakpoint): Removed
explicit creation of String, which was wasteful and unnecessary.
(WebCore::InspectorDOMDebuggerAgent::setInstrumentationBreakpoint): Ditto.
(WebCore::InspectorDOMDebuggerAgent::removeEventListenerBreakpoint): Ditto.
(WebCore::InspectorDOMDebuggerAgent::removeInstrumentationBreakpoint): Ditto.
(WebCore::InspectorDOMDebuggerAgent::setXHRBreakpoint): Removed bogus const.

* inspector/agents/InspectorDOMDebuggerAgent.h: Removed bogus const and use
final instead of override.
* inspector/agents/InspectorPageAgent.cpp: Ditto.
* inspector/agents/InspectorPageAgent.h: Ditto.

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

19 months ago[RenderTreeBuilder] Cleanup RenderTreeBuilder
zalan@apple.com [Sat, 17 Feb 2018 06:01:58 +0000 (06:01 +0000)]
[RenderTreeBuilder] Cleanup RenderTreeBuilder
https://bugs.webkit.org/show_bug.cgi?id=182899
<rdar://problem/37627888>

Reviewed by Antti Koivisto.

No change in functionality.

* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::styleDidChange):
* rendering/updating/RenderTreeBuilder.cpp:
(WebCore::RenderTreeBuilder::takeChild):
(WebCore::RenderTreeBuilder::moveChildTo):
(WebCore::RenderTreeBuilder::moveAllChildrenTo):
(WebCore::RenderTreeBuilder::moveChildrenTo):
(WebCore::RenderTreeBuilder::moveAllChildrenIncludingFloatsTo):
(WebCore::RenderTreeBuilder::makeChildrenNonInline):
(WebCore::RenderTreeBuilder::splitAnonymousBoxesAroundChild):
(WebCore::RenderTreeBuilder::takeChildFromRenderMenuList): Deleted.
(WebCore::RenderTreeBuilder::takeChildFromRenderButton): Deleted.
* rendering/updating/RenderTreeBuilder.h:
(WebCore::RenderTreeBuilder::current):
* rendering/updating/RenderTreeBuilderBlock.cpp:
(WebCore::RenderTreeBuilder::Block::dropAnonymousBoxChild):
* rendering/updating/RenderTreeBuilderBlockFlow.cpp:
(WebCore::RenderTreeBuilder::BlockFlow::moveAllChildrenIncludingFloatsTo):
* rendering/updating/RenderTreeBuilderFormControls.cpp:
(WebCore::RenderTreeBuilder::FormControls::takeChild):
* rendering/updating/RenderTreeBuilderFormControls.h:
* rendering/updating/RenderTreeBuilderMultiColumn.cpp:
(WebCore::RenderTreeBuilder::MultiColumn::createFragmentedFlow):
(WebCore::RenderTreeBuilder::MultiColumn::destroyFragmentedFlow):
* rendering/updating/RenderTreeBuilderRuby.cpp:
(WebCore::RenderTreeBuilder::Ruby::moveInlineChildren):
(WebCore::RenderTreeBuilder::Ruby::moveBlockChildren):
(WebCore::RenderTreeBuilder::Ruby::takeChild):
* rendering/updating/RenderTreeBuilderTable.cpp:
(WebCore::RenderTreeBuilder::Table::collapseAndDestroyAnonymousSiblingRows):

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

19 months agoRemove dead code for UTF-32
commit-queue@webkit.org [Sat, 17 Feb 2018 05:49:59 +0000 (05:49 +0000)]
Remove dead code for UTF-32
https://bugs.webkit.org/show_bug.cgi?id=182900
<rdar://problem/37238717>

Patch by Daniel Bates <dabates@apple.com> on 2018-02-16
Reviewed by Alexey Proskuryakov.

LayoutTests/imported/w3c:

Update expected results now that all sub-tests pass.

* web-platform-tests/encoding/unsupported-encodings-expected.txt:
* web-platform-tests/encoding/utf-32-expected.txt:

Source/WebCore:

The UTF-32 encodings were removed from the text codec registry in r224747. So,
we no longer need code to encode or decode these variants.

* dom/TextDecoder.cpp:
(WebCore::codeUnitByteSize):
* loader/TextResourceDecoder.cpp:
(WebCore::TextResourceDecoder::checkForBOM):
(WebCore::TextResourceDecoder::checkForHeadCharset):
* platform/text/TextEncoding.cpp:
(WebCore::TextEncoding::isNonByteBasedEncoding const):
(WebCore::UTF32BigEndianEncoding): Deleted.
(WebCore::UTF32LittleEndianEncoding): Deleted.
* platform/text/TextEncoding.h:

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

19 months ago[RenderTreeBuilder] Move RenderBoxModelObject::moveChild*() to RenderTreeBuilder
zalan@apple.com [Sat, 17 Feb 2018 02:20:24 +0000 (02:20 +0000)]
[RenderTreeBuilder] Move RenderBoxModelObject::moveChild*() to RenderTreeBuilder
https://bugs.webkit.org/show_bug.cgi?id=182896
<rdar://problem/37623051>

Reviewed by Antti Koivisto.

No change in functionality.

* rendering/RenderBlock.h:
(WebCore::RenderBlock::moveAllChildrenIncludingFloatsTo): Deleted.
* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::styleDidChange):
(WebCore::RenderBlockFlow::moveAllChildrenIncludingFloatsTo): Deleted.
* rendering/RenderBlockFlow.h:
* rendering/RenderBoxModelObject.cpp:
(WebCore::RenderBoxModelObject::moveChildTo): Deleted.
(WebCore::RenderBoxModelObject::moveChildrenTo): Deleted.
(WebCore::RenderBoxModelObject::moveAllChildrenToInternal): Deleted.
* rendering/RenderBoxModelObject.h:
(WebCore::RenderBoxModelObject::moveChildTo): Deleted.
(WebCore::RenderBoxModelObject::moveAllChildrenTo): Deleted.
(WebCore::RenderBoxModelObject::moveChildrenTo): Deleted.
* rendering/updating/RenderTreeBuilder.cpp:
(WebCore::RenderTreeBuilder::moveChildTo):
(WebCore::RenderTreeBuilder::moveAllChildrenTo):
(WebCore::RenderTreeBuilder::moveChildrenTo):
(WebCore::RenderTreeBuilder::moveAllChildrenIncludingFloatsTo):
(WebCore::RenderTreeBuilder::makeChildrenNonInline):
(WebCore::RenderTreeBuilder::splitAnonymousBoxesAroundChild):
* rendering/updating/RenderTreeBuilder.h:
* rendering/updating/RenderTreeBuilderBlock.cpp:
(WebCore::moveAllChildrenToInternal):
(WebCore::RenderTreeBuilder::Block::removeLeftoverAnonymousBlock):
(WebCore::RenderTreeBuilder::Block::takeChild):
(WebCore::RenderTreeBuilder::Block::dropAnonymousBoxChild):
* rendering/updating/RenderTreeBuilderBlockFlow.cpp:
(WebCore::RenderTreeBuilder::BlockFlow::moveAllChildrenIncludingFloatsTo):
* rendering/updating/RenderTreeBuilderBlockFlow.h:
* rendering/updating/RenderTreeBuilderMultiColumn.cpp:
(WebCore::RenderTreeBuilder::MultiColumn::createFragmentedFlow):
(WebCore::RenderTreeBuilder::MultiColumn::destroyFragmentedFlow):
* rendering/updating/RenderTreeBuilderRuby.cpp:
(WebCore::RenderTreeBuilder::Ruby::moveInlineChildren):
(WebCore::RenderTreeBuilder::Ruby::moveBlockChildren):
(WebCore::RenderTreeBuilder::Ruby::takeChild):
* rendering/updating/RenderTreeBuilderTable.cpp:
(WebCore::RenderTreeBuilder::Table::collapseAndDestroyAnonymousSiblingRows):

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

19 months ago[Cocoa] Stop using non-prefixed vDSP functions in 32-bit builds
aestes@apple.com [Sat, 17 Feb 2018 02:13:59 +0000 (02:13 +0000)]
[Cocoa] Stop using non-prefixed vDSP functions in 32-bit builds
https://bugs.webkit.org/show_bug.cgi?id=182898
<rdar://problem/37195079>

Reviewed by Tim Horton.

There's no need to use non-prefixed vDSP function aliases on 32-bit builds.
The vDSP-prefixed versions are available on all Cocoa platforms we currently support.

* platform/audio/DirectConvolver.cpp:
(WebCore::DirectConvolver::process):
* platform/audio/VectorMath.cpp:
(WebCore::VectorMath::vsmul):
(WebCore::VectorMath::vadd):
(WebCore::VectorMath::vmul):
(WebCore::VectorMath::zvmul):

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

19 months agoUnreviewed, rolling out r228575.
ryanhaddad@apple.com [Sat, 17 Feb 2018 01:43:32 +0000 (01:43 +0000)]
Unreviewed, rolling out r228575.

Introduced LayoutTest crashes under GuardMalloc.

Reverted changeset:

"Use ResourceLoader to load appcache manifest"
https://bugs.webkit.org/show_bug.cgi?id=182861
https://trac.webkit.org/changeset/228575

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

19 months agoUse OPENGL macros to be more clear about which OpenGL/ES WebGL uses on Cocoa
dino@apple.com [Sat, 17 Feb 2018 00:48:36 +0000 (00:48 +0000)]
Use OPENGL macros to be more clear about which OpenGL/ES WebGL uses on Cocoa
https://bugs.webkit.org/show_bug.cgi?id=182894

Reviewed by Tim Horton.

.:

Rename OPENGL_ES_2 to OPENGL_ES.

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

PerformanceTests:

Rename OPENGL_ES_2 to OPENGL_ES.

* StitchMarker/wtf/Platform.h:

Source/WebCore:

Adjust the places where we check for PLATFORM(MAC) or
PLATFORM(IOS) related to WebGL, and instead rely
on USE(OPENGL) USE(OPENGL_ES).

* CMakeLists.txt:
* PlatformGTK.cmake:
* platform/graphics/GLContext.cpp:
(WebCore::initializeOpenGLShimsIfNeeded):
* platform/graphics/GraphicsContext3DPrivate.cpp:
* platform/graphics/OpenGLESShims.h:
* platform/graphics/cairo/ImageBufferCairo.cpp:
* platform/graphics/egl/GLContextEGL.cpp:
(WebCore::GLContextEGL::getEGLConfig):
(WebCore::GLContextEGL::createContext):
(WebCore::GLContextEGL::createSharingContext):
* platform/graphics/egl/GLContextEGLWPE.cpp:
(WebCore::GLContextEGL::createWPEContext):
* platform/graphics/egl/GLContextEGLWayland.cpp:
(WebCore::GLContextEGL::createWaylandContext):
* platform/graphics/egl/GLContextEGLX11.cpp:
(WebCore::GLContextEGL::createPixmapContext):
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
(WebCore::MediaPlayerPrivateGStreamerBase::ensureGstGLContext):
* platform/graphics/gstreamer/VideoTextureCopierGStreamer.cpp:
(WebCore::VideoTextureCopierGStreamer::VideoTextureCopierGStreamer):
(WebCore::VideoTextureCopierGStreamer::~VideoTextureCopierGStreamer):
(WebCore::VideoTextureCopierGStreamer::copyVideoTextureToPlatformTexture):
* platform/graphics/gstreamer/VideoTextureCopierGStreamer.h:
* platform/graphics/opengl/Extensions3DOpenGLES.cpp:
* platform/graphics/opengl/Extensions3DOpenGLES.h:
* platform/graphics/opengl/GraphicsContext3DOpenGLES.cpp:
(WebCore::GraphicsContext3D::create):
(WebCore::GraphicsContext3D::GraphicsContext3D):
(WebCore::GraphicsContext3D::isGLES2Compliant const):
* platform/graphics/texmap/GraphicsContext3DTextureMapper.cpp:
(WebCore::GraphicsContext3D::create):
(WebCore::GraphicsContext3D::GraphicsContext3D):
(WebCore::GraphicsContext3D::~GraphicsContext3D):
(WebCore::GraphicsContext3D::isGLES2Compliant const):
(WebCore::GraphicsContext3D::getExtensions):
* platform/graphics/texmap/TextureMapperContextAttributes.cpp:
(WebCore::TextureMapperContextAttributes::initialize):
* platform/graphics/texmap/TextureMapperGL.cpp:
(WebCore::TextureMapperGLData::~TextureMapperGLData):
(WebCore::TextureMapperGLData::getVAO):
(WebCore::TextureMapperGL::beginPainting):
(WebCore::TextureMapperGL::endPainting):
* platform/graphics/texmap/TextureMapperGLHeaders.h:
* platform/graphics/texmap/TextureMapperShaderProgram.cpp:
(WebCore::TextureMapperShaderProgram::create):

Source/WebKit:

Rename OPENGL_ES_2 to OPENGL_ES.

* CMakeLists.txt:
* Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
* UIProcess/gtk/AcceleratedBackingStoreWayland.cpp:
(WebKit::AcceleratedBackingStoreWayland::paint):
* UIProcess/gtk/WaylandCompositor.cpp:
(WebKit::WaylandCompositor::initializeEGL):

Source/WebKitLegacy/win:

Rename OPENGL_ES_2 to OPENGL_ES.

* WebCoreSupport/AcceleratedCompositingContext.cpp:

Source/WTF:

If we're on a Cocoa platform, define USE_OPENGL/USE_OPENGL_ES
depending on what we're actually going to use. In this case,
they are exclusive, but it doesn't appear that other platforms
use this approach. Ultimately the idea is to be more concerned
with the type of OpenGL we're using, rather than the platform.

* wtf/Platform.h: Define USE_OPENGL(_ES) for PLATFORM(COCOA).

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

19 months agoAdd an entitlement check for service worker on iOS
rniwa@webkit.org [Sat, 17 Feb 2018 00:46:52 +0000 (00:46 +0000)]
Add an entitlement check for service worker on iOS
https://bugs.webkit.org/show_bug.cgi?id=182865
<rdar://problem/37505903>

Reviewed by Brady Eidson.

Source/WebKit:

Added an entitlement check to enable service workers on iOS.

* Shared/mac/SandboxUtilities.h:
* Shared/mac/SandboxUtilities.mm:
(WebKit::connectedProcessHasEntitlement): Added.
* StorageProcess/StorageProcess.cpp:
(WebKit::StorageProcess::createStorageToWebProcessConnection): Enforce the entitlement check by crashing
when this code is executed without the parent process having the service worker entitlement. This should
never happen unless someone is trying to bypass the entitlement check in UI Process since we ordinarily
disable service worker gracefully in WKWebView _initializeWithConfiguration.
(WebKit::StorageProcess::swServerForSession): Ditto.
(WebKit::StorageProcess::registerSWServerConnection): Ditto.
* StorageProcess/StorageProcess.h:
(WebKit::StorageProcess::parentProcessHasServiceWorkerEntitlement const): Added.
* StorageProcess/ios/StorageProcessIOS.mm:
(WebKit::StorageProcess::parentProcessHasServiceWorkerEntitlement const): Added.
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _initializeWithConfiguration:]): Disable the service workers when the entitlement is
missing from the current process. The entitlement is enforced by WebContent and Storage process.
This check avoids crashing WebContent process and gracefully disabling the feature.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::updatePreferences): Enforce the entitlement check.
* WebProcess/WebPage/WebPage.h:
(WebKit::WebPage::parentProcessHasServiceWorkerEntitlement const): Added.
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::parentProcessHasServiceWorkerEntitlement const): Added.

Tools:

Added the service worker entitlements to WebKitTestRunner and TestWebKitAPI on iOS.

* TestWebKitAPI/Configurations/TestWebKitAPI-iOS.entitlements:
* WebKitTestRunner/Configurations/WebKitTestRunnerApp-iOS.entitlements:
* WebKitTestRunner/Configurations/WebKitTestRunnerApp.xcconfig:
* WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj:

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

19 months ago[RenderTreeBuilder] Move RenderElement::insertChildInternal() to RenderTreeBuilder
zalan@apple.com [Sat, 17 Feb 2018 00:05:35 +0000 (00:05 +0000)]
[RenderTreeBuilder] Move RenderElement::insertChildInternal() to RenderTreeBuilder
https://bugs.webkit.org/show_bug.cgi?id=182885
<rdar://problem/37617371>

Reviewed by Antti Koivisto.

No change in functionality.

* rendering/RenderElement.cpp:
(WebCore::RenderElement::insertChildInternal): Deleted.
* rendering/RenderObject.h:
* rendering/updating/RenderTreeBuilder.cpp:
(WebCore::RenderTreeBuilder::insertChildToRenderElement):

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

19 months agoAllow specifying which plug-ins are supported
commit-queue@webkit.org [Fri, 16 Feb 2018 23:31:31 +0000 (23:31 +0000)]
Allow specifying which plug-ins are supported
https://bugs.webkit.org/show_bug.cgi?id=182748

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

Source/WebCore:

Tests: http/tests/plugins/nounsupported-plugin.html
       http/tests/plugins/supported-plugin-all-origin-visibility.html
       http/tests/plugins/supported-plugin-on-specific-origin.html
       http/tests/plugins/supported-plugin-origin-specific-visibility.html
       http/tests/plugins/unsupported-plugin-on-specific-origin.html
       plugins/unsupported-plugin.html

Added support for computing plugin web visibility with the added knowledge of supported plugins.
In case of a plugin failing to be created due to being unsupported, update the UI
to use mark the plugin as "Unexpected plug in".

Added internal API to retrieve the plug-in error description message.

* English.lproj/Localizable.strings:
* WebCore.xcodeproj/project.pbxproj:
* html/HTMLPlugInElement.cpp:
(WebCore::HTMLPlugInElement::setReplacement):
* html/HTMLPlugInElement.h:
* loader/EmptyClients.cpp:
* platform/LocalizedStrings.cpp:
(WebCore::unsupportedPluginText):
* platform/LocalizedStrings.h:
* plugins/PluginData.cpp:
(WebCore::PluginData::initPlugins):
* plugins/PluginData.h:
(WebCore::decodePluginNames):
(WebCore::encodePluginNames):
(WebCore::SupportedPluginNames::decode):
(WebCore::SupportedPluginNames::encode const):
* plugins/PluginInfoProvider.h:
* rendering/RenderEmbeddedObject.cpp:
(WebCore::unavailablePluginReplacementText):
* rendering/RenderEmbeddedObject.h:
(WebCore::RenderEmbeddedObject::pluginReplacementTextIfUnavailable const):
* testing/Internals.cpp:
(WebCore::Internals::unavailablePluginReplacementText):
* testing/Internals.h:
* testing/Internals.idl:

Source/WebKit:

Add a C and ObjC API to set which plug-ins are specified.
Plug-ins may be allowed by origin of the main page or for all origins.

If the API to set a supported plug-in is called, WebKit enters a mode
where it will block any plug-in that is not on the list.

The list of supported plug-ins is stored in UIProcess and sent to WebProcess.
This allows to compute the list of visible plug-ins according supported plugins.

PluginInfoStore is storing the list of supported plugins and can
answer whether a plug-in creation request is to be made unsupported or not.
It also creates the structure sent to WebProcess for computing plugin visibility.

Updated ArgumentCoders to accept modern HashSet decoders.

* Platform/IPC/ArgumentCoders.h:
* UIProcess/API/C/WKContext.cpp:
(WKContextAddSupportedPlugin):
(WKContextClearSupportedPlugins):
* UIProcess/API/C/WKContextPrivate.h:
* UIProcess/API/Cocoa/WKProcessPool.mm:
(-[WKProcessPool _addSupportedPlugin:named:withMimeTypes:withExtensions:]):
* UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
* UIProcess/Plugins/PluginInfoStore.cpp:
(WebKit::PluginInfoStore::isSupportedPlugin):
(WebKit::PluginInfoStore::SupportedPlugins::isSupported):
(WebKit::PluginInfoStore::SupportedPlugin::isSupported):
(WebKit::PluginInfoStore::supportedPluginNames):
(WebKit::PluginInfoStore::addSupportedPlugin):
* UIProcess/Plugins/PluginInfoStore.h:
(WebKit::PluginInfoStore::clearSupportedPlugins):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::findPlugin):
(WebKit::WebPageProxy::unavailablePluginButtonClicked):
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::addSupportedPlugin):
(WebKit::WebProcessPool::clearSupportedPlugins):
* UIProcess/WebProcessPool.h:
* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::getPlugins):
* UIProcess/WebProcessProxy.h:
* UIProcess/WebProcessProxy.messages.in:
* WebProcess/Plugins/WebPluginInfoProvider.cpp:
(WebKit::WebPluginInfoProvider::getPluginInfo):
(WebKit::WebPluginInfoProvider::getWebVisiblePluginInfo):
(WebKit::WebPluginInfoProvider::populatePluginCache):
* WebProcess/Plugins/WebPluginInfoProvider.h:
* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::shouldUnavailablePluginMessageBeButton const):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::createPlugin):
(WebKit::WebPage::canPluginHandleResponse):

Source/WebKitLegacy/mac:

* WebCoreSupport/WebPluginInfoProvider.h:
* WebCoreSupport/WebPluginInfoProvider.mm:
(WebPluginInfoProvider::getPluginInfo):
(WebPluginInfoProvider::getWebVisiblePluginInfo):

Source/WebKitLegacy/win:

* WebCoreSupport/WebPluginInfoProvider.cpp:
(WebPluginInfoProvider::getPluginInfo):
* WebCoreSupport/WebPluginInfoProvider.h:

Tools:

Add support for a test runner API to specificy supported plug-ins.

* WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl:
* WebKitTestRunner/InjectedBundle/TestRunner.cpp:
(WTR::TestRunner::setPluginsAsUnsupported):
* WebKitTestRunner/InjectedBundle/TestRunner.h:
* WebKitTestRunner/TestController.cpp:
(WTR::TestController::resetStateToConsistentValues):
(WTR::TestController::setPluginsAsUnsupported):
* WebKitTestRunner/TestController.h:
* WebKitTestRunner/TestInvocation.cpp:
(WTR::TestInvocation::didReceiveMessageFromInjectedBundle):

LayoutTests:

* http/tests/plugins/nounsupported-plugin-expected.txt: Added.
* http/tests/plugins/nounsupported-plugin.html: Added.
* http/tests/plugins/supported-plugin-all-origin-visibility-expected.txt: Added.
* http/tests/plugins/supported-plugin-all-origin-visibility.html: Added.
* http/tests/plugins/supported-plugin-on-specific-origin-expected.txt: Added.
* http/tests/plugins/supported-plugin-on-specific-origin.html: Added.
* http/tests/plugins/supported-plugin-origin-specific-visibility-expected.txt: Added.
* http/tests/plugins/supported-plugin-origin-specific-visibility.html: Added.
* http/tests/plugins/unsupported-plugin-on-specific-origin-expected.txt: Added.
* http/tests/plugins/unsupported-plugin-on-specific-origin.html: Added.
* plugins/unsupported-plugin-expected.txt: Added.
* plugins/unsupported-plugin.html: Added.
* platform/ios-wk1/TestExpectations:
* platform/mac-wk1/TestExpectations:

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

19 months agohttp/tests/security/http-0.9/xhr-blocked.html is flaky
cdumez@apple.com [Fri, 16 Feb 2018 23:18:00 +0000 (23:18 +0000)]
http/tests/security/http-0.9/xhr-blocked.html is flaky
https://bugs.webkit.org/show_bug.cgi?id=182857
<rdar://problem/37616958>

Reviewed by Antti Koivisto.

WebCoreResourceHandleAsOperationQueueDelegate does not own the messageQueue and
the detachHandle function was failing to nullout m_messageQueue when the resourceHandle
gets destroyed. This means that callFunctionOnMainThread would sometimes try to append
to a dead messageQueue.

No new tests, already covered by:
http/tests/security/http-0.9/xhr-blocked.html is flaky

* platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm:
(-[WebCoreResourceHandleAsOperationQueueDelegate detachHandle]):

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

19 months agoAssert in mixed blend animation
antti@apple.com [Fri, 16 Feb 2018 23:15:08 +0000 (23:15 +0000)]
Assert in mixed blend animation
https://bugs.webkit.org/show_bug.cgi?id=182887
<rdar://problem/37598140>

Reviewed by Zalan Bujtas.

Test: fast/css/calc-mixed-blend-crash.html

* platform/CalculationValue.cpp:
(WebCore::CalcExpressionBlendLength::CalcExpressionBlendLength):

Fix mismatch between the type test and the value used.

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

19 months agoApply Bugzilla patches for CVE-2018-5123
commit-queue@webkit.org [Fri, 16 Feb 2018 23:12:13 +0000 (23:12 +0000)]
Apply Bugzilla patches for CVE-2018-5123
https://bugs.webkit.org/show_bug.cgi?id=182884

Patch by Ling Ho <lingho@apple.com> on 2018-02-16
Reviewed by Alexey Proskuryakov.

* Bugzilla/CGI.pm:
(_prevent_unsafe_response):
(header):
* attachment.cgi:

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

19 months agoUnreviewed, rolling out r228318.
jlewis3@apple.com [Fri, 16 Feb 2018 22:06:33 +0000 (22:06 +0000)]
Unreviewed, rolling out r228318.

The patch that this attempted to fix was rolled out already.

Reverted changeset:

"Fix build on ARMv7 traditional JSCOnly bot after r228306"
https://bugs.webkit.org/show_bug.cgi?id=182563
https://trac.webkit.org/changeset/228318

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

19 months agoWeb Inspector: TabBar redesign: remove top-level search field and pin the Search tab
mattbaker@apple.com [Fri, 16 Feb 2018 22:06:01 +0000 (22:06 +0000)]
Web Inspector: TabBar redesign: remove top-level search field and pin the Search tab
https://bugs.webkit.org/show_bug.cgi?id=182353
<rdar://problem/37088644>

Reviewed by Devin Rousso.

* Localizations/en.lproj/localizedStrings.js:

* UserInterface/Base/Main.js:
(WI.contentLoaded):
Create Search UI based on experimental setting. When the new TabBar is
enabled, the Search tab is a pinned tab. Since it is also saveable, it
needs to be added to the TabBrowser (the browser adds the item to the bar).

When restoring saved tabs, make an additional check to prevent a tab
from being added twice. This can occur now that the Search tab is pinned.

* UserInterface/Images/Search.svg:
Update art to better match Safari/macOS. Slightly increase the radius of
the lens, and shorten the length of the handle.

* UserInterface/Views/GoToLineDialog.css:
(.go-to-line-dialog > div::before):
Update styles for new Search icon.

* UserInterface/Views/LegacyTabBar.js:
(WI.LegacyTabBar.prototype.get saveableTabCount):
Backported new TabBar method which is called by TabBrowser.

* UserInterface/Views/OpenResourceDialog.css:
(.open-resource-dialog > .field::before):
Update styles for new Search icon.

* UserInterface/Views/PinnedTabBarItem.js:
(WI.PinnedTabBarItem.prototype.fromTabInfo):
Match GeneralTabBarItem.fromTabInfo.

* UserInterface/Views/SearchTabContentView.js:
(WI.SearchTabContentView):
(WI.SearchTabContentView.tabInfo):
New image (magnifying glass without border) when new TabBar is enabled.

* UserInterface/Views/SettingsTabContentView.js:
(WI.SettingsTabContentView):

* UserInterface/Views/TabBar.js:
(WI.TabBar):
Move creation of the Settings item out of TabBar. The TabBar should
only be concerned with managing tabs.

(WI.TabBar.prototype.get saveableTabCount):
(WI.TabBar.prototype._handleContextMenu):
(WI.TabBar.prototype.get normalNonEphemeralTabCount): Deleted.
Now that the Search tab is pinned, there aren't any normal tabs that
are also ephemeral. For the LegacyTabBar, both the Search and New Tab
tabs are still in this category.

* UserInterface/Views/TabBrowser.js:
(WI.TabBrowser.prototype.addTabForContentView):
(WI.TabBrowser.prototype.closeTabForContentView):
(WI.TabBrowser.prototype._tabBarItemSelected):
(WI.TabBrowser._tabBarItemRemoved):
Recent tab list should be validated against the list of saveable tabs,
since the Search tab is no longer a normal tab (a GeneralTabBarItem),
but is still persisted across Inspector sessions.

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

19 months ago[Cocoa][WebKitLegacy] REGRESSION(r221559): Coda 2 crashes when switching views
bfulgham@apple.com [Fri, 16 Feb 2018 21:56:16 +0000 (21:56 +0000)]
[Cocoa][WebKitLegacy] REGRESSION(r221559): Coda 2 crashes when switching views
https://bugs.webkit.org/show_bug.cgi?id=182882
<rdar://problem/35672661>

Reviewed by Dan Bernstein.

Make sure the smart pointer hold the collection of subviews lives at least as
long as the loop using it.

* WebView/WebHTMLView.mm:
(-[WebHTMLView _web_makePluginSubviewsPerformSelector:withObject:]):

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

19 months agoMark fast/block/positioning/fixed-container-with-relative-parent.html as flaky.
ryanhaddad@apple.com [Fri, 16 Feb 2018 21:53:18 +0000 (21:53 +0000)]
Mark fast/block/positioning/fixed-container-with-relative-parent.html as flaky.
https://bugs.webkit.org/show_bug.cgi?id=181834

Unreviewed test gardening.

* platform/mac-wk1/TestExpectations:

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

19 months ago[RenderTreeBuilder] Move RenderBlock/RenderInline::addChildIgnoringContinuation(...
zalan@apple.com [Fri, 16 Feb 2018 21:42:39 +0000 (21:42 +0000)]
[RenderTreeBuilder] Move RenderBlock/RenderInline::addChildIgnoringContinuation() to RenderTreeBuilder
https://bugs.webkit.org/show_bug.cgi?id=182876
<rdar://problem/37607604>

Reviewed by Antti Koivisto.

No change in functionality.

* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::addChildIgnoringContinuation): Deleted.
* rendering/RenderBlock.h:
* rendering/RenderElement.cpp:
(WebCore::RenderElement::addChildIgnoringContinuation): Deleted.
* rendering/RenderElement.h:
* rendering/RenderInline.cpp:
(WebCore::RenderInline::addChildIgnoringContinuation): Deleted.
* rendering/RenderInline.h:
* rendering/updating/RenderTreeBuilder.cpp:
(WebCore::RenderTreeBuilder::insertChildIgnoringContinuation):
(WebCore::RenderTreeBuilder::insertChildToRenderBlockIgnoringContinuation): Deleted.
(WebCore::RenderTreeBuilder::insertChildToRenderInlineIgnoringContinuation): Deleted.
* rendering/updating/RenderTreeBuilder.h:
* rendering/updating/RenderTreeBuilderBlock.cpp:
(WebCore::RenderTreeBuilder::Block::insertChildToContinuation):
* rendering/updating/RenderTreeBuilderInline.cpp:
(WebCore::RenderTreeBuilder::Inline::insertChildToContinuation):
(WebCore::RenderTreeBuilder::Inline::splitInlines):

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

19 months ago[Curl] Unify logic of ResourceHandleCurlDelegate into ResourceHandle
commit-queue@webkit.org [Fri, 16 Feb 2018 21:39:38 +0000 (21:39 +0000)]
[Curl] Unify logic of ResourceHandleCurlDelegate into ResourceHandle
https://bugs.webkit.org/show_bug.cgi?id=182578

Reconstruct the classes to match Curl port network layer more similar
structure with other ports. Move CurlRequest handling into ResourceHandle
and makes CurlResourceHandleDelegate simple life cycle. Also its duty is
for most of incoming data and event handling from CurRequest.

Patch by Basuke Suzuki <Basuke.Suzuki@sony.com> on 2018-02-16
Reviewed by Alex Christensen.

No new tests because there's no new behavior.

* platform/Curl.cmake:
* platform/network/ResourceHandle.h:
* platform/network/ResourceHandleInternal.h:
(WebCore::ResourceHandleInternal::ResourceHandleInternal):
* platform/network/curl/CurlCacheManager.cpp:
(WebCore::CurlCacheManager::didReceiveResponse):
* platform/network/curl/CurlDownload.cpp:
(WebCore::CurlDownload::~CurlDownload):
(WebCore::CurlDownload::createCurlRequest):
(WebCore::CurlDownload::curlDidReceiveResponse):
(WebCore::CurlDownload::curlDidReceiveBuffer):
(WebCore::CurlDownload::curlDidComplete):
(WebCore::CurlDownload::curlDidFailWithError):
(WebCore::CurlDownload::willSendRequest):
* platform/network/curl/CurlDownload.h:
* platform/network/curl/CurlRequest.cpp:
(WebCore::CurlRequest::CurlRequest):
(WebCore::CurlRequest::cancel):
(WebCore::CurlRequest::callClient):
(WebCore::CurlRequest::willSendData):
(WebCore::CurlRequest::didReceiveData):
(WebCore::CurlRequest::didReceiveDataFromMultipart):
(WebCore::CurlRequest::didCompleteTransfer):
(WebCore::CurlRequest::invokeDidReceiveResponse):
* platform/network/curl/CurlRequest.h:
(WebCore::CurlRequest::create):
(WebCore::CurlRequest::invalidateClient):
(WebCore::CurlRequest::setClient): Deleted.
* platform/network/curl/CurlRequestClient.h:
* platform/network/curl/CurlResourceHandleDelegate.cpp: Added.
(WebCore::CurlResourceHandleDelegate::CurlResourceHandleDelegate):
(WebCore::CurlResourceHandleDelegate::ref):
(WebCore::CurlResourceHandleDelegate::deref):
(WebCore::CurlResourceHandleDelegate::cancelledOrClientless):
(WebCore::CurlResourceHandleDelegate::client const):
(WebCore::CurlResourceHandleDelegate::d):
(WebCore::CurlResourceHandleDelegate::curlDidSendData):
(WebCore::handleCookieHeaders):
(WebCore::CurlResourceHandleDelegate::curlDidReceiveResponse):
(WebCore::CurlResourceHandleDelegate::curlDidReceiveBuffer):
(WebCore::CurlResourceHandleDelegate::curlDidComplete):
(WebCore::CurlResourceHandleDelegate::curlDidFailWithError):
* platform/network/curl/CurlResourceHandleDelegate.h: Added.
(WebCore::CurlResourceHandleDelegate::response const):
* platform/network/curl/ResourceHandleCurl.cpp:
(WebCore::ResourceHandleInternal::~ResourceHandleInternal):
(WebCore::ResourceHandle::start):
(WebCore::ResourceHandle::cancel):
(WebCore::ResourceHandle::cancelledOrClientless):
(WebCore::ResourceHandle::createCurlRequest):
(WebCore::ResourceHandle::delegate):
(WebCore::ResourceHandle::platformSetDefersLoading):
(WebCore::ResourceHandle::didReceiveAuthenticationChallenge):
(WebCore::ResourceHandle::receivedCredential):
(WebCore::ResourceHandle::receivedRequestToContinueWithoutCredential):
(WebCore::ResourceHandle::getCredential):
(WebCore::ResourceHandle::restartRequestWithCredential):
(WebCore::ResourceHandle::platformLoadResourceSynchronously):
(WebCore::ResourceHandle::platformContinueSynchronousDidReceiveResponse):
(WebCore::ResourceHandle::continueAfterDidReceiveResponse):
(WebCore::ResourceHandle::shouldRedirectAsGET):
(WebCore::ResourceHandle::willSendRequest):
(WebCore::ResourceHandle::continueAfterWillSendRequest):
(WebCore::ResourceHandle::handleDataURL):
* platform/network/curl/ResourceHandleCurlDelegate.cpp: Removed.
* platform/network/curl/ResourceHandleCurlDelegate.h: Removed.

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

19 months agoUnreviewed, roll out r228306 (custom memcpy/memset) because the bots say that it...
fpizlo@apple.com [Fri, 16 Feb 2018 21:38:53 +0000 (21:38 +0000)]
Unreviewed, roll out r228306 (custom memcpy/memset) because the bots say that it was not a
progression.

Source/bmalloc:

* bmalloc/Algorithm.h:
(bmalloc::fastCopy): Deleted.
(bmalloc::fastZeroFill): Deleted.
* bmalloc/Allocator.cpp:
(bmalloc::Allocator::reallocate):
* bmalloc/Bits.h:
(bmalloc::BitsWordOwner::operator=):
(bmalloc::BitsWordOwner::clearAll):
(bmalloc::BitsWordOwner::set):
* bmalloc/IsoPageInlines.h:
(bmalloc::IsoPage<Config>::IsoPage):
* bmalloc/Vector.h:
(bmalloc::Vector<T>::reallocateBuffer):

Source/JavaScriptCore:

* assembler/AssemblerBuffer.h:
(JSC::AssemblerBuffer::append):
* heap/LargeAllocation.cpp:
(JSC::LargeAllocation::tryCreate):
* heap/MarkedBlock.cpp:
(JSC::MarkedBlock::Handle::didAddToDirectory):
* runtime/ArrayBuffer.cpp:
(JSC::ArrayBufferContents::tryAllocate):
(JSC::ArrayBufferContents::copyTo):
(JSC::ArrayBuffer::createInternal):
* runtime/ArrayBufferView.h:
(JSC::ArrayBufferView::zeroRangeImpl):
* runtime/ArrayConventions.cpp:
(JSC::clearArrayMemset):
* runtime/ArrayConventions.h:
(JSC::clearArray):
* runtime/ArrayPrototype.cpp:
(JSC::arrayProtoPrivateFuncConcatMemcpy):
* runtime/ButterflyInlines.h:
(JSC::Butterfly::tryCreate):
(JSC::Butterfly::createOrGrowPropertyStorage):
(JSC::Butterfly::growArrayRight):
(JSC::Butterfly::resizeArray):
* runtime/GenericTypedArrayViewInlines.h:
(JSC::GenericTypedArrayView<Adaptor>::create):
* runtime/JSArray.cpp:
(JSC::JSArray::appendMemcpy):
(JSC::JSArray::fastSlice):
* runtime/JSArrayBufferView.cpp:
(JSC::JSArrayBufferView::ConstructionContext::ConstructionContext):
* runtime/JSGenericTypedArrayViewInlines.h:
(JSC::JSGenericTypedArrayView<Adaptor>::set):
* runtime/JSObject.cpp:
(JSC::JSObject::constructConvertedArrayStorageWithoutCopyingElements):
(JSC::JSObject::shiftButterflyAfterFlattening):
* runtime/PropertyTable.cpp:
(JSC::PropertyTable::PropertyTable):

Source/WTF:

* WTF.xcodeproj/project.pbxproj:
* wtf/BitVector.cpp:
(WTF::BitVector::setSlow):
(WTF::BitVector::clearAll):
(WTF::BitVector::resizeOutOfLine):
* wtf/BitVector.h:
(WTF::BitVector::OutOfLineBits::numWords const):
(WTF::BitVector::wordCount): Deleted.
* wtf/CMakeLists.txt:
* wtf/ConcurrentBuffer.h:
(WTF::ConcurrentBuffer::growExact):
* wtf/FastBitVector.h:
(WTF::FastBitVectorWordOwner::operator=):
(WTF::FastBitVectorWordOwner::clearAll):
(WTF::FastBitVectorWordOwner::set):
* wtf/FastCopy.h: Removed.
* wtf/FastMalloc.cpp:
(WTF::fastZeroedMalloc):
(WTF::fastStrDup):
(WTF::tryFastZeroedMalloc):
* wtf/FastZeroFill.h: Removed.
* wtf/OSAllocator.h:
(WTF::OSAllocator::reallocateCommitted):
* wtf/StringPrintStream.cpp:
(WTF::StringPrintStream::increaseSize):
* wtf/Vector.h:
* wtf/persistence/PersistentDecoder.cpp:
(WTF::Persistence::Decoder::decodeFixedLengthData):
* wtf/persistence/PersistentEncoder.cpp:
(WTF::Persistence::Encoder::encodeFixedLengthData):
* wtf/text/CString.cpp:
(WTF::CString::init):
(WTF::CString::copyBufferIfNeeded):
* wtf/text/LineBreakIteratorPoolICU.h:
(WTF::LineBreakIteratorPool::makeLocaleWithBreakKeyword):
* wtf/text/StringBuilder.cpp:
(WTF::StringBuilder::allocateBuffer):
(WTF::StringBuilder::append):
* wtf/text/StringConcatenate.h:
* wtf/text/StringImpl.h:
(WTF::StringImpl::copyCharacters):
* wtf/text/icu/UTextProvider.cpp:
(WTF::uTextCloneImpl):
* wtf/text/icu/UTextProviderLatin1.cpp:
(WTF::uTextLatin1Clone):
(WTF::openLatin1UTextProvider):
* wtf/threads/Signals.cpp:

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

19 months agoUse ResourceLoader to load appcache manifest
commit-queue@webkit.org [Fri, 16 Feb 2018 21:31:42 +0000 (21:31 +0000)]
Use ResourceLoader to load appcache manifest
https://bugs.webkit.org/show_bug.cgi?id=182861

Patch by Youenn Fablet <youenn@apple.com> on 2018-02-16
Reviewed by Alex Christensen.

Source/WebCore:

Covered by updated tests.

Add ApplicationCacheResourceLoader to load an ApplicationCacheResource from a ResourceLoader.
Make use of it to load the app cache manifest.
Future work should load entries using the same loader.

Remove manifest handle.
Ensure that DocumentLoader does not register the manifest resource loader as its lifetime
is handled by its ApplicationCacheGroup.

Add a ResourceLoader option to bypass the application cache.
Use it for manifest loading.

* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::addSubresourceLoader):
* loader/ResourceLoaderOptions.h:
* loader/appcache/ApplicationCacheGroup.cpp:
(WebCore::ApplicationCacheGroup::stopLoading):
(WebCore::ApplicationCacheGroup::update):
(WebCore::ApplicationCacheGroup::createRequest):
(WebCore::ApplicationCacheGroup::didReceiveResponseAsync):
(WebCore::ApplicationCacheGroup::didReceiveData):
(WebCore::ApplicationCacheGroup::didFinishLoading):
(WebCore::ApplicationCacheGroup::didFail):
(WebCore::ApplicationCacheGroup::didFinishLoadingManifest):
(WebCore::ApplicationCacheGroup::checkIfLoadIsComplete):
* loader/appcache/ApplicationCacheGroup.h:
* loader/appcache/ApplicationCacheHost.cpp:
(WebCore::ApplicationCacheHost::maybeLoadResource):
(WebCore::ApplicationCacheHost::maybeLoadFallbackForRedirect):
(WebCore::ApplicationCacheHost::maybeLoadFallbackForResponse):
(WebCore::ApplicationCacheHost::maybeLoadFallbackForError):
* loader/appcache/ApplicationCacheResourceLoader.cpp: Added.
* loader/appcache/ApplicationCacheResourceLoader.h: Added.

LayoutTests:

* http/tests/appcache/fail-on-update-2-expected.txt:
* http/tests/appcache/manifest-redirect-2-expected.txt:
* http/tests/appcache/offline-access-expected.txt:

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

19 months agoCrash under WebCore::EventTarget::fireEventListeners
cdumez@apple.com [Fri, 16 Feb 2018 21:06:34 +0000 (21:06 +0000)]
Crash under WebCore::EventTarget::fireEventListeners
https://bugs.webkit.org/show_bug.cgi?id=182880
<rdar://problem/20788804>

Reviewed by Youenn Fablet.

Source/WebCore:

Make sure the 'ended' event does not get dispatched on a
AudioScheduledSourceNode after ActiveDOMObjects have been stopped.

Test: webaudio/audiobuffersource-ended-detached-frame.html

* Modules/webaudio/AudioScheduledSourceNode.cpp:
(WebCore::AudioScheduledSourceNode::finish):

LayoutTests:

Add layout test coverage.

* webaudio/audiobuffersource-ended-detached-frame-expected.txt: Added.
* webaudio/audiobuffersource-ended-detached-frame.html: Added.
* webaudio/resources/audiobuffersource-ended-detached-frame-iframe.html: Added.

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

19 months agoWeb Inspector: TabBar redesign: TabBarItem close button is incorrectly positioned
mattbaker@apple.com [Fri, 16 Feb 2018 20:59:55 +0000 (20:59 +0000)]
Web Inspector: TabBar redesign: TabBarItem close button is incorrectly positioned
https://bugs.webkit.org/show_bug.cgi?id=182844
<rdar://problem/37586749>

Reviewed by Timothy Hatcher.

* UserInterface/Views/GeneralTabBarItem.js:
(WI.GeneralTabBarItem.prototype.set title):
Insert the title before the last flexible space item.

* UserInterface/Views/TabBar.css:
(.tab-bar > .item):
(.tab-bar > .item > .close):
(.tab-bar > .item > .flex-space):
(.tab-bar > .item.ephemeral > .flex-space:last-child):
(.tab-bar.collapsed > .item):
(.tab-bar.collapsed > .item > .flex-space):
(.tab-bar.collapsed > .item > .close):
(.tab-bar.collapsed > .item:hover > .close):
(.tab-bar.collapsed > .item.ephemeral:hover > .icon):
(.tab-bar > .item:hover > .close): Deleted.
(.tab-bar:not(.collapsed) > .item.ephemeral:hover > .icon): Deleted.

* UserInterface/Views/TabBarItem.js:
(WI.TabBarItem):
Restore flexible space items before and after the icon.

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

19 months ago[WebAuthN] Implement PublicKeyCredential.isUserVerifyingPlatformAuthenticatorAvailable()
jiewen_tan@apple.com [Fri, 16 Feb 2018 20:43:28 +0000 (20:43 +0000)]
[WebAuthN] Implement PublicKeyCredential.isUserVerifyingPlatformAuthenticatorAvailable()
https://bugs.webkit.org/show_bug.cgi?id=182771
<rdar://problem/36459988>

Reviewed by Brent Fulgham.

Source/WebCore:

This patch implements PublicKeyCredential.isUserVerifyingPlatformAuthenticatorAvailable()
per https://www.w3.org/TR/webauthn/#isUserVerifyingPlatformAuthenticatorAvailable with some
limitations.

In addition, it changes DeferredPromise to DOMPromiseDeferred<> for all CredentialsManagement
and WebAuthN API.

Test: http/wpt/webauthn/public-key-is-user-verifying-platform-authenticator-available.html

* Modules/credentialmanagement/CredentialsContainer.cpp:
(WebCore::CredentialsContainer::get):
(WebCore::CredentialsContainer::store):
(WebCore::CredentialsContainer::isCreate):
(WebCore::CredentialsContainer::preventSilentAccess const):
* Modules/credentialmanagement/CredentialsContainer.h:
* Modules/credentialmanagement/CredentialsMessenger.cpp:
(WebCore::CredentialsMessenger::addCreationCompletionHandler):
Remove a redundant assertion.
(WebCore::CredentialsMessenger::addRequestCompletionHandler):
Remove a redundant assertion.
(WebCore::CredentialsMessenger::addQueryCompletionHandler):
(WebCore::CredentialsMessenger::takeQueryCompletionHandler):
* Modules/credentialmanagement/CredentialsMessenger.h:
* Modules/webauthn/AuthenticatorManager.cpp:
(WebCore::AuthenticatorManagerInternal::initTimeoutTimer):
(WebCore::AuthenticatorManager::create const):
(WebCore::AuthenticatorManager::discoverFromExternalSource const):
(WebCore::AuthenticatorManager::isUserVerifyingPlatformAuthenticatorAvailable const):
* Modules/webauthn/AuthenticatorManager.h:
* Modules/webauthn/PublicKeyCredential.cpp:
(WebCore::PublicKeyCredential::isUserVerifyingPlatformAuthenticatorAvailable):
* Modules/webauthn/PublicKeyCredential.h:
* testing/MockCredentialsMessenger.cpp:
(WebCore::MockCredentialsMessenger::isUserVerifyingPlatformAuthenticatorAvailable):
(WebCore::MockCredentialsMessenger::isUserVerifyingPlatformAuthenticatorAvailableReply):
* testing/MockCredentialsMessenger.h:
* testing/MockCredentialsMessenger.idl:

Source/WebKit:

This patch utilizes LocalAuthentication Framework to determine if biometrics
are enrolled on a device, which is the user verifying platform authenticator.
To do so, it links the framework to WebKit.

* UIProcess/CredentialManagement/WebCredentialsMessengerProxy.cpp:
(WebKit::WebCredentialsMessengerProxy::isUserVerifyingPlatformAuthenticatorAvailable):
(WebKit::WebCredentialsMessengerProxy::isUserVerifyingPlatformAuthenticatorAvailableReply):
* UIProcess/CredentialManagement/WebCredentialsMessengerProxy.h:
* UIProcess/CredentialManagement/WebCredentialsMessengerProxy.messages.in:
* UIProcess/CredentialManagement/cocoa/WebCredentialsMessengerProxyCocoa.mm:
(WebKit::WebCredentialsMessengerProxy::platformIsUserVerifyingPlatformAuthenticatorAvailable):
* WebKit.xcodeproj/project.pbxproj:
* WebProcess/CredentialManagement/WebCredentialsMessenger.cpp:
(WebKit::WebCredentialsMessenger::isUserVerifyingPlatformAuthenticatorAvailable):
(WebKit::WebCredentialsMessenger::isUserVerifyingPlatformAuthenticatorAvailableReply):
* WebProcess/CredentialManagement/WebCredentialsMessenger.h:
* WebProcess/CredentialManagement/WebCredentialsMessenger.messages.in:

LayoutTests:

* http/wpt/webauthn/public-key-is-user-verifying-platform-authenticator-available-expected.txt: Added.
* http/wpt/webauthn/public-key-is-user-verifying-platform-authenticator-available.html: Added.

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

19 months agoStop using EXCLUDED_SOURCE_FILE_NAMES for touch and gesture files in WebCore
timothy_horton@apple.com [Fri, 16 Feb 2018 19:53:19 +0000 (19:53 +0000)]
Stop using EXCLUDED_SOURCE_FILE_NAMES for touch and gesture files in WebCore
https://bugs.webkit.org/show_bug.cgi?id=182866

Reviewed by Daniel Bates.

* Configurations/WebCore.xcconfig:
These generated files already have ENABLE() flags around them,
so there's no reason to exclude them explicitly.

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

19 months agoImplement stopping of run loop in the WebContent process when using NSRunLoop.
pvollan@apple.com [Fri, 16 Feb 2018 19:38:13 +0000 (19:38 +0000)]
Implement stopping of run loop in the WebContent process when using NSRunLoop.
https://bugs.webkit.org/show_bug.cgi?id=182499
<rdar://problem/37247424>

Reviewed by Brent Fulgham.

Source/WebKit:

Add the method ChildProcess::stopNSRunLoop to end the WebContent process by executing a block
with 'exit(0)' on the main run loop.

* Shared/ChildProcess.h:
* Shared/mac/ChildProcessMac.mm:
(WebKit::ChildProcess::stopNSRunLoop):
* WebProcess/cocoa/WebProcessCocoa.mm:
(WebKit::WebProcess::platformInitializeWebProcess):
(WebKit::WebProcess::stopRunLoop):

Tools:

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKitCocoa/WebProcessTerminate.mm: Added.
(TEST):

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

19 months agoUnreviewed, fix iOS build after r228562.
cdumez@apple.com [Fri, 16 Feb 2018 19:35:52 +0000 (19:35 +0000)]
Unreviewed, fix iOS build after r228562.

* workers/service/server/RegistrationDatabase.cpp:
(WebCore::RegistrationDatabase::openSQLiteDatabase):

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

19 months ago[WinCario] Add NetworkSessionCurl
commit-queue@webkit.org [Fri, 16 Feb 2018 19:34:12 +0000 (19:34 +0000)]
[WinCario] Add NetworkSessionCurl
https://bugs.webkit.org/show_bug.cgi?id=182680

Patch by Yousuke Kimoto <yousuke.kimoto@sony.com> on 2018-02-16
Reviewed by Konstantin Tokarev.

* NetworkProcess/NetworkSession.cpp:
(WebKit::NetworkSession::create):
* PlatformWin.cmake:

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

19 months ago[RenderTreeBuilder] Move RenderElement::addChild() to RenderTreeBuilder
zalan@apple.com [Fri, 16 Feb 2018 19:25:18 +0000 (19:25 +0000)]
[RenderTreeBuilder] Move RenderElement::addChild() to RenderTreeBuilder
https://bugs.webkit.org/show_bug.cgi?id=182878
<rdar://problem/37608349>

Reviewed by Antti Koivisto.

This patch removes the last addChild() related mutation logic from the renderers.

No change in functionality.

* rendering/RenderElement.cpp:
(WebCore::RenderElement::didInsertChild):
(WebCore::RenderElement::addChild): Deleted.
* rendering/RenderElement.h:
(WebCore::RenderElement::isChildAllowed const):
* rendering/updating/RenderTreeBuilder.cpp:
(WebCore::RenderTreeBuilder::insertChild):
(WebCore::RenderTreeBuilder::insertChildToRenderElement):
* rendering/updating/RenderTreeBuilder.h:
* rendering/updating/RenderTreeBuilderBlock.cpp:
(WebCore::RenderTreeBuilder::Block::insertChildIgnoringContinuation):
* rendering/updating/RenderTreeBuilderInline.cpp:
(WebCore::RenderTreeBuilder::Inline::insertChildIgnoringContinuation):
* rendering/updating/RenderTreeBuilderSVG.cpp:
(WebCore::RenderTreeBuilder::SVG::insertChild):
* rendering/updating/RenderTreeBuilderTable.cpp:
(WebCore::RenderTreeBuilder::Table::insertChild):

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

19 months agoFix bugs from r228411
sbarati@apple.com [Fri, 16 Feb 2018 19:12:29 +0000 (19:12 +0000)]
Fix bugs from r228411
https://bugs.webkit.org/show_bug.cgi?id=182851
<rdar://problem/37577732>

Reviewed by JF Bastien.

JSTests:

* stress/constant-folding-phase-insert-check-handle-varargs.js: Added.

Source/JavaScriptCore:

There was a bug from r228411 where inside the constant folding phase,
we used an insertCheck method that didn't handle varargs. This would
lead to a crash. When thinking about the fix for that function, I realized
a made a couple of mistakes in r228411. One is probably a security bug, and
the other is a performance bug because it'll prevent CSE for certain flavors
of GetByVal nodes. Both blunders are similar in nature.

In r228411, I added code in LICM that inserted a CheckVarargs node with children
of another varargs node. However, to construct this new node's children,
I just copied the AdjacencyList. This does a shallow copy. What we needed
was a deep copy. We needed to create a new vararg AdjacencyList that points
to edges that are deep copies of the original varargs children. This patch
fixes this goof in LICM.

r228411 made it so that PureValue over a varargs node would just compare actual
AdjacencyLists structs. So, if you had two GetByVals that had equal santized
children, their actual AdjacencyList structs are *not* bitwise equal, since they'll
have different firstChild values. Instead, we need to do a deep compare of their
adjacency lists. This patch teaches PureValue how to do that.

* dfg/DFGClobberize.h:
(JSC::DFG::clobberize):
* dfg/DFGConstantFoldingPhase.cpp:
(JSC::DFG::ConstantFoldingPhase::foldConstants):
* dfg/DFGGraph.h:
(JSC::DFG::Graph::copyVarargChildren):
* dfg/DFGInsertionSet.h:
(JSC::DFG::InsertionSet::insertCheck):
* dfg/DFGLICMPhase.cpp:
(JSC::DFG::LICMPhase::attemptHoist):
* dfg/DFGPureValue.cpp:
(JSC::DFG::PureValue::dump const):
* dfg/DFGPureValue.h:
(JSC::DFG::PureValue::PureValue):
(JSC::DFG::PureValue::op const):
(JSC::DFG::PureValue::hash const):
(JSC::DFG::PureValue::operator== const):
(JSC::DFG::PureValue::isVarargs const):
(JSC::DFG::PureValue::children const): Deleted.
* dfg/DFGStrengthReductionPhase.cpp:
(JSC::DFG::StrengthReductionPhase::handleNode):
(JSC::DFG::StrengthReductionPhase::convertToIdentityOverChild):

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

19 months agoASSERTION FAILED: !m_processes[i] || *m_processes[i] == process in MessagePortChannel...
cdumez@apple.com [Fri, 16 Feb 2018 19:05:07 +0000 (19:05 +0000)]
ASSERTION FAILED: !m_processes[i] || *m_processes[i] == process in MessagePortChannel::entanglePortWithProcess()
https://bugs.webkit.org/show_bug.cgi?id=182054
<rdar://problem/36871207>

Reviewed by Brady Eidson.

Pipe postMessage messages to and from service workers via the UIProcess instead of going
directly to the StorageProcess. This is temporarily needed to avoid races due to the
MessagePort registry currently living in the UIProcess and postMessage messages potentially
sending MessagePort objects.

This change is covered by tests on the bots that currently flakily crash in debug.

* StorageProcess/ServiceWorker/WebSWServerConnection.h:
* StorageProcess/StorageProcess.cpp:
(WebKit::StorageProcess::postMessageToServiceWorker):
* StorageProcess/StorageProcess.h:
* StorageProcess/StorageProcess.messages.in:
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::postMessageToServiceWorkerClient):
(WebKit::WebProcessPool::postMessageToServiceWorker):
* UIProcess/WebProcessPool.h:
* UIProcess/WebProcessPool.messages.in:
* WebProcess/Storage/WebSWClientConnection.cpp:
(WebKit::WebSWClientConnection::postMessageToServiceWorker):
* WebProcess/Storage/WebSWContextManagerConnection.cpp:
(WebKit::WebSWContextManagerConnection::postMessageToServiceWorkerClient):

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

19 months agoUnreviewed, rolling out r228546.
jlewis3@apple.com [Fri, 16 Feb 2018 18:52:24 +0000 (18:52 +0000)]
Unreviewed, rolling out r228546.

This caused a consistent crash on all macOS WK2 platforms.

Reverted changeset:

"Web Inspector: get rid of remaining uses of OptOutput<T>"
https://bugs.webkit.org/show_bug.cgi?id=180607
https://trac.webkit.org/changeset/228546

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

19 months agoLog the error message when failing to open the database
commit-queue@webkit.org [Fri, 16 Feb 2018 18:48:32 +0000 (18:48 +0000)]
Log the error message when failing to open the database
https://bugs.webkit.org/show_bug.cgi?id=182795
<rdar://problem/37592399>

Unreviewed.
Fixing iOS simulator debug build.

Patch by Youenn Fablet <youenn@apple.com> on 2018-02-16

* workers/service/server/RegistrationDatabase.cpp:
(WebCore::RegistrationDatabase::openSQLiteDatabase):

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

19 months agofast/frames/sandboxed-iframe-navigation-top-denied.html is crashing in Inspector...
commit-queue@webkit.org [Fri, 16 Feb 2018 17:46:13 +0000 (17:46 +0000)]
fast/frames/sandboxed-iframe-navigation-top-denied.html is crashing in Inspector::createScriptCallStackForConsole::Exec for GTK
https://bugs.webkit.org/show_bug.cgi?id=172952

Patch by Fujii Hironori <Hironori.Fujii@sony.com> on 2018-02-16
Reviewed by Michael Catanzaro.

Source/JavaScriptCore:

Null dereference of VM::topCallFrame happens in
Inspector::createScriptCallStackForConsole if the ExecState has no
call frames.

* inspector/ScriptCallStackFactory.cpp:
(Inspector::createScriptCallStack): Do null check of topCallFrame.
(Inspector::createScriptCallStackForConsole): Ditto.

LayoutTests:

* platform/gtk/TestExpectations: Unmarked fast/frames/sandboxed-iframe-navigation-top-denied.html.

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

19 months agoIndexedDB: Several test crash in when destroying a IDBKeyData
commit-queue@webkit.org [Fri, 16 Feb 2018 17:41:12 +0000 (17:41 +0000)]
IndexedDB: Several test crash in when destroying a IDBKeyData
https://bugs.webkit.org/show_bug.cgi?id=167576

Patch by Fujii Hironori <Hironori.Fujii@sony.com> on 2018-02-16
Reviewed by Michael Catanzaro.

Source/WebCore:

IDBKeyDataHashTraits::constructDeletedValue is using operator= to
assign deletedValue. But, the value is destructed just before
calling constructDeletedValue. You can't use operator= for a
destructed value.

No new tests (Covered by existing tests).

* Modules/indexeddb/IDBKeyData.h:
(WebCore::IDBKeyDataHashTraits::constructDeletedValue):
Construct null value before assigning deletedValue.

LayoutTests:

* platform/gtk/TestExpectations: Unmarked
imported/w3c/IndexedDB-private-browsing/idbcursor_iterating.html,
imported/w3c/IndexedDB-private-browsing/idbcursor_iterating_index.html
and storage/indexeddb/modern/index-3-private.html.
* platform/wpe/TestExpectations: Unmarked
imported/w3c/IndexedDB-private-browsing/idbcursor_iterating.html and
imported/w3c/IndexedDB-private-browsing/idbcursor_iterating_index.html.

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

20 months ago[RenderTreeBuilder] Move RenderBlock/RenderBlockFlow::addChild() to RenderTreeBuilder
zalan@apple.com [Fri, 16 Feb 2018 15:13:31 +0000 (15:13 +0000)]
[RenderTreeBuilder] Move RenderBlock/RenderBlockFlow::addChild() to RenderTreeBuilder
https://bugs.webkit.org/show_bug.cgi?id=182862
<rdar://problem/37595464>

Reviewed by Antti Koivisto.

No change in functionality.

* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::addChild): Deleted.
* rendering/RenderBlock.h:
* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::addChild): Deleted.
* rendering/RenderBlockFlow.h:
* rendering/updating/RenderTreeBuilder.cpp:
(WebCore::RenderTreeBuilder::insertChild):
(WebCore::RenderTreeBuilder::insertChildToRenderBlock): Deleted.
(WebCore::RenderTreeBuilder::insertChildToRenderBlockFlow): Deleted.
* rendering/updating/RenderTreeBuilder.h:
* rendering/updating/RenderTreeBuilderBlockFlow.cpp:
(WebCore::RenderTreeBuilder::BlockFlow::insertChild):
* rendering/updating/RenderTreeBuilderFormControls.cpp:
(WebCore::RenderTreeBuilder::FormControls::findOrCreateParentForChild):
* rendering/updating/RenderTreeBuilderMathML.cpp:
(WebCore::RenderTreeBuilder::MathML::makeFences):
(WebCore::RenderTreeBuilder::MathML::insertChild):
* rendering/updating/RenderTreeBuilderMultiColumn.cpp:
(WebCore::RenderTreeBuilder::MultiColumn::createFragmentedFlow):
(WebCore::RenderTreeBuilder::MultiColumn::processPossibleSpannerDescendant):
* rendering/updating/RenderTreeBuilderRuby.cpp:
(WebCore::RenderTreeBuilder::Ruby::insertChild):
(WebCore::RenderTreeBuilder::Ruby::findOrCreateParentForChild):
(WebCore::RenderTreeBuilder::Ruby::rubyBaseSafe):
* rendering/updating/RenderTreeBuilderSVG.cpp:
(WebCore::RenderTreeBuilder::SVG::insertChild):

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

20 months ago[WPE] Update expectations for a couple of flaky tests
csaavedra@igalia.com [Fri, 16 Feb 2018 15:03:59 +0000 (15:03 +0000)]
[WPE] Update expectations for a couple of flaky tests

Unreviewed gardening.

http/tests/appcache/fail-on-update.html and
svg/as-image/svg-as-image-canvas.html are flaky.
* platform/wpe/TestExpectations:

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

20 months ago[Extra zoom mode] Add basic support for <input type='date'> using date picker UI
wenson_hsieh@apple.com [Fri, 16 Feb 2018 14:35:49 +0000 (14:35 +0000)]
[Extra zoom mode] Add basic support for <input type='date'> using date picker UI
https://bugs.webkit.org/show_bug.cgi?id=182847
<rdar://problem/35143111>

Reviewed by Tim Horton.

Source/WebCore:

Add new localized strings for "month", "day" and "year" as they appear in the date picker.

* English.lproj/Localizable.strings:
* platform/LocalizedStrings.cpp:
(WebCore::textInputModeWriteButtonTitle):
(WebCore::textInputModeSpeechButtonTitle):
(WebCore::datePickerDayLabelTitle):
(WebCore::datePickerMonthLabelTitle):
(WebCore::datePickerYearLabelTitle):
(WebCore::textInputModeWriteButton): Deleted.
(WebCore::textInputModeSpeechButton): Deleted.
* platform/LocalizedStrings.h:

Source/WebKit:

Add support for presenting date pickers when focusing a date input.

* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _stopAssistingNode]):
(-[WKContentView dismissAllInputViewControllers]):

Pull logic to dismiss input view controllers into a single helper.

(-[WKContentView presentDatePickerViewController:]):
(-[WKContentView dismissDatePickerViewController:]):
(-[WKContentView presentViewControllerForAssistedNode:]):
(-[WKContentView textInputController:didCommitText:]):
(-[WKContentView _wheelChangedWithEvent:]):

Delegate wheel events to the date picker.

* UIProcess/ios/forms/WKDatePickerViewController.h: Added.
* UIProcess/ios/forms/WKDatePickerViewController.mm: Added.

Add harness files for the WKDatePickerViewController implementation in WebKitAdditions.

* WebKit.xcodeproj/project.pbxproj:

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

20 months agoRemove unused line from Platform.h
keith_miller@apple.com [Fri, 16 Feb 2018 14:33:29 +0000 (14:33 +0000)]
Remove unused line from Platform.h
https://bugs.webkit.org/show_bug.cgi?id=182871

Reviewed by Mark Lam.

* wtf/Platform.h:

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

20 months ago[WPE] New rebaseline after r228427
csaavedra@igalia.com [Fri, 16 Feb 2018 13:56:22 +0000 (13:56 +0000)]
[WPE] New rebaseline after r228427

Unreviewed gardening
* platform/wpe/js/dom/dom-static-property-for-in-iteration-expected.txt: Remove
gone AccessibleNode class.

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

20 months agoUpdate expectations for a couple of failing tests.
csaavedra@igalia.com [Fri, 16 Feb 2018 13:47:01 +0000 (13:47 +0000)]
Update expectations for a couple of failing tests.

Unreviewed gardening.
* platform/gtk/TestExpectations:

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

20 months agoHarfBuzzFace should operate with a FontPlatformData reference
zandobersek@gmail.com [Fri, 16 Feb 2018 08:00:19 +0000 (08:00 +0000)]
HarfBuzzFace should operate with a FontPlatformData reference
https://bugs.webkit.org/show_bug.cgi?id=182863

Reviewed by Carlos Garcia Campos.

Instead of keeping a never-null pointer to FontPlatformData,
HarfBuzzFace should operate with a FontPlatformData reference.

* platform/graphics/freetype/FontPlatformDataFreeType.cpp:
(WebCore::FontPlatformData::harfBuzzFace const):
* platform/graphics/harfbuzz/HarfBuzzFace.cpp:
(WebCore::HarfBuzzFace::HarfBuzzFace):
* platform/graphics/harfbuzz/HarfBuzzFace.h:
* platform/graphics/harfbuzz/HarfBuzzFaceCairo.cpp:
(WebCore::HarfBuzzFace::createFace):
(WebCore::HarfBuzzFace::createFont):

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

20 months agoObjects that contain dangerous things should be allocated far away from objects that...
fpizlo@apple.com [Fri, 16 Feb 2018 05:27:39 +0000 (05:27 +0000)]
Objects that contain dangerous things should be allocated far away from objects that can do OOB
https://bugs.webkit.org/show_bug.cgi?id=182843

Reviewed by Saam Barati.

To complete our object distancing plan, we need to put objects that can contain unpoisoned data
far away from objects that cannot. Objects referenceable from JSValues cannot contain
unpoisoned data, but auxiliary data can. This further divides auxiliary data that is meant for
storing mostly JSValues from data that is meant for storing anything.

This is achieved by having three SecurityKinds that are used for MarkedBlock selection and
zeroing sort of the same way SecurityOriginToken already was.

This change shouldn't make anything slower. If anything, it will be a small speed-up because it
removes some cases of MarkedBlock zeroing since we don't need to zero blocks used for two of
the SecurityKinds.

* Sources.txt:
* bytecode/ObjectAllocationProfileInlines.h:
(JSC::ObjectAllocationProfile::initializeProfile):
* heap/BlockDirectory.cpp:
(JSC::BlockDirectory::addBlock):
* heap/BlockDirectory.h:
* heap/CellAttributes.cpp:
(JSC::CellAttributes::dump const):
* heap/CellAttributes.h:
(JSC::CellAttributes::CellAttributes):
* heap/LocalAllocator.cpp:
(JSC::LocalAllocator::allocateSlowCase):
(JSC::LocalAllocator::tryAllocateWithoutCollecting):
* heap/MarkedBlock.cpp:
(JSC::MarkedBlock::Handle::didAddToDirectory):
(JSC::MarkedBlock::Handle::associateWithOrigin): Deleted.
* heap/MarkedBlock.h:
* heap/SecurityKind.cpp: Added.
(WTF::printInternal):
* heap/SecurityKind.h: Added.
* runtime/JSCellInlines.h:
(JSC::JSCell::subspaceFor):
* runtime/JSDestructibleObjectHeapCellType.cpp:
(JSC::JSDestructibleObjectHeapCellType::JSDestructibleObjectHeapCellType):
* runtime/JSObject.h:
(JSC::JSObject::subspaceFor):
* runtime/JSSegmentedVariableObjectHeapCellType.cpp:
(JSC::JSSegmentedVariableObjectHeapCellType::JSSegmentedVariableObjectHeapCellType):
* runtime/JSStringHeapCellType.cpp:
(JSC::JSStringHeapCellType::JSStringHeapCellType):
* runtime/Symbol.h:
(JSC::Symbol::subspaceFor):
* runtime/VM.cpp:
(JSC::VM::VM):
* runtime/VM.h:
* wasm/js/JSWebAssemblyCodeBlockHeapCellType.cpp:
(JSC::JSWebAssemblyCodeBlockHeapCellType::JSWebAssemblyCodeBlockHeapCellType):

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

20 months agoResources loaded from service workers are not downloadable
commit-queue@webkit.org [Fri, 16 Feb 2018 04:27:43 +0000 (04:27 +0000)]
Resources loaded from service workers are not downloadable
https://bugs.webkit.org/show_bug.cgi?id=182848

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

Source/WebKit:

Downloads are not supporting resources loaded through service worker.
As a temporary solution, we will let network process handle it.
Note that this would not work if the URL can only be loaded through service worker.
Note also that for navigation loads, if the content type is the default one (application/octet-stream) we are overriding it to
text/html as we do not support mime sniffing yet from service worker responses.
This might interfere with automatic downloads from navigation.

* NetworkProcess/NetworkConnectionToWebProcess.cpp:
(WebKit::NetworkConnectionToWebProcess::convertMainResourceLoadToDownload):

LayoutTests:

* http/tests/workers/service/resources/download-binary.php: Added.
* http/tests/workers/service/resources/service-worker-download-worker.js: Added.
* http/tests/workers/service/service-worker-download.https-expected.txt: Added.
* http/tests/workers/service/service-worker-download.https.html: Added.

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

20 months ago[RenderTreeBuilder] parent.Render*::addChild() cleanup
zalan@apple.com [Fri, 16 Feb 2018 03:28:24 +0000 (03:28 +0000)]
[RenderTreeBuilder] parent.Render*::addChild() cleanup
https://bugs.webkit.org/show_bug.cgi?id=182842
<rdar://problem/37585524>

Reviewed by Antti Koivisto.

No change in functionality.

* rendering/updating/RenderTreeBuilderBlock.cpp:
(WebCore::RenderTreeBuilder::Block::insertChildIgnoringContinuation):
* rendering/updating/RenderTreeBuilderFormControls.cpp:
(WebCore::RenderTreeBuilder::FormControls::createInnerRendererIfNeeded):
* rendering/updating/RenderTreeBuilderInline.cpp:
(WebCore::RenderTreeBuilder::Inline::insertChildIgnoringContinuation):
* rendering/updating/RenderTreeBuilderMathML.cpp:
(WebCore::RenderTreeBuilder::MathML::makeFences):
(WebCore::RenderTreeBuilder::MathML::insertChild):
* rendering/updating/RenderTreeBuilderSVG.cpp:
(WebCore::RenderTreeBuilder::SVG::insertChild):
* rendering/updating/RenderTreeBuilderTable.cpp:
(WebCore::RenderTreeBuilder::Table::insertChild):

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

20 months agoSupport scrolling for non-editable web-selection and start autoscroll when near scree...
megan_gardner@apple.com [Fri, 16 Feb 2018 03:08:06 +0000 (03:08 +0000)]
Support scrolling for non-editable web-selection and start autoscroll when near screen edges
https://bugs.webkit.org/show_bug.cgi?id=182815

Source/WebCore:

Reviewed by Tim Horton.

Adjust the position we are autoscrolling to so that when we are close to an edge, we will start autoscrolling
while we are still inside the view. Autoscrolling still happens when you drag past the edge of a view.

No new tests (This is difficult to test in this state, but when we switch assistants, test will also be added).

* page/EventHandler.h:
* page/ios/EventHandlerIOS.mm:
(WebCore::EventHandler::startSelectionAutoscroll):
(WebCore::EventHandler::cancelSelectionAutoscroll):
(WebCore::autoscrollAdjustmentFactorForScreenBoundaries):
(WebCore::EventHandler::targetPositionInWindowForSelectionAutoscroll const):
(WebCore::EventHandler::startTextAutoscroll): Deleted.
(WebCore::EventHandler::cancelTextAutoscroll): Deleted.

Source/WebKit:

Add support for autoscrolling during a selection. This also takes into account the edges of the screen
and starts autoscrolling when you get close, while still allowing autoscrolling when you are past the bounds
of the WebView.

Reviewed by Tim Horton.

* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView startAutoscroll:]):
(-[WKContentView resignFirstResponderForWebView]):
(-[WKContentView useSelectionAssistantWithGranularity:]):
(-[WKContentView selectedTextRange]):
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::startAutoscrollAtPosition):
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::startAutoscrollAtPosition):
(WebKit::WebPage::cancelAutoscroll):

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

20 months agoLog the error message when failing to open the database
commit-queue@webkit.org [Fri, 16 Feb 2018 02:45:07 +0000 (02:45 +0000)]
Log the error message when failing to open the database
https://bugs.webkit.org/show_bug.cgi?id=182795

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

No change of behavior.
Print the error message as it does not contain any user private information.

* workers/service/server/RegistrationDatabase.cpp:
(WebCore::RegistrationDatabase::openSQLiteDatabase):

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

20 months ago[RenderTreeBuilder] Move RenderMenuList::addChild() to RenderTreeBuilder
zalan@apple.com [Fri, 16 Feb 2018 02:37:38 +0000 (02:37 +0000)]
[RenderTreeBuilder] Move RenderMenuList::addChild() to RenderTreeBuilder
https://bugs.webkit.org/show_bug.cgi?id=182840
<rdar://problem/37583638>

Reviewed by Antti Koivisto.

No change in functionality.

* rendering/RenderMenuList.cpp:
(RenderMenuList::didInsertChild):
(RenderMenuList::addChild): Deleted.
* rendering/RenderMenuList.h:
* rendering/updating/RenderTreeBuilder.cpp:
(WebCore::RenderTreeBuilder::insertChild):
* rendering/updating/RenderTreeBuilderFormControls.cpp:
(WebCore::RenderTreeBuilder::FormControls::findOrCreateParentForChild):
(WebCore::RenderTreeBuilder::FormControls::insertChild):
(WebCore::RenderTreeBuilder::FormControls::createInnerRendererIfNeeded): Deleted.
* rendering/updating/RenderTreeBuilderFormControls.h:

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

20 months agoWeb Inspector: get rid of remaining uses of OptOutput<T>
darin@apple.com [Fri, 16 Feb 2018 02:14:29 +0000 (02:14 +0000)]
Web Inspector: get rid of remaining uses of OptOutput<T>
https://bugs.webkit.org/show_bug.cgi?id=180607

Reviewed by Brian Burg.

Source/JavaScriptCore:

* inspector/AsyncStackTrace.cpp: Removed explicit Inspector prefix from code that
is inside the Inspector namespace already. Also use auto a bit.
* inspector/AsyncStackTrace.h: Ditto.
* inspector/ConsoleMessage.cpp: Ditto.

* inspector/ContentSearchUtilities.cpp: More Inspector namespace removal and ...
(Inspector::ContentSearchUtilities::getRegularExpressionMatchesByLines): Use a
Vector instead of a unique_ptr<Vector>.
(Inspector::ContentSearchUtilities::lineEndings): Ditto.
(Inspector::ContentSearchUtilities::stylesheetCommentPattern): Deleted.
(Inspector::ContentSearchUtilities::findMagicComment): Use std::array instead of
a Vector for a fixed size array; also got rid of reinterpret_cast.
(Inspector::ContentSearchUtilities::findStylesheetSourceMapURL): Moved the regular
expression here since it's the only place it was used.

* inspector/ContentSearchUtilities.h: Cut down on unneeded includes.

* inspector/InjectedScript.cpp: Removed explicit Inspector prefix from code that
is inside the Inspector namespace already. Also use auto a bit.

* inspector/InspectorProtocolTypes.h: Removed OptOutput. Simplified assertions.
Removed base template for BindingTraits; we only need the specializations.

* inspector/ScriptCallFrame.cpp: Removed explicit Inspector prefix from code that
is inside the Inspector namespace already. Also use auto a bit.
* inspector/ScriptCallFrame.h: Ditto.
* inspector/ScriptCallStack.cpp: Ditto.
* inspector/ScriptCallStack.h: Ditto.
* inspector/agents/InspectorConsoleAgent.cpp: Ditto.
* inspector/agents/InspectorConsoleAgent.h: Ditto.

* inspector/agents/InspectorDebuggerAgent.cpp: More Inspector namespace removal and ...
(Inspector::InspectorDebuggerAgent::evaluateOnCallFrame): Use std::optional& intead of
OptOutput* for out arguments.
* inspector/agents/InspectorDebuggerAgent.h: Ditto.

* inspector/agents/InspectorHeapAgent.cpp: More Inspector namespace removal and ...
(Inspector::InspectorHeapAgent::getPreview): Use std::optional& intead of OptOutput*
for out arguments.
* inspector/agents/InspectorHeapAgent.h: Ditto.

* inspector/agents/InspectorRuntimeAgent.cpp: More Inspector namespace removal and ...
(Inspector::InspectorRuntimeAgent::parse): Use std::optional& intead of OptOutput*
for out arguments.
(Inspector::InspectorRuntimeAgent::evaluate): Ditto.
(Inspector::InspectorRuntimeAgent::callFunctionOn): Ditto.
(Inspector::InspectorRuntimeAgent::saveResult): Ditto.
* inspector/agents/InspectorRuntimeAgent.h: Ditto.

* inspector/agents/InspectorScriptProfilerAgent.cpp: More Inspector namespace removal
and removed some bogus const.
* inspector/agents/InspectorScriptProfilerAgent.h: Ditto.

* inspector/scripts/codegen/cpp_generator.py:
(CppGenerator.cpp_type_for_unchecked_formal_in_parameter): Removed some bogus const.
(CppGenerator.cpp_type_for_type_with_name): Ditto.
(CppGenerator.cpp_type_for_formal_out_parameter): Use std::optional& instead of
Inspector::Protocol::OptOutput*.
(CppGenerator.cpp_type_for_formal_async_parameter): Ditto.
(CppGenerator.cpp_type_for_stack_in_parameter): Ditto.
(CppGenerator.cpp_type_for_stack_out_parameter): Ditto.

* inspector/scripts/codegen/cpp_generator_templates.py: Removed ASSERT_DISABLED
conditional around assertion code which will now compile to nothing if ASSERT is disabled.
Build strings more simply in a few cases.

* inspector/scripts/codegen/generate_cpp_backend_dispatcher_implementation.py:
(CppBackendDispatcherImplementationGenerator._generate_async_dispatcher_class_for_domain):
Use has_value instead of isAssigned and * operator instead of getValue() since std::optional
replace OptOutput here.
(CppBackendDispatcherImplementationGenerator._generate_dispatcher_implementation_for_command):
Pass by reference instead of pointer now.

* inspector/scripts/codegen/generate_cpp_protocol_types_header.py:
Removed ASSERT_DISABLED conditional around assertion code which will now compile to nothing
if ASSERT is disabled.

* inspector/scripts/codegen/generate_cpp_protocol_types_implementation.py:
(CppProtocolTypesImplementationGenerator._generate_assertion_for_object_declaration): Generate
the assertion function unconditionally, but leave out the assertions if ASSERT_DISABLED is true.
(CppProtocolTypesImplementationGenerator): Use auto instead of writing out JSON::Object::iterator.

* inspector/scripts/codegen/generate_objc_backend_dispatcher_implementation.py:
(ObjCBackendDispatcherImplementationGenerator._generate_conversions_for_command): Build strings
more simply.

* inspector/scripts/tests/generic/expected/commands-with-async-attribute.json-result:
* inspector/scripts/tests/generic/expected/commands-with-optional-call-return-parameters.json-result:
* inspector/scripts/tests/generic/expected/events-with-optional-parameters.json-result:
* inspector/scripts/tests/generic/expected/type-requiring-runtime-casts.json-result:
Rebaselined.

Source/WebCore:

* inspector/InspectorStyleSheet.cpp:
(WebCore::buildSourceRangeObject): Take a const Vector& instead of a Vector*.
(WebCore::InspectorStyle::buildObjectForStyle const): Pass lineEndings() instead
of lineEndings().get().
(WebCore::InspectorStyle::styleWithProperties const): Ditto.
(WebCore::InspectorStyleSheet::buildObjectForSelectorList): Ditto.
(WebCore::InspectorStyleSheet::lineEndings const): Return a Vector instead of
a std::unique_ptr<Vector>.
(WebCore::InspectorStyleSheetForInlineStyle::lineEndings const): Ditto.
* inspector/InspectorStyleSheet.h: Updated for the above.

* inspector/agents/InspectorCSSAgent.h: Removed some bogus const.
* inspector/agents/InspectorCanvasAgent.cpp: Ditto.
* inspector/agents/InspectorCanvasAgent.h: Ditto.

* inspector/agents/InspectorDOMDebuggerAgent.cpp: Improved type of global strings
so we don't waste space with a pointer to the string.
(WebCore::InspectorDOMDebuggerAgent::setEventListenerBreakpoint): Removed
explicit creation of String, which was wasteful and unnecessary.
(WebCore::InspectorDOMDebuggerAgent::setInstrumentationBreakpoint): Ditto.
(WebCore::InspectorDOMDebuggerAgent::removeEventListenerBreakpoint): Ditto.
(WebCore::InspectorDOMDebuggerAgent::removeInstrumentationBreakpoint): Ditto.
(WebCore::InspectorDOMDebuggerAgent::setXHRBreakpoint): Removed bogus const.

* inspector/agents/InspectorDOMDebuggerAgent.h: Removed bogus const and use
final instead of override.
* inspector/agents/InspectorPageAgent.cpp: Ditto.
* inspector/agents/InspectorPageAgent.h: Ditto.

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

20 months agoFlaky Test: imported/w3c/web-platform-tests/fetch/api/redirect/redirect-to-dataurl...
cdumez@apple.com [Fri, 16 Feb 2018 01:35:32 +0000 (01:35 +0000)]
Flaky Test: imported/w3c/web-platform-tests/fetch/api/redirect/redirect-to-dataurl-worker.html
https://bugs.webkit.org/show_bug.cgi?id=182270
<rdar://problem/36904314>

Reviewed by Antti Koivisto.

No new tests, already covered by existing tests that crash flakily on the bots.

* loader/ThreadableLoaderClientWrapper.h:
(WebCore::ThreadableLoaderClientWrapper::ThreadableLoaderClientWrapper):
isolate copy the initiator string as this object can be destroyed on a different thread. This was
causing the test to flakily crash as well when destroying ThreadLocalData.

* platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.h:
* platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm:
(scheduledWithCustomRunLoopMode):
(-[WebCoreResourceHandleAsOperationQueueDelegate callFunctionOnMainThread:]):
Fix thread safety issue in callFunctionOnMainThread. This function is called from a background thread
to get to the main thread. However, it relied on m_handle which would get nullified on the main thread
by detachHandle when the ResourceHandle is destroyed. Fix the issue by not relying on m_handle anymore.

(-[WebCoreResourceHandleAsOperationQueueDelegate initWithHandle:messageQueue:]):
(-[WebCoreResourceHandleAsOperationQueueDelegate connection:willSendRequest:redirectResponse:]):
(-[WebCoreResourceHandleAsOperationQueueDelegate connection:canAuthenticateAgainstProtectionSpace:]):
(-[WebCoreResourceHandleAsOperationQueueDelegate connection:didReceiveResponse:]):
(-[WebCoreResourceHandleAsOperationQueueDelegate connection:willCacheResponse:]):
- Go back to using autorelease() instead of get() for the returned objects to match the code pre-r224522.
- Dispatch the protectedSelf variables that were added in r227073 to the main thread to make sure we do
  not get destroyed on the background thread when protectedSelf is the last strong reference to self.
  Destroying the WebCoreResourceHandleAsOperationQueueDelegate on the background safe is unsafe due to
  its m_messageQueue data member which contains lambdas that may capture anything.
- Add a Lock to protect against detachHandle getting called on the main thread and nulling out
  m_handle / m_requestResult / m_cachedResponseResult while the background thread may be accessing
  them.

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

20 months agoMark imported/w3c/web-platform-tests/service-workers/service-worker/register-closed...
ryanhaddad@apple.com [Fri, 16 Feb 2018 01:19:57 +0000 (01:19 +0000)]
Mark imported/w3c/web-platform-tests/service-workers/service-worker/register-closed-window.https.html as flaky.
https://bugs.webkit.org/show_bug.cgi?id=182853

Unreviewed test gardening.

* platform/ios/TestExpectations:

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

20 months agoVersioning.
jmarcell@apple.com [Fri, 16 Feb 2018 00:45:12 +0000 (00:45 +0000)]
Versioning.

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

20 months ago[RenderTreeBuilder] Move RenderTableRow::addChild() to RenderTreeBuilder
zalan@apple.com [Fri, 16 Feb 2018 00:42:09 +0000 (00:42 +0000)]
[RenderTreeBuilder] Move RenderTableRow::addChild() to RenderTreeBuilder
https://bugs.webkit.org/show_bug.cgi?id=182838
<rdar://problem/37580762>

Reviewed by Antti Koivisto.

No change in functionality.

* rendering/RenderTableRow.cpp:
(WebCore::RenderTableRow::didInsertTableCell):
(WebCore::RenderTableRow::addChild): Deleted.
* rendering/RenderTableRow.h:
* rendering/updating/RenderTreeBuilder.cpp:
(WebCore::RenderTreeBuilder::insertChild):
(WebCore::RenderTreeBuilder::insertChildToRenderTableRow): Deleted.
* rendering/updating/RenderTreeBuilder.h:
* rendering/updating/RenderTreeBuilderTable.cpp:
(WebCore::RenderTreeBuilder::Table::insertChild):

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

20 months agoMark imported/w3c/web-platform-tests/XMLHttpRequest/event-upload-progress-crossorigin...
ryanhaddad@apple.com [Fri, 16 Feb 2018 00:38:43 +0000 (00:38 +0000)]
Mark imported/w3c/web-platform-tests/XMLHttpRequest/event-upload-progress-crossorigin.htm as flaky.
https://bugs.webkit.org/show_bug.cgi?id=182849

Unreviewed test gardening.

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

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

20 months agoSpeed up dSYM generation on build.webkit.org with -gline-tables-only
ap@apple.com [Fri, 16 Feb 2018 00:07:23 +0000 (00:07 +0000)]
Speed up dSYM generation on build.webkit.org with -gline-tables-only
https://bugs.webkit.org/show_bug.cgi?id=182841
rdar://problem/34579649

Reviewed by Aakash Jain.

Build speed and binary size improvements are so substantial that I'm willing to make
CI builds less suitable for debugging, which is not a common scenario anyway.
Crash logs will still have line numbers in them.

* BuildSlaveSupport/build.webkit.org-config/steps.py: (CompileWebKit.start):

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

20 months agoUnreviewed, roll out r228366 since it did not progress anything.
fpizlo@apple.com [Thu, 15 Feb 2018 23:38:15 +0000 (23:38 +0000)]
Unreviewed, roll out r228366 since it did not progress anything.

JSTests:

* stress/gc-error-stack.js: Removed.
* stress/no-gc-error-stack.js: Removed.

Source/JavaScriptCore:

* heap/Heap.cpp:
(JSC::Heap::finalizeUnconditionalFinalizers):
* runtime/ErrorInstance.cpp:
(JSC::ErrorInstance::visitChildren):
(JSC::ErrorInstance::finalizeUnconditionally): Deleted.
* runtime/ErrorInstance.h:
(JSC::ErrorInstance::stackTrace):
(JSC::ErrorInstance::subspaceFor): Deleted.
* runtime/Exception.cpp:
(JSC::Exception::visitChildren):
(JSC::Exception::finalizeUnconditionally): Deleted.
* runtime/Exception.h:
* runtime/StackFrame.cpp:
(JSC::StackFrame::visitChildren):
(JSC::StackFrame::isFinalizationCandidate): Deleted.
(JSC::StackFrame::finalizeUnconditionally): Deleted.
* runtime/StackFrame.h:
* runtime/VM.cpp:
(JSC::VM::VM):
* runtime/VM.h:

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

20 months ago[Web Animations] Ensure that changing the timing model updates styles synchronously
graouts@webkit.org [Thu, 15 Feb 2018 23:33:44 +0000 (23:33 +0000)]
[Web Animations] Ensure that changing the timing model updates styles synchronously
https://bugs.webkit.org/show_bug.cgi?id=182836

Reviewed by Dean Jackson.

LayoutTests/imported/w3c:

Update test expectations for progressions.

* web-platform-tests/css-timing-1/cubic-bezier-timing-functions-output-expected.txt:
* web-platform-tests/css-timing-1/frames-timing-functions-output-expected.txt:
* web-platform-tests/css-timing-1/step-timing-functions-output-expected.txt:
* web-platform-tests/css/css-multicol/multicol-gap-animation-001-expected.txt:
* web-platform-tests/web-animations/animation-model/animation-types/discrete-expected.txt:
* web-platform-tests/web-animations/animation-model/animation-types/visibility-expected.txt:
* web-platform-tests/web-animations/animation-model/keyframe-effects/effect-value-iteration-composite-operation-expected.txt:
* web-platform-tests/web-animations/animation-model/keyframe-effects/effect-value-transformed-distance-expected.txt:
* web-platform-tests/web-animations/interfaces/Animation/cancel-expected.txt:
* web-platform-tests/web-animations/interfaces/KeyframeEffect/iterationComposite-expected.txt:

Source/WebCore:

We did not invalidate the timing model when properties of an effect's timing object changed
and even when we did invalidate the timing model, we did not update styles on effect targets
synchronously, only scheduling such updates for the next animation frame.

In this patch we expose the effect on the timing object such that changing timing properties
can notify the effect of a change in the timing model, which can then be forwarded to the
animation (which already informs its timeline, if any).

Additionally, when an animation's timing model has changed, we now invalidate the effect, which
will update styles synchronously.

This produces a number of progressions in WPT tests.

* animation/AnimationEffectReadOnly.cpp:
(WebCore::AnimationEffectReadOnly::AnimationEffectReadOnly): Set the timing object's effect upon
effect construction.
(WebCore::AnimationEffectReadOnly::~AnimationEffectReadOnly): Set the timing object's effect to
null upon effect destruction.
(WebCore::AnimationEffectReadOnly::timingDidChange): Notify the animation (if any) that its timing
model changed following a change in the timing properties.
* animation/AnimationEffectReadOnly.h: Add a new virtual invalidate() method that subclasses can
override to implement invalidation behavior when the animation finds out its timing model changed.
* animation/AnimationEffectTimingReadOnly.cpp: Notify the effect when a property changes such
that it may notify its animation of a timing model change.
(WebCore::AnimationEffectTimingReadOnly::propertyDidChange):
(WebCore::AnimationEffectTimingReadOnly::setIterationStart):
(WebCore::AnimationEffectTimingReadOnly::setIterations):
(WebCore::AnimationEffectTimingReadOnly::setBindingsDuration):
(WebCore::AnimationEffectTimingReadOnly::setEasing):
(WebCore::AnimationEffectTimingReadOnly::setDelay):
(WebCore::AnimationEffectTimingReadOnly::setEndDelay):
(WebCore::AnimationEffectTimingReadOnly::setFill):
(WebCore::AnimationEffectTimingReadOnly::setIterationDuration):
(WebCore::AnimationEffectTimingReadOnly::setDirection):
* animation/AnimationEffectTimingReadOnly.h:
(WebCore::AnimationEffectTimingReadOnly::setEffect):
(WebCore::AnimationEffectTimingReadOnly::setBindingsDelay):
(WebCore::AnimationEffectTimingReadOnly::setBindingsEndDelay):
(WebCore::AnimationEffectTimingReadOnly::setDelay): Deleted.
(WebCore::AnimationEffectTimingReadOnly::setEndDelay): Deleted.
(WebCore::AnimationEffectTimingReadOnly::setFill): Deleted.
(WebCore::AnimationEffectTimingReadOnly::setIterationDuration): Deleted.
(WebCore::AnimationEffectTimingReadOnly::setDirection): Deleted.
* animation/AnimationTimeline.cpp: Rename animationTimingModelDidChange() to timingModelDidChange()
to align it with the new WebAnimation::timingModelDidChange() method.
(WebCore::AnimationTimeline::addAnimation):
(WebCore::AnimationTimeline::removeAnimation):
(WebCore::AnimationTimeline::setCurrentTime):
* animation/AnimationTimeline.h:
(WebCore::AnimationTimeline::timingModelDidChange):
(WebCore::AnimationTimeline::animationTimingModelDidChange): Deleted.
* animation/DocumentTimeline.cpp:
(WebCore::DocumentTimeline::timingModelDidChange):
(WebCore::DocumentTimeline::updateAnimations):
(WebCore::DocumentTimeline::animationTimingModelDidChange): Deleted.
* animation/DocumentTimeline.h:
* animation/KeyframeEffectReadOnly.cpp:
(WebCore::KeyframeEffectReadOnly::invalidate): Override the invalidate() method to perform a synchronous
style update in order to ensure that timing properties are accounted for right as they change.
* animation/KeyframeEffectReadOnly.h:
* animation/WebAnimation.cpp:
(WebCore::WebAnimation::timingModelDidChange): Invalidate the effect and notify the timeline of a timing
model change when an animation is notified that its timing model has changed.
(WebCore::WebAnimation::setStartTime):
* animation/WebAnimation.h:

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

20 months agoFix the build.
timothy_horton@apple.com [Thu, 15 Feb 2018 23:00:44 +0000 (23:00 +0000)]
Fix the build.

* platform/ios/KeyEventCodesIOS.h:

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

20 months ago[JSC] Remove monotonicallyIncreasingTime and currentTime
utatane.tea@gmail.com [Thu, 15 Feb 2018 22:34:16 +0000 (22:34 +0000)]
[JSC] Remove monotonicallyIncreasingTime and currentTime
https://bugs.webkit.org/show_bug.cgi?id=182793

Reviewed by Saam Barati.

We would like to drop monotonicallyIncreasingTime and currentTime from our tree by
replacing them with MonotonicTime and WallTime, which are well-typed alternatives,
compared to double.
This patch removes monotonicallyIncreasingTime and currentTime in JSC.

* b3/testb3.cpp:
(JSC::B3::testComplex):
* dfg/DFGPhase.h:
(JSC::DFG::runAndLog):
* dfg/DFGPlan.cpp:
(JSC::DFG::Plan::compileInThread):
(JSC::DFG::Plan::compileInThreadImpl):
* dfg/DFGPlan.h:
* dynbench.cpp:
(JSC::benchmarkImpl):
* heap/BlockDirectory.cpp:
(JSC::BlockDirectory::isPagedOut):
* heap/BlockDirectory.h:
* heap/FullGCActivityCallback.cpp:
(JSC::FullGCActivityCallback::doCollection):
* heap/Heap.cpp:
(JSC::Heap::isPagedOut):
(JSC::Heap::sweepSynchronously):
* heap/Heap.h:
* heap/MarkedSpace.cpp:
(JSC::MarkedSpace::isPagedOut):
* heap/MarkedSpace.h:
* inspector/agents/InspectorConsoleAgent.cpp:
(Inspector::InspectorConsoleAgent::startTiming):
(Inspector::InspectorConsoleAgent::stopTiming):
* inspector/agents/InspectorConsoleAgent.h:
* inspector/agents/InspectorRuntimeAgent.cpp:
(Inspector::InspectorRuntimeAgent::getRuntimeTypesForVariablesAtOffsets):
* jit/JIT.cpp:
(JSC::JIT::compileWithoutLinking):
(JSC::JIT::compileTimeStats):
* jit/JIT.h:
* jsc.cpp:
(StopWatch::start):
(StopWatch::stop):
(StopWatch::getElapsedMS):
(functionPreciseTime):
(runJSC):
* profiler/ProfilerDatabase.cpp:
(JSC::Profiler::Database::logEvent):
* profiler/ProfilerEvent.cpp:
(JSC::Profiler::Event::toJS const):
* profiler/ProfilerEvent.h:
(JSC::Profiler::Event::Event):
(JSC::Profiler::Event::time const):
* runtime/CodeCache.cpp:
(JSC::CodeCacheMap::pruneSlowCase):
* runtime/CodeCache.h:
(JSC::CodeCacheMap::CodeCacheMap):
(JSC::CodeCacheMap::prune):
* runtime/DateConstructor.cpp:
(JSC::callDate):
* runtime/TypeProfilerLog.cpp:
(JSC::TypeProfilerLog::processLogEntries):
* testRegExp.cpp:
(StopWatch::start):
(StopWatch::stop):
(StopWatch::getElapsedMS):

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

20 months agoResource Load Statistics: Make sure WebResourceLoadStatisticsStore::mergeWithDataFrom...
wilander@apple.com [Thu, 15 Feb 2018 21:50:14 +0000 (21:50 +0000)]
Resource Load Statistics: Make sure WebResourceLoadStatisticsStore::mergeWithDataFromDecoder() can ingest older plist versions and not reset the database
https://bugs.webkit.org/show_bug.cgi?id=182812
<rdar://problem/37511406>

Reviewed by Brent Fulgham.

Source/WebCore:

No new tests. Tested manually between versions of Safari.

* loader/ResourceLoadStatistics.cpp:
(WebCore::ResourceLoadStatistics::decode):
    Now only expects these fields for model version 11 or higher:
    - topFrameUniqueRedirectsTo
    - topFrameUniqueRedirectsFrom
    - subresourceUniqueRedirectsFrom
    - timesAccessedAsFirstPartyDueToUserInteraction
    - timesAccessedAsFirstPartyDueToStorageAccessAPI
* loader/ResourceLoadStatistics.h:

Source/WebKit:

* UIProcess/WebResourceLoadStatisticsStore.cpp:
(WebKit::WebResourceLoadStatisticsStore::mergeWithDataFromDecoder):
    Now does the following:
    - Logs when there is a model version mismatch.
    - Does not ingest statistics if the version on disk is newer than the supported one.
    - Does ingest statistics if the version on disk is older than the supported one.
    - Passes on the version found on disk to WebCore::ResourceLoadStatistics::decode().

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

20 months agoStop using EXCLUDED_SOURCE_FILE_NAMES for actual source files in WebCore
timothy_horton@apple.com [Thu, 15 Feb 2018 21:08:45 +0000 (21:08 +0000)]
Stop using EXCLUDED_SOURCE_FILE_NAMES for actual source files in WebCore
https://bugs.webkit.org/show_bug.cgi?id=182822

Reviewed by Dan Bernstein.

It's much easier to reason about things if xcconfigs don't apply extra
constraints to which source files actually build on a per-platform basis.
We should use #ifs instead like we usually do.

* Configurations/WebCore.xcconfig:
* Modules/geolocation/ios/GeolocationPositionIOS.mm:
* accessibility/ios/AccessibilityObjectIOS.mm:
* accessibility/mac/AXObjectCacheMac.mm:
* accessibility/mac/AccessibilityObjectMac.mm:
* accessibility/mac/WebAccessibilityObjectWrapperMac.h:
* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
* dom/DataTransferMac.mm:
* editing/ios/DictationCommandIOS.cpp:
* editing/ios/DictationCommandIOS.h:
* editing/ios/EditorIOS.mm:
* editing/ios/WebContentReaderIOS.mm:
* editing/mac/EditorMac.mm:
* editing/mac/WebContentReaderMac.mm:
* page/ios/EventHandlerIOS.mm:
* page/ios/FrameIOS.mm:
* page/mac/EventHandlerMac.mm:
* page/scrolling/ios/ScrollingCoordinatorIOS.h:
* page/scrolling/ios/ScrollingCoordinatorIOS.mm:
* page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.mm:
* platform/ThreadCheck.h:
* platform/audio/ios/AudioDestinationIOS.h:
* platform/audio/ios/AudioFileReaderIOS.h:
* platform/audio/ios/MediaSessionManagerIOS.h:
* platform/graphics/ios/DisplayRefreshMonitorIOS.h:
* platform/graphics/ios/DisplayRefreshMonitorIOS.mm:
* platform/graphics/ios/FontCacheIOS.mm:
* platform/graphics/ios/GraphicsContext3DIOS.h:
* platform/graphics/ios/IconIOS.mm:
* platform/graphics/mac/ColorMac.h:
* platform/graphics/mac/ColorMac.mm:
* platform/graphics/mac/DisplayRefreshMonitorMac.cpp:
* platform/graphics/mac/DisplayRefreshMonitorMac.h:
* platform/graphics/mac/IconMac.mm:
* platform/graphics/opengl/GraphicsContext3DOpenGLES.cpp:
* platform/ios/CursorIOS.cpp:
* platform/ios/DeviceMotionClientIOS.h:
* platform/ios/DeviceOrientationClientIOS.h:
* platform/ios/EventLoopIOS.mm:
* platform/ios/KeyEventCodesIOS.h:
* platform/ios/LowPowerModeNotifierIOS.mm:
* platform/ios/PasteboardIOS.mm:
* platform/ios/PlatformEventFactoryIOS.h:
* platform/ios/PlatformEventFactoryIOS.mm:
* platform/ios/PlatformPasteboardIOS.mm:
* platform/ios/PlatformScreenIOS.mm:
* platform/ios/PlatformSpeechSynthesizerIOS.mm:
* platform/ios/RemoteCommandListenerIOS.h:
* platform/ios/RemoteCommandListenerIOS.mm:
* platform/ios/SSLKeyGeneratorIOS.cpp:
* platform/ios/ScrollAnimatorIOS.h:
* platform/ios/ScrollAnimatorIOS.mm:
* platform/ios/ScrollViewIOS.mm:
* platform/ios/ScrollbarThemeIOS.h:
* platform/ios/ScrollbarThemeIOS.mm:
* platform/ios/SystemMemoryIOS.cpp:
* platform/ios/ThemeIOS.h:
* platform/ios/ThemeIOS.mm:
* platform/ios/TileControllerMemoryHandlerIOS.cpp:
* platform/ios/TileControllerMemoryHandlerIOS.h:
* platform/ios/UserAgentIOS.mm:
* platform/ios/ValidationBubbleIOS.mm:
* platform/ios/WidgetIOS.mm:
* platform/mac/CursorMac.mm:
* platform/mac/EventLoopMac.mm:
* platform/mac/LocalCurrentGraphicsContext.h:
* platform/mac/LocalCurrentGraphicsContext.mm:
* platform/mac/NSScrollerImpDetails.h:
* platform/mac/NSScrollerImpDetails.mm:
* platform/mac/PasteboardMac.mm:
* platform/mac/PlatformEventFactoryMac.h:
* platform/mac/PlatformEventFactoryMac.mm:
* platform/mac/PlatformPasteboardMac.mm:
* platform/mac/PlatformScreenMac.mm:
* platform/mac/PlatformSpeechSynthesizerMac.mm:
* platform/mac/SSLKeyGeneratorMac.mm:
* platform/mac/ScrollViewMac.mm:
* platform/mac/ScrollbarThemeMac.h:
* platform/mac/ScrollbarThemeMac.mm:
* platform/mac/ThemeMac.h:
* platform/mac/ThemeMac.mm:
* platform/mac/ThreadCheck.mm:
* platform/mac/UserAgentMac.mm:
* platform/mac/WebCoreView.h:
* platform/mac/WebCoreView.m:
* platform/mac/WidgetMac.mm:
* platform/mediastream/ios/CoreAudioCaptureSourceIOS.h:
* platform/network/ios/NetworkStateNotifierIOS.mm:
* platform/network/ios/WebCoreURLResponseIOS.h:
* platform/network/ios/WebCoreURLResponseIOS.mm:
* platform/network/mac/NetworkStateNotifierMac.cpp:

* Configurations/PAL.xcconfig:
* pal/system/Sound.cpp:
* pal/system/mac/SoundMac.mm:
* pal/text/KillRing.cpp:
* pal/text/mac/KillRingMac.mm:

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

20 months ago[RenderTreeBuilder] Move RenderTableSection::addChild() to RenderTreeBuilder
zalan@apple.com [Thu, 15 Feb 2018 21:06:53 +0000 (21:06 +0000)]
[RenderTreeBuilder] Move RenderTableSection::addChild() to RenderTreeBuilder
https://bugs.webkit.org/show_bug.cgi?id=182835
<rdar://problem/37579191>

Reviewed by Antti Koivisto.

No change in functionality.

* rendering/RenderTableSection.cpp:
(WebCore::RenderTableSection::willInsertTableRow):
(WebCore::RenderTableSection::addChild): Deleted.
* rendering/RenderTableSection.h:
* rendering/updating/RenderTreeBuilder.cpp:
(WebCore::RenderTreeBuilder::insertChild): Leftover from r228529.
(WebCore::RenderTreeBuilder::insertChildToRenderTable): Deleted. Leftover from r228529.
(WebCore::RenderTreeBuilder::insertChildToRenderTableSection): Deleted.
* rendering/updating/RenderTreeBuilder.h:
* rendering/updating/RenderTreeBuilderTable.cpp:
(WebCore::RenderTreeBuilder::Table::insertChild):

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

20 months ago[RenderTreeBuilder] Move RenderTable::addChild() to RenderTreeBuilder
zalan@apple.com [Thu, 15 Feb 2018 20:01:58 +0000 (20:01 +0000)]
[RenderTreeBuilder] Move RenderTable::addChild() to RenderTreeBuilder
https://bugs.webkit.org/show_bug.cgi?id=182832
<rdar://problem/37576362>

Reviewed by Antti Koivisto.

No change in functionality.

* rendering/RenderTable.cpp:
(WebCore::RenderTable::willInsertTableColumn):
(WebCore::RenderTable::willInsertTableSection):
(WebCore::RenderTable::addChild): Deleted.
* rendering/RenderTable.h:
* rendering/updating/RenderTreeBuilder.cpp:
(WebCore::RenderTreeBuilder::insertChild):
* rendering/updating/RenderTreeBuilderTable.cpp:
(WebCore::RenderTreeBuilder::Table::insertChild):

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

20 months agoUse std::make_unique instead of explicit calls to new and instead of writing create...
darin@apple.com [Thu, 15 Feb 2018 19:49:24 +0000 (19:49 +0000)]
Use std::make_unique instead of explicit calls to new and instead of writing create functions
https://bugs.webkit.org/show_bug.cgi?id=182821

Reviewed by Anders Carlsson.

* loader/LinkLoader.cpp:
(WebCore::createLinkPreloadResourceClient): Use std::make_unique insteadof create functions.

* loader/LinkPreloadResourceClients.h: Make constructors public, get rid of create functions,
make overrides be private and final, get rid of unnecessary public default virtual destructors
that the compiler will generate correctly without anything explicit.

* platform/encryptedmedia/clearkey/CDMClearKey.cpp:
(WebCore::CDMFactoryClearKey::createCDM): Use std::make_unique instead of std::unique_ptr/new.

* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::MediaPlayerPrivateAVFoundationObjC): Use
std::make_unique instead of calling a create function.
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::MediaPlayerPrivateMediaSourceAVFObjC): Ditto.
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::MediaPlayerPrivateMediaStreamAVFObjC): Ditto.

* platform/graphics/avfoundation/objc/VideoFullscreenLayerManager.h: Made the constructor
public and got rid of the create function.
* platform/graphics/avfoundation/objc/VideoFullscreenLayerManager.mm:
(WebCore::VideoFullscreenLayerManager::create): Deleted.

* rendering/GridTrackSizingAlgorithm.cpp:
(WebCore::GridTrackSizingAlgorithm::computeFlexFactorUnitSize const):
Use std::make_unique instead of std::unique_ptr/new.

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

20 months agoFinish unifying Apple Pay and Payment Request sources
aestes@apple.com [Thu, 15 Feb 2018 19:47:46 +0000 (19:47 +0000)]
Finish unifying Apple Pay and Payment Request sources
https://bugs.webkit.org/show_bug.cgi?id=182831

Reviewed by Keith Miller.

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

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

20 months agoUpdate TestExpectations for imported/w3c/web-platform-tests/2dcontext/imagebitmap...
ryanhaddad@apple.com [Thu, 15 Feb 2018 19:12:48 +0000 (19:12 +0000)]
Update TestExpectations for imported/w3c/web-platform-tests/2dcontext/imagebitmap/createImageBitmap tests.
https://bugs.webkit.org/show_bug.cgi?id=182833

Unreviewed test gardening.

* platform/mac/TestExpectations:

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

20 months agoHarfBuzzFace: rework cache entry reference holding
zandobersek@gmail.com [Thu, 15 Feb 2018 19:06:05 +0000 (19:06 +0000)]
HarfBuzzFace: rework cache entry reference holding
https://bugs.webkit.org/show_bug.cgi?id=182828

Reviewed by Michael Catanzaro.

Move the FaceCacheEntry and HarfBuzzFaceCache types into the
HarfBuzzFace class as CacheEntry and Cache, respectively. The Cache
singleton is also moved there.

In the HarfBuzzFace constructor, we now don't increase the CacheEntry
reference, but instead just keep a reference to that object through
a RefPtr<CacheEntry> object. We don't need to retrieve the hb_face_t
object and the glyph cache HashMap in the constructor anymore, we just
retrieve them when necessary through that CacheEntry reference.

In the destructor, that RefPtr<CacheEntry> object is nulled out before
the object in Cache is removed if that's where the final reference is
kept.

* platform/graphics/harfbuzz/HarfBuzzFace.cpp:
(WebCore::HarfBuzzFace::CacheEntry::CacheEntry):
(WebCore::HarfBuzzFace::CacheEntry::~CacheEntry):
(WebCore::HarfBuzzFace::cache):
(WebCore::HarfBuzzFace::HarfBuzzFace):
(WebCore::HarfBuzzFace::~HarfBuzzFace):
(WebCore::HarfBuzzFace::setScriptForVerticalGlyphSubstitution):
(WebCore::FaceCacheEntry::create): Deleted.
(WebCore::FaceCacheEntry::~FaceCacheEntry): Deleted.
(WebCore::FaceCacheEntry::face): Deleted.
(WebCore::FaceCacheEntry::glyphCache): Deleted.
(WebCore::FaceCacheEntry::FaceCacheEntry): Deleted.
(WebCore::harfBuzzFaceCache): Deleted.
* platform/graphics/harfbuzz/HarfBuzzFace.h:
(WebCore::HarfBuzzFace::CacheEntry::create):
(WebCore::HarfBuzzFace::CacheEntry::face):
(WebCore::HarfBuzzFace::CacheEntry::glyphCache):
* platform/graphics/harfbuzz/HarfBuzzFaceCairo.cpp:
(WebCore::harfBuzzGetGlyph):
(WebCore::HarfBuzzFace::createFont):

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

20 months agoFontPlatformData::harfBuzzFace() should return a reference
zandobersek@gmail.com [Thu, 15 Feb 2018 19:04:01 +0000 (19:04 +0000)]
FontPlatformData::harfBuzzFace() should return a reference
https://bugs.webkit.org/show_bug.cgi?id=182825

Reviewed by Carlos Garcia Campos.

Have FontPlatformData::harfBuzzFace() return a reference instead of a
pointer, given that the returned HarfBuzzFace object cannot be null.

Call-sites of FontPlatformData::harfBuzzFace() are adjusted.
OpenTypeMathData constructors are also changed to not rely on
preprocessor to correctly position the closing brace.

* platform/graphics/FontPlatformData.h:
* platform/graphics/freetype/FontPlatformDataFreeType.cpp:
(WebCore::FontPlatformData::harfBuzzFace const):
* platform/graphics/harfbuzz/ComplexTextControllerHarfBuzz.cpp:
(WebCore::ComplexTextController::collectComplexTextRunsForCharacters):
* platform/graphics/opentype/OpenTypeMathData.cpp:
(WebCore::OpenTypeMathData::OpenTypeMathData):

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

20 months ago[WebAuthN] Revisit the whole async model of task dispatching, timeout and aborting
jiewen_tan@apple.com [Thu, 15 Feb 2018 19:02:50 +0000 (19:02 +0000)]
[WebAuthN] Revisit the whole async model of task dispatching, timeout and aborting
https://bugs.webkit.org/show_bug.cgi?id=181946
<rdar://problem/37258262>

Reviewed by Chris Dumez.

Source/WebCore:

This patch changes the original async model from a work queue to IPC between WebProcess
and UIProcess. Since all authenticator operations must be handled in the UIProcess due
to sandboxing, this message passing IPC async model then surpasses the original multi
threading model. To cooperate that, a CredentialsMessenger class is then created and
all task dispatching code is moved thre.

As an improvement over existing code, static functions from PublicKeyCredential are
moved to AuthenticatorManager. AuthenticatorManager is made as a singleton such that
when static functions are called, they could reach the CredentialsMessenger to interact
with UIProccess. CredentialsMessenger and AuthenticatorManager are separated so later
on when other Credential types are created, they can reuse the same IPC messenger.

What's more, a mock CredentialsMessenger is then created to mock behaviors of UIProcess
for testing purpose.

Covered by existing tests.

* DerivedSources.make:
* Modules/credentialmanagement/BasicCredential.h:
* Modules/credentialmanagement/CredentialsContainer.cpp:
(WebCore::CredentialsContainer::CredentialsContainer):
(WebCore::CredentialsContainer::doesHaveSameOriginAsItsAncestors):
(WebCore::CredentialsContainer::get):
(WebCore::CredentialsContainer::isCreate):
(WebCore::CredentialsContainer::PendingPromise::PendingPromise): Deleted.
(WebCore::CredentialsContainer::dispatchTask): Deleted.
* Modules/credentialmanagement/CredentialsContainer.h:
(WebCore::CredentialsContainer::PendingPromise::create): Deleted.
* Modules/credentialmanagement/CredentialsMessenger.cpp: Added.
(WebCore::CredentialsMessenger::exceptionReply):
(WebCore::CredentialsMessenger::addCreationCompletionHandler):
(WebCore::CredentialsMessenger::takeCreationCompletionHandler):
(WebCore::CredentialsMessenger::addRequestCompletionHandler):
(WebCore::CredentialsMessenger::takeRequestCompletionHandler):
(WebCore::CredentialsMessenger::addQueryCompletionHandler):
(WebCore::CredentialsMessenger::takeQueryCompletionHandler):
(WebCore::getIdFromAttestationObject):
* Modules/credentialmanagement/CredentialsMessenger.h: Added.
(WebCore::CreationReturnBundle::CreationReturnBundle):
(WebCore::AssertionReturnBundle::AssertionReturnBundle):
(WebCore::CredentialsMessenger::weakPtrFactory const):
* Modules/webauthn/Authenticator.cpp: Removed.
* Modules/webauthn/Authenticator.h: Removed.
* Modules/webauthn/AuthenticatorManager.cpp: Copied from Source/WebCore/Modules/webauthn/PublicKeyCredential.cpp.
(WebCore::AuthenticatorManagerInternal::produceClientDataJson):
(WebCore::AuthenticatorManagerInternal::produceClientDataJsonHash):
(WebCore::AuthenticatorManagerInternal::initTimer):
(WebCore::AuthenticatorManagerInternal::didTimerFire):
(WebCore::AuthenticatorManager::singleton):
(WebCore::AuthenticatorManager::setMessenger):
(WebCore::AuthenticatorManager::create const):
(WebCore::AuthenticatorManager::discoverFromExternalSource const):
* Modules/webauthn/AuthenticatorManager.h: Copied from Source/WebCore/Modules/webauthn/AuthenticatorResponse.h.
* Modules/webauthn/AuthenticatorResponse.h:
* Modules/webauthn/PublicKeyCredential.cpp:
(WebCore::PublicKeyCredentialInternal::produceClientDataJson): Deleted.
(WebCore::PublicKeyCredentialInternal::produceClientDataJsonHash): Deleted.
(WebCore::PublicKeyCredentialInternal::getIdFromAttestationObject): Deleted.
(WebCore::PublicKeyCredential::collectFromCredentialStore): Deleted.
(WebCore::PublicKeyCredential::discoverFromExternalSource): Deleted.
(WebCore::PublicKeyCredential::store): Deleted.
(WebCore::PublicKeyCredential::create): Deleted.
(WebCore::PublicKeyCredential::rawId const): Deleted.
(WebCore::PublicKeyCredential::response const): Deleted.
* Modules/webauthn/PublicKeyCredential.h:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* testing/Internals.cpp:
(WebCore::Internals::Internals):
(WebCore::Internals::mockCredentialsMessenger const):
* testing/Internals.h:
* testing/Internals.idl:
* testing/MockCredentialsMessenger.cpp: Added.
(WebCore::MockCredentialsMessenger::MockCredentialsMessenger):
(WebCore::MockCredentialsMessenger::~MockCredentialsMessenger):
(WebCore::MockCredentialsMessenger::setAttestationObject):
(WebCore::MockCredentialsMessenger::setAssertionReturnBundle):
(WebCore::MockCredentialsMessenger::makeCredential):
(WebCore::MockCredentialsMessenger::getAssertion):
(WebCore::MockCredentialsMessenger::makeCredentialReply):
(WebCore::MockCredentialsMessenger::getAssertionReply):
* testing/MockCredentialsMessenger.h: Copied from Source/WebCore/Modules/webauthn/AuthenticatorResponse.h.
* testing/MockCredentialsMessenger.idl: Copied from Source/WebCore/Modules/webauthn/AuthenticatorResponse.h.

Source/WebKit:

Dummy WebCredentialsMessenger and WebCredentialsMessengerProxy are crafted to establish
a message exchange channel between UIProcess and WebProcess.

* DerivedSources.make:
* UIProcess/CredentialManagement/WebCredentialsMessengerProxy.cpp: Copied from Source/WebCore/Modules/webauthn/AuthenticatorResponse.h.
(WebKit::WebCredentialsMessengerProxy::WebCredentialsMessengerProxy):
(WebKit::WebCredentialsMessengerProxy::~WebCredentialsMessengerProxy):
(WebKit::WebCredentialsMessengerProxy::makeCredential):
(WebKit::WebCredentialsMessengerProxy::getAssertion):
* UIProcess/CredentialManagement/WebCredentialsMessengerProxy.h: Copied from Source/WebCore/Modules/webauthn/AuthenticatorResponse.h.
* UIProcess/CredentialManagement/WebCredentialsMessengerProxy.messages.in: Added.
* UIProcess/WebPageProxy.cpp:
(WebKit::m_configurationPreferenceValues):
(WebKit::WebPageProxy::reattachToWebProcess):
(WebKit::WebPageProxy::resetState):
* UIProcess/WebPageProxy.h:
* WebKit.xcodeproj/project.pbxproj:
* WebProcess/CredentialManagement/WebCredentialsMessenger.cpp: Copied from Source/WebCore/Modules/webauthn/AuthenticatorResponse.h.
(WebKit::WebCredentialsMessenger::WebCredentialsMessenger):
(WebKit::WebCredentialsMessenger::~WebCredentialsMessenger):
(WebKit::WebCredentialsMessenger::makeCredential):
(WebKit::WebCredentialsMessenger::getAssertion):
(WebKit::WebCredentialsMessenger::makeCredentialReply):
(WebKit::WebCredentialsMessenger::getAssertionReply):
* WebProcess/CredentialManagement/WebCredentialsMessenger.h: Copied from Source/WebCore/Modules/webauthn/AuthenticatorResponse.h.
* WebProcess/CredentialManagement/WebCredentialsMessenger.messages.in: Added.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::m_credentialsMessenger):
(WebKit::m_cpuLimit): Deleted.
* WebProcess/WebPage/WebPage.h:

LayoutTests:

* http/wpt/credential-management/credentialscontainer-store-basics.https.html:
* http/wpt/webauthn/idl.https.html:
* http/wpt/webauthn/public-key-credential-create-failure.https.html:
* http/wpt/webauthn/public-key-credential-create-success.https.html:
* http/wpt/webauthn/public-key-credential-get-failure.https.html:
* http/wpt/webauthn/public-key-credential-get-success.https.html:
* http/wpt/webauthn/resources/util.js:

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

20 months ago[WPE] Unify build of platform-specific files in WebKit layer
mcatanzaro@igalia.com [Thu, 15 Feb 2018 18:47:52 +0000 (18:47 +0000)]
[WPE] Unify build of platform-specific files in WebKit layer
https://bugs.webkit.org/show_bug.cgi?id=182696

Reviewed by Žan Doberšek.

This is easy, because all needed changes were made in the previously-landed patch.

* CMakeLists.txt:
* PlatformWPE.cmake:

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

20 months agoWebCore headers should not be included relatively within dependent projects
don.olmstead@sony.com [Thu, 15 Feb 2018 18:42:02 +0000 (18:42 +0000)]
WebCore headers should not be included relatively within dependent projects
https://bugs.webkit.org/show_bug.cgi?id=182805

Reviewed by Chris Dumez.

Source/WebKit:

* NetworkProcess/capture/NetworkCaptureManager.cpp:
* NetworkProcess/webrtc/NetworkRTCMonitor.h:
* Shared/gtk/WebEventFactory.cpp:
* UIProcess/API/gtk/PageClientImpl.cpp:
* UIProcess/API/gtk/WebKitWebViewBase.cpp:
* UIProcess/gtk/WebPageProxyGtk.cpp:
* WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp:
* WebProcess/WebCoreSupport/gtk/WebEditorClientGtk.cpp:
* WebProcess/WebCoreSupport/wpe/WebEditorClientWPE.cpp:
* WebProcess/WebPage/gtk/WebPageGtk.cpp:
* WebProcess/WebPage/wpe/WebPageWPE.cpp:

Source/WebKitLegacy/win:

* FullscreenVideoController.h:

Tools:

* TestWebKitAPI/win/TestWebCoreStubs.cpp:
* WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp:
* WebKitTestRunner/InjectedBundle/wpe/AccessibilityControllerWPE.cpp:
* WebKitTestRunner/InjectedBundle/wpe/AccessibilityUIElementWPE.cpp:
* WebKitTestRunner/gtk/EventSenderProxyGtk.cpp:
* WebKitTestRunner/wpe/EventSenderProxyWPE.cpp:

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

20 months ago[RenderTreeBuilder] Move RenderInline/RenderGrid::addChild() to RenderTreeBuilder
zalan@apple.com [Thu, 15 Feb 2018 18:25:05 +0000 (18:25 +0000)]
[RenderTreeBuilder] Move RenderInline/RenderGrid::addChild() to RenderTreeBuilder
https://bugs.webkit.org/show_bug.cgi?id=182819
<rdar://problem/37558187>

Reviewed by Antti Koivisto.

No change in functionality.

* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::addChild): Deleted.
* rendering/RenderGrid.h:
* rendering/RenderInline.cpp:
(WebCore::RenderInline::addChild): Deleted.
* rendering/RenderInline.h:
* rendering/updating/RenderTreeBuilder.cpp:
(WebCore::RenderTreeBuilder::insertChild):
(WebCore::RenderTreeBuilder::takeChild): Deleted.
* rendering/updating/RenderTreeBuilder.h:
* rendering/updating/RenderTreeBuilderRuby.cpp:
(WebCore::RenderTreeBuilder::Ruby::findOrCreateParentForChild):
* rendering/updating/RenderTreeBuilderSVG.cpp:
(WebCore::RenderTreeBuilder::SVG::insertChild):

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

20 months ago[Modern Media Controls] REGRESSION: Inline media controls are not disabled while...
commit-queue@webkit.org [Thu, 15 Feb 2018 18:03:55 +0000 (18:03 +0000)]
[Modern Media Controls] REGRESSION: Inline media controls are not disabled while in fullscreen on iOS
https://bugs.webkit.org/show_bug.cgi?id=182830
<rdar://problem/37537909>

Patch by Antoine Quint <graouts@apple.com> on 2018-02-15
Reviewed by Eric Carlson.

The test media/modern-media-controls/media-controller/ios/media-controller-stop-updates-in-fullscreen.html
regressed when fixing webkit.org/b/182668 since we now started only caring about the presence of the "controls"
attribute to identify that WebKit media controls should be available.

We now have a dedicated _shouldControlsBeAvailable() method which more clearly establishes the conditions under
which controls should be available and correctly disables them while in fullscreen on iOS, regardless of the
"controls" attribute value.

* Modules/modern-media-controls/media/media-controller.js:
(MediaController.prototype._shouldControlsBeAvailable):
(MediaController.prototype._updateControlsAvailability):

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

20 months agoUnreviewed, rolling out r228495.
jlewis3@apple.com [Thu, 15 Feb 2018 17:19:23 +0000 (17:19 +0000)]
Unreviewed, rolling out r228495.

This caused mulitple perf tests to fail consistently.

Reverted changeset:

"Resource Load Statistics: Make sure
WebResourceLoadStatisticsStore::mergeWithDataFromDecoder() can
ingest older plist versions and not reset the database"
https://bugs.webkit.org/show_bug.cgi?id=182812
https://trac.webkit.org/changeset/228495

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

20 months agoMany stress tests fail with JIT disabled
tpopela@redhat.com [Thu, 15 Feb 2018 16:49:49 +0000 (16:49 +0000)]
Many stress tests fail with JIT disabled
https://bugs.webkit.org/show_bug.cgi?id=182730

Reviewed by Saam Barati.

These tests are broken by design if the JIT is disabled - they test
the return value of numberOfDFGCompiles(), which is always set to
1000000.0 in TestRunnerUtils.cpp and makes the tests to fail.

* stress/arith-abs-on-various-types.js:
* stress/arith-abs-to-arith-negate-range-optimizaton.js:
* stress/arith-acos-on-various-types.js:
* stress/arith-acosh-on-various-types.js:
* stress/arith-asin-on-various-types.js:
* stress/arith-asinh-on-various-types.js:
* stress/arith-atan-on-various-types.js:
* stress/arith-atanh-on-various-types.js:
* stress/arith-cbrt-on-various-types.js:
* stress/arith-ceil-on-various-types.js:
* stress/arith-clz32-on-various-types.js:
* stress/arith-cos-on-various-types.js:
* stress/arith-cosh-on-various-types.js:
* stress/arith-expm1-on-various-types.js:
* stress/arith-floor-on-various-types.js:
* stress/arith-fround-on-various-types.js:
* stress/arith-log-on-various-types.js:
* stress/arith-log10-on-various-types.js:
* stress/arith-log2-on-various-types.js:
* stress/arith-negate-on-various-types.js:
* stress/arith-round-on-various-types.js:
* stress/arith-sin-on-various-types.js:
* stress/arith-sinh-on-various-types.js:
* stress/arith-sqrt-on-various-types.js:
* stress/arith-tan-on-various-types.js:
* stress/arith-tanh-on-various-types.js:
* stress/arith-trunc-on-various-types.js:
* stress/compare-strict-eq-on-various-types.js:

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

20 months agorun-jsc-stress-tests - skip a test if any of the run commands evals to skip
tpopela@redhat.com [Thu, 15 Feb 2018 16:49:01 +0000 (16:49 +0000)]
run-jsc-stress-tests - skip a test if any of the run commands evals to skip
https://bugs.webkit.org/show_bug.cgi?id=182729

If multiple run commands are specified and one of them evals to skip,
then the test is not skipped, because the run is scheduled while
evaluating other commands.

Remember if the test is going to be skipped - if yes, just stop
evaluating the other run commands.

Reviewed by Saam Barati.

* Scripts/run-jsc-stress-tests:

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

20 months agoClean up HarfBuzzFaceCairo
zandobersek@gmail.com [Thu, 15 Feb 2018 10:12:38 +0000 (10:12 +0000)]
Clean up HarfBuzzFaceCairo
https://bugs.webkit.org/show_bug.cgi?id=182824

Reviewed by Carlos Garcia Campos.

Clean up Cairo-specific bits of HarfBuzzFace implementation.

HarfBuzzFontData is simplified, removing the constructor and turning the
cairo_scaled_font_t member into a RefPtr<>, tying the Cairo object's
lifetime to the lifetime of the HarfBuzzFontData instance.

HarfBuzz font callbacks have the HarfBuzzFontData casting cleaned up,
casting the user data pointer straight into a HarfBuzzFontData reference
that's then used in the functions. HarfBuzzFontData member access is
also adjusted.

HarfBuzzFace::createFace() now references the cairo_scaled_font_t object
that is then set as the user data pointer, with the destroy callback
that dereferences that object also specified. With hb_face_t being a
reference-counted object itself, this ensures the cairo_scaled_font_t
object doesn't get destroyed while hb_face_t is still alive.

In HarfBuzzFace::createFont(), the hb_font_t creation is cleaned up,
with a C++ lambda used as the destroy callback.

* platform/graphics/harfbuzz/HarfBuzzFaceCairo.cpp:
(WebCore::harfBuzzGetGlyph):
(WebCore::harfBuzzGetGlyphHorizontalAdvance):
(WebCore::harfBuzzGetGlyphExtents):
(WebCore::harfBuzzCairoGetTable):
(WebCore::HarfBuzzFace::createFace):
(WebCore::HarfBuzzFace::createFont):
(WebCore::HarfBuzzFontData::HarfBuzzFontData): Deleted.
(WebCore::destroyHarfBuzzFontData): Deleted.

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

20 months ago[GStreamer] WebVTT caps changed in GStreamer 1.14
philn@webkit.org [Thu, 15 Feb 2018 10:11:26 +0000 (10:11 +0000)]
[GStreamer] WebVTT caps changed in GStreamer 1.14
https://bugs.webkit.org/show_bug.cgi?id=182690

Reviewed by Xabier Rodriguez-Calvar.

* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::createGSTPlayBin): Use
text/vtt caps only for GStreamer versions inferior or equal to
1.12. In 1.13 (current git master) the VTT caps format changed to
application/x-subtitle-vtt.

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

20 months agoHarfBuzzFace should not be ref-counted
zandobersek@gmail.com [Thu, 15 Feb 2018 10:10:21 +0000 (10:10 +0000)]
HarfBuzzFace should not be ref-counted
https://bugs.webkit.org/show_bug.cgi?id=182823

Reviewed by Carlos Garcia Campos.

The HarfBuzzFace objects shouldn't be copied along in FontPlatformData
copy assignment operator, which made it a requirement for that class to
be ref-counted. Cairo-based HarfBuzzFace implementation uses the
cairo_scaled_font_t object from FontPlatformData internally, but upon
FontPlatformData cloning that scaled font object could change, meaning
HarfBuzzFace object that's shared with another FontPlatformData object
would end up using a different cairo_scaled_font_t object from the one
that's been regenerated in the newly-cloned FontPlatformData object.

Instead of ref-counting the HarfBuzzFace objects, they should be handled
in FontPlatformData through std::unique_ptr<>. In the FontPlatformData
copy assignment operator, the copy target's m_harfBuzzFace object is
nulled out, allowing the next harfBuzzFace() call to construct an
object that properly leverages the cairo_scaled_font_t object that could
have changed during cloning.

* platform/graphics/FontPlatformData.h:
* platform/graphics/freetype/FontPlatformDataFreeType.cpp:
(WebCore::FontPlatformData::operator=):
(WebCore::FontPlatformData::harfBuzzFace const):
* platform/graphics/harfbuzz/HarfBuzzFace.h:
(WebCore::HarfBuzzFace::create): Deleted.

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

20 months ago[RenderTreeBuilder] Move RenderMathMLFenced::addChild() to RenderTreeBuilder
zalan@apple.com [Thu, 15 Feb 2018 03:41:57 +0000 (03:41 +0000)]
[RenderTreeBuilder] Move RenderMathMLFenced::addChild() to RenderTreeBuilder
https://bugs.webkit.org/show_bug.cgi?id=182817
<rdar://problem/37556761>

Reviewed by Antti Koivisto.

No change in functionality.

* rendering/mathml/RenderMathMLFenced.cpp:
(WebCore::RenderMathMLFenced::addChild): Deleted.
* rendering/mathml/RenderMathMLFenced.h:
* rendering/updating/RenderTreeBuilder.cpp:
(WebCore::RenderTreeBuilder::insertChild):
(WebCore::RenderTreeBuilder::insertChildToRenderMathMLFenced): Deleted.
* rendering/updating/RenderTreeBuilder.h:
* rendering/updating/RenderTreeBuilderMathML.cpp:
(WebCore::RenderTreeBuilder::MathML::insertChild):

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

20 months agoDefault definition of InjectedBundle::PlatformBundle should not be Windows-specific.
ross.kirsling@sony.com [Thu, 15 Feb 2018 02:55:57 +0000 (02:55 +0000)]
Default definition of InjectedBundle::PlatformBundle should not be Windows-specific.
https://bugs.webkit.org/show_bug.cgi?id=182810

Reviewed by Michael Catanzaro.

This branch was added in r228455, but should not be limited to OS(WINDOWS).

* WebProcess/InjectedBundle/InjectedBundle.h:

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

20 months agoGet Garden-O-Matic running again.
cturner@igalia.com [Thu, 15 Feb 2018 02:52:50 +0000 (02:52 +0000)]
Get Garden-O-Matic running again.
https://bugs.webkit.org/show_bug.cgi?id=179089

Reviewed by Carlos Alberto Lopez Perez.

* BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/Trac.js:
(parseCommitData): Author field is not always spelled 'author' these days.
* BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/config.js:
No longer have a 32-bit builder.
* BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/ui/perf.js:
(ui.perf.View.base.init): createElement has a required parameter these days.
* Scripts/webkitpy/tool/commands/gardenomatic.py:
(GardenOMatic): Override use_globs so that platform lookup in config.js works.

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

20 months agoWe should be able to jsDynamicCast from JSType when possible
keith_miller@apple.com [Thu, 15 Feb 2018 02:08:41 +0000 (02:08 +0000)]
We should be able to jsDynamicCast from JSType when possible
https://bugs.webkit.org/show_bug.cgi?id=182804

Reviewed by Filip Pizlo and Mark Lam.

This patch beefs up jsDynamicCast in some of the cases where we
can use the JSType to quickly determine if a cell is a subclass of
the desired type. Since all JSCells have a range of JSTypes they support,
if there is a range exclusive to a class and all subclasses we can use
that range to quickly determine if the cast should be successful.

Additionally, the JSValue versions of jsCast and jsDynamicCast now
call the JSCell version after checking the value is a cell.

Finally, the casting functions have been moved to a new header,
JSCast.h

* JavaScriptCore.xcodeproj/project.pbxproj:
* bytecode/CallVariant.h:
* bytecode/CodeBlock.h:
* bytecode/ExecutableToCodeBlockEdge.h:
* bytecode/TrackedReferences.h:
* bytecode/UnlinkedCodeBlock.h:
* bytecode/UnlinkedFunctionExecutable.h:
* dfg/DFGAbstractValue.h:
* dfg/DFGCommonData.h:
* dfg/DFGFrozenValue.h:
* dfg/DFGStructureAbstractValue.h:
* heap/CellContainerInlines.h:
* heap/ConservativeRoots.cpp:
* heap/GCLogging.cpp:
* heap/HeapInlines.h:
* heap/HeapSnapshotBuilder.cpp:
* heap/MarkedBlock.cpp:
* heap/MarkedBlockInlines.h:
* heap/SubspaceInlines.h:
* heap/WeakInlines.h:
* jit/JITOpcodes.cpp:
* jit/JITOpcodes32_64.cpp:
* llint/LLIntOffsetsExtractor.cpp:
* runtime/ArrayBufferNeuteringWatchpoint.h:
* runtime/BigIntPrototype.cpp:
* runtime/ClassInfo.h:
* runtime/CustomGetterSetter.h:
* runtime/FunctionRareData.h:
* runtime/GetterSetter.h:
* runtime/InferredType.h:
* runtime/InferredTypeTable.h:
* runtime/InferredValue.h:
* runtime/InternalFunction.cpp:
(JSC::InternalFunction::finishCreation):
* runtime/JSAPIValueWrapper.h:
* runtime/JSArray.h:
(JSC::JSArray::finishCreation):
* runtime/JSArrayBufferView.cpp:
(JSC::JSArrayBufferView::finishCreation):
* runtime/JSCast.h: Added.
(JSC::jsCast):
(JSC::JSCastingHelpers::jsDynamicCastGenericImpl):
(JSC::JSCastingHelpers::jsDynamicCastJSTypeImpl):
(JSC::JSCastingHelpers::JSDynamicCastTraits::cast):
(JSC::jsDynamicCast):
* runtime/JSCell.cpp:
* runtime/JSCell.h:
(JSC::jsCast): Deleted.
(JSC::jsDynamicCast): Deleted.
* runtime/JSCellInlines.h:
* runtime/JSFunction.cpp:
(JSC::JSFunction::finishCreation):
* runtime/JSJob.h:
* runtime/JSObject.h:
(JSC::JSObject::finishCreation):
* runtime/JSPromiseDeferred.h:
* runtime/JSPropertyNameEnumerator.h:
* runtime/NativeStdFunctionCell.h:
* runtime/ScopedArgumentsTable.h:
* runtime/SparseArrayValueMap.h:
* runtime/Structure.h:
* runtime/StructureChain.h:
* runtime/StructureRareData.h:
* tools/CellProfile.h:
* wasm/js/JSWebAssemblyCodeBlock.h:

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

20 months agoSkip stress/new-largeish-contiguous-array-with-size.js on arm.
ryanhaddad@apple.com [Thu, 15 Feb 2018 01:58:44 +0000 (01:58 +0000)]
Skip stress/new-largeish-contiguous-array-with-size.js on arm.

Unreviewed test gardening.

* stress/new-largeish-contiguous-array-with-size.js:

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

20 months agoRemove unused ForwardingHeaders directories from Tools
don.olmstead@sony.com [Thu, 15 Feb 2018 01:40:33 +0000 (01:40 +0000)]
Remove unused ForwardingHeaders directories from Tools
https://bugs.webkit.org/show_bug.cgi?id=182813

Reviewed by Konstantin Tokarev.

* DumpRenderTree/ForwardingHeaders/runtime/ArrayBufferView.h: Removed.
* DumpRenderTree/ForwardingHeaders/runtime/JSArrayBufferView.h: Removed.
* DumpRenderTree/ForwardingHeaders/runtime/JSExportMacros.h: Removed.
* DumpRenderTree/ForwardingHeaders/runtime/TypedArrayInlines.h: Removed.
* TestWebKitAPI/ForwardingHeaders/WebCore/LayoutUnit.h: Removed.

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

20 months agoDo sibling invalidation on mutation
antti@apple.com [Thu, 15 Feb 2018 01:27:52 +0000 (01:27 +0000)]
Do sibling invalidation on mutation
https://bugs.webkit.org/show_bug.cgi?id=182809

Reviewed by Zalan Bujtas.

Source/WebCore:

We used to invalidate siblings for sibling combinators and nth-pseudo classes during style resolution tree walk.
This would consider any element with invalid style a reason to invalidate siblings too. However we now do
accurate invalidation on class and attribute changes and this approach ends up invalidating too much.

This patch sibling style invalidation to mutation time and removes invalidation code from style resolution tree walk.

* dom/Element.cpp:
(WebCore::invalidateSiblingsIfNeeded):

    Helper to invalidate siblings.

(WebCore::Element::invalidateStyle):
(WebCore::Element::invalidateStyleAndLayerComposition):
(WebCore::Element::invalidateStyleForSubtree):
(WebCore::Element::invalidateStyleAndRenderersForSubtree):

    Invalidate siblings if needed based on affectsNextSibling/affectedByPreviousSibling bits.

(WebCore::Element::invalidateStyleInternal):
(WebCore::Element::invalidateStyleForSubtreeInternal):

    Add "internal" versions that don't invalidate siblings. These are used by StyleInvalidator for accurate invalidation.

* dom/Element.h:
* style/StyleInvalidator.cpp:
(WebCore::Style::Invalidator::invalidateIfNeeded):
(WebCore::Style::Invalidator::invalidateStyle):

    Use internal invalidation functions.

* style/StyleTreeResolver.cpp:
(WebCore::Style::resetStyleForNonRenderedDescendants):
(WebCore::Style::TreeResolver::resolveComposedTree):

    Remove sibling invalidation.

* style/StyleTreeResolver.h:

LayoutTests:

Sibling invalidation now happens on mutation. Update the tests.

* fast/css/indirect-adjacent-style-invalidation-1-expected.txt:
* fast/css/indirect-adjacent-style-invalidation-1.html:
* fast/css/indirect-adjacent-style-invalidation-2-expected.txt:
* fast/css/indirect-adjacent-style-invalidation-2.html:
* fast/css/indirect-adjacent-style-invalidation-3-expected.txt:
* fast/css/indirect-adjacent-style-invalidation-3.html:

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

20 months agoDefault implementations of nativeEvent() should be platform-agnostic.
ross.kirsling@sony.com [Thu, 15 Feb 2018 01:02:41 +0000 (01:02 +0000)]
Default implementations of nativeEvent() should be platform-agnostic.
https://bugs.webkit.org/show_bug.cgi?id=182806

Reviewed by Darin Adler.

* Shared/NativeWebKeyboardEvent.h:
* Shared/NativeWebMouseEvent.h:
* Shared/NativeWebWheelEvent.h:

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

20 months agoResource Load Statistics: Make sure WebResourceLoadStatisticsStore::mergeWithDataFrom...
wilander@apple.com [Thu, 15 Feb 2018 00:52:29 +0000 (00:52 +0000)]
Resource Load Statistics: Make sure WebResourceLoadStatisticsStore::mergeWithDataFromDecoder() can ingest older plist versions and not reset the database
https://bugs.webkit.org/show_bug.cgi?id=182812
<rdar://problem/37511406>

Reviewed by Brent Fulgham.

Source/WebCore:

No new tests. Tested manually between versions of Safari.

* loader/ResourceLoadStatistics.cpp:
(WebCore::ResourceLoadStatistics::decode):
    Now only expects these fields for model version 11 or higher:
    - topFrameUniqueRedirectsTo
    - topFrameUniqueRedirectsFrom
    - subresourceUniqueRedirectsFrom
    - timesAccessedAsFirstPartyDueToUserInteraction
    - timesAccessedAsFirstPartyDueToStorageAccessAPI
* loader/ResourceLoadStatistics.h:

Source/WebKit:

* UIProcess/WebResourceLoadStatisticsStore.cpp:
(WebKit::WebResourceLoadStatisticsStore::mergeWithDataFromDecoder):
    Now does the following:
    - Logs when there is a model version mismatch.
    - Does not ingest statistics if the version on disk is newer than the supported one.
    - Does ingest statistics if the version on disk is older than the supported one.
    - Passes on the version found on disk to WebCore::ResourceLoadStatistics::decode().

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

20 months ago[WinCairo] Fix several build warnings under WebCore/platform
commit-queue@webkit.org [Thu, 15 Feb 2018 00:13:56 +0000 (00:13 +0000)]
[WinCairo] Fix several build warnings under WebCore/platform
https://bugs.webkit.org/show_bug.cgi?id=182802

Patch by Basuke Suzuki <Basuke.Suzuki@sony.com> on 2018-02-14
Reviewed by Konstantin Tokarev.

Warning C4101 'fileModificationDate': unreferenced local variable
        Source\WebCore\platform\network\curl\CurlCacheEntry.cpp:279

Warning C4239 nonstandard extension used: 'argument': conversion from 'WTF::String'
to 'WTF::String &'
        Source\WebCore\platform\text\win\LocaleWin.cpp:75
        Source\WebCore\platform\text\win\LocaleWin.cpp:77

Warning C4838 conversion from 'UINT' to 'CLIPFORMAT' requires a narrowing conversion
        Source\WebCore\platform\win\ClipboardUtilitiesWin.cpp:170
        Source\WebCore\platform\win\ClipboardUtilitiesWin.cpp:325
        Source\WebCore\platform\win\ClipboardUtilitiesWin.cpp:332
        Source\WebCore\platform\win\ClipboardUtilitiesWin.cpp:351
        Source\WebCore\platform\win\ClipboardUtilitiesWin.cpp:358
        Source\WebCore\platform\win\ClipboardUtilitiesWin.cpp:366
        Source\WebCore\platform\win\ClipboardUtilitiesWin.cpp:373
        Source\WebCore\platform\win\ClipboardUtilitiesWin.cpp:380
        Source\WebCore\platform\win\ClipboardUtilitiesWin.cpp:387

* platform/network/curl/CurlCacheEntry.cpp:
(WebCore::CurlCacheEntry::parseResponseHeaders):
* platform/text/win/LocaleWin.cpp:
(WebCore::LCIDFromLocaleInternal):
* platform/win/ClipboardUtilitiesWin.cpp:
(WebCore::registerClipboardFormat):
(WebCore::texthtmlFormat):
(WebCore::urlWFormat):
(WebCore::urlFormat):
(WebCore::filenameWFormat):
(WebCore::filenameFormat):
(WebCore::htmlFormat):
(WebCore::smartPasteFormat):
(WebCore::fileDescriptorFormat):
(WebCore::fileContentFormatZero):

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

20 months ago[RenderTreeBuilder] Move RenderSVG*::addChild() to RenderTreeBuilder
zalan@apple.com [Wed, 14 Feb 2018 23:41:55 +0000 (23:41 +0000)]
[RenderTreeBuilder] Move RenderSVG*::addChild() to RenderTreeBuilder
https://bugs.webkit.org/show_bug.cgi?id=182811
<rdar://problem/37549714>

Reviewed by Antti Koivisto.

No change in functionality.

* rendering/svg/RenderSVGContainer.cpp:
(WebCore::RenderSVGContainer::addChild): Deleted.
* rendering/svg/RenderSVGContainer.h:
* rendering/svg/RenderSVGInline.cpp:
(WebCore::RenderSVGInline::addChild): Deleted.
* rendering/svg/RenderSVGInline.h:
* rendering/svg/RenderSVGRoot.cpp:
(WebCore::RenderSVGRoot::addChild): Deleted.
* rendering/svg/RenderSVGRoot.h:
* rendering/svg/RenderSVGText.cpp:
(WebCore::RenderSVGText::addChild): Deleted.
* rendering/svg/RenderSVGText.h:
* rendering/updating/RenderTreeBuilder.cpp:
(WebCore::RenderTreeBuilder::insertChild):
(WebCore::RenderTreeBuilder::insertChildToSVGContainer): Deleted.
(WebCore::RenderTreeBuilder::insertChildToSVGInline): Deleted.
(WebCore::RenderTreeBuilder::insertChildToSVGRoot): Deleted.
(WebCore::RenderTreeBuilder::insertChildToSVGText): Deleted.
* rendering/updating/RenderTreeBuilder.h:

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

20 months agoCrash: triggerOMGTierUpThunkGenerator() doesn't align the stack pointer before callin...
msaboff@apple.com [Wed, 14 Feb 2018 23:31:50 +0000 (23:31 +0000)]
Crash: triggerOMGTierUpThunkGenerator() doesn't align the stack pointer before calling C++ code
https://bugs.webkit.org/show_bug.cgi?id=182808

Reviewed by Keith Miller.

Set up a proper frame with a prologue and epilogue to align the stack pointer for the rest of the
thunk.

* wasm/WasmThunks.cpp:
(JSC::Wasm::triggerOMGTierUpThunkGenerator):

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

20 months agoSetting a VMTrap shouldn't look at topCallFrame since that may imply we're in C code...
sbarati@apple.com [Wed, 14 Feb 2018 23:25:52 +0000 (23:25 +0000)]
Setting a VMTrap shouldn't look at topCallFrame since that may imply we're in C code and holding the malloc lock
https://bugs.webkit.org/show_bug.cgi?id=182801

Reviewed by Keith Miller.

JSTests:

* stress/watchdog-dont-malloc-when-in-c-code.js: Added.

Source/JavaScriptCore:

VMTraps would sometimes install traps when it paused the JS thread when it
was in C code. This is wrong, as installing traps mallocs, and the JS thread
may have been holding the malloc lock while in C code. This could lead to a
deadlock when C code was holding the malloc lock.

This patch makes it so that we only install traps when we've proven the PC
is in JIT or LLInt code. If we're in JIT/LLInt code, we are guaranteed that
we're not holding the malloc lock.

* jsc.cpp:
(GlobalObject::finishCreation):
(functionMallocInALoop):
* runtime/VMTraps.cpp:
(JSC::VMTraps::tryInstallTrapBreakpoints):

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

20 months agoWeb Inspector: Styles: completion popover doesn't hide when switching panels
nvasilyev@apple.com [Wed, 14 Feb 2018 22:45:50 +0000 (22:45 +0000)]
Web Inspector: Styles: completion popover doesn't hide when switching panels
https://bugs.webkit.org/show_bug.cgi?id=182464
<rdar://problem/37202763>

Reviewed by Timothy Hatcher.

Save the position of the anchor, an element the popover is shown for, and hide the completion popover
when the position changes.

* UserInterface/Views/CompletionSuggestionsView.js:
(WI.CompletionSuggestionsView.prototype.showUntilAnchorMoves):
When the popover is visible, check every 200ms if the anchor moved.

(WI.CompletionSuggestionsView.prototype.hide):
* UserInterface/Views/SpreadsheetTextField.js:
(WI.SpreadsheetTextField.prototype._updateCompletions):
(WI.SpreadsheetTextField.prototype._getCaretRect):
getBoundingClientRect returns {x: 0, y: 0} when it can't determine node's position.
This happens when a node isn't attached to DOM, attached to DOM but not visible, and
a number of odd cases.

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

20 months agoDisallow cross-origin subresources from asking for credentials
dbates@webkit.org [Wed, 14 Feb 2018 22:27:52 +0000 (22:27 +0000)]
Disallow cross-origin subresources from asking for credentials
https://bugs.webkit.org/show_bug.cgi?id=182579
<rdar://problem/36162271>

Reviewed by Andy Estes.

Source/WebCore:

Prompts for credentials to load cross-origin subresources are typically seen as unexpected
by a person that navigates to- or interacts with- a web page. The cross-origin and implicit
loading nature of these subresources makes asking for credentials questionable because they
are not being served by the same origin of the page a person explicitly loaded and are not
guaranteed to correspond to an explicit user interaction other than the initial load of the
page. We know that subresources that ask for credentials can be abused as part of a phishing
attack. It seems reasonable to disallow cross-origin subresources from asking for credentials
due to their questionable nature and the risk for abuse. This will also make the behavior
of WebKit match the behavior of Chrome.

Tests: http/tests/media/video-auth-with-allowCrossOriginSubresourcesToAskForCredentials.html
       http/tests/security/basic-auth-subresource.html
       http/tests/security/mixedContent/insecure-basic-auth-image-allowCrossOriginSubresourcesToAskForCredentials.https.html
       http/tests/security/mixedContent/insecure-image-redirects-to-basic-auth-secure-image-allowCrossOriginSubresourcesToAskForCredentials.html
       http/tests/security/mixedContent/secure-redirect-to-insecure-redirect-to-basic-auth-secure-image-allowCrossOriginSubresourcesToAskForCredentials.https.html
       http/tests/security/mixedContent/secure-redirect-to-secure-redirect-to-basic-auth-insecure-image-allowCrossOriginSubresourcesToAskForCredentials.https.html
       http/tests/security/mixedContent/secure-redirect-to-secure-redirect-to-basic-auth-secure-image-allowCrossOriginSubresourcesToAskForCredentials.https.html

* loader/ResourceLoader.cpp:
(WebCore::ResourceLoader::isSubresourceLoader const): Formerly non-const.
(WebCore::ResourceLoader::shouldAllowResourceToAskForCredentials const): Added.
(WebCore::ResourceLoader::didBlockAuthenticationChallenge): Emit Web Inspector console message if
the authentication challenge was blocked because the request is cross origin.
(WebCore::ResourceLoader::isAllowedToAskUserForCredentials const): Disallow a cross-origin
request from prompting for credentials.
(WebCore::ResourceLoader::isSubresourceLoader): Deleted; made const.
* loader/ResourceLoader.h:
* loader/SubresourceLoader.cpp:
(WebCore::SubresourceLoader::SubresourceLoader): Update ResourceLoader state so that block cross-origin
subresources from prompting for credentials, if applicable.
(WebCore::SubresourceLoader::isSubresourceLoader const): Formerly non-const.
(WebCore::SubresourceLoader::isSubresourceLoader): Deleted; made const.
* loader/SubresourceLoader.h:
* page/Settings.yaml: Add setting allowCrossOriginSubresourcesToAskForCredentials (defaults: false -
do not allow cross origin subresources to ask for credentials).

Source/WebKit:

Add a private preference to toggle allowing non-mixed content cross-origin subresources to load.
WebKitTestRunner toggles this preference when it sees the test option allowCrossOriginSubresourcesToAskForCredential.

* Shared/WebPreferences.yaml:
* UIProcess/API/C/WKPreferences.cpp:
(WKPreferencesSetAllowCrossOriginSubresourcesToAskForCredentials):
(WKPreferencesGetAllowCrossOriginSubresourcesToAskForCredentials):
* UIProcess/API/C/WKPreferencesRefPrivate.h:

Source/WebKitLegacy/mac:

Add a private preference to toggle allowing non-mixed content cross-origin subresources to load.
DumpRenderTree toggles this preference when it sees the test option allowCrossOriginSubresourcesToAskForCredential.

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

Tools:

Add test option allowCrossOriginSubresourcesToAskForCredential (defaults to false)
so that tests can toggle between the old behavior and new behavior.

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

LayoutTests:

Copied existing tests that depended on cross-origin subresources being able prompt for credentials
to files with suffix allowCrossOriginSubresourcesToAskForCredentials. These copies were modified
to set allowCrossOriginSubresourcesToAskForCredentials to false so as to opt-into the behavior
before this change. Updated existing tests to reflect the new behavior and added new tests to
ensure that we do not regress the new behavior.

* http/tests/media/video-auth-expected.txt:
* http/tests/media/video-auth-with-allowCrossOriginSubresourcesToAskForCredentials-expected.txt: Copied from LayoutTests/http/tests/media/video-auth-expected.txt.
* http/tests/media/video-auth-with-allowCrossOriginSubresourcesToAskForCredentials.html: Copied from LayoutTests/http/tests/media/video-auth.html.
* http/tests/media/video-auth.html:
* http/tests/security/basic-auth-subresource-expected.txt: Added.
* http/tests/security/basic-auth-subresource.html: Added.
* http/tests/security/credentials-iframes-allowCrossOriginSubresourcesToAskForCredentials-expected.txt: Renamed from LayoutTests/platform/mac-wk1/http/tests/security/credentials-iframes-expected.txt.
* http/tests/security/credentials-iframes-allowCrossOriginSubresourcesToAskForCredentials.html: Added.
* http/tests/security/credentials-iframes-expected.txt:
* http/tests/security/mixedContent/insecure-basic-auth-image-allowCrossOriginSubresourcesToAskForCredentials.https-expected.txt: Copied from LayoutTests/http/tests/security/mixedContent/insecure-basic-auth-image.https-expected.txt.
* http/tests/security/mixedContent/insecure-basic-auth-image-allowCrossOriginSubresourcesToAskForCredentials.https.html: Copied from LayoutTests/http/tests/security/mixedContent/secure-redirect-to-secure-redirect-to-basic-auth-secure-image.https.html.
* http/tests/security/mixedContent/insecure-basic-auth-image.https-expected.txt:
* http/tests/security/mixedContent/insecure-image-redirects-to-basic-auth-secure-image-allowCrossOriginSubresourcesToAskForCredentials-expected.txt: Copied from LayoutTests/http/tests/security/mixedContent/insecure-image-redirects-to-basic-auth-secure-image-expected.txt.
* http/tests/security/mixedContent/insecure-image-redirects-to-basic-auth-secure-image-allowCrossOriginSubresourcesToAskForCredentials.html: Added.
* http/tests/security/mixedContent/insecure-image-redirects-to-basic-auth-secure-image-expected.txt:
* http/tests/security/mixedContent/secure-redirect-to-insecure-redirect-to-basic-auth-secure-image-allowCrossOriginSubresourcesToAskForCredentials.https-expected.txt: Copied from LayoutTests/http/tests/security/mixedContent/secure-redirect-to-insecure-redirect-to-basic-auth-secure-image.https-expected.txt.
* http/tests/security/mixedContent/secure-redirect-to-insecure-redirect-to-basic-auth-secure-image-allowCrossOriginSubresourcesToAskForCredentials.https.html: Copied from LayoutTests/http/tests/security/mixedContent/secure-redirect-to-secure-redirect-to-basic-auth-secure-image.https.html.
* http/tests/security/mixedContent/secure-redirect-to-insecure-redirect-to-basic-auth-secure-image.https-expected.txt:
* http/tests/security/mixedContent/secure-redirect-to-secure-redirect-to-basic-auth-insecure-image-allowCrossOriginSubresourcesToAskForCredentials.https-expected.txt: Copied from LayoutTests/http/tests/security/mixedContent/secure-redirect-to-secure-redirect-to-basic-auth-insecure-image.https-expected.txt.
* http/tests/security/mixedContent/secure-redirect-to-secure-redirect-to-basic-auth-insecure-image-allowCrossOriginSubresourcesToAskForCredentials.https.html: Copied from LayoutTests/http/tests/security/mixedContent/secure-redirect-to-secure-redirect-to-basic-auth-secure-image.https.html.
* http/tests/security/mixedContent/secure-redirect-to-secure-redirect-to-basic-auth-insecure-image.https-expected.txt:
* http/tests/security/mixedContent/secure-redirect-to-secure-redirect-to-basic-auth-secure-image-allowCrossOriginSubresourcesToAskForCredentials.https-expected.txt: Renamed from LayoutTests/platform/mac-wk1/http/tests/security/mixedContent/secure-redirect-to-secure-redirect-to-basic-auth-secure-image.https-expected.txt.
* http/tests/security/mixedContent/secure-redirect-to-secure-redirect-to-basic-auth-secure-image-allowCrossOriginSubresourcesToAskForCredentials.https.html: Copied from LayoutTests/http/tests/security/mixedContent/secure-redirect-to-secure-redirect-to-basic-auth-secure-image.https.html.
* http/tests/security/mixedContent/secure-redirect-to-secure-redirect-to-basic-auth-secure-image.https-expected.txt:
* http/tests/security/mixedContent/secure-redirect-to-secure-redirect-to-basic-auth-secure-image.https.html:
* http/tests/security/resources/basic-auth-subresource.html: Added.
* http/tests/security/resources/subresource1/protected-image.php: Added.
* http/tests/security/resources/subresource2/protected-image.php: Added.
* platform/win/TestExpectations: Skip allowCrossOriginSubresourcesToAskForCredentials-suffixed tests as
DumpRenderTree on Windows does not support parsing test options. See <https://bugs.webkit.org/show_bug.cgi?id=173281>.
* platform/win/http/tests/security/basic-auth-subresource-expected.txt: Added Windows-specific result. For some reason
connections to localhost:8443 are not allowed. See <https://bugs.webkit.org/show_bug.cgi?id=182609> for more details.
* platform/wk2/http/tests/media/video-auth-expected.txt:
* platform/wk2/http/tests/media/video-auth-with-allowCrossOriginSubresourcesToAskForCredentials-expected.txt: Copied from LayoutTests/platform/wk2/http/tests/media/video-auth-expected.txt.
* platform/wk2/http/tests/security/basic-auth-subresource-expected.txt: Added.
* platform/wk2/http/tests/security/credentials-iframes-allowCrossOriginSubresourcesToAskForCredentials-expected.txt: Copied from LayoutTests/http/tests/security/credentials-iframes-expected.txt.
* platform/wk2/http/tests/security/mixedContent/secure-redirect-to-secure-redirect-to-basic-auth-secure-image-allowCrossOriginSubresourcesToAskForCredentials.https-expected.txt: Copied from LayoutTests/http/tests/security/mixedContent/secure-redirect-to-secure-redirect-to-basic-auth-secure-image.https-expected.txt.

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

20 months agoMarked imported/w3c/web-platform-tests/service-workers/cache-storage/worker/cache...
jlewis3@apple.com [Wed, 14 Feb 2018 21:23:21 +0000 (21:23 +0000)]
Marked imported/w3c/web-platform-tests/service-workers/cache-storage/worker/cache-storage-match.https.html as flaky on macOS WK2.
https://bugs.webkit.org/show_bug.cgi?id=177198

Unreviewed test gardening.

* platform/mac-wk2/TestExpectations:

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

20 months agoWebCore headers should not include config.h or PlatformExportMacros.h
don.olmstead@sony.com [Wed, 14 Feb 2018 21:23:02 +0000 (21:23 +0000)]
WebCore headers should not include config.h or PlatformExportMacros.h
https://bugs.webkit.org/show_bug.cgi?id=182799

Reviewed by Darin Adler.

No new tests. No change in behavior.

* Modules/speech/SpeechSynthesis.h:
* bindings/js/JSDOMGlobalObject.h:
* contentextensions/ContentExtensionError.h:
* contentextensions/DFA.h:
* dom/ContextDestructionObserver.h:
* dom/DeviceOrientationClient.h:
* dom/DeviceOrientationData.h:
* editing/cocoa/HTMLConverter.h:
* loader/FrameLoaderStateMachine.h:
* loader/cache/CachedResourceHandle.h:
* page/FrameDestructionObserver.h:
* page/RuntimeEnabledFeatures.h:
* platform/URL.h:
* platform/audio/AudioHardwareListener.h:
* platform/audio/AudioSession.h:
* platform/graphics/Color.h:
* platform/graphics/IntSize.h:
* platform/graphics/transforms/AffineTransform.h:
* platform/graphics/win/LocalWindowsContext.h:
* platform/network/CacheValidation.h:
* platform/network/CredentialBase.h:
* platform/network/ResourceHandleClient.h:
* platform/network/cf/CertificateInfo.h:

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

20 months agoREGRESSION (r223440): Copying & pasting a list from Microsoft Word to TinyMCE fails
rniwa@webkit.org [Wed, 14 Feb 2018 21:07:38 +0000 (21:07 +0000)]
REGRESSION (r223440): Copying & pasting a list from Microsoft Word to TinyMCE fails
https://bugs.webkit.org/show_bug.cgi?id=182564

Reviewed by Wenson Hsieh.

Source/WebCore:

Unfortunately, r228352 was inadaquate to fix copying & pasting of a list item from Microsoft Word into TinyMCE
in older verions of TinyMCE. This patch amends the approach taken by r228352 to make it work across the board
as well as unbreak GMail.

Turns out older versions of TinyMCE can't handle list items when computed styles are added as inline style
declarations by WebKit. To make this work, avoid adding any computed styles as inline styles within mso-list
conditionals as well as any p elements whose style attribute contains "mso-list" property. We would instead
preserve these styles by keeping Microsoft Word's CSS style rules in addition to special @list rules.

In addition, not keeping the style element of Microsoft Word in a head element as done in r228352 causes some
versions of TinyMCE to treat it as regular text, and inserting a bunch of @list rules as user visible text.
To work around this problem, we serialize the style rules as a comment (<!-- ~ -->) within a head element.

Furthermore, when Microsoft Word is in the compatibility mode, it does not generate xmlns:o as the first xmlns
declaration. Generalized the code to detect Microsoft Word's HTML declaration by looking for xmlns:o and xmlns:w
xmls declarations.

Finally, it turns out that Gmail has its own handling of list items copy & pasted from Microsoft Word, and also
needs this quirks but in the pasted HTML, not the one exposed in getData. As such, this patch also enables the
MSO list quirks in the pasted content as well as the one exposed in getData.

Tests: PasteHTML.PreservesMSOList
       PasteHTML.PreservesMSOListInCompatibilityMode
       PasteHTML.StripsMSOListWhenMissingMSOHTMLElement
       PasteWebArchive.PreservesMSOList
       PasteWebArchive.PreservesMSOListInCompatibilityMode
       PasteWebArchive.StripsMSOListWhenMissingMSOHTMLElement

* editing/HTMLInterchange.h:
* editing/ReplaceSelectionCommand.cpp:
(WebCore::removeHeadContents): Don't remove the special style element needed for the MSO list quirks since we
don't keep the computed style as inline styles in this case.
* editing/cocoa/WebContentReaderCocoa.mm:
(WebCore::WebContentReader::readWebArchive): Enable the quirks in the pasted content as well as opposed to
just in DataTransfer API exposed to the JavaScript.
(WebCore::WebContentReader::readHTML): Ditto.
* editing/markup.cpp:
(WebCore::shouldPreserveMSOLists): Added. Generalized the logic to detect a Microsoft Word document.
more xmlns declarations.
(WebCore::StyledMarkupAccumulator::shouldPreserveMSOListStyleForElement): Added.
(WebCore::StyledMarkupAccumulator::appendElement): Don't generate the second style element here for elements
with most-list properties. Instead, avoid overriding inline styles with computed styles altogether.
(WebCore::StyledMarkupAccumulator::appendNodeToPreserveMSOList): Include the style rules as well as list rules
and wrap the "style" element in a "head" element to make it compatible with older versions of TinyMCE.

Tools:

Updated assertions to make sure the trailing "}" of @list rules is includd in the style, the "style" element
is wrapped by "head" element (not present in the pasted markup since the fragment parsing algorithm strips away),
and the style content is enclosed in "<!--" and "-->".

Also use execCommand('insertHTML', ~) to insert the HTML obtained via dataTransfer.getData instead of innerHTML
to make sure our pasting code preserves the special style element for MSO list quirks.

Finally, added two more test cases for pasting content from Microsoft Word's compatibility mode.

* TestWebKitAPI/Tests/WebKitCocoa/PasteHTML.mm:
(TEST):
* TestWebKitAPI/Tests/WebKitCocoa/PasteWebArchive.mm:
(TEST):

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

20 months agoREGRESSION(225695) : com.apple.WebKit.WebContent at com.apple.JavaScriptCore: JSC...
msaboff@apple.com [Wed, 14 Feb 2018 20:37:11 +0000 (20:37 +0000)]
REGRESSION(225695) : com.apple.WebKit.WebContent at com.apple.JavaScriptCore: JSC::RegExp::match + 630 :: stack overflow
https://bugs.webkit.org/show_bug.cgi?id=182705

Reviewed by Mark Lam.

Source/JavaScriptCore:

Moved the pattern context buffer used by YARR JIT'ed code from a stack local to a lazily allocated
buffer on the VM.  Exposed when the buffer is needed to reduce likelihood that we'd allocated it.
Guarded use of the buffer with a lock since the DFG compiler may call into YARR JIT'ed code on a
compilation thread.

* runtime/RegExpInlines.h:
(JSC::RegExp::matchInline):
* runtime/VM.cpp:
(JSC::VM::~VM):
(JSC::VM::acquireRegExpPatternContexBuffer):
(JSC::VM::releaseRegExpPatternContexBuffer):
* runtime/VM.h:
* yarr/YarrJIT.cpp:
(JSC::Yarr::YarrGenerator::generate):
(JSC::Yarr::YarrGenerator::backtrack):
(JSC::Yarr::YarrGenerator::opCompileParenthesesSubpattern):
(JSC::Yarr::YarrGenerator::generateEnter):
(JSC::Yarr::YarrGenerator::generateReturn):
(JSC::Yarr::YarrGenerator::YarrGenerator):
(JSC::Yarr::YarrGenerator::compile):
* yarr/YarrJIT.h:
(JSC::Yarr::YarrCodeBlock::usesPatternContextBuffer):
(JSC::Yarr::YarrCodeBlock::setUsesPaternContextBuffer):

Source/WTF:

Moved the setting of ENABLE_YARR_JIT_ALL_PARENS_EXPRESSIONS to Platform.h since more than just the YARR
code needs to know if that feature is enabled.

* wtf/Platform.h:

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