WebKit-https.git
19 months agoLayout Test svg/text/monospace-text-size-in-img.html is failing
pvollan@apple.com [Tue, 27 Nov 2018 17:05:35 +0000 (17:05 +0000)]
Layout Test svg/text/monospace-text-size-in-img.html is failing
https://bugs.webkit.org/show_bug.cgi?id=192011

Unreviewed test gardening.

* platform/win/TestExpectations:

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

19 months agoLayout Test fast/inline/simple-inline-with-out-of-flow-descendant.html is failing
pvollan@apple.com [Tue, 27 Nov 2018 17:00:48 +0000 (17:00 +0000)]
Layout Test fast/inline/simple-inline-with-out-of-flow-descendant.html is failing
https://bugs.webkit.org/show_bug.cgi?id=192010

Unreviewed test gardening.

* platform/win/TestExpectations:

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

19 months agoWebKit.AddAndRemoveDataDetectors hits a debug assertion after r238515
wenson_hsieh@apple.com [Tue, 27 Nov 2018 15:51:43 +0000 (15:51 +0000)]
WebKit.AddAndRemoveDataDetectors hits a debug assertion after r238515
https://bugs.webkit.org/show_bug.cgi?id=191996

Reviewed by Tim Horton.

This assertion is hit because `decode(Decoder& decoder, NSArray<Class> *allowedClasses)` expects the decoded
object (of class `_NSArrayM`) to be equal to `NSArray.class`.

We fix the crash by relaxing the debug assertion when decoding securely-codable objects over IPC. Instead of
checking that the class of the decoded object is equal to one of the allowed classes, check that the object is a
kind of any of the allowed classes.

* Shared/Cocoa/ArgumentCodersCocoa.h:
(IPC::isObjectClassAllowed):
(IPC::decode):

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

19 months ago[GTK][WPE] Remove temporary workaround in Source/WebKit/Platform*.cmake
tpopela@redhat.com [Tue, 27 Nov 2018 15:29:55 +0000 (15:29 +0000)]
[GTK][WPE] Remove temporary workaround in Source/WebKit/Platform*.cmake
https://bugs.webkit.org/show_bug.cgi?id=192008

Reviewed by Michael Catanzaro.

Looks like it's not needed anymore as the code compiles fine without
it.

* PlatformGTK.cmake:
* PlatformWPE.cmake:

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

19 months ago[css-grid] align-self center and position sticky don't work together
jfernandez@igalia.com [Tue, 27 Nov 2018 13:52:57 +0000 (13:52 +0000)]
[css-grid] align-self center and position sticky don't work together
https://bugs.webkit.org/show_bug.cgi?id=191963

Reviewed by Manuel Rego Casasnovas.

LayoutTests/imported/w3c:

This change makes several cases of the following tests to pass now.

* web-platform-tests/css/css-grid/alignment/grid-column-axis-alignment-sticky-positioned-items-001-expected.txt:
* web-platform-tests/css/css-grid/alignment/grid-column-axis-alignment-sticky-positioned-items-002-expected.txt:
* web-platform-tests/css/css-grid/alignment/grid-row-axis-alignment-sticky-positioned-items-001-expected.txt:
* web-platform-tests/css/css-grid/alignment/grid-row-axis-alignment-sticky-positioned-items-002-expected.txt:

Source/WebCore:

This is a fix for a regression introduced in r515391, where we landed
the implementation of alignment for positioned objects in a Grid Layout
container.

We assumed that items with non-static positions shouldn't honor the
CSS Box Alignment properties. This is only true for out-of-flow items,
absolute or fixed positioned elements. However, sticky positioned
elements are treated as relative positioned items, but they indeed use
non-static position to define their behavior.

No new tests, this change is covered by current tests and make several cases to pass now.

* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::columnAxisPositionForChild const):
(WebCore::RenderGrid::rowAxisPositionForChild const):

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

19 months agoFactor mask layer applying in RemoteLayerTreePropertyApplier into a shared function
antti@apple.com [Tue, 27 Nov 2018 13:34:17 +0000 (13:34 +0000)]
Factor mask layer applying in RemoteLayerTreePropertyApplier into a shared function
https://bugs.webkit.org/show_bug.cgi?id=192001

Reviewed by Tim Horton.

* Shared/RemoteLayerTree/RemoteLayerTreePropertyApplier.h:
* Shared/RemoteLayerTree/RemoteLayerTreePropertyApplier.mm:
(WebKit::RemoteLayerTreePropertyApplier::applyProperties):
(WebKit::RemoteLayerTreePropertyApplier::updateMask):

Shared function, with some special tricks for iOS backdrop layers.

(WebKit::RemoteLayerTreePropertyApplier::applyPropertiesToUIView):

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

19 months agoStop collecting related layers in RemoteLayerTreeHost::updateLayerTree
antti@apple.com [Tue, 27 Nov 2018 12:39:27 +0000 (12:39 +0000)]
Stop collecting related layers in RemoteLayerTreeHost::updateLayerTree
https://bugs.webkit.org/show_bug.cgi?id=192003

Reviewed by Tim Horton.

We can pass the node hash directly to RemoteLayerTreePropertyApplier. The collection step doesn't seem
to add anything except an extra hash lookup.

* Shared/RemoteLayerTree/RemoteLayerTreePropertyApplier.h:
* UIProcess/RemoteLayerTree/RemoteLayerTreeHost.mm:
(WebKit::RemoteLayerTreeHost::updateLayerTree):

Pass m_nodes directly.
Some random cleanups.

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

19 months ago[ews-app] Add support to communicate with Buildbot (Follow-up fix)
aakash_jain@apple.com [Tue, 27 Nov 2018 12:27:29 +0000 (12:27 +0000)]
[ews-app] Add support to communicate with Buildbot (Follow-up fix)
https://bugs.webkit.org/show_bug.cgi?id=191935
<rdar://problem/46262314>

Unreviewed infrastructure fix.

* BuildSlaveSupport/ews-app/ews/common/buildbot.py:
(Buildbot.send_patch_to_buildbot):

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

19 months agoRemote tile layers shouldn't be UIViews
antti@apple.com [Tue, 27 Nov 2018 09:12:03 +0000 (09:12 +0000)]
Remote tile layers shouldn't be UIViews
https://bugs.webkit.org/show_bug.cgi?id=191953

Reviewed by Tim Horton.

They don't need any UIView functionality, nor do they ever have UIView descendants.
We can use lighter weight objects.

* Shared/RemoteLayerTree/RemoteLayerTreePropertyApplier.h:
* Shared/RemoteLayerTree/RemoteLayerTreePropertyApplier.mm:
(WebKit::RemoteLayerTreePropertyApplier::applyProperties):
(WebKit::RemoteLayerTreePropertyApplier::updateChildren):

Factor to a function shared between platforms.
Support having both views and plain layers in the same tree.
Assert that all siblings are of the same type and that we don't attempt to add views to layers.

(WebKit::RemoteLayerTreePropertyApplier::applyPropertiesToUIView):
* UIProcess/RemoteLayerTree/RemoteLayerTreeHost.mm:
(WebKit::RemoteLayerTreeHost::makeNode):

Use new plain layer on Mac too.

* UIProcess/RemoteLayerTree/RemoteLayerTreeNode.h:
* UIProcess/RemoteLayerTree/RemoteLayerTreeNode.mm:
(-[WKPlainRemoteLayer description]):

Add a CALayer subclass so we can have a description, similar to WKCompositingView and pals.

(WebKit::RemoteLayerTreeNode::createWithPlainLayer):
(WebKit::RemoteLayerTreeNode::detachFromParent):

Support having null view.

(WebKit::RemoteLayerTreeNode::appendLayerDescription):

Helper for layer descriptions.

* UIProcess/RemoteLayerTree/ios/RemoteLayerTreeHostIOS.mm:
(WebKit::RemoteLayerTreeHost::makeNode):

Construct plain layers for tiles.

* UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.mm:
(-[WKCompositingView description]):
(-[WKUIRemoteView description]):
(-[WKBackdropView description]):

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

19 months agoRemove "using namespace WebCore" under Source/WebKit/WebProcess/InjectedBundle/API
Hironori.Fujii@sony.com [Tue, 27 Nov 2018 08:59:00 +0000 (08:59 +0000)]
Remove "using namespace WebCore" under Source/WebKit/WebProcess/InjectedBundle/API
https://bugs.webkit.org/show_bug.cgi?id=191995

Reviewed by Alex Christensen.

The statement "using namespace WebCore" should be placed inside
namespace WebKit for unified source builds. But, source files
defining WebKit API can't be enclosed by namespace WebKit { }
becuase they are defined in the global scope.

"using namespace WebCore" in global scope and unified source
builds may cause build breaks (Bug 191853).

Remove "using namespace WebCore" in the global scope. Use
"WebCore::" prefix instead.

* WebProcess/InjectedBundle/API/c/WKBundle.cpp:
(WKBundleClearAllDatabases):
(WKBundleSetDatabaseQuota):
(WKBundleClearResourceLoadStatistics):
(WKBundleResourceLoadStatisticsNotifyObserver):
* WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp:
(WKBundleFrameGetFrameLoadState):
(WKBundleFrameClearOpener):
(WKBundleFrameCallShouldCloseOnWebView):
(WKBundleFrameCopySecurityOrigin):
(WKBundleFrameFocus):
* WebProcess/InjectedBundle/API/c/WKBundleInspector.cpp:
* WebProcess/InjectedBundle/API/c/WKBundlePageOverlay.cpp:

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

19 months agoREGRESSION (r238078): Do not draw caps lock indicator when Strong Password button...
dbates@webkit.org [Tue, 27 Nov 2018 04:17:11 +0000 (04:17 +0000)]
REGRESSION (r238078): Do not draw caps lock indicator when Strong Password button is shown
https://bugs.webkit.org/show_bug.cgi?id=191969
<rdar://problem/46247569>

Reviewed by Dean Jackson.

Source/WebCore:

Following r238078 we now support drawing the caps lock indicator in password fields on iOS.
However it is not meaningful to show the caps lock indicator when the Strong Password button
is visible because the password field is not editable. We should not paint the caps lock
indicator when the Strong Password button is visible.

Tests: fast/forms/auto-fill-button/caps-lock-indicator-should-be-visible-after-hiding-auto-fill-strong-password-button.html
       fast/forms/auto-fill-button/caps-lock-indicator-should-not-be-visible-when-auto-fill-strong-password-button-is-visible.html

* html/TextFieldInputType.cpp:
(WebCore::TextFieldInputType::shouldDrawCapsLockIndicator const): Do not draw the caps
lock indicator when the password field has the Strong Password button.
(WebCore::TextFieldInputType::updateAutoFillButton): Call capsLockStateMayHaveChanged() to
update the visibility of the caps lock indicator when the auto fill button has changed.

LayoutTests:

Add tests to ensure that we show or hide the caps lock indicator depending on whether the
Strong Password button is visible.

* TestExpectations: Skip the tests below on all platforms. We will selectively enable them on Mac.
* fast/forms/auto-fill-button/caps-lock-indicator-should-be-visible-after-hiding-auto-fill-strong-password-button-expected.html: Added.
* fast/forms/auto-fill-button/caps-lock-indicator-should-be-visible-after-hiding-auto-fill-strong-password-button.html: Added.
* fast/forms/auto-fill-button/caps-lock-indicator-should-not-be-visible-when-auto-fill-strong-password-button-is-visible-expected.html: Added.
* fast/forms/auto-fill-button/caps-lock-indicator-should-not-be-visible-when-auto-fill-strong-password-button-is-visible.html: Added.
* platform/mac-wk2/TestExpectations: Mark the tests above as PASS so that we run them.

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

19 months ago[Cocoa] No way for clients to tell whether the content view is in the responder chain...
wenson_hsieh@apple.com [Tue, 27 Nov 2018 03:32:06 +0000 (03:32 +0000)]
[Cocoa] No way for clients to tell whether the content view is in the responder chain when the web view is
https://bugs.webkit.org/show_bug.cgi?id=169212
<rdar://problem/30899656>

Reviewed by Tim Horton.

Source/WebKit:

Add an SPI hook to allow internal WKWebView clients to determine whether the WKWebView's content view is the
first responder. Intended for use by clients, such as Mail, that embed native text input views and other views
that may become first responder within the view hierarchy of the WKWebView.

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

Tools:

Add an API test to exercise the behavior of `-_contentViewIsFirstResponder` when an embedded text input becomes
and resigns first responder.

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKitCocoa/WKWebViewFirstResponderTests.mm: Added.
(-[FirstResponderTestingView initWithFrame:]):
(-[FirstResponderTestingView inputField]):
(TestWebKitAPI::TEST):

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

19 months agoRe-introduce op_bitnot
ticaiolima@gmail.com [Tue, 27 Nov 2018 02:26:59 +0000 (02:26 +0000)]
Re-introduce op_bitnot
https://bugs.webkit.org/show_bug.cgi?id=190923

Reviewed by Yusuke Suzuki.

JSTests:

* stress/bit-not-must-generate.js: Added.
* stress/bitwise-not-no-int32.js: Added.

Source/JavaScriptCore:

With the introduction of BigInt as a new type, we can't emit bitwise
not as `x ^ -1` anymore, because this is incompatible with the new type.
Based on that, this Patch is adding `op_bitnot` as a new operation
into LLInt, as well as introducing ArithBitNot node into DFG to support
JIT compilation of such opcode. We will use the ValueProfile of this
intruction in the future to generate better code when its operand
is not Int32.

* assembler/MacroAssemblerARM64.h:
(JSC::MacroAssemblerARM64::not32):
* assembler/MacroAssemblerARMv7.h:
(JSC::MacroAssemblerARMv7::not32):
* assembler/MacroAssemblerMIPS.h:
(JSC::MacroAssemblerMIPS::not32):
* bytecode/BytecodeList.rb:
* bytecode/BytecodeUseDef.h:
(JSC::computeUsesForBytecodeOffset):
(JSC::computeDefsForBytecodeOffset):
* bytecode/CodeBlock.cpp:
(JSC::CodeBlock::finishCreation):
* bytecode/Opcode.h:
(JSC::padOpcodeName):
* bytecompiler/BytecodeGenerator.cpp:
(JSC::BytecodeGenerator::emitUnaryOp):
* bytecompiler/NodesCodegen.cpp:
(JSC::UnaryPlusNode::emitBytecode):
(JSC::BitwiseNotNode::emitBytecode): Deleted.
* dfg/DFGAbstractInterpreterInlines.h:
(JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects):
* dfg/DFGBackwardsPropagationPhase.cpp:
(JSC::DFG::BackwardsPropagationPhase::propagate):
* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::parseBlock):
* dfg/DFGCapabilities.cpp:
(JSC::DFG::capabilityLevel):
* dfg/DFGClobberize.h:
(JSC::DFG::clobberize):
* dfg/DFGDoesGC.cpp:
(JSC::DFG::doesGC):
* dfg/DFGFixupPhase.cpp:
(JSC::DFG::FixupPhase::fixupNode):
* dfg/DFGNodeType.h:
* dfg/DFGOperations.cpp:
* dfg/DFGOperations.h:
* dfg/DFGPredictionPropagationPhase.cpp:
* dfg/DFGSafeToExecute.h:
(JSC::DFG::safeToExecute):
* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::compileBitwiseNot):
* dfg/DFGSpeculativeJIT.h:
* dfg/DFGSpeculativeJIT32_64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* dfg/DFGSpeculativeJIT64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* ftl/FTLCapabilities.cpp:
(JSC::FTL::canCompile):
* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::compileNode):
(JSC::FTL::DFG::LowerDFGToB3::compileArithBitNot):
* jit/JIT.cpp:
(JSC::JIT::privateCompileMainPass):
(JSC::JIT::privateCompileSlowCases):
* jit/JIT.h:
* jit/JITArithmetic.cpp:
(JSC::JIT::emit_op_bitnot):
* llint/LowLevelInterpreter32_64.asm:
* llint/LowLevelInterpreter64.asm:
* offlineasm/cloop.rb:
* parser/NodeConstructors.h:
(JSC::BitwiseNotNode::BitwiseNotNode):
* parser/Nodes.h:
* parser/ResultType.h:
(JSC::ResultType::bigIntOrInt32Type):
(JSC::ResultType::forBitOp):
* runtime/CommonSlowPaths.cpp:
(JSC::SLOW_PATH_DECL):
* runtime/CommonSlowPaths.h:

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

19 months ago[Clang][WebKitLegacy][Win] MarshallingHelpers.h(65,47): warning: extra qualification...
Hironori.Fujii@sony.com [Tue, 27 Nov 2018 02:09:01 +0000 (02:09 +0000)]
[Clang][WebKitLegacy][Win] MarshallingHelpers.h(65,47): warning: extra qualification on member 'windowsEpochAbsoluteTime' [-Wmicrosoft-extra-qualification]
https://bugs.webkit.org/show_bug.cgi?id=191959

Reviewed by Alex Christensen.

* MarshallingHelpers.h: Removed extra "MarshallingHelpers::" of windowsEpochAbsoluteTime declaration.

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

19 months ago[Win][Clang] SOFT_LINK reports warning: implicit conversion between pointer-to-functi...
Hironori.Fujii@sony.com [Tue, 27 Nov 2018 02:01:07 +0000 (02:01 +0000)]
[Win][Clang] SOFT_LINK reports warning: implicit conversion between pointer-to-function and pointer-to-object is a Microsoft extension [-Wmicrosoft-cast]
https://bugs.webkit.org/show_bug.cgi?id=191960

Reviewed by Alex Christensen.

* wtf/win/SoftLinking.h: Do reinterpret_cast<void*> a function
pointer argument of EncodePointer. Changed the type of stored
function pointer returned by EncodePointer.

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

19 months agoUnreviewed, rolling out r238357.
ryanhaddad@apple.com [Tue, 27 Nov 2018 01:59:19 +0000 (01:59 +0000)]
Unreviewed, rolling out r238357.

One of the layout tests added with this change is failing on Mojave.

Reverted changeset:
"REGRESSION (r238078): Do not draw caps lock indicator when Strong Password button is shown"
https://bugs.webkit.org/show_bug.cgi?id=191969
https://trac.webkit.org/changeset/238513

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

19 months ago[CMake] Remove ENABLE_ACCESSIBILITY CMake variable
Hironori.Fujii@sony.com [Tue, 27 Nov 2018 01:54:59 +0000 (01:54 +0000)]
[CMake] Remove ENABLE_ACCESSIBILITY CMake variable
https://bugs.webkit.org/show_bug.cgi?id=191831

Reviewed by Michael Catanzaro.

.:

ENABLE_ACCESSIBILITY is a bit confusing name because there is no
such ENABLE_ACCESSIBILITY macros in C++ source files.

* Source/cmake/OptionsGTK.cmake: Removed ENABLE_ACCESSIBILITY.
* Source/cmake/OptionsWPE.cmake: Ditto.
* Source/cmake/OptionsWin.cmake: Ditto.
* Source/cmake/WebKitFeatures.cmake: Ditto.

Tools:

* WebKitTestRunner/CMakeLists.txt:

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

19 months agoInsert <attachment> elements under editable images to make their backing data accessible
timothy_horton@apple.com [Tue, 27 Nov 2018 01:37:22 +0000 (01:37 +0000)]
Insert <attachment> elements under editable images to make their backing data accessible
https://bugs.webkit.org/show_bug.cgi?id=191844
<rdar://problem/30900149>

Reviewed by Simon Fraser.

Source/WebCore:

Test: editing/images/editable-image-creates-attachment.html

* html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::parseAttribute):
(WebCore::HTMLImageElement::insertedIntoAncestor):
(WebCore::HTMLImageElement::removedFromAncestor):
When the x-apple-editable-image attribute changes, or the element is
moved into or out of a document, call updateEditableImage.

(WebCore::HTMLImageElement::editableImageViewID const):
Adopt EditableImageReference.

(WebCore::HTMLImageElement::updateEditableImage):
When the image element moves into a document, the setting is on, and
the appropriate attribute is applied, add an <attachment> into the
shadow DOM, and inform the UI process both of the editable image's
creation and that it should be associated with the new attachment.

