WebKit-https.git
6 months agoScrollingTreeScrollingNode: use LayerRepresentation for scroll container, scrolled...
zandobersek@gmail.com [Mon, 30 Sep 2019 05:15:40 +0000 (05:15 +0000)]
ScrollingTreeScrollingNode: use LayerRepresentation for scroll container, scrolled contents layers
https://bugs.webkit.org/show_bug.cgi?id=202256
<rdar://problem/55772092>

Reviewed by Simon Fraser.

Source/WebCore:

Make the scroll container and scrolled contents layer holders
platform-independent by using the LayerRepresentation as the underlying
type for the two member variables in ScrollingTreeScrollingNode.

* page/scrolling/ScrollingTreeScrollingNode.cpp:
(WebCore::ScrollingTreeScrollingNode::commitStateBeforeChildren):
* page/scrolling/ScrollingTreeScrollingNode.h:
* page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
(WebCore::ScrollingTreeFrameScrollingNodeMac::repositionScrollingLayers):
* page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.mm:
(WebCore::ScrollingTreeOverflowScrollingNodeMac::repositionScrollingLayers):

Source/WebKit:

* UIProcess/RemoteLayerTree/ios/RemoteScrollingCoordinatorProxyIOS.mm:
(WebKit::RemoteScrollingCoordinatorProxy::establishLayerTreeScrollingRelations):
Use static casts to retrieve the CALayer pointers from the
LayerRepresentation objects due to the explicit operators.

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

6 months agoAddress static analysis warning in ParkingLot.cpp: Access to field 'size' results...
krollin@apple.com [Mon, 30 Sep 2019 02:21:48 +0000 (02:21 +0000)]
Address static analysis warning in ParkingLot.cpp: Access to field 'size' results in a dereference of a null pointer
https://bugs.webkit.org/show_bug.cgi?id=202154
<rdar://problem/55672103>

Reviewed by Brent Fulgham.

Static analysis reports the following:

    .../OpenSource/Source/WTF/wtf/ParkingLot.cpp:376:30: warning: Access to field 'size' results in a dereference of a null pointer (loaded from variable 'oldHashtable')
        RELEASE_ASSERT(newSize > oldHashtable->size);
                                 ^~~~~~~~~~~~~~~~~~

This warning arises because earlier code checks to see if oldHashtable
is NULL, leading the static analyzer to think that it *could* be NULL.
However, even earlier code actually ensures that oldHashtable will not
be NULL. Address this by removing the NULL check, and back it up with
an ASSERT to ensure that it's not NULL.

* wtf/ParkingLot.cpp:

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

6 months ago[FTW] Correct compositing, shadow, and radial gradient implementations
bfulgham@apple.com [Sun, 29 Sep 2019 19:33:37 +0000 (19:33 +0000)]
[FTW] Correct compositing, shadow, and radial gradient implementations
https://bugs.webkit.org/show_bug.cgi?id=202177

Reviewed by Fujii Hironori.

This patch corrects a number of implementation errors in basic Canvas
drawing operations.

Tested by canvas/philip/tests

* platform/graphics/win/Direct2DOperations.cpp:
(WebCore::Direct2D::State::setCompositeOperation): Initialize blend and
composite modes to correct defaults.
(WebCore::Direct2D::drawWithShadowHelper): Correct value used for blur
standard deviation to more closely match other browser output.
* platform/graphics/win/Direct2DUtilities.cpp:
(WebCore::Direct2D::createBitmapCopyFromContext): Added helper function.
* platform/graphics/win/Direct2DUtilities.h:
* platform/graphics/win/GradientDirect2D.cpp:
(WebCore::Gradient::generateGradient): Properly handle the case of a non-zero
initial gradient radius. Properly compute the final radius.
* platform/graphics/win/ImageBufferDataDirect2D.cpp:
(WebCore::ImageBufferData::readDataFromBitmapIfNeeded const): Update to use ID2D1DeviceContext
from platformContext, rather than searching for it each time.
(WebCore::ImageBufferData::compatibleBitmap): Ditto.
* platform/graphics/win/PlatformContextDirect2D.cpp:
(WebCore::PlatformContextDirect2D::PlatformContextDirect2D): Grab the ID2D1DeviceContext for
the RenderTarget at construction time.
(WebCore::PlatformContextDirect2D::setRenderTarget): Ditto.
(WebCore::PlatformContextDirect2D::endDraw): Perform compositing operations when needed.
(WebCore::PlatformContextDirect2D::compositeIfNeeded): Added.
(WebCore::PlatformContextDirect2D::setBlendAndCompositeMode): Update to properly set the
blend and compositing mode (depending on global value set for the canvas.)
* platform/graphics/win/PlatformContextDirect2D.h:
(WebCore::PlatformContextDirect2D::deviceContext):
(WebCore::PlatformContextDirect2D::setRenderTarget): Deleted.
(WebCore::PlatformContextDirect2D::setBlendMode): Deleted.
(WebCore::PlatformContextDirect2D::setCompositeMode): Deleted.

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

6 months agoTighten up LayerRepresentation operators
zandobersek@gmail.com [Sun, 29 Sep 2019 17:25:43 +0000 (17:25 +0000)]
Tighten up LayerRepresentation operators
https://bugs.webkit.org/show_bug.cgi?id=202344

Reviewed by Simon Fraser.

Source/WebCore:

Make the operators on the LayerRepresentation class explicit.
Additionally, the bool operator is added to the class, allowing objects
of this class to be safely used in boolean contexts like null checks.
Before, use in such contexts fell back to using the
GraphicsLayer::PlatformLayerID operator which caused asserts when the
internal representation was of different type.

While the explicit operators prevent misuse, they do require additional
conversion casts to retrieve the internal LayerRepresentation value.

* page/scrolling/ScrollingStateNode.h:
(WebCore::LayerRepresentation::operator GraphicsLayer* const):
(WebCore::LayerRepresentation::operator PlatformLayer* const):
(WebCore::LayerRepresentation::operator GraphicsLayer::PlatformLayerID const):
(WebCore::LayerRepresentation::operator bool const):
(WebCore::LayerRepresentation::toRepresentation const):
Add a missing ASSERT_NOT_REACHED() invocation.
* page/scrolling/ScrollingTreeScrollingNode.cpp:
(WebCore::ScrollingTreeScrollingNode::commitStateBeforeChildren):
* page/scrolling/cocoa/ScrollingTreeFixedNode.mm:
(WebCore::ScrollingTreeFixedNode::commitStateBeforeChildren):
* page/scrolling/cocoa/ScrollingTreeOverflowScrollProxyNode.mm:
(WebCore::ScrollingTreeOverflowScrollProxyNode::commitStateBeforeChildren):
* page/scrolling/cocoa/ScrollingTreePositionedNode.mm:
(WebCore::ScrollingTreePositionedNode::commitStateBeforeChildren):
* page/scrolling/cocoa/ScrollingTreeStickyNode.mm:
(WebCore::ScrollingTreeStickyNode::commitStateBeforeChildren):
* page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
(WebCore::ScrollingTreeFrameScrollingNodeMac::commitStateBeforeChildren):

Source/WebKit:

With LayerRepresentation operators now being explicit, we require
to manually specify conversion to CALayer pointers or
GraphicsLayer::PlatformLayerID values.

* UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.cpp:
(WebKit::RemoteScrollingCoordinatorProxy::connectStateNodeLayers):
* UIProcess/RemoteLayerTree/ios/RemoteScrollingCoordinatorProxyIOS.mm:
(WebKit::RemoteScrollingCoordinatorProxy::connectStateNodeLayers):
* UIProcess/RemoteLayerTree/ios/ScrollingTreeFrameScrollingNodeRemoteIOS.mm:
(WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::commitStateBeforeChildren):
* UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm:
(WebKit::ScrollingTreeScrollingNodeDelegateIOS::commitStateBeforeChildren):
* UIProcess/RemoteLayerTree/mac/ScrollingTreeFrameScrollingNodeRemoteMac.cpp:
(WebKit::ScrollingTreeFrameScrollingNodeRemoteMac::commitStateBeforeChildren):
* UIProcess/RemoteLayerTree/mac/ScrollingTreeOverflowScrollingNodeRemoteMac.cpp:
(WebKit::ScrollingTreeOverflowScrollingNodeRemoteMac::commitStateBeforeChildren):

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

6 months ago[LFC][IFC] Remove InlineLayout abstraction layer
zalan@apple.com [Sun, 29 Sep 2019 15:08:41 +0000 (15:08 +0000)]
[LFC][IFC] Remove InlineLayout abstraction layer
https://bugs.webkit.org/show_bug.cgi?id=202352
<rdar://problem/55811532>

Reviewed by Antti Koivisto.

Move InlineLayout functions to InlineFormattingContext. Now inline layout has
1. InlineFormattingContext -high level layout and preferred width computation, collecting inline content, constructing display boxes
2. LineLayout -responsible for placing inline content on the current line (partial inline content handling, line breaking etc)
3. Line -represents an actual line, turns inline content into runs.

* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::layoutInFlowContent):
(WebCore::Layout::InlineFormattingContext::lineLayout):
(WebCore::Layout::InlineFormattingContext::computedIntrinsicWidthConstraints):
(WebCore::Layout::InlineFormattingContext::computedIntrinsicWidthForConstraint const):
(WebCore::Layout::InlineFormattingContext::initialConstraintsForLine):
(WebCore::Layout::InlineFormattingContext::setDisplayBoxesForLine):
* layout/inlineformatting/InlineFormattingContext.h:
(WebCore::Layout::InlineFormattingContext::InlineLayout::layoutState const): Deleted.
(WebCore::Layout::InlineFormattingContext::InlineLayout::formattingContext const): Deleted.
(WebCore::Layout::InlineFormattingContext::InlineLayout::formattingRoot const): Deleted.
(WebCore::Layout::InlineFormattingContext::InlineLayout::formattingState): Deleted.
(WebCore::Layout::InlineFormattingContext::InlineLayout::widthConstraint const): Deleted.
* layout/inlineformatting/InlineFormattingContextLineLayout.cpp: Removed.
* layout/inlineformatting/InlineFormattingState.h:
(WebCore::Layout::InlineFormattingState::inlineItems const):
* layout/inlineformatting/InlineLineLayout.cpp: Added.
(WebCore::Layout::inlineItemWidth):
(WebCore::Layout::LineLayout::LineInput::LineInput):
(WebCore::Layout::LineLayout::UncommittedContent::add):
(WebCore::Layout::LineLayout::UncommittedContent::reset):
(WebCore::Layout::LineLayout::LineLayout):
(WebCore::Layout::LineLayout::commitPendingContent):
(WebCore::Layout::LineLayout::close):
(WebCore::Layout::LineLayout::placeInlineItem):
(WebCore::Layout::LineLayout::layout):
* layout/inlineformatting/InlineLineLayout.h: Added.
(WebCore::Layout::LineLayout::formattingContext const):
(WebCore::Layout::LineLayout::UncommittedContent::runs):
(WebCore::Layout::LineLayout::UncommittedContent::isEmpty const):
(WebCore::Layout::LineLayout::UncommittedContent::size const):
(WebCore::Layout::LineLayout::UncommittedContent::width const):

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

6 months ago[Nicosia] Add overflow, overflow proxy node implementations
zandobersek@gmail.com [Sun, 29 Sep 2019 08:56:34 +0000 (08:56 +0000)]
[Nicosia] Add overflow, overflow proxy node implementations
https://bugs.webkit.org/show_bug.cgi?id=202306

Reviewed by Carlos Garcia Campos.

Add the ScrollingTreeOverflowScrollProxyNode and
ScrollingTreeOverflowScrollingNodeNicosia classes, implementing the
missing overlfow node types. Both implementations are based on the
corresponsing classes for Cocoa/Mac platforms and should ideally
share most of the platform-agnostic logic.

* SourcesWPE.txt:
* page/scrolling/nicosia/ScrollingTreeOverflowScrollProxyNode.cpp: Added.
(WebCore::ScrollingTreeOverflowScrollProxyNode::create):
(WebCore::ScrollingTreeOverflowScrollProxyNode::ScrollingTreeOverflowScrollProxyNode):
(WebCore::ScrollingTreeOverflowScrollProxyNode::commitStateBeforeChildren):
(WebCore::ScrollingTreeOverflowScrollProxyNode::applyLayerPositions):
(WebCore::ScrollingTreeOverflowScrollProxyNode::dumpProperties const):
* page/scrolling/nicosia/ScrollingTreeOverflowScrollProxyNode.h: Added.
* page/scrolling/nicosia/ScrollingTreeOverflowScrollingNodeNicosia.cpp: Added.
(WebCore::ScrollingTreeOverflowScrollingNodeNicosia::create):
(WebCore::ScrollingTreeOverflowScrollingNodeNicosia::ScrollingTreeOverflowScrollingNodeNicosia):
(WebCore::ScrollingTreeOverflowScrollingNodeNicosia::commitStateAfterChildren):
(WebCore::ScrollingTreeOverflowScrollingNodeNicosia::adjustedScrollPosition const):
(WebCore::ScrollingTreeOverflowScrollingNodeNicosia::repositionScrollingLayers):
(WebCore::ScrollingTreeOverflowScrollingNodeNicosia::handleWheelEvent):
* page/scrolling/nicosia/ScrollingTreeOverflowScrollingNodeNicosia.h: Added.

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

6 months agoCrash when removing the target element while animating its attributes
said@apple.com [Sun, 29 Sep 2019 05:16:58 +0000 (05:16 +0000)]
Crash when removing the target element while animating its attributes
https://bugs.webkit.org/show_bug.cgi?id=202247

Reviewed by Darin Adler.

Source/WebCore:

If SMIL is animating a CSS attribute, there is a chance the animation is
ended while it is being started or progressed. For that reason, the member
SVGAnimateElementBase::m_animator has to be made RefPtr and it has to be
be protected in resetAnimatedType() and calculateAnimatedValue().

While SMILTimeContainer::updateAnimations() is calling progress() for the
scheduled animation elements, SMILTimeContainer::unschedule() might get
called if processing an animation causes events to be dispatched. For that
reason we need to copy the scheduled animations Vector before processing
them so we avoid changing the Vector while looping through its items.

Remove the guard SMILTimeContainer::m_preventScheduledAnimationsChanges
which was added in r129670 for debugging purposes. In some situations,
the scheduled animations map could be modified out from under some of the
functions of SMILTimeContainer.

Test: svg/animations/animate-and-remove-target-element.html

* svg/SVGAnimateElementBase.cpp:
(WebCore::SVGAnimateElementBase::resetAnimatedType):
(WebCore::SVGAnimateElementBase::calculateAnimatedValue):
* svg/SVGAnimateElementBase.h:
* svg/SVGElement.cpp:
(WebCore::SVGElement::createAnimator):
* svg/SVGElement.h:
* svg/animation/SMILTimeContainer.cpp:
(WebCore::SMILTimeContainer::schedule):
(WebCore::SMILTimeContainer::unschedule):
(WebCore::SMILTimeContainer::setElapsed):
(WebCore::SMILTimeContainer::sortByPriority):
(WebCore::SMILTimeContainer::processAnimations):
(WebCore::SMILTimeContainer::processScheduledAnimations):
(WebCore::SMILTimeContainer::updateAnimations):
(WebCore::SMILTimeContainer::~SMILTimeContainer): Deleted.
* svg/animation/SMILTimeContainer.h:
* svg/animation/SVGSMILElement.cpp:
(WebCore::SVGSMILElement::calculateNextProgressTime const):
* svg/properties/SVGAnimatedPropertyAccessorImpl.h:
* svg/properties/SVGAnimatedPropertyAnimatorImpl.h:
* svg/properties/SVGAnimatedPropertyPairAccessorImpl.h:
* svg/properties/SVGAnimatedPropertyPairAnimator.h:
* svg/properties/SVGAnimatedPropertyPairAnimatorImpl.h:
* svg/properties/SVGAttributeAnimator.h:
* svg/properties/SVGMemberAccessor.h:
(WebCore::SVGMemberAccessor::createAnimator const):
* svg/properties/SVGPrimitivePropertyAnimator.h:
(WebCore::SVGPrimitivePropertyAnimator::create):
* svg/properties/SVGPropertyAnimatorFactory.h:
(WebCore::SVGPropertyAnimatorFactory::createAnimator):
* svg/properties/SVGPropertyOwnerRegistry.h:
* svg/properties/SVGPropertyRegistry.h:
* svg/properties/SVGValuePropertyAnimatorImpl.h:
* svg/properties/SVGValuePropertyListAnimatorImpl.h:

LayoutTests:

* svg/animations/animate-and-remove-target-element-expected.txt: Added.
* svg/animations/animate-and-remove-target-element.html: Added.

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

6 months ago[LFC][IFC] Move horizontal alignment to Line
zalan@apple.com [Sun, 29 Sep 2019 01:59:27 +0000 (01:59 +0000)]
[LFC][IFC] Move horizontal alignment to Line
https://bugs.webkit.org/show_bug.cgi?id=202351
<rdar://problem/55810139>

Reviewed by Antti Koivisto.

Line should be able to finalize the run placement including horizontal alignment.

* layout/Verification.cpp:
(WebCore::Layout::outputMismatchingSimpleLineInformationIfNeeded):
* layout/inlineformatting/InlineFormattingContextLineLayout.cpp:
(WebCore::Layout::LineInput::LineInput):
(WebCore::Layout::LineLayout::LineLayout):
(WebCore::Layout::InlineFormattingContext::InlineLayout::layout):
(WebCore::Layout::InlineFormattingContext::InlineLayout::computedIntrinsicWidth const):
* layout/inlineformatting/InlineLine.cpp:
(WebCore::Layout::Line::Line):
(WebCore::Layout::Line::isVisuallyEmpty const):
(WebCore::Layout::Line::close):
(WebCore::Layout::Line::verticalAlignContent):
(WebCore::Layout::Line::horizontalAlignContent):
(WebCore::Layout::Line::appendInlineContainerStart):
(WebCore::Layout::Line::appendTextContent):
(WebCore::Layout::Line::appendNonReplacedInlineBox):
(WebCore::Layout::Line::appendHardLineBreak):
(WebCore::Layout::Line::inlineItemContentHeight const):
* layout/inlineformatting/InlineLine.h:

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

6 months ago[GTK][WPE] Fix non-unified build issue caused by r250440
aperez@igalia.com [Sun, 29 Sep 2019 00:48:26 +0000 (00:48 +0000)]
[GTK][WPE] Fix non-unified build issue caused by r250440
https://bugs.webkit.org/show_bug.cgi?id=202349

Reviewed by Mark Lam.

* dfg/DFGOSRExit.cpp: Add missing inclusion of the BytecodeUseDef.h header.

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

6 months ago[IDL] Support record<DOMString, *Callback> in bindings
wenson_hsieh@apple.com [Sun, 29 Sep 2019 00:26:13 +0000 (00:26 +0000)]
[IDL] Support record<DOMString, *Callback> in bindings
https://bugs.webkit.org/show_bug.cgi?id=202326

Reviewed by Sam Weinig.

Currently, IDLRecord's converter assumes that the value type (template argument V) can be converted by passing
in only an ExecState and the JSValue, since it calls `auto typedValue = Converter<V>::convert(state, subValue)`.
However, IDLCallbackFunctions additionally require the JSDOMGlobalObject (see JSDOMConverterCallbacks.h). This
results in a compilation error in generated code, when attempting to convert the record.

To fix this, teach Converter<IDLRecord<K, V>> to accept three arguments (the ExecState, value, and global
object) in the case where V requires the global object. Additionally, let the bindings generator know that
JSValue to native object conversion requires the global object, by returning whether or not the value type of
the IDL record requires the global object, in the case where the given type is a record.

* bindings/js/JSDOMConvertRecord.h:
* bindings/scripts/CodeGeneratorJS.pm:
(JSValueToNativeDOMConvertNeedsGlobalObject):
* bindings/scripts/test/JS/JSTestObj.cpp:

Test this scenario by augmenting TestObj.idl with record<DOMString, VoidCallback>.

(WebCore::jsTestObjStringVoidCallbackRecordAttrGetter):
(WebCore::jsTestObjStringVoidCallbackRecordAttr):
(WebCore::setJSTestObjStringVoidCallbackRecordAttrSetter):
(WebCore::setJSTestObjStringVoidCallbackRecordAttr):
* bindings/scripts/test/TestObj.idl:

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

6 months ago[LFC][IFC] Line::InitialConstraints's heightAndBaseline should be optional
zalan@apple.com [Sat, 28 Sep 2019 23:58:10 +0000 (23:58 +0000)]
[LFC][IFC] Line::InitialConstraints's heightAndBaseline should be optional
https://bugs.webkit.org/show_bug.cgi?id=202348

Reviewed by Antti Koivisto.

Vertical properties are undefined while computing the preferred width.

* layout/inlineformatting/InlineFormattingContextLineLayout.cpp:
(WebCore::Layout::LineInput::LineInput):
(WebCore::Layout::InlineFormattingContext::InlineLayout::computedIntrinsicWidth const):
* layout/inlineformatting/InlineLine.cpp:
(WebCore::Layout::Line::Line):
* layout/inlineformatting/InlineLine.h:

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

6 months ago[Experiment][iOS] Add temporary HTTP header to distinguish iPads for requests to...
cdumez@apple.com [Sat, 28 Sep 2019 21:38:14 +0000 (21:38 +0000)]
[Experiment][iOS] Add temporary HTTP header to distinguish iPads for requests to Google
https://bugs.webkit.org/show_bug.cgi?id=202335
<rdar://problem/55790994>

Reviewed by Maciej Stachowiak.

* loader/cache/CachedResourceLoader.cpp:
(WebCore::CachedResourceLoader::requestResource):
* platform/network/HTTPHeaderNames.in:

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

6 months ago[LFC][IFC] Line::Box should have a const public interface
zalan@apple.com [Sat, 28 Sep 2019 14:30:40 +0000 (14:30 +0000)]
[LFC][IFC] Line::Box should have a const public interface
https://bugs.webkit.org/show_bug.cgi?id=202336
<rdar://problem/55798628>

Reviewed by Antti Koivisto.

Clean up Line::Box interface.

* layout/inlineformatting/InlineLine.cpp:
(WebCore::Layout::Line::close):
* layout/inlineformatting/InlineLine.h:
(WebCore::Layout::Line::Run::displayRun const):
(WebCore::Layout::Line::Run::isVisuallyEmpty const):
(WebCore::Layout::Line::Run::expand):
(WebCore::Layout::Line::Run::displayRun): Deleted.

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

6 months ago[JSC] Keep JSString::value(ExecState*)'s result as String instead of `const String&`
ysuzuki@apple.com [Sat, 28 Sep 2019 03:40:23 +0000 (03:40 +0000)]
[JSC] Keep JSString::value(ExecState*)'s result as String instead of `const String&`
https://bugs.webkit.org/show_bug.cgi?id=202330

Reviewed by Saam Barati.

JSTests:

* stress/to-lower-case-gc-stress.js: Added.

Source/JavaScriptCore:

In toLocaleLowerCase and toLocaleUpperCase, we get `const String&` from JSString* and use it.
But if this string is newly created one in toLocaleLowerCase and toLocaleUpperCase (like, passing a number, and number.toString() is called
in C++), after getting `const String&`, our C++ code potentially does not have any reference to the owner of this `const String&`. So, this
JSString* can be collected by GC, while `const String&` is used. This makes `const String&` destroyed, and causes crash.

In this patch, we receive it as `String` instead of `const String&` to ref it. This ensures that this string is live even if the owner is collected.
I grepped the source code and make this changes conservatively to places which looks dangerous. And I added error checks more after calling `value(exec)`.

In this patch, I didn't introduce the change like that: `JSString::value(ExecState*)` returns `String` instead of `const String&`. Some of places are
really performance sensitive and we want to use the current behavior when we can ensure the owners are alive. We could figure out these points, and we
can change the default behavior of `JSString::value` function to returning `String`. But for now, I plan it as a future work.