Use an EditableImageReference to extend the lifetime of the
corresponding editable image in the UI process, and to communicate
the attachment association.

If the element was cloned from another editable image element, use the
EditableImageReference and attachmentID from the original; the embedded
view will be re-parented under this element's layer, and the attachment
will be cloned (with a new ID) by editing code if the element is parented.

(WebCore::HTMLImageElement::attachmentIdentifier const):
(WebCore::HTMLImageElement::copyNonAttributePropertiesFromElement):
Store the aforementioned bits of information when cloned so that we can
reconstitute the appropriate attachment data and embedded view.

* html/HTMLImageElement.h:
* page/ChromeClient.h:

* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* page/EditableImageReference.cpp: Added.
(WebCore::EditableImageReference::EditableImageReference):
(WebCore::EditableImageReference::~EditableImageReference):
(WebCore::EditableImageReference::associateWithAttachment):
* page/EditableImageReference.h: Added.
(WebCore::EditableImageReference::create):
(WebCore::EditableImageReference::embeddedViewID const):
Add EditableImageReference, which manages the lifetime of the UI-side
EditableImage and helps clients communicate about it. It is refcounted
so that cloned <img> elements can potentially borrow the UI-side state
(in the case where they end up getting parented).

* page/NavigatorBase.cpp:
Fix an unrelated unified build failure that I exposed.

Source/WebKit:

* DerivedSources.make:
* SourcesCocoa.txt:
* UIProcess/API/APIAttachment.h:
fileWrapper() is no longer a trivial getter; it can now construct
the file wrapper from a file wrapper generator if necessary.

Add setFileWrapperGenerator() and invalidateGeneratedFileWrapper().

Make m_fileWrapper mutable so it can be adjusted inside its own getter.

* UIProcess/API/Cocoa/APIAttachmentCocoa.mm:
(API::Attachment::fileWrapper const):
If we have a fileWrapperGenerator and don't have a cached file wrapper,
create one before returning it.

(API::Attachment::invalidateGeneratedFileWrapper):
Invalidate the currently-cached file wrapper. The next time a client
requests the file wrapper it will be regenerated.

(API::Attachment::fileName const):
(API::Attachment::fileSizeForDisplay const):
(API::Attachment::enclosingImageData const):
(API::Attachment::isEmpty const):
(API::Attachment::createSerializedRepresentation const):
Make use of fileWrapper() instead of m_fileWrapper directly, to ensure
that it is created lazily if necessary.

(API::Attachment::setFileWrapperGenerator):
* UIProcess/RemoteLayerTree/ios/RemoteLayerTreeHostIOS.mm:
(WebKit::RemoteLayerTreeHost::createEmbeddedView):
* UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.h:
* UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.mm:
(-[WKEmbeddedView initWithEmbeddedViewID:]):
Defer to EditableImageController for creating WKDrawingViews for
editable images. This is done primarily so we don't have to pollute
Remote Layer Tree and DrawingArea interfaces with editable-image-specific messages.

* UIProcess/WebPageProxy.cpp:
(WebKit::m_editableImageController):
(WebKit::m_resetRecentCrashCountTimer): Deleted.
* UIProcess/WebPageProxy.h:
(WebKit::WebPageProxy::editableImageController):
Keep an EditableImageController on the WebPageProxy.

* UIProcess/ios/EditableImageController.h: Added.
* UIProcess/ios/EditableImageController.messages.in: Added.
* UIProcess/ios/EditableImageController.mm: Added.
(WebKit::EditableImageController::EditableImageController):
(WebKit::EditableImageController::~EditableImageController):
(WebKit::EditableImageController::ensureEditableImage):
(WebKit::EditableImageController::editableImage):
(WebKit::EditableImageController::didCreateEditableImage):
(WebKit::EditableImageController::didDestroyEditableImage):
(WebKit::EditableImageController::associateWithAttachment):
(WebKit::EditableImageController::invalidateAttachmentForEditableImage):
Add EditableImageController, which keeps track of EditableImages.
It can be messaged directly to create or destroy the UI-side state
of an editable image, and also to associate a WKDrawingView with
a particular attachment.

* UIProcess/ios/WKDrawingView.h:
* UIProcess/ios/WKDrawingView.mm:
(-[WKDrawingView initWithEmbeddedViewID:webPageProxy:]):
Store the WebPageProxy (weakly) so that we can get to the EditableImageController.

(-[WKDrawingView layoutSubviews]):
(-[WKDrawingView PNGRepresentation]):
Synchronously render the PKCanvasView to PNG.

(-[WKDrawingView drawingDidChange:]):
If the drawing changes, inform the APIAttachment that it needs
to discard its NSFileWrapper; a new one will be generated lazily.

(-[WKDrawingView init]): Deleted.
* WebKit.xcodeproj/project.pbxproj:
* WebProcess/WebCoreSupport/WebChromeClient.h:
* WebProcess/WebCoreSupport/ios/WebChromeClientIOS.mm:
(WebKit::WebChromeClient::associateEditableImageWithAttachment):
(WebKit::WebChromeClient::didCreateEditableImage):
(WebKit::WebChromeClient::didDestroyEditableImage):

Tools:

* DumpRenderTree/ios/UIScriptControllerIOS.mm:
(WTR::UIScriptController::attachmentInfo):
* TestRunnerShared/UIScriptContext/Bindings/UIScriptController.idl:
* TestRunnerShared/UIScriptContext/UIScriptController.cpp:
(WTR::UIScriptController::attachmentInfo):
* TestRunnerShared/UIScriptContext/UIScriptController.h:
* WebKitTestRunner/ios/UIScriptControllerIOS.mm:
(WTR::UIScriptController::attachmentInfo):
Add a UIScriptController mechanism to retrieve information about
a given attachment.

LayoutTests:

* editing/images/editable-image-creates-attachment-expected.txt: Added.
* editing/images/editable-image-creates-attachment.html: Added.
* resources/ui-helper.js:
(window.UIHelper.attachmentInfo):
(window.UIHelper):

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

19 months ago[ews-app] Add support to communicate with Buildbot
aakash_jain@apple.com [Tue, 27 Nov 2018 01:05:53 +0000 (01:05 +0000)]
[ews-app] Add support to communicate with Buildbot
https://bugs.webkit.org/show_bug.cgi?id=191935

Reviewed by Lucas Forschler.

* BuildSlaveSupport/ews-app/ews/common/__init__.py: Added.
* BuildSlaveSupport/ews-app/ews/common/buildbot.py: Added.

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

19 months agowebkitpy: Race condition in ServerProcess tests
jbedard@apple.com [Tue, 27 Nov 2018 01:02:42 +0000 (01:02 +0000)]
webkitpy: Race condition in ServerProcess tests
https://bugs.webkit.org/show_bug.cgi?id=191989
<rdar://problem/45536844>

Reviewed by Lucas Forschler.

Serializing these tests to prevent the race conditions.

* Scripts/webkitpy/port/server_process_unittest.py:
(TestServerProcess.serial_test_basic):
(TestServerProcess.serial_test_read_after_process_exits):
(TestServerProcess.serial_test_process_crashing):
(TestServerProcess.serial_test_process_crashing_no_data):
(TestServerProcess.test_basic): Deleted.
(TestServerProcess.test_read_after_process_exits): Deleted.
(TestServerProcess.test_process_crashing): Deleted.
(TestServerProcess.test_process_crashing_no_data): Deleted.

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

19 months ago[ews-app] Add field in Patch object to indicate if it has been sent to Buildbot
aakash_jain@apple.com [Tue, 27 Nov 2018 00:48:51 +0000 (00:48 +0000)]
[ews-app] Add field in Patch object to indicate if it has been sent to Buildbot
https://bugs.webkit.org/show_bug.cgi?id=191929

Reviewed by Lucas Forschler.

* BuildSlaveSupport/ews-app/ews/models/patch.py:
(Patch): Added sent_to_buildbot field.
(Patch.is_patch_sent_to_buildbot): Checks if the patch has been sent to Buildbot.

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

19 months ago[ews-app] Add a config file
aakash_jain@apple.com [Tue, 27 Nov 2018 00:29:53 +0000 (00:29 +0000)]
[ews-app] Add a config file
https://bugs.webkit.org/show_bug.cgi?id=191933

Reviewed by Lucas Forschler.

* BuildSlaveSupport/ews-app/ews/config.py: Added.

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

19 months ago[ews-app] Add methods to save patch to database
aakash_jain@apple.com [Tue, 27 Nov 2018 00:21:37 +0000 (00:21 +0000)]
[ews-app] Add methods to save patch to database
https://bugs.webkit.org/show_bug.cgi?id=191928

Reviewed by Lucas Forschler.

* BuildSlaveSupport/ews-app/ews/models/patch.py:
(Patch.save_patch): Method to save the patch to database.
(Patch.save_patches): Method to save multiple patches to database.
(Patch.is_valid_patch_id): Checks if the patch id is valid.
(Patch.is_existing_patch_id): Checks if the patch id already exists in database.

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

19 months agoAdopt -setOverrideRouteSharingPolicy:routingContextUID: SPI
jer.noble@apple.com [Tue, 27 Nov 2018 00:02:28 +0000 (00:02 +0000)]
Adopt -setOverrideRouteSharingPolicy:routingContextUID: SPI
https://bugs.webkit.org/show_bug.cgi?id=190951
<rdar://problem/45213065>

Reviewed by Alex Christensen.

Source/WebCore:

Request the correct route policy and context from the VideoFullscreenModel.

* platform/cocoa/VideoFullscreenModel.h:
(WebCore::VideoFullscreenModel::requestRouteSharingPolicyAndContextUID):
* platform/cocoa/VideoFullscreenModelVideoElement.h:
* platform/cocoa/VideoFullscreenModelVideoElement.mm:
(WebCore::VideoFullscreenModelVideoElement::requestRouteSharingPolicyAndContextUID):
* platform/ios/VideoFullscreenInterfaceAVKit.h:
* platform/ios/VideoFullscreenInterfaceAVKit.mm:
(-[WebAVPlayerViewController setWebKitOverrideRouteSharingPolicy:routingContextUID:]):
(VideoFullscreenInterfaceAVKit::setVideoFullscreenModel):
(VideoFullscreenInterfaceAVKit::doSetup):

Source/WebCore/PAL:

* pal/spi/cocoa/AVKitSPI.h:

Source/WebKit:

Add an asyncronous reply request to VideoFullscreenManager.

* Platform/IPC/MessageSender.h:
(IPC::MessageSender::sendWithAsyncReply):
* UIProcess/Cocoa/VideoFullscreenManagerProxy.h:
* UIProcess/Cocoa/VideoFullscreenManagerProxy.mm:
(WebKit::VideoFullscreenModelContext::requestRouteSharingPolicyAndContextUID):
* WebProcess/cocoa/VideoFullscreenManager.h:
* WebProcess/cocoa/VideoFullscreenManager.messages.in:
* WebProcess/cocoa/VideoFullscreenManager.mm:
(WebKit::VideoFullscreenManager::requestRouteSharingPolicyAndContextUID):

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

19 months agoRename WKWebView._safeBrowsingWarningForTesting to _safeBrowsingWarning to use it...
achristensen@apple.com [Mon, 26 Nov 2018 23:06:57 +0000 (23:06 +0000)]
Rename WKWebView._safeBrowsingWarningForTesting to _safeBrowsingWarning to use it for more than testing
https://bugs.webkit.org/show_bug.cgi?id=191981

Reviewed by Tim Horton.

Source/WebKit:

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

Tools:

* TestWebKitAPI/Tests/WebKitCocoa/SafeBrowsing.mm:
(TEST):
(safeBrowsingView):

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

19 months agoREGRESSION (r237738): Command Down Arrow doesn't scroll to the end of a page anymore
dbates@webkit.org [Mon, 26 Nov 2018 22:57:44 +0000 (22:57 +0000)]
REGRESSION (r237738): Command Down Arrow doesn't scroll to the end of a page anymore
https://bugs.webkit.org/show_bug.cgi?id=191967
<rdar://problem/45976390>

Reviewed by Tim Horton.

Source/WebKit:

Fixes an issue where pressing Command + Down Arrow does not scroll the view to the end of the page.

Following r237738 the value of the enumerations used to identify modifier keys (e.g. Shift) changed
to match the values of the corresponding enumerations in GraphicsServices, which are the
enumerations UIKit uses to computes the modifier flags bitmask when instantiating a WebEvent to
pass to WebKit. Before r237738 WebKit was using enumerations whose values matched the values
of the corresponding UIKit public API UIKeyModifier* enumerations. For non-content editable elements,
WebKit intercepts UIKit events in -_handleKeyUIEvent, synthesizes and dispatches its own WebEvent.
However it was creating WebEvents with a modifier flags bitmask built from the UIKeyModifier* enumerations,
-_modifierFlags, as opposed to a bitmask from the GraphicsServices enumerations, -_gsModifierFlags.
Instead WebKit should call -_gsModifierFlags to compute the GraphicsServices-compatible modifier
flags bitmask when instantiating a WebEvent.

* Platform/spi/ios/UIKitSPI.h: Expose -_gsModifierFlags and remove -_modifierFlags.
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _handleKeyUIEvent:]): Remove unnecessary code to update the current modifier state.
This will be done by the WebProcess when it receives the keyboard event.
(-[WKContentView _didHandleKeyEvent:eventWasHandled:]): Do not pass modifier flags changed events
to the scrolling animator as it does not know how to handle these kinds of events and triggers an
assertion failure when it tries to read the input string from the event (calls -charactersIgnoringModifiers).
FlagsChanged WebEvents events do not have an input string just like a FlagsChanged NSEvent that
they model on Mac.
* UIProcess/ios/WKWebEvent.mm:
(-[WKWebEvent initWithEvent:]): Pass the value of -_gsModifierFlags for the modifier flags bitmask
instead of the value of -_modifierFlags.

Tools:

Add more test infrastructure to dispatch key up events.

* WebKitTestRunner/ios/HIDEventGenerator.h:
* WebKitTestRunner/ios/HIDEventGenerator.mm:
(createHIDKeyEvent): Renamed from createHIDKeyDownEvent() and modified to take a boolean as
to whether to create an event for a key down or key up.
(createHIDKeyDownEvent): Deleted; renamed to createHIDKeyEvent().
* WebKitTestRunner/ios/UIScriptControllerIOS.mm:
(WTR::createUIPhysicalKeyboardEvent): Added. Convenience function to create a UIPhysicalKeyboardEvent.
(WTR::UIScriptController::keyDown): Modified to dispatch a key up event in addition to dispatching
a key down event.

LayoutTests:

Add tests to ensure that Command + Down Arrow and Command + Up Arrow scroll to the end of
the page and the top of the page, respectively.

* fast/scrolling/ios/key-command-scroll-to-bottom-expected.html: Added.
* fast/scrolling/ios/key-command-scroll-to-bottom.html: Added.
* fast/scrolling/ios/key-command-scroll-to-top-expected.html: Added.
* fast/scrolling/ios/key-command-scroll-to-top.html: Added.
* resources/ui-helper.js:
(window.UIHelper.keyDown): Pass the modifiers array to EventSender.keyDown() to make
this function work on Mac.

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

19 months ago[PSON] process pre-warming should not be on for everyone
cdumez@apple.com [Mon, 26 Nov 2018 22:54:48 +0000 (22:54 +0000)]
[PSON] process pre-warming should not be on for everyone
https://bugs.webkit.org/show_bug.cgi?id=191966
<rdar://problem/46138499>

Reviewed by Ryosuke Niwa.

If automatic process-prewarming is not explicitly turned on/off by the client, then we now only
turn it on automatically after the first process swap. Previously, it was always enabled if
process-swap on cross-site navigation was enabled (which is the case by default for all apps).

This is important because some apps do not actually browse (only display static content) or never
browse cross-site, and thus would not benefit from process prewarming and yet pay a memory cost.

* UIProcess/API/APIProcessPoolConfiguration.h:
Add m_clientWouldBenefitFromAutomaticProcessPrewarming flag which is false by default and is used
as a fallback if the client did not call setIsAutomaticProcessWarmingEnabled().

* UIProcess/API/C/WKContextConfigurationRef.cpp:
(WKContextConfigurationPrewarmsProcessesAutomatically):
(WKContextConfigurationSetPrewarmsProcessesAutomatically):
Add C API to toggle automatic process prewarming. It is needed for Safari to turn on this feature
by default for browsing. This way Safari does not have to wait for the first process swap to
start prewarming.

* UIProcess/API/C/WKContextConfigurationRef.h:
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::didReachGoodTimeToPrewarm):
Only do automatic process prewarming if process-swap on cross-site navigation is also enabled.
This is needed for clients like Safari that explicitly enable automatic process prewarming but
only want to have it enabled if PSON is also enabled via experimental features.

(WebKit::WebProcessPool::processForNavigation):
On first process swap, if the client did not explicitly turn on or off automatic process prewarming
then we enable it then. This avoids paying the cost of process prewarming in apps that would not
benefit from it.

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

19 months agoSVG use element inside a shadow tree cannot reference an element in the same tree
rniwa@webkit.org [Mon, 26 Nov 2018 22:48:08 +0000 (22:48 +0000)]
SVG use element inside a shadow tree cannot reference an element in the same tree
https://bugs.webkit.org/show_bug.cgi?id=174977
<rdar://problem/33665636>

Reviewed by Zalan Bujtas.

Source/WebCore:

Make fragment URL references used by SVGelements within a shadow tree to refer to other elements
in the same shadow tree. To do this, this patch makes targetElementFromIRIString take a TreeScope
instead of a Document, and updates its call sites.

This patch updates the most uses of targetElementFromIRIString except CSS cursor image, altGraph,
and glyphRef since the cursor image isn't really a SVG feature, and there aren't really real world
use cases in which altGraph and glyphRef are used within shadow trees.

Tests: fast/shadow-dom/svg-animate-href-change-in-shadow-tree.html
       fast/shadow-dom/svg-animate-href-in-shadow-tree.html
       fast/shadow-dom/svg-feimage-href-in-shadow-tree.html
       fast/shadow-dom/svg-linear-gradient-href-in-shadow-tree.html
       fast/shadow-dom/svg-mpath-href-change-in-shadow-tree.html
       fast/shadow-dom/svg-mpath-href-in-shadow-tree.html
       fast/shadow-dom/svg-radial-gradient-href-in-shadow-tree.html
       fast/shadow-dom/svg-text-path-href-change-in-shadow-tree.html
       fast/shadow-dom/svg-text-path-href-in-shadow-tree.html
       fast/shadow-dom/svg-thref-href-change-in-shadow-tree.html
       fast/shadow-dom/svg-thref-href-in-shadow-tree.html
       fast/shadow-dom/svg-use-href-change-in-shadow-tree.html
       fast/shadow-dom/svg-use-href-in-shadow-tree.html

* accessibility/AccessibilitySVGElement.cpp:
(WebCore::AccessibilitySVGElement::targetForUseElement const):
* css/CSSCursorImageValue.cpp:
* rendering/svg/RenderSVGTextPath.cpp:
(WebCore::RenderSVGTextPath::layoutPath const):
* svg/SVGAltGlyphElement.cpp:
(WebCore::SVGAltGlyphElement::hasValidGlyphElements const):
* svg/SVGFEImageElement.cpp:
(WebCore::SVGFEImageElement::buildPendingResource):
(WebCore::SVGFEImageElement::build):
* svg/SVGGlyphRefElement.cpp:
(WebCore::SVGGlyphRefElement::hasValidGlyphElement const):
* svg/SVGLinearGradientElement.cpp:
(WebCore::SVGLinearGradientElement::collectGradientAttributes):
* svg/SVGMPathElement.cpp:
(WebCore::SVGMPathElement::buildPendingResource):
(WebCore::SVGMPathElement::pathElement):
* svg/SVGRadialGradientElement.cpp:
(WebCore::SVGRadialGradientElement::collectGradientAttributes):
* svg/SVGTRefElement.cpp:
(WebCore::SVGTRefElement::buildPendingResource):
* svg/SVGTextPathElement.cpp:
(WebCore::SVGTextPathElement::buildPendingResource):
* svg/SVGURIReference.cpp:
(WebCore::SVGURIReference::targetElementFromIRIString):
* svg/SVGURIReference.h:
* svg/SVGUseElement.cpp:
(WebCore::SVGUseElement::updateShadowTree):
(WebCore::SVGUseElement::findTarget const):
* svg/animation/SVGSMILElement.cpp:
(WebCore::SVGSMILElement::buildPendingResource):
(WebCore::SVGSMILElement::insertedIntoAncestor):
* svg/graphics/filters/SVGFEImage.cpp:
(WebCore::FEImage::FEImage):
(WebCore::FEImage::createWithIRIReference):
(WebCore::FEImage::referencedRenderer const):
* svg/graphics/filters/SVGFEImage.h:

LayoutTests:

Added tests for specifying a fragment URL to refer to other elements within shadow trees.

This patch doesn't add a test for updating a fragment URL of linearGradient and radialGradient
since it doesn't work at all even outside shadow trees. See webkit.org/b/191934.

* fast/shadow-dom/svg-animate-href-change-in-shadow-tree-expected.html: Added.
* fast/shadow-dom/svg-animate-href-change-in-shadow-tree.html: Added.
* fast/shadow-dom/svg-animate-href-in-shadow-tree-expected.html: Added.
* fast/shadow-dom/svg-animate-href-in-shadow-tree.html: Added.
* fast/shadow-dom/svg-feimage-href-in-shadow-tree-expected.html: Added.
* fast/shadow-dom/svg-feimage-href-in-shadow-tree.html: Added.
* fast/shadow-dom/svg-linear-gradient-href-in-shadow-tree-expected.html: Added.
* fast/shadow-dom/svg-linear-gradient-href-in-shadow-tree.html: Added.
* fast/shadow-dom/svg-mpath-href-change-in-shadow-tree-expected.html: Added.
* fast/shadow-dom/svg-mpath-href-change-in-shadow-tree.html: Added.
* fast/shadow-dom/svg-mpath-href-in-shadow-tree-expected.html: Added.
* fast/shadow-dom/svg-mpath-href-in-shadow-tree.html: Added.
* fast/shadow-dom/svg-radial-gradient-href-in-shadow-tree-expected.html: Added.
* fast/shadow-dom/svg-radial-gradient-href-in-shadow-tree.html: Added.
* fast/shadow-dom/svg-text-path-href-change-in-shadow-tree-expected.html: Added.
* fast/shadow-dom/svg-text-path-href-change-in-shadow-tree.html: Added.
* fast/shadow-dom/svg-text-path-href-in-shadow-tree-expected.html: Added.
* fast/shadow-dom/svg-text-path-href-in-shadow-tree.html: Added.
* fast/shadow-dom/svg-thref-href-change-in-shadow-tree-expected.html: Added.
* fast/shadow-dom/svg-thref-href-change-in-shadow-tree.html: Added.
* fast/shadow-dom/svg-thref-href-in-shadow-tree-expected.html: Added.
* fast/shadow-dom/svg-thref-href-in-shadow-tree.html: Added.
* fast/shadow-dom/svg-use-href-change-in-shadow-tree-expected.html: Added.
* fast/shadow-dom/svg-use-href-change-in-shadow-tree.html: Added.
* fast/shadow-dom/svg-use-href-in-shadow-tree-expected.html: Added.
* fast/shadow-dom/svg-use-href-in-shadow-tree.html: Added.

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

19 months agoUnreviewed, rolling out r238357.
tsavell@apple.com [Mon, 26 Nov 2018 22:22:07 +0000 (22:22 +0000)]
Unreviewed, rolling out r238357.

Casued three css tests to fail and crash on ios sim

Reverted changeset:

"Avoid triggering compositing updates when only the root layer
is composited"
https://bugs.webkit.org/show_bug.cgi?id=191813
https://trac.webkit.org/changeset/238357

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

19 months agoCaret disappears at end of password field when caps lock indicator is shown; password...
dbates@webkit.org [Mon, 26 Nov 2018 22:15:16 +0000 (22:15 +0000)]
Caret disappears at end of password field when caps lock indicator is shown; password field
not scrolled when caps lock indicator is shown
https://bugs.webkit.org/show_bug.cgi?id=191164
<rdar://problem/45738179>

Reviewed by Dean Jackson.

Source/WebCore:

Fixes an issue where the caret may be occluded by- or paint on top of- the caps lock indicator on
Mac and iOS, respectively.

If there has not been a previous selection in a focused password field, including a caret
selection made by pressing the arrow keys, then we never scroll the password field to reveal
the current selection when the caps lock indicator is made visible. When the caps lock indicator
is made visible or hidden the size of the inner text renderer changes as it shrinks or expands
to make space for the caps lock indicator or to fill the void of the now hidden caps lock indicator,
respectively. We should detect such size changes and schedule an update and reveal of the current
selection after layout.

Test: fast/forms/password-scrolled-after-caps-lock-toggled.html

* editing/FrameSelection.cpp:
(WebCore::FrameSelection::setNeedsSelectionUpdate): Modified to take an enum to override the current
selection reveal mode for the next update.
* editing/FrameSelection.h:
* rendering/RenderTextControlSingleLine.cpp:
(WebCore::RenderTextControlSingleLine::layout): Schedule post-layout a selection update that
reveals the current selection. We pass FrameSelection::RevealSelectionAfterUpdate::Forced to ensure
that the scheduled selection update scrolls to the reveal the current selection regardless of selection
reveal mode. This is necessary because typing into a password field does not change the current
selection reveal mode.

LayoutTests:

Add a test to ensure that we scroll the password field when caps lock is toggled.

* TestExpectations: Skip the test on all platforms as we only support toggling Caps Lock in
WebKit2 on Mac at the moment.
* fast/forms/password-scrolled-after-caps-lock-toggled-expected.txt: Added.
* fast/forms/password-scrolled-after-caps-lock-toggled.html: Added.
* platform/mac-wk2/TestExpectations: Mark the test as PASS so that we run it.

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

19 months agoPlaceholder text is not repainted after caps lock indicator is hidden
dbates@webkit.org [Mon, 26 Nov 2018 21:55:42 +0000 (21:55 +0000)]
Placeholder text is not repainted after caps lock indicator is hidden
https://bugs.webkit.org/show_bug.cgi?id=191968
<rdar://problem/46247234>

Substitute UIHelper.toggleCapsLock() for testRunner.toggleCapsLock() as the former replaces
the latter following r238512.

* fast/repaint/placeholder-after-caps-lock-hidden.html:

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

19 months agoPlaceholder text is not repainted after caps lock indicator is hidden
dbates@webkit.org [Mon, 26 Nov 2018 21:50:17 +0000 (21:50 +0000)]
Placeholder text is not repainted after caps lock indicator is hidden
https://bugs.webkit.org/show_bug.cgi?id=191968
<rdar://problem/46247234>

Reviewed by Zalan Bujtas.

Source/WebCore:

Fixes an issue where the placeholder text in a password field is not repainted when the
caps lock indicator is hidden.

The placeholder renderer is special. It is an excluded child renderer and does not take
part in normal flow layout. It is also created and destroyed as needed. The caps lock
indicator is also special in that it is implemented as a RenderImage and we do not know
its dimensions before it is loaded and the load happens asynchronously. As a result we
detect when the inner text size changes and mark the placeholder as dirty as a way to
keep the dimensions of the placeholder in sync with the dimensions of the inner text.

Test: fast/repaint/placeholder-after-caps-lock-hidden.html

* rendering/RenderTextControlSingleLine.cpp:
(WebCore::RenderTextControlSingleLine::layout): Mark the placeholder as needing layout
the size of the inner text changes.

LayoutTests:

Add a test to ensure to that the placeholder text is repainted when the caps lock indicator is hidden.

* TestExpectations: Skip the test on all platforms as we only support toggling Caps Lock in
WebKit2 on Mac at the moment.
* fast/repaint/placeholder-after-caps-lock-hidden.html: Added.
* platform/mac-wk2/TestExpectations: Mark the test as PASS so that we run it.

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

19 months ago[ews-app] Set Foreign Keys in EWS Django app models
aakash_jain@apple.com [Mon, 26 Nov 2018 21:44:27 +0000 (21:44 +0000)]
[ews-app] Set Foreign Keys in EWS Django app models
https://bugs.webkit.org/show_bug.cgi?id=191790

Reviewed by Lucas Forschler.

* BuildSlaveSupport/ews-app/ews/models/builds.py: Set Foreign Key.
* BuildSlaveSupport/ews-app/ews/models/steps.py: Ditto.

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

19 months ago[ews-app] Do not store patch content in database
aakash_jain@apple.com [Mon, 26 Nov 2018 21:39:46 +0000 (21:39 +0000)]
[ews-app] Do not store patch content in database
https://bugs.webkit.org/show_bug.cgi?id=191788

Reviewed by Lucas Forschler.

* BuildSlaveSupport/ews-app/ews/models/patch.py: Removed content field.

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

19 months agoPicture-in-picture window size changes unnecesarily when URL changes.
commit-queue@webkit.org [Mon, 26 Nov 2018 21:19:52 +0000 (21:19 +0000)]
Picture-in-picture window size changes unnecesarily when URL changes.
https://bugs.webkit.org/show_bug.cgi?id=191787

Patch by Jeremy Jones <jeremyj@apple.com> on 2018-11-26
Reviewed by Jer Noble.

When loading a new URL, the video dimensions are temporarily 0,0. Instead of
defaulting back to 4:3 sized pip window temporarily, keep the old dimensions until
there is a new valid size.

* platform/ios/VideoFullscreenInterfaceAVKit.mm:
(VideoFullscreenInterfaceAVKit::videoDimensionsChanged):

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

19 months ago[Cocoa] Make it easier to encode NSObjects
aestes@apple.com [Mon, 26 Nov 2018 21:13:47 +0000 (21:13 +0000)]
[Cocoa] Make it easier to encode NSObjects
https://bugs.webkit.org/show_bug.cgi?id=191948

Reviewed by Dean Jackson.

Source/WebCore:

* Modules/applepay/Payment.h: Changed the PKPayment * constructor to take a
RetainPtr<PKPayment>&& instead.
* Modules/applepay/PaymentContact.h: Ditto for PKContact.
* Modules/applepay/PaymentMerchantSession.h: Ditto for PKPaymentMerchantSession.
* Modules/applepay/PaymentMethod.h: Ditto for PKPaymentMethod.
* Modules/applepay/cocoa/PaymentCocoa.mm:
(WebCore::Payment::Payment): Moved definition out-of-line.
(WebCore::Payment::pkPayment const): Ditto.
* Modules/applepay/cocoa/PaymentContactCocoa.mm:
(WebCore::PaymentContact::PaymentContact): Ditto.
(WebCore::PaymentContact::pkContact const): Ditto.
* Modules/applepay/cocoa/PaymentMethodCocoa.mm:
(WebCore::PaymentMethod::PaymentMethod): Ditto.
(WebCore::PaymentMethod::pkPaymentMethod const): Ditto.

Source/WebCore/PAL:

* pal/spi/cocoa/PassKitSPI.h: Declared some classes that secretly conform to NSSecureCoding.

Source/WebKit:

It should be easier to encode objects that conform to NSSecureCoding for WebKit IPC. Right
now, several argument coders duplicate the logic for encoding and decoding objects using
NSKeyedArchiver and NSKeyedUnarchiver.

This patch adds encodeObject() and decodeObject() primitives for encoding and decoding using
Foundation keyed archiving. It then partially specializes ArgumentCoder for raw pointers and
RetainPtrs whose pointee conforms to NSSecureCoding to call these new primitives.

This allows us to use Encoder::operator<< to encode raw pointers or RetainPtrs and use
Decoder::operator>> to decode to an optional RetainPtr. By default, IPC::decode infers the
allowed class for decoding by calling `[T class]`. We can also specify the allowed classes
explicitly for containers and classes that are loaded at runtime.

* Shared/Cocoa/ArgumentCodersCocoa.h: Added.
* Shared/Cocoa/ArgumentCodersCocoa.mm: Added.
* Shared/Cocoa/DataDetectionResult.mm:
(WebKit::DataDetectionResult::encode const): Removed custom encoding code and used ArgumentCodersCocoa instead.
(WebKit::DataDetectionResult::decode): Ditto.
* Shared/Cocoa/WebCoreArgumentCodersCocoa.mm:
(IPC::ArgumentCoder<WebCore::Payment>::encode): Ditto.
(IPC::ArgumentCoder<WebCore::Payment>::decode): Ditto.
(IPC::ArgumentCoder<WebCore::PaymentAuthorizationResult>::decode): Ditto.
(IPC::ArgumentCoder<WebCore::PaymentContact>::encode): Ditto.
(IPC::ArgumentCoder<WebCore::PaymentContact>::decode): Ditto.
(IPC::ArgumentCoder<WebCore::PaymentMerchantSession>::encode): Ditto.
(IPC::ArgumentCoder<WebCore::PaymentMerchantSession>::decode): Ditto.
(IPC::ArgumentCoder<WebCore::PaymentMethod>::encode): Ditto.
(IPC::ArgumentCoder<WebCore::PaymentMethod>::decode): Ditto.
(IPC::ArgumentCoder<ApplePaySessionPaymentRequest>::decode): Ditto.
* Shared/RemoteLayerTree/RemoteLayerTreeTransaction.mm:
(WebKit::RemoteLayerTreeTransaction::description const): Added some needed namespaces due to unified source shuffling.
* Shared/WebCoreArgumentCoders.h: Modernized several decoders.
* Shared/ios/InteractionInformationAtPosition.mm:
(WebKit::InteractionInformationAtPosition::encode const): Removed custom encoding code and used ArgumentCodersCocoa instead.
(WebKit::InteractionInformationAtPosition::decode): Ditto.
* Shared/mac/WebCoreArgumentCodersMac.mm:
(IPC::ArgumentCoder<WebCore::ProtectionSpace>::encodePlatformData): Ditto.
(IPC::ArgumentCoder<WebCore::ProtectionSpace>::decodePlatformData): Ditto.
(IPC::ArgumentCoder<WebCore::Credential>::encodePlatformData): Ditto.
(IPC::ArgumentCoder<WebCore::Credential>::decodePlatformData): Ditto.
(IPC::ArgumentCoder<WebCore::MediaPlaybackTargetContext>::encodePlatformData): Ditto.
(IPC::ArgumentCoder<WebCore::MediaPlaybackTargetContext>::decodePlatformData): Ditto.
(IPC::deviceContextKey): Deleted.
* Shared/mac/WebHitTestResultData.mm:
(WebKit::WebHitTestResultData::platformEncode const): Ditto.
(WebKit::WebHitTestResultData::platformDecode): Ditto.
* SourcesCocoa.txt: Added ArgumentCodersCocoa.mm.
* WebKit.xcodeproj/project.pbxproj: Ditto.

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

19 months agowebkitpy: Retry app installation on watchOS simulators (Follow-up fix)
jbedard@apple.com [Mon, 26 Nov 2018 20:55:42 +0000 (20:55 +0000)]
webkitpy: Retry app installation on watchOS simulators (Follow-up fix)
https://bugs.webkit.org/show_bug.cgi?id=191769
<rdar://problem/46139850>

Unreviewed infrastructure fix.

* Scripts/webkitpy/xcode/simulated_device.py:
(SimulatedDevice): Increase retry attempts.

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

19 months agoREGRESSION (r238078): Do not draw caps lock indicator when Strong Password button...
dbates@webkit.org [Mon, 26 Nov 2018 20:42:22 +0000 (20:42 +0000)]
REGRESSION (r238078): Do not draw caps lock indicator when Strong Password button is shown
https://bugs.webkit.org/show_bug.cgi?id=191969
<rdar://problem/46247569>

Reviewed by Dean Jackson.

Source/WebCore:

Following r238078 we now support drawing the caps lock indicator in password fields on iOS.
However it is not meaningful to show the caps lock indicator when the Strong Password button
is visible because the password field is not editable. We should not paint the caps lock
indicator when the Strong Password button is visible.

Tests: fast/forms/auto-fill-button/caps-lock-indicator-should-be-visible-when-after-hiding-auto-fill-strong-password-button.html
       fast/forms/auto-fill-button/caps-lock-indicator-should-not-be-visible-when-auto-fill-strong-password-button-is-visible.html

* html/TextFieldInputType.cpp:
(WebCore::TextFieldInputType::shouldDrawCapsLockIndicator const): Do not draw the caps
lock indicator when the password field has the Strong Password button.
(WebCore::TextFieldInputType::updateAutoFillButton): Call capsLockStateMayHaveChanged() to
update the visibility of the caps lock indicator when the auto fill button has changed.

LayoutTests:

Add tests to ensure that we show or hide the caps lock indicator depending on whether the
Strong Password button is visible.

* TestExpectations: Skip the tests below on all platforms. We will selectively enable them on Mac.
* fast/forms/auto-fill-button/caps-lock-indicator-should-be-visible-when-after-hiding-auto-fill-strong-password-button-expected.html: Added.
* fast/forms/auto-fill-button/caps-lock-indicator-should-be-visible-when-after-hiding-auto-fill-strong-password-button.html: Added.
* fast/forms/auto-fill-button/caps-lock-indicator-should-not-be-visible-when-auto-fill-strong-password-button-is-visible-expected.html: Added.
* fast/forms/auto-fill-button/caps-lock-indicator-should-not-be-visible-when-auto-fill-strong-password-button-is-visible.html: Added.
* platform/mac-wk2/TestExpectations: Mark the tests above as PASS so that we run them.

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

19 months agoMove testRunner.toggleCapsLock() to uiController
dbates@webkit.org [Mon, 26 Nov 2018 20:41:19 +0000 (20:41 +0000)]
Move testRunner.toggleCapsLock() to uiController
https://bugs.webkit.org/show_bug.cgi?id=191972

Reviewed by Tim Horton.

Tools:

Move testRunner.toggleCapsLock() to uiController as uiController is the preferred JavaScript
object for UI test functions. Having this functionality be on uiController makes it an
asynchronous function naturally and complements use of onkeydown, onkeyup listeners to know
when the Caps Lock key event is dispatched. It also facilitates its use directly as part of
scripts with other uiController functions invocations that are passed in a single invocation
of testRunner.runUIScript().

* DumpRenderTree/ios/UIScriptControllerIOS.mm:
(WTR::UIScriptController::toggleCapsLock):
* DumpRenderTree/mac/UIScriptControllerMac.mm:
(WTR::UIScriptController::toggleCapsLock):
Added stub functions that invoke the callback. We do not support toggling caps lock in Legacy
WebKit at the moment. Legacy WebKit reads the caps lock key state directly from the OS. Modern
WebKit caches the caps lock state in the WebProcess as a natural side effect of the fact that
the UIProcess is the only process capable of querying the caps lock key state from the OS and
hence the UIProcess must send over this state to the WebProcess.

* TestRunnerShared/UIScriptContext/Bindings/UIScriptController.idl: Add IDL for new function.
* TestRunnerShared/UIScriptContext/UIScriptController.cpp:
(WTR::UIScriptController::toggleCapsLock): Added empty implementation for ports non-Cocoa ports.
* TestRunnerShared/UIScriptContext/UIScriptController.h:

* WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl:
* WebKitTestRunner/InjectedBundle/TestRunner.cpp:
(WTR::TestRunner::toggleCapsLock): Deleted.
* WebKitTestRunner/InjectedBundle/TestRunner.h:
* WebKitTestRunner/TestController.h:
* WebKitTestRunner/TestInvocation.cpp:
(WTR::TestInvocation::didReceiveSynchronousMessageFromInjectedBundle):
* WebKitTestRunner/cocoa/TestControllerCocoa.mm:
(WTR::TestController::toggleCapsLock): Deleted; moved to UIScriptController::toggleCapsLock().
Removed logic to handle testRunner.toggleCapsLock().

* WebKitTestRunner/ios/UIScriptControllerIOS.mm:
(WTR::UIScriptController::toggleCapsLock): Add stub function that invokes the callback
and a FIXME comment that explains that we will implement this function in <https://bugs.webkit.org/show_bug.cgi?id=191815>.
* WebKitTestRunner/mac/UIScriptControllerMac.mm:
(WTR::UIScriptController::toggleCapsLock): Moved the implementation from TestController::toggleCapsLock().

LayoutTests:

Updated existing test to use UIHelper.toggleCapsLock(), which calls uiController.toggleCapsLock(),
now that testRunner.toggleCapsLock() was removed.

* fast/events/detect-caps-lock.html:
* resources/ui-helper.js:
(window.UIHelper.toggleCapsLock): Added. Convenience function to call uiController.toggleCapsLock()
and return a Promise that is resolved once the UIProcess has dispatched the NSEvent to simulate
pressing the caps lock key.

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

19 months agoInPlaceAbstractState::endBasicBlock rule for SetLocal should filter the value based...
sbarati@apple.com [Mon, 26 Nov 2018 20:29:33 +0000 (20:29 +0000)]
InPlaceAbstractState::endBasicBlock rule for SetLocal should filter the value based on the flush format
https://bugs.webkit.org/show_bug.cgi?id=191956
<rdar://problem/45665806>

Reviewed by Yusuke Suzuki.

JSTests:

* stress/end-basic-block-set-local-should-filter-type.js: Added.
(bar):
(foo):

Source/JavaScriptCore:

This is a similar bug to what Keith fixed in r232134. The issue is if we have
a program like this:

a: JSConstant(jsNumber(0))
b: SetLocal(Int32:@a, loc1, FlushedInt32)
c: ArrayifyToStructure(Cell:@a)
d: Jump(...)

At the point in the program right after the Jump, a GetLocal for loc1
would return whatever the ArrayifyToStructure resulting type is. This breaks
the invariant that a GetLocal must return a value that is a subtype of its
FlushFormat. InPlaceAbstractState::endBasicBlock will know if a SetLocal is
the final node touching a local slot. If so, it'll see if any nodes later
in the block may have refined the type of the value stored in that slot. If
so, endBasicBlock() further refines the type to ensure that any GetLocals
loading from the same slot will result in having this more refined type.
However, we must ensure that this logic only considers types within the
hierarchy of the variable access data's FlushFormat, otherwise, we may
break the invariant that a GetLocal's type is a subtype of its FlushFormat.

* dfg/DFGInPlaceAbstractState.cpp:
(JSC::DFG::InPlaceAbstractState::endBasicBlock):

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

19 months agoObject allocation sinking phase needs to iterate each scope offset instead of just...
sbarati@apple.com [Mon, 26 Nov 2018 20:14:41 +0000 (20:14 +0000)]
Object allocation sinking phase needs to iterate each scope offset instead of just iterating the symbol table's hashmap when handling an activation
https://bugs.webkit.org/show_bug.cgi?id=191958
<rdar://problem/46221877>

Reviewed by Yusuke Suzuki.

JSTests:

* stress/object-allocation-sinking-phase-needs-to-write-to-each-scope-offset.js: Added.
(x):
(foo):

Source/JavaScriptCore:

There may be more entries in an activation than unique variables
in a symbol table's hashmap. For example, if you have two parameters
to a function, and they both are the same name, and the function
uses eval, we'll end up with two scope slots, but only a single
entry in the hashmap in the symbol table. Object allocation sinking
phase was previously iterating over the hashmap, assuming these
values were equivalent. This is wrong in the above case. Instead,
we need to iterate over each scope offset.

* dfg/DFGObjectAllocationSinkingPhase.cpp:
* runtime/GenericOffset.h:
(JSC::GenericOffset::operator+=):
(JSC::GenericOffset::operator-=):

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

19 months agoNaNs read from Wasm code needs to be be purified.
mark.lam@apple.com [Mon, 26 Nov 2018 20:06:30 +0000 (20:06 +0000)]
NaNs read from Wasm code needs to be be purified.
https://bugs.webkit.org/show_bug.cgi?id=191056
<rdar://problem/45660341>

Reviewed by Filip Pizlo.

JSTests:

* wasm/regress/regress-191056.js: Added.

Source/JavaScriptCore:

* wasm/js/WebAssemblyModuleRecord.cpp:
(JSC::WebAssemblyModuleRecord::link):

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

19 months ago32-bit JSC test failure: stress/regexp-compile-oom.js
msaboff@apple.com [Mon, 26 Nov 2018 19:59:41 +0000 (19:59 +0000)]
32-bit JSC test failure: stress/regexp-compile-oom.js
https://bugs.webkit.org/show_bug.cgi?id=191375

Reviewed by Mark Lam.

Disabled the test for 32 bit platforms.

* stress/regexp-compile-oom.js:

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

19 months agoCompletionHandler-based async IPC messages only work when the completion handler...
wenson_hsieh@apple.com [Mon, 26 Nov 2018 19:55:30 +0000 (19:55 +0000)]
CompletionHandler-based async IPC messages only work when the completion handler takes a single argument
https://bugs.webkit.org/show_bug.cgi?id=191965

Reviewed by Tim Horton.

Teach `messages.py` to handle the case where an async IPC completion handler takes no arguments, or takes more
than a single argument. Currently, the generated code attempts to wrap all arguments in a `WTFMove(*~)`, but
this either results in `WTFMove(*)` in the case where there are no arguments, or `WTFMove(*foo, *bar, *baz)` in
the case where there are several arguments. Both of these results fail to compile.

Instead, emit `completionHandler()` when there are no arguments, and
`completionHandler(WTFMove(*foo), WTFMove(*bar), WTFMove(*baz))` when there are multiple arguments.

Tests:  TestAsyncMessageWithNoArguments
        TestAsyncMessageWithMultipleArguments

* Scripts/webkit/MessageReceiverSuperclass-expected.cpp:
(Messages::WebPage::TestAsyncMessageWithNoArguments::callReply):
(Messages::WebPage::TestAsyncMessageWithNoArguments::cancelReply):
(Messages::WebPage::TestAsyncMessageWithNoArguments::send):
(Messages::WebPage::TestAsyncMessageWithMultipleArguments::callReply):
(Messages::WebPage::TestAsyncMessageWithMultipleArguments::cancelReply):
(Messages::WebPage::TestAsyncMessageWithMultipleArguments::send):
(WebKit::WebPage::didReceiveMessage):
* Scripts/webkit/MessagesSuperclass-expected.h:
(Messages::WebPage::TestAsyncMessageWithNoArguments::receiverName):
(Messages::WebPage::TestAsyncMessageWithNoArguments::name):
(Messages::WebPage::TestAsyncMessageWithNoArguments::asyncMessageReplyName):
(Messages::WebPage::TestAsyncMessageWithNoArguments::arguments const):
(Messages::WebPage::TestAsyncMessageWithMultipleArguments::receiverName):
(Messages::WebPage::TestAsyncMessageWithMultipleArguments::name):
(Messages::WebPage::TestAsyncMessageWithMultipleArguments::asyncMessageReplyName):
(Messages::WebPage::TestAsyncMessageWithMultipleArguments::arguments const):
* Scripts/webkit/messages.py:
* Scripts/webkit/messages_unittest.py:

Add new `messages.py` unit tests to cover these cases.

* Scripts/webkit/test-superclass-messages.in:

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

19 months agoStreamline ListHashSet use in floating object code
commit-queue@webkit.org [Mon, 26 Nov 2018 19:29:23 +0000 (19:29 +0000)]
Streamline ListHashSet use in floating object code
https://bugs.webkit.org/show_bug.cgi?id=191957

Patch by Sam Weinig <sam@webkit.org> on 2018-11-26
Reviewed by Alex Christensen.

Source/WebCore:

Simplify use of ListHashSet by using new raw pointer overloads and
making use of reversed order of template arguments in the find() and
contains() overloads that take hash translators.

* rendering/FloatingObjects.cpp:
(WebCore::FloatingObjects::remove):
Use raw pointer overloads of contains and remove. Remove seperate call
to find / check agains end() which is unnecessary as remove() already
does that.

* rendering/FloatingObjects.h:
(WebCore::FloatingObjectHashFunctions::hash):
(WebCore::FloatingObjectHashFunctions::equal):
(WebCore::FloatingObjectHashTranslator::hash):
(WebCore::FloatingObjectHashTranslator::equal):
Add hash()/equal() overloads for the raw pointer cases. As the FIXME
notes, this could be simplified by changing PtrHashBase to use designated
bottleneck functions for hash() and equal().

* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::containsFloat const):
(WebCore::RenderBlockFlow::insertFloatingObject):
(WebCore::RenderBlockFlow::removeFloatingObject):
(WebCore::RenderBlockFlow::hasOverhangingFloat):
(WebCore::RenderBlockFlow::addIntrudingFloats):
Use simplified calls.

* rendering/RenderBlockLineLayout.cpp:
(WebCore::RenderBlockFlow::layoutRunsAndFloatsInRange):
(WebCore::RenderBlockFlow::linkToEndLineIfNeeded):
Use simplified calls.

Source/WTF:

* wtf/ListHashSet.h:
Reverses the order of the template arguments for the find() and contains()
overload that allow specifying a hash translator to allow the compiler to
deduce type T. This simplifies call sites and matches other WTF containers.

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

19 months agoUse Full Screen consistently in localizable strings.
commit-queue@webkit.org [Mon, 26 Nov 2018 19:15:11 +0000 (19:15 +0000)]
Use Full Screen consistently in localizable strings.
https://bugs.webkit.org/show_bug.cgi?id=190363
rdar://problem/43882333

Patch by Jeremy Jones <jeremyj@apple.com> on 2018-11-26
Reviewed by Jon Lee.

Source/WebCore:

No new tests because only change is to localizable strings.

Rename "Fullscreen" to "Full Screen" in localizable strings for consistency.

* English.lproj/Localizable.strings:
* platform/LocalizedStrings.cpp:
(WebCore::contextMenuItemTagEnterVideoFullscreen):
(WebCore::contextMenuItemTagExitVideoFullscreen):
(WebCore::localizedMediaControlElementHelpText):

Source/WebKit:

Rename "Fullscreen" to "Full Screen" in localizable strings for consistency.

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

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

19 months agoWeb Inspector: "No Filter Results" in navigation sidebar should have a button to...
drousso@apple.com [Mon, 26 Nov 2018 19:01:04 +0000 (19:01 +0000)]
Web Inspector: "No Filter Results" in navigation sidebar should have a button to clear filters
https://bugs.webkit.org/show_bug.cgi?id=191916

Reviewed by Joseph Pecoraro.

* UserInterface/Views/NavigationSidebarPanel.js:
(WI.NavigationSidebarPanel.prototype.resetFilter): Added.
(WI.NavigationSidebarPanel.prototype._checkForEmptyFilterResults.checkTreeOutlineForEmptyFilterResults):

* UserInterface/Views/FilterBar.js:
(WI.FilterBar.prototype.clear):

* UserInterface/Views/FilterBarButton.js:
(WI.FilterBarButton.prototype.toggle):

* UserInterface/Views/ResourceSidebarPanel.js:
(WI.ResourceSidebarPanel.prototype.resetFilter): Added.
* UserInterface/Views/StorageSidebarPanel.js:
(WI.StorageSidebarPanel.prototype.resetFilter): Added.

* UserInterface/Views/AuditTestContentView.js:
(WI.AuditTestContentView.prototype.showFilteredPlaceholder):
* UserInterface/Views/NetworkTableContentView.js:
(WI.NetworkTableContentView.prototype._showEmptyFilterResultsMessage):

* UserInterface/Views/Main.css:
(.message-text-view > .message + button): Added.

* Localizations/en.lproj/localizedStrings.js:

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

19 months ago[Win] Reduce the use of WKSI library calls: CoreAnimation
bfulgham@apple.com [Mon, 26 Nov 2018 18:26:48 +0000 (18:26 +0000)]
[Win] Reduce the use of WKSI library calls: CoreAnimation
https://bugs.webkit.org/show_bug.cgi?id=191777
<rdar://problem/46140542>

Reviewed by Zalan Bujtas.

Update the Windows build of WebKit to refer to the SPI headers, rather than WebKitSystemInterface.
Move a small amount of glue code from WKSI to WebCore, and remove any includes or link
directives for WebKitSystemInterface.lib.
Source/WebCore:

No new tests. No change in behavior.

* platform/graphics/BitmapImage.cpp:
* platform/graphics/ca/win/CACFLayerTreeHost.h:
* platform/graphics/ca/win/PlatformCALayerWin.cpp:
(layerTreeHostForLayer):
* platform/graphics/cg/GraphicsContextCG.cpp:
* platform/graphics/cg/PathCG.cpp:
* platform/graphics/cg/PatternCG.cpp:
* platform/graphics/win/WKCAImageQueue.cpp:

Source/WebKitLegacy:

* PlatformWin.cmake:

Source/WebKitLegacy/win:

* FullscreenVideoController.cpp:
* WebKitGraphics.cpp:
* WebPreferences.cpp:

Tools:

* TestWebKitAPI/PlatformWin.cmake:

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

19 months agoWeb Inspector: Audit: automatically add to tab bar when the experimental setting...
drousso@apple.com [Mon, 26 Nov 2018 18:20:55 +0000 (18:20 +0000)]
Web Inspector: Audit: automatically add to tab bar when the experimental setting is enabled
https://bugs.webkit.org/show_bug.cgi?id=191659

Reviewed by Joseph Pecoraro.

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

* UserInterface/Base/Main.js:
(WI.loaded):
Drive-by: use existing constants instead of hard-coded strings for consistency.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@238500 268f45cc-cd09-0410-ab3c-d52691b4dbfc

19 months agoASSERTION FAILED: m_outOfLineJumpTargets.contains(bytecodeOffset)
tzagallo@apple.com [Mon, 26 Nov 2018 18:15:18 +0000 (18:15 +0000)]
ASSERTION FAILED: m_outOfLineJumpTargets.contains(bytecodeOffset)
https://bugs.webkit.org/show_bug.cgi?id=191716
<rdar://problem/45723878>

Reviewed by Saam Barati.

JSTests:

* stress/regress-187373.js: Added.
(async.fn):

Source/JavaScriptCore:

After https://bugs.webkit.org/show_bug.cgi?id=187373, when updating
jump targets during generatorification, we only stored the new jump
target when it changed. However, the out-of-line jump targets are
cleared at the beginning of the pass, so we need to store it
unconditionally.

* bytecode/PreciseJumpTargetsInlines.h:
(JSC::extractStoredJumpTargetsForInstruction):
(JSC::updateStoredJumpTargetsForInstruction):

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

19 months agoWire up ChromeClient::takeFocus() on iOS
dbates@webkit.org [Mon, 26 Nov 2018 17:42:12 +0000 (17:42 +0000)]
Wire up ChromeClient::takeFocus() on iOS
https://bugs.webkit.org/show_bug.cgi?id=191763
<rdar://problem/18584508>

Reviewed by Dan Bernstein.

Expose existing Mac SPI for use on iOS. This will allow Safari to be notified when
the engine has cycled through all the tab focusable elements on the page.

* UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
* UIProcess/Cocoa/UIDelegate.h:
* UIProcess/Cocoa/UIDelegate.mm:
(WebKit::UIDelegate::setDelegate):

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

19 months agoUnreviewed, fix the internal 32-bit macOS 10.13 build after r238471
wenson_hsieh@apple.com [Mon, 26 Nov 2018 17:11:48 +0000 (17:11 +0000)]
Unreviewed, fix the internal 32-bit macOS 10.13 build after r238471

r238471 added an `#include WebPageMessages.h` in `WebPage.h`, which causes the 32-bit macOS build using an
internal macOS SDK ≤ 10.13 to fail. To address this, move the `#include` back under `PLATFORM(IOS_FAMILY)` by
changing the parameters of `WebPage::removeDataDetectedLinks` and `WebPage::detectDataInAllFrames` to completion
handlers rather than async IPC replies.

* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::removeDataDetectedLinks):
(WebKit::WebPage::detectDataInAllFrames):
* WebProcess/WebPage/WebPage.h:

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

19 months agoUnreviewed rebaseline after r238493.
zalan@apple.com [Mon, 26 Nov 2018 16:49:55 +0000 (16:49 +0000)]
Unreviewed rebaseline after r238493.

* platform/ios/fast/inline/inline-content-with-float-and-margin-expected.txt: Added.

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

19 months agoUnreviewed test gardening after r238280.
zalan@apple.com [Mon, 26 Nov 2018 16:24:20 +0000 (16:24 +0000)]
Unreviewed test gardening after r238280.

* fast/content-observation/click-event-suppression-on-content-change.html:

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

19 months agoUnreviewed rebaseline after r238460.
zalan@apple.com [Mon, 26 Nov 2018 15:30:15 +0000 (15:30 +0000)]
Unreviewed rebaseline after r238460.

* platform/ios/fast/inline/inline-content-with-image-simple-expected.txt: Added.

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

19 months ago[LFC][IFC] Use float box's margin box to adjust the line constraints.
zalan@apple.com [Mon, 26 Nov 2018 15:23:44 +0000 (15:23 +0000)]
[LFC][IFC] Use float box's margin box to adjust the line constraints.
https://bugs.webkit.org/show_bug.cgi?id=191961

Reviewed by Antti Koivisto.

Source/WebCore:

Test: fast/inline/inline-content-with-float-and-margin.html

(WebCore::Layout::outputMismatchingComplexLineInformationIfNeeded):
(WebCore::Layout::LayoutState::verifyAndOutputMismatchingLayoutTree const):
* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::layoutInlineContent const):

Tools:

* LayoutReloaded/misc/LFC-passing-tests.txt:

LayoutTests:

* fast/inline/inline-content-with-float-and-margin-expected.txt: Added.
* fast/inline/inline-content-with-float-and-margin.html: Added.

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

19 months ago[GTK] Accessing default web context before gtk_init results in drawing failure (Gtk...
carlosgc@webkit.org [Mon, 26 Nov 2018 14:18:37 +0000 (14:18 +0000)]
[GTK] Accessing default web context before gtk_init results in drawing failure (Gtk-WARNING **: drawing failure for widget 'WebKitWebView': invalid value for an input Visual*)
https://bugs.webkit.org/show_bug.cgi?id=150303

Reviewed by Michael Catanzaro.

Ensure gtk has been initialized before trying to get the default display.

* platform/graphics/PlatformDisplay.cpp:
(WebCore::PlatformDisplay::createPlatformDisplay):

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

19 months ago[css-grid] absolute positioned child is sized wrongly when using auto-fit, generating...
jfernandez@igalia.com [Mon, 26 Nov 2018 12:09:04 +0000 (12:09 +0000)]
[css-grid] absolute positioned child is sized wrongly when using auto-fit, generating spurious collapsed tracks
https://bugs.webkit.org/show_bug.cgi?id=191938

Reviewed by Manuel Rego Casasnovas.

LayoutTests/imported/w3c:

This change makes several cases of the following tests to pass now.

* web-platform-tests/css/css-grid/abspos/grid-positioned-items-and-autofit-tracks-004-expected.txt:
* web-platform-tests/css/css-grid/abspos/grid-positioned-items-and-autofit-tracks-005-expected.txt:
* web-platform-tests/css/css-grid/abspos/grid-positioned-items-and-autofit-tracks-006-expected.txt:
* web-platform-tests/css/css-grid/abspos/grid-positioned-items-and-autofit-tracks-007-expected.txt:

Source/WebCore:

The guttersSize function has a complex logic to compute the gaps in a
specific GridSpan, considering different scenarios of collapsed tracks
for such span.

The first case is avoiding the duplicated gap because of trailing
collapsed tracks.

The second case considered is looking for non-empty tracks before the
GridSpan end, if it points to an empty track, so we must add this gap.

The last case is to consider the gap of non-empty tracks after the
GridSpan end line, if it points to an empty track.

There are several cases that are not considered or incorrectly computed.
This patch addresses those cases; basically, we should only consider gaps
when there are non-empty tracks before and after the collapsed tracks.
Additionally, we should avoid duplicating the gaps size adding both,
before and after non-empty track's gap.

No new tests, this change is covered by current tests and make several cases to pass now.

* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::guttersSize const):

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

19 months agoClean up layer tree freezing logic in WebPage
antti@apple.com [Mon, 26 Nov 2018 09:40:49 +0000 (09:40 +0000)]
Clean up layer tree freezing logic in WebPage
https://bugs.webkit.org/show_bug.cgi?id=191826