* dfg/DFGOperations.cpp:
* jsc.cpp:
(GlobalObject::moduleLoaderImportModule):
* runtime/DateConstructor.cpp:
(JSC::constructDate):
* runtime/JSCJSValueInlines.h:
(JSC::JSValue::equalSlowCaseInline):
* runtime/RegExpMatchesArray.h:
(JSC::createRegExpMatchesArray):
* runtime/StringPrototype.cpp:
(JSC::toLocaleCase):
(JSC::stringProtoFuncToLocaleLowerCase):
(JSC::stringProtoFuncToLocaleUpperCase):
* tools/JSDollarVM.cpp:
(JSC::functionCreateBuiltin):

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

6 months agoProvide build request status description information on dashboard.
dewei_zhu@apple.com [Fri, 27 Sep 2019 22:45:12 +0000 (22:45 +0000)]
Provide build request status description information on dashboard.
https://bugs.webkit.org/show_bug.cgi?id=199810

Reviewed by Ryosuke Niwa.

Add build request status description to show detailed information for a build and show it in dashboard.
Update SQL for existing instance:
    ALTER TABLE build_requests ADD COLUMN IF NOT EXISTS request_status_description varchar(1024) DEFAULT NULL;

* ReadMe.md: Updated instructions for initializing a database to include running 'migrate-database.sql'.
* init-database.sql: Added request_status_description column.
* migrate-database.sql: A file stores migration SQL for existing instance.
* public/api/build-requests.php: Added support for updating request_status_description.
* public/include/build-requests-fetcher.php: Exposed `statusDescription` to API.
* public/v3/components/test-group-revision-table.js: Added UI for showing build request status detail.
(TestGroupRevisionTable.prototype._renderTable):
(TestGroupRevisionTable.prototype._buildDescriptionCell):
(TestGroupRevisionTable.cssTemplate):
* public/v3/components/warning-icon.js: Extended warning icon to be able to customize information on hover.
(WarningIcon):
(WarningIcon.prototype.render):
* public/v3/components/button-base.js: Added a instance method to set button title.
(ButtonBase.prototype.setButtonTitle):
* public/v3/models/build-request.js: Added 'statusDescription' field.
(BuildRequest):
(BuildRequest.prototype.updateSingleton):
(BuildRequest.prototype.statusDescription):
* server-tests/api-build-requests-tests.js: Fixed unit tests.
* server-tests/resources/mock-data.js:
(MockData.set mockTestSyncConfigWithSingleBuilder): Added 'status_description' in buildbot mock data.
(MockData.sampleBuildData):
* server-tests/resources/test-server.js:
(TestServer.prototype.initDatabase): Added code to execute 'migrate-database.sql' on initialization.
* server-tests/tools-sync-buildbot-integration-tests.js: Added unit tests.
* tools/js/buildbot-syncer.js: Added 'statusDescription' field to 'BuildbotBuildEntry'.
(BuildbotBuildEntry.prototype.initialize):
(BuildbotBuildEntry.prototype.statusDescription):
* tools/js/buildbot-triggerable.js:
(BuildbotTriggerable.prototype._pullBuildbotOnAllSyncers):
* unit-tests/buildbot-syncer-tests.js: Added test code for BuildbotBuildEntry.statusDescription.

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

6 months agoPages using WebGLRenderingContext fail to enter the back/forward cache
cdumez@apple.com [Fri, 27 Sep 2019 22:42:20 +0000 (22:42 +0000)]
Pages using WebGLRenderingContext fail to enter the back/forward cache
https://bugs.webkit.org/show_bug.cgi?id=202318
<rdar://problem/55783612>

Reviewed by Tim Horton.

Source/WebCore:

Allow pages with a WebGLRenderingContext to enter the back/forward cache by updating the
implementation to use SuspendableTimers to fire JS events. This guarantees that no events
will be fired (and thus no JS will run) while in the page cache.

This was preventing some of the pages on weather.com and facebook.com from entering the
back/forward cache.

Test: fast/canvas/webgl/canvas-webgl-page-cache.html

* dom/DocumentEventQueue.cpp:
* html/canvas/WebGLRenderingContextBase.cpp:
(WebCore::WebGLRenderingContextBase::WebGLRenderingContextBase):
(WebCore::WebGLRenderingContextBase::canSuspendForDocumentSuspension const):
(WebCore::WebGLRenderingContextBase::suspend):
(WebCore::WebGLRenderingContextBase::resume):
(WebCore::WebGLRenderingContextBase::dispatchContextLostEvent):
(WebCore::WebGLRenderingContextBase::maybeRestoreContext):
(WebCore::WebGLRenderingContextBase::dispatchContextChangedNotification):
(WebCore::WebGLRenderingContextBase::dispatchContextChangedEvent):
* html/canvas/WebGLRenderingContextBase.h:
* page/DOMTimer.cpp:
(WebCore::DOMTimer::DOMTimer):
* page/DOMTimer.h:
* page/SuspendableTimer.cpp:
(WebCore::SuspendableTimerBase::SuspendableTimerBase):
(WebCore::SuspendableTimerBase::hasPendingActivity const):
(WebCore::SuspendableTimerBase::stop):
(WebCore::SuspendableTimerBase::suspend):
(WebCore::SuspendableTimerBase::resume):
(WebCore::SuspendableTimerBase::canSuspendForDocumentSuspension const):
(WebCore::SuspendableTimerBase::didStop):
(WebCore::SuspendableTimerBase::cancel):
(WebCore::SuspendableTimerBase::startRepeating):
(WebCore::SuspendableTimerBase::startOneShot):
(WebCore::SuspendableTimerBase::repeatInterval const):
(WebCore::SuspendableTimerBase::augmentFireInterval):
(WebCore::SuspendableTimerBase::augmentRepeatInterval):
(WebCore::SuspendableTimer::activeDOMObjectName const):
* page/SuspendableTimer.h:

Source/WebKitLegacy/win:

* WebView.cpp:
(WindowCloseTimer::WindowCloseTimer):
(WindowCloseTimer::contextDestroyed):
* WebView.h:

LayoutTests:

Add layout test coverage.

* fast/canvas/webgl/canvas-webgl-page-cache-expected.txt: Added.
* fast/canvas/webgl/canvas-webgl-page-cache.html: Added.

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

6 months ago[GTK][WPE] Fixes for non-unified builds after r249714
aperez@igalia.com [Fri, 27 Sep 2019 22:15:49 +0000 (22:15 +0000)]
[GTK][WPE] Fixes for non-unified builds after r249714
https://bugs.webkit.org/show_bug.cgi?id=202304

Reviewed by Youenn Fablet.

Source/WebCore:

No new tests needed.

* Modules/websockets/WorkerThreadableWebSocketChannel.cpp: Add missing inclusion of Frame.h
to make the compiler stop complaining about Frame being used without being defined.
* inspector/InspectorShaderProgram.h: Add missing inclusion of wtf/Variant.h, where
WTF::Monostate is defined; and prefixed the usage with its namespace.

Source/WebKit:

* NetworkProcess/NetworkLoadChecker.h: Add missing inclusion of the pal/SessionID.h header.
* NetworkProcess/NetworkResourceLoadMap.cpp: Add missing inclusion of the
NetworkResourceLoader.h header.
* UIProcess/API/C/WKWebsiteDataStoreConfigurationRef.cpp:
(WKWebsiteDataStoreConfigurationCreate): Add missing namespace to usage of the
WebKit::IsPersistent::Yes value.
* UIProcess/WebPageProxy.cpp: Add missing inclusion of the LegacyGlobalSettings.h header.

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

6 months agoSupport accessibility for <figure> element on iOS.
commit-queue@webkit.org [Fri, 27 Sep 2019 22:15:21 +0000 (22:15 +0000)]
Support accessibility for <figure> element on iOS.
https://bugs.webkit.org/show_bug.cgi?id=202272
<rdar://problem/54789907>

Patch by Andres Gonzalez <andresg_22@apple.com> on 2019-09-27
Reviewed by Chris Fleizach.

Source/WebCore:

Test: accessibility/ios-simulator/figure-element.html

Added a role description for the <figure> element.
* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::roleDescription const):

Tools:

Implemented titleUIElement and roleDescription properties for <figure> elements on iOS.
* WebKitTestRunner/InjectedBundle/ios/AccessibilityUIElementIOS.mm:
(WTR::AccessibilityUIElement::titleUIElement):
(WTR::AccessibilityUIElement::roleDescription):

LayoutTests:

* accessibility/ios-simulator/figure-element-expected.txt: Added.
* accessibility/ios-simulator/figure-element.html: Added.

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

6 months agoAdopt new UIWebGeolocationPolicyDecider SPI to pass a view instead of a window
timothy_horton@apple.com [Fri, 27 Sep 2019 21:56:21 +0000 (21:56 +0000)]
Adopt new UIWebGeolocationPolicyDecider SPI to pass a view instead of a window
https://bugs.webkit.org/show_bug.cgi?id=202329
<rdar://problem/25963823>

Reviewed by Wenson Hsieh.

* Platform/spi/ios/UIKitSPI.h:
* UIProcess/ios/WKGeolocationProviderIOS.mm:
(-[WKGeolocationProviderIOS geolocationAuthorizationGranted]):
* UIProcess/ios/WKGeolocationProviderIOSObjCSecurityOrigin.mm:
(WebKit::decidePolicyForGeolocationRequestFromOrigin):
Switch to newer SPI that takes a UIView instead of a UIWindow, so that
UIWebGeolocationPolicyDecider can find the correct presenting view controller.

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

6 months ago[iPadOS] Can’t use RalphLauren.com on iPad because hover menus don’t stay up
zalan@apple.com [Fri, 27 Sep 2019 21:52:37 +0000 (21:52 +0000)]
[iPadOS] Can’t use RalphLauren.com on iPad because hover menus don’t stay up
https://bugs.webkit.org/show_bug.cgi?id=202331
<rdar://problem/55629493>

Reviewed by Tim Horton.

Source/WebCore:

Unfortunately the top level menu items now are ARIA labelled as 'buttons' and that triggers the fast path on content observation.
This patch introduces a quirk on ralphLauren.com to ignore the ARIA labels when checking whether the target node should always click through.

* page/Quirks.cpp:
(WebCore::Quirks::shouldIgnoreAriaForFastPathContentObservationCheck const):
* page/Quirks.h:

Source/WebKit:

* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::handleSyntheticClick):
(WebKit::nodeTriggersFastPath): Deleted.

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

6 months ago[Win] Crash under FontCache::lastResortFallbackFont
pvollan@apple.com [Fri, 27 Sep 2019 21:05:05 +0000 (21:05 +0000)]
[Win] Crash under FontCache::lastResortFallbackFont
https://bugs.webkit.org/show_bug.cgi?id=202325
<rdar://problem/47856730>

Reviewed by Brent Fulgham.

As demonstrated by crash reports, there seems to be cases where we are not able to create a last resort fallback font
on Windows. If all attempts to create a fallback font fail, create a font from the default UI font.

No new tests. I have not been able to reproduce this issue.

* platform/graphics/win/FontCacheWin.cpp:
(WebCore::FontCache::lastResortFallbackFont):

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

6 months agoMove shouldUseTestingNetworkSession from NetworkProcessCreationParameters to NetworkS...
achristensen@apple.com [Fri, 27 Sep 2019 20:57:23 +0000 (20:57 +0000)]
Move shouldUseTestingNetworkSession from NetworkProcessCreationParameters to NetworkSessionCreationParameters
https://bugs.webkit.org/show_bug.cgi?id=202327

Reviewed by Tim Horton.

Source/WebKit:

* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::initializeNetworkProcess):
(WebKit::NetworkProcess::ensureSession):
* NetworkProcess/NetworkProcess.h:
* NetworkProcess/NetworkProcessCreationParameters.cpp:
(WebKit::NetworkProcessCreationParameters::encode const):
(WebKit::NetworkProcessCreationParameters::decode):
* NetworkProcess/NetworkProcessCreationParameters.h:
* NetworkProcess/NetworkSession.cpp:
(WebKit::NetworkSession::NetworkSession):
* NetworkProcess/NetworkSessionCreationParameters.cpp:
(WebKit::NetworkSessionCreationParameters::encode const):
(WebKit::NetworkSessionCreationParameters::decode):
* NetworkProcess/NetworkSessionCreationParameters.h:
* NetworkProcess/cocoa/NetworkProcessCocoa.mm:
(WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
* NetworkProcess/curl/RemoteNetworkingContextCurl.cpp:
(WebKit::RemoteNetworkingContext::ensureWebsiteDataStoreSession):
* NetworkProcess/mac/RemoteNetworkingContext.mm:
(WebKit::RemoteNetworkingContext::ensureWebsiteDataStoreSession):
* NetworkProcess/soup/RemoteNetworkingContextSoup.cpp:
(WebKit::RemoteNetworkingContext::ensureWebsiteDataStoreSession):
* UIProcess/API/C/WKWebsiteDataStoreConfigurationRef.cpp:
(WKWebsiteDataStoreConfigurationSetPerOriginStorageQuota):
(WKWebsiteDataStoreConfigurationSetNetworkCacheSpeculativeValidationEnabled):
(WKWebsiteDataStoreConfigurationGetTestingSessionEnabled):
(WKWebsiteDataStoreConfigurationSetTestingSessionEnabled):
* UIProcess/API/C/WKWebsiteDataStoreConfigurationRef.h:
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::ensureNetworkProcess):
* UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
(WebKit::WebsiteDataStore::parameters):
* UIProcess/WebsiteData/WebsiteDataStoreConfiguration.cpp:
(WebKit::WebsiteDataStoreConfiguration::copy):
* UIProcess/WebsiteData/WebsiteDataStoreConfiguration.h:
(WebKit::WebsiteDataStoreConfiguration::testingSessionEnabled const):
(WebKit::WebsiteDataStoreConfiguration::setTestingSessionEnabled):

Tools:

* WebKitTestRunner/TestController.cpp:
(WTR::TestController::websiteDataStore):

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

6 months agoMove legacy custom protocol registration from process pool to NetworkProcessProxy
achristensen@apple.com [Fri, 27 Sep 2019 20:55:59 +0000 (20:55 +0000)]
Move legacy custom protocol registration from process pool to NetworkProcessProxy
https://bugs.webkit.org/show_bug.cgi?id=202315

Reviewed by Tim Horton.

Legacy custom protocol registration is a global thing, which is why it's legacy and we're trying to get rid of it.
In the meantime, we don't want it to be in the set of things the NetworkProcess depends on the WebProcessPool for, which should be an empty set.

* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::ensureNetworkProcess):
(WebKit::WebProcessPool::registerGlobalURLSchemeAsHavingCustomProtocolHandlers):
(WebKit::WebProcessPool::unregisterGlobalURLSchemeAsHavingCustomProtocolHandlers):
(WebKit::WebProcessPool::registerSchemeForCustomProtocol): Deleted.
(WebKit::WebProcessPool::unregisterSchemeForCustomProtocol): Deleted.
* UIProcess/WebProcessPool.h:

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

6 months agoLayout Test http/tests/cache-storage/cache-records-persistency.https.html is failing
achristensen@apple.com [Fri, 27 Sep 2019 20:49:49 +0000 (20:49 +0000)]
Layout Test http/tests/cache-storage/cache-records-persistency.https.html is failing
https://bugs.webkit.org/show_bug.cgi?id=202323

Reviewed by Tim Horton.

This reverts most of r250351.
It turns out NetworkProcessProxy::addSession has some side effects in the UIProcess that are useful for NetworkProcess resumption after crashes.  Let's keep that.

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

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

6 months agoUnreviewed, rolling out r250397.
jiewen_tan@apple.com [Fri, 27 Sep 2019 20:38:25 +0000 (20:38 +0000)]
Unreviewed, rolling out r250397.

caused failure on iOS 13

Reverted changeset:

"REGRESSION: [ Catalina WK2 ] http/wpt/webauthn/public-key-
credential-create-success-u2f.https.html is failing"
https://bugs.webkit.org/show_bug.cgi?id=201620
https://trac.webkit.org/changeset/250397

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

6 months agofast/images/async-image-multiple-clients-repaint.html
tsavell@apple.com [Fri, 27 Sep 2019 20:25:46 +0000 (20:25 +0000)]
fast/images/async-image-multiple-clients-repaint.html
https://bugs.webkit.org/show_bug.cgi?id=202328

Unreviewed test gardening

* platform/ios/TestExpectations:

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

6 months ago[iOS] Vimeo fails to AirPlay in desktop mode
jer.noble@apple.com [Fri, 27 Sep 2019 19:48:05 +0000 (19:48 +0000)]
[iOS] Vimeo fails to AirPlay in desktop mode
https://bugs.webkit.org/show_bug.cgi?id=202322

Reviewed by Eric Carlson.

Add a Quirk which opts Vimeo out of the preload=auto restriction, and allows their
second video element containing a HLS stream to correctly start AirPlaying when the
system route changes.

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::finishInitialization):
* page/Quirks.cpp:
(WebCore::Quirks::needsPreloadAutoQuirk const):
* page/Quirks.h:

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

6 months agoOSR exit shouldn't bother updating get_by_id array profiles that have changed modes
keith_miller@apple.com [Fri, 27 Sep 2019 19:30:07 +0000 (19:30 +0000)]
OSR exit shouldn't bother updating get_by_id array profiles that have changed modes
https://bugs.webkit.org/show_bug.cgi?id=202324
<rdar://problem/52669110>

Reviewed by Yusuke Suzuki.

This is an optimization that avoids polluting the array profile.

* dfg/DFGOSRExit.cpp:
(JSC::DFG::OSRExit::executeOSRExit):
(JSC::DFG::OSRExit::compileExit):

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

6 months ago[LFC][IFC] Line::close should merge the text runs.
zalan@apple.com [Fri, 27 Sep 2019 19:25:53 +0000 (19:25 +0000)]
[LFC][IFC] Line::close should merge the text runs.
https://bugs.webkit.org/show_bug.cgi?id=202319
<rdar://problem/55785949>

Reviewed by Antti Koivisto.

Now Line::close returns the final Display::Run list.

* layout/displaytree/DisplayRect.h:
(WebCore::Display::Rect::expandHorizontally):
(WebCore::Display::Rect::expandVertically):
(WebCore::Display::Rect::expand):
* layout/displaytree/DisplayRun.h:
(WebCore::Display::Run::expandVertically):
(WebCore::Display::Run::expandHorizontally):
* layout/inlineformatting/InlineFormattingContextLineLayout.cpp:
(WebCore::Layout::InlineFormattingContext::InlineLayout::createDisplayRuns):
* layout/inlineformatting/InlineLine.cpp:
(WebCore::Layout::Line::close):
* layout/inlineformatting/InlineLine.h:
(WebCore::Layout::Line::Run::displayRun):

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

6 months agoUnreviewed build-fix: wrap the AssertionServicesSPI.h in an IOS_FAMILY check.
jer.noble@apple.com [Fri, 27 Sep 2019 19:12:16 +0000 (19:12 +0000)]
Unreviewed build-fix: wrap the AssertionServicesSPI.h in an IOS_FAMILY check.

* WebProcess/cocoa/WebProcessCocoa.mm:

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

6 months agoAllow pages served over HTTPS with `Cache-Control: no-store` header to enter the...
cdumez@apple.com [Fri, 27 Sep 2019 19:09:04 +0000 (19:09 +0000)]
Allow pages served over HTTPS with `Cache-Control: no-store` header to enter the back/forward cache
https://bugs.webkit.org/show_bug.cgi?id=202314
<rdar://problem/55783482>

Reviewed by Alex Christensen.

Source/WebCore:

Allow pages served over HTTPS with `Cache-Control: no-store` header to enter the back/forward cache.
This was preventing all pages on Facebook.com to enter the back/forward cache.

No new tests, updated existing test.

* history/PageCache.cpp:
(WebCore::canCacheFrame):

LayoutTests:

Update existing test to reflect behavior change.

* http/tests/navigation/https-in-page-cache-expected.txt:
* http/tests/navigation/resources/https-in-page-cache-1.php:

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

6 months agoNon-standard Error properties should not be enumerable
commit-queue@webkit.org [Fri, 27 Sep 2019 18:32:47 +0000 (18:32 +0000)]
Non-standard Error properties should not be enumerable
https://bugs.webkit.org/show_bug.cgi?id=198975

Patch by Alexey Shvayka <shvaikalesh@gmail.com> on 2019-09-27
Reviewed by Ross Kirsling.

JSTests:

* ChakraCore/test/Error/NativeErrors_v4.baseline-jsc: Adjust expectations.
* microbenchmarks/let-for-in.js: Adjust test.
* test262/expectations.yaml: Mark 6 test cases as passing.

Source/JavaScriptCore:

Define non-standard Error properties "line", "column", and "sourceURL" as non-enumerable to match other engines.

* runtime/ErrorInstance.cpp:
(JSC::ErrorInstance::materializeErrorInfoIfNeeded):

LayoutTests:

* inspector/debugger/resources/exception.js: Introduce `stringifyError` helper.
* inspector/debugger/setPauseOnExceptions-all.html:
* inspector/debugger/setPauseOnExceptions-none.html:
* inspector/debugger/setPauseOnExceptions-uncaught.html:
* js/exception-properties-expected.txt:
* js/script-tests/exception-properties.js:

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

6 months agoFlaky Test: inspector/canvas/updateShader.html
drousso@apple.com [Fri, 27 Sep 2019 17:54:22 +0000 (17:54 +0000)]
Flaky Test: inspector/canvas/updateShader.html
https://bugs.webkit.org/show_bug.cgi?id=202186
<rdar://problem/55716053>

Reviewed by Joseph Pecoraro.

If the `WebGLProgram` outlives it's `WebGLRenderingContext`, the `ScriptExecutionContext*`
that was provided in the constructor won't be invalidated leading to the bad access crash.

Rather than pass the `ScriptExecutionContext*` directly, have `WebGLProgram` inherit from
`ContextDestructionObserver` so that it can propertly invalidate (and notify Web Inspector)
when the related context is about to be destroyed.

Test: inspector/canvas/updateShader.html

* html/canvas/WebGLProgram.h:
(WebCore::WebGLProgram::scriptExecutionContext const): Deleted.
* html/canvas/WebGLProgram.cpp:
(WebCore::WebGLProgram::WebGLProgram):
(WebCore::WebGLProgram::contextDestroyed): Added.

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

6 months ago[iOS]: When inserting a photo and then inserting auto-corrected text, the photo is...
commit-queue@webkit.org [Fri, 27 Sep 2019 17:33:25 +0000 (17:33 +0000)]
[iOS]: When inserting a photo and then inserting auto-corrected text, the photo is removed
https://bugs.webkit.org/show_bug.cgi?id=202294

Patch by Said Abou-Hallawa <sabouhallawa@apple.com> on 2019-09-27
Reviewed by Wenson Hsieh.

Source/WebKit:

WebPage::applyAutocorrectionInternal() calls wordRangeFromPosition() to
calculate the range of the word to be replaced with the auto-corrected
word. But if the text of the range does not match the original text,
applyAutocorrectionInternal() tries to correct the range by moving it
forward such that the length of the text range matches the length of the
original text.

Another case, which should correct the range also, is: the range does not
have a text but it is not collapsed. In this case, we should set the range
back to the selection range so non-text nodes is removed.

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

LayoutTests:

* fast/events/ios/autocorrect-after-image-expected.txt: Added.
* fast/events/ios/autocorrect-after-image.html: Added.

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

6 months agoStorage Access API: document.hasStorageAccess() should return false by default
wilander@apple.com [Fri, 27 Sep 2019 17:14:20 +0000 (17:14 +0000)]
Storage Access API: document.hasStorageAccess() should return false by default
https://bugs.webkit.org/show_bug.cgi?id=202281
<rdar://problem/55718526>

Reviewed by Alex Christensen.

document.hasStorageAccess() should return false by default so that it only
returns true if the context has asked for and been granted storage access.

Source/WebKit:

* NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp:
(WebKit::ResourceLoadStatisticsDatabaseStore::hasStorageAccess):
* NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp:
(WebKit::ResourceLoadStatisticsMemoryStore::hasStorageAccess):

LayoutTests:

* http/tests/storageAccess/has-storage-access-false-by-default-expected.txt: Added.
* http/tests/storageAccess/has-storage-access-false-by-default.html: Added.
* platform/ios/TestExpectations:
    The new test is marked as [ Pass ].
* platform/mac-wk2/TestExpectations:
    The new test is marked as [ Pass ].

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

6 months ago[JSC] DFG recursive-tail-call optimization should not emit jump to call-frame with...
ysuzuki@apple.com [Fri, 27 Sep 2019 16:56:58 +0000 (16:56 +0000)]
[JSC] DFG recursive-tail-call optimization should not emit jump to call-frame with varargs
https://bugs.webkit.org/show_bug.cgi?id=202299
<rdar://problem/52669116>

Reviewed by Saam Barati.

JSTests:

* stress/recursive-tail-call-optimization-should-not-jump-into-call-frame-with-varargs-simple.js: Added.
(foo):
(test):
* stress/recursive-tail-call-optimization-should-not-jump-into-call-frame-with-varargs.js: Added.
(foo):
(C1.prototype.baz):
(C1):
(bar):
(noInline.bar.goo):
(C2.prototype.baz):
(C2):
(test):

Source/JavaScriptCore:

When converting recursive-tail-call to jump to the upper call frame, we picked call-frame which is spread by LoadVarargs.
This is wrong since this call-frame does not know the exact number of arguments. We are using InlineCallFrame::argumentCountIncludingThis,
but this is maximal argumentCountIncludingThis when InlineCallFrame is Varargs call-frame. Let's see the simple example.

    'use strict';
    var count = 0;
    function foo() {
        count--;
        if (count === 0)
            return 30;
        return foo(42, 42); // HERE
    }

    function test() {
        count = 100;
        return foo(...[42, 42]); // THERE
    }
    noInline(test);

In the above case, currently, we convert HERE's foo call to the jump to the prologue of the foo function inlined by "test". But since foo is called
in a varargs form, "test" emits LoadVarargs, and it also emits `SetArgumentMaybe` for 1st and 2nd arguments. Since HERE's foo call is actually passing
two arguments, we emit a Phi node which Upsilon is from SetArgumentMaybe and 42 Constant. This is wrong since SetArgumentMaybe should not be used. Later,
SSA conversion phase emits Upsilon with SetArgumentMaybe, and since SetArgumentMaybe is simply removed in SSA conversion phase, it ends up emitting
Upsilon without a child.

We are currently only performing recursive-tail-call optimization when argument count matches. Given this condition, we should not pick varargs CallFrame
as a jump target.

* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::handleRecursiveTailCall):
* dfg/DFGSSAConversionPhase.cpp:
(JSC::DFG::SSAConversionPhase::run):

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

6 months ago[LFC][IFC] Replace Line::Run's logicalRect/textContext with Display::Run
zalan@apple.com [Fri, 27 Sep 2019 16:49:54 +0000 (16:49 +0000)]
[LFC][IFC] Replace Line::Run's logicalRect/textContext with Display::Run
https://bugs.webkit.org/show_bug.cgi?id=202313
<rdar://problem/55782430>

Reviewed by Antti Koivisto.

Display::Run is a container for logical rect and text context. Let's replace Line::Run's logical rect/text context with Display::Run.

* layout/Verification.cpp:
(WebCore::Layout::outputMismatchingSimpleLineInformationIfNeeded):
(WebCore::Layout::outputMismatchingComplexLineInformationIfNeeded):
* layout/displaytree/DisplayRun.h:
(WebCore::Display::Run::logicalRect const):
* layout/inlineformatting/InlineFormattingContextLineLayout.cpp:
(WebCore::Layout::InlineFormattingContext::InlineLayout::createDisplayRuns):
(WebCore::Layout::InlineFormattingContext::InlineLayout::alignRuns const):
* layout/inlineformatting/InlineFormattingContextQuirks.cpp:
(WebCore::Layout::InlineFormattingContext::Quirks::lineDescentNeedsCollapsing const):
* layout/inlineformatting/InlineFormattingState.h:
(WebCore::Layout::InlineFormattingState::addInlineRun):
* layout/inlineformatting/InlineLine.cpp:
(WebCore::Layout::Line::Run::Run):
(WebCore::Layout::Line::isVisuallyEmpty const):
(WebCore::Layout::Line::appendNonBreakableSpace):
(WebCore::Layout::Line::appendTextContent):
(WebCore::Layout::Line::appendNonReplacedInlineBox):
(WebCore::Layout::Line::appendHardLineBreak):
* layout/inlineformatting/InlineLine.h:
(WebCore::Layout::Line::Run::displayRun const):
(WebCore::Layout::Line::Run::logicalRect const):
(WebCore::Layout::Line::Run::adjustLogicalTop):
(WebCore::Layout::Line::Run::moveVertically):
(WebCore::Layout::Line::Run::moveHorizontally):
(WebCore::Layout::Line::Run::textContext const): Deleted.
* layout/layouttree/LayoutTreeBuilder.cpp:
(WebCore::Layout::outputInlineRuns):

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

6 months ago[iOS] Lock screen controls can fail to play web content
jer.noble@apple.com [Fri, 27 Sep 2019 16:27:45 +0000 (16:27 +0000)]
[iOS] Lock screen controls can fail to play web content
https://bugs.webkit.org/show_bug.cgi?id=202279

Reviewed by Chris Dumez.

When playback is paused from the lock screen via Now Playing controls, the WebProcess,
UIProcess, and Network Process will all be suspended. MediaRemote will take an assertion
and wake up the WebProcess when a remote control command to "play" is sent via the Now
Playing controls. However, if a synchronous message to the (suspended) Network or UIProcess
is issued before the notification that the process was unexpectedly unsuspended can be
issued (which will subsequently unsuspend the UIProcess and Network process), we can get
into a deadlocked state where the main thread is blocked on the sync message to a suspended
process.

To work around this problem, move all the processing from ProcessTaskStateObserver to a
WorkQueue / background thread. This requires making the ProcessTaskStateObserver thread-safe,
though its only current client is a Singleton (the WebProcess class), and so the risk of
thread safety issues is currently minimal. Regardless, access to the Client pointer must be
guarded by a Lock, and the Client itself must become ref-counted, so that the
ProcessTaskStateObserver can ref its Client (the WebProcess) during callback processing.

Unfortunately, sendWithAsyncReply() is not thread safe, nor is ProcessAssertion, so instead
just use send() and set a 5-second timeout before expiring the assertion, and just use
BKSProcessStateAssertion directly.

* Shared/Cocoa/ProcessTaskStateObserver.h:
(WebKit::ProcessTaskStateObserver::Client::ref):
(WebKit::ProcessTaskStateObserver::Client::deref):
(WebKit::ProcessTaskStateObserver::setClient): Deleted.
(WebKit::ProcessTaskStateObserver::client): Deleted.
* Shared/Cocoa/ProcessTaskStateObserver.mm:
(-[WKProcessTaskStateObserverDelegate process:taskStateDidChange:]):
(WebKit::ProcessTaskStateObserver::create):
(WebKit::ProcessTaskStateObserver::ProcessTaskStateObserver):
(WebKit::ProcessTaskStateObserver::~ProcessTaskStateObserver):
(WebKit::ProcessTaskStateObserver::invalidate):
(WebKit::ProcessTaskStateObserver::client):
(WebKit::ProcessTaskStateObserver::setTaskState):
* WebProcess/WebProcess.cpp:
(WebKit::m_taskStateObserver):
* WebProcess/WebProcess.h:
* UIProcess/Cocoa/WebProcessProxyCocoa.mm:
(WebKit::WebProcessProxy::processWasUnexpectedlyUnsuspended):
* UIProcess/WebProcessProxy.h:
* UIProcess/WebProcessProxy.messages.in:
* WebProcess/cocoa/WebProcessCocoa.mm:
(WebKit::WebProcess::processTaskStateDidChange):

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

6 months agoUnreviewed, rolling out r250415.
tsavell@apple.com [Fri, 27 Sep 2019 16:25:35 +0000 (16:25 +0000)]
Unreviewed, rolling out r250415.

Broke iOS debug testing with 50 crashes and 850 API failure

Reverted changeset:

"ScrollingTreeScrollingNode: use LayerRepresentation for
scroll container, scrolled contents layers"
https://bugs.webkit.org/show_bug.cgi?id=202256
https://trac.webkit.org/changeset/250415

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

6 months agoMove service worker process termination delay disabling from process pool to website...
achristensen@apple.com [Fri, 27 Sep 2019 16:07:18 +0000 (16:07 +0000)]
Move service worker process termination delay disabling from process pool to website data store
https://bugs.webkit.org/show_bug.cgi?id=202308

Reviewed by Chris Dumez.

Source/WebCore:

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

Source/WebKit:

It's only there for a test, which still works quickly.

* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::initializeNetworkProcess):
(WebKit::NetworkProcess::addWebsiteDataStore):
(WebKit::NetworkProcess::destroySession):
(WebKit::NetworkProcess::fetchWebsiteData):
(WebKit::NetworkProcess::deleteWebsiteDataForRegistrableDomains):
(WebKit::NetworkProcess::registrableDomainsWithWebsiteData):
(WebKit::NetworkProcess::swServerForSession):
(WebKit::NetworkProcess::addServiceWorkerSession):
(WebKit::NetworkProcess::disableServiceWorkerProcessTerminationDelay): Deleted.
* NetworkProcess/NetworkProcess.h:
* NetworkProcess/NetworkProcess.messages.in:
* Shared/WebsiteDataStoreParameters.cpp:
(WebKit::WebsiteDataStoreParameters::encode const):
(WebKit::WebsiteDataStoreParameters::decode):
* Shared/WebsiteDataStoreParameters.h:
* UIProcess/API/Cocoa/WKProcessPool.mm:
(-[WKProcessPool _disableServiceWorkerProcessTerminationDelay]): Deleted.
* UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
* UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.h:
* UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.mm:
(-[_WKWebsiteDataStoreConfiguration serviceWorkerProcessTerminationDelayEnabled]):
(-[_WKWebsiteDataStoreConfiguration setServiceWorkerProcessTerminationDelayEnabled:]):
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::ensureNetworkProcess):
(WebKit::WebProcessPool::disableServiceWorkerProcessTerminationDelay): Deleted.
* UIProcess/WebProcessPool.h:
* UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
(WebKit::WebsiteDataStore::parameters):
* UIProcess/WebsiteData/WebsiteDataStoreConfiguration.cpp:
(WebKit::WebsiteDataStoreConfiguration::copy):
* UIProcess/WebsiteData/WebsiteDataStoreConfiguration.h:
(WebKit::WebsiteDataStoreConfiguration::serviceWorkerProcessTerminationDelayEnabled const):
(WebKit::WebsiteDataStoreConfiguration::setServiceWorkerProcessTerminationDelayEnabled):

Tools:

* TestWebKitAPI/Tests/WebKitCocoa/ServiceWorkerBasic.mm:

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

6 months agoIDBRequest should not prevent a page from entering the back/forward cache
cdumez@apple.com [Fri, 27 Sep 2019 15:56:04 +0000 (15:56 +0000)]
IDBRequest should not prevent a page from entering the back/forward cache
https://bugs.webkit.org/show_bug.cgi?id=202270
<rdar://problem/55744717>

Reviewed by Youenn Fablet.

Source/WebCore:

Update IDBRequest::canSuspendForDocumentSuspension() to return true instead of
false. IDBRequest can only fire 2 events (error / success) and for both its
merely enqueues the Event to the DocumentEventQueue. The DocumentEventQueue
uses a SuspendableTimer (which will be suspended while the document is in the
page cache) so there is no risk of firing the events (and thus running script)
while in the page cache.

Test: storage/indexeddb/IDBRequest-page-cache.html

* Modules/indexeddb/IDBRequest.cpp:
(WebCore::IDBRequest::canSuspendForDocumentSuspension const):

LayoutTests:

Add layout test coverage.

* storage/indexeddb/IDBRequest-page-cache-expected.txt: Added.
* storage/indexeddb/IDBRequest-page-cache.html: Added.

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

6 months agoEnable and disable ResourceLoadStatistics only by session
achristensen@apple.com [Fri, 27 Sep 2019 15:55:01 +0000 (15:55 +0000)]
Enable and disable ResourceLoadStatistics only by session
https://bugs.webkit.org/show_bug.cgi?id=202298

Reviewed by Chris Dumez.

This is needed to keep per-session things per-session and per-process-pool things per-process-pool.
This was a strange case where we would take the current session's value and apply it globally.
This has no change in behavior because it is globally enabled and disabled by API clients anyways.

* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::setResourceLoadStatisticsEnabled):
* NetworkProcess/NetworkProcess.h:
* NetworkProcess/NetworkProcess.messages.in:
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _initializeWithConfiguration:]):
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::setResourceLoadStatisticsEnabled): Deleted.
* UIProcess/WebProcessPool.h:
* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::WebsiteDataStore::setResourceLoadStatisticsEnabled):

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

6 months ago[LFC][IFC] Remove redundant Line::TextContext member variables
zalan@apple.com [Fri, 27 Sep 2019 15:31:00 +0000 (15:31 +0000)]
[LFC][IFC] Remove redundant Line::TextContext member variables
https://bugs.webkit.org/show_bug.cgi?id=202300
<rdar://problem/55769916>

Reviewed by Antti Koivisto.

This is in preparation for using Display::Run in Line::Run instead of Display::Rect + TextContext.

* layout/inlineformatting/InlineFormattingContextLineLayout.cpp:
(WebCore::Layout::InlineFormattingContext::InlineLayout::createDisplayRuns):
* layout/inlineformatting/InlineFormattingContextQuirks.cpp:
(WebCore::Layout::InlineFormattingContext::Quirks::lineDescentNeedsCollapsing const):
* layout/inlineformatting/InlineLine.cpp:
(WebCore::Layout::Line::Run::isWhitespace const):
(WebCore::Layout::Line::Run::canBeExtended const):
(WebCore::Layout::Line::isVisuallyEmpty const):
(WebCore::Layout::Line::removeTrailingTrimmableContent):
(WebCore::Layout::Line::trailingTrimmableWidth const):
(WebCore::Layout::Line::appendTextContent):
* layout/inlineformatting/InlineLine.h:
(WebCore::Layout::Line::Run::isVisuallyEmpty const):
(WebCore::Layout::Line::Run::setVisuallyIsEmpty):
(WebCore::Layout::Line::Run::setTextIsCollapsed): Deleted.

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

6 months agoRemove unused WebProcessPool::setCanHandleHTTPSServerTrustEvaluation
achristensen@apple.com [Fri, 27 Sep 2019 14:34:13 +0000 (14:34 +0000)]
Remove unused WebProcessPool::setCanHandleHTTPSServerTrustEvaluation
https://bugs.webkit.org/show_bug.cgi?id=202285

Reviewed by Youenn Fablet.

Source/WebKit:

The SPI to set this was deprecated in r250377 with a replacement that was adopted in rdar://problem/55731135
I removed a layout test using the old SPI and replaced it with a more precise API test verifying the behavior of the new SPI
before and after the introduction of NSURLSession's _strictTrustEvaluate:queue:completionHandler:

* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::initializeNetworkProcess):
(WebKit::NetworkProcess::setCanHandleHTTPSServerTrustEvaluation): Deleted.
* NetworkProcess/NetworkProcess.h:
(WebKit::NetworkProcess::canHandleHTTPSServerTrustEvaluation const): Deleted.
* NetworkProcess/NetworkProcess.messages.in:
* NetworkProcess/NetworkProcessCreationParameters.cpp:
(WebKit::NetworkProcessCreationParameters::encode const):
(WebKit::NetworkProcessCreationParameters::decode):
* NetworkProcess/NetworkProcessCreationParameters.h:
* NetworkProcess/cocoa/NetworkSessionCocoa.mm:
(-[WKNetworkSessionDelegate URLSession:task:didReceiveChallenge:completionHandler:]):
(canNSURLSessionTrustEvaluate): Deleted.
* UIProcess/API/C/WKContext.cpp:
(WKContextSetCanHandleHTTPSServerTrustEvaluation):
* UIProcess/API/Cocoa/WKProcessPool.mm:
(-[WKProcessPool _setCanHandleHTTPSServerTrustEvaluation:]):
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::ensureNetworkProcess):
(WebKit::WebProcessPool::setCanHandleHTTPSServerTrustEvaluation): Deleted.
* UIProcess/WebProcessPool.h:

Tools:

* TestWebKitAPI/Tests/WebKitCocoa/Challenge.mm:
(-[ServerTrustDelegate webView:didFinishNavigation:]):
(-[ServerTrustDelegate webView:didFailProvisionalNavigation:withError:]):
(-[ServerTrustDelegate waitForDidFinishNavigation]):
(-[ServerTrustDelegate waitForDidFailProvisionalNavigationError]):
(-[ServerTrustDelegate authenticationChallengeCount]):
(-[ServerTrustDelegate webView:didReceiveAuthenticationChallenge:completionHandler:]):
(TestWebKitAPI::TEST):
* WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl:
* WebKitTestRunner/InjectedBundle/TestRunner.cpp:
(WTR::TestRunner::setCanHandleHTTPSServerTrustEvaluation): Deleted.
(WTR::TestRunner::canDoServerTrustEvaluationInNetworkProcess): Deleted.
(WTR::TestRunner::serverTrustEvaluationCallbackCallsCount): Deleted.
* WebKitTestRunner/InjectedBundle/TestRunner.h:
* WebKitTestRunner/TestController.cpp:
(WTR::TestController::resetStateToConsistentValues):
(WTR::TestController::didReceiveAuthenticationChallenge):
(WTR::TestController::canDoServerTrustEvaluationInNetworkProcess const): Deleted.
* WebKitTestRunner/TestController.h:
(WTR::TestController::serverTrustEvaluationCallbackCallsCount const): Deleted.
* WebKitTestRunner/TestInvocation.cpp:
(WTR::TestInvocation::didReceiveSynchronousMessageFromInjectedBundle):
* WebKitTestRunner/cocoa/TestControllerCocoa.mm:
(WTR::TestController::canDoServerTrustEvaluationInNetworkProcess const): Deleted.

LayoutTests:

* http/tests/ssl/certificate-validation-expected.txt: Removed.
* http/tests/ssl/certificate-validation.html: Removed.

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

6 months agoRemove unused APIProcessPoolConfiguration::diskCacheSpeculativeValidationEnabled
achristensen@apple.com [Fri, 27 Sep 2019 14:05:46 +0000 (14:05 +0000)]
Remove unused APIProcessPoolConfiguration::diskCacheSpeculativeValidationEnabled
https://bugs.webkit.org/show_bug.cgi?id=202290

Reviewed by Carlos Garcia Campos.

Source/WebKit:

The SPI to set this was deprecated in r250377 with a replacement that was adopted in rdar://problem/55731135

* NetworkProcess/NetworkProcessCreationParameters.cpp:
(WebKit::NetworkProcessCreationParameters::encode const):
(WebKit::NetworkProcessCreationParameters::decode):
* NetworkProcess/NetworkProcessCreationParameters.h:
* NetworkProcess/cocoa/NetworkProcessCocoa.mm:
(WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
* UIProcess/API/APIProcessPoolConfiguration.cpp:
(API::ProcessPoolConfiguration::copy):
* UIProcess/API/APIProcessPoolConfiguration.h:
* UIProcess/API/C/WKContext.cpp:
(WKContextSetDiskCacheSpeculativeValidationEnabled):
* UIProcess/API/C/WKWebsiteDataStoreConfigurationRef.cpp:
(WKWebsiteDataStoreConfigurationGetNetworkCacheSpeculativeValidationEnabled):
(WKWebsiteDataStoreConfigurationSetNetworkCacheSpeculativeValidationEnabled):
* UIProcess/API/C/WKWebsiteDataStoreConfigurationRef.h:
* UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
(-[_WKProcessPoolConfiguration diskCacheSpeculativeValidationEnabled]):
(-[_WKProcessPoolConfiguration setDiskCacheSpeculativeValidationEnabled:]):
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::ensureNetworkProcess):

Tools:

* TestWebKitAPI/Tests/WebKitCocoa/WKProcessPoolConfiguration.mm:
(TEST):
* WebKitTestRunner/TestController.cpp:
(WTR::TestController::websiteDataStore):
(WTR::TestController::generatePageConfiguration):

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

6 months ago[Nicosia] Implement frame scrolling functionality
zandobersek@gmail.com [Fri, 27 Sep 2019 10:48:30 +0000 (10:48 +0000)]
[Nicosia] Implement frame scrolling functionality
https://bugs.webkit.org/show_bug.cgi?id=202201

Reviewed by Carlos Garcia Campos.

Implement logic in the ScrollingTreeFrameScrollingNodeNicosia class,
largely following the Mac port's implementation but skipping areas we
don't support or can keep simple, like CSS scroll snap, frame pinning
and more complex wheel event handling through the platform-specific
delegate behavior.

* page/scrolling/nicosia/ScrollingTreeFrameScrollingNodeNicosia.cpp:
(WebCore::ScrollingTreeFrameScrollingNodeNicosia::commitStateBeforeChildren):
(WebCore::ScrollingTreeFrameScrollingNodeNicosia::commitStateAfterChildren):
(WebCore::ScrollingTreeFrameScrollingNodeNicosia::handleWheelEvent):
(WebCore::ScrollingTreeFrameScrollingNodeNicosia::adjustedScrollPosition const):
(WebCore::ScrollingTreeFrameScrollingNodeNicosia::currentScrollPositionChanged):
(WebCore::ScrollingTreeFrameScrollingNodeNicosia::repositionScrollingLayers):
(WebCore::ScrollingTreeFrameScrollingNodeNicosia::repositionRelatedLayers):
* page/scrolling/nicosia/ScrollingTreeFrameScrollingNodeNicosia.h:

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

6 months ago[Nicosia] ScrollingCoordinatorNicosia should handle wheel events coming from the...
zandobersek@gmail.com [Fri, 27 Sep 2019 10:36:57 +0000 (10:36 +0000)]
[Nicosia] ScrollingCoordinatorNicosia should handle wheel events coming from the main thread
https://bugs.webkit.org/show_bug.cgi?id=202275

Reviewed by Carlos Garcia Campos.

* page/scrolling/nicosia/ScrollingCoordinatorNicosia.cpp:
(WebCore::ScrollingCoordinatorNicosia::handleWheelEvent):
Handle wheel events that get rerouted through the main thread,
dispatching them back to the scrolling thread so that they end up
performing the desired scroll if possible.

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

6 months ago[CoordinatedGraphics] support bounds origin
zandobersek@gmail.com [Fri, 27 Sep 2019 10:34:31 +0000 (10:34 +0000)]
[CoordinatedGraphics] support bounds origin
https://bugs.webkit.org/show_bug.cgi?id=198998

Reviewed by Carlos Garcia Campos.

Source/WebCore:

Add bounds-origin support to the CoordinatedGraphics stack. Currently we
take the short-cut implementation of just combining the bounds origin
and the position value and incorporating them into the layer transform
we calculate in TextureMapperLayer.

Additional boilerplate code is added, as required, to relay the
WebCore::GraphicsLayer change of bounds origin to the rendering system.

* platform/graphics/nicosia/NicosiaPlatformLayer.h:
(Nicosia::CompositionLayer::flushState):
* platform/graphics/texmap/TextureMapperLayer.cpp:
(WebCore::TextureMapperLayer::computeTransformsRecursive):
(WebCore::TextureMapperLayer::setBoundsOrigin):
* platform/graphics/texmap/TextureMapperLayer.h:
* platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
(WebCore::CoordinatedGraphicsLayer::setBoundsOrigin):
(WebCore::CoordinatedGraphicsLayer::computePositionRelativeToBase):
* platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:

Source/WebKit:

* Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
(WebKit::CoordinatedGraphicsScene::updateSceneState):
Apply bounds origin value to the TextureMapperLayer object.

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

6 months agoMake IsNSURLSessionWebSocketEnabled an experimental flag
youenn@apple.com [Fri, 27 Sep 2019 09:04:35 +0000 (09:04 +0000)]
Make IsNSURLSessionWebSocketEnabled an experimental flag
https://bugs.webkit.org/show_bug.cgi?id=202135
<rdar://problem/55694721>

Reviewed by Geoff Garen.

Source/WebKit:

Add C API to switch off this feature in WTR.

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

Tools:

* WebKitTestRunner/TestController.cpp:
(WTR::TestController::resetPreferencesToConsistentValues):
Set preference to false by default.

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

6 months agoSubFrameSOAuthorizationSession should ensure messages are posted in the right order...
jiewen_tan@apple.com [Fri, 27 Sep 2019 07:13:56 +0000 (07:13 +0000)]
SubFrameSOAuthorizationSession should ensure messages are posted in the right order to the parent frame
https://bugs.webkit.org/show_bug.cgi?id=202061
<rdar://problem/55485666>

Reviewed by Youenn Fablet.

Source/WebKit:

This patch ensures messages that signal the process of SOAuthorization interception are posted in
the right order to the parent frame. Before this patch, there are chances that SOAuthorizationDidCancel
could be posted to the parent before SOAuthorizationDidStart. There are few causes that lead to
this race condition:
1) SubFrameSOAuthorizationSession::beforeStart posts SOAuthorizationDidStart in the next runloop. So
extension could have the chance to invoke SubFrameSOAuthorizationSession::fallBackToWebPathInternal
before SOAuthorizationDidStart is posted.
2) Even if the order is right in the UI process, it is not guaranteed that Web process will strictly
follow the order as the loading process is async.

To fix the issue:
1) SubFrameSOAuthorizationSession::beforeStart now posts SOAuthorizationDidStart in the same runloop.
2) Observer is introduced in FrameLoadState such that SubFrameSOAuthorizationSession could know if
the loading is finished. With this new capacity, SubFrameSOAuthorizationSession can ensure it only
posts next message when the previous message has been posted.

Implementation wise, a deque to queue requests is provided to maintain order.
1) When new request is added to the deque, SubFrameSOAuthorizationSession will only load the request
if it is the only element in the deque. Otherwise, it does nothing.
2) When SubFrameSOAuthorizationSession receives didFinishLoad, it pops the head of the queue and loads
the next request in the queue if any.
The above design should guarantee all requests are loaded in sequence.

* UIProcess/Cocoa/SOAuthorization/SubFrameSOAuthorizationSession.h:
* UIProcess/Cocoa/SOAuthorization/SubFrameSOAuthorizationSession.mm:
(WebKit::SubFrameSOAuthorizationSession::SubFrameSOAuthorizationSession):
(WebKit::SubFrameSOAuthorizationSession::~SubFrameSOAuthorizationSession):
(WebKit::SubFrameSOAuthorizationSession::fallBackToWebPathInternal):
(WebKit::SubFrameSOAuthorizationSession::completeInternal):
(WebKit::SubFrameSOAuthorizationSession::beforeStart):
(WebKit::SubFrameSOAuthorizationSession::didFinishLoad):
(WebKit::SubFrameSOAuthorizationSession::appendRequestToLoad):
(WebKit::SubFrameSOAuthorizationSession::loadRequestToFrame):
(WebKit::SubFrameSOAuthorizationSession::loadDataToFrame): Deleted.
(WebKit::SubFrameSOAuthorizationSession::postDidCancelMessageToParent): Deleted.
* UIProcess/FrameLoadState.cpp:
(WebKit::FrameLoadState::addObserver):
(WebKit::FrameLoadState::removeObserver):
(WebKit::FrameLoadState::didFinishLoad):
* UIProcess/FrameLoadState.h:

Tools:

Adds tests that check the order of messages posted by SubFrameSOAuthorizationSession.

* TestWebKitAPI/Tests/WebKitCocoa/TestSOAuthorization.mm:
(-[TestSOAuthorizationScriptMessageHandler userContentController:didReceiveScriptMessage:]):
(resetState):
(TestWebKitAPI::TEST):

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

6 months agoScrollingTreeScrollingNode: use LayerRepresentation for scroll container, scrolled...
zandobersek@gmail.com [Fri, 27 Sep 2019 06:19:52 +0000 (06:19 +0000)]
ScrollingTreeScrollingNode: use LayerRepresentation for scroll container, scrolled contents layers
https://bugs.webkit.org/show_bug.cgi?id=202256

Reviewed by Simon Fraser.

Make the scroll container and scrolled contents layer holders
platform-independent by using the LayerRepresentation as the underlying
type for the two member variables in ScrollingTreeScrollingNode.

* page/scrolling/ScrollingTreeScrollingNode.cpp:
(WebCore::ScrollingTreeScrollingNode::commitStateBeforeChildren):
* page/scrolling/ScrollingTreeScrollingNode.h:
* page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
(WebCore::ScrollingTreeFrameScrollingNodeMac::repositionScrollingLayers):
* page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.mm:
(WebCore::ScrollingTreeOverflowScrollingNodeMac::repositionScrollingLayers):

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

6 months agoPages frequently fails to enter the back/forward cache due to pending loads
cdumez@apple.com [Fri, 27 Sep 2019 06:17:17 +0000 (06:17 +0000)]
Pages frequently fails to enter the back/forward cache due to pending loads
https://bugs.webkit.org/show_bug.cgi?id=202289
<rdar://problem/55758506>

Reviewed by Geoffrey Garen.

Source/WebCore:

Allow pages to enter the back / forward cache, even if they have pending loads.
Note that these pending loads get cancelled. Also note that we won't enter page
cache unless the 'load' event has been fired in the main frame, since a
HistoryItem would not get created otherwise. This was causing frequent transient
failures to enter the back / forward cache while browsing (e.g. on weather.com).

Test: http/tests/navigation/page-cache-pending-load.html

* history/PageCache.cpp:
(WebCore::canCacheFrame):
* loader/CrossOriginPreflightChecker.cpp:
* loader/CrossOriginPreflightChecker.h:
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::setMainDocumentError):
(WebCore::DocumentLoader::stopLoading):
* loader/DocumentLoader.h:
* loader/DocumentThreadableLoader.cpp:
* loader/DocumentThreadableLoader.h:
* loader/cache/CachedResource.cpp:
* loader/cache/CachedResource.h:
* loader/cache/CachedResourceClient.h:
(WebCore::CachedResourceClient::deprecatedDidReceiveCachedResource):
* page/DiagnosticLoggingKeys.cpp:
(WebCore::DiagnosticLoggingKeys::mainFrameHasNotFinishedLoadingKey):
* page/DiagnosticLoggingKeys.h:

LayoutTests:

Add layout test coverage.

* http/tests/navigation/page-cache-pending-load-expected.txt: Added.
* http/tests/navigation/page-cache-pending-load.html: Added.

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

6 months agoResource Load Statistics: Downgrade all third-party referrer headers
commit-queue@webkit.org [Fri, 27 Sep 2019 05:13:10 +0000 (05:13 +0000)]
Resource Load Statistics: Downgrade all third-party referrer headers
https://bugs.webkit.org/show_bug.cgi?id=201353
<rdar://problem/54895650>
Source/WebKit:

Majority of this patch was written by John Wilander <wilander@apple.com>.

Patch by Kate Cheney <katherine_cheney@apple.com> on 2019-09-26
Reviewed by Brent Fulgham.

When tracking protections are enabled, we should downgrade all third-party
referrers to their origins. Note that this downgrade will be specific to
Cocoa so other ports will have to adopt as they see fit.

Cocoa already does this downgrade in ephemeral sessions (shipping).

The majority of these changes are test infrastructure. The functional
change is in WebKit::NetworkDataTaskCocoa and WebKit::NetworkSession.

* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::setShouldDowngradeReferrerForTesting):
* NetworkProcess/NetworkProcess.h:
* NetworkProcess/NetworkProcess.messages.in:
* NetworkProcess/NetworkSession.cpp:
(WebKit::NetworkSession::isResourceLoadStatisticsEnabled const):
(WebKit::NetworkSession::setShouldDowngradeReferrerForTesting):
(WebKit::NetworkSession::shouldDowngradeReferrer const):
* NetworkProcess/NetworkSession.h:
* NetworkProcess/cocoa/NetworkDataTaskCocoa.h:
* NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
(WebKit::NetworkDataTaskCocoa::isThirdPartyRequest const):
(WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa):
(WebKit::NetworkDataTaskCocoa::restrictRequestReferrerToOriginIfNeeded):
(WebKit::NetworkDataTaskCocoa::willPerformHTTPRedirection):
(WebKit::NetworkDataTaskCocoa::isThirdPartyRequest): Deleted.
* UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
(WKWebsiteDataStoreSetResourceLoadStatisticsShouldDowngradeReferrerForTesting):
(WKWebsiteDataStoreStatisticsResetToConsistentState):
* UIProcess/API/C/WKWebsiteDataStoreRef.h:
* UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::setShouldDowngradeReferrerForTesting):
* UIProcess/Network/NetworkProcessProxy.h:
* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::WebsiteDataStore::setResourceLoadStatisticsShouldDowngradeReferrerForTesting):
* UIProcess/WebsiteData/WebsiteDataStore.h:

Tools:

Majority of this patch was written by John Wilander <wilander@apple.com>.

Patch by Kate Cheney <katherine_cheney@apple.com> on 2019-09-26
Reviewed by Brent Fulgham.

The changes to the TestRunner facilitates an opt-out for test cases
that either test the referrer mechanism explicitly or tests that
rely on the full referrer to be sent.

The new boolean variable and early return in
TestRunner::setStatisticsShouldDowngradeReferrer() prevent the same
event from trying to set multiple TestRunner callbacks.

* WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl:
* WebKitTestRunner/InjectedBundle/InjectedBundle.cpp:
(WTR::InjectedBundle::didReceiveMessageToPage):
* WebKitTestRunner/InjectedBundle/TestRunner.cpp:
(WTR::TestRunner::setStatisticsShouldDowngradeReferrer):
(WTR::TestRunner::statisticsCallDidSetShouldDowngradeReferrerCallback):
* WebKitTestRunner/InjectedBundle/TestRunner.h:
* WebKitTestRunner/TestController.cpp:
(WTR::TestController::setStatisticsShouldDowngradeReferrer):
* WebKitTestRunner/TestController.h:
* WebKitTestRunner/TestInvocation.cpp:
(WTR::TestInvocation::didReceiveSynchronousMessageFromInjectedBundle):
(WTR::TestInvocation::didSetShouldDowngradeReferrer):
* WebKitTestRunner/TestInvocation.h:

LayoutTests:

Majority of this patch was written by John Wilander <wilander@apple.com>

Patch by Kate Cheney <katherine_cheney@apple.com> on 2019-09-26
Reviewed by Brent Fulgham.