Reviewed by Dean Jackson.

Use OptionSet<LayerTreeFreezeReason> to track various reasons that can cause layer tree to get frozen.

* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::reinitializeWebPage):
(WebKit::WebPage::freezeLayerTree):
(WebKit::WebPage::unfreezeLayerTree):
(WebKit::WebPage::updateDrawingAreaLayerTreeFreezeState):

Layer tree is unfrozen when there there are no reasons to freeze it.

(WebKit::WebPage::didStartPageTransition):
(WebKit::WebPage::didCompletePageTransition):
(WebKit::WebPage::beginPrinting):
(WebKit::WebPage::endPrinting):
(WebKit::WebPage::setIsSuspended):
(WebKit::WebPage::setLayerTreeStateIsFrozen): Deleted.
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::applicationDidEnterBackground):
(WebKit::WebPage::applicationWillEnterForeground):
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::actualPrepareToSuspend):
(WebKit::WebProcess::cancelPrepareToSuspend):
(WebKit::WebProcess::freezeAllLayerTrees):
(WebKit::WebProcess::unfreezeAllLayerTrees):
(WebKit::WebProcess::processDidResume):
(WebKit::WebProcess::setAllLayerTreeStatesFrozen): Deleted.
* WebProcess/WebProcess.h:

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

19 months ago[GTK] [2.22.0] Fails to build in armel
berto@igalia.com [Mon, 26 Nov 2018 08:54:15 +0000 (08:54 +0000)]
[GTK] [2.22.0] Fails to build in armel
https://bugs.webkit.org/show_bug.cgi?id=188862

Disable the JIT and enable C_LOOP on ARM CPUs without Thumb2
support.

Reviewed by Michael Catanzaro.

* Source/cmake/WebKitFeatures.cmake:

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

19 months ago[css-grid] Fix grid container sizing under min-content height
rego@igalia.com [Mon, 26 Nov 2018 08:06:52 +0000 (08:06 +0000)]
[css-grid] Fix grid container sizing under min-content height
https://bugs.webkit.org/show_bug.cgi?id=191889

Reviewed by Javier Fernandez.

LayoutTests/imported/w3c:

Imported tests from WPT.

* web-platform-tests/css/css-grid/grid-model/grid-container-sizing-constraints-001-expected.txt: Added.
* web-platform-tests/css/css-grid/grid-model/grid-container-sizing-constraints-001.html: Added.
* web-platform-tests/css/css-grid/grid-model/w3c-import.log:

Source/WebCore:

The spec is quite clear
(https://drafts.csswg.org/css-sizing/#valdef-width-min-content):
  "min-content
     If specified for the inline axis, use the min-content inline size;
     otherwise behaves as the property’s initial value."

So if a grid container has "height: min-content" it should behave
the same than with "height: auto".

The patch removes computeIntrinsicLogicalContentHeightUsing() in
RenderGrid as we don't need a custom one anymore.
We can also get rid of m_minContentHeight and m_maxContentHeight
attributes that were only used for this logic.

Test: fast/css-grid-layout/grid-track-sizing-with-orthogonal-flows.html
      fast/css-grid-layout/maximize-tracks-definite-indefinite-height.html
      imported/w3c/web-platform-tests/css/css-grid/grid-model/grid-container-sizing-constraints-001.html

* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::layoutBlock):
(WebCore::RenderGrid::computeIntrinsicLogicalWidths const):
(WebCore::RenderGrid::computeTrackSizesForIndefiniteSize const):
* rendering/RenderGrid.h:

LayoutTests:

Update tests results to the new behavior.
Also modified a little bit the test to keep them in sync with Blink versions.

* fast/css-grid-layout/grid-track-sizing-with-orthogonal-flows-expected.txt:
* fast/css-grid-layout/grid-track-sizing-with-orthogonal-flows.html:
* fast/css-grid-layout/maximize-tracks-definite-indefinite-height.html:

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

19 months agoUnreviewed test gardening, rebaseline webgpu/queue-creation.html.
ryanhaddad@apple.com [Mon, 26 Nov 2018 06:55:00 +0000 (06:55 +0000)]
Unreviewed test gardening, rebaseline webgpu/queue-creation.html.

* webgpu/queue-creation-expected.txt:

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

19 months agoUnreviewed test fix after r238467.
zalan@apple.com [Mon, 26 Nov 2018 01:06:39 +0000 (01:06 +0000)]
Unreviewed test fix after r238467.

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

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

19 months agoUnreviewed, fix the internal iOS 12 build after r238471
wenson_hsieh@apple.com [Sun, 25 Nov 2018 22:59:07 +0000 (22:59 +0000)]
Unreviewed, fix the internal iOS 12 build after r238471

* TestWebKitAPI/Tests/WebKitCocoa/DataDetection.mm:
(TEST):

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

19 months agoWeb Inspector: Timelines: add Media timeline
drousso@apple.com [Sun, 25 Nov 2018 22:11:24 +0000 (22:11 +0000)]
Web Inspector: Timelines: add Media timeline
https://bugs.webkit.org/show_bug.cgi?id=191625

Reviewed by Matt Baker.

Add a new timeline to Timelines for media related events (e.g. event/fullscreen/low-power).
Mimics what is visible by using the same instrumentation points as the Network tab when
"Group Media Requests" is enabled.

* UserInterface/Models/MediaInstrument.js: Added.
(WI.MediaInstrument):
(WI.MediaInstrument.supported):
(WI.MediaInstrument.prototype.get timelineRecordType):
(WI.MediaInstrument.prototype.startInstrumentation):
(WI.MediaInstrument.prototype.stopInstrumentation):

* UserInterface/Models/MediaTimelineRecord.js: Added.
(WI.MediaTimelineRecord):
(WI.MediaTimelineRecord.prototype.get eventType):
(WI.MediaTimelineRecord.prototype.get domNode):
(WI.MediaTimelineRecord.prototype.get domEvent):
(WI.MediaTimelineRecord.prototype.get isLowPower):
(WI.MediaTimelineRecord.prototype.get displayName):
(WI.MediaTimelineRecord.prototype.saveIdentityToCookie):

* UserInterface/Views/MediaTimelineDataGridNode.js: Added.
(WI.MediaTimelineDataGridNode):
(WI.MediaTimelineDataGridNode.prototype.get records):
(WI.MediaTimelineDataGridNode.prototype.get data):
(WI.MediaTimelineDataGridNode.prototype.createCellContent):
(WI.MediaTimelineDataGridNode.prototype.iconClassNames):
(WI.MediaTimelineDataGridNode.prototype.filterableDataForColumn):

* UserInterface/Views/MediaTimelineOverviewGraph.js: Added.
(WI.MediaTimelineOverviewGraph):
(WI.MediaTimelineOverviewGraph.prototype.reset):
(WI.MediaTimelineOverviewGraph.prototype.shown):
(WI.MediaTimelineOverviewGraph.prototype.hidden):
(WI.MediaTimelineOverviewGraph.prototype.layout):
(WI.MediaTimelineOverviewGraph.prototype.updateSelectedRecord):
(WI.MediaTimelineOverviewGraph.prototype._handleRecordAdded):
* UserInterface/Views/MediaTimelineOverviewGraph.css: Added.
(.timeline-overview-graph.media > .timeline-record-bar):
(.timeline-overview-graph.media > .timeline-record-bar > .segment):

* UserInterface/Views/MediaTimelineView.js: Added.
(WI.MediaTimelineView):
(WI.MediaTimelineView.prototype.get secondsPerPixel):
(WI.MediaTimelineView.prototype.get selectionPathComponents):
(WI.MediaTimelineView.prototype.closed):
(WI.MediaTimelineView.prototype.reset):
(WI.MediaTimelineView.prototype.dataGridSortComparator.compareDOMNodes):
(WI.MediaTimelineView.prototype.dataGridSortComparator.):
(WI.MediaTimelineView.prototype.dataGridSortComparator):
(WI.MediaTimelineView.prototype.layout):
(WI.MediaTimelineView.prototype._processPendingRecords):
(WI.MediaTimelineView.prototype._handleRecordAdded):
(WI.MediaTimelineView.prototype._handleSelectionPathComponentSiblingSelected):
* UserInterface/Views/MediaTimelineView.css: Added.
(.timeline-view.media > .data-grid):

* UserInterface/Views/DOMEventsBreakdownView.js:
(WI.DOMEventsBreakdownView.prototype.layout):
* UserInterface/Views/DOMNodeEventsContentView.js:
(WI.DOMNodeEventsContentView.prototype.initialLayout):
* UserInterface/Views/NetworkDOMNodeDetailView.js:
(WI.NetworkDOMNodeDetailView):
(WI.NetworkDOMNodeDetailView.prototype.showContentViewForIdentifier):
* UserInterface/Views/NetworkTableContentView.js:
(WI.NetworkTableContentView):
(WI.NetworkTableContentView.prototype.get filterNavigationItems):
(WI.NetworkTableContentView.prototype._populateWaterfallGraph):
(WI.NetworkTableContentView.prototype._showDetailView):
(WI.NetworkTableContentView.prototype._waterfallPopoverContentForNodeEntry):
Remove passing of `startTimestamp` to `WI.DOMEventsBreakdownView`, as we should be showing
absolute timestamps for each event, not relative to the start of the recording.

* UserInterface/Views/TimelineIcons.css:
(.media-icon .icon): Added.
(.dom-event-record .icon): Added.
(.dom-event-record.fullscreen .icon): Added.
(.low-power-record .icon): Added.

* UserInterface/Controllers/TimelineManager.js:
(WI.TimelineManager.availableTimelineTypes):
(WI.TimelineManager.prototype.capturingStarted):
(WI.TimelineManager.prototype.capturingStopped):
(WI.TimelineManager.prototype._updateAutoCaptureInstruments):
(WI.TimelineManager.prototype._handleDOMNodeDidFireEvent): Added.
(WI.TimelineManager.prototype._handleDOMNodeLowPowerChanged): Added.

* UserInterface/Views/TimelineRuler.js:
(WI.TimelineRuler.prototype.clearMarkers):
(WI.TimelineRuler.prototype._handleClick):
* UserInterface/Views/TimelineOverview.js:
(WI.TimelineOverview.prototype._timelineRulerMouseClicked):
* UserInterface/Models/TimelineRecording.js:
(WI.TimelineRecording.prototype.reset):
(WI.TimelineRecording.prototype.addEventMarker):
(WI.TimelineRecording.prototype.addRecord):
(WI.TimelineRecording.prototype._keyForRecord):
Drive-by: rework the logic for "click" event pass-through to the graph underneath.
* UserInterface/Models/Instrument.js:
(WI.Instrument.createForTimelineType):

* UserInterface/Models/TimelineRecord.js:

* UserInterface/Views/TimelineTabContentView.js:
(WI.TimelineTabContentView.displayNameForTimelineType):
(WI.TimelineTabContentView.iconClassNameForTimelineType):
(WI.TimelineTabContentView.genericClassNameForTimelineType):
(WI.TimelineTabContentView.iconClassNameForRecord):
(WI.TimelineTabContentView.displayNameForRecord):
* UserInterface/Views/TimelineRecordBar.css:
(.timeline-record-bar.timeline-record-type-media > .segment): Added.

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

* UserInterface/Models/ScriptTimelineRecord.js:
(WI.ScriptTimelineRecord.EventType.displayName):

* UserInterface/Main.html:
* UserInterface/Test.html:
* Localizations/en.lproj/localizedStrings.js:
* UserInterface/Images/DOMEvent.svg: Added.
* UserInterface/Images/DOMEventFullscreen.svg: Added.
* UserInterface/Images/LowPower.svg: Added.
* UserInterface/Images/MediaInstrument.svg: Added.

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

19 months agoWeb Inspector: Remove parameters from TreeOutline SelectionDidChange event
mattbaker@apple.com [Sun, 25 Nov 2018 21:44:43 +0000 (21:44 +0000)]
Web Inspector: Remove parameters from TreeOutline SelectionDidChange event
https://bugs.webkit.org/show_bug.cgi?id=191770

Reviewed by Devin Rousso.

* UserInterface/Controllers/CallFrameTreeController.js:
(WI.CallFrameTreeController.prototype._treeSelectionDidChange):
* UserInterface/Views/AuditNavigationSidebarPanel.js:
(WI.AuditNavigationSidebarPanel.prototype._treeSelectionDidChange):
* UserInterface/Views/CanvasSidebarPanel.js:
(WI.CanvasSidebarPanel):
(WI.CanvasSidebarPanel.prototype._treeSelectionDidChange):
(WI.CanvasSidebarPanel.prototype._treeOutlineSelectionDidChange): Deleted.
* UserInterface/Views/CanvasTabContentView.js:
(WI.CanvasTabContentView.prototype._canvasTreeOutlineSelectionDidChange):
* UserInterface/Views/DebuggerSidebarPanel.js:
(WI.DebuggerSidebarPanel.prototype._treeSelectionDidChange):
* UserInterface/Views/OpenResourceDialog.js:
(WI.OpenResourceDialog.prototype._treeSelectionDidChange):
* UserInterface/Views/ResourceSidebarPanel.js:
(WI.ResourceSidebarPanel.prototype._treeSelectionDidChange):
* UserInterface/Views/SearchSidebarPanel.js:
(WI.SearchSidebarPanel.prototype._treeSelectionDidChange):
* UserInterface/Views/StorageSidebarPanel.js:
(WI.StorageSidebarPanel._treeSelectionDidChange):
* UserInterface/Views/TimelineDataGrid.js:
(WI.TimelineDataGrid.prototype._popoverCallStackTreeSelectionDidChange):
(WI.TimelineDataGrid):
* UserInterface/Views/TimelineTabContentView.js:
(WI.TimelineTabContentView.prototype._recordingsTreeSelectionDidChange):
Use `event.target.selectedTreeElement` instead of `event.data.selectedElement`.

* UserInterface/Views/TimelineOverview.js:
(WI.TimelineOverview.prototype._timelinesTreeSelectionDidChange):
(WI.TimelineOverview.prototype._timelinesTreeSelectionDidChange.updateGraphSelectedState): Deleted.
Refactor away the single place `event.data.deselectedElement` was used.

* UserInterface/Views/TreeElement.js:
(WI.TreeElement.prototype.select):
(WI.TreeElement.prototype.deselect):
Remove `selectedElement` and `deselectedElement` from event data.

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

19 months ago[LFC] Remove PointInContainingBlock and PositionInContainingBlock
zalan@apple.com [Sun, 25 Nov 2018 21:35:18 +0000 (21:35 +0000)]
[LFC] Remove PointInContainingBlock and PositionInContainingBlock
https://bugs.webkit.org/show_bug.cgi?id=191954

Reviewed by Antti Koivisto.

Use Point and Position instead. Points and positions are by default in the containing block's coordinate system.

* layout/FormattingContextGeometry.cpp:
(WebCore::Layout::contentHeightForFormattingContextRoot):
* layout/LayoutUnits.h:
(WebCore::Layout::Position::operator LayoutUnit const):
(WebCore::Layout::operator<):
(WebCore::Layout::operator==):
* layout/floats/FloatAvoider.cpp:
(WebCore::Layout::FloatAvoider::FloatAvoider):
(WebCore::Layout::FloatAvoider::setHorizontalConstraints):
(WebCore::Layout::FloatAvoider::horizontalPositionCandidate):
(WebCore::Layout::FloatAvoider::initialHorizontalPosition const):
* layout/floats/FloatBox.cpp:
(WebCore::Layout::FloatBox::horizontalPositionCandidate):
(WebCore::Layout::FloatBox::verticalPositionCandidate):
(WebCore::Layout::FloatBox::initialVerticalPosition const):
* layout/floats/FloatingContext.cpp:
(WebCore::Layout::FloatingContext::positionForFloat const):
(WebCore::Layout::FloatingContext::positionForFloatAvoiding const):
(WebCore::Layout::FloatingContext::verticalPositionWithClearance const):
(WebCore::Layout::FloatingContext::floatingPosition const):
(WebCore::Layout::FloatingPair::horizontalConstraints const):
(WebCore::Layout::FloatingPair::bottom const):
* layout/floats/FloatingContext.h:
* layout/floats/FloatingState.cpp:
(WebCore::Layout::FloatingState::constraints const):
(WebCore::Layout::FloatingState::bottom const):
* layout/floats/FloatingState.h:
(WebCore::Layout::FloatingState::FloatItem::bottom const):
* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::initializeNewLine const):

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

19 months ago[LFC] Rename Layout::Position to Layout::Point
zalan@apple.com [Sun, 25 Nov 2018 21:32:55 +0000 (21:32 +0000)]
[LFC] Rename Layout::Position to Layout::Point
https://bugs.webkit.org/show_bug.cgi?id=191950

Reviewed by Antti Koivisto.

It actually represents a point.

* layout/FormattingContext.cpp:
(WebCore::Layout::FormattingContext::mapTopLeftToAncestor):
(WebCore::Layout::FormattingContext::mapCoordinateToAncestor):
* layout/FormattingContext.h:
* layout/LayoutUnits.h:
(WebCore::Layout::Point::Point):
(WebCore::Layout::Point::moveBy):
(WebCore::Layout::Position::operator LayoutPoint const): Deleted.
(WebCore::Layout::Position::Position): Deleted.
(WebCore::Layout::Position::moveBy): Deleted.
* layout/blockformatting/BlockFormattingContext.h:
* layout/blockformatting/BlockFormattingContextGeometry.cpp:
(WebCore::Layout::BlockFormattingContext::Geometry::staticPosition):
* layout/floats/FloatingState.cpp:
(WebCore::Layout::FloatingState::constraints const):

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

19 months ago[LFC] Floating code should use typed positions (PositionInContextRoot).
zalan@apple.com [Sun, 25 Nov 2018 21:30:34 +0000 (21:30 +0000)]
[LFC] Floating code should use typed positions (PositionInContextRoot).
https://bugs.webkit.org/show_bug.cgi?id=191949

Reviewed by Antti Koivisto.

Use PositionInContextRoot instead of LayoutUnit.

* layout/floats/FloatingState.cpp:
(WebCore::Layout::FloatingState::constraints const):
(WebCore::Layout::FloatingState::bottom const):
* layout/floats/FloatingState.h:
(WebCore::Layout::FloatingState::leftBottom const):
(WebCore::Layout::FloatingState::rightBottom const):
(WebCore::Layout::FloatingState::bottom const):

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

19 months agoFix build after r238472.
zalan@apple.com [Sun, 25 Nov 2018 21:28:33 +0000 (21:28 +0000)]
Fix build after r238472.

* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::splitInlineRunIfNeeded const):
* layout/inlineformatting/InlineFormattingContextGeometry.cpp:
(WebCore::Layout::InlineFormattingContext::Geometry::runWidth):
* layout/inlineformatting/InlineLineBreaker.cpp:
(WebCore::Layout::InlineLineBreaker::textWidth const):

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

19 months agoCRASH() should call abort() except on Darwin and in developer builds
mcatanzaro@igalia.com [Sun, 25 Nov 2018 18:22:30 +0000 (18:22 +0000)]
CRASH() should call abort() except on Darwin and in developer builds
https://bugs.webkit.org/show_bug.cgi?id=184408

Reviewed by Daniel Bates.

CRASH() should call abort() except on Darwin and in developer builds, as discussed on
webkit-dev. This should be slightly nicer than dereferencing 0xbadbeef.

On Darwin, CRASH() uses a breakpoint trap, which seems to corrupt the stack on Linux, so we
can't do that.

Continue to call WTFCrash() in developer mode, and make no changes to WTFCrash(), since it
is reportedly useful in nightmare scenarios where core dumps are unavailable.

We also have to define CRASH_UNDER_CONSTEXPR_CONTEXT(). It's a bit odd that it's possible to
use a non-constexpr function here, but it works. Currently this macro uses WTFCrash(), which
is also non-constexpr.

* wtf/Assertions.h:

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

19 months agoUnreviewed, rolling out r238469.
mcatanzaro@igalia.com [Sun, 25 Nov 2018 16:22:46 +0000 (16:22 +0000)]
Unreviewed, rolling out r238469.

Broke the build

Reverted changeset:

"CRASH() should call abort() except on Darwin and in developer
builds"
https://bugs.webkit.org/show_bug.cgi?id=184408
https://trac.webkit.org/changeset/238469

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

19 months agoRemoteLayerTreeNode construction cleanups
antti@apple.com [Sun, 25 Nov 2018 12:19:02 +0000 (12:19 +0000)]
RemoteLayerTreeNode construction cleanups
https://bugs.webkit.org/show_bug.cgi?id=191951

Reviewed by Tim Horton.

* UIProcess/RemoteLayerTree/RemoteLayerTreeHost.h:
* UIProcess/RemoteLayerTree/RemoteLayerTreeHost.mm:
(WebKit::RemoteLayerTreeHost::updateLayerTree):

    Drop unused LayerProperties argument.

(WebKit::RemoteLayerTreeHost::createLayer):

    Split the actual construction out to makeNode.
    Map updating is shared between platforms.
    Move setting of layerID and clearing default actions to RemoteLayerTreeNode.

(WebKit::RemoteLayerTreeHost::makeNode):

    Returns RemoteLayerTreeNode.

(WebKit::RemoteLayerTreeHost::setLayerID): Deleted.
(WebKit::RemoteLayerTreeHost::layerID): Deleted.

    Move to RemoteLayerTreeNode.

* UIProcess/RemoteLayerTree/RemoteLayerTreeNode.h:
* UIProcess/RemoteLayerTree/RemoteLayerTreeNode.mm:
(WebKit::RemoteLayerTreeNode::RemoteLayerTreeNode):
(WebKit::RemoteLayerTreeNode::setLayerID):
(WebKit::RemoteLayerTreeNode::layerID):
* UIProcess/RemoteLayerTree/ios/RemoteLayerTreeHostIOS.mm:
(WebKit::RemoteLayerTreeHost::makeNode):
(WebKit::RemoteLayerTreeHost::createEmbeddedView):
(WebKit::RemoteLayerTreeHost::createLayer): Deleted.
* UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.mm:
(-[WKCompositingView description]):
(-[WKUIRemoteView description]):
(-[WKBackdropView description]):
* WebProcess/WebPage/RemoteLayerTree/PlatformCAAnimationRemote.mm:
(WebKit::addAnimationToLayer):

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

19 months agoMake it possible to insert editable images with a gesture
timothy_horton@apple.com [Sun, 25 Nov 2018 12:11:16 +0000 (12:11 +0000)]
Make it possible to insert editable images with a gesture
https://bugs.webkit.org/show_bug.cgi?id=191937

Reviewed by Wenson Hsieh.

Source/WebCore:

Tests:
    editing/images/redo-insert-editable-image-maintains-strokes.html,
    editing/images/undo-insert-editable-image.html,
    editing/images/basic-editable-image-from-execCommand.html

* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* Source/WebCore/editing/EditorCommand.cpp:
* Source/WebCore/en.lproj/Localizable.strings:
* editing/EditAction.h:
* editing/Editor.cpp:
(WebCore::Editor::insertEditableImage):
* editing/Editor.h:
* editing/InsertEditableImageCommand.cpp: Added.
(WebCore::InsertEditableImageCommand::InsertEditableImageCommand):
(WebCore::InsertEditableImageCommand::doApply):
* editing/InsertEditableImageCommand.h: Added.
(WebCore::InsertEditableImageCommand::create):
* editing/VisibleSelection.cpp:
Add an editor command that inserts an editable image.
It will likely get a bit more complicated, but for now it just inserts
a 100% by 300px editable image.

Source/WebKit:

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _stylusTapGestureShouldCreateEditableImage]):
* UIProcess/API/Cocoa/WKWebViewInternal.h:
Add a internal getter for a WKWebViewConfiguration property.

* UIProcess/WebEditCommandProxy.cpp:
(WebKit::WebEditCommandProxy::nameForEditAction):
Add a undo name.

* UIProcess/WebPageProxy.h:
* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView setupInteraction]):
(-[WKContentView cleanupInteraction]):
(-[WKContentView _removeDefaultGestureRecognizers]):
(-[WKContentView _addDefaultGestureRecognizers]):
Add a single-stylus-tap gesture recognizer.

(-[WKContentView _stylusSingleTapRecognized:]):
If allowed, request to insert an editable image when a stylus tap occurs.

* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::handleStylusSingleTapAtPoint):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::handleStylusSingleTapAtPoint):
Do a hit test, select the hit position, insert an editable image, and
then de-assist any assisted node (to make the keyboard go away).
For now, we'll only insert if we hit non-replaced elements,
though this heuristic will need to be enhanced significantly once we
decide on a design.

Source/WebKitLegacy/mac:

* WebCoreSupport/WebEditorClient.mm:
(undoNameForEditAction):
Add a undo name.

Tools:

* WebKitTestRunner/ios/UIScriptControllerIOS.mm:
(WTR::UIScriptController::drawSquareInEditableImage):
If the canvas already has a drawing, draw a new stroke on top of it
instead of removing the existing stroke.

LayoutTests:

* editing/images/basic-editable-image-from-execCommand-expected.txt: Added.
* editing/images/basic-editable-image-from-execCommand.html: Added.
Add a test that ensures that editable images also work when
inserted via the editor command.

* editing/images/redo-insert-editable-image-maintains-strokes-expected.txt: Added.
* editing/images/redo-insert-editable-image-maintains-strokes.html: Added.
Add a test that ensures that strokes are maintained when re-doing an
un-done editable image insertion.

* editing/images/undo-insert-editable-image-expected.txt: Added.
* editing/images/undo-insert-editable-image.html: Added.
Add a test that ensures that the selection stays in a sensible place
when undoing and redoing editable image insertion.

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

19 months agoScrolling and drawing compete for incoming gestures
timothy_horton@apple.com [Sun, 25 Nov 2018 12:05:02 +0000 (12:05 +0000)]
Scrolling and drawing compete for incoming gestures
https://bugs.webkit.org/show_bug.cgi?id=191940

Reviewed by Wenson Hsieh.

* Platform/spi/ios/PencilKitSPI.h:
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _initializeWithConfiguration:]):
* UIProcess/ios/WKDrawingView.mm:
(-[WKDrawingView initWithEmbeddedViewID:webPageProxy:]):
Make scrolling and drawing mutually exclusive if editable images
are enabled.

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

19 months ago[Cocoa] Fix a few localizable string descriptions in WebEditCommandProxy.cpp and...
wenson_hsieh@apple.com [Sun, 25 Nov 2018 01:45:54 +0000 (01:45 +0000)]
[Cocoa] Fix a few localizable string descriptions in WebEditCommandProxy.cpp and WebEditorClient.mm
https://bugs.webkit.org/show_bug.cgi?id=191945

Reviewed by Anders Carlsson.

Source/WebCore:

Run `update-webkit-localizable-strings`.

* en.lproj/Localizable.strings:

Source/WebKit:

Replace some a couple of command undo action name descriptions with "Undo action name", to match all other
edit commands.

* UIProcess/WebEditCommandProxy.cpp:
(WebKit::WebEditCommandProxy::nameForEditAction):

Source/WebKitLegacy/mac:

* WebCoreSupport/WebEditorClient.mm:
(undoNameForEditAction):

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

19 months agoRemove now unnecessary specialized ListHashSet from InlineItem.h
commit-queue@webkit.org [Sun, 25 Nov 2018 00:37:06 +0000 (00:37 +0000)]
Remove now unnecessary specialized ListHashSet from InlineItem.h
https://bugs.webkit.org/show_bug.cgi?id=191946

Patch by Sam Weinig <sam@webkit.org> on 2018-11-24
Reviewed by Zalan Bujtas.

Now that ListHashSet supports raw pointer overloads for smart pointers,
we can fix the FIXME in InlineItem.h and remove the specialized ListHashSet
and ListHashSet::find calls.

* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::splitInlineRunIfNeeded const):
(WebCore::Layout::InlineFormattingContext::collectInlineContentForSubtree const):
* layout/inlineformatting/InlineFormattingContextGeometry.cpp:
(WebCore::Layout::InlineFormattingContext::Geometry::runWidth):
* layout/inlineformatting/InlineItem.h:
(WebCore::Layout::InlineItemHashFunctions::hash): Deleted.
(WebCore::Layout::InlineItemHashFunctions::equal): Deleted.
(WebCore::Layout::InlineItemHashTranslator::hash): Deleted.
(WebCore::Layout::InlineItemHashTranslator::equal): Deleted.
* layout/inlineformatting/InlineLineBreaker.cpp:
(WebCore::Layout::InlineLineBreaker::textWidth const):

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

19 months ago[Cocoa] Add WKWebView SPI to trigger and remove data detection
wenson_hsieh@apple.com [Sat, 24 Nov 2018 21:06:09 +0000 (21:06 +0000)]
[Cocoa] Add WKWebView SPI to trigger and remove data detection
https://bugs.webkit.org/show_bug.cgi?id=191918
<rdar://problem/36185051>

Reviewed by Tim Horton.

Source/WebCore:

Add a helper method on DataDetection to remove all data detected links in the given document. See WebKit changes
for more detail.

* editing/cocoa/DataDetection.h:
* editing/cocoa/DataDetection.mm:
(WebCore::DataDetection::removeDataDetectedLinksInDocument):

Source/WebKit:

Adds support for two new WKWebView SPI methods, `-_detectDataWithTypes:completionHandler:` and
`-_removeAllDataDetectedLinks:`, to allow internal WebKit clients to run data detection and add links to data
detected content, or remove all data detected links from the document.

Test: WebKit.AddAndRemoveDataDetectors

* Shared/Cocoa/DataDetectionResult.h:
* Shared/Cocoa/DataDetectionResult.mm:
(WebKit::DataDetectionResult::decode):

Modernize DataDetectionResult's IPC decoding, so that it can be used with reply-based async IPC.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _removeDataDetectedLinks:]):
(-[WKWebView _detectDataWithTypes:completionHandler:]):
* UIProcess/API/Cocoa/WKWebViewPrivate.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::detectDataInAllFrames):
(WebKit::WebPageProxy::removeDataDetectedLinks):

Add or remove data detected links from each frame in the page, and then propagate the new data detector
results of the main frame to the UI process (this matches current behavior, where the results of -[WKWebView
_dataDetectionResults] only reflects data detection results in the main frame of the page).

* UIProcess/WebPageProxy.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::removeDataDetectedLinks):
(WebKit::WebPage::detectDataInAllFrames):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:

Tools:

Add an API test to exercise the new WebKit SPI.

* TestWebKitAPI/DataDetectorsCoreSPI.h: Added.
* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKitCocoa/DataDetection.mm:
(-[WKWebView synchronouslyDetectDataWithTypes:]):
(-[WKWebView synchronouslyRemoveDataDetectedLinks]):
(TEST):
* TestWebKitAPI/Tests/WebKitCocoa/WKAttachmentTests.mm:
(TestWebKitAPI::TEST):
(-[TestWKWebView tagsInBody]): Deleted.
(-[TestWKWebView expectElementTagsInOrder:]): Deleted.
(-[TestWKWebView expectElementCount:tagName:]): Deleted.
(-[TestWKWebView expectElementTag:toComeBefore:]): Deleted.

Rename this from `-expectElementCount:tagName:` to `-expectElementCount:querySelector:`.

* TestWebKitAPI/Tests/WebKitCocoa/data-detectors.html: Added.

Add a new test page containing some content that can be data detected.

* TestWebKitAPI/cocoa/TestWKWebView.h:
* TestWebKitAPI/cocoa/TestWKWebView.mm:
(-[WKWebView tagsInBody]):
(-[WKWebView expectElementTagsInOrder:]):
(-[WKWebView expectElementCount:querySelector:]):
(-[WKWebView expectElementTag:toComeBefore:]):

Move some testing helper functions from WKAttachmentTests to a testing category on WKWebView. This allows us to
use `-expectElementCount:querySelector:` in tests outside of WKAttachmentTests.

(-[WKWebView objectByEvaluatingJavaScript:]):
(-[WKWebView objectByEvaluatingJavaScriptWithUserGesture:]):
(-[WKWebView stringByEvaluatingJavaScript:]):

Move some common helper functions from TestWKWebView to a testing category on WKWebView.

(-[TestWKWebView objectByEvaluatingJavaScript:]): Deleted.
(-[TestWKWebView objectByEvaluatingJavaScriptWithUserGesture:]): Deleted.
(-[TestWKWebView stringByEvaluatingJavaScript:]): Deleted.

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

19 months ago[Cocoa] SOFT_LINK_CLASS_FOR_{HEADER,SOURCE} should generate a more concise getter...
aestes@apple.com [Sat, 24 Nov 2018 18:37:14 +0000 (18:37 +0000)]
[Cocoa] SOFT_LINK_CLASS_FOR_{HEADER,SOURCE} should generate a more concise getter function
https://bugs.webkit.org/show_bug.cgi?id=191899

Reviewed by Dean Jackson.

Source/WebCore:

* editing/cocoa/DataDetection.mm:
* editing/cocoa/FontAttributesCocoa.mm:
* editing/cocoa/FontShadowCocoa.mm:
* platform/cocoa/DataDetectorsCoreSoftLink.h:
* platform/graphics/cocoa/ColorCocoa.mm:
* platform/ios/PlatformScreenIOS.mm:

Source/WebCore/PAL:

* pal/cocoa/PassKitSoftLink.h:
* pal/ios/UIKitSoftLink.h:

Source/WebKit:

* Shared/cocoa/WebCoreArgumentCodersCocoa.mm:
* UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
* UIProcess/ApplePay/mac/WebPaymentCoordinatorProxyMac.mm:

Source/WTF:

Currently, SOFT_LINK_CLASS_FOR_HEADER declares a class getter function that includes the
framework name. For example, NSView would have a class getter named
namespace::get_AppKit_NSViewClass().

Including the framework name in the getter is unnecessary. Objective-C classes already exist
in a global namespace, so there is no need to disambiguate class names by framework. This
patch elides the framework name from the getter function. For example, NSView would now have
a getter named namespace::getNSViewClass().

* wtf/cocoa/SoftLinking.h:

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

19 months agoCRASH() should call abort() except on Darwin and in developer builds
mcatanzaro@igalia.com [Sat, 24 Nov 2018 15:13:15 +0000 (15:13 +0000)]
CRASH() should call abort() except on Darwin and in developer builds
https://bugs.webkit.org/show_bug.cgi?id=184408

Reviewed by Daniel Bates.

CRASH() should call abort() except on Darwin and in developer builds, as discussed on
webkit-dev. This should be slightly nicer than dereferencing 0xbadbeef.

On Darwin, CRASH() uses a breakpoint trap, which seems to corrupt the stack on Linux, so we
can't do that.

Continue to call WTFCrash() in developer mode, and make no changes to WTFCrash(), since it
is reportedly useful in nightmare scenarios where core dumps are unavailable.

* wtf/Assertions.h:

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

19 months agoReplace LayerOrView typedef with a class
antti@apple.com [Sat, 24 Nov 2018 07:17:35 +0000 (07:17 +0000)]
Replace LayerOrView typedef with a class
https://bugs.webkit.org/show_bug.cgi?id=191927

Reviewed by Tim Horton.

This typedef restricts remote layer representation to be either a CA layer or a view. We might want
have more flexibility, for example tiles don't really need to be UIViews. It will also make it easier
to unify Mac and iOS code, and hopefully make it less confusing too.

This patch introduces RemoteLayerTreeNode class that replaces most uses of LayerOrView typedef
(the rest are converted to pure CALayer). It also does a bunch of related cleanup.

* Shared/RemoteLayerTree/RemoteLayerTreePropertyApplier.h:
* Shared/RemoteLayerTree/RemoteLayerTreePropertyApplier.mm:
(WebKit::RemoteLayerTreePropertyApplier::applyPropertiesToLayer):
(WebKit::RemoteLayerTreePropertyApplier::applyProperties):
(WebKit::RemoteLayerTreePropertyApplier::applyPropertiesToUIView):
(WebKit::applyPropertiesToLayer): Deleted.
* SourcesCocoa.txt:
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _propertiesOfLayerWithID:]):
* UIProcess/Cocoa/LayerRepresentation.h: Removed.
* UIProcess/Cocoa/VideoFullscreenManagerProxy.mm:
(WebKit::VideoFullscreenManagerProxy::setupFullscreenWithID):
* UIProcess/PageClient.h:
* UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.h:
* UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm:
(WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree):
(WebKit::RemoteLayerTreeDrawingAreaProxy::updateDebugIndicator):
(WebKit::RemoteLayerTreeDrawingAreaProxy::layerWithIDForTesting const):
* UIProcess/RemoteLayerTree/RemoteLayerTreeHost.h:
(WebKit::RemoteLayerTreeHost::rootNode const):
(WebKit::RemoteLayerTreeHost::rootLayer const): Deleted.
* UIProcess/RemoteLayerTree/RemoteLayerTreeHost.mm:
(WebKit::RemoteLayerTreeHost::updateLayerTree):
(WebKit::RemoteLayerTreeHost::nodeForID const):
(WebKit::RemoteLayerTreeHost::layerWillBeRemoved):
(WebKit::RemoteLayerTreeHost::animationDidStart):
(WebKit::RemoteLayerTreeHost::animationDidEnd):
(WebKit::RemoteLayerTreeHost::clearLayers):
(WebKit::RemoteLayerTreeHost::layerWithIDForTesting const):
(WebKit::RemoteLayerTreeHost::layerForID const):
(WebKit::RemoteLayerTreeHost::rootLayer const):
(WebKit::RemoteLayerTreeHost::createLayer):
(WebKit::RemoteLayerTreeHost::detachRootLayer):
(WebKit::RemoteLayerTreeHost::mapAllIOSurfaceBackingStore):
(WebKit::RemoteLayerTreeHost::getLayer const): Deleted.
* UIProcess/RemoteLayerTree/RemoteLayerTreeNode.h: Added.
(WebKit::RemoteLayerTreeNode::layer const):
(WebKit::RemoteLayerTreeNode::uiView const):
* UIProcess/RemoteLayerTree/RemoteLayerTreeNode.mm: Added.
(WebKit::RemoteLayerTreeNode::RemoteLayerTreeNode):
(WebKit::RemoteLayerTreeNode::detachFromParent):
* UIProcess/RemoteLayerTree/RemoteLayerTreeScrollingPerformanceData.mm:
(WebKit::RemoteLayerTreeScrollingPerformanceData::blankPixelCount const):
* UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.cpp:
(WebKit::RemoteScrollingCoordinatorProxy::connectStateNodeLayers):
* UIProcess/RemoteLayerTree/ios/RemoteLayerTreeHostIOS.mm:
(WebKit::RemoteLayerTreeHost::createLayer):
* UIProcess/RemoteLayerTree/ios/RemoteScrollingCoordinatorProxyIOS.mm:
(WebKit::RemoteScrollingCoordinatorProxy::connectStateNodeLayers):
(WebKit::layerRepresentationFromLayerOrView): Deleted.
* UIProcess/WebAuthentication/Cocoa/HidService.h:
* UIProcess/WebAuthentication/Cocoa/HidService.mm:
* UIProcess/WebPageProxy.h:
* UIProcess/ios/LayerRepresentation.mm: Removed.
* UIProcess/ios/PageClientImplIOS.h:
* UIProcess/ios/PageClientImplIOS.mm:
(WebKit::PageClientImpl::setRemoteLayerTreeRootNode):
(WebKit::PageClientImpl::acceleratedCompositingRootLayer const):
(WebKit::PageClientImpl::setAcceleratedCompositingRootLayer): Deleted.
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::setRemoteLayerTreeRootNode):
(WebKit::WebPageProxy::setAcceleratedCompositingRootLayer): Deleted.
* UIProcess/mac/PageClientImplMac.h:
* UIProcess/mac/PageClientImplMac.mm:
(WebKit::PageClientImpl::setRemoteLayerTreeRootNode):
(WebKit::PageClientImpl::setAcceleratedCompositingRootLayer): Deleted.
* UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm:
(WebKit::TiledCoreAnimationDrawingAreaProxy::createFence):
* UIProcess/mac/WebPageProxyMac.mm:
(WebKit::WebPageProxy::setRemoteLayerTreeRootNode):
(WebKit::WebPageProxy::acceleratedCompositingRootLayer const):
(WebKit::WebPageProxy::setAcceleratedCompositingRootLayer): Deleted.
* WebKit.xcodeproj/project.pbxproj:
* WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemote.cpp:
(WebKit::PlatformCALayerRemote::recursiveBuildTransaction):

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