The changes in the two http/tests/resourceLoadStatistics/strip-referrer-to-origin*
tests and the http/tests/navigation/ping-attribute/* tests are for the functional
change. The other changes are to make use of the new
testRunner.setStatisticsShouldDowngradeReferrer() to maintain earlier functionality.

TestRunner::setStatisticsShouldDowngradeReferrer() function is not
supported for mac-wk1, win or wincairo.

* http/tests/blink/sendbeacon/beacon-cross-origin-expected.txt:
* http/tests/navigation/ping-attribute/anchor-cross-origin.html:
* http/tests/navigation/ping-attribute/area-cross-origin.html:
* http/tests/referrer-policy-script/no-referrer-when-downgrade/cross-origin-http-http.html:
* http/tests/referrer-policy-script/no-referrer-when-downgrade/cross-origin-http.https.html:
* http/tests/referrer-policy-script/no-referrer-when-downgrade/same-origin.html:
* http/tests/referrer-policy-script/no-referrer/cross-origin-http-http.html:
* http/tests/referrer-policy-script/no-referrer/cross-origin-http.https.html:
* http/tests/referrer-policy-script/no-referrer/same-origin.html:
* http/tests/referrer-policy-script/origin-when-cross-origin/cross-origin-http-http.html:
* http/tests/referrer-policy-script/origin-when-cross-origin/cross-origin-http.https.html:
* http/tests/referrer-policy-script/origin-when-cross-origin/same-origin.html:
* http/tests/referrer-policy-script/origin/cross-origin-http-http.html:
* http/tests/referrer-policy-script/origin/cross-origin-http.https.html:
* http/tests/referrer-policy-script/origin/same-origin.html:
* http/tests/referrer-policy-script/same-origin/cross-origin-http-http.html:
* http/tests/referrer-policy-script/same-origin/cross-origin-http.https.html:
* http/tests/referrer-policy-script/same-origin/same-origin.html:
* http/tests/referrer-policy-script/strict-origin-when-cross-origin/cross-origin-http-http.html:
* http/tests/referrer-policy-script/strict-origin-when-cross-origin/cross-origin-http.https.html:
* http/tests/referrer-policy-script/strict-origin-when-cross-origin/same-origin.html:
* http/tests/referrer-policy-script/strict-origin/cross-origin-http-http.html:
* http/tests/referrer-policy-script/strict-origin/cross-origin-http.https.html:
* http/tests/referrer-policy-script/strict-origin/same-origin.html:
* http/tests/referrer-policy-script/unsafe-url/cross-origin-http-http.html:
* http/tests/referrer-policy-script/unsafe-url/cross-origin-http.https.html:
* http/tests/referrer-policy-script/unsafe-url/same-origin.html:
* http/tests/referrer-policy/no-referrer-when-downgrade/cross-origin-http-http.html:
* http/tests/referrer-policy/no-referrer-when-downgrade/cross-origin-http.https.html:
* http/tests/referrer-policy/no-referrer-when-downgrade/same-origin.html:
* http/tests/referrer-policy/unsafe-url/cross-origin-http-http.html:
* http/tests/referrer-policy/unsafe-url/cross-origin-http.https.html:
* http/tests/resourceLoadStatistics/strip-referrer-to-origin-for-prevalent-subresource-requests.html: Removed.
* http/tests/resourceLoadStatistics/strip-referrer-to-origin-for-third-party-redirects-expected.txt: Renamed from LayoutTests/http/tests/resourceLoadStatistics/strip-referrer-to-origin-for-prevalent-subresource-redirects-expected.txt.
* http/tests/resourceLoadStatistics/strip-referrer-to-origin-for-third-party-redirects.html: Copied from LayoutTests/http/tests/resourceLoadStatistics/strip-referrer-to-origin-for-prevalent-subresource-redirects.html.
* http/tests/resourceLoadStatistics/strip-referrer-to-origin-for-third-party-requests-expected.txt: Renamed from LayoutTests/http/tests/resourceLoadStatistics/strip-referrer-to-origin-for-prevalent-subresource-requests-expected.txt.
* http/tests/resourceLoadStatistics/strip-referrer-to-origin-for-third-party-requests.html: Renamed from LayoutTests/http/tests/resourceLoadStatistics/strip-referrer-to-origin-for-prevalent-subresource-redirects.html.
* http/tests/security/contentSecurityPolicy/report-cross-origin-no-cookies-when-private-browsing-enabled.php:
* http/tests/security/contentSecurityPolicy/report-cross-origin-no-cookies.php:
* http/tests/security/referrer-policy-header.html:
* platform/ios-wk2/TestExpectations:
* platform/ios/TestExpectations:
* platform/mac-wk1/TestExpectations:
* platform/mac-wk2/TestExpectations:
* platform/win/TestExpectations:
* platform/wincairo/TestExpectations:
* platform/wk2/TestExpectations:
* resources/testharnessreport.js:
* resources/js-test.js:

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

6 months ago[LFC][IFC] Line::Run should have a reference to the associated InlineItem
zalan@apple.com [Fri, 27 Sep 2019 03:43:54 +0000 (03:43 +0000)]
[LFC][IFC] Line::Run should have a reference to the associated InlineItem
https://bugs.webkit.org/show_bug.cgi?id=202288
<rdar://problem/55758112>

Reviewed by Antti Koivisto.

It makes it clearer where the type and the layout box come from.

* layout/inlineformatting/InlineFormattingContextQuirks.cpp:
(WebCore::Layout::InlineFormattingContext::Quirks::lineDescentNeedsCollapsing const):
* layout/inlineformatting/InlineLine.cpp:
(WebCore::Layout::Line::Run::Run):
* layout/inlineformatting/InlineLine.h:
(WebCore::Layout::Line::Run::layoutBox const):
(WebCore::Layout::Line::Run::textContext const):
(WebCore::Layout::Line::Run::isText const):
(WebCore::Layout::Line::Run::isBox const):
(WebCore::Layout::Line::Run::isLineBreak const):
(WebCore::Layout::Line::Run::isContainerStart const):
(WebCore::Layout::Line::Run::isContainerEnd const):
(WebCore::Layout::Line::Run::type const): Deleted.

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

6 months ago[LFC][IFC] Remove redundant Line::Content
zalan@apple.com [Fri, 27 Sep 2019 03:23:32 +0000 (03:23 +0000)]
[LFC][IFC] Remove redundant Line::Content
https://bugs.webkit.org/show_bug.cgi?id=202284
<rdar://problem/55757187>

Reviewed by Antti Koivisto.

Line::Content is really just a list or runs at this point.

* layout/inlineformatting/InlineFormattingContext.h:
* layout/inlineformatting/InlineFormattingContextLineLayout.cpp:
(WebCore::Layout::InlineFormattingContext::InlineLayout::createDisplayRuns):
* layout/inlineformatting/InlineFormattingContextQuirks.cpp:
(WebCore::Layout::InlineFormattingContext::Quirks::lineDescentNeedsCollapsing const):
* layout/inlineformatting/InlineLine.cpp:
(WebCore::Layout::Line::Run::Run):
(WebCore::Layout::Line::Line):
(WebCore::Layout::Line::isVisuallyEmpty const):
(WebCore::Layout::Line::close):
(WebCore::Layout::Line::appendNonBreakableSpace):
(WebCore::Layout::Line::appendTextContent):
(WebCore::Layout::Line::appendNonReplacedInlineBox):
(WebCore::Layout::Line::appendHardLineBreak):
(WebCore::Layout::Line::Content::Run::Run): Deleted.
* layout/inlineformatting/InlineLine.h:
(WebCore::Layout::Line::Run::layoutBox const):
(WebCore::Layout::Line::Run::logicalRect const):
(WebCore::Layout::Line::Run::textContext const):
(WebCore::Layout::Line::Run::type const):
(WebCore::Layout::Line::Run::isText const):
(WebCore::Layout::Line::Run::isBox const):
(WebCore::Layout::Line::Run::isLineBreak const):
(WebCore::Layout::Line::Run::isContainerStart const):
(WebCore::Layout::Line::Run::isContainerEnd const):
(WebCore::Layout::Line::Run::adjustLogicalTop):
(WebCore::Layout::Line::Run::moveVertically):
(WebCore::Layout::Line::Run::moveHorizontally):
(WebCore::Layout::Line::Run::setTextIsCollapsed):
(WebCore::Layout::Line::Content::Run::layoutBox const): Deleted.
(WebCore::Layout::Line::Content::Run::logicalRect const): Deleted.
(WebCore::Layout::Line::Content::Run::textContext const): Deleted.
(WebCore::Layout::Line::Content::Run::type const): Deleted.
(WebCore::Layout::Line::Content::Run::isText const): Deleted.
(WebCore::Layout::Line::Content::Run::isBox const): Deleted.
(WebCore::Layout::Line::Content::Run::isLineBreak const): Deleted.
(WebCore::Layout::Line::Content::Run::isContainerStart const): Deleted.
(WebCore::Layout::Line::Content::Run::isContainerEnd const): Deleted.
(WebCore::Layout::Line::Content::Run::adjustLogicalTop): Deleted.
(WebCore::Layout::Line::Content::Run::moveVertically): Deleted.
(WebCore::Layout::Line::Content::Run::moveHorizontally): Deleted.
(WebCore::Layout::Line::Content::Run::setTextIsCollapsed): Deleted.
(WebCore::Layout::Line::Content::runs const): Deleted.
(WebCore::Layout::Line::Content::runs): Deleted.

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

6 months agoREGRESSION (iOS 13): Trying to record just audio using HTML Media Capture crashes...
eric.carlson@apple.com [Fri, 27 Sep 2019 03:00:10 +0000 (03:00 +0000)]
REGRESSION (iOS 13): Trying to record just audio using HTML Media Capture crashes Safari
https://bugs.webkit.org/show_bug.cgi?id=202039
<rdar://problem/55566628>

Reviewed by Jer Noble.

Source/WebKit:

* UIProcess/ios/forms/WKFileUploadPanel.mm:
(-[WKFileUploadPanel _mediaTypesForPickerSourceType:]): UIImagePickerController doesn't
support audio-only recording, so show the video recorder for "audio/*".

LayoutTests:

* fast/forms/ios/file-upload-panel-capture-expected.txt: Added.
* fast/forms/ios/file-upload-panel-capture.html: Added.

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

6 months agoWeb Inspector: Include LocalResourceOverrides in the Open Resource dialog
joepeck@webkit.org [Fri, 27 Sep 2019 02:25:42 +0000 (02:25 +0000)]
Web Inspector: Include LocalResourceOverrides in the Open Resource dialog
https://bugs.webkit.org/show_bug.cgi?id=202023

Reviewed by Devin Rousso.

* UserInterface/Views/OpenResourceDialog.js:
(WI.OpenResourceDialog.prototype._addScriptsForTarget):
Also walk the extraScriptCollection. Some Worker resource loads never
fully become resources.

(WI.OpenResourceDialog.prototype.didPresentDialog):
(WI.OpenResourceDialog.prototype._addLocalResourceOverrides):
Include local resource override resources.

(WI.OpenResourceDialog.prototype._populateResourceTreeOutline):
* Localizations/en.lproj/localizedStrings.js:
Include a subtitle for local resource overrides.

* UserInterface/Views/OpenResourceDialog.css:
(.open-resource-dialog .tree-outline.large .item .titles .subtitle):
Improved subtitle styling.

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

6 months agoAdd some logging to help diagnose blank or stuck WKWebViews
timothy_horton@apple.com [Fri, 27 Sep 2019 00:59:37 +0000 (00:59 +0000)]
Add some logging to help diagnose blank or stuck WKWebViews
https://bugs.webkit.org/show_bug.cgi?id=202297
<rdar://problem/55763610>

Reviewed by Wenson Hsieh.

Our current logging is insufficient to rule out some of the potential
causes of stuck/blank WKWebViews in <rdar://problem/53399054>. Add
some new logging, and improve some existing logging, to aid in diagnosis.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _willInvokeUIScrollViewDelegateCallback]):
(-[WKWebView _didInvokeUIScrollViewDelegateCallback]):
Rename _delayUpdateVisibleContentRects to be more specific that it
was due to us being underneath a UIScrollView delegate callback.

(-[WKWebView _processWillSwapOrDidExit]):
(-[WKWebView _didCommitLayerTree:]):
Add a log when we receive an incoming commit while visible content rect
updates are being deferred. Also, include the current transaction ID
and the transaction ID that _needsResetViewState... is waiting for, to
help rule out a class of potential problems.

Add a log when we receive an incoming commit more than 5 seconds after
a visible content rect update.

(-[WKWebView _updateVisibleContentRects]):
Keep track of when we defer visual content rect updates for any reason,
and log the first time we do an update after deferring them. This will make
it MUCH easier at-a-glance to tell if one of the "bailing" messages
represents a long-term state (a problem), or is expected.

Keep track of how long it's been since we sent a visible content rect update
and didn't get a commit back from the Web Content process; if it's been
more than 5 seconds, start logging.

(-[WKWebView _cancelAnimatedResize]):
(-[WKWebView _didCompleteAnimatedResize]):
(-[WKWebView _beginAnimatedResizeWithUpdates:]):
(-[WKWebView _endAnimatedResize]):
(-[WKWebView _resizeWhileHidingContentWithUpdates:]):
Turn animated resize logging into release logging. It is a common culprit
for many kinds of bugs, while also not being high volume, so this is well worth it.

* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::freezeLayerTree):
(WebKit::WebPage::unfreezeLayerTree):
Show the current value of m_layerTreeFreezeReasons in addition to the old value and delta,
so you don't have to manually compute the current value when reading logs.

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

6 months ago[LFC][IFC] Move Line::Content::m_lineBox to Line.
zalan@apple.com [Thu, 26 Sep 2019 23:03:02 +0000 (23:03 +0000)]
[LFC][IFC] Move Line::Content::m_lineBox to Line.
https://bugs.webkit.org/show_bug.cgi?id=202280
<rdar://problem/55755798>

Reviewed by Antti Koivisto.

This is in preparation for Line producing Display::Runs instead of Line::Runs.

* layout/inlineformatting/InlineFormattingContext.h:
* layout/inlineformatting/InlineFormattingContextLineLayout.cpp:
(WebCore::Layout::LineLayout::close):
(WebCore::Layout::LineLayout::placeInlineItem):
(WebCore::Layout::InlineFormattingContext::InlineLayout::layout):
(WebCore::Layout::InlineFormattingContext::InlineLayout::computedIntrinsicWidth const):
(WebCore::Layout::InlineFormattingContext::InlineLayout::createDisplayRuns):
* layout/inlineformatting/InlineLine.cpp:
(WebCore::Layout::Line::Line):
(WebCore::Layout::Line::close):
(WebCore::Layout::Line::removeTrailingTrimmableContent):
(WebCore::Layout::Line::moveLogicalLeft):
(WebCore::Layout::Line::appendNonBreakableSpace):
(WebCore::Layout::Line::appendTextContent):
(WebCore::Layout::Line::appendNonReplacedInlineBox):
(WebCore::Layout::Line::adjustBaselineAndLineHeight):
* layout/inlineformatting/InlineLine.h:
(WebCore::Layout::Line::Content::runs const):
(WebCore::Layout::Line::availableWidth const):
(WebCore::Layout::Line::lineBox const):
(WebCore::Layout::Line::logicalTop const):
(WebCore::Layout::Line::logicalBottom const):
(WebCore::Layout::Line::logicalLeft const):
(WebCore::Layout::Line::logicalHeight const):
(WebCore::Layout::Line::contentLogicalWidth const):
(WebCore::Layout::Line::contentLogicalRight const):
(WebCore::Layout::Line::baselineOffset const):
(WebCore::Layout::Line::Content::lineBox const): Deleted.
(WebCore::Layout::Line::Content::lineBox): Deleted.
(WebCore::Layout::Line::Content::setLineBox): Deleted.

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

6 months agoBuild fix.
dino@apple.com [Thu, 26 Sep 2019 22:41:38 +0000 (22:41 +0000)]
Build fix.

* TestWebKitAPI/Tests/WebKitCocoa/ContextMenus.mm:
(-[TestContextMenuImageWithoutConfigurationUIDelegate webView:contextMenuConfigurationForElement:completionHandler:]): Deleted.
(-[TestContextMenuImageWithoutConfigurationUIDelegate webView:contextMenuWillPresentForElement:]): Deleted.
(-[TestContextMenuImageWithoutConfigurationUIDelegate webView:contextMenuForElement:willCommitWithAnimator:]): Deleted.
(-[TestContextMenuImageWithoutConfigurationUIDelegate webView:contextMenuDidEndForElement:]): Deleted.

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

6 months ago[ iOS ] Layout Test scrollingcoordinator/ios/fixed-scrolling-with-keyboard.html is...
russell_e@apple.com [Thu, 26 Sep 2019 22:19:42 +0000 (22:19 +0000)]
[ iOS ] Layout Test scrollingcoordinator/ios/fixed-scrolling-with-keyboard.html is a Flaky Failure
https://bugs.webkit.org/show_bug.cgi?id=202283

Unreviewed Test Gardening.

* platform/ios/TestExpectations: Marked
scrollingcoordinator/ios/fixed-scrolling-with-keyboard.html as flaky

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

6 months agoContextMenu on a link in an email no longer shows web preview
dino@apple.com [Thu, 26 Sep 2019 22:19:32 +0000 (22:19 +0000)]
ContextMenu on a link in an email no longer shows web preview
https://bugs.webkit.org/show_bug.cgi?id=201120
<rdar://54353617>

Reviewed by Wenson Hsieh.

Source/WebKit:

Only go down the image path if we are not also a link.

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

Tools:

Test context menus on a link that is also an image.

* TestWebKitAPI/Tests/WebKitCocoa/ContextMenus.mm:
(contextMenuWebViewDriver):
(-[TestContextMenuImageWithoutConfigurationUIDelegate webView:contextMenuConfigurationForElement:completionHandler:]):
(-[TestContextMenuImageWithoutConfigurationUIDelegate webView:contextMenuWillPresentForElement:]):
(-[TestContextMenuImageWithoutConfigurationUIDelegate webView:contextMenuForElement:willCommitWithAnimator:]):
(-[TestContextMenuImageWithoutConfigurationUIDelegate webView:contextMenuDidEndForElement:]):
(TEST):

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

6 months agorun-safari --ios-simulator is no longer working with Xcode 11
commit-queue@webkit.org [Thu, 26 Sep 2019 21:54:31 +0000 (21:54 +0000)]
run-safari --ios-simulator is no longer working with Xcode 11
https://bugs.webkit.org/show_bug.cgi?id=199852

Path of MobileSafari.app has changed in Xcode 11. This patch updates
the run-safari script to use the new path. This removes support for
running Safari on iOS < 13, see discussions on bug 177595.

Patch by Frederic Wang <fwang@igalia.com> on 2019-09-26
Reviewed by Jonathan Bedard.

* Scripts/webkitdirs.pm:
(iosSimulatorApplicationsPath):

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

6 months ago[results.webkit.org] Timeline support Image inner label
zhifei_fang@apple.com [Thu, 26 Sep 2019 21:51:35 +0000 (21:51 +0000)]
[results.webkit.org] Timeline support Image inner label
https://bugs.webkit.org/show_bug.cgi?id=202180

Reviewed by Jonathan Bedard.

* resultsdbpy/resultsdbpy/view/static/js/expectations.js:
* resultsdbpy/resultsdbpy/view/static/library/css/webkit.css:
(.lengend>.item .dot img): support img symbol for lengend and dot
* resultsdbpy/resultsdbpy/view/static/library/js/components/TimelineComponents.js:
(Timeline.CanvasSeriesComponent): Support user pass a Image object or a image url as inner label

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

6 months agoStop using testRunner.overridePreference() to turn on Page Cache
cdumez@apple.com [Thu, 26 Sep 2019 21:37:38 +0000 (21:37 +0000)]
Stop using testRunner.overridePreference() to turn on Page Cache
https://bugs.webkit.org/show_bug.cgi?id=202274

Reviewed by Alex Christensen.

Source/WebKit:

* WebProcess/InjectedBundle/InjectedBundle.cpp:
(WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):

Tools:

* DumpRenderTree/TestRunner.cpp:
(overridePreferenceCallback):
* WebKitTestRunner/InjectedBundle/TestRunner.cpp:
(WTR::TestRunner::overridePreference):

LayoutTests:

Stop using testRunner.overridePreference() to turn on Page Cache, as this does not work
for WebKit2 when navigating cross-origin due to process swapping. Instead, update tests
to rely on `<!-- webkit-test-runner [ enablePageCache=true ] -->`.

* animations/resume-after-page-cache.html:
* compositing/accelerated-layers-after-back.html:
* compositing/iframes/page-cache-layer-tree.html:
* compositing/page-cache-back-crash.html:
* compositing/show-composited-iframe-on-back-button.html:
* editing/mac/input/unconfirmed-text-navigation-with-page-cache.html:
* fast/css/fontloader-page-cache.html:
* fast/dom/DeviceMotion/no-page-cache.html:
* fast/dom/DeviceOrientation/event-after-navigation.html:
* fast/dom/DeviceOrientation/no-page-cache.html:
* fast/dom/Window/timer-resume-on-navigation-back.html:
* fast/events/onunload-back-to-page-cache.html:
* fast/events/pagehide-timeout-expected.txt:
* fast/events/pagehide-timeout.html:
* fast/events/pagehide-xhr-open-expected.txt:
* fast/events/pagehide-xhr-open.html:
* fast/events/pageshow-pagehide-on-back-cached-with-frames.html:
* fast/events/pageshow-pagehide-on-back-cached.html:
* fast/events/suspend-timers-expected.txt:
* fast/events/suspend-timers.html:
* fast/forms/autocomplete-off-with-default-value-does-not-clear.html:
* fast/frames/frame-crash-with-page-cache.html:
* fast/frames/frame-unload-navigate-and-setTimeout-assert-fail.html:
* fast/frames/page-hide-document-open.html:
* fast/frames/restoring-page-cache-should-not-run-scripts-via-style-update.html:
* fast/frames/restoring-page-cache-should-not-run-scripts.html:
* fast/harness/page-cache-crash-on-data-urls.html:
* fast/harness/use-page-cache-expected.txt:
* fast/harness/use-page-cache.html:
* fast/history/back-from-page-with-focused-iframe.html:
* fast/history/go-back-to-iframe-with-plugin.html:
* fast/history/go-back-to-object-subframe.html:
* fast/history/history-back-while-pdf-in-pagecache.html:
* fast/history/page-cache-MessagePort-pending-message.html:
* fast/history/page-cache-after-window-open.html:
* fast/history/page-cache-back-navigation-crash.html:
* fast/history/page-cache-clearing-expected.txt:
* fast/history/page-cache-clearing.html:
* fast/history/page-cache-closed-audiocontext.html:
* fast/history/page-cache-createObjectURL-using-open-panel.html:
* fast/history/page-cache-createObjectURL.html:
* fast/history/page-cache-destroy-document.html:
* fast/history/page-cache-element-state-focused.html:
* fast/history/page-cache-execute-script-during-restore.html:
* fast/history/page-cache-geolocation-active-oneshot.html:
* fast/history/page-cache-geolocation-active-watcher.html:
* fast/history/page-cache-geolocation.html:
* fast/history/page-cache-indexed-closed-db.html:
* fast/history/page-cache-indexed-opened-db.html:
* fast/history/page-cache-media-source-closed-2.html:
* fast/history/page-cache-media-source-closed.html:
* fast/history/page-cache-media-source-opened.html:
* fast/history/page-cache-navigate-during-restore.html:
* fast/history/page-cache-notification-non-suspendable.html:
* fast/history/page-cache-notification-suspendable.html:
* fast/history/page-cache-removed-source-buffer.html:
* fast/history/page-cache-running-audiocontext.html:
* fast/history/page-cache-suspended-audiocontext.html:
* fast/history/page-cache-webdatabase-no-transaction-db-expected.txt:
* fast/history/page-cache-webdatabase-no-transaction-db.html:
* fast/history/page-cache-webdatabase-pending-transaction.html:
* fast/history/page-cache-with-opener.html:
* fast/history/pagehide-remove-iframe-crash.html:
* fast/history/resources/page-cache-window-with-iframe.html:
* fast/history/resources/page-cache-window-with-opener.html:
* fast/history/timed-refresh-in-cached-frame.html:
* fast/images/animated-gif-restored-from-bfcache.html:
* fast/loader/frames-with-unload-handlers-in-page-cache.html:
* fast/loader/image-in-page-cache.html:
* fast/loader/input-element-page-cache-crash.html:
* fast/loader/navigate-with-new-target-after-back-forward-navigation.html:
* fast/loader/navigate-with-post-to-new-target-after-back-forward-navigation.html:
* fast/loader/scroll-position-restored-on-back.html:
* fast/loader/stateobjects/no-popstate-when-back-to-stateless-entry-with-page-cache.html:
* fast/loader/stateobjects/popstate-fires-with-page-cache.html:
* fast/loader/unschedule-relayout-after-unload.html:
* fast/loader/window-properties-restored-from-page-cache.html:
* fast/overflow/horizontal-scroll-after-back.html:
* fast/scrolling/iframe-scrollable-after-back.html:
* fast/scrolling/ios/scroll-events-back-forward-after-pageshow.html:
* fast/scrolling/ios/scroll-events-back-forward.html:
* fast/scrolling/ios/touch-scroll-back-forward.html:
* fast/scrolling/overflow-scrollable-after-back.html:
* fast/scrolling/page-cache-back-overflow-scroll-restore.html:
* fast/text-autosizing/ios/text-autosizing-after-back.html:
* fast/viewport/ios/viewport-shrink-to-fit-on-new-navigation.html:
* fast/viewport/viewport-128.html:
* http/tests/cache/display-image-unset-allows-cached-image-load.html:
* http/tests/loading/main-resource-delegates-on-back-navigation-expected.txt:
* http/tests/loading/main-resource-delegates-on-back-navigation.html:
* http/tests/loading/unfinished-load-back-to-cached-page-callbacks.html:
* http/tests/loading/unfinished-main-resource-back-to-cached-page-callbacks.html:
* http/tests/media/reload-after-dialog.html:
* http/tests/navigation/go-back-to-error-page.html:
* http/tests/navigation/https-in-page-cache.html:
* http/tests/navigation/https-no-store-subframe-in-page-cache.html:
* http/tests/navigation/image-load-in-pagehide-handler.html:
* http/tests/navigation/page-cache-fragment-referrer.html:
* http/tests/navigation/page-cache-iframe-no-current-historyItem.html:
* http/tests/navigation/page-cache-iframe-provisional-load-async-delegates.html:
* http/tests/navigation/page-cache-iframe-provisional-load.html:
* http/tests/navigation/page-cache-pending-image-load-cache-partition.html:
* http/tests/navigation/page-cache-pending-image-load.html:
* http/tests/navigation/page-cache-pending-ping-load-cross-origin.html:
* http/tests/navigation/page-cache-pending-ping-load-same-origin.html:
* http/tests/navigation/page-cache-xhr-in-pagehide-expected.txt:
* http/tests/navigation/page-cache-xhr-in-pagehide.html:
* http/tests/navigation/page-cache-xhr.html:
* http/tests/navigation/resources/https-in-page-cache-1.php:
* http/tests/navigation/resources/https-in-page-cache-2.php:
* http/tests/navigation/resources/https-in-page-cache-3.html:
* http/tests/navigation/resources/https-no-store-subframe-in-page-cache.html:
* http/tests/navigation/subframe-pagehide-handler-starts-load.html:
* http/tests/navigation/subframe-pagehide-handler-starts-load2.html:
* http/tests/security/cross-origin-window-open-insert-script.html:
* http/tests/security/cross-origin-window-open-javascript-url.html:
* http/tests/security/navigate-when-restoring-cached-page.html:
* http/tests/security/xss-DENIED-click-and-form-submission-from-inactive-domwindow.html:
* http/tests/security/xss-DENIED-script-inject-into-inactive-window.html:
* http/tests/security/xss-DENIED-script-inject-into-inactive-window2-pson.html:
* http/tests/security/xss-DENIED-script-inject-into-inactive-window2.html:
* http/tests/security/xss-DENIED-script-inject-into-inactive-window3.html:
* http/tests/websocket/tests/hybi/closed-when-entering-page-cache.html:
* http/tests/websocket/tests/hybi/stop-on-resume-in-error-handler.html:
* http/tests/workers/service/client-added-to-clients-when-restored-from-page-cache.html:
* http/tests/workers/service/client-removed-from-clients-while-in-page-cache.html:
* http/wpt/beacon/support/sendBeacon-onpagehide-window.html:
* legacy-animation-engine/animations/resume-after-page-cache.html:
* loader/go-back-cached-main-resource.html:
* loader/go-back-to-different-window-size.html:
* media/crash-closing-page-with-media-as-plugin-fallback.html:
* media/restore-from-page-cache.html:
* platform/ios/ios/fixed/fixed-back-forward.html:
* plugins/crash-restoring-plugin-page-from-page-cache.html:
* plugins/frameset-with-plugin-frame.html:
* plugins/netscape-plugin-page-cache-works.html:
* swipe/basic-cached-back-swipe.html:
* swipe/main-frame-pinning-requirement.html:
* swipe/pushState-cached-back-swipe.html:
* swipe/pushState-programmatic-back-while-swiping-crash.html:
* swipe/pushstate-with-manual-scrollrestoration.html:
* tiled-drawing/scrolling/null-parent-back-crash.html:
* tiled-drawing/tiled-drawing-scroll-position-page-cache-restoration.html:

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

6 months agoREGRESSION: [ Catalina WK2 ] http/wpt/webauthn/public-key-credential-create-success...
jiewen_tan@apple.com [Thu, 26 Sep 2019 21:36:36 +0000 (21:36 +0000)]
REGRESSION: [ Catalina WK2 ] http/wpt/webauthn/public-key-credential-create-success-u2f.https.html is failing
https://bugs.webkit.org/show_bug.cgi?id=201620

Unreviewed, roll back part of r249737 to confirm the cause.

* Modules/webauthn/fido/U2fResponseConverter.cpp:
(fido::WebCore::createAttestedCredentialDataFromU2fRegisterResponse):

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

6 months agoresults.webkit.org: Use cursor: pointer for clickable elements
jbedard@apple.com [Thu, 26 Sep 2019 20:09:00 +0000 (20:09 +0000)]
results.webkit.org: Use cursor: pointer for clickable elements
https://bugs.webkit.org/show_bug.cgi?id=202268

Rubber-stamped by Aakash Jain.

* resultsdbpy/resultsdbpy/view/static/js/drawer.js: Give collapse button a pointer for cursor.
* resultsdbpy/resultsdbpy/view/templates/search.html: Make 'X' to close test timeline a link-button.

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

6 months agoUnreviewed, rolling out r250385.
tsavell@apple.com [Thu, 26 Sep 2019 20:05:25 +0000 (20:05 +0000)]
Unreviewed, rolling out r250385.

Broke imported/w3c/web-platform-tests/svg/animations/syncbase-
remove-add-while-running.html on all platforms. Which was
caught by EWS

Reverted changeset:

"Non-callable "handleEvent" property is silently ignored"
https://bugs.webkit.org/show_bug.cgi?id=200066
https://trac.webkit.org/changeset/250385

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

6 months agoCrash under WebPage::beginPrinting when m_printContext becomes null due to synchronou...
aestes@apple.com [Thu, 26 Sep 2019 19:20:22 +0000 (19:20 +0000)]
Crash under WebPage::beginPrinting when m_printContext becomes null due to synchronous layout
https://bugs.webkit.org/show_bug.cgi?id=202171
<rdar://problem/49731211>

Reviewed by Tim Horton.

Speculatively fix a null pointer dereference crash in WebPage::beginPrinting.

WebPage::beginPrinting creates a PrintContext, stores it in m_printContext, then calls
PrintContext::begin which forces a synchronous, paginated layout. If a post-layout task
executes script, that might result in the WebPage being closed and m_printContext being set
to nullptr.

Guard against this in WebPage::beginPrinting by adding a null check before calling
PrintContext::computePageRects.

* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::beginPrinting):

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

6 months agoSource/WebCore:
commit-queue@webkit.org [Thu, 26 Sep 2019 19:16:40 +0000 (19:16 +0000)]
Source/WebCore:
Enable LayoutTests using ResourceLoadStatistics SQLite backend (195420)
https://bugs.webkit.org/show_bug.cgi?id=195420
<rdar://problem/54213551>

Patch by Kate Cheney <katherine_cheney@apple.com> on 2019-09-26
Reviewed by Brent Fulgham.

Tests: http/tests/resourceLoadStatistics/add-blocking-to-redirect-database.html
       http/tests/resourceLoadStatistics/blocking-in-web-worker-script-import-database.html
       http/tests/resourceLoadStatistics/cap-cache-max-age-for-prevalent-resource-database.html
       http/tests/resourceLoadStatistics/capped-lifetime-for-cookie-set-in-js-database.html
       http/tests/resourceLoadStatistics/capped-lifetime-for-cookie-set-in-js-with-link-decoration-same-site-database.html
       http/tests/resourceLoadStatistics/capped-lifetime-for-cookie-set-in-js-with-link-fragment-from-prevalent-resource-database.html
       http/tests/resourceLoadStatistics/capped-lifetime-for-cookie-set-in-js-with-link-query-and-fragment-from-prevalent-resource-database.html
       http/tests/resourceLoadStatistics/capped-lifetime-for-cookie-set-in-js-with-link-query-from-prevalent-resource-database.html
       http/tests/resourceLoadStatistics/capped-lifetime-for-cookie-set-in-js-without-link-decoration-from-prevalent-resource-database.html
       http/tests/resourceLoadStatistics/classify-as-non-prevalent-based-on-mixed-statistics-database.html
       http/tests/resourceLoadStatistics/classify-as-non-prevalent-based-on-sub-frame-under-top-frame-origins-database.html
       http/tests/resourceLoadStatistics/classify-as-non-prevalent-based-on-subresource-under-top-frame-origins-database.html
       http/tests/resourceLoadStatistics/classify-as-non-prevalent-based-on-subresource-unique-redirects-to-database.html
       http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-mixed-statistics-database.html
       http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-sub-frame-under-top-frame-origins-database.html
       http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-subresource-redirect-collusion-database.html
       http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-subresource-redirect-to-prevalent-database.html
       http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-subresource-under-top-frame-origins-database.html
       http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-subresource-unique-redirects-to-database.html
       http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-top-frame-redirect-collusion-database.html
       http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-top-frame-redirect-to-prevalent-database.html
       http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-top-frame-unique-redirects-to-database.html
       http/tests/resourceLoadStatistics/classify-as-very-prevalent-based-on-mixed-statistics-database.html
       http/tests/resourceLoadStatistics/clear-in-memory-and-persistent-store-database.html
       http/tests/resourceLoadStatistics/clear-in-memory-and-persistent-store-one-hour-database.html
       http/tests/resourceLoadStatistics/cookie-deletion-database.html
       http/tests/resourceLoadStatistics/cookies-with-and-without-user-interaction-database.html
       http/tests/resourceLoadStatistics/delete-script-accessible-cookies-database.html
       http/tests/resourceLoadStatistics/do-not-block-top-level-navigation-redirect-database.html
       http/tests/resourceLoadStatistics/do-not-capture-statistics-for-simple-top-navigations-database.html
       http/tests/resourceLoadStatistics/do-not-remove-blocking-in-redirect-database.html
       http/tests/resourceLoadStatistics/do-not-switch-session-on-navigation-to-prevalent-without-interaction-database.html
       http/tests/resourceLoadStatistics/downgraded-referrer-for-navigation-with-link-query-from-prevalent-resource-database.html
       http/tests/resourceLoadStatistics/enable-debug-mode-database.html
       http/tests/resourceLoadStatistics/grandfathering-database.html
       http/tests/resourceLoadStatistics/non-prevalent-resource-with-user-interaction-database.html
       http/tests/resourceLoadStatistics/non-prevalent-resource-without-user-interaction-database.html
       http/tests/resourceLoadStatistics/non-prevalent-resources-can-access-cookies-in-a-third-party-context-database.html
       http/tests/resourceLoadStatistics/non-sandboxed-iframe-redirect-ip-to-localhost-to-ip-database.html
       http/tests/resourceLoadStatistics/non-sandboxed-iframe-redirect-localhost-to-ip-to-localhost-database.html
       http/tests/resourceLoadStatistics/non-sandboxed-nesting-iframe-with-non-sandboxed-iframe-redirect-ip-to-localhost-to-ip-database.html
       http/tests/resourceLoadStatistics/non-sandboxed-nesting-iframe-with-non-sandboxed-iframe-redirect-localhost-to-ip-to-localhost-database.html
       http/tests/resourceLoadStatistics/non-sandboxed-nesting-iframe-with-sandboxed-iframe-redirect-ip-to-localhost-to-ip-database.html
       http/tests/resourceLoadStatistics/non-sandboxed-nesting-iframe-with-sandboxed-iframe-redirect-localhost-to-ip-to-localhost-database.html
       http/tests/resourceLoadStatistics/ping-to-prevalent-resource-database.html
       http/tests/resourceLoadStatistics/prevalent-resource-handled-keydown-database.html
       http/tests/resourceLoadStatistics/prevalent-resource-unhandled-keydown-database.html
       http/tests/resourceLoadStatistics/prevalent-resource-with-user-interaction-database.html
       http/tests/resourceLoadStatistics/prevalent-resource-with-user-interaction-timeout-database.html
       http/tests/resourceLoadStatistics/prevalent-resource-without-user-interaction-database.html
       http/tests/resourceLoadStatistics/prune-statistics-database.html
       http/tests/resourceLoadStatistics/sandboxed-iframe-redirect-ip-to-localhost-to-ip-database.html
       http/tests/resourceLoadStatistics/sandboxed-iframe-redirect-localhost-to-ip-to-localhost-database.html
       http/tests/resourceLoadStatistics/sandboxed-nesting-iframe-with-non-sandboxed-iframe-redirect-ip-to-localhost-to-ip-database.html
       http/tests/resourceLoadStatistics/sandboxed-nesting-iframe-with-non-sandboxed-iframe-redirect-localhost-to-ip-to-localhost-database.html
       http/tests/resourceLoadStatistics/sandboxed-nesting-iframe-with-sandboxed-iframe-redirect-ip-to-localhost-to-ip-database.html
       http/tests/resourceLoadStatistics/sandboxed-nesting-iframe-with-sandboxed-iframe-redirect-localhost-to-ip-to-localhost-database.html
       http/tests/resourceLoadStatistics/set-custom-prevalent-resource-in-debug-mode-database.html
       http/tests/resourceLoadStatistics/strip-referrer-to-origin-for-prevalent-subresource-redirects-database.html
       http/tests/resourceLoadStatistics/strip-referrer-to-origin-for-prevalent-subresource-requests-database.html
       http/tests/resourceLoadStatistics/switch-session-on-navigation-to-prevalent-with-interaction-database.html
       http/tests/resourceLoadStatistics/user-interaction-in-cross-origin-sub-frame-database.html
       http/tests/resourceLoadStatistics/user-interaction-only-reported-once-within-short-period-of-time-database.html
       http/tests/resourceLoadStatistics/user-interaction-reported-after-website-data-removal-database.html

* platform/sql/SQLiteDatabase.h:
Added WEBCORE_EXPORT prefix to 2 functions needed in the ITP Database
to clear out the database.

Source/WebKit:
Enable LayoutTests using ResourceLoadStatistics SQLite backend (195420)
https://bugs.webkit.org/show_bug.cgi?id=195420
<rdar://problem/54213551>

Patch by Kate Cheney <katherine_cheney@apple.com> on 2019-09-26
Reviewed by Brent Fulgham.

Changed all RELEASE_LOG_ERROR() calls involving domain strings to
RELEASE_LOG_ERROR_IF_ALLOWED() to prevent leaking information about
the domain strings only if sessionID.isAlwaysOnLoggingAllowed().

* NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp:
(WebKit::ResourceLoadStatisticsDatabaseStore::ResourceLoadStatisticsDatabaseStore):
Added autovacuuming to the constructor to avoid manually calling
runVacuumCommand(). Changed constructor to take in sessionID so it
can use RELEASE_LOG_ERROR_IF_ALLOWED which requires the sessionID.

(WebKit::ResourceLoadStatisticsDatabaseStore::prepareStatements):
Added 2 statements that were not being prepared.

(WebKit::ResourceLoadStatisticsDatabaseStore::relationshipExists const):
Corrected incorrect capitalization. Added check for nullopt in case
domainID is for a domain not in the database yet.

(WebKit::ResourceLoadStatisticsDatabaseStore::domainID const):
Changed return value to Optional<unsigned>. Some tests were directly
checking for subframes under top frame domains on domains that had
not been inserted yet. Now, domainID() won't crash but will return
a nullopt value which can be checked to know that the tests failed.

(WebKit::ResourceLoadStatisticsDatabaseStore::insertDomainRelationships):
Added a check to assure domainID exists and updated the domainID
interactions to work as Optionals.

(WebKit::ResourceLoadStatisticsDatabaseStore::populateFromMemoryStore):
Moved the prepareStatements() call after the vacuum command in the case
where the database is empty. Otherwise called it before returning.

(WebKit::ResourceLoadStatisticsDatabaseStore::recursivelyFindNonPrevalentDomainsThatRedirectedToThisDomain):
Added a space to the SQL commands to correct the syntax.

(WebKit::ResourceLoadStatisticsDatabaseStore::findNotVeryPrevalentResources):
Corrected a bug in the SQL command for querying
subframeUnderTopFrameDomain. The old query was asking for subresource.

(WebKit::ResourceLoadStatisticsDatabaseStore::reclassifyResources):
Spelling fix.

(WebKit::ResourceLoadStatisticsDatabaseStore::requestStorageAccess):
Changed string concatenation to binding.

(WebKit::ResourceLoadStatisticsDatabaseStore::grandfatherDataForDomains):
The grandfathering.html test was failing because domains were being
"set" to grandfathered in the database before being inserted. This fix
ensures all domains before setting the grandfathering flag.

(WebKit::ResourceLoadStatisticsDatabaseStore::logFrameNavigation):
Multiple tests were failing because the query to insert the relationship
for the source domain relies on the target domain being in the
ObservedDomains table. This patch ensures all domains are added before
performing the query.

(WebKit::ResourceLoadStatisticsDatabaseStore::setUserInteraction):
Added a != SQLITE_OK check to make sure an error is logged if the
statement fails to bind.

(WebKit::ResourceLoadStatisticsDatabaseStore::clearUserInteraction):
Changed string concatenation to binding.

(WebKit::ResourceLoadStatisticsDatabaseStore::hasHadUserInteraction):
The SQL statement was being bound to a value and not being reset. This
patch resets the statement after binding. Additionally, the step()
function was being compared to SQLITE_DONE instead of SQLITE_ROW,
causing an error if the query returned results. The
ASSERT_NOT_REACHED() was causing null searches to crash instead of
returning false (i.e. if a domain is not in the database it should
return that it has no user interaction instead of crashing).

(WebKit::ResourceLoadStatisticsDatabaseStore::setPrevalentResource):
Updated domainID call to act as an Optional.

(WebKit::ResourceLoadStatisticsDatabaseStore::predicateValueForDomain const):
The SQL statement was being bound to a value and not being reset. This
patch resets the statement after binding. SQLITE_DONE changed to
SQLITE_ROW to return non-empty query results. ASSERT_NOT_REACHED()
removed for the same reasons as above.

(WebKit::ResourceLoadStatisticsDatabaseStore::ensureResourceStatisticsForRegistrableDomain):
Fixed the release log statement which was logging the wrong function
name.

(WebKit::ResourceLoadStatisticsDatabaseStore::clearDatabaseContents):
Clears the database and rebuilds the tables on a clear command to
match the functionality in the Memory Store.

(WebKit::ResourceLoadStatisticsDatabaseStore::clear):
Call the clearDatabaseContents function to match the functionality
in the Memory Store.

(WebKit::ResourceLoadStatisticsDatabaseStore::hasUserGrantedStorageAccessThroughPrompt const):
Updated domainID call to act as an Optional.

(WebKit::ResourceLoadStatisticsDatabaseStore::hasHadUnexpiredRecentUserInteraction):
Tests were failing because shouldRemoveAllWebsiteDataFor() was not
checking for expired user interaction. Matched functionality in the
Memory Store.

(WebKit::ResourceLoadStatisticsDatabaseStore::shouldRemoveAllWebsiteDataFor):
Tests were failing because shouldRemoveAllWebsiteDataFor() was not
checking for expired user interaction. Matched functionality in the
Memory Store.

(WebKit::ResourceLoadStatisticsDatabaseStore::registrableDomainsToRemoveWebsiteDataFor):
Spelling fix.

(WebKit::ResourceLoadStatisticsDatabaseStore::pruneStatisticsIfNeeded):
Last seen should be sorted in ascending order because you want to
prune the older statistics first, which will have a lower lastSeen
field (secondsSinceEpoch() will be lower for older values).

(WebKit::ResourceLoadStatisticsDatabaseStore::shouldRemoveAllWebsiteDataFor const): Deleted.
Deleted const specifier because the function needs to clear the
database.

* NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.h:
Declared new functions. Updated spelling error (registerable -->
registrable). Updated constructor to take sessionID.

* NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
(WebKit::WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore):
ITP database flag now is stored in the NetworkProcess.
* NetworkProcess/NetworkProcess.cpp:

(WebKit::NetworkProcess::initializeNetworkProcess):
Set the ITP database flag which is now stored in the Network Process.

(WebKit::NetworkProcess::setUseITPDatabase):
* NetworkProcess/NetworkProcess.h:
(WebKit::NetworkProcess::isITPDatabaseEnabled const):
* NetworkProcess/NetworkProcess.messages.in:
Passed the setUseITPDatabase flag to the initialization function
of the statistics store to enable the database backend.

* NetworkProcess/NetworkSession.cpp:
(WebKit::NetworkSession::NetworkSession):
SandboxExtension::consumePermanently was not getting called on the
WebKitTestRunner resourceLoadStatistics path. This was preventing
the database file from opening.

(WebKit::NetworkSession::recreateResourceLoadStatisticStore):
Destroy old WebResourceLoadStatisticsStore and create a new one using
the ITP database.

* NetworkProcess/NetworkSession.h:
* UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
(WKWebsiteDataStoreSetUseITPDatabase):
* UIProcess/API/C/WKWebsiteDataStoreRef.h:
* UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::setUseITPDatabase):
* UIProcess/Network/NetworkProcessProxy.h:
* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::WebsiteDataStore::setUseITPDatabase):
* UIProcess/WebsiteData/WebsiteDataStore.h:
Passed the setUseITPDatabase flag to the initialization function
of the statistics store to enable the database backend.

Tools:
Enable LayoutTests using ResourceLoadStatistics SQLite backend (195420)
https://bugs.webkit.org/show_bug.cgi?id=195420
<rdar://problem/54213551>

Patch by Kate Cheney <katherine_cheney@apple.com> on 2019-09-26
Reviewed by Brent Fulgham.

Added in logic to send a message from the UIProcess to the Network
Process which will initalize the ITP Database backend to allow for
layout testing.
* WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl:
* WebKitTestRunner/InjectedBundle/TestRunner.cpp:
(WTR::TestRunner::setUseITPDatabase):
* WebKitTestRunner/InjectedBundle/TestRunner.h:
* WebKitTestRunner/TestController.cpp:
(WTR::TestController::setUseITPDatabase):
* WebKitTestRunner/TestController.h:
* WebKitTestRunner/TestInvocation.cpp:
(WTR::TestInvocation::didReceiveSynchronousMessageFromInjectedBundle):

LayoutTests:
Enable LayoutTests using ResourceLoadStatistics SQLite backend (195420)
https://bugs.webkit.org/show_bug.cgi?id=195420
<rdar://problem/54213551>

Added a flag to all ITP tests to enable the ITP database backend to
allow for testing functionality against the memory store. Tests were
not created for telemetry-generation.html,
log-cross-site-load-with-link-decoration.html, or
website-data-removal-for-site-navigated-to-with-link-decoration.html,
because these rely on functions not yet implemented in the ITP database.
Additionally, added flags to some memory store tests to ensure they
are using the memory store before calling functions not implemented in
the database store yet.

Patch by Kate Cheney <katherine_cheney@apple.com> on 2019-09-26
Reviewed by Brent Fulgham.

* http/tests/resourceLoadStatistics/add-blocking-to-redirect-database-expected.txt: Added.
* http/tests/resourceLoadStatistics/add-blocking-to-redirect-database.html: Added.
* http/tests/resourceLoadStatistics/blocking-in-web-worker-script-import-database-expected.txt: Added.
* http/tests/resourceLoadStatistics/blocking-in-web-worker-script-import-database.html: Added.
* http/tests/resourceLoadStatistics/cap-cache-max-age-for-prevalent-resource-database-expected.txt: Added.
* http/tests/resourceLoadStatistics/cap-cache-max-age-for-prevalent-resource-database.html: Added.
* http/tests/resourceLoadStatistics/capped-lifetime-for-cookie-set-in-js-database-expected.txt: Added.
* http/tests/resourceLoadStatistics/capped-lifetime-for-cookie-set-in-js-database.html: Added.
* http/tests/resourceLoadStatistics/capped-lifetime-for-cookie-set-in-js-with-link-decoration-same-site-database-expected.txt: Added.
* http/tests/resourceLoadStatistics/capped-lifetime-for-cookie-set-in-js-with-link-decoration-same-site-database.html: Added.
* http/tests/resourceLoadStatistics/capped-lifetime-for-cookie-set-in-js-with-link-fragment-from-prevalent-resource-database-expected.txt: Added.
* http/tests/resourceLoadStatistics/capped-lifetime-for-cookie-set-in-js-with-link-fragment-from-prevalent-resource-database.html: Added.
* http/tests/resourceLoadStatistics/capped-lifetime-for-cookie-set-in-js-with-link-query-and-fragment-from-prevalent-resource-database-expected.txt: Added.
* http/tests/resourceLoadStatistics/capped-lifetime-for-cookie-set-in-js-with-link-query-and-fragment-from-prevalent-resource-database.html: Added.
* http/tests/resourceLoadStatistics/capped-lifetime-for-cookie-set-in-js-with-link-query-from-prevalent-resource-database-expected.txt: Added.
* http/tests/resourceLoadStatistics/capped-lifetime-for-cookie-set-in-js-with-link-query-from-prevalent-resource-database.html: Added.
* http/tests/resourceLoadStatistics/capped-lifetime-for-cookie-set-in-js-without-link-decoration-from-prevalent-resource-database-expected.txt: Added.
* http/tests/resourceLoadStatistics/capped-lifetime-for-cookie-set-in-js-without-link-decoration-from-prevalent-resource-database.html: Added.
* http/tests/resourceLoadStatistics/classify-as-non-prevalent-based-on-mixed-statistics-database-expected.txt: Added.
* http/tests/resourceLoadStatistics/classify-as-non-prevalent-based-on-mixed-statistics-database.html: Added.
* http/tests/resourceLoadStatistics/classify-as-non-prevalent-based-on-sub-frame-under-top-frame-origins-database-expected.txt: Added.
* http/tests/resourceLoadStatistics/classify-as-non-prevalent-based-on-sub-frame-under-top-frame-origins-database.html: Added.
* http/tests/resourceLoadStatistics/classify-as-non-prevalent-based-on-subresource-under-top-frame-origins-database-expected.txt: Added.
* http/tests/resourceLoadStatistics/classify-as-non-prevalent-based-on-subresource-under-top-frame-origins-database.html: Added.
* http/tests/resourceLoadStatistics/classify-as-non-prevalent-based-on-subresource-unique-redirects-to-database-expected.txt: Added.
* http/tests/resourceLoadStatistics/classify-as-non-prevalent-based-on-subresource-unique-redirects-to-database.html: Added.
* http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-mixed-statistics-database-expected.txt: Added.
* http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-mixed-statistics-database.html: Added.
* http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-sub-frame-under-top-frame-origins-database-expected.txt: Added.
* http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-sub-frame-under-top-frame-origins-database.html: Added.
* http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-subresource-redirect-collusion-database-expected.txt: Added.
* http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-subresource-redirect-collusion-database.html: Added.
* http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-subresource-redirect-to-prevalent-database-expected.txt: Added.
* http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-subresource-redirect-to-prevalent-database.html: Added.
* http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-subresource-under-top-frame-origins-database-expected.txt: Added.
* http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-subresource-under-top-frame-origins-database.html: Added.
* http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-subresource-unique-redirects-to-database-expected.txt: Added.
* http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-subresource-unique-redirects-to-database.html: Added.
* http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-top-frame-redirect-collusion-database-expected.txt: Added.
* http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-top-frame-redirect-collusion-database.html: Added.
* http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-top-frame-redirect-to-prevalent-database-expected.txt: Added.
* http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-top-frame-redirect-to-prevalent-database.html: Added.
* http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-top-frame-unique-redirects-to-database-expected.txt: Added.
* http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-top-frame-unique-redirects-to-database.html: Added.
* http/tests/resourceLoadStatistics/classify-as-very-prevalent-based-on-mixed-statistics-database-expected.txt: Added.
* http/tests/resourceLoadStatistics/classify-as-very-prevalent-based-on-mixed-statistics-database.html: Added.
* http/tests/resourceLoadStatistics/clear-in-memory-and-persistent-store-database-expected.txt: Added.
* http/tests/resourceLoadStatistics/clear-in-memory-and-persistent-store-database.html: Added.
* http/tests/resourceLoadStatistics/clear-in-memory-and-persistent-store-one-hour-database-expected.txt: Added.
* http/tests/resourceLoadStatistics/clear-in-memory-and-persistent-store-one-hour-database.html: Added.
* http/tests/resourceLoadStatistics/cookie-deletion-database-expected.txt: Added.
* http/tests/resourceLoadStatistics/cookie-deletion-database.html: Added.
* http/tests/resourceLoadStatistics/cookies-with-and-without-user-interaction-database-expected.txt: Added.
* http/tests/resourceLoadStatistics/cookies-with-and-without-user-interaction-database.html: Added.
* http/tests/resourceLoadStatistics/delete-script-accessible-cookies-database-expected.txt: Added.
* http/tests/resourceLoadStatistics/delete-script-accessible-cookies-database.html: Added.
* http/tests/resourceLoadStatistics/do-not-block-top-level-navigation-redirect-database-expected.txt: Added.
* http/tests/resourceLoadStatistics/do-not-block-top-level-navigation-redirect-database.html: Added.
* http/tests/resourceLoadStatistics/do-not-capture-statistics-for-simple-top-navigations-database-expected.txt: Added.
* http/tests/resourceLoadStatistics/do-not-capture-statistics-for-simple-top-navigations-database.html: Added.
* http/tests/resourceLoadStatistics/do-not-remove-blocking-in-redirect-database-expected.txt: Added.
* http/tests/resourceLoadStatistics/do-not-remove-blocking-in-redirect-database.html: Added.
* http/tests/resourceLoadStatistics/do-not-switch-session-on-navigation-to-prevalent-without-interaction-database-expected.txt: Added.
* http/tests/resourceLoadStatistics/do-not-switch-session-on-navigation-to-prevalent-without-interaction-database.html: Added.
* http/tests/resourceLoadStatistics/downgraded-referrer-for-navigation-with-link-query-from-prevalent-resource-database-expected.txt: Added.
* http/tests/resourceLoadStatistics/downgraded-referrer-for-navigation-with-link-query-from-prevalent-resource-database.html: Added.
* http/tests/resourceLoadStatistics/enable-debug-mode-database-expected.txt: Added.
* http/tests/resourceLoadStatistics/enable-debug-mode-database.html: Added.
* http/tests/resourceLoadStatistics/grandfathering-database-expected.txt: Added.
* http/tests/resourceLoadStatistics/grandfathering-database.html: Added.
* http/tests/resourceLoadStatistics/log-cross-site-load-with-link-decoration.html:
* http/tests/resourceLoadStatistics/non-prevalent-resource-with-user-interaction-database-expected.txt: Added.
* http/tests/resourceLoadStatistics/non-prevalent-resource-with-user-interaction-database.html: Added.
* http/tests/resourceLoadStatistics/non-prevalent-resource-without-user-interaction-database-expected.txt: Added.
* http/tests/resourceLoadStatistics/non-prevalent-resource-without-user-interaction-database.html: Added.
* http/tests/resourceLoadStatistics/non-prevalent-resources-can-access-cookies-in-a-third-party-context-database-expected.txt: Added.
* http/tests/resourceLoadStatistics/non-prevalent-resources-can-access-cookies-in-a-third-party-context-database.html: Added.
* http/tests/resourceLoadStatistics/non-sandboxed-iframe-redirect-ip-to-localhost-to-ip-database-expected.txt: Added.
* http/tests/resourceLoadStatistics/non-sandboxed-iframe-redirect-ip-to-localhost-to-ip-database.html: Added.
* http/tests/resourceLoadStatistics/non-sandboxed-iframe-redirect-localhost-to-ip-to-localhost-database-expected.txt: Added.
* http/tests/resourceLoadStatistics/non-sandboxed-iframe-redirect-localhost-to-ip-to-localhost-database.html: Added.
* http/tests/resourceLoadStatistics/non-sandboxed-nesting-iframe-with-non-sandboxed-iframe-redirect-ip-to-localhost-to-ip-database-expected.txt: Added.
* http/tests/resourceLoadStatistics/non-sandboxed-nesting-iframe-with-non-sandboxed-iframe-redirect-ip-to-localhost-to-ip-database.html: Added.
* http/tests/resourceLoadStatistics/non-sandboxed-nesting-iframe-with-non-sandboxed-iframe-redirect-localhost-to-ip-to-localhost-database-expected.txt: Added.
* http/tests/resourceLoadStatistics/non-sandboxed-nesting-iframe-with-non-sandboxed-iframe-redirect-localhost-to-ip-to-localhost-database.html: Added.
* http/tests/resourceLoadStatistics/non-sandboxed-nesting-iframe-with-sandboxed-iframe-redirect-ip-to-localhost-to-ip-database-expected.txt: Added.
* http/tests/resourceLoadStatistics/non-sandboxed-nesting-iframe-with-sandboxed-iframe-redirect-ip-to-localhost-to-ip-database.html: Added.
* http/tests/resourceLoadStatistics/non-sandboxed-nesting-iframe-with-sandboxed-iframe-redirect-localhost-to-ip-to-localhost-database-expected.txt: Added.
* http/tests/resourceLoadStatistics/non-sandboxed-nesting-iframe-with-sandboxed-iframe-redirect-localhost-to-ip-to-localhost-database.html: Added.
* http/tests/resourceLoadStatistics/ping-to-prevalent-resource-database-expected.txt: Added.
* http/tests/resourceLoadStatistics/ping-to-prevalent-resource-database.html: Added.
* http/tests/resourceLoadStatistics/prevalent-resource-handled-keydown-database-expected.txt: Added.
* http/tests/resourceLoadStatistics/prevalent-resource-handled-keydown-database.html: Added.
* http/tests/resourceLoadStatistics/prevalent-resource-unhandled-keydown-database-expected.txt: Added.
* http/tests/resourceLoadStatistics/prevalent-resource-unhandled-keydown-database.html: Added.
* http/tests/resourceLoadStatistics/prevalent-resource-with-user-interaction-database-expected.txt: Added.
* http/tests/resourceLoadStatistics/prevalent-resource-with-user-interaction-database.html: Added.
* http/tests/resourceLoadStatistics/prevalent-resource-with-user-interaction-timeout-database-expected.txt: Added.
* http/tests/resourceLoadStatistics/prevalent-resource-with-user-interaction-timeout-database.html: Added.
* http/tests/resourceLoadStatistics/prevalent-resource-without-user-interaction-database-expected.txt: Added.
* http/tests/resourceLoadStatistics/prevalent-resource-without-user-interaction-database.html: Added.
* http/tests/resourceLoadStatistics/prune-statistics-database-expected.txt: Added.
* http/tests/resourceLoadStatistics/prune-statistics-database.html: Added.
* http/tests/resourceLoadStatistics/sandboxed-iframe-redirect-ip-to-localhost-to-ip-database-expected.txt: Added.
* http/tests/resourceLoadStatistics/sandboxed-iframe-redirect-ip-to-localhost-to-ip-database.html: Added.
* http/tests/resourceLoadStatistics/sandboxed-iframe-redirect-localhost-to-ip-to-localhost-database-expected.txt: Added.
* http/tests/resourceLoadStatistics/sandboxed-iframe-redirect-localhost-to-ip-to-localhost-database.html: Added.
* http/tests/resourceLoadStatistics/sandboxed-nesting-iframe-with-non-sandboxed-iframe-redirect-ip-to-localhost-to-ip-database-expected.txt: Added.
* http/tests/resourceLoadStatistics/sandboxed-nesting-iframe-with-non-sandboxed-iframe-redirect-ip-to-localhost-to-ip-database.html: Added.
* http/tests/resourceLoadStatistics/sandboxed-nesting-iframe-with-non-sandboxed-iframe-redirect-localhost-to-ip-to-localhost-database-expected.txt: Added.
* http/tests/resourceLoadStatistics/sandboxed-nesting-iframe-with-non-sandboxed-iframe-redirect-localhost-to-ip-to-localhost-database.html: Added.
* http/tests/resourceLoadStatistics/sandboxed-nesting-iframe-with-sandboxed-iframe-redirect-ip-to-localhost-to-ip-database-expected.txt: Added.
* http/tests/resourceLoadStatistics/sandboxed-nesting-iframe-with-sandboxed-iframe-redirect-ip-to-localhost-to-ip-database.html: Added.
* http/tests/resourceLoadStatistics/sandboxed-nesting-iframe-with-sandboxed-iframe-redirect-localhost-to-ip-to-localhost-database-expected.txt: Added.
* http/tests/resourceLoadStatistics/sandboxed-nesting-iframe-with-sandboxed-iframe-redirect-localhost-to-ip-to-localhost-database.html: Added.
* http/tests/resourceLoadStatistics/set-custom-prevalent-resource-in-debug-mode-database-expected.txt: Added.
* http/tests/resourceLoadStatistics/set-custom-prevalent-resource-in-debug-mode-database.html: Added.
* http/tests/resourceLoadStatistics/strip-referrer-to-origin-for-prevalent-subresource-redirects-database-expected.txt: Added.
* http/tests/resourceLoadStatistics/strip-referrer-to-origin-for-prevalent-subresource-redirects-database.html: Added.
* http/tests/resourceLoadStatistics/strip-referrer-to-origin-for-prevalent-subresource-requests-database-expected.txt: Added.
* http/tests/resourceLoadStatistics/strip-referrer-to-origin-for-prevalent-subresource-requests-database.html: Added.
* http/tests/resourceLoadStatistics/switch-session-on-navigation-to-prevalent-with-interaction-database-expected.txt: Added.
* http/tests/resourceLoadStatistics/switch-session-on-navigation-to-prevalent-with-interaction-database.html: Added.
* http/tests/resourceLoadStatistics/telemetry-generation.html:
* http/tests/resourceLoadStatistics/user-interaction-in-cross-origin-sub-frame-database-expected.txt: Added.
* http/tests/resourceLoadStatistics/user-interaction-in-cross-origin-sub-frame-database.html: Added.
* http/tests/resourceLoadStatistics/user-interaction-only-reported-once-within-short-period-of-time-database-expected.txt: Added.
* http/tests/resourceLoadStatistics/user-interaction-only-reported-once-within-short-period-of-time-database.html: Added.
* http/tests/resourceLoadStatistics/user-interaction-reported-after-website-data-removal-database-expected.txt: Added.
* http/tests/resourceLoadStatistics/user-interaction-reported-after-website-data-removal-database.html: Added.
* http/tests/resourceLoadStatistics/website-data-removal-for-site-navigated-to-with-link-decoration.html:
* platform/ios/TestExpectations:
Added test expectations to skip database tests which do not work in
ios because of reliance on EventSender.keydown() which is not
supported on iOS and also those which use UIHelper.activateAt() which
does not produce a user gesture captured by ITP in iOS.

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

6 months ago[iOS 13] Tapping on a non-editable text selection should toggle callout bar visibilit...
wenson_hsieh@apple.com [Thu, 26 Sep 2019 19:03:47 +0000 (19:03 +0000)]
[iOS 13] Tapping on a non-editable text selection should toggle callout bar visibility instead of clearing selection
https://bugs.webkit.org/show_bug.cgi?id=202254
<rdar://problem/54410263>

Reviewed by Megan Gardner.

Source/WebKit:

In iOS 13, tapping a text selection should toggle callout bar visibility (i.e. "selection commands" in UIKit).
This currently does not work for non-editable text, since the synthetic click gesture simultaneously fires
alongside the text interaction assistant's non-editable tap gesture, which dispatches a click to the page which
then clears the selection.

To remedy this and match platform behavior, we avoid recognizing clicks that occur over the text selection, but
only in the case where the bounding rect of the text selection doesn't cover a large portion of the visible
content rect of the web view. This ensures that the user doesn't get stuck in a state where it's impossible to
dismiss a very large text selection (e.g. after selecting all the content on the page).

Tests:  editing/selection/ios/clear-selection-after-tap-in-large-selected-non-editable-text.html
        editing/selection/ios/toggle-callout-bar-after-tap-in-selected-non-editable-text.html

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

Check the last known selection rects (on _lastSelectionDrawingInfo) to see if the tapped point lies within at
least one of the selection rects.

(-[WKContentView gestureRecognizerShouldBegin:]):

LayoutTests:

* editing/selection/ios/clear-selection-after-tap-in-large-selected-non-editable-text-expected.txt: Added.
* editing/selection/ios/clear-selection-after-tap-in-large-selected-non-editable-text.html: Added.

Add a new layout test to verify that when tapping in a text selection that encompasses the entire page, we allow
the tap to dismiss the selection instead of toggling callout bar visibility.

* editing/selection/ios/toggle-callout-bar-after-tap-in-selected-non-editable-text-expected.txt: Added.
* editing/selection/ios/toggle-callout-bar-after-tap-in-selected-non-editable-text.html: Added.

Add another layout test to verify that when tapping inside a text selection, the callout bar is toggled, and
when tapping outside the selected text, the selection is dismissed.

* resources/ui-helper.js:
(window.UIHelper.async.waitForSelectionToAppear):
(window.UIHelper.async.waitForSelectionToDisappear):

New helper methods to wait for selection rects to appear or disappear.

(window.UIHelper):

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

6 months agoTestWebKitAPI.WebKit.ReloadWithDifferingInitialScale is failing consistently
wenson_hsieh@apple.com [Thu, 26 Sep 2019 18:52:13 +0000 (18:52 +0000)]
TestWebKitAPI.WebKit.ReloadWithDifferingInitialScale is failing consistently
https://bugs.webkit.org/show_bug.cgi?id=202273

Reviewed by Aakash Jain.

The content width scaling limits added in r250361 prevent this test from scaling down the content width (2000px
wide) to fit the viewport (375px). To avoid this issue, change the content width from 2000px to 1500px, which is
still a very wide content width for a web page.

* TestWebKitAPI/Tests/WebKitCocoa/ReloadWithDifferingInitialScale.mm:

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

6 months agoUse LineLayoutTraversal for RenderText functions
antti@apple.com [Thu, 26 Sep 2019 18:25:47 +0000 (18:25 +0000)]
Use LineLayoutTraversal for RenderText functions
https://bugs.webkit.org/show_bug.cgi?id=202266

Reviewed by Zalan Bujtas.

Replace a bunch of functions that have separate simple and complex line layout versions with
shared functions that use LineLayoutTraversal.

* rendering/RenderText.cpp:
(WebCore::RenderText::absoluteRects const):
(WebCore::RenderText::firstRunLocation const):
(WebCore::RenderText::linesBoundingBox const):

This is substantially simpler than RenderTextLineBoxes::boundingBox because it uses physical rects for all computations
instead of using logical rects and flipping to physical at the end.

(WebCore::RenderText::caretMinOffset const):
(WebCore::RenderText::caretMaxOffset const):
(WebCore::RenderText::countRenderedCharacterOffsetsUntil const):
(WebCore::containsOffset):
(WebCore::RenderText::containsRenderedCharacterOffset const):
(WebCore::RenderText::containsCaretOffset const):
(WebCore::RenderText::hasRenderedText const):
* rendering/RenderTextLineBoxes.cpp:
(WebCore::RenderTextLineBoxes::boundingBox const): Deleted.
(WebCore::RenderTextLineBoxes::firstRunLocation const): Deleted.
(WebCore::RenderTextLineBoxes::hasRenderedText const): Deleted.
(WebCore::RenderTextLineBoxes::caretMinOffset const): Deleted.
(WebCore::RenderTextLineBoxes::caretMaxOffset const): Deleted.
(WebCore::RenderTextLineBoxes::containsOffset const): Deleted.
(WebCore::RenderTextLineBoxes::countCharacterOffsetsUntil const): Deleted.
(WebCore::RenderTextLineBoxes::absoluteRects const): Deleted.
* rendering/RenderTreeAsText.cpp:
(WebCore::write):
* rendering/SimpleLineLayout.cpp:
(WebCore::SimpleLineLayout::LineState::appendFragmentAndCreateRunIfNeeded):
* rendering/SimpleLineLayout.h:
(WebCore::SimpleLineLayout::Run::Run):
* rendering/SimpleLineLayoutFunctions.cpp:
(WebCore::SimpleLineLayout::computeFirstRunLocation): Deleted.
* rendering/SimpleLineLayoutFunctions.h:
(WebCore::SimpleLineLayout::findCaretMinimumOffset): Deleted.
(WebCore::SimpleLineLayout::findCaretMaximumOffset): Deleted.
(WebCore::SimpleLineLayout::containsOffset): Deleted.
(WebCore::SimpleLineLayout::isTextRendered): Deleted.
* rendering/SimpleLineLayoutResolver.h:
(WebCore::SimpleLineLayout::RunResolver::Run::isLineBreak const):
* rendering/line/LineLayoutTraversal.cpp:
(WebCore::LineLayoutTraversal::TextBox::isLineBreak const):
(WebCore::LineLayoutTraversal::firstTextBoxFor):
(WebCore::LineLayoutTraversal::firstTextBoxInTextOrderFor):
(WebCore::LineLayoutTraversal::textBoxesFor):
(WebCore::LineLayoutTraversal::firstTextBoxInVisualOrderFor): Deleted.
(WebCore::LineLayoutTraversal::textBoxRangeFor): Deleted.
* rendering/line/LineLayoutTraversal.h:
(WebCore::LineLayoutTraversal::hasTextBoxes):

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

6 months agotoExponential, toFixed, and toPrecision should allow arguments up to 100
commit-queue@webkit.org [Thu, 26 Sep 2019 18:17:52 +0000 (18:17 +0000)]
toExponential, toFixed, and toPrecision should allow arguments up to 100
https://bugs.webkit.org/show_bug.cgi?id=199163

Patch by Alexey Shvayka <shvaikalesh@gmail.com> on 2019-09-26
Reviewed by Ross Kirsling.

JSTests:

* ChakraCore/test/Number/toString_3.baseline-jsc:
* ChakraCore/test/es5/exceptions3.baseline-jsc:
* test262/expectations.yaml: Mark 6 test cases as passing.

Source/JavaScriptCore:

Previously, the spec gave fixed range of [0,20] for Number.prototype.{toExponential,toFixed} argument and
range of [1,21] for Number.prototype.toPrecision argument, but allowed implementations to permit a larger range.
Historically, only SpiderMonkey accepted a larger range, and other implementations threw a RangeError outside the range.
Later the spec was changed (see https://github.com/tc39/ecma262/pull/857) to specify the SpiderMonkey behavior.

* runtime/NumberPrototype.cpp:
(JSC::numberProtoFuncToExponential): Accept arguments between 0 and 100.
(JSC::numberProtoFuncToFixed): Accept arguments between 0 and 100.
(JSC::numberProtoFuncToPrecision): Accept arguments between 1 and 100.
(JSC::getIntegerArgumentInRange): Inline to improve readability.

Source/WTF:

Increase size of NumberToStringBuffer: <21 digits> + decimal point + <100 digits> + null char = 123.
Increase kMaxFixedDigitsAfterPoint to make Number.prototype.toFixed work with arguments up to 100.
Also update other constants to their correct values.

* wtf/dtoa.h:
* wtf/dtoa/double-conversion.cc:
* wtf/dtoa/double-conversion.h:

Tools:

Adjust StringNumberFixedWidth test due to lowering kMaxFixedDigitsBeforePoint.

* TestWebKitAPI/Tests/WTF/WTFString.cpp:

LayoutTests:

* js/dom/number-tofixed-expected.txt:
* js/dom/number-toprecision-expected.txt:
* js/dom/script-tests/number-tofixed.js:
* js/dom/script-tests/number-toprecision.js:
* js/kde/Number-expected.txt:
* js/kde/script-tests/Number.js:
* js/number-toExponential-expected.txt:
* js/script-tests/number-toExponential.js:

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

6 months ago[GTK] Fix logic of dark theme detection
pgriffis@igalia.com [Thu, 26 Sep 2019 18:04:31 +0000 (18:04 +0000)]
[GTK] Fix logic of dark theme detection
https://bugs.webkit.org/show_bug.cgi?id=202276

- If GTK_THEME is set it has a higher priority to GtkSettings.
- GTK_THEME may be a -dark theme or :dark variant, handle both.

Reviewed by Michael Catanzaro.

* UIProcess/API/gtk/PageClientImpl.cpp:
(WebKit::PageClientImpl::effectiveAppearanceIsDark const):

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

6 months agoLayout Test platform/ios/ios/fast/text/opticalFont.html is Failing on iOS13.
russell_e@apple.com [Thu, 26 Sep 2019 17:59:49 +0000 (17:59 +0000)]
Layout Test platform/ios/ios/fast/text/opticalFont.html is Failing on iOS13.
https://bugs.webkit.org/show_bug.cgi?id=202278

Unreviewed Test Gardening.

* platform/ios/ios/fast/text/opticalFont-expected.txt: Removed.
* platform/ios/platform/ios/ios/fast/text/opticalFont-expected.txt:
Rebaselined for iOS 13.

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

6 months agoUnreviewed, rolling out r250381.
tsavell@apple.com [Thu, 26 Sep 2019 17:49:47 +0000 (17:49 +0000)]
Unreviewed, rolling out r250381.

broke multiple webgpu/ tests on Mojave WK2

Reverted changeset:

"Flaky Test: inspector/canvas/updateShader.html"
https://bugs.webkit.org/show_bug.cgi?id=202186
https://trac.webkit.org/changeset/250381

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

6 months agoNon-callable "handleEvent" property is silently ignored
commit-queue@webkit.org [Thu, 26 Sep 2019 17:43:24 +0000 (17:43 +0000)]
Non-callable "handleEvent" property is silently ignored
https://bugs.webkit.org/show_bug.cgi?id=200066

Patch by Alexey Shvayka <shvaikalesh@gmail.com> on 2019-09-26
Reviewed by Darin Adler.

LayoutTests/imported/w3c:

* web-platform-tests/IndexedDB/fire-error-event-exception-expected.txt:
* web-platform-tests/IndexedDB/fire-success-event-exception-expected.txt:
* web-platform-tests/IndexedDB/fire-upgradeneeded-event-exception-expected.txt:
* web-platform-tests/dom/events/EventListener-handleEvent-expected.txt:

Source/WebCore:

Tests: imported/w3c/web-platform-tests/IndexedDB/fire-error-event-exception.html
       imported/w3c/web-platform-tests/IndexedDB/fire-success-event-exception.html
       imported/w3c/web-platform-tests/IndexedDB/fire-upgradeneeded-event-exception.html
       imported/w3c/web-platform-tests/dom/events/EventListener-handleEvent.html

* bindings/js/JSEventListener.cpp:
(WebCore::JSEventListener::handleEvent): Report TypeError if "handleEvent" is not callable.

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

6 months ago[LFC][IFC] Decouple Display::Run and Display::Box initializations.
zalan@apple.com [Thu, 26 Sep 2019 15:44:33 +0000 (15:44 +0000)]
[LFC][IFC] Decouple Display::Run and Display::Box initializations.
https://bugs.webkit.org/show_bug.cgi?id=202255
<rdar://problem/55731445>

Reviewed by Antti Koivisto.

This is in preparation for moving Display::Run initialization to Line class.

* layout/inlineformatting/InlineFormattingContextLineLayout.cpp:
(WebCore::Layout::InlineFormattingContext::InlineLayout::createDisplayRuns):

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

6 months agoWe need to initialize the Gigacage first in setJITEnabled() when disabling the JIT.
mark.lam@apple.com [Thu, 26 Sep 2019 15:07:17 +0000 (15:07 +0000)]
We need to initialize the Gigacage first in setJITEnabled() when disabling the JIT.
https://bugs.webkit.org/show_bug.cgi?id=202257

Reviewed by Saam Barati.

Because of an OS quirk, even after the JIT region has been unmapped, the OS thinks
that region is reserved, and as such, can cause Gigacage allocation to fail.  We
work around this by initializing the Gigacage first.

Note: when called, setJITEnabled() is always called extra early in the process
bootstrap.  Under normal operation (when setJITEnabled() isn't called at all), we
will naturally initialize the Gigacage before we allocate the JIT region.
Hence, this workaround is merely ensuring the same behavior of allocation ordering.

This patch only applies to iOS.

* jit/ExecutableAllocator.cpp:
(JSC::ExecutableAllocator::setJITEnabled):

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

6 months agoTestWebKitAPI.SOAuthorizationSubFrame.AuthorizationOptions is failing consistently...
jiewen_tan@apple.com [Thu, 26 Sep 2019 09:48:28 +0000 (09:48 +0000)]
TestWebKitAPI.SOAuthorizationSubFrame.AuthorizationOptions is failing consistently on iOS API tests EWS
https://bugs.webkit.org/show_bug.cgi?id=202249

Reviewed by Alex Christensen.

Swizzles +[AKAuthorizationController isURLFromAppleOwnedDomain:] following other tests.

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

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

6 months agoFlaky Test: inspector/canvas/updateShader.html
drousso@apple.com [Thu, 26 Sep 2019 08:33:35 +0000 (08:33 +0000)]
Flaky Test: inspector/canvas/updateShader.html
https://bugs.webkit.org/show_bug.cgi?id=202186
<rdar://problem/55716053>

Reviewed by Joseph Pecoraro.

If the `WebGPUPipeline`/`WebGLProgram` outlives it's `WebGPUDevice`/`WebGLRenderingContext`,
the `ScriptExecutionContext*` that was provided in the constructor won't be invalidated
leading to the bad access crash.

Rather than pass the `ScriptExecutionContext*` directly, have `WebGPUPipeline`/`WebGLProgram`
extend from `ContextDestructionObserver` so that it can propertly invalidate (and notify Web
Inspector) when the related context is about to be destroyed.

Test: inspector/canvas/updateShader.html

* Modules/webgpu/WebGPUPipeline.h:
(WebCore::WebGPUPipeline::scriptExecutionContext const): Deleted.
* Modules/webgpu/WebGPUPipeline.cpp:
(WebCore::WebGPUPipeline::WebGPUPipeline):
(WebCore::WebGPUPipeline::contextDestroyed): Added.

* html/canvas/WebGLProgram.h:
(WebCore::WebGLProgram::scriptExecutionContext const): Deleted.
* html/canvas/WebGLProgram.cpp:
(WebCore::WebGLProgram::WebGLProgram):
(WebCore::WebGLProgram::contextDestroyed): Added.

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

6 months agoAddress static analysis warning in UTextProviderLatin1.cpp: Array access results...
krollin@apple.com [Thu, 26 Sep 2019 06:41:14 +0000 (06:41 +0000)]
Address static analysis warning in UTextProviderLatin1.cpp: Array access results in a null pointer dereference
https://bugs.webkit.org/show_bug.cgi?id=202155
<rdar://problem/55672422>

Reviewed by Geoffrey Garen.

Xcode's static analysis reports:

    .../OpenSource/Source/WTF/wtf/text/icu/UTextProviderLatin1.cpp:185:22: warning: Array access (from variable 'dest') results in a null pointer dereference
            dest[length] = 0;
            ~~~~         ^

This error is due to an earlier "if" statement that caused the static
analyzer to infer that "dest" could be NULL. It turns out that that
previous check was in error, in that it tested for "!dest" when it
should have tested for "dest". So this patch fixes that.

Even with that error fixed, the static analyzer will still infer that
"dest" could be NULL at the point shown above. Therefore, add a "dest"
test just before the assignment.

* wtf/text/icu/UTextProviderLatin1.cpp:
(WTF::uTextLatin1Extract):

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

6 months agoAdd very basic PageCache support for RTCPeerConnection
cdumez@apple.com [Thu, 26 Sep 2019 05:32:00 +0000 (05:32 +0000)]
Add very basic PageCache support for RTCPeerConnection
https://bugs.webkit.org/show_bug.cgi?id=202244

Reviewed by Geoffrey Garen.

Source/WebCore:

RTCPeerConnection::canSuspendForDocumentSuspension() returns true if
RTCPeerConnection::hasPendingActivity() return false. Previously, hasPendingActivity()
would return true unless the JS has called close() on the RTCPeerConnection
object.

On weather.com, an ad would construct an RTCPeerConnection just to do some feature
checking and then let the variable go out of scope (without calling close()). Because
of the previous implementation of RTCPeerConnection::hasPendingActivity(), this wrapper
and its implementation object would stay alive forever AND prevent the page from
entering PageCache on navigation.

To improve this, the implementation of hadPendingActivity() has been updated so that
it keeps returning false if close() has been called, but will also return false if
there are no pending Promises to be resolved and no event listeners.

Test: fast/mediastream/RTCPeerConnection-page-cache.html

* Modules/mediastream/RTCPeerConnection.cpp:
WebCore::RTCPeerConnection::RTCPeerConnection:
Stop taking a pending activity in the constructor, this would be NOT keep the wrapper
alive since RTCPeerConnection::hasPendingActivity() was not checking
ActiveDOMObject::hasPendingActivity().

(WebCore::RTCPeerConnection::canSuspendForDocumentSuspension const):
(WebCore::RTCPeerConnection::hasPendingActivity const):

* Modules/mediastream/RTCPeerConnection.h:

* bindings/js/JSDOMPromiseDeferred.h:
(WebCore::DOMPromiseDeferredBase::whenSettled):

LayoutTests:

Add layout test coverage.

* fast/mediastream/RTCPeerConnection-page-cache-expected.txt: Added.
* fast/mediastream/RTCPeerConnection-page-cache.html: Added.

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

6 months agoImprove Service worker support for Page Caching
cdumez@apple.com [Thu, 26 Sep 2019 04:30:39 +0000 (04:30 +0000)]
Improve Service worker support for Page Caching
https://bugs.webkit.org/show_bug.cgi?id=202221

Reviewed by Geoffrey Garen.

Source/WebCore:

Allow pages using service workers to enter the back / forward cache.
Update ServiceWorkerRegistration / ServiceWorker ActiveDOMObjects
to properly suspend while in PageCache. Also, let documents controlled
by a service worker to enter PageCache (we already unregistered it as
a client of the service worker while suspended).

Test: http/tests/workers/service/page-caching.html

* dom/Document.cpp:
(WebCore::Document::suspend):
(WebCore::Document::resume):
* history/PageCache.cpp:
(WebCore::canCacheFrame):
* workers/service/ServiceWorker.cpp:
(WebCore::ServiceWorker::updateState):
(WebCore::ServiceWorker::canSuspendForDocumentSuspension const):
(WebCore::ServiceWorker::suspend):
(WebCore::ServiceWorker::resume):
* workers/service/ServiceWorker.h:
* workers/service/ServiceWorkerRegistration.cpp:
(WebCore::ServiceWorkerRegistration::fireUpdateFoundEvent):
(WebCore::ServiceWorkerRegistration::canSuspendForDocumentSuspension const):
(WebCore::ServiceWorkerRegistration::suspend):
(WebCore::ServiceWorkerRegistration::resume):
* workers/service/ServiceWorkerRegistration.h:

LayoutTests:

Add layout test coverage.

* http/tests/workers/service/no-page-cache-when-controlled-expected.txt: Removed.
* http/tests/workers/service/page-caching-expected.txt: Added.
* http/tests/workers/service/page-caching.html: Renamed from LayoutTests/http/tests/workers/service/no-page-cache-when-controlled.html.

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

6 months agoAdd replacement SPI on _WKWebsiteDataStoreConfiguration for enabling speculative...
achristensen@apple.com [Thu, 26 Sep 2019 04:24:23 +0000 (04:24 +0000)]
Add replacement SPI on _WKWebsiteDataStoreConfiguration for enabling speculative cache validation and IPC-free server trust evaluation
https://bugs.webkit.org/show_bug.cgi?id=202251

Reviewed by Tim Horton.

Source/WebKit:

These are two performance optimizations that are currently per-ProcessPool that need to be per-WebsiteDataStore.
This makes replacement SPI and deprecates the old SPI.  I'm going to adopt the new SPI then remove the old SPI.

* NetworkProcess/NetworkSession.cpp:
(WebKit::NetworkSession::NetworkSession):
* NetworkProcess/NetworkSessionCreationParameters.cpp:
(WebKit::NetworkSessionCreationParameters::encode const):
(WebKit::NetworkSessionCreationParameters::decode):
* NetworkProcess/NetworkSessionCreationParameters.h:
* NetworkProcess/cocoa/NetworkSessionCocoa.h:
* NetworkProcess/cocoa/NetworkSessionCocoa.mm:
(-[WKNetworkSessionDelegate URLSession:task:didReceiveChallenge:completionHandler:]):
(WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
* UIProcess/API/C/WKContextPrivate.h:
* UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
* UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
* UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.h:
* UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.mm:
(-[_WKWebsiteDataStoreConfiguration networkCacheSpeculativeValidationEnabled]):
(-[_WKWebsiteDataStoreConfiguration setNetworkCacheSpeculativeValidationEnabled:]):
(-[_WKWebsiteDataStoreConfiguration fastServerTrustEvaluationEnabled]):
(-[_WKWebsiteDataStoreConfiguration setFastServerTrustEvaluationEnabled:]):
* UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
(WebKit::WebsiteDataStore::parameters):
* UIProcess/WebsiteData/WebsiteDataStoreConfiguration.cpp:
(WebKit::WebsiteDataStoreConfiguration::copy):
* UIProcess/WebsiteData/WebsiteDataStoreConfiguration.h:
(WebKit::WebsiteDataStoreConfiguration::fastServerTrustEvaluationEnabled const):
(WebKit::WebsiteDataStoreConfiguration::setFastServerTrustEvaluationEnabled):
(WebKit::WebsiteDataStoreConfiguration::networkCacheSpeculativeValidationEnabled const):
(WebKit::WebsiteDataStoreConfiguration::setNetworkCacheSpeculativeValidationEnabled):

Tools:

Adopt new SPI instead of deprecated SPI.

* MiniBrowser/mac/AppDelegate.m:
(persistentDataStore):
(defaultConfiguration):
(-[BrowserAppDelegate fetchDefaultStoreWebsiteData:]):
(-[BrowserAppDelegate fetchAndClearDefaultStoreWebsiteData:]):
(-[BrowserAppDelegate clearDefaultStoreWebsiteData:]):

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

6 months agoWeb Inspector: REGRESSION: Elements detail sidebar sometimes starts collapsed
pecoraro@apple.com [Thu, 26 Sep 2019 04:19:11 +0000 (04:19 +0000)]
Web Inspector: REGRESSION: Elements detail sidebar sometimes starts collapsed
https://bugs.webkit.org/show_bug.cgi?id=202057
<rdar://problem/55572345>

Reviewed by Devin Rousso.

* UserInterface/Views/ElementsTabContentView.js:
(WI.ElementsTabContentView.prototype.get detailsSidebarExpandedByDefault):
Default the Elements tab detail sidebar to be shown, not collapsed.

* UserInterface/Views/TabContentView.js:
(WI.TabContentView):
(WI.TabContentView.prototype.get detailsSidebarExpandedByDefault):
Allow classes to specify whether or not their detail sidebar should
be expanded by default.

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

6 months agoPython 3: Add support in webkitpy.common.system
jbedard@apple.com [Thu, 26 Sep 2019 02:01:53 +0000 (02:01 +0000)]
Python 3: Add support in webkitpy.common.system
https://bugs.webkit.org/show_bug.cgi?id=201826
<rdar://problem/55452671>

Reviewed by Stephanie Lewis.

Tested compatibility by running 'python3 -m unittest webkitpy.common.system.<_unittest>' on
each of the effected files.

* Scripts/webkitpy/common/checkout/changelog.py: Import StringIO from io module.
(set_reviewer):
(set_short_description_and_bug_url):
* Scripts/webkitpy/common/checkout/checkout.py:  Import StringIO from io module.
(Checkout._latest_entry_for_changelog_at_revision):
* Scripts/webkitpy/common/config/committers.py:
(CommitterList.load_json): iteritems -> items.
* Scripts/webkitpy/common/net/networktransaction.py:
(NetworkTransaction.run): urllib2 is urllib in Python3.
* Scripts/webkitpy/common/system/abstractexecutive.py:
(AbstractExecutive._stringify_args):
(AbstractExecutive.command_for_printing): The str type is unicode in Python3.
* Scripts/webkitpy/common/system/crashlogs_unittest.py: Explicitly encode and decode binary crashlogs.
* Scripts/webkitpy/common/system/environment_unittest.py: Use absolute imports.
* Scripts/webkitpy/common/system/executive.py:
(ScriptError.message_with_output): The str type is unicode in Python3.
(Executive.WrappedPopen): Python3's Popen object is a context manager. To allow us to use it as one,
our Python2 Popen needs to be one as well.
(Executive.WrappedPopen.__init__):
(Executive.WrappedPopen.__enter__):
(Executive.WrappedPopen.__exit__):
(Executive._run_command_with_teed_output): Simplify loop, decode unicode strings.
(Executive.run_and_throw_if_fail): The child output file should not be unicode strings.
(Executive.running_pids): Use the Popen context manager to guarantee clean-up.
(Executive._compute_stdin):
(Executive.run_command): Use the Popen context manager to guarantee clean-up.
(Executive._stringify_args): The str type is unicode in Python3.
(Executive.popen): Return a context manager if the Popen object is not one.
* Scripts/webkitpy/common/system/executive_mock.py:
(MockProcess.__init__): StringIO -> BytesIO.
(MockProcess.__enter__):
(MockProcess):
(MockProcess.__exit__):
* Scripts/webkitpy/common/system/executive_unittest.py:
(ExecutiveTest.test_auto_stringify_args): Use the Popen context manager to guarantee clean-up.
(ExecutiveTest.test_popen_args): Ditto.
(ExecutiveTest.serial_test_kill_process): Ditto.
(ExecutiveTest.serial_test_kill_all): Ditto.
* Scripts/webkitpy/common/system/filesystem.py:
(FileSystem.read_binary_file): Use 'open' instead of 'file'.
(FileSystem.write_binary_file): Ditto.
(FileSystem.write_text_file): The str type is unicode in Python3.
(FileSystem.relpath):
(FileSystem.remove): The WindowsError is just anther OSError in Python3.
(FileSystem._WindowsError): Deleted.
* Scripts/webkitpy/common/system/filesystem_mock.py:
(MockFileSystem.glob): filter returns a generator instead of a list.
(WritableBinaryFileObject.__init__): Binary files are comprised of bytes, not string in Python3.
(WritableBinaryFileObject.write): Ditto.
(ReadableTextFileObject.__init__): Ditto.
* Scripts/webkitpy/common/system/filesystem_mock_unittest.py:
(MockFileSystemTest.test_normpath):
(MockFileSystemTest.test_dirs_under): assertEquals -> assertEqual.
* Scripts/webkitpy/common/system/filesystem_unittest.py:
(RealFileSystemTest.test_read_and_write_file): Explicitly define byte arrays instead of strings.
(RealFileSystemTest.test_remove_file_with_retry.remove_with_exception): The WindowsError is just
anther OSError in Python3.
* Scripts/webkitpy/common/system/outputcapture.py:
* Scripts/webkitpy/common/system/outputtee_unittest.py:
(SimpleTeeTest.test_simple_tee):
* Scripts/webkitpy/common/system/path.py:
(_escape): urllib library has been broken into parts.
* Scripts/webkitpy/common/system/pemfile.py:
(_parse_pem_format.find_end): Python3 does not define a maxint.
* Scripts/webkitpy/common/system/pemfile_unittest.py:
* Scripts/webkitpy/common/system/platforminfo.py:
(PlatformInfo.total_bytes_memory): Not 'long' type in Python3.
* Scripts/webkitpy/common/system/platforminfo_unittest.py:
(TestPlatformInfo.test_real_code): assertNotEquals -> assertNotEqual.
(TestPlatformInfo.test_display_name): Ditto.
* Scripts/webkitpy/common/system/profiler.py:
(ProfilerFactory.create_profiler): Manually implement ifilter.
* Scripts/webkitpy/common/system/profiler_unittest.py: Use absolute imports.
* Scripts/webkitpy/common/system/stack_utils_unittest.py:
(current_thread_id): items() returns a generator in Python3.
* Scripts/webkitpy/common/system/systemhost.py: Use absolute imports.
* Scripts/webkitpy/common/system/urlfetcher.py: Removed.
* Scripts/webkitpy/common/system/urlfetcher_mock.py: Removed.
* Scripts/webkitpy/common/system/user.py:
(User.prompt): Use absolute imports, raw_input -> input.
(User.prompt_with_multiple_lists):
(User.prompt_with_list):
(User.confirm):
* Scripts/webkitpy/common/unicode.py: Tooling to manage compatibility between Python 2
and Python 3 unicode handling.
* Scripts/webkitpy/common/system/user_mock.py:
(MockUser.prompt): raw_input -> input.
(MockUser.prompt_with_list): Ditto.
* Scripts/webkitpy/common/version.py:
(Version.from_iterable): xrange -> range.
(Version.from_name): Use absolute import path.
(Version.__contains__): xrange -> range.
(Version.__str__): xrange -> range.
(Version.__cmp__): amp is no longer an operator in Python3, but versions are comprised
Of integers, so subtraction has the same effect.
(Version):
(Version.__eq__): __cmp__ operator is no longer respected, so we need to implement
each comparison.
(Version.__ne__): Ditto.
(Version.__lt__): Ditto.
(Version.__le__): Ditto.
(Version.__gt__): Ditto.
(Version.__ge__): Ditto.
* Scripts/webkitpy/common/version_name_map.py:
(VersionNameMap._automap_to_major_version):
(VersionNameMap.to_name): xrange -> range.
(VersionNameMap.from_name): iteritems -> items.
* Scripts/webkitpy/common/version_name_map_unittest.py: Use absolute imports.
* Scripts/webkitpy/common/version_unittest.py: Ditto.
* Scripts/webkitpy/common/wavediff.py:
(WaveDiff.__init__): StringIO -> BytesIO.
* Scripts/webkitpy/port/__init__.py:
(outside):

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

6 months agoUnreviewed build fix for Windows ports.
Hironori.Fujii@sony.com [Thu, 26 Sep 2019 01:43:47 +0000 (01:43 +0000)]
Unreviewed build fix for Windows ports.
https://bugs.webkit.org/show_bug.cgi?id=202125
<rdar://problem/14944104>

* WebCoreSupport/WebEditorClient.h: Added missing subFrameScrollPositionChanged.

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

6 months agoFix failing layout tests after trac.webkit.org/r250183
wenson_hsieh@apple.com [Thu, 26 Sep 2019 00:57:13 +0000 (00:57 +0000)]
Fix failing layout tests after trac.webkit.org/r250183
https://bugs.webkit.org/show_bug.cgi?id=202053
<rdar://problem/54542190>

Reviewed by Tim Horton.

Followup to r250183: move the implementation of -gestureRecognizer:shouldReceiveTouch: out of
ENABLE(TOUCH_EVENTS) and into ENABLE(POINTER_EVENTS) instead. This logic is necessary in order for scrolling
via pan gestures to work on iOS, in the case where ENABLE(POINTER_EVENTS) is on but ENABLE(TOUCH_EVENTS) is off.
This is because the new swipe gesture recognizers added in r250183 will otherwise always take priority over the
scroll view's pan gestures.

Fixes the following layout tests:
- fast/scrolling/ios/reconcile-layer-position-recursive.html
- fast/scrolling/ios/click-events-during-momentum-scroll-in-main-frame.html
- fast/scrolling/ios/click-events-after-long-press-during-momentum-scroll-in-main-frame.html

* UIProcess/ios/WKContentViewInteraction.mm:

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

6 months agoWeb Inspector: Uncaught Exception: TypeError: undefined is not an object (evaluating...
drousso@apple.com [Thu, 26 Sep 2019 00:44:32 +0000 (00:44 +0000)]
Web Inspector: Uncaught Exception: TypeError: undefined is not an object (evaluating 'WI.showDebugUISetting.addEventListener')
https://bugs.webkit.org/show_bug.cgi?id=202220

Reviewed by Joseph Pecoraro.

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

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

6 months agoVersioning.
alancoon@apple.com [Thu, 26 Sep 2019 00:29:59 +0000 (00:29 +0000)]
Versioning.

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

6 months ago[Cocoa] Regression(r212041) Safari adds a .dms extension automatically when downloadi...
cdumez@apple.com [Wed, 25 Sep 2019 23:47:47 +0000 (23:47 +0000)]
[Cocoa] Regression(r212041) Safari adds a .dms extension automatically when downloading binaries with no extension
https://bugs.webkit.org/show_bug.cgi?id=202147
<rdar://problem/54886021>

Reviewed by Alexey Proskuryakov.

Source/WebCore:

When getting a suggested filename without extension (either from Content-Disposition header or from the download
attribute), we determine a suitable file extension based on the Content-Type header and append it. This is useful
since a lot of operating systems (such as macOS) rely on the file extension to determine file type.

The issue is that if the Content-Type is not provided or when it is provided but is "application/octet-stream",
we would append a .dms extension, which was unexpected. This patch makes it so that we no longer try to append
an extension when the resolved content type is "application/octet-stream".

Tests: http/tests/download/anchor-download-attribute-content-disposition-no-extension-octet-stream.html
       http/tests/download/anchor-download-attribute-content-disposition-no-extension-text-plain.html
       http/tests/security/anchor-download-octet-stream-no-extension.html

* platform/MIMETypeRegistry.cpp:
(WebCore::MIMETypeRegistry::appendFileExtensionIfNecessary):

LayoutTests:

Add layout test coverage.

* http/tests/download/anchor-download-attribute-content-disposition-no-extension-octet-stream-expected.txt: Added.
* http/tests/download/anchor-download-attribute-content-disposition-no-extension-octet-stream.html: Added.
* http/tests/download/anchor-download-attribute-content-disposition-no-extension-text-plain-expected.txt: Added.
* http/tests/download/anchor-download-attribute-content-disposition-no-extension-text-plain.html: Added.
* http/tests/download/resources/content-disposition-pass-no-extension-octet-stream.php: Added.
* http/tests/download/resources/content-disposition-pass-no-extension-text-plain.php: Added.
* http/tests/security/anchor-download-octet-stream-no-extension-expected.txt: Added.
* http/tests/security/anchor-download-octet-stream-no-extension.html: Added.
* platform/mac-wk1/TestExpectations:
* platform/win/TestExpectations:

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

6 months agoUpdate selections after scrolling for iframes and hide selections while iframes and...
megan_gardner@apple.com [Wed, 25 Sep 2019 22:54:16 +0000 (22:54 +0000)]
Update selections after scrolling for iframes and hide selections while iframes and overflow scrolls are scrolling.
https://bugs.webkit.org/show_bug.cgi?id=202125

Reviewed by Tim Horton.

Source/WebCore:

Test: editing/selection/ios/update-selection-after-iframe-scroll.html

When we end scrolling, make sure that iframes get a final update to ensure that the
selection is in the correct position. Pipe that to WebKit/UIProcess via
frame specific plath.

* loader/EmptyClients.cpp:
* page/EditorClient.h:
* page/scrolling/AsyncScrollingCoordinator.cpp:
(WebCore::AsyncScrollingCoordinator::updateScrollPositionAfterAsyncScroll):

Source/WebKit:

Add additional calls into UIKit differentiate between main frame scrolling and overflow/iframe scrolling.
Add piping for iframe specific scrolling.

* Platform/spi/ios/UIKitSPI.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _willStartScrollingOrZooming]):
(-[WKContentView _didEndScrollingOrZooming]):
* WebProcess/WebCoreSupport/WebEditorClient.cpp:
(WebKit::WebEditorClient::subFrameScrollPositionChanged):
* WebProcess/WebCoreSupport/WebEditorClient.h:
* WebProcess/WebCoreSupport/ios/WebEditorClientIOS.mm:
(WebKit::WebEditorClient::subFrameScrollPositionChanged):

Source/WebKitLegacy/mac:

Filling out unused functions needed for new fix.

* WebCoreSupport/WebEditorClient.h:

LayoutTests:

Test that an iframe selection is updated after a scroll is completed.

* editing/selection/ios/update-selection-after-iframe-scroll-expected.txt: Added.
* editing/selection/ios/update-selection-after-iframe-scroll.html: Added.

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

6 months ago[GTK] Unreviewed test gardening
aboya@igalia.com [Wed, 25 Sep 2019 22:46:03 +0000 (22:46 +0000)]
[GTK] Unreviewed test gardening
https://bugs.webkit.org/show_bug.cgi?id=202246

* platform/gtk/TestExpectations:

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

6 months agoPage temporarily jumps to an excessively small viewport scale while loading usatoday.com
wenson_hsieh@apple.com [Wed, 25 Sep 2019 22:30:55 +0000 (22:30 +0000)]
Page temporarily jumps to an excessively small viewport scale while loading usatoday.com
https://bugs.webkit.org/show_bug.cgi?id=202224
<rdar://problem/52906640>

Reviewed by Tim Horton.

Source/WebCore:

On some pages (e.g. usatoday.com), the content width of the page temporarily becomes very large during page
load. This causes a couple of viewport scaling behaviors (notably, the existing shrink-to-fit heuristic in
ViewportConfiguration::initialScaleFromSize, as well as the new iPad-specific content-aware shrink-to-fit
heuristic in WebPage::immediatelyShrinkToFitContent) to cause the page to shrink down excessively in an attempt
to fit all the content to the viewport. This causes a very ugly flash as the page appears zoomed out initially
during page load, before zooming back in.

To fix this, we add some sanity checks to these viewport scaling heuristics. In ViewportConfiguration's
initialScaleFromSize method, in the codepath where an initial scale is not specified, we always scale to fit the
contents of the page; instead, detect the case where the content width is enormous (with a threshold arbitrarily
chosen to be 1920) and fall back to the scaling to fit the viewport's width, if such a width has been explicitly
set. This ensures that we avoid excessive shrinking in the case where content is extremely wide, but also that
we do scale the viewport down to fit all the content in the case where the content isn't extremely wide (e.g. on
daringfireball.com).

See WebKit ChangeLog for more detail.

Test: fast/viewport/ios/shrink-to-fit-large-content-width.html

* page/ViewportConfiguration.cpp:
(WebCore::ViewportConfiguration::initialScaleFromSize const):

Source/WebKit:

Tweaks the content-aware shrink-to-fit algorithm to bail in the case where the content width is extremely large,
such that it bails instead of attempting to fit the entire content of the page. See WebCore ChangeLog for more
details.

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

LayoutTests:

Adds a new layout test to verify that when the content width of the page is excessively large and an explicit
viewport width is specified, we don't attempt to zoom out to fit the larger content width, and instead zoom to
fit the explicit viewport width.

* fast/viewport/ios/shrink-to-fit-large-content-width-expected.txt: Added.
* fast/viewport/ios/shrink-to-fit-large-content-width.html: Added.

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

6 months agoAdjust tap position to avoid double-tap issue across tests.
zalan@apple.com [Wed, 25 Sep 2019 21:45:28 +0000 (21:45 +0000)]
Adjust tap position to avoid double-tap issue across tests.

Unreviewed test gardening.

* fast/events/touch/ios/double-tap-for-two-clicks3.html:

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

6 months ago[EWS] RunJavaScriptCoreTestsToT should use the same command as RunJavaScriptCoreTests
aakash_jain@apple.com [Wed, 25 Sep 2019 21:12:04 +0000 (21:12 +0000)]
[EWS] RunJavaScriptCoreTestsToT should use the same command as RunJavaScriptCoreTests
https://bugs.webkit.org/show_bug.cgi?id=202216

Reviewed by Jonathan Bedard.

* BuildSlaveSupport/ews-build/steps.py:
(RunJavaScriptCoreTestsToT): Removed the command so as to use the command from base class.
* BuildSlaveSupport/ews-build/steps_unittest.py: Updatd unit-tests.

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

6 months ago[ews] JSC queues should run or skip tests based on runTests key from config.json
aakash_jain@apple.com [Wed, 25 Sep 2019 20:56:16 +0000 (20:56 +0000)]
[ews] JSC queues should run or skip tests based on runTests key from config.json
https://bugs.webkit.org/show_bug.cgi?id=202223

Reviewed by Jonathan Bedard.

* BuildSlaveSupport/ews-build/config.json: Added the runTests key.
* BuildSlaveSupport/ews-build/factories.py:
(JSCTestsFactory.__init__): Add RunJavaScriptCoreTests step based on runTests key.
* BuildSlaveSupport/ews-build/loadConfig.py:
(loadBuilderConfig): Pass the runTests key to the factory.
* BuildSlaveSupport/ews-build/loadConfig_unittest.py:
(ConfigDotJSONTest.test_builder_keys): Added the runTests key.

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

6 months agoresults.webkit.org: Add investigation drawer
jbedard@apple.com [Wed, 25 Sep 2019 20:27:35 +0000 (20:27 +0000)]
results.webkit.org: Add investigation drawer
https://bugs.webkit.org/show_bug.cgi?id=202106

Reviewed by Dewei Zhu.

* resultsdbpy/resultsdbpy/view/static/js/drawer.js: Support multiple 'main' classes.
* resultsdbpy/resultsdbpy/view/static/js/expectations.js: Added.
(Expectations.colorMap): Return a dictionary mapping type strings to colors.
(Expectations.stringToStateId): Map a string to a state ID for sorting.
(Expectations.typeForId): Return a type string given an ID.
(Expectations.symbolForId): Return a symbol for a type given an ID.
(Expectations.colorForId): Return a color given an ID.
(Expectations.unexpectedResults): Given a list of actual results and expected results,
return a state.
(Expectations):
* resultsdbpy/resultsdbpy/view/static/js/investigate.js: Added.
(commitsForUuid):
(testRunLink):
(elapsed):
(percentage):
(contentForAgregateData):
(contentForData):
(_InvestigateDrawer):
(_InvestigateDrawer.prototype.isRendered):
(_InvestigateDrawer.prototype.expand): Expand the investigation drawer.
(_InvestigateDrawer.prototype.collapse): Collapse the investigation drawer.
(_InvestigateDrawer.prototype.select): Select an element to investigate.
* resultsdbpy/resultsdbpy/view/static/js/timeline.js:
(statsForSingleResult): Move Expectation constants.
(TimelineFromEndpoint.prototype.render): Investigate specific data points instead
of jumping to the build.
(Expectations.stringToStateId): Deleted.
(Expectations.unexpectedResults): Deleted.
(Expectations): Deleted.
* resultsdbpy/resultsdbpy/view/static/library/css/webkit.css:
(.drawer.display): Make minimum height.
(@media screen and (min-width: 600px)): Move main and sidebar so they override drawer.
(@media screen and (min-width: 768px)): Ditto.
* resultsdbpy/resultsdbpy/view/templates/commits.html:
* resultsdbpy/resultsdbpy/view/templates/search.html:
* resultsdbpy/resultsdbpy/view/templates/suite_results.html:

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