19 months agoAdd raw pointer overloads to ListHashSet via SmartPtr specialized functions
commit-queue@webkit.org [Sat, 24 Nov 2018 06:08:31 +0000 (06:08 +0000)]
Add raw pointer overloads to ListHashSet via SmartPtr specialized functions
https://bugs.webkit.org/show_bug.cgi?id=191936

Patch by Sam Weinig <sam@webkit.org> on 2018-11-23
Reviewed by Zalan Bujtas.

Source/WTF:

Adds overloads for find, contains, insertBefore and remove that take raw pointers
when the value type V of a ListHashSet is true for the predicate IsSmartPtr<V>::value.
This brings the interface to ListHashSet closer inline with HashSet, HashMap and HashCountedSet
which already have this functionality. Like in the other collections, this is especially
useful when using std::unique_ptr<> as the value, since there would be no way to pass it
to these functions. One difference between this set of overloads is the inclusion of insertBefore,
which is unique to ListHashSet. As would be expected, this specialization only changes the first
parameter, the one that needs to be found, to support a raw pointer.

* wtf/ListHashSet.h:
(WTF::U>::find):
(WTF::U>::find const):
(WTF::U>::contains const):
(WTF::U>::insertBefore):
(WTF::U>::remove):

Tools:

Adds tests for raw pointer overloads in ListHashSet.

* TestWebKitAPI/Tests/WTF/HashSet.cpp:
* TestWebKitAPI/Tests/WTF/ListHashSet.cpp:

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

19 months ago[WebAuthN] Enable Web Authentication as an experimental feature for macOS
jiewen_tan@apple.com [Sat, 24 Nov 2018 03:51:16 +0000 (03:51 +0000)]
[WebAuthN] Enable Web Authentication as an experimental feature for macOS
https://bugs.webkit.org/show_bug.cgi?id=191932
rdar://problem/46225210

Reviewed by Brent Fulgham.

Source/WebCore:

Add myself to the contact of Web Authentication.

* features.json:

Source/WebKit:

* Shared/WebPreferences.yaml:

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

19 months agoREGRESSION (r236785): Nullptr crash in StyledMarkupAccumulator::traverseNodesForSeria...
rniwa@webkit.org [Sat, 24 Nov 2018 02:17:30 +0000 (02:17 +0000)]
REGRESSION (r236785): Nullptr crash in StyledMarkupAccumulator::traverseNodesForSerialization
https://bugs.webkit.org/show_bug.cgi?id=191921

Reviewed by Dean Jackson.

Source/WebCore:

The bug was caused by traverseNodesForSerialization not being able to traverse past the end of shadow root
when skipping children of a node for which enterNode returns false because  it was using NodeTraversal's
nextSkippingChildren instead of a member function which supports traversing the composed tree.

Fixed the crash by using variant of nextSkippingChildren which knows how to traverse past the last node
in a shadow tree. Also added more assertions to help debug issues like this in the future.

Test: editing/pasteboard/copy-paste-across-shadow-boundaries-5.html

* editing/markup.cpp:
(WebCore::StyledMarkupAccumulator::traverseNodesForSerialization):

LayoutTests:

Added a regression test.

* editing/pasteboard/copy-paste-across-shadow-boundaries-5-expected.txt: Added.
* editing/pasteboard/copy-paste-across-shadow-boundaries-5.html: Added.
* platform/ios/editing/pasteboard/copy-paste-across-shadow-boundaries-5-expected.txt: Added.

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

19 months agoUpdating href on textPath doesn't update its rendering
rniwa@webkit.org [Fri, 23 Nov 2018 22:06:35 +0000 (22:06 +0000)]
Updating href on textPath doesn't update its rendering
https://bugs.webkit.org/show_bug.cgi?id=191920

Reviewed by Dean Jackson.

Source/WebCore:

Fixed the bug by invalidating the RenderSVGResource in SVGTextPathElement::svgAttributeChanged
in addition to updating the pending resources.

Test: svg/text/textpath-reference-update.html

* svg/SVGTextPathElement.cpp:
(WebCore::SVGTextPathElement::svgAttributeChanged):

LayoutTests:

Added a ref test.

* svg/text/textpath-reference-update-expected.html: Added.
* svg/text/textpath-reference-update.html: Added.

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

19 months agoIntroduce user-defined literal for LayoutUnit
ross.kirsling@sony.com [Fri, 23 Nov 2018 20:47:11 +0000 (20:47 +0000)]
Introduce user-defined literal for LayoutUnit
https://bugs.webkit.org/show_bug.cgi?id=191915

Reviewed by Dean Jackson.

* platform/LayoutUnit.h:
Introduce a user-defined literal for LayoutUnit, _lu, replacing the existing "fromPixel" factory function.

* layout/FormattingContextGeometry.cpp:
* layout/inlineformatting/InlineFormattingContextGeometry.cpp:
* layout/inlineformatting/InlineLineBreaker.cpp:
* page/FrameView.cpp:
* page/FrameViewLayoutContext.h:
* page/Page.cpp:
* page/SpatialNavigation.h:
* platform/ScrollableArea.cpp:
* rendering/EllipsisBox.cpp:
* rendering/FlexibleBoxAlgorithm.cpp:
* rendering/FloatingObjects.cpp:
* rendering/GridLayoutFunctions.cpp:
* rendering/GridTrackSizingAlgorithm.cpp:
* rendering/InlineFlowBox.cpp:
* rendering/InlineTextBox.cpp:
* rendering/LayoutState.h:
* rendering/LogicalSelectionOffsetCaches.h:
* rendering/RenderBlock.cpp:
* rendering/RenderBlock.h:
* rendering/RenderBlockFlow.cpp:
* rendering/RenderBlockFlow.h:
* rendering/RenderBlockLineLayout.cpp:
* rendering/RenderBox.cpp:
* rendering/RenderBoxModelObject.cpp:
* rendering/RenderDeprecatedFlexibleBox.cpp:
* rendering/RenderDeprecatedFlexibleBox.h:
* rendering/RenderElement.cpp:
* rendering/RenderFlexibleBox.cpp:
* rendering/RenderFlexibleBox.h:
* rendering/RenderFragmentContainer.cpp:
* rendering/RenderFragmentedFlow.cpp:
* rendering/RenderGrid.cpp:
* rendering/RenderGrid.h:
* rendering/RenderImage.cpp:
* rendering/RenderLayer.cpp:
* rendering/RenderListMarker.cpp:
* rendering/RenderMultiColumnFlow.cpp:
* rendering/RenderMultiColumnSet.cpp:
* rendering/RenderReplaced.cpp:
* rendering/RenderReplaced.h:
* rendering/RenderRubyRun.h:
* rendering/RenderTable.cpp:
* rendering/RenderTable.h:
* rendering/RenderTableSection.cpp:
* rendering/RenderTheme.cpp:
* rendering/RenderTreeAsText.cpp:
* rendering/RenderView.cpp:
* rendering/RootInlineBox.h:
* rendering/SimpleLineLayout.cpp:
* rendering/SimpleLineLayoutPagination.cpp:
* rendering/TableLayout.h:
* rendering/line/BreakingContext.h:
* rendering/line/LineLayoutState.h:
* rendering/line/LineWidth.h:
* rendering/mathml/MathOperator.cpp:
* rendering/mathml/MathOperator.h:
* rendering/mathml/RenderMathMLBlock.h:
* rendering/mathml/RenderMathMLFraction.cpp:
* rendering/mathml/RenderMathMLFraction.h:
* rendering/mathml/RenderMathMLMath.cpp:
* rendering/mathml/RenderMathMLMath.h:
* rendering/mathml/RenderMathMLMenclose.h:
* rendering/mathml/RenderMathMLOperator.cpp:
* rendering/mathml/RenderMathMLOperator.h:
* rendering/mathml/RenderMathMLPadded.h:
* rendering/mathml/RenderMathMLRoot.cpp:
* rendering/mathml/RenderMathMLRoot.h:
* rendering/mathml/RenderMathMLRow.h:
* rendering/mathml/RenderMathMLScripts.cpp:
* rendering/mathml/RenderMathMLScripts.h:
* rendering/mathml/RenderMathMLSpace.h:
* rendering/mathml/RenderMathMLToken.cpp:
* rendering/mathml/RenderMathMLToken.h:
* rendering/mathml/RenderMathMLUnderOver.h:
* rendering/shapes/ShapeOutsideInfo.cpp:
* rendering/style/CollapsedBorderValue.h:
Update all instances of LayoutUnit(), LayoutUnit(0), LayoutUnit { 0 }, etc. and add any other
literal conversions that will be needed when making non-int LayoutUnit constructors explicit.
For good measure, also mark all default values for LayoutUnit parameters.

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

19 months ago[GTK] Scrollbars not following gtk-primary-button-warps-slider setting
commit-queue@webkit.org [Fri, 23 Nov 2018 19:45:52 +0000 (19:45 +0000)]
[GTK] Scrollbars not following gtk-primary-button-warps-slider setting
https://bugs.webkit.org/show_bug.cgi?id=191067

Updated code per the style guide, removed unreachable break (non-semantic change)

Patch by Jim Mason <jmason@ibinx.com> on 2018-11-23
Reviewed by Michael Catanzaro.

* platform/gtk/ScrollbarThemeGtk.cpp:
(WebCore::ScrollbarThemeGtk::handleMousePressEvent):

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

19 months agoEnable drag and drop support for iOSMac
wenson_hsieh@apple.com [Fri, 23 Nov 2018 18:18:01 +0000 (18:18 +0000)]
Enable drag and drop support for iOSMac
https://bugs.webkit.org/show_bug.cgi?id=191818
<rdar://problem/43907454>

Reviewed by Dean Jackson.

Source/JavaScriptCore:

* Configurations/FeatureDefines.xcconfig:

Source/WebCore:

Enables drag and drop by default on iOSMac by switching on ENABLE_DATA_INTERACTION and ENABLE_DRAG_SUPPORT. This
enables support for dragging links, text selections, and images, though many advanced features (e.g. custom
pasteboard data) will require additional support from the platform.

* Configurations/FeatureDefines.xcconfig:
* platform/ios/PlatformPasteboardIOS.mm:
(WebCore::PlatformPasteboard::informationForItemAtIndex):
(WebCore::registerItemToPasteboard):
(WebCore::PlatformPasteboard::typesSafeForDOMToReadAndWrite const):
* platform/ios/WebItemProviderPasteboard.mm:
(-[WebItemProviderLoadResult canBeRepresentedAsFileUpload]):
(-[WebItemProviderPasteboard numberOfFiles]):

Disable codepaths which attempt to access or set `teamData` or `preferredPresentationStyle` on `NSItemProvider`
in iOSMac, since these are currently unimplemented.

Source/WebCore/PAL:

* Configurations/FeatureDefines.xcconfig:

Source/WebKit:

* Configurations/FeatureDefines.xcconfig:
* Shared/WebPreferencesDefaultValues.cpp:
(defaultCustomPasteboardDataEnabled):

Enable custom pasteboard data by default on iOSMac. While writing and reading custom pasteboard data is
currently broken in iOSMac due to the lack of `teamData` and `preferredPresentationStyle`, opting into custom
pasteboard data at least allows us to avoid writing unsanitized data types to the pasteboard.

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

Fix a regression from <https://trac.webkit.org/r236619> wherein the web process crashes when attempting to edit
a text field. This happens because the call to `-[UIKeyboard isInHardwareKeyboardMode]` on the iOSMac platform
attempts to initialize a `UHASWorkspace` from the web process, which then attempts to connect to the UIKit host
application. Instead, we can skip this call altogether on iOSMac, where the platform never considers a hardware
keyboard to be "connected", even when typing.

Source/WebKitLegacy/mac:

* Configurations/FeatureDefines.xcconfig:

Tools:

* TestWebKitAPI/Configurations/FeatureDefines.xcconfig:

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

19 months ago[LFC][IFC] Add support for variable height runs.
zalan@apple.com [Fri, 23 Nov 2018 17:05:43 +0000 (17:05 +0000)]
[LFC][IFC] Add support for variable height runs.
https://bugs.webkit.org/show_bug.cgi?id=191925

Reviewed by Antti Koivisto.

Source/WebCore:

https://www.w3.org/TR/CSS22/visudet.html#inline-box-height

10.8 Line height calculations: the 'line-height' and 'vertical-align' properties

The height of each inline-level box in the line box is calculated. For replaced elements, inline-block elements,
and inline-table elements, this is the height of their margin box; for inline boxes, this is their 'line-height'.

The line box height is the distance between the uppermost box top and the lowermost box bottom.

The minimum height consists of a minimum height above the baseline and a minimum depth below it,
exactly as if each line box starts with a zero-width inline box with the element's font and line height properties.
We call that imaginary box a "strut." (The name is inspired by TeX.).

Test: fast/inline/inline-content-with-image-simple.html

* layout/Verification.cpp:
(WebCore::Layout::checkForMatchingNonTextRuns):
(WebCore::Layout::checkForMatchingTextRuns):
(WebCore::Layout::outputMismatchingComplexLineInformationIfNeeded):
* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::initializeNewLine const):
(WebCore::Layout::InlineFormattingContext::splitInlineRunIfNeeded const):
(WebCore::Layout::InlineFormattingContext::createFinalRuns const):
(WebCore::Layout::InlineFormattingContext::appendContentToLine const):
(WebCore::Layout::InlineFormattingContext::layoutInlineContent const):
* layout/inlineformatting/InlineFormattingContext.h:
(WebCore::Layout::InlineFormattingContext::Line::logicalHeight const):
* layout/inlineformatting/InlineFormattingContextGeometry.cpp:
(WebCore::Layout::InlineFormattingContext::Geometry::justifyRuns):
* layout/inlineformatting/InlineRun.h:
(WebCore::Layout::InlineRun::logicalWidth const):
(WebCore::Layout::InlineRun::logicalHeight const):
(WebCore::Layout::InlineRun::setLogicalWidth):
(WebCore::Layout::InlineRun::width const): Deleted.
(WebCore::Layout::InlineRun::height const): Deleted.
(WebCore::Layout::InlineRun::setWidth): Deleted.
* layout/inlineformatting/Line.cpp:
(WebCore::Layout::InlineFormattingContext::Line::init):
(WebCore::Layout::InlineFormattingContext::Line::appendContent):
(WebCore::Layout::InlineFormattingContext::Line::close):
* layout/layouttree/LayoutTreeBuilder.cpp:
(WebCore::Layout::outputInlineRuns):

Tools:

* LayoutReloaded/misc/LFC-passing-tests.txt:

LayoutTests:

* fast/inline/inline-content-with-image-simple-expected.txt: Added.
* fast/inline/inline-content-with-image-simple.html: Added.

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

19 months agoUI side compositing doesn't paint on Mac
antti@apple.com [Fri, 23 Nov 2018 15:07:40 +0000 (15:07 +0000)]
UI side compositing doesn't paint on Mac
https://bugs.webkit.org/show_bug.cgi?id=191908

Reviewed by Tim Horton.

Source/WebCore:

For clarity put RGB10 and RGB10A8 formats behind PLATFORM(IOS_FAMILY). They are not supported on Mac.

* platform/graphics/cocoa/IOSurface.h:
* platform/graphics/cocoa/IOSurface.mm:
(WebCore::IOSurface::IOSurface):
(WebCore::IOSurface::ensurePlatformContext):
(WebCore::IOSurface::format const):
(WebCore::operator<<):

Source/WebKit:

* Shared/RemoteLayerTree/RemoteLayerBackingStore.mm:
(WebKit::RemoteLayerBackingStore::bytesPerPixel const):
(WebKit::RemoteLayerBackingStore::surfaceBufferFormat const):

These deep color formats are not supported on Mac.

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

19 months ago[GTK] [WPE] Tools/Platform{GTK,WPE}.cmake files missing from the tarballs
berto@igalia.com [Fri, 23 Nov 2018 13:36:54 +0000 (13:36 +0000)]
[GTK] [WPE] Tools/Platform{GTK,WPE}.cmake files missing from the tarballs
https://bugs.webkit.org/show_bug.cgi?id=191923

Add Tools/PlatformGTK.cmake and Tools/PlatformWPE.cmake to their
respective tarballs.

Reviewed by Carlos Garcia Campos.

* gtk/manifest.txt.in:
* wpe/manifest.txt.in:

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

19 months ago[css-grid] Implement Baseline Alignment for grid items
jfernandez@igalia.com [Fri, 23 Nov 2018 11:04:23 +0000 (11:04 +0000)]
[css-grid] Implement Baseline Alignment for grid items
https://bugs.webkit.org/show_bug.cgi?id=145566

Reviewed by Manuel Rego Casasnovas.

LayoutTests/imported/w3c:

Updated test expectations of severla tests, that are now passing with the new code.

* resources/import-expectations.json:
* web-platform-tests/css/css-grid/alignment/grid-alignment-style-changes-001-expected.txt:
* web-platform-tests/css/css-grid/alignment/grid-alignment-style-changes-002-expected.txt:
* web-platform-tests/css/css-grid/alignment/grid-alignment-style-changes-003-expected.txt:
* web-platform-tests/css/css-grid/alignment/grid-alignment-style-changes-004-expected.txt:
* web-platform-tests/css/css-grid/alignment/grid-alignment-style-changes-005-expected.txt:
* web-platform-tests/css/css-grid/alignment/grid-alignment-style-changes-006-expected.txt:
* web-platform-tests/css/css-grid/alignment/grid-alignment-style-changes-007-expected.txt:
* web-platform-tests/css/css-grid/alignment/grid-alignment-style-changes-008-expected.txt:
* web-platform-tests/css/css-grid/alignment/grid-column-axis-self-baseline-synthesized-001-expected.txt:
* web-platform-tests/css/css-grid/alignment/grid-column-axis-self-baseline-synthesized-002-expected.txt:
* web-platform-tests/css/css-grid/alignment/grid-column-axis-self-baseline-synthesized-003-expected.txt:
* web-platform-tests/css/css-grid/alignment/grid-column-axis-self-baseline-synthesized-004-expected.txt:
* web-platform-tests/css/css-grid/alignment/grid-row-axis-self-baseline-synthesized-001-expected.txt:
* web-platform-tests/css/css-grid/alignment/grid-row-axis-self-baseline-synthesized-002-expected.txt:
* web-platform-tests/css/css-grid/alignment/grid-row-axis-self-baseline-synthesized-003-expected.txt:
* web-platform-tests/css/css-grid/alignment/grid-row-axis-self-baseline-synthesized-004-expected.txt:
* web-platform-tests/css/css-grid/alignment/grid-self-baseline-not-applied-if-sizing-cyclic-dependency-001-expected.txt:
* web-platform-tests/css/css-grid/alignment/grid-self-baseline-not-applied-if-sizing-cyclic-dependency-002-expected.txt:
* web-platform-tests/css/css-grid/alignment/grid-self-baseline-not-applied-if-sizing-cyclic-dependency-003-expected.txt:
* web-platform-tests/css/css-grid/alignment/self-baseline/grid-self-baseline-changes-grid-area-size-007.html:
* web-platform-tests/css/css-grid/alignment/self-baseline/grid-self-baseline-changes-grid-area-size-008.html:
* web-platform-tests/css/css-grid/alignment/self-baseline/grid-self-baseline-changes-grid-area-size-009.html:
* web-platform-tests/css/css-grid/alignment/self-baseline/grid-self-baseline-changes-grid-area-size-010.html:
* web-platform-tests/css/css-grid/alignment/self-baseline/grid-self-baseline-changes-grid-area-size-011.html:
* web-platform-tests/css/css-grid/alignment/self-baseline/grid-self-baseline-changes-grid-area-size-012.html:
* web-platform-tests/css/css-grid/grid-items/grid-items-percentage-margins-002-expected.txt:
* web-platform-tests/css/css-grid/grid-items/grid-items-percentage-margins-vertical-lr-002-expected.txt:
* web-platform-tests/css/css-grid/grid-items/grid-items-percentage-margins-vertical-rl-002-expected.txt:
* web-platform-tests/css/css-grid/grid-items/grid-items-percentage-paddings-002-expected.txt:
* web-platform-tests/css/css-grid/grid-items/grid-items-percentage-paddings-vertical-lr-002-expected.txt:
* web-platform-tests/css/css-grid/grid-items/grid-items-percentage-paddings-vertical-rl-002-expected.txt:

Source/WebCore:

This patch impements the Baseline Self-Alignment feature for grid items according to
the CSS Box Alignment specification [1].

This new layout logic is handled by the Self-Alignment (justify-self and align-self)
and Default-Alignment (justify-items and align-items) CSS properties.

This feature allows users to align the grid items sharing a Baseline Alignment Context,
either row or column contexts, based on their respective baselines.

[1] https://drafts.csswg.org/css-align-3/#baseline-align-self

Tests: fast/css-grid-layout/grid-self-baseline-and-flex-tracks-with-indefinite-container-crash.html
       fast/css-grid-layout/grid-self-baseline-and-flexible-tracks-should-not-crash.html
       fast/css-grid-layout/grid-self-baseline-and-item-relayout-should-not-crash.html
       fast/css-grid-layout/grid-self-baseline-and-relative-sized-items-crash.html
       fast/css-grid-layout/grid-self-baseline-and-relative-sized-tracks-crash.html
       fast/css-grid-layout/grid-self-baseline-followed-by-item-style-change-should-not-crash.html

* Sources.txt:
* rendering/GridBaselineAlignment.cpp: Added.
(WebCore::GridBaselineAlignment::marginOverForChild const):
(WebCore::GridBaselineAlignment::marginUnderForChild const):
(WebCore::GridBaselineAlignment::logicalAscentForChild const):
(WebCore::GridBaselineAlignment::ascentForChild const):
(WebCore::GridBaselineAlignment::descentForChild const):
(WebCore::GridBaselineAlignment::isDescentBaselineForChild const):
(WebCore::GridBaselineAlignment::isHorizontalBaselineAxis const):
(WebCore::GridBaselineAlignment::isOrthogonalChildForBaseline const):
(WebCore::GridBaselineAlignment::isParallelToBaselineAxisForChild const):
(WebCore::GridBaselineAlignment::baselineGroupForChild const):
(WebCore::GridBaselineAlignment::updateBaselineAlignmentContext):
(WebCore::GridBaselineAlignment::baselineOffsetForChild const):
(WebCore::GridBaselineAlignment::clear):
(WebCore::BaselineGroup::BaselineGroup):
(WebCore::BaselineGroup::update):
(WebCore::BaselineGroup::isOppositeBlockFlow const):
(WebCore::BaselineGroup::isOrthogonalBlockFlow const):
(WebCore::BaselineGroup::isCompatible const):
(WebCore::BaselineContext::BaselineContext):
(WebCore::BaselineContext::sharedGroup const):
(WebCore::BaselineContext::updateSharedGroup):
(WebCore::BaselineContext::findCompatibleSharedGroup):
* rendering/GridBaselineAlignment.h: Added.
(WebCore::BaselineGroup::maxAscent const):
(WebCore::BaselineGroup::maxDescent const):
(WebCore::BaselineGroup::size const):
(WebCore::isBaselinePosition):
(WebCore::GridBaselineAlignment::setBlockFlow):
* rendering/GridLayoutFunctions.h:
* rendering/GridTrackSizingAlgorithm.cpp:
(WebCore::gridAxisForDirection):
(WebCore::gridDirectionForAxis):
(WebCore::GridTrackSizingAlgorithm::availableSpace const):
(WebCore::GridTrackSizingAlgorithm::isIntrinsicSizedGridArea const):
(WebCore::GridTrackSizingAlgorithmStrategy::logicalHeightForChild const):
(WebCore::GridTrackSizingAlgorithmStrategy::minContentForChild const):
(WebCore::GridTrackSizingAlgorithmStrategy::maxContentForChild const):
(WebCore::GridTrackSizingAlgorithmStrategy::minSizeForChild const):
(WebCore::GridTrackSizingAlgorithm::canParticipateInBaselineAlignment const):
(WebCore::GridTrackSizingAlgorithm::participateInBaselineAlignment const):
(WebCore::GridTrackSizingAlgorithm::updateBaselineAlignmentContext):
(WebCore::GridTrackSizingAlgorithm::baselineOffsetForChild const):
(WebCore::GridTrackSizingAlgorithm::clearBaselineItemsCache):
(WebCore::GridTrackSizingAlgorithm::cacheBaselineAlignedItem):
(WebCore::GridTrackSizingAlgorithm::copyBaselineItemsCache):
(WebCore::GridTrackSizingAlgorithm::setup):
(WebCore::GridTrackSizingAlgorithm::computeBaselineAlignmentContext):
* rendering/GridTrackSizingAlgorithm.h:
* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::firstLineBaseline const):
* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::layoutBlock):
(WebCore::RenderGrid::computeIntrinsicLogicalWidths const):
(WebCore::RenderGrid::placeItemsOnGrid const):
(WebCore::RenderGrid::performGridItemsPreLayout const):
(WebCore::synthesizedBaselineFromMarginBox):
(WebCore::RenderGrid::isBaselineAlignmentForChild const):
(WebCore::RenderGrid::baselinePosition const):
(WebCore::RenderGrid::firstLineBaseline const):
(WebCore::RenderGrid::inlineBlockBaseline const):
(WebCore::RenderGrid::columnAxisBaselineOffsetForChild const):
(WebCore::RenderGrid::rowAxisBaselineOffsetForChild const):
(WebCore::RenderGrid::columnAxisOffsetForChild const):
(WebCore::RenderGrid::rowAxisOffsetForChild const):
* rendering/RenderGrid.h:

LayoutTests:

Most of the baseline realated tests pass now; just a few still fail because of unrelated bugs.

* TestExpectations: Removed several entries, related to the baseline tests that are now passing.
* fast/css-grid-layout/grid-align-baseline-expected.txt:
* fast/css-grid-layout/grid-align-baseline-vertical-expected.txt:
* fast/css-grid-layout/grid-baseline-expected.html:
* fast/css-grid-layout/grid-baseline-margins-expected.html:
* fast/css-grid-layout/grid-baseline-margins.html:
* fast/css-grid-layout/grid-baseline-must-respect-grid-order-expected.txt:
* fast/css-grid-layout/grid-baseline-must-respect-grid-order.html:
* fast/css-grid-layout/grid-baseline.html:
* fast/css-grid-layout/grid-self-baseline-and-flex-tracks-with-indefinite-container-crash-expected.txt: Added.
* fast/css-grid-layout/grid-self-baseline-and-flex-tracks-with-indefinite-container-crash.html: Added.
* fast/css-grid-layout/grid-self-baseline-and-flexible-tracks-should-not-crash-expected.txt: Added.
* fast/css-grid-layout/grid-self-baseline-and-flexible-tracks-should-not-crash.html: Added.
* fast/css-grid-layout/grid-self-baseline-and-item-relayout-should-not-crash-expected.txt: Added.
* fast/css-grid-layout/grid-self-baseline-and-item-relayout-should-not-crash.html: Added.
* fast/css-grid-layout/grid-self-baseline-and-relative-sized-items-crash-expected.txt: Added.
* fast/css-grid-layout/grid-self-baseline-and-relative-sized-items-crash.html: Added.
* fast/css-grid-layout/grid-self-baseline-and-relative-sized-tracks-crash-expected.txt: Added.
* fast/css-grid-layout/grid-self-baseline-and-relative-sized-tracks-crash.html: Added.
* fast/css-grid-layout/grid-self-baseline-followed-by-item-style-change-should-not-crash-expected.txt: Added.
* fast/css-grid-layout/grid-self-baseline-followed-by-item-style-change-should-not-crash.html: Added.
* fast/css-grid-layout/grid-self-baseline-two-dimensional-expected.txt:
* fast/css-grid-layout/grid-self-baseline-two-dimensional.html:

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

19 months agoRegression(r238353) Load sometimes hangs when navigating back after a cross-site...
cdumez@apple.com [Fri, 23 Nov 2018 04:36:38 +0000 (04:36 +0000)]
Regression(r238353) Load sometimes hangs when navigating back after a cross-site navigation
https://bugs.webkit.org/show_bug.cgi?id=191914

Reviewed by Ryosuke Niwa.

Source/WebKit:

When process-swapping on a cross-site server-side redirect, we end up doing a decidePolicyForNavigationResponse
policy check for the about:blank suspension load. This policy decision is ignored by the UIProcess because
SuspendedPageProxy does not handle this particular IPC message. To handle the issue, make sure the WebProcess
never sends a DecidePolicyForNavigationResponse IPC to the UIProcess for about:blank suspension loads and let
the load proceed.

The issue was already there before r238353 but it was made obvious by r238353 which caused a hang when trying
to reuse a Suspended page which is hanging while trying to suspend.

* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse):

Tools:

Add API test coverage.

* TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm:

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

19 months ago[Cocoa] clang emits a warning when building WebKit after r238293
wenson_hsieh@apple.com [Fri, 23 Nov 2018 04:00:31 +0000 (04:00 +0000)]
[Cocoa] clang emits a warning when building WebKit after r238293
https://bugs.webkit.org/show_bug.cgi?id=191917

Reviewed by Dan Bernstein.

Move the implementations of -setSafeBrowsingEnabled: and -isSafeBrowsingEnabled to the main implementation of
WKPreferences to fix the warning.

* UIProcess/API/Cocoa/WKPreferences.mm:
(-[WKPreferences setSafeBrowsingEnabled:]):
(-[WKPreferences isSafeBrowsingEnabled]):

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

19 months agoAddress post-review feedback after r238438
wenson_hsieh@apple.com [Fri, 23 Nov 2018 03:10:34 +0000 (03:10 +0000)]
Address post-review feedback after r238438
https://bugs.webkit.org/show_bug.cgi?id=191913

Reviewed by Ryosuke Niwa.

Source/WebCore:

Replace `bool` arguments to `FrameSelection::setSelectedRange`, `Editor::replaceSelectionWithText`, and
`Editor::replaceSelectionWithFragment` with `enum class`es instead. In particular, introduce the following:

FrameSelection::ShouldCloseTyping { No, Yes }
Editor::SelectReplacement { No, Yes }
Editor::SmartReplace { No, Yes }
Editor::MatchStyle { No, Yes }

* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::selectText):
* editing/Editor.cpp:
(WebCore::Editor::handleTextEvent):
(WebCore::Editor::replaceSelectionWithFragment):
(WebCore::Editor::replaceSelectionWithText):
(WebCore::Editor::setComposition):
(WebCore::Editor::markMisspellingsAfterTypingToWord):
(WebCore::Editor::changeBackToReplacedString):
(WebCore::Editor::transpose):
(WebCore::Editor::insertAttachment):

At various call sites, replace boolean arguments with named enums.

* editing/Editor.h:
* editing/EditorCommand.cpp:
(WebCore::expandSelectionToGranularity):
(WebCore::executeDeleteToMark):
(WebCore::executeSelectToMark):
* editing/FrameSelection.cpp:
(WebCore::FrameSelection::setSelectedRange):
* editing/FrameSelection.h:
* page/Page.cpp:
(WebCore::replaceRanges):

Avoid a bit of ref-count churn, and adjust a few functions to take `const Vector&`s instead of `Vector&&`s.

(WebCore::Page::replaceRangesWithText):
(WebCore::Page::replaceSelectionWithText):
* page/Page.h:

Source/WebKit:

Replace boolean arguments to setSelectedRange, replaceSelectionWithText and replaceSelectionWithFragment with
enum flags, and tweak a couple of functions to take `const Vector&` instead of `Vector&&`.

* WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
(WKBundlePageReplaceStringMatches):
* WebProcess/WebPage/FindController.cpp:
(WebKit::FindController::replaceMatches):
* WebProcess/WebPage/FindController.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::replaceStringMatchesFromInjectedBundle):
(WebKit::WebPage::replaceMatches):
(WebKit::WebPage::replaceSelectionWithText):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::selectWithGesture):
(WebKit::WebPage::updateSelectionWithTouches):
(WebKit::WebPage::selectWithTwoTouches):
(WebKit::WebPage::extendSelection):
(WebKit::WebPage::selectWordBackward):
(WebKit::WebPage::moveSelectionByOffset):
(WebKit::WebPage::selectPositionAtPoint):
(WebKit::WebPage::selectPositionAtBoundaryWithDirection):
(WebKit::WebPage::moveSelectionAtBoundaryWithDirection):
(WebKit::WebPage::selectTextWithGranularityAtPoint):
(WebKit::WebPage::updateSelectionWithExtentPointAndBoundary):
(WebKit::WebPage::updateSelectionWithExtentPoint):
(WebKit::WebPage::replaceSelectedText):
(WebKit::WebPage::replaceDictatedText):
(WebKit::WebPage::syncApplyAutocorrection):

Source/WebKitLegacy/mac:

* WebView/WebFrame.mm:
(-[WebFrame setSelectedDOMRange:affinity:closeTyping:]):
(-[WebFrame _replaceSelectionWithFragment:selectReplacement:smartReplace:matchStyle:]):
* WebView/WebView.mm:
(-[WebView setSelectedDOMRange:affinity:]):

Source/WebKitLegacy/win:

* AccessibleTextImpl.cpp:
(AccessibleText::replaceText):

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

19 months agoMake the jsc shell's dumpException() more robust against long exception strings.
mark.lam@apple.com [Fri, 23 Nov 2018 01:33:40 +0000 (01:33 +0000)]
Make the jsc shell's dumpException() more robust against long exception strings.
https://bugs.webkit.org/show_bug.cgi?id=191910
<rdar://problem/46212980>

Reviewed by Michael Saboff.

This only affects the dumping of the exception string in the jsc shell due to
unhandled exceptions or exceptions at shell boot time before any JS code is
running.

* jsc.cpp:
(dumpException):

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

19 months agoModernize SVGURIReference::targetElementFromIRIString
rniwa@webkit.org [Thu, 22 Nov 2018 23:47:33 +0000 (23:47 +0000)]
Modernize SVGURIReference::targetElementFromIRIString
https://bugs.webkit.org/show_bug.cgi?id=191898

Reviewed by Daniel Bates.

Made targetElementFromIRIString return an element and the fragment identifier,
and merged urlFromIRIStringWithFragmentIdentifier into it.

Also replaced the code computing the full URL using the base URL after removing
the fragment identifier and rejoining it later with a single call to completeURL.

No new tests since there should be no observable behavior change.

* accessibility/AccessibilitySVGElement.cpp:
(WebCore::AccessibilitySVGElement::targetForUseElement const):
* css/CSSCursorImageValue.cpp:
(WebCore::CSSCursorImageValue::updateCursorElement):
* rendering/svg/RenderSVGTextPath.cpp:
(WebCore::RenderSVGTextPath::layoutPath const):
* svg/SVGAltGlyphElement.cpp:
(WebCore::SVGAltGlyphElement::hasValidGlyphElements const):
* svg/SVGFEImageElement.cpp:
(WebCore::SVGFEImageElement::buildPendingResource):
* svg/SVGGlyphRefElement.cpp:
(WebCore::SVGGlyphRefElement::hasValidGlyphElement const):
* svg/SVGLinearGradientElement.cpp:
(WebCore::SVGLinearGradientElement::collectGradientAttributes):
* svg/SVGMPathElement.cpp:
(WebCore::SVGMPathElement::buildPendingResource):
(WebCore::SVGMPathElement::pathElement):
* svg/SVGRadialGradientElement.cpp:
(WebCore::SVGRadialGradientElement::collectGradientAttributes):
* svg/SVGTRefElement.cpp:
(WebCore::SVGTRefElement::detachTarget):
(WebCore::SVGTRefElement::buildPendingResource):
* svg/SVGTextPathElement.cpp:
(WebCore::SVGTextPathElement::buildPendingResource):
* svg/SVGURIReference.cpp:
(WebCore::SVGURIReference::targetElementFromIRIString):
(WebCore::urlFromIRIStringWithFragmentIdentifier): Deleted.
* svg/SVGURIReference.h:
* svg/SVGUseElement.cpp:
(WebCore::SVGUseElement::findTarget const):
* svg/animation/SVGSMILElement.cpp:
(WebCore::SVGSMILElement::buildPendingResource):
* svg/graphics/filters/SVGFEImage.cpp:
(WebCore::FEImage::referencedRenderer const):

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

19 months agoImplement WebGPUQueue and device.getQueue()
dino@apple.com [Thu, 22 Nov 2018 21:17:41 +0000 (21:17 +0000)]
Implement WebGPUQueue and device.getQueue()
https://bugs.webkit.org/show_bug.cgi?id=191911
<rdar://problem/46214871>

Reviewed by Antoine Quint.

Source/WebCore:

Implement WebGPUDevice::getQueue(), which creates a WebGPUQueue
instance if necessary. Also link WebGPUQueue to the existing
GPUQueue object, and expose the label IDL property.

This patch is based on some work from Justin Fan.

Test: webgpu/queue-creation.html

* DerivedSources.make:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
    New files.

* Modules/webgpu/WebGPUCommandBuffer.h:
(WebCore::WebGPUCommandBuffer::commandBuffer const):
    Expose a GPUCommandBuffer getter, used when submitting (even though
    the actual GPU submission isn't implemented yet).

* Modules/webgpu/WebGPUDevice.cpp:
(WebCore::WebGPUDevice::getQueue):
* Modules/webgpu/WebGPUDevice.h:
* Modules/webgpu/WebGPUDevice.idl:
    Implement getQueue().

* Modules/webgpu/WebGPUQueue.cpp:
(WebCore::WebGPUQueue::create):
(WebCore::WebGPUQueue::WebGPUQueue):
(WebCore::WebGPUQueue::submit):
* Modules/webgpu/WebGPUQueue.h:
(WebCore::WebGPUQueue::label const):
(WebCore::WebGPUQueue::setLabel):
* Modules/webgpu/WebGPUQueue.idl:
    New class. Mostly sends stuff onto GPUQueue.

* bindings/js/WebCoreBuiltinNames.h:
    Add WebGPUQueue.

* platform/graphics/gpu/GPUQueue.h:
* platform/graphics/gpu/cocoa/GPUQueueMetal.mm:
(WebCore::GPUQueue::create):
(WebCore::GPUQueue::submit):
(WebCore::GPUQueue::label const):
(WebCore::GPUQueue::setLabel const):
    "label" getter/setter that uses
    the underlying MTLCommandQueue label property, but prefixes
    it with a WebKit identifier, so it can be correctly
    identified in system crash logs as coming from WebGPU.

LayoutTests:

WPT-style test for queue creation.

* webgpu/queue-creation-expected.txt: Added.
* webgpu/queue-creation.html: Added.

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

19 months agoImprove fast/scrolling/scrolling-tree-includes-frame.html
commit-queue@webkit.org [Thu, 22 Nov 2018 20:32:52 +0000 (20:32 +0000)]
Improve fast/scrolling/scrolling-tree-includes-frame.html
https://bugs.webkit.org/show_bug.cgi?id=191912

These are small improvements to scrolling-tree-includes-frame.html:
- Run doTest() after the iframe is loaded and use waitUntilDone/notifyDone for more reliable timing.
- Use iframe@srcdoc instead of iframe@src and put the content of the iframe document in its own line.
- Move the iframe style in a separate <style> tag and ensure the iframe is really positioned at (0,0)
with no extra margin/padding/border.
- Remove unnecessary id="frame"
The test expectation is not changed.

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

* fast/scrolling/scrolling-tree-includes-frame.html:

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

19 months ago[LFC][IFC] Merge addNonBreakableStart/NonBreakableEnd calls.
zalan@apple.com [Thu, 22 Nov 2018 18:56:28 +0000 (18:56 +0000)]
[LFC][IFC] Merge addNonBreakableStart/NonBreakableEnd calls.
https://bugs.webkit.org/show_bug.cgi?id=191903

Reviewed by Antti Koivisto.

* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::collectInlineContentForSubtree const):

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