WebKit-https.git
21 months ago@media rules ignored in user agent style sheet html.css
antti@apple.com [Mon, 6 Nov 2017 17:45:50 +0000 (17:45 +0000)]
@media rules ignored in user agent style sheet html.css
https://bugs.webkit.org/show_bug.cgi?id=169245
<rdar://problem/30885951>

Reviewed by Darin Adler.

To support accessibility features, allow non-trivial @media rules in user agent stylesheet.

This patch creates a special stylesheet consisting of rules with media queries seen on user agent stylesheets.
The queries on this sheet are evaluated with the document's media query evaluator.

No tests as I don't want to add things to UA style just for testing purposes. This will
gain coverage when the feature is used.

 * css/CSSDefaultStyleSheets.cpp:
(WebCore::CSSDefaultStyleSheets::addToDefaultStyle):

    Add a helper.
    Build a new stylesheet that consists of complex media rules seen in user agent sheets.

(WebCore::CSSDefaultStyleSheets::loadFullDefaultStyle):
(WebCore::CSSDefaultStyleSheets::ensureDefaultStyleSheetsForElement):
* css/CSSDefaultStyleSheets.h:
* css/DocumentRuleSets.cpp:
(WebCore::DocumentRuleSets::userAgentMediaQueryStyle const):

    Rule set constructed from media queries seen on UA sheet.

(WebCore::DocumentRuleSets::updateUserAgentMediaQueryStyleIfNeeded const):

    Evalute the media queries if needed.
    Re-evaluate if the rule count of the media query stylesheet increases
    (this could happen when additional UA style is added).

(WebCore::DocumentRuleSets::resetUserAgentMediaQueryStyle):
(WebCore::DocumentRuleSets::collectFeatures const):

    Collect the features from userAgentMediaQueryStyle.

* css/DocumentRuleSets.h:
(WebCore::DocumentRuleSets::setIsForShadowScope):
* css/ElementRuleCollector.cpp:
(WebCore::ElementRuleCollector::ElementRuleCollector):
(WebCore::ElementRuleCollector::matchUARules):

    Also match rules in userAgentMediaQueryStyle.

* css/ElementRuleCollector.h:
* css/InspectorCSSOMWrappers.cpp:
(WebCore::InspectorCSSOMWrappers::collectDocumentWrappers):
* css/StyleResolver.cpp:
(WebCore::StyleResolver::StyleResolver):
* style/StyleScope.cpp:
(WebCore::Style::Scope::resolver):

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

21 months ago[LayoutState cleanup] Move m_layoutState from RenderView to LayoutContext
zalan@apple.com [Mon, 6 Nov 2017 17:45:09 +0000 (17:45 +0000)]
[LayoutState cleanup] Move m_layoutState from RenderView to LayoutContext
https://bugs.webkit.org/show_bug.cgi?id=179282
<rdar://problem/35348653>

Reviewed by Antti Koivisto.

LayoutContext now owns the top level LayoutState object.
It makes RenderView behave like any other renderer by constructing a LayoutStateMaintainer on the stack.
This is mostly moving code from RenderView.h/.cpp to LayoutContext.h/.cpp and fixing the callsites.
(While view().frameView().layoutContext().layoutState() is a bit lengthy, it's
temporary only, since LayoutState is planned to be an argument of the layout() method.

Covered by existing test.

* accessibility/AXObjectCache.cpp:
(WebCore::AXObjectCache::notificationPostTimerFired):
* page/LayoutContext.cpp:
(WebCore::LayoutContext::layoutDelta const):
(WebCore::LayoutContext::addLayoutDelta):
(WebCore::LayoutContext::layoutDeltaMatches):
(WebCore::LayoutContext::pushLayoutState):
(WebCore::LayoutContext::pushLayoutStateForPaginationIfNeeded):
(WebCore::LayoutContext::popLayoutState):
(WebCore::LayoutContext::checkLayoutState):
* page/LayoutContext.h:
(WebCore::LayoutContext::layoutState const):
(WebCore::LayoutContext::layoutStateEnabled const):
(WebCore::LayoutContext::disableLayoutState):
(WebCore::LayoutContext::enableLayoutState):
* rendering/LayoutState.cpp:
(WebCore::LayoutState::LayoutState):
(WebCore::LayoutState::computeClipRect):
(WebCore::LayoutStateMaintainer::LayoutStateMaintainer):
(WebCore::LayoutStateMaintainer::push):
(WebCore::LayoutStateMaintainer::pop):
(WebCore::LayoutStateDisabler::LayoutStateDisabler):
(WebCore::LayoutStateDisabler::~LayoutStateDisabler):
(WebCore::SubtreeLayoutStateMaintainer::SubtreeLayoutStateMaintainer):
(WebCore::SubtreeLayoutStateMaintainer::~SubtreeLayoutStateMaintainer):
(WebCore::PaginatedLayoutStateMaintainer::PaginatedLayoutStateMaintainer):
(WebCore::PaginatedLayoutStateMaintainer::~PaginatedLayoutStateMaintainer):
* rendering/LayoutState.h:
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::setLogicalLeftForChild):
(WebCore::RenderBlock::setLogicalTopForChild):
(WebCore::RenderBlock::layoutPositionedObject):
(WebCore::RenderBlock::markForPaginationRelayoutIfNeeded):
(WebCore::RenderBlock::adjustLogicalLeftOffsetForLine const):
(WebCore::RenderBlock::adjustLogicalRightOffsetForLine const):
(WebCore::RenderBlock::offsetFromLogicalTopOfFirstPage const):
(WebCore::RenderBlock::childBoxIsUnsplittableForFragmentation const):
* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::layoutBlock):
(WebCore::RenderBlockFlow::layoutBlockChildren):
(WebCore::RenderBlockFlow::layoutBlockChild):
(WebCore::RenderBlockFlow::collapseMarginsWithChildInfo):
(WebCore::RenderBlockFlow::estimateLogicalTopPosition):
(WebCore::RenderBlockFlow::applyBeforeBreak):
(WebCore::RenderBlockFlow::applyAfterBreak):
(WebCore::RenderBlockFlow::hasNextPage const):
(WebCore::RenderBlockFlow::pageLogicalTopForOffset const):
(WebCore::RenderBlockFlow::pageLogicalHeightForOffset const):
(WebCore::RenderBlockFlow::pageRemainingLogicalHeightForOffset const):
(WebCore::RenderBlockFlow::repaintOverhangingFloats):
(WebCore::RenderBlockFlow::insertFloatingObject):
(WebCore::RenderBlockFlow::positionNewFloats):
(WebCore::RenderBlockFlow::layoutSimpleLines):
* rendering/RenderBlockLineLayout.cpp:
(WebCore::RenderBlockFlow::layoutRunsAndFloats):
(WebCore::RenderBlockFlow::layoutRunsAndFloatsInRange):
(WebCore::RenderBlockFlow::linkToEndLineIfNeeded):
(WebCore::RenderBlockFlow::layoutLineBoxes):
(WebCore::RenderBlockFlow::determineStartPosition):
(WebCore::RenderBlockFlow::checkPaginationAndFloatsAtEndLine):
* rendering/RenderBox.cpp:
(WebCore::RenderBox::outlineBoundsForRepaint const):
(WebCore::RenderBox::mapLocalToContainer const):
(WebCore::RenderBox::clippedOverflowRectForRepaint const):
(WebCore::RenderBox::computeRectForRepaint const):
(WebCore::RenderBox::offsetFromLogicalTopOfFirstPage const):
* rendering/RenderDeprecatedFlexibleBox.cpp:
(WebCore::RenderDeprecatedFlexibleBox::layoutBlock):
(WebCore::layoutChildIfNeededApplyingDelta):
* rendering/RenderElement.cpp:
(WebCore::RenderElement::insertChildInternal):
(WebCore::RenderElement::takeChildInternal):
* rendering/RenderEmbeddedObject.cpp:
* rendering/RenderFragmentedFlow.cpp:
(WebCore::RenderFragmentedFlow::repaintRectangleInFragments const):
* rendering/RenderGrid.cpp:
* rendering/RenderInline.cpp:
(WebCore::RenderInline::clippedOverflowRectForRepaint const):
(WebCore::RenderInline::computeRectForRepaint const):
(WebCore::RenderInline::mapLocalToContainer const):
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::updateLayerPositions):
* rendering/RenderListBox.cpp:
(WebCore::RenderListBox::layout):
* rendering/RenderMediaControlElements.cpp:
(WebCore::RenderMediaVolumeSliderContainer::layout):
(WebCore::RenderMediaControlTimelineContainer::layout):
(WebCore::RenderTextTrackContainerElement::layout):
* rendering/RenderObject.cpp:
(WebCore::RenderObject::repaintRectangle const):
* rendering/RenderReplaced.cpp:
(WebCore::RenderReplaced::clippedOverflowRectForRepaint const):
* rendering/RenderTable.cpp:
(WebCore::RenderTable::layout):
(WebCore::RenderTable::markForPaginationRelayoutIfNeeded):
* rendering/RenderTableCell.cpp:
(WebCore::RenderTableCell::clippedOverflowRectForRepaint const):
(WebCore::RenderTableCell::computeRectForRepaint const):
* rendering/RenderTableRow.cpp:
(WebCore::RenderTableRow::layout):
* rendering/RenderTableSection.cpp:
(WebCore::RenderTableSection::calcRowLogicalHeight):
(WebCore::RenderTableSection::layout):
(WebCore::RenderTableSection::layoutRows):
(WebCore::RenderTableSection::setLogicalPositionForCell const):
* rendering/RenderVTTCue.cpp:
* rendering/RenderView.cpp:
(WebCore::RenderView::layout):
(WebCore::RenderView::layoutContent): Deleted.
(WebCore::RenderView::checkLayoutState): Deleted.
(WebCore::RenderView::initializeLayoutState): Deleted.
(WebCore::RenderView::pushLayoutState): Deleted.
(WebCore::RenderView::pushLayoutStateForPaginationIfNeeded): Deleted.
* rendering/RenderView.h:
* rendering/RootInlineBox.cpp:
(WebCore::RootInlineBox::lineSnapAdjustment const):
* rendering/svg/RenderSVGContainer.cpp:
(WebCore::RenderSVGContainer::layout):
* rendering/svg/RenderSVGForeignObject.cpp:
(WebCore::RenderSVGForeignObject::layout):
* rendering/svg/RenderSVGRoot.cpp:
(WebCore::RenderSVGRoot::layout):
* style/RenderTreeUpdaterFirstLetter.cpp:
(WebCore::RenderTreeUpdater::FirstLetter::update):
* style/RenderTreeUpdaterListItem.cpp:
(WebCore::RenderTreeUpdater::ListItem::updateMarker):

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

21 months agoUnreviewed, fix WPE build after r224492
mcatanzaro@igalia.com [Mon, 6 Nov 2017 16:36:45 +0000 (16:36 +0000)]
Unreviewed, fix WPE build after r224492
https://bugs.webkit.org/show_bug.cgi?id=179009

* Source/cmake/OptionsWPE.cmake:

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

21 months ago[WPE] Clean up OptionsWPE.cmake
mcatanzaro@igalia.com [Mon, 6 Nov 2017 16:27:25 +0000 (16:27 +0000)]
[WPE] Clean up OptionsWPE.cmake
https://bugs.webkit.org/show_bug.cgi?id=179009

Reviewed by Žan Doberšek.

* Source/cmake/OptionsWPE.cmake:

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

21 months agoCodeBlock::usesOpcode() is dead code
rmorisset@apple.com [Mon, 6 Nov 2017 14:55:31 +0000 (14:55 +0000)]
CodeBlock::usesOpcode() is dead code
https://bugs.webkit.org/show_bug.cgi?id=179316

Reviewed by Yusuke Suzuki.

Remove CodeBlock::usesOpcode which is dead code

* bytecode/CodeBlock.cpp:
* bytecode/CodeBlock.h:

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

21 months ago[WPE][GTK] Always use SET_AND_EXPOSE_TO_BUILD to set build variables
mcatanzaro@igalia.com [Mon, 6 Nov 2017 14:43:36 +0000 (14:43 +0000)]
[WPE][GTK] Always use SET_AND_EXPOSE_TO_BUILD to set build variables
https://bugs.webkit.org/show_bug.cgi?id=179038

Reviewed by Žan Doberšek.

.:

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

Source/WTF:

* wtf/Platform.h:

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

21 months ago[WPE] Properly use SYSTEM_INCLUDE_DIRECTORIES for WebKit build target
mcatanzaro@igalia.com [Mon, 6 Nov 2017 14:43:32 +0000 (14:43 +0000)]
[WPE] Properly use SYSTEM_INCLUDE_DIRECTORIES for WebKit build target
https://bugs.webkit.org/show_bug.cgi?id=179097

Reviewed by Žan Doberšek.

* PlatformWPE.cmake:

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

21 months ago[WPE] -Wsign-compare warning in EventSenderProxyWPE.cpp
mcatanzaro@igalia.com [Mon, 6 Nov 2017 14:42:55 +0000 (14:42 +0000)]
[WPE] -Wsign-compare warning in EventSenderProxyWPE.cpp
https://bugs.webkit.org/show_bug.cgi?id=179039

Reviewed by Žan Doberšek.

* WebKitTestRunner/wpe/EventSenderProxyWPE.cpp:
(WTR::EventSenderProxy::updateTouchPoint):
(WTR::EventSenderProxy::releaseTouchPoint):

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

21 months agoJIT call inline caches should cache calls to objects with getCallData/getConstructDat...
utatane.tea@gmail.com [Mon, 6 Nov 2017 14:40:08 +0000 (14:40 +0000)]
JIT call inline caches should cache calls to objects with getCallData/getConstructData traps
https://bugs.webkit.org/show_bug.cgi?id=144458

Reviewed by Saam Barati.

JSTests:

* microbenchmarks/dfg-internal-function-call.js: Added.
(target):
* microbenchmarks/dfg-internal-function-construct.js: Added.
(target):
* microbenchmarks/dfg-internal-function-not-handled-call.js: Added.
(target):
* microbenchmarks/dfg-internal-function-not-handled-construct.js: Added.
(target):
* stress/dfg-internal-function-call.js: Added.
(shouldBe):
(target):
* stress/dfg-internal-function-construct.js: Added.
(shouldBe):
(target):
* stress/internal-function-call.js: Added.
(shouldBe):
* stress/internal-function-construct.js: Added.
(shouldBe):

Source/JavaScriptCore:

Previously only JSFunction is handled by CallLinkInfo's caching mechanism. This means that
InternalFunction calls are not cached and they always go to the slow path. This is not good because

1. We need to query getCallData/getConstructData every time in the slow path.
2. CallLinkInfo tells nothing in the higher tier JITs.

This patch starts handling InternalFunction in CallLinkInfo's caching mechanism. We change InternalFunction
to hold pointers to the functions for call and construct. We have new stubs that can call/construct
InternalFunction. And we return this code pointer as a result of setup call to use CallLinkInfo mechanism.

This patch is critical to optimizing derived Array construction[1] since it starts using CallLinkInfo
for InternalFunction. Previously we did not record any information to CallLinkInfo. Except for the
case that DFGByteCodeParser figures out InternalFunction constant, we cannot attempt to emit DFG
nodes for these InternalFunctions since CallLinkInfo tells us nothing.

Attached microbenchmarks show performance improvement.

                                                   baseline                  patched

dfg-internal-function-construct                 1.6439+-0.0826     ^      1.2829+-0.0727        ^ definitely 1.2813x faster
dfg-internal-function-not-handled-construct     2.1862+-0.1361            2.0696+-0.1201          might be 1.0564x faster
dfg-internal-function-not-handled-call         20.7592+-0.9085           19.7369+-0.7921          might be 1.0518x faster
dfg-internal-function-call                      1.6856+-0.0967     ^      1.2771+-0.0744        ^ definitely 1.3198x faster

[1]: https://bugs.webkit.org/show_bug.cgi?id=178064

* API/JSCallbackFunction.cpp:
(JSC::JSCallbackFunction::JSCallbackFunction):
(JSC::JSCallbackFunction::getCallData): Deleted.
* API/JSCallbackFunction.h:
(JSC::JSCallbackFunction::createStructure):
* API/ObjCCallbackFunction.h:
(JSC::ObjCCallbackFunction::createStructure):
* API/ObjCCallbackFunction.mm:
(JSC::ObjCCallbackFunction::ObjCCallbackFunction):
(JSC::ObjCCallbackFunction::getCallData): Deleted.
(JSC::ObjCCallbackFunction::getConstructData): Deleted.
* bytecode/BytecodeDumper.cpp:
(JSC::BytecodeDumper<Block>::printCallOp):
* bytecode/BytecodeList.json:
* bytecode/CallLinkInfo.cpp:
(JSC::CallLinkInfo::setCallee):
(JSC::CallLinkInfo::callee):
(JSC::CallLinkInfo::setLastSeenCallee):
(JSC::CallLinkInfo::lastSeenCallee):
(JSC::CallLinkInfo::visitWeak):
* bytecode/CallLinkInfo.h:
* bytecode/CallLinkStatus.cpp:
(JSC::CallLinkStatus::computeFromCallLinkInfo):
* bytecode/LLIntCallLinkInfo.h:
* jit/JITOperations.cpp:
* jit/JITThunks.cpp:
(JSC::JITThunks::ctiInternalFunctionCall):
(JSC::JITThunks::ctiInternalFunctionConstruct):
* jit/JITThunks.h:
* jit/Repatch.cpp:
(JSC::linkFor):
(JSC::linkPolymorphicCall):
* jit/Repatch.h:
* jit/ThunkGenerators.cpp:
(JSC::virtualThunkFor):
(JSC::nativeForGenerator):
(JSC::nativeCallGenerator):
(JSC::nativeTailCallGenerator):
(JSC::nativeTailCallWithoutSavedTagsGenerator):
(JSC::nativeConstructGenerator):
(JSC::internalFunctionCallGenerator):
(JSC::internalFunctionConstructGenerator):
* jit/ThunkGenerators.h:
* llint/LLIntSlowPaths.cpp:
(JSC::LLInt::setUpCall):
* llint/LowLevelInterpreter.asm:
* llint/LowLevelInterpreter32_64.asm:
* llint/LowLevelInterpreter64.asm:
* runtime/ArrayConstructor.cpp:
(JSC::ArrayConstructor::ArrayConstructor):
(JSC::ArrayConstructor::getConstructData): Deleted.
(JSC::ArrayConstructor::getCallData): Deleted.
* runtime/ArrayConstructor.h:
(JSC::ArrayConstructor::createStructure):
* runtime/AsyncFunctionConstructor.cpp:
(JSC::AsyncFunctionConstructor::AsyncFunctionConstructor):
(JSC::AsyncFunctionConstructor::finishCreation):
(JSC::AsyncFunctionConstructor::getCallData): Deleted.
(JSC::AsyncFunctionConstructor::getConstructData): Deleted.
* runtime/AsyncFunctionConstructor.h:
(JSC::AsyncFunctionConstructor::createStructure):
* runtime/AsyncGeneratorFunctionConstructor.cpp:
(JSC::AsyncGeneratorFunctionConstructor::AsyncGeneratorFunctionConstructor):
(JSC::AsyncGeneratorFunctionConstructor::finishCreation):
(JSC::AsyncGeneratorFunctionConstructor::getCallData): Deleted.
(JSC::AsyncGeneratorFunctionConstructor::getConstructData): Deleted.
* runtime/AsyncGeneratorFunctionConstructor.h:
(JSC::AsyncGeneratorFunctionConstructor::createStructure):
* runtime/BooleanConstructor.cpp:
(JSC::callBooleanConstructor):
(JSC::BooleanConstructor::BooleanConstructor):
(JSC::BooleanConstructor::finishCreation):
(JSC::BooleanConstructor::getConstructData): Deleted.
(JSC::BooleanConstructor::getCallData): Deleted.
* runtime/BooleanConstructor.h:
(JSC::BooleanConstructor::createStructure):
* runtime/DateConstructor.cpp:
(JSC::DateConstructor::DateConstructor):
(JSC::DateConstructor::getConstructData): Deleted.
(JSC::DateConstructor::getCallData): Deleted.
* runtime/DateConstructor.h:
(JSC::DateConstructor::createStructure):
* runtime/Error.h:
(JSC::StrictModeTypeErrorFunction::StrictModeTypeErrorFunction):
(JSC::StrictModeTypeErrorFunction::createStructure):
(JSC::StrictModeTypeErrorFunction::getConstructData): Deleted.
(JSC::StrictModeTypeErrorFunction::getCallData): Deleted.
* runtime/ErrorConstructor.cpp:
(JSC::ErrorConstructor::ErrorConstructor):
(JSC::ErrorConstructor::getConstructData): Deleted.
(JSC::ErrorConstructor::getCallData): Deleted.
* runtime/ErrorConstructor.h:
(JSC::ErrorConstructor::createStructure):
* runtime/FunctionConstructor.cpp:
(JSC::FunctionConstructor::FunctionConstructor):
(JSC::FunctionConstructor::finishCreation):
(JSC::FunctionConstructor::getConstructData): Deleted.
(JSC::FunctionConstructor::getCallData): Deleted.
* runtime/FunctionConstructor.h:
(JSC::FunctionConstructor::createStructure):
* runtime/FunctionPrototype.cpp:
(JSC::callFunctionPrototype):
(JSC::FunctionPrototype::FunctionPrototype):
(JSC::FunctionPrototype::getCallData): Deleted.
* runtime/FunctionPrototype.h:
(JSC::FunctionPrototype::createStructure):
* runtime/GeneratorFunctionConstructor.cpp:
(JSC::GeneratorFunctionConstructor::GeneratorFunctionConstructor):
(JSC::GeneratorFunctionConstructor::finishCreation):
(JSC::GeneratorFunctionConstructor::getCallData): Deleted.
(JSC::GeneratorFunctionConstructor::getConstructData): Deleted.
* runtime/GeneratorFunctionConstructor.h:
(JSC::GeneratorFunctionConstructor::createStructure):
* runtime/InternalFunction.cpp:
(JSC::InternalFunction::InternalFunction):
(JSC::InternalFunction::finishCreation):
(JSC::InternalFunction::getCallData):
(JSC::InternalFunction::getConstructData):
* runtime/InternalFunction.h:
(JSC::InternalFunction::createStructure):
(JSC::InternalFunction::nativeFunctionFor):
(JSC::InternalFunction::offsetOfNativeFunctionFor):
* runtime/IntlCollatorConstructor.cpp:
(JSC::IntlCollatorConstructor::createStructure):
(JSC::IntlCollatorConstructor::IntlCollatorConstructor):
(JSC::IntlCollatorConstructor::getConstructData): Deleted.
(JSC::IntlCollatorConstructor::getCallData): Deleted.
* runtime/IntlCollatorConstructor.h:
* runtime/IntlDateTimeFormatConstructor.cpp:
(JSC::IntlDateTimeFormatConstructor::createStructure):
(JSC::IntlDateTimeFormatConstructor::IntlDateTimeFormatConstructor):
(JSC::IntlDateTimeFormatConstructor::getConstructData): Deleted.
(JSC::IntlDateTimeFormatConstructor::getCallData): Deleted.
* runtime/IntlDateTimeFormatConstructor.h:
* runtime/IntlNumberFormatConstructor.cpp:
(JSC::IntlNumberFormatConstructor::createStructure):
(JSC::IntlNumberFormatConstructor::IntlNumberFormatConstructor):
(JSC::IntlNumberFormatConstructor::getConstructData): Deleted.
(JSC::IntlNumberFormatConstructor::getCallData): Deleted.
* runtime/IntlNumberFormatConstructor.h:
* runtime/JSArrayBufferConstructor.cpp:
(JSC::JSArrayBufferConstructor::JSArrayBufferConstructor):
(JSC::JSArrayBufferConstructor::createStructure):
(JSC::JSArrayBufferConstructor::getConstructData): Deleted.
(JSC::JSArrayBufferConstructor::getCallData): Deleted.
* runtime/JSArrayBufferConstructor.h:
* runtime/JSGenericTypedArrayViewConstructor.h:
* runtime/JSGenericTypedArrayViewConstructorInlines.h:
(JSC::JSGenericTypedArrayViewConstructor<ViewClass>::JSGenericTypedArrayViewConstructor):
(JSC::JSGenericTypedArrayViewConstructor<ViewClass>::createStructure):
(JSC::JSGenericTypedArrayViewConstructor<ViewClass>::getConstructData): Deleted.
(JSC::JSGenericTypedArrayViewConstructor<ViewClass>::getCallData): Deleted.
* runtime/JSInternalPromiseConstructor.cpp:
(JSC::JSInternalPromiseConstructor::createStructure):
(JSC::JSInternalPromiseConstructor::JSInternalPromiseConstructor):
(JSC::JSInternalPromiseConstructor::getConstructData): Deleted.
(JSC::JSInternalPromiseConstructor::getCallData): Deleted.
* runtime/JSInternalPromiseConstructor.h:
* runtime/JSPromiseConstructor.cpp:
(JSC::JSPromiseConstructor::createStructure):
(JSC::JSPromiseConstructor::JSPromiseConstructor):
(JSC::JSPromiseConstructor::getConstructData): Deleted.
(JSC::JSPromiseConstructor::getCallData): Deleted.
* runtime/JSPromiseConstructor.h:
* runtime/JSType.h:
* runtime/JSTypedArrayViewConstructor.cpp:
(JSC::JSTypedArrayViewConstructor::JSTypedArrayViewConstructor):
(JSC::JSTypedArrayViewConstructor::createStructure):
(JSC::JSTypedArrayViewConstructor::getConstructData): Deleted.
(JSC::JSTypedArrayViewConstructor::getCallData): Deleted.
* runtime/JSTypedArrayViewConstructor.h:
* runtime/MapConstructor.cpp:
(JSC::MapConstructor::MapConstructor):
(JSC::MapConstructor::getConstructData): Deleted.
(JSC::MapConstructor::getCallData): Deleted.
* runtime/MapConstructor.h:
(JSC::MapConstructor::createStructure):
(JSC::MapConstructor::MapConstructor): Deleted.
* runtime/NativeErrorConstructor.cpp:
(JSC::NativeErrorConstructor::NativeErrorConstructor):
(JSC::NativeErrorConstructor::getConstructData): Deleted.
(JSC::NativeErrorConstructor::getCallData): Deleted.
* runtime/NativeErrorConstructor.h:
(JSC::NativeErrorConstructor::createStructure):
* runtime/NullGetterFunction.cpp:
(JSC::NullGetterFunction::NullGetterFunction):
(JSC::NullGetterFunction::getCallData): Deleted.
(JSC::NullGetterFunction::getConstructData): Deleted.
* runtime/NullGetterFunction.h:
(JSC::NullGetterFunction::createStructure):
(JSC::NullGetterFunction::NullGetterFunction): Deleted.
* runtime/NullSetterFunction.cpp:
(JSC::NullSetterFunction::NullSetterFunction):
(JSC::NullSetterFunction::getCallData): Deleted.
(JSC::NullSetterFunction::getConstructData): Deleted.
* runtime/NullSetterFunction.h:
(JSC::NullSetterFunction::createStructure):
(JSC::NullSetterFunction::NullSetterFunction): Deleted.
* runtime/NumberConstructor.cpp:
(JSC::NumberConstructor::NumberConstructor):
(JSC::constructNumberConstructor):
(JSC::constructWithNumberConstructor): Deleted.
(JSC::NumberConstructor::getConstructData): Deleted.
(JSC::NumberConstructor::getCallData): Deleted.
* runtime/NumberConstructor.h:
(JSC::NumberConstructor::createStructure):
* runtime/ObjectConstructor.cpp:
(JSC::ObjectConstructor::ObjectConstructor):
(JSC::ObjectConstructor::getConstructData): Deleted.
(JSC::ObjectConstructor::getCallData): Deleted.
* runtime/ObjectConstructor.h:
(JSC::ObjectConstructor::createStructure):
* runtime/ProxyConstructor.cpp:
(JSC::ProxyConstructor::ProxyConstructor):
(JSC::ProxyConstructor::getConstructData): Deleted.
(JSC::ProxyConstructor::getCallData): Deleted.
* runtime/ProxyConstructor.h:
(JSC::ProxyConstructor::createStructure):
* runtime/ProxyRevoke.cpp:
(JSC::ProxyRevoke::ProxyRevoke):
(JSC::ProxyRevoke::getCallData): Deleted.
* runtime/ProxyRevoke.h:
(JSC::ProxyRevoke::createStructure):
* runtime/RegExpConstructor.cpp:
(JSC::RegExpConstructor::RegExpConstructor):
(JSC::RegExpConstructor::getConstructData): Deleted.
(JSC::RegExpConstructor::getCallData): Deleted.
* runtime/RegExpConstructor.h:
(JSC::RegExpConstructor::createStructure):
* runtime/SetConstructor.cpp:
(JSC::SetConstructor::SetConstructor):
(JSC::SetConstructor::getConstructData): Deleted.
(JSC::SetConstructor::getCallData): Deleted.
* runtime/SetConstructor.h:
(JSC::SetConstructor::createStructure):
(JSC::SetConstructor::SetConstructor): Deleted.
* runtime/StringConstructor.cpp:
(JSC::StringConstructor::StringConstructor):
(JSC::StringConstructor::getConstructData): Deleted.
(JSC::StringConstructor::getCallData): Deleted.
* runtime/StringConstructor.h:
(JSC::StringConstructor::createStructure):
* runtime/SymbolConstructor.cpp:
(JSC::SymbolConstructor::SymbolConstructor):
(JSC::SymbolConstructor::getConstructData): Deleted.
(JSC::SymbolConstructor::getCallData): Deleted.
* runtime/SymbolConstructor.h:
(JSC::SymbolConstructor::createStructure):
* runtime/VM.cpp:
(JSC::VM::VM):
(JSC::VM::getCTIInternalFunctionTrampolineFor):
* runtime/VM.h:
* runtime/WeakMapConstructor.cpp:
(JSC::WeakMapConstructor::WeakMapConstructor):
(JSC::WeakMapConstructor::getConstructData): Deleted.
(JSC::WeakMapConstructor::getCallData): Deleted.
* runtime/WeakMapConstructor.h:
(JSC::WeakMapConstructor::createStructure):
(JSC::WeakMapConstructor::WeakMapConstructor): Deleted.
* runtime/WeakSetConstructor.cpp:
(JSC::WeakSetConstructor::WeakSetConstructor):
(JSC::WeakSetConstructor::getConstructData): Deleted.
(JSC::WeakSetConstructor::getCallData): Deleted.
* runtime/WeakSetConstructor.h:
(JSC::WeakSetConstructor::createStructure):
(JSC::WeakSetConstructor::WeakSetConstructor): Deleted.
* wasm/js/WebAssemblyCompileErrorConstructor.cpp:
(JSC::WebAssemblyCompileErrorConstructor::createStructure):
(JSC::WebAssemblyCompileErrorConstructor::WebAssemblyCompileErrorConstructor):
(JSC::WebAssemblyCompileErrorConstructor::getConstructData): Deleted.
(JSC::WebAssemblyCompileErrorConstructor::getCallData): Deleted.
* wasm/js/WebAssemblyCompileErrorConstructor.h:
* wasm/js/WebAssemblyInstanceConstructor.cpp:
(JSC::WebAssemblyInstanceConstructor::createStructure):
(JSC::WebAssemblyInstanceConstructor::WebAssemblyInstanceConstructor):
(JSC::WebAssemblyInstanceConstructor::getConstructData): Deleted.
(JSC::WebAssemblyInstanceConstructor::getCallData): Deleted.
* wasm/js/WebAssemblyInstanceConstructor.h:
* wasm/js/WebAssemblyLinkErrorConstructor.cpp:
(JSC::WebAssemblyLinkErrorConstructor::createStructure):
(JSC::WebAssemblyLinkErrorConstructor::WebAssemblyLinkErrorConstructor):
(JSC::WebAssemblyLinkErrorConstructor::getConstructData): Deleted.
(JSC::WebAssemblyLinkErrorConstructor::getCallData): Deleted.
* wasm/js/WebAssemblyLinkErrorConstructor.h:
* wasm/js/WebAssemblyMemoryConstructor.cpp:
(JSC::WebAssemblyMemoryConstructor::createStructure):
(JSC::WebAssemblyMemoryConstructor::WebAssemblyMemoryConstructor):
(JSC::WebAssemblyMemoryConstructor::getConstructData): Deleted.
(JSC::WebAssemblyMemoryConstructor::getCallData): Deleted.
* wasm/js/WebAssemblyMemoryConstructor.h:
* wasm/js/WebAssemblyModuleConstructor.cpp:
(JSC::WebAssemblyModuleConstructor::createStructure):
(JSC::WebAssemblyModuleConstructor::WebAssemblyModuleConstructor):
(JSC::WebAssemblyModuleConstructor::getConstructData): Deleted.
(JSC::WebAssemblyModuleConstructor::getCallData): Deleted.
* wasm/js/WebAssemblyModuleConstructor.h:
* wasm/js/WebAssemblyRuntimeErrorConstructor.cpp:
(JSC::WebAssemblyRuntimeErrorConstructor::createStructure):
(JSC::WebAssemblyRuntimeErrorConstructor::WebAssemblyRuntimeErrorConstructor):
(JSC::WebAssemblyRuntimeErrorConstructor::getConstructData): Deleted.
(JSC::WebAssemblyRuntimeErrorConstructor::getCallData): Deleted.
* wasm/js/WebAssemblyRuntimeErrorConstructor.h:
* wasm/js/WebAssemblyTableConstructor.cpp:
(JSC::WebAssemblyTableConstructor::createStructure):
(JSC::WebAssemblyTableConstructor::WebAssemblyTableConstructor):
(JSC::WebAssemblyTableConstructor::getConstructData): Deleted.
(JSC::WebAssemblyTableConstructor::getCallData): Deleted.
* wasm/js/WebAssemblyTableConstructor.h:

Source/WebCore:

* bridge/runtime_method.cpp:
(JSC::RuntimeMethod::RuntimeMethod):
(JSC::RuntimeMethod::getCallData): Deleted.
* bridge/runtime_method.h:

Source/WebKit:

* WebProcess/Plugins/Netscape/JSNPMethod.cpp:
(WebKit::JSNPMethod::JSNPMethod):
(WebKit::JSNPMethod::getCallData): Deleted.
* WebProcess/Plugins/Netscape/JSNPMethod.h:
(WebKit::JSNPMethod::createStructure):

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

21 months agoAdd a third benchmark to TailBench
rmorisset@apple.com [Mon, 6 Nov 2017 12:58:42 +0000 (12:58 +0000)]
Add a third benchmark to TailBench
https://bugs.webkit.org/show_bug.cgi?id=178815

Reviewed by Saam Barati.

Add a new benchmark to TailBench: a BF interpreter written in a weird kinda functional style

PerformanceTests:

* TailBench9000/bf-interpreter.js: Added.
(lookForMatchingBracket):
(evalRec):
(infiniteTape):
(evalShort):

Tools:

* Scripts/run-jsc-benchmarks:

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

21 months agoPerformanceTests/TailBench9000/merge-sort.js does not actually sort any of the large...
rmorisset@apple.com [Mon, 6 Nov 2017 12:56:51 +0000 (12:56 +0000)]
PerformanceTests/TailBench9000/merge-sort.js does not actually sort any of the large arrays it allocates
https://bugs.webkit.org/show_bug.cgi?id=178817

Reviewed by Saam Barati.

* TailBench9000/merge-sort.js:
(TEST_mergeSort):

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

21 months agoCanonical name of EUC-KR encoding should be EUC-KR, not windows-949
mjs@apple.com [Mon, 6 Nov 2017 08:31:44 +0000 (08:31 +0000)]
Canonical name of EUC-KR encoding should be EUC-KR, not windows-949
https://bugs.webkit.org/show_bug.cgi?id=179305

Reviewed by Alexey Proskuryakov.

LayoutTests/imported/w3c:

* web-platform-tests/encoding/textdecoder-labels-expected.txt: Updated expected results. The test already correctly covered this.
* web-platform-tests/encoding/textencoder-constructor-non-utf-expected.txt: ditto

Source/WebCore:

Already covered by:
LayoutTests/imported/w3c/web-platform-tests/encoding/textdecoder-labels.html
LayoutTests/imported/w3c/web-platform-tests/encoding/textencoder-constructor-non-utf-expected.html
LayoutTests/fast/encoding/charset-decode.html

* platform/text/TextCodecICU.cpp: Change registration so the EUC-KR name
is canonical.
(WebCore::TextCodecICU::registerCodecs): However, we still want to use the windows-949
decoder. It's not exactly the same, but the spec calls for that.

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

21 months ago[Cairo] CairoGlyphToPathTranslator::path() shouldn't fill out the glyph path
zandobersek@gmail.com [Mon, 6 Nov 2017 08:05:52 +0000 (08:05 +0000)]
[Cairo] CairoGlyphToPathTranslator::path() shouldn't fill out the glyph path
https://bugs.webkit.org/show_bug.cgi?id=179159

Reviewed by Michael Catanzaro.

In case of non-zero synthetic bold offset in CairoGlyphToPathTranslator::path(),
cairo_glyph_path() should be called just like in the generic case.
cairo_show_glyphs() performs the actual rasterization of the glyph, but we're
only interested in the generated path operations.

No new tests -- covered by existing tests.

* platform/graphics/cairo/FontCairo.cpp:
(WebCore::CairoGlyphToPathTranslator::path):

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

21 months agoUnreviewed. Remove stray conflict markers from ChangeLog.
mjs@apple.com [Mon, 6 Nov 2017 07:53:40 +0000 (07:53 +0000)]
Unreviewed. Remove stray conflict markers from ChangeLog.

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

21 months agoREGRESSION (r221338): Web Inspector: NavigationBar incorrectly calculates minimumWidth
nvasilyev@apple.com [Mon, 6 Nov 2017 07:04:02 +0000 (07:04 +0000)]
REGRESSION (r221338): Web Inspector: NavigationBar incorrectly calculates minimumWidth
https://bugs.webkit.org/show_bug.cgi?id=179292

Reviewed by Devin Rousso.

* UserInterface/Views/NavigationBar.js:
(WI.NavigationBar.prototype._calculateMinimumWidth):
totalItemWidth was the minimumWidth of the last item.

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

21 months ago[WinCairo] Fix build after r224463
commit-queue@webkit.org [Mon, 6 Nov 2017 03:59:43 +0000 (03:59 +0000)]
[WinCairo] Fix build after r224463
https://bugs.webkit.org/show_bug.cgi?id=179310

Unreviewed build fix.

No new tests (No behavior change).

Patch by Fujii Hironori <Hironori.Fujii@sony.com> on 2017-11-05

* platform/graphics/win/GraphicsContextCairoWin.cpp: Include "GraphicsContextImpl.h".

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

21 months agoWeb Inspector: Canvas Tab: selecting Frame tree element should update preview/slider...
webkit@devinrousso.com [Mon, 6 Nov 2017 03:47:05 +0000 (03:47 +0000)]
Web Inspector: Canvas Tab: selecting Frame tree element should update preview/slider, does nothing
https://bugs.webkit.org/show_bug.cgi?id=179072
<rdar://problem/35278711>

Reviewed by Matt Baker.

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

* UserInterface/Views/RecordingActionTreeElement.css:
(.item.action > .titles .parameter.swizzled):
(.tree-outline:not(:focus, .force-focus) .item.action:not(.initial-state, .parent, .invalid) > .icon): Deleted.
(body:not(.window-inactive, .window-docked-inactive) .item.action > .titles .parameter.swizzled): Deleted.
Drive-by: remove extra :focus selectors to prevent icon flashing when the window is blurred.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@224475 268f45cc-cd09-0410-ab3c-d52691b4dbfc

21 months ago[Web Animations] Schedule animations registered on the document timeline
graouts@webkit.org [Sun, 5 Nov 2017 22:34:10 +0000 (22:34 +0000)]
[Web Animations] Schedule animations registered on the document timeline
https://bugs.webkit.org/show_bug.cgi?id=179236
<rdar://problem/35332669>

Reviewed by Dean Jackson.

Source/WebCore:

We now schedule animations contained in the document timeline using a three-step approach.

1. Each time an object that is part of the timing model changes one of its timing properties, we call
   animationTimingModelDidChange() on the document timeline. This schedules performInvalidationTask()
   to be called when the current run loop completes, such that we invalidate the timing model just once
   per run loop.

2. Once performInvalidationTask() is called, the timing model is invalidated in updateAnimationSchedule().
   We iterate over the registered animations on the timineline and identify the shortest interval between
   the current time and the next moment one of the animations requires a tick to update its value. If we
   find a value below 15ms, we schedule animations to be resolved with scheduleAnimationResolution() right
   away. If the value is above 15ms, and not inifinity, we schedule a one-shot timer for that interval to
   call scheduleAnimationResolution().

3. Once scheduleAnimationResolution() is called, we call scheduleAnimation() on the shared DisplayRefreshMonitorManager
   to be notified when the next display refresh occurs to actually resolve animations with resolveAnimations().

Note that, in this patch, resolveAnimations() does nothing, we will add support for interpolating values in
a future patch.

Another important thing to note is that every time the document timeline's current time is requested, we cache
it for the duration of the run loop such that the timing model always uses the same value during a given run loop.

Finally, to support tests where we check the state of the timing model by manually advancing time, we expose a
new pause() method on AnimationTimeline for tests to call to avoid the timeline to self-advance.

* animation/AnimationTimeline.cpp:
(WebCore::AnimationTimeline::addAnimation): Mark that the timing model changed as a result of adding an animation.
(WebCore::AnimationTimeline::removeAnimation): Mark that the timing model changed as a result of removing an animation.
(WebCore::AnimationTimeline::bindingsCurrentTime): Update the method signature to no longer be const and call into
currentTime() instead of reading directly from the m_currentTime member variable since a subclass, like DocumentTimeline,
may have a custom currentTime() implementation.
(WebCore::AnimationTimeline::setCurrentTime): Mark that the timing model changed as a result of the timeline current time
changing.
(WebCore::AnimationTimeline::bindingsCurrentTime const): Deleted.
* animation/AnimationTimeline.h:
(WebCore::AnimationTimeline::currentTime): Change both methods signatures to no longer be const so that DocumentTimeline's
implementation of currentTime() may cache the current time in a member variable, enqueuing a callback when the run loop
completes for this member variable to be reset, and updating some states.
(WebCore::AnimationTimeline::pause): To be implemented by subclasses.
(WebCore::AnimationTimeline::animationTimingModelDidChange): Add a new virtual method to indicate that the timing model
needs invalidating.
(WebCore::AnimationTimeline::animations const): Add an accessor to allow animations to be accessed by a subclass.
* animation/DocumentTimeline.cpp:
(WebCore::DocumentTimeline::create):
(WebCore::DocumentTimeline::DocumentTimeline): Update the constructor signature to receive a Document and a PlatformDisplayID
since we need a reference to the Document to get at the nowTime() and a PlatformDisplayID to create the DisplayRefreshMonitor.
(WebCore::DocumentTimeline::~DocumentTimeline): Close the task queue when the timeline gets destroyed.
(WebCore::DocumentTimeline::currentTime): If we don't have a current cahed current time, compute one and schedule
the invalidation task if needed so that we may reset the cached value as the run loop completes.
(WebCore::DocumentTimeline::pause): Allows the timeline not to self-advance, for testing purposes only.
(WebCore::DocumentTimeline::animationTimingModelDidChange): If we haven't already done so, mark that we need to update our
animation schedule in the invalidation task and schedule that task if not scheduled yet.
(WebCore::DocumentTimeline::scheduleInvalidationTaskIfNeeded): Schedule the invalidation task to run as the run loop completes
if we haven't already done so.
(WebCore::DocumentTimeline::performInvalidationTask): Update the animation schedule if needed and reset the cached current
time value.
(WebCore::DocumentTimeline::updateAnimationSchedule): Iterate over registed animations and find the shortest interval until
one of them needs to update their animation. If the shortest interval is below 15ms, schedule the animation resolution right
away. If the shortest inverval is finite and above 15ms, then schedule a one-shot timer for that interval to perform the
animation resolution then.
(WebCore::DocumentTimeline::animationScheduleTimerFired): The one-shot timer to perform the animation resolution has fired,
we call scheduleAnimationResolution().
(WebCore::DocumentTimeline::scheduleAnimationResolution): We call scheduleAnimation() on the shared DisplayRefreshMonitorManager
so that we may resolve animations on the next display refresh, or start a timer if the DisplayRefreshMonitorManager is not available.
(WebCore::DocumentTimeline::displayRefreshFired): The display is about to refresh, we call resolveAnimations().
(WebCore::DocumentTimeline::animationResolutionTimerFired): The fallback animation resolution timer has fired, we call resolveAnimations().
(WebCore::DocumentTimeline::resolveAnimations): Currently do nothing, this is where we'll iterate over registered animations to
update them with the current time.
(WebCore::DocumentTimeline::windowScreenDidChange): Notify the shared DisplayRefreshMonitorManager that the PlatformDisplayID
changed.
(WebCore::DocumentTimeline::createDisplayRefreshMonitor const): Provide a DisplayRefreshMonitor as part of the
DisplayRefreshMonitorClient protocol.
* animation/DocumentTimeline.h:
* animation/WebAnimation.cpp:
(WebCore::WebAnimation::create): Remove extra white space.
(WebCore::WebAnimation::setStartTime): Mark that the timing model changed as a result of changing this animation's start time.
(WebCore::WebAnimation::timeToNextRequiredTick const): Compute the interval until the next time we need to resolve this animation.
If the provided current time is before this animation's start time, compute the delay until the start time. If the current time
is after the animation's start time but before the animation's end time, indicate that we want to resolve the animation again
right away and return 0ms. In any other case, return an infinite interval to indicate that we don't need to be refreshed after
the provided time.
* animation/WebAnimation.h:
* dom/Document.cpp:
(WebCore::Document::windowScreenDidChange): Notify the document timeline that the PlatformDisplayID changed.
(WebCore::Document::timeline): Provide the Document and the PlatformDisplayID to the DocumentTimeline.
* testing/Internals.cpp:
(WebCore::Internals::pauseTimeline):
* testing/Internals.h:
* testing/Internals.idl:

LayoutTests:

Adopt the new internals.pauseTimeline() method to ensure that the existing
tests do not have a self-advancing timeline since we're interested in checking
the timing model state based on manually setting the timeline current time.

Also update some WPT expectations with some progressions.

* TestExpectations: Mark two tests as flaky due to the sample time being logged
in the failure.
* http/wpt/web-animations/interfaces/AnimationTimeline/document-timeline-expected.txt:
* http/wpt/web-animations/timing-model/animations/current-time-expected.txt:
* http/wpt/web-animations/timing-model/animations/set-the-animation-start-time-expected.txt:
* http/wpt/wk-web-animations/timing-model/animation-creation-basic.html:
* http/wpt/wk-web-animations/timing-model/animation-current-time.html:
* http/wpt/wk-web-animations/timing-model/animation-effect-timing.html:
* http/wpt/wk-web-animations/timing-model/animation-effect.html:
* http/wpt/wk-web-animations/timing-model/animation-interface-effect-property.html:
* http/wpt/wk-web-animations/timing-model/animation-interface-start-time-property.html:
* http/wpt/wk-web-animations/timing-model/animation-playback-rate.html:
* http/wpt/wk-web-animations/timing-model/document-timeline.html:
* http/wpt/wk-web-animations/timing-model/keyframe-effect-interface-timing-duration.html:
* http/wpt/wk-web-animations/timing-model/keyframe-effect.html:
* http/wpt/wk-web-animations/timing-model/timeline-current-time.html:

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

21 months agoMark http/tests/security/xss-DENIED-xsl-external-entity.xml as a flaky failure on...
pvollan@apple.com [Sun, 5 Nov 2017 22:17:04 +0000 (22:17 +0000)]
Mark http/tests/security/xss-DENIED-xsl-external-entity.xml as a flaky failure on Windows.
https://bugs.webkit.org/show_bug.cgi?id=179301

Unreviewed test gardening.

* platform/win/TestExpectations:

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

21 months agoMark fast/html/menuitem-element.html as failure on Windows.
pvollan@apple.com [Sun, 5 Nov 2017 20:32:51 +0000 (20:32 +0000)]
Mark fast/html/menuitem-element.html as failure on Windows.
https://bugs.webkit.org/show_bug.cgi?id=179299

Unreviewed test gardening.

* platform/win/TestExpectations:

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

21 months agoImplement ServiceWorkerRegistration.update()
cdumez@apple.com [Sun, 5 Nov 2017 20:18:17 +0000 (20:18 +0000)]
Implement ServiceWorkerRegistration.update()
https://bugs.webkit.org/show_bug.cgi?id=179270

Reviewed by Youenn Fablet.

LayoutTests/imported/w3c:

Rebaseline WPT tests now that more are passing or at least failing later.

* web-platform-tests/service-workers/service-worker/claim-affect-other-registration.https-expected.txt:
* web-platform-tests/service-workers/service-worker/claim-with-redirect.https-expected.txt:
* web-platform-tests/service-workers/service-worker/import-scripts-redirect.https-expected.txt:
* web-platform-tests/service-workers/service-worker/multiple-register.https-expected.txt:
* web-platform-tests/service-workers/service-worker/multiple-update.https-expected.txt:
* web-platform-tests/service-workers/service-worker/postmessage-from-waiting-serviceworker.https-expected.txt:
* web-platform-tests/service-workers/service-worker/ready.https-expected.txt:
* web-platform-tests/service-workers/service-worker/registration-script.https-expected.txt:
* web-platform-tests/service-workers/service-worker/skip-waiting.https-expected.txt:
* web-platform-tests/service-workers/service-worker/unregister-then-register.https-expected.txt:

* web-platform-tests/service-workers/service-worker/update.https-expected.txt:
I investigated this test and it is still failing later on because we clear registrations too
aggressively on the StorageProcess side we are supposed to make sure the registration does
not have a newestWorker before clearing it when a script fetch fails or a script syntax error
occurs. We properly have those if (!newestWorker) checks in the code but service workers
are not yet populated on the SWServerRegistration object so SWServerRegistration::getNewestWorker()
alwasy returns null.

Source/WebCore:

Implement ServiceWorkerRegistration.update():
- https://w3c.github.io/ServiceWorker/#service-worker-registration-update

We already had support for the Update algorithm in SWServerJobQueue but
this patch enhances our support a bit to get us closer to the specification:
- https://w3c.github.io/ServiceWorker/#update-algorithm

No new tests, rebaselined existing tests.

* workers/service/ServiceWorker.h:
* workers/service/ServiceWorkerContainer.cpp:
(WebCore::ServiceWorkerContainer::updateRegistration):
(WebCore::ServiceWorkerContainer::getRegistration):
(WebCore::ServiceWorkerContainer::jobResolvedWithRegistration):
* workers/service/ServiceWorkerContainer.h:
* workers/service/ServiceWorkerJobData.h:
(WebCore::ServiceWorkerJobData::encode const):
(WebCore::ServiceWorkerJobData::decode):
* workers/service/ServiceWorkerJobType.h:
* workers/service/ServiceWorkerRegistration.cpp:
(WebCore::ServiceWorkerRegistration::ServiceWorkerRegistration):
(WebCore::ServiceWorkerRegistration::installing):
(WebCore::ServiceWorkerRegistration::waiting):
(WebCore::ServiceWorkerRegistration::active):
(WebCore::ServiceWorkerRegistration::setInstallingWorker):
(WebCore::ServiceWorkerRegistration::setWaitingWorker):
(WebCore::ServiceWorkerRegistration::setActiveWorker):
(WebCore::ServiceWorkerRegistration::getNewestWorker):
(WebCore::ServiceWorkerRegistration::update):
* workers/service/ServiceWorkerRegistration.h:
* workers/service/server/SWServerJobQueue.cpp:
(WebCore::SWServerJobQueue::scriptFetchFinished):
(WebCore::SWServerJobQueue::scriptContextFailedToStart):
(WebCore::SWServerJobQueue::runNextJobSynchronously):
(WebCore::SWServerJobQueue::runUpdateJob):

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

21 months ago[Win] Skip stress/regress-178385.js.
pvollan@apple.com [Sun, 5 Nov 2017 19:20:53 +0000 (19:20 +0000)]
[Win] Skip stress/regress-178385.js.
https://bugs.webkit.org/show_bug.cgi?id=179298

Unreviewed test gardening.

* stress/regress-178385.js:

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

21 months agoMark fast/loader/empty-embed-src-attribute.html as a flaky crash on Windows.
pvollan@apple.com [Sun, 5 Nov 2017 17:51:33 +0000 (17:51 +0000)]
Mark fast/loader/empty-embed-src-attribute.html as a flaky crash on Windows.
https://bugs.webkit.org/show_bug.cgi?id=179297

Unreviewed test gardening.

* platform/win/TestExpectations:

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

21 months agoMark fast/css/object-fit/object-fit-embed.html and related tests as failing on Windows.
pvollan@apple.com [Sun, 5 Nov 2017 17:06:45 +0000 (17:06 +0000)]
Mark fast/css/object-fit/object-fit-embed.html and related tests as failing on Windows.
https://bugs.webkit.org/show_bug.cgi?id=179296

Unreviewed test gardening.

* platform/win/TestExpectations:

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

21 months agoMove code that maps a CompositeOperator and BlendMode to a CGBlendMode into a helper...
simon.fraser@apple.com [Sun, 5 Nov 2017 05:40:16 +0000 (05:40 +0000)]
Move code that maps a CompositeOperator and BlendMode to a CGBlendMode into a helper function
https://bugs.webkit.org/show_bug.cgi?id=179290

Reviewed by Darin Adler.

Move the code, and use nested switch rather than conditionals.

* platform/graphics/GraphicsTypes.h:
* platform/graphics/cg/GraphicsContextCG.cpp:
(WebCore::compositeAndBlendToCGBlendMode):
(WebCore::GraphicsContext::setPlatformCompositeOperation):

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

21 months agoIndex properties on cross origin Window objects should be enumerable
cdumez@apple.com [Sun, 5 Nov 2017 00:54:32 +0000 (00:54 +0000)]
Index properties on cross origin Window objects should be enumerable
https://bugs.webkit.org/show_bug.cgi?id=179289

Reviewed by Darin Adler.

LayoutTests/imported/w3c:

Re-sync WPT test after:
- https://github.com/w3c/web-platform-tests/pull/8045

Rebaseline a couple of WPT tests now that more checks are passing.

* web-platform-tests/html/browsers/origin/cross-origin-objects/cross-origin-objects-expected.txt:
* web-platform-tests/html/browsers/origin/cross-origin-objects/cross-origin-objects.html:
* web-platform-tests/html/browsers/the-window-object/window-indexed-properties-expected.txt:

Source/WebCore:

Index properties on cross origin Window objects should be enumerable:
- https://github.com/whatwg/html/pull/3186
- https://github.com/w3c/web-platform-tests/pull/8045

All exposed properties used to be enumerable but we had to revert this in
r224287 because it was not Web-compatible. The HTML specification has now
been updated so that only index properties are enumerable cross origin.

No new tests, rebaselined existing tests.

* bindings/js/JSDOMWindowCustom.cpp:
(WebCore::JSDOMWindow::getOwnPropertySlotByIndex):
(WebCore::JSDOMWindow::getOwnPropertyNames):

LayoutTests:

Update / rebaseline existing test to match new expected behavior.

* js/dom/getOwnPropertyDescriptor-expected.txt:
* js/resources/getOwnPropertyDescriptor.js:

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

21 months agoAdd a GraphicsContextImpl and use it for DispayList::Recorder
simon.fraser@apple.com [Sat, 4 Nov 2017 23:43:55 +0000 (23:43 +0000)]
Add a GraphicsContextImpl and use it for DispayList::Recorder
https://bugs.webkit.org/show_bug.cgi?id=179286

Reviewed by Sam Weinig.

Start moving towards a model when GraphicsContext has a pointer to an implementation
("pimpl") by adding GraphicsContextImpl, and converting display list recording to
be an implementation of a GraphicsContextImpl.

No behavior change.

* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* html/canvas/CanvasRenderingContext2D.cpp:
(WebCore::DisplayListDrawingContext::DisplayListDrawingContext):
* platform/graphics/GraphicsContext.cpp:
(WebCore::GraphicsContext::GraphicsContext):
(WebCore::GraphicsContext::save):
(WebCore::GraphicsContext::restore):
(WebCore::GraphicsContext::setStrokeThickness):
(WebCore::GraphicsContext::setStrokeStyle):
(WebCore::GraphicsContext::setStrokeColor):
(WebCore::GraphicsContext::setShadow):
(WebCore::GraphicsContext::setLegacyShadow):
(WebCore::GraphicsContext::clearShadow):
(WebCore::GraphicsContext::setFillColor):
(WebCore::GraphicsContext::setShadowsIgnoreTransforms):
(WebCore::GraphicsContext::setShouldAntialias):
(WebCore::GraphicsContext::setShouldSmoothFonts):
(WebCore::GraphicsContext::setShouldSubpixelQuantizeFonts):
(WebCore::GraphicsContext::setImageInterpolationQuality):
(WebCore::GraphicsContext::setStrokePattern):
(WebCore::GraphicsContext::setFillPattern):
(WebCore::GraphicsContext::setStrokeGradient):
(WebCore::GraphicsContext::setFillRule):
(WebCore::GraphicsContext::setFillGradient):
(WebCore::GraphicsContext::beginTransparencyLayer):
(WebCore::GraphicsContext::endTransparencyLayer):
(WebCore::GraphicsContext::drawGlyphs):
(WebCore::GraphicsContext::drawImage):
(WebCore::GraphicsContext::drawTiledImage):
(WebCore::GraphicsContext::setTextDrawingMode):
(WebCore::GraphicsContext::fillRect):
(WebCore::GraphicsContext::fillRoundedRect):
(WebCore::GraphicsContext::setAlpha):
(WebCore::GraphicsContext::setCompositeOperation):
(WebCore::GraphicsContext::setDrawLuminanceMask):
(WebCore::GraphicsContext::applyDeviceScaleFactor):
(WebCore::GraphicsContext::fillEllipse):
(WebCore::GraphicsContext::strokeEllipse):
* platform/graphics/GraphicsContext.h:
(WebCore::GraphicsContext::hasPlatformContext const):
(WebCore::GraphicsContext::paintingDisabled const):
(WebCore::GraphicsContext::setDisplayListRecorder): Deleted.
(WebCore::GraphicsContext::isRecording const): Deleted.
* platform/graphics/GraphicsContextImpl.cpp: Added.
(WebCore::GraphicsContextImpl::GraphicsContextImpl):
(WebCore::GraphicsContextImpl::~GraphicsContextImpl):
* platform/graphics/GraphicsContextImpl.h: Added.
(WebCore::GraphicsContextImpl::graphicsContext const):
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::recursiveCommitChanges):
* platform/graphics/cairo/GraphicsContextCairo.cpp:
(WebCore::GraphicsContext::getCTM const):
(WebCore::GraphicsContext::savePlatformState):
(WebCore::GraphicsContext::restorePlatformState):
(WebCore::GraphicsContext::drawRect):
(WebCore::GraphicsContext::drawNativeImage):
(WebCore::GraphicsContext::drawLine):
(WebCore::GraphicsContext::drawEllipse):
(WebCore::GraphicsContext::fillPath):
(WebCore::GraphicsContext::strokePath):
(WebCore::GraphicsContext::fillRect):
(WebCore::GraphicsContext::clip):
(WebCore::GraphicsContext::clipPath):
(WebCore::GraphicsContext::clipBounds const):
(WebCore::GraphicsContext::drawLinesForText):
(WebCore::GraphicsContext::roundToDevicePixels):
(WebCore::GraphicsContext::translate):
(WebCore::GraphicsContext::setPlatformStrokeThickness):
(WebCore::GraphicsContext::setPlatformStrokeStyle):
(WebCore::GraphicsContext::concatCTM):
(WebCore::GraphicsContext::setCTM):
(WebCore::GraphicsContext::beginPlatformTransparencyLayer):
(WebCore::GraphicsContext::endPlatformTransparencyLayer):
(WebCore::GraphicsContext::clearRect):
(WebCore::GraphicsContext::strokeRect):
(WebCore::GraphicsContext::setLineCap):
(WebCore::GraphicsContext::setLineDash):
(WebCore::GraphicsContext::setLineJoin):
(WebCore::GraphicsContext::setMiterLimit):
(WebCore::GraphicsContext::clipOut):
(WebCore::GraphicsContext::rotate):
(WebCore::GraphicsContext::scale):
(WebCore::GraphicsContext::platformFillRoundedRect):
(WebCore::GraphicsContext::fillRectWithRoundedHole):
(WebCore::GraphicsContext::drawPattern):
(WebCore::GraphicsContext::setPlatformShouldAntialias):
(WebCore::GraphicsContext::setPlatformImageInterpolationQuality):
(WebCore::GraphicsContext::isAcceleratedContext const):
* platform/graphics/cg/GraphicsContextCG.cpp:
(WebCore::GraphicsContext::savePlatformState):
(WebCore::GraphicsContext::restorePlatformState):
(WebCore::GraphicsContext::drawNativeImage):
(WebCore::GraphicsContext::drawPattern):
(WebCore::GraphicsContext::drawRect):
(WebCore::GraphicsContext::drawLine):
(WebCore::GraphicsContext::drawEllipse):
(WebCore::GraphicsContext::applyStrokePattern):
(WebCore::GraphicsContext::applyFillPattern):
(WebCore::GraphicsContext::drawPath):
(WebCore::GraphicsContext::fillPath):
(WebCore::GraphicsContext::strokePath):
(WebCore::GraphicsContext::fillRect):
(WebCore::GraphicsContext::platformFillRoundedRect):
(WebCore::GraphicsContext::fillRectWithRoundedHole):
(WebCore::GraphicsContext::clip):
(WebCore::GraphicsContext::clipOut):
(WebCore::GraphicsContext::clipPath):
(WebCore::GraphicsContext::clipBounds const):
(WebCore::GraphicsContext::beginPlatformTransparencyLayer):
(WebCore::GraphicsContext::endPlatformTransparencyLayer):
(WebCore::GraphicsContext::setPlatformShadow):
(WebCore::GraphicsContext::setMiterLimit):
(WebCore::GraphicsContext::clearRect):
(WebCore::GraphicsContext::strokeRect):
(WebCore::GraphicsContext::setLineCap):
(WebCore::GraphicsContext::setLineDash):
(WebCore::GraphicsContext::setLineJoin):
(WebCore::GraphicsContext::scale):
(WebCore::GraphicsContext::rotate):
(WebCore::GraphicsContext::translate):
(WebCore::GraphicsContext::concatCTM):
(WebCore::GraphicsContext::setCTM):
(WebCore::GraphicsContext::getCTM const):
(WebCore::GraphicsContext::roundToDevicePixels):
(WebCore::GraphicsContext::drawLinesForText):
(WebCore::GraphicsContext::setURLForRect):
(WebCore::GraphicsContext::setIsCALayerContext):
(WebCore::GraphicsContext::isCALayerContext const):
(WebCore::GraphicsContext::setIsAcceleratedContext):
(WebCore::GraphicsContext::isAcceleratedContext const):
(WebCore::GraphicsContext::setPlatformTextDrawingMode):
(WebCore::GraphicsContext::setPlatformStrokeColor):
(WebCore::GraphicsContext::setPlatformStrokeThickness):
(WebCore::GraphicsContext::setPlatformFillColor):
(WebCore::GraphicsContext::setPlatformShouldAntialias):
(WebCore::GraphicsContext::setPlatformShouldSmoothFonts):
(WebCore::GraphicsContext::setPlatformAlpha):
(WebCore::GraphicsContext::setPlatformCompositeOperation):
(WebCore::GraphicsContext::platformApplyDeviceScaleFactor):
(WebCore::GraphicsContext::platformFillEllipse):
(WebCore::GraphicsContext::platformStrokeEllipse):
(WebCore::GraphicsContext::setDestinationForRect):
(WebCore::GraphicsContext::addDestinationAtPoint):
* platform/graphics/cocoa/GraphicsContextCocoa.mm:
(WebCore::GraphicsContext::drawFocusRing):
* platform/graphics/displaylists/DisplayListRecorder.cpp:
(WebCore::DisplayList::Recorder::Recorder):
(WebCore::DisplayList::Recorder::updateItemExtent const):
(WebCore::DisplayList::Recorder::extentFromLocalBounds const):
* platform/graphics/displaylists/DisplayListRecorder.h:
(WebCore::DisplayList::Recorder::itemCount const):
* rendering/RenderTheme.cpp:
(WebCore::RenderTheme::paint):

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

21 months agoREGRESSION(r223718): Leaking WebProcessPool after reconfiguration
cdumez@apple.com [Sat, 4 Nov 2017 23:01:56 +0000 (23:01 +0000)]
REGRESSION(r223718): Leaking WebProcessPool after reconfiguration
https://bugs.webkit.org/show_bug.cgi?id=179123
<rdar://problem/35294685>

Reviewed by Geoff Garen.

Make sure we destroy the ServiceWorker WebProcess once all other WebProcesses
go away at there is no use keeping it running at this point. Also, this prevents
leaking the WebProcessPool since the WebProcessProxy holds a strong reference
to the WebProcessPool.

* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::disconnectProcess):

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

21 months ago[LayoutState cleanup] Move all LayoutState* classes to LayoutState.h/cpp
zalan@apple.com [Sat, 4 Nov 2017 22:02:39 +0000 (22:02 +0000)]
[LayoutState cleanup] Move all LayoutState* classes to LayoutState.h/cpp
https://bugs.webkit.org/show_bug.cgi?id=179280
<rdar://problem/35348452>

Reviewed by Antti Koivisto.

No change in functionality.

* page/LayoutContext.cpp:
(WebCore::SubtreeLayoutStateMaintainer::SubtreeLayoutStateMaintainer): Deleted.
(WebCore::SubtreeLayoutStateMaintainer::~SubtreeLayoutStateMaintainer): Deleted.
(WebCore::SubtreeLayoutStateMaintainer::shouldDisableLayoutStateForSubtree): Deleted.
* rendering/LayoutState.cpp:
(WebCore::LayoutStateMaintainer::LayoutStateMaintainer):
(WebCore::LayoutStateMaintainer::~LayoutStateMaintainer):
(WebCore::LayoutStateMaintainer::push):
(WebCore::LayoutStateMaintainer::pop):
(WebCore::LayoutStateDisabler::LayoutStateDisabler):
(WebCore::LayoutStateDisabler::~LayoutStateDisabler):
(WebCore::shouldDisableLayoutStateForSubtree):
(WebCore::SubtreeLayoutStateMaintainer::SubtreeLayoutStateMaintainer):
(WebCore::SubtreeLayoutStateMaintainer::~SubtreeLayoutStateMaintainer):
(WebCore::PaginatedLayoutStateMaintainer::PaginatedLayoutStateMaintainer):
(WebCore::PaginatedLayoutStateMaintainer::~PaginatedLayoutStateMaintainer):
* rendering/LayoutState.h:
(WebCore::LayoutStateMaintainer::didPush const):
* rendering/RenderBlockFlow.cpp:
(WebCore::PaginatedLayoutStateMaintainer::PaginatedLayoutStateMaintainer): Deleted.
(WebCore::PaginatedLayoutStateMaintainer::~PaginatedLayoutStateMaintainer): Deleted.
(): Deleted.
* rendering/RenderView.h:
(WebCore::LayoutStateMaintainer::LayoutStateMaintainer): Deleted.
(WebCore::LayoutStateMaintainer::~LayoutStateMaintainer): Deleted.
(WebCore::LayoutStateMaintainer::push): Deleted.
(WebCore::LayoutStateMaintainer::pop): Deleted.
(WebCore::LayoutStateMaintainer::didPush const): Deleted.
(WebCore::LayoutStateDisabler::LayoutStateDisabler): Deleted.
(WebCore::LayoutStateDisabler::~LayoutStateDisabler): Deleted.

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

21 months ago[LayoutState cleanup] Move offset/cliprect/pagination code to dedicate methods
zalan@apple.com [Sat, 4 Nov 2017 21:41:10 +0000 (21:41 +0000)]
[LayoutState cleanup] Move offset/cliprect/pagination code to dedicate methods
https://bugs.webkit.org/show_bug.cgi?id=179279
<rdar://problem/35348171>

Reviewed by Antti Koivisto.

This is in preparation for creating the initial LayoutSate through LayoutStateMaintainer.

Moving code around. No change in functionality.

* rendering/LayoutState.cpp:
(WebCore::LayoutState::LayoutState):
(WebCore::LayoutState::computeOffsets):
(WebCore::LayoutState::computeClipRect):
(WebCore::LayoutState::computePaginationInformation):
* rendering/LayoutState.h:

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

21 months agoSimplify event dispatch code and make it a bit more consistent
darin@apple.com [Sat, 4 Nov 2017 21:19:11 +0000 (21:19 +0000)]
Simplify event dispatch code and make it a bit more consistent
https://bugs.webkit.org/show_bug.cgi?id=178991

Reviewed by Chris Dumez.

Source/WebCore:

Straighten out event dispatch code in three ways:

1) Add an Event::resetAfterDispatch function, and use it instead of the multiple
   separate functions that were used before to reset after dispatching. This fixed
   an extremely minor bug where we would leave some kinds of state on some event
   objects in unusual cases after dispatching the events.

2) Remove IDBEventDispatcher and make its callers use EventDispatcher instead.
   This leaves us with one less event dispatch code path to maintain, more shared code.

3) Remove boolean return values from functions that take event objects and
   dispatch the events. The return values are redundant with various things that
   can be checked by looking at the event itself. The legacy return value indicates
   whether the event has its "canceled flag" set, which means that the default
   behavior should be prevented. If that is what we need to check, it's easier
   to read the code and see that it's correct if it calls the named function
   "defaultPrevented" directly. More importantly, callers can also call whatever
   other function is appropriate to ask the specific relevant question to their needs.
   The general rule is that default behavior that we want to allow even with an
   untrusted event can be inside a default event handler function. Default behavior
   that should only happen for the browser-generated event can and should be done
   after dispatching the event, in the code that dispatches it; but that requires
   explicitly checking "defaultPrevented".

* Modules/indexeddb/IDBDatabase.cpp:
(WebCore::IDBDatabase::dispatchEvent): Removed boolean return value.
* Modules/indexeddb/IDBDatabase.h: Ditto.

* Modules/indexeddb/IDBEventDispatcher.cpp: Removed.
* Modules/indexeddb/IDBEventDispatcher.h: Removed.

* Modules/indexeddb/IDBOpenDBRequest.cpp:
(WebCore::IDBOpenDBRequest::dispatchEvent): Removed boolean return value.
Added protection for "this" since the function accesses it after dispatching the event.
* Modules/indexeddb/IDBOpenDBRequest.h: Ditto.

* Modules/indexeddb/IDBRequest.cpp:
(WebCore::IDBRequest::dispatchEvent): Removed boolean return value. Instead of using
IDBEventDispatcher, use EventDispatcher's new function that takes an initializer_list
with a list of event targets. Added protection for "this" since the function accesses
it after dispatching the event.
* Modules/indexeddb/IDBRequest.h: Ditto.
* Modules/indexeddb/IDBTransaction.cpp:
(WebCore::IDBTransaction::dispatchEvent): Ditto.
* Modules/indexeddb/IDBTransaction.h: Ditto.

* Modules/mediastream/RTCPeerConnection.cpp:
(WebCore::RTCPeerConnection::dispatchEvent): Removed boolean return value.
* Modules/mediastream/RTCPeerConnection.h: Ditto.
* Modules/paymentrequest/PaymentRequest.cpp:
(WebCore::PaymentRequest::shippingAddressChanged): Don't dispatch an event if
m_isUpdating is true; preserves behavior that was implemented in
PaymentRequest::dispatchEvent before. Since this is the source of the trusted
event, cleaner to implement the rule here instead of overriding dispatchEvent.
(WebCore::PaymentRequest::shippingOptionChanged): Ditto.
(WebCore::PaymentRequest::dispatchEvent): Deleted.
* Modules/paymentrequest/PaymentRequest.h: Ditto.

* Sources.txt: Removed IDBEventDispatcher.cpp.
* WebCore.xcodeproj/project.pbxproj: Removed IDBEventDispatcher.h/cpp.

* dom/Element.cpp:
(WebCore::Element::dispatchMouseEvent): Updated to call defaultPrevented
directly instead of using the return value of dispatchEvent.
(WebCore::Element::dispatchWheelEvent): Ditto.
(WebCore::Element::dispatchKeyEvent): Ditto.
(WebCore::Element::dispatchFocusInEvent): Removed assertion, since the
underlying event dispatching takes care of it.
(WebCore::Element::dispatchFocusOutEvent): Ditto.
(WebCore::Element::dispatchFocusEvent): Call dispatchEvent instead of
calling EventDispatcher::dispatchEvent. There is no good reason to use
EventDispatcher directly.
(WebCore::Element::dispatchBlurEvent): Ditto.

* dom/Event.cpp:
(WebCore::Event::eventInterface const): Deleted. Moved into header since this is
short and if called in a non-polymorphic context it's good to have it be inlined.
(WebCore::Event::isUIEvent const): Ditto.
(WebCore::Event::isMouseEvent const): Ditto.
(WebCore::Event::isFocusEvent const): Ditto.
(WebCore::Event::isKeyboardEvent const): Ditto.
(WebCore::Event::isInputEvent const): Ditto.
(WebCore::Event::isCompositionEvent const): Ditto.
(WebCore::Event::isTouchEvent const): Ditto.
(WebCore::Event::isClipboardEvent const): Ditto.
(WebCore::Event::isBeforeTextInsertedEvent const): Ditto.
(WebCore::Event::isBeforeUnloadEvent const): Ditto.
(WebCore::Event::isErrorEvent const): Ditto.
(WebCore::Event::isTextEvent const): Ditto.
(WebCore::Event::isWheelEvent const): Ditto.
(WebCore::Event::receivedTarget): Ditto.
(WebCore::Event::resetAfterDispatch): Added. Replaces functions like
clearEventPath and resetPropagationFlags, covering all the things we need to clear
after dispatching an event.

* dom/Event.h: Removed some unneeded includes and forward declarations. Moved bodies
of multi-line inline member functions out of the class definition. Changed argument
type of setEventPhase and m_eventPhase to an enum rather than just an integer, since
only the getter is for use from the bindings. Removed clearEventPath, srcElement, and
resetPropagationFlags. Sorted the isXXX functions alphabetically and removed previous
attempts to make categories out of them. Marked the constructor explicit since it has
a single argument. Moved trivially short bodies into the class definition.

* dom/Event.idl: Use ImplementedAs to implement srcElement so we don't need it in
the C++ code.

* dom/EventContext.cpp:
(WebCore::EventContext::EventContext): Removed assertion since we now handle event
contexts without nodes so we can use this to dispatch events for IDB, for example.
(WebCore::EventContext::handleLocalEvents const): Add code to handle non-node event
targets by calling fireEventListeners directly.
(WebCore::MouseOrFocusEventContext::MouseOrFocusEventContext): Take a reference
insetad of a pointer for the node.
(WebCore::TouchEventContext::TouchEventContext): Ditto.
(WebCore::TouchEventContext::handleLocalEvents const): Streamline a bit by improving
the checkReachability function to be easier to call. Also removed an unneeded assertion
just before calling downcast<>, the same assertion that downcast<> itself does.
(WebCore::TouchEventContext::checkReachability const): Chagned argument type to take
a Ref& so the caller doesn't have to call get() or ptr().

* dom/EventContext.h: Removed unneeded FIXME and currentTargetSameAsTarget function.
Changed arguemnt types to use Node& instead of Node* as appropriate. Removed unused
functions from TouchEventContext, made more private, and changed data members to Ref
instead of RefPtr. Removed unused NotTouchList value from TouchListType enumeration.
Changed touchList function to return a reference instead of a pointer.

* dom/EventDispatcher.cpp: Removed unneeded includes.
(WebCore::dispatchEventInDOM): Removed use of currentTargetSameAsTarget since it's
clearer if written out.
(WebCore::EventDispatcher::dispatchEvent): Changed no-event dispatch assertion to
use RELEASE_ASSERT_WITH_SECURITY_IMPLICATION since the style checker says so, but
it still doesn't assert anything in release builds because the check in
NoEventDispatchAssertion itself is debug-only. Moved the calls to EventPath's
setRelatedTarget and retargetTouchLists functions inside the EventPath constructor.
Removed the second no-event dispatch assertion because we only need one. Replaced
calls to clearEventPath, setCurrentTarget(nullptr), resetPropagationFlags,
and setEventPhase(NONE) and with a call to resetAfterDispatch. Moved the code that
temporarily sets the target to a different value when calling default event handlers
into the block that calls the default event handlers. Added a new overload that
takes an initializer list of event targets so we can dispatch events that are not
being sent to nodes.

* dom/EventDispatcher.h: Fixed misleading copyright dates and names since this file
just contains a couple of function declarations. Added new overload of dispatchEvent.

* dom/EventPath.cpp:
(WebCore::WindowEventContext::WindowEventContext): Take references instead of pointers.
(WebCore::EventPath::EventPath): Moved the bulk of construction into a new function
named buildPath, so it can still use "return" without skipping the additions here.
Added calls to setRelatedTarget and retargetTouchLists and now both can be private.
Also added a new overload that takes event targets that are not nodes.
(WebCore::EventPath::buildPath): Added. Contains what used to be in the constructor.
But use some references instead of pointers and refactor a bit using lambdas.
(WebCore::EventPath::retargetTouchList): Added. Makes the retargetTouchLists function
shorter and less repetetive.
(WebCore::EventPath::retargetTouchLists): Updated to call retargetTouchList.
(WebCore::EventPath::hasEventListeners const): Deleted. This was unused.
* dom/EventPath.h: Added a constructor that takes an initializer list of event targets.
Made retargetTouchEvents and setRelatedTarget private and used them in the constructor
insead of expecting clients to call them. Removed unused hasEventListeners and
lastContextIfExists functions. Moved body of the eventTargetRespectingTargetRules
function out of the class definition.

* dom/EventTarget.cpp:
(WebCore::EventTarget::dispatchEventForBindings): Updated so it does not expect
dispatchEvent to return a boolean. Instead call a function on the event after dispatching.
Decided to use legacyReturnValue instead of !defaultPrevented, because this is exactly
the return value that the returnValue property is referring to.
(WebCore::EventTarget::dispatchEvent): Removed return value. Replaced calls to
resetPropagationFlags and setEventPhase(NONE) with a call to resetAfterDispatch.
I noticed that there was a local boolean here named "defaultPrevented", which was
backwards; the value in that local was "default not prevented". Doesn't matter since
the boolean return value was removed.
(WebCore::EventTarget::fireEventListeners): Removed the boolean return value.

* dom/EventTarget.h: Added initial values to members of ListenerOptions and
AddEventListenerOptions; maybe we can get rid of the constructors some day.
Removed booelan return values from dispatchEvent and fireEventListeners.

* dom/KeyboardEvent.cpp: Removed unneeded include of EventDispatcher.h.

* dom/Node.cpp:
(WebCore::Node::dispatchEvent): Got rid of boolean return value.
Removed special case code that sometimes called dispatchTouchEvent, since that
just turns around and calls EventDispatcher::dispatchEvent just like this function.
(WebCore::Node::dispatchDOMActivateEvent): Removed boolean return value, removed
integer detail argument and moved the logic to compute the value of the detail
peroprty and to call setDefaultHandled on the underlying click event in here.
This is a private helper function used only in one place.
(WebCore::Node::dispatchTouchEvent): Deleted.
(WebCore::Node::defaultEventHandler): Updated for change to dispatchDOMActivateEvent.
* dom/Node.h: Updated for the above changes.

* dom/RejectedPromiseTracker.cpp:
(WebCore::RejectedPromiseTracker::reportUnhandledRejections): Use defaultPrevented
directly instead of the return value from dispatchEvent.

* dom/ScopedEventQueue.cpp:
(WebCore::ScopedEventQueue::enqueueEvent): Moved assertions here ...
(WebCore::ScopedEventQueue::dispatchEvent const): ... from here. Also changed this
to call Node::dispatchEvent instead of calling EventDispatcher::dispatchEvent directly.

* dom/SimulatedClick.cpp:
(WebCore::simulateMouseEvent): Call Element::dispatchEvent instead of calling
EventDispatcher::dispatchEvent directly.

* editing/Editor.cpp:
(WebCore::dispatchBeforeInputEvent): Use defaultPrevented directly instead of the
return value from dispatchEvent.
* editing/FrameSelection.cpp:
(WebCore::FrameSelection::selectAll): Ditto.
(WebCore::FrameSelection::dispatchSelectStart): Ditto.

* html/CheckboxInputType.cpp:
(WebCore::CheckboxInputType::didDispatchClick): Take a reference instead of a pointer.
* html/CheckboxInputType.h: Updated for above and to use final instead of override.

* html/HTMLFormControlElement.cpp:
(WebCore::HTMLFormControlElement::checkValidity): Use defaultPrevented directly instead
of the return value from dispatchEvent.

* html/HTMLFormElement.cpp:
(WebCore::HTMLFormElement::prepareForSubmission): Use defaultPrevented directly instead
of the return value from dispatchEvent.
(WebCore::HTMLFormElement::reset): Ditto.

* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::didDispatchClickEvent): Updated to pass references instead
of pointer.

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::dispatchEvent): Got rid of boolean return value.
* html/HTMLMediaElement.h: Ditto.

* html/HTMLPlugInElement.h: Use "delete" instead of just a private function for something
that should never be called.

* html/InputType.cpp:
(WebCore::InputType::didDispatchClick): Take a reference instead of a pointer.
* html/InputType.h: Ditto.
* html/RadioInputType.cpp:
(WebCore::RadioInputType::didDispatchClick): Ditto.
* html/RadioInputType.h: Updated for above and to use final instead of override.

* html/track/TextTrackCue.cpp:
(WebCore::TextTrackCue::dispatchEvent): Got rid of boolean return value.
* html/track/TextTrackCue.h: Ditto.

* inspector/InspectorInstrumentation.cpp: Removed unneeded include of EventDispatcher.h.

* page/DOMWindow.cpp:
(WebCore::DOMWindow::dispatchLoadEvent): Streamlined code a bit so we only have a single
call to dispatchEvent. Improved comments.
(WebCore::DOMWindow::dispatchEvent): Removed return value. Added comments. Replaced
calls to setCurrentTarget(null), setEventPhase(NONE), and resetPropagationFlags with
a call to resetAfterDispatch.
* page/DOMWindow.h: Updated to get rid of the boolean return value.

* page/DragController.cpp:
(WebCore::DragController::dispatchTextInputEventFor): Use defaultPrevented directly instead
of the return value from dispatchEvent.

* page/EventHandler.cpp:
(WebCore::dispatchSelectStart): Use defaultPrevented directly instead
of the return value from dispatchEvent.
(WebCore::EventHandler::accessibilityPreventsEventPropagation): Fixed spelling error in the
name of this function.
(WebCore::EventHandler::dispatchDragSrcEvent): Got rid of boolean return value.
(WebCore::EventHandler::handleTouchEvent): Call dispatchEvent instead of dispatchTouchEvent;
there was no difference between the two except that dispatchTouchEvent required downcasting
and might some day lead to us missing some behavior implemented in an override to dispatchEvent.
* page/EventHandler.h: Updated for above changes.

* platform/graphics/filters/FilterOperation.h:
(WebCore::FilterOperation::clone): Removed dead code that was causing a compiler warning.

* workers/WorkerMessagingProxy.cpp:
(WebCore::WorkerMessagingProxy::postExceptionToWorkerObject): Use defaultPrevented
directly instead of the return value from dispatchEvent.

Source/WebKit:

* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMEvent.cpp:
(webkit_dom_event_get_src_element): Call target instead of srcElement.

Source/WebKitLegacy/mac:

* DOM/DOMEvent.mm:
(-[DOMEvent srcElement]): Call target instead of srcElement.

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

21 months ago[GTK] Fix gtk-doc generation with gtk-doc master
mcatanzaro@igalia.com [Sat, 4 Nov 2017 16:47:46 +0000 (16:47 +0000)]
[GTK] Fix gtk-doc generation with gtk-doc master
https://bugs.webkit.org/show_bug.cgi?id=179252

Reviewed by Carlos Garcia Campos.

gtkdoc-scangobj has changed to no longer use a shell when executing its subcommands. In
particular, this means we can no longer rely on shell stuff in our run command that we use
to run the scanner. We currently use the RUN envvar to set LD_LIBRARY_PATH, and the end
result is gtkdoc-scangobj now attempts to execute our environment variable instead of the
scanner itself. We can just set LD_LIBRARY_PATH directly, instead of using RUN, in order to
make documentation generation work again.

* gtk/gtkdoc.py:
(GTKDoc._run_gtkdoc_scangobj):

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

21 months ago[Touch Bar Web API] Add support for menuitem tag
commit-queue@webkit.org [Sat, 4 Nov 2017 08:20:03 +0000 (08:20 +0000)]
[Touch Bar Web API] Add support for menuitem tag
https://bugs.webkit.org/show_bug.cgi?id=179020

Patch by Aishwarya Nirmal <anirmal@apple.com> on 2017-11-04
Reviewed by Ryosuke Niwa.

Source/WebCore:

The Touch Bar Web API will make use of the menu and menuitem tags
to represent the NSTouchBar and NSTouchBarItem respectively.
Since WebKit currently does not offer support for the menuitem tag,
this change adds it in. There is a runtime flag for this tag, which
is set to false by default.

A specification for the menuitem element can be found at
https://www.w3.org/TR/2013/WD-html51-20130528/interactive-elements.html#the-menuitem-element.
More attributes of this element will be implemented in future patches.

Test: fast/html/menuitem-element.html

* CMakeLists.txt:
* DerivedSources.cpp:
* DerivedSources.make:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/WebCoreBuiltinNames.h:
* html/HTMLElementsAllInOne.cpp:
* html/HTMLMenuItemElement.cpp: Added.
(WebCore::HTMLMenuItemElement::HTMLMenuItemElement):
(WebCore::HTMLMenuItemElement::create):
* html/HTMLMenuItemElement.h: Added.
* html/HTMLMenuItemElement.idl: Added.
* html/HTMLTagNames.in:
* page/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::setMenuItemElementEnabled):
(WebCore::RuntimeEnabledFeatures::menuItemElementEnabled const):

Source/WebKit:

Adds in the MenuItemElementEnabled flag so that the menu item element is a runtime-
enabled feature. It has a default value of false.

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

Source/WebKitLegacy/mac:

Adds in properties and methods that allow the menuitem runtime feature
to be enabled or disabled.

* WebView/WebPreferenceKeysPrivate.h:
* WebView/WebPreferences.mm:
(-[WebPreferences menuItemElementEnabled]):
(-[WebPreferences setMenuItemElementEnabled:]):
* WebView/WebPreferencesPrivate.h:
* WebView/WebView.mm:
(-[WebView _preferencesChanged:]):

Tools:

Defines flags for the menu item test so that the element is recognized
only while its test is being run.

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

LayoutTests:

This test ensures that the menuitem element is recognized when
its runtime feature is turned on.

* fast/html/menuitem-element-expected.txt: Added.
* fast/html/menuitem-element.html: Added.

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

21 months agoWeb Inspector: add contextmenu item to arbitrarily add HTML/Child to DOMTree
webkit@devinrousso.com [Sat, 4 Nov 2017 08:03:32 +0000 (08:03 +0000)]
Web Inspector: add contextmenu item to arbitrarily add HTML/Child to DOMTree
https://bugs.webkit.org/show_bug.cgi?id=179042

Reviewed by Joseph Pecoraro.

* Localizations/en.lproj/localizedStrings.js:

* UserInterface/Models/DOMNode.js:
(WI.DOMNode.prototype.insertAdjacentHTML.inspectedPage_node_insertAdjacentHTML):
(WI.DOMNode.prototype.insertAdjacentHTML):
Call-through to `insertAdjacentHTML` on the corresponding node in the inspected page.

* UserInterface/Views/DOMTreeElement.js:
(WI.DOMTreeElement):
(WI.DOMTreeElement.prototype._populateNodeContextMenu):
(WI.DOMTreeElement.prototype._startEditingAsHTML.dispose):
(WI.DOMTreeElement.prototype._startEditingAsHTML):
(WI.DOMTreeElement.prototype._insertAdjacentHTML.commitCallback):
(WI.DOMTreeElement.prototype._insertAdjacentHTML):
(WI.DOMTreeElement.prototype.updateTitle):
(WI.DOMTreeElement.prototype._singleTextChild):
(WI.DOMTreeElement.prototype._nodeTitleInfo):
(WI.DOMTreeElement.prototype._addHTML):
(WI.DOMTreeElement.prototype._addPreviousSibling):
(WI.DOMTreeElement.prototype._addNextSibling):
(WI.DOMTreeElement.prototype._editAsHTML):
Adjust where the editing element is placed depending on the options passed to `_editAsHTML`.
If the placement is as a child, put it inside the child list. If the placement is as a
sibling, place it before/after the selected TreeElement. Otherwise, add it as a child.

* UserInterface/Views/DOMTreeOutline.css:
(.tree-outline.dom):
(.tree-outline.dom li):
(.tree-outline.dom li:not(.editing)):
(.tree-outline.dom li.editing):
(body[dir=ltr] .tree-outline.dom li): Deleted.
(body[dir=rtl] .tree-outline.dom li): Deleted.
Don't add padding when the list item is being edited.

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

21 months agoLayoutState should take RenderBox reference.
zalan@apple.com [Sat, 4 Nov 2017 05:40:22 +0000 (05:40 +0000)]
LayoutState should take RenderBox reference.
https://bugs.webkit.org/show_bug.cgi?id=179272
<rdar://problem/35345247>

Reviewed by Simon Fraser.

No change in functionality.

* rendering/LayoutState.cpp:
(WebCore::LayoutState::LayoutState):
(WebCore::LayoutState::propagateLineGridInfo):
(WebCore::LayoutState::establishLineGrid):
* rendering/LayoutState.h: type tightening.
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::offsetFromLogicalTopOfFirstPage const):
* rendering/RenderView.cpp:
(WebCore::RenderView::pushLayoutState):
* rendering/RenderView.h:

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

21 months agoUnreviewed, rolling out r224438.
cdumez@apple.com [Sat, 4 Nov 2017 05:19:45 +0000 (05:19 +0000)]
Unreviewed, rolling out r224438.

Has caused assertions on the bots

Reverted changeset:

"REGRESSION(r223718): Leaking WebProcessPool after
reconfiguration"
https://bugs.webkit.org/show_bug.cgi?id=179123
https://trac.webkit.org/changeset/224438

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

21 months agoImplement ServiceWorkerContainer.getRegistration
cdumez@apple.com [Sat, 4 Nov 2017 02:12:06 +0000 (02:12 +0000)]
Implement ServiceWorkerContainer.getRegistration
https://bugs.webkit.org/show_bug.cgi?id=179253

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

LayoutTests/imported/w3c:

* web-platform-tests/service-workers/service-worker/activation.https-expected.txt:
* web-platform-tests/service-workers/service-worker/claim-affect-other-registration.https-expected.txt:
* web-platform-tests/service-workers/service-worker/claim-with-redirect.https-expected.txt:
* web-platform-tests/service-workers/service-worker/getregistration.https-expected.txt:
* web-platform-tests/service-workers/service-worker/multi-globals/url-parsing.https-expected.txt:
* web-platform-tests/service-workers/service-worker/navigate-window.https-expected.txt:
* web-platform-tests/service-workers/service-worker/registration-iframe.https-expected.txt:
* web-platform-tests/service-workers/service-worker/skip-waiting-without-using-registration.https-expected.txt:
* web-platform-tests/service-workers/service-worker/synced-state.https-expected.txt:

Source/WebCore:

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

Added a map of ServiceWorkerRegistration in ServiceWorkerContainer.
Removing a similar map from SWClientConnection as it is more convenient to have this map per ScriptExecutionContext.

This map allows returning the same JS object for different getRegistration.
Delegating the actual matching to SWServer::Connection which is implemented on the StorageProcess through IPC.

* workers/service/ServiceWorkerContainer.cpp:
(WebCore::ServiceWorkerContainer::getRegistration):
(WebCore::ServiceWorkerContainer::jobResolvedWithRegistration):
(WebCore::ServiceWorkerContainer::jobDidFinish):
* workers/service/ServiceWorkerContainer.h:
* workers/service/ServiceWorkerContainer.idl:
* workers/service/ServiceWorkerRegistration.cpp:
(WebCore::ServiceWorkerRegistration::ServiceWorkerRegistration):
(WebCore::ServiceWorkerRegistration::~ServiceWorkerRegistration):
* workers/service/ServiceWorkerRegistration.h:
* workers/service/server/SWClientConnection.cpp:
(WebCore::SWClientConnection::updateRegistrationState):
(WebCore::SWClientConnection::addServiceWorkerRegistration): Deleted.
(WebCore::SWClientConnection::removeServiceWorkerRegistration): Deleted.
* workers/service/server/SWClientConnection.h:

LayoutTests:

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

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

21 months ago[iOS-WK1] Fix thread safety issue in WebSQLiteDatabaseTrackerClient
cdumez@apple.com [Sat, 4 Nov 2017 01:57:57 +0000 (01:57 +0000)]
[iOS-WK1] Fix thread safety issue in WebSQLiteDatabaseTrackerClient
https://bugs.webkit.org/show_bug.cgi?id=179190

Reviewed by David Kilzer.

WebSQLiteDatabaseTrackerClient and its HystererisActivity member are constructed on the UIThread. The
HystererisActivity activity also fires on the UIThread, which means that WebSQLiteDatabaseTrackerClient::hysteresisUpdated()
gets called on the UIThread.

However, the code in WebSQLiteDatabaseTrackerClient::willBeginFirstTransaction() / WebSQLiteDatabaseTrackerClient::didFinishLastTransaction()
uses callOnMainThread() before calling methods on the HysteresisActivity. callOnMainThread() dispatches to the WebThread on WK1 iOS, which
would lead to crashes when calling methods of the HystererisActivity object:
*** -[CFRunLoopTimer respondsToSelector:]: message sent to deallocated instance 0x1c0b6a500

To address the issue, we now dispatch_async() to the main queue in willBeginFirstTransaction() / didFinishLastTransaction()
instead of using callOnMainThread(). I also added assertions to catch issues like these.

* platform/ios/WebSQLiteDatabaseTrackerClient.mm:
(WebCore::WebSQLiteDatabaseTrackerClient::willBeginFirstTransaction):
(WebCore::WebSQLiteDatabaseTrackerClient::didFinishLastTransaction):
(WebCore::WebSQLiteDatabaseTrackerClient::hysteresisUpdated):

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

21 months agoASSERTION FAILED: NoEventDispatchAssertion::InMainThread::isEventAllowed() || (frameV...
rniwa@webkit.org [Sat, 4 Nov 2017 00:36:08 +0000 (00:36 +0000)]
ASSERTION FAILED: NoEventDispatchAssertion::InMainThread::isEventAllowed() || (frameView && frameView->isInChildFrameWithFrameFlattening())
https://bugs.webkit.org/show_bug.cgi?id=179259

Reviewed by Youenn Fablet.

Avoid updating the layout inside HTMLMediaElement::stop() and MediaElementSession::~MediaElementSession

No new tests since existing tests cover this.

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::userCancelledLoad): Don't update VTT cues when the active DOM objects are being stopped.
* platform/audio/mac/MediaSessionManagerMac.mm:
(WebCore::MediaSessionManagerMac::removeSession): Update the updateNowPlayingInfo asynchronously
since this function can be called inside HTMLMediaElement::~HTMLMediaElement.

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

21 months agoAdd WEBCORE_EXPORT to CachedResourceHandleBase
achristensen@apple.com [Sat, 4 Nov 2017 00:35:08 +0000 (00:35 +0000)]
Add WEBCORE_EXPORT to CachedResourceHandleBase
https://bugs.webkit.org/show_bug.cgi?id=179251

* loader/cache/CachedResourceHandle.h:
(WebCore::CachedResourceHandleBase::get const): Deleted.
(WebCore::CachedResourceHandleBase::operator! const): Deleted.
(WebCore::CachedResourceHandleBase::operator UnspecifiedBoolType const): Deleted.
(WebCore::CachedResourceHandleBase::operator=): Deleted.
I'll need this soon for bug 179251, and having to touch CachedResourceHandle.h causes me to rebuild everything.
Committing it separately greatly increases my debugging and comparison speed.

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

21 months agoUnreviewed, rolling out r224428, r224435, and r224440.
ryanhaddad@apple.com [Fri, 3 Nov 2017 23:32:07 +0000 (23:32 +0000)]
Unreviewed, rolling out r224428, r224435, and r224440.
https://bugs.webkit.org/show_bug.cgi?id=179274

Broke iOS and internal builds (Requested by ryanhaddad on
#webkit).

Reverted changesets:

"Use VCP H264 encoder for platforms supporting it"
https://bugs.webkit.org/show_bug.cgi?id=179076
https://trac.webkit.org/changeset/224428

"Use VCP H264 encoder for platforms supporting it"
https://bugs.webkit.org/show_bug.cgi?id=179076
https://trac.webkit.org/changeset/224435

"Use VCP H264 encoder for platforms supporting it"
https://bugs.webkit.org/show_bug.cgi?id=179076
https://trac.webkit.org/changeset/224440

Patch by Commit Queue <commit-queue@webkit.org> on 2017-11-03

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

21 months agoWeb Inspector: Uncaught Exception: null is not an object (evaluating 'selector.specif...
nvasilyev@apple.com [Fri, 3 Nov 2017 23:31:50 +0000 (23:31 +0000)]
Web Inspector: Uncaught Exception: null is not an object (evaluating 'selector.specificity.map') (at SpreadsheetCSSStyleDeclarationSection.js:199:51)
https://bugs.webkit.org/show_bug.cgi?id=179225
<rdar://problem/35329019>

Reviewed by Joseph Pecoraro.

* UserInterface/Views/SpreadsheetCSSStyleDeclarationSection.js:
(WI.SpreadsheetCSSStyleDeclarationSection.prototype._renderSelector):
selector.specificity may not exist when the selector is dynamic and doesn't match the selected element.

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

21 months agoUse VCP H264 encoder for platforms supporting it
commit-queue@webkit.org [Fri, 3 Nov 2017 23:21:47 +0000 (23:21 +0000)]
Use VCP H264 encoder for platforms supporting it
https://bugs.webkit.org/show_bug.cgi?id=179076
rdar://problem/35180773

Unreviewed.

Patch by Youenn Fablet <youenn@apple.com> on 2017-11-03

* Source/webrtc/sdk/objc/Framework/Classes/VideoProcessing/encoder_vcp.h: build fix for iOS.

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

21 months agoRequests handled by Service Worker should not go through preflighting
commit-queue@webkit.org [Fri, 3 Nov 2017 23:09:28 +0000 (23:09 +0000)]
Requests handled by Service Worker should not go through preflighting
https://bugs.webkit.org/show_bug.cgi?id=179250

Patch by Youenn Fablet <youenn@apple.com> on 2017-11-03
Reviewed by Alex Christensen.

Source/WebCore:

Test: http/tests/workers/service/service-worker-crossorigin-fetch.html
In case of cross origin requests needed preflighting that may be served through SW, the following is done:
- Bypass preflight
- Put service workers mode as Only so that if SW is not handling the request, the load will fail
- If load fails, restart DocumentThreadableLoader load with preflight.

Additional testing should be added when we properly handle the case where no fetch event handler is registered in the service worker.

* loader/DocumentThreadableLoader.cpp:
(WebCore::DocumentThreadableLoader::makeCrossOriginAccessRequest):
(WebCore::DocumentThreadableLoader::didFail):
* loader/DocumentThreadableLoader.h:
* loader/ResourceLoaderOptions.h:
* loader/cache/CachedResourceRequest.cpp:
(WebCore::CachedResourceRequest::setSelectedServiceWorkerIdentifierIfNeeded):
* platform/network/ResourceErrorBase.h:

Source/WebKit:

* WebProcess/Network/WebLoaderStrategy.cpp:
(WebKit::WebLoaderStrategy::scheduleLoad):
* WebProcess/Storage/WebSWClientConnection.cpp:
(WebKit::WebSWClientConnection::startFetch):
* WebProcess/Storage/WebServiceWorkerProvider.cpp:
(WebKit::shouldHandleFetch):

LayoutTests:

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

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

21 months agoREGRESSION(r223718): Leaking WebProcessPool after reconfiguration
cdumez@apple.com [Fri, 3 Nov 2017 23:02:16 +0000 (23:02 +0000)]
REGRESSION(r223718): Leaking WebProcessPool after reconfiguration
https://bugs.webkit.org/show_bug.cgi?id=179123
<rdar://problem/35294685>

Reviewed by Geoffrey Garen.

Make sure we destroy the ServiceWorker WebProcess once all other WebProcesses
go away at there is no use keeping it running at this point. Also, this prevents
leaking the WebProcessPool since the WebProcessProxy holds a strong reference
to the WebProcessPool.

* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::disconnectProcess):

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

21 months ago[iOS] Append the platform name to the product directory on all embedded platforms
aestes@apple.com [Fri, 3 Nov 2017 22:49:17 +0000 (22:49 +0000)]
[iOS] Append the platform name to the product directory on all embedded platforms
https://bugs.webkit.org/show_bug.cgi?id=179271

Reviewed by Joseph Pecoraro.

* Scripts/webkitdirs.pm:
(determineConfigurationProductDir):

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

21 months agoRemove redundant LayoutStateMaintainer argument (RenderView&)
zalan@apple.com [Fri, 3 Nov 2017 22:42:13 +0000 (22:42 +0000)]
Remove redundant LayoutStateMaintainer argument (RenderView&)
https://bugs.webkit.org/show_bug.cgi?id=179269
<rdar://problem/35344397>

Reviewed by Simon Fraser.

No change in functionality.

* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::simplifiedLayout):
* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::layoutBlock):
* rendering/RenderBox.cpp:
(WebCore::RenderBox::layout):
* rendering/RenderDeprecatedFlexibleBox.cpp:
(WebCore::RenderDeprecatedFlexibleBox::layoutBlock):
* rendering/RenderEmbeddedObject.cpp:
(WebCore::RenderEmbeddedObject::layout):
* rendering/RenderFlexibleBox.cpp:
(WebCore::RenderFlexibleBox::layoutBlock):
* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::layoutBlock):
* rendering/RenderImage.cpp:
(WebCore::RenderImage::layoutShadowControls):
* rendering/RenderTable.cpp:
(WebCore::RenderTable::layout):
* rendering/RenderTableRow.cpp:
(WebCore::RenderTableRow::layout):
* rendering/RenderTableSection.cpp:
(WebCore::RenderTableSection::layout):
(WebCore::RenderTableSection::layoutRows):
* rendering/RenderVTTCue.cpp:
(WebCore::RenderVTTCue::layout):
* rendering/RenderView.h:
(WebCore::LayoutStateMaintainer::LayoutStateMaintainer):

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

21 months agoUse VCP H264 encoder for platforms supporting it
commit-queue@webkit.org [Fri, 3 Nov 2017 22:03:30 +0000 (22:03 +0000)]
Use VCP H264 encoder for platforms supporting it
https://bugs.webkit.org/show_bug.cgi?id=179076
rdar://problem/35180773

Unreviewed.

Patch by Youenn Fablet <youenn@apple.com> on 2017-11-03

* Source/webrtc/sdk/objc/Framework/Classes/VideoProcessing/encoder_vcp.h: build fix.

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

21 months agoWeb Inspector: Move Show Compositing Borders/Paint Flashing buttons from Elements...
ross.kirsling@sony.com [Fri, 3 Nov 2017 21:53:42 +0000 (21:53 +0000)]
Web Inspector: Move Show Compositing Borders/Paint Flashing buttons from Elements tab to Layers tab
https://bugs.webkit.org/show_bug.cgi?id=179211

Reviewed by Joseph Pecoraro.

* UserInterface/Views/DOMTreeContentView.js:
(WI.DOMTreeContentView.prototype.get navigationItems):
(WI.DOMTreeContentView.prototype._updateCompositingBordersButtonToMatchPageSettings):
Guard old buttons with experimental flag.

* UserInterface/Views/Layers3DContentView.js:
(WI.Layers3DContentView):
(WI.Layers3DContentView.prototype.get navigationItems):
(WI.Layers3DContentView.prototype.shown):
(WI.Layers3DContentView.prototype.closed):
(WI.Layers3DContentView.prototype._showPaintRectsSettingChanged):
(WI.Layers3DContentView.prototype._togglePaintFlashing):
(WI.Layers3DContentView.prototype._updateCompositingBordersButtonState):
(WI.Layers3DContentView.prototype._toggleCompositingBorders):
Add buttons to new home.
No need to guard for get/setCompositingBordersVisible anymore, as these were introduced in iOS 7.

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

21 months agoWeb Inspector: move top-level namespace functions in ImageUtilities to static class
webkit@devinrousso.com [Fri, 3 Nov 2017 21:43:32 +0000 (21:43 +0000)]
Web Inspector: move top-level namespace functions in ImageUtilities to static class
https://bugs.webkit.org/show_bug.cgi?id=179207

Reviewed by Brian Burg.

* .eslintrc:
* UserInterface/Base/ImageUtilities.js:
(WI.ImageUtilities.useSVGSymbol):
(WI.ImageUtilities.scratchCanvasContext2D):
(WI.ImageUtilities.imageFromImageData):
(WI.ImageUtilities.imageFromCanvasGradient):
(WI.ImageUtilities):
(useSVGSymbol): Deleted.
(WI.scratchCanvasContext2D): Deleted.
(WI.imageFromImageData): Deleted.
(WI.imageFromCanvasGradient): Deleted.

* UserInterface/Models/Recording.js:
(WI.Recording.prototype.async swizzle):
* UserInterface/Views/ButtonNavigationItem.js:
(WI.ButtonNavigationItem.prototype.set image):
* UserInterface/Views/CallFrameTreeElement.js:
(WI.CallFrameTreeElement.prototype._updateStatus):
* UserInterface/Views/DOMNodeDetailsSidebarPanel.js:
(WI.DOMNodeDetailsSidebarPanel.prototype.initialLayout):
* UserInterface/Views/DOMTreeElement.js:
(WI.DOMTreeElement.prototype._updateBreakpointStatus):
* UserInterface/Views/MultipleScopeBarItem.js:
(WI.MultipleScopeBarItem):
* UserInterface/Views/RecordingActionTreeElement.js:
(WI.RecordingActionTreeElement._generateDOM):
(WI.RecordingActionTreeElement.prototype._handleHasVisibleEffectChanged):
* UserInterface/Views/RecordingStateDetailsSidebarPanel.js:
(WI.RecordingStateDetailsSidebarPanel.prototype._generateDetailsCanvas2D):
* UserInterface/Views/ResourceMetricsContentView.js:
(WI.ResourceMetricsContentView.prototype._refreshResourceSizeSection):
* UserInterface/Views/ScopeRadioButtonNavigationItem.js:
(WI.ScopeRadioButtonNavigationItem):
* UserInterface/Views/ThreadTreeElement.js:
(WI.ThreadTreeElement.prototype._updateStatus):
* UserInterface/Views/TimelineTreeElement.js:
(WI.TimelineTreeElement.prototype._showCloseButton):
* UserInterface/Views/VisualStyleCommaSeparatedKeywordEditor.js:
(WI.VisualStyleCommaSeparatedKeywordEditor):
* UserInterface/Views/VisualStyleKeywordIconList.js:
(WI.VisualStyleKeywordIconList):
* UserInterface/Views/VisualStylePropertyEditorLink.js:
(WI.VisualStylePropertyEditorLink):
* UserInterface/Views/VisualStyleSelectorSection.js:
(WI.VisualStyleSelectorSection):
* UserInterface/Views/WebSocketDataGridNode.js:
(WI.WebSocketDataGridNode.prototype.createCellContent):

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

21 months agoLayoutTest http/tests/loading/basic-auth-resend-wrong-credentials.html is flaky on WK2
achristensen@apple.com [Fri, 3 Nov 2017 21:30:08 +0000 (21:30 +0000)]
LayoutTest http/tests/loading/basic-auth-resend-wrong-credentials.html is flaky on WK2
https://bugs.webkit.org/show_bug.cgi?id=159884

Reviewed by Darin Adler.

* http/tests/loading/basic-auth-resend-wrong-credentials-expected.txt:
* http/tests/loading/basic-auth-resend-wrong-credentials.html:
* platform/wk2/http/tests/loading/basic-auth-resend-wrong-credentials-expected.txt:

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

21 months agoWeb Inspector: Hide legacy Layers sidebar on Search tab
ross.kirsling@sony.com [Fri, 3 Nov 2017 21:26:59 +0000 (21:26 +0000)]
Web Inspector: Hide legacy Layers sidebar on Search tab
https://bugs.webkit.org/show_bug.cgi?id=179257

Reviewed by Joseph Pecoraro.

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

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

21 months agoMark http/tests/security/mixedContent/insecure-css-with-secure-cookies.html as flaky.
ryanhaddad@apple.com [Fri, 3 Nov 2017 21:26:43 +0000 (21:26 +0000)]
Mark http/tests/security/mixedContent/insecure-css-with-secure-cookies.html as flaky.
https://bugs.webkit.org/show_bug.cgi?id=175998

Unreviewed test gardening.

* platform/mac/TestExpectations:

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

21 months agoMark imported/w3c/web-platform-tests/service-workers/service-worker/fetch-event-withi...
ryanhaddad@apple.com [Fri, 3 Nov 2017 21:26:39 +0000 (21:26 +0000)]
Mark imported/w3c/web-platform-tests/service-workers/service-worker/fetch-event-within-sw.https.html as flaky.
https://bugs.webkit.org/show_bug.cgi?id=179248

Unreviewed test gardening.

* TestExpectations:

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

21 months agoUse VCP H264 encoder for platforms supporting it
commit-queue@webkit.org [Fri, 3 Nov 2017 21:13:35 +0000 (21:13 +0000)]
Use VCP H264 encoder for platforms supporting it
https://bugs.webkit.org/show_bug.cgi?id=179076
rdar://problem/35180773

Patch by Youenn Fablet <youenn@apple.com> on 2017-11-03
Reviewed by Eric Carlson.

Source/ThirdParty/libwebrtc:

* Configurations/libwebrtc.iOS.exp:
* Configurations/libwebrtc.iOSsim.exp:
* Configurations/libwebrtc.mac.exp:
* Source/webrtc/sdk/objc/Framework/Classes/VideoProcessing/encoder_vcp.h: Added.
(webrtc::H264VideoToolboxEncoderVCP::SetActive):
* Source/webrtc/sdk/objc/Framework/Classes/VideoProcessing/encoder_vcp.mm: Copied from Source/ThirdParty/libwebrtc/Source/webrtc/sdk/objc/Framework/Classes/VideoToolbox/encoder.mm.
* Source/webrtc/sdk/objc/Framework/Classes/VideoToolbox/encoder.mm:
(internal::CFStringToString):
(internal::SetVTSessionProperty):
(internal::CopyVideoFrameToPixelBuffer):
(internal::CreatePixelBuffer):
(internal::VTCompressionOutputCallback):
(internal::ExtractProfile):
* Source/webrtc/sdk/objc/Framework/Classes/VideoToolbox/videocodecfactory.h:
* Source/webrtc/sdk/objc/Framework/Classes/VideoToolbox/videocodecfactory.mm:
(webrtc::VideoToolboxVideoEncoderFactory::VideoToolboxVideoEncoderFactory):
(webrtc::VideoToolboxVideoEncoderFactory::CreateSupportedVideoEncoder):
* libwebrtc.xcodeproj/project.pbxproj:

Source/WebCore:

Covered by existing test coverage.

* platform/mediastream/libwebrtc/VideoToolBoxEncoderFactory.cpp:
(WebCore::VideoToolboxVideoEncoderFactory::setActive):
(WebCore::VideoToolboxVideoEncoderFactory::CreateSupportedVideoEncoder):
(WebCore::VideoToolboxVideoEncoderFactory::DestroyVideoEncoder):
* platform/mediastream/libwebrtc/VideoToolBoxEncoderFactory.h:

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

21 months ago[Curl] Fix build after r224373
commit-queue@webkit.org [Fri, 3 Nov 2017 21:04:49 +0000 (21:04 +0000)]
[Curl] Fix build after r224373
https://bugs.webkit.org/show_bug.cgi?id=179265

Unreviewed build fix.

Patch by Basuke Suzuki <Basuke.Suzuki@sony.com> on 2017-11-03

* platform/network/curl/ResourceHandleCurl.cpp:
(WebCore::ResourceHandle::continueWillSendRequest): Deleted.

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

21 months agoThe Abstract Interpreter needs to change similar to clobberize() in r224366
msaboff@apple.com [Fri, 3 Nov 2017 20:45:06 +0000 (20:45 +0000)]
The Abstract Interpreter needs to change similar to clobberize() in r224366
https://bugs.webkit.org/show_bug.cgi?id=179267

Reviewed by Saam Barati.

Add clobberWorld() to HasGenericProperty, HasStructureProperty & GetPropertyEnumerator
cases in the abstract interpreter to match what was done for r224366.

* dfg/DFGAbstractInterpreterInlines.h:
(JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects):

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

21 months agoAdd test for ic with side effects
keith_miller@apple.com [Fri, 3 Nov 2017 20:31:00 +0000 (20:31 +0000)]
Add test for ic with side effects
https://bugs.webkit.org/show_bug.cgi?id=179268

Reviewed by Saam Barati.

* stress/put-inline-cache-side-effects.js: Added.
(let.i.of.objs.keys):
(f):

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

21 months agoRemove an invalid ASSERT that is seen intermittently.
beidson@apple.com [Fri, 3 Nov 2017 20:12:10 +0000 (20:12 +0000)]
Remove an invalid ASSERT that is seen intermittently.
https://bugs.webkit.org/show_bug.cgi?id=179186

Unreviewed.

* workers/service/server/SWServerRegistration.cpp:
(WebCore::SWServerRegistration::removeClientServiceWorkerRegistration): This is an invalid ASSERT,
  it's definitely racey over IPC.

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

21 months agoRemove Yosemite test expectations
achristensen@apple.com [Fri, 3 Nov 2017 20:02:06 +0000 (20:02 +0000)]
Remove Yosemite test expectations
https://bugs.webkit.org/show_bug.cgi?id=179143

Reviewed by Ryosuke Niwa.

We only test back to El Capitan.  Everything is Yosemite+.  Marking tests as failing only on Yosemite isn't useful any more.

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

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

21 months agoPutProperytSlot should inform the IC about the property before effects.
keith_miller@apple.com [Fri, 3 Nov 2017 19:57:01 +0000 (19:57 +0000)]
PutProperytSlot should inform the IC about the property before effects.
https://bugs.webkit.org/show_bug.cgi?id=179262

Reviewed by Mark Lam.

This patch fixes an issue where we choose to cache setters based on
incorrect information. If we did so we might end up OSR exiting
more than we would otherwise need to. The new model is that the
PutPropertySlot should inform the IC of what the property looked
like before any potential side effects might have occurred.

* runtime/JSObject.cpp:
(JSC::JSObject::putInlineSlow):
* runtime/Lookup.h:
(JSC::putEntry):

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

21 months agoUnreviewed GTK+ gardening. Mark a few failures, posting along the relevant
zandobersek@gmail.com [Fri, 3 Nov 2017 19:40:12 +0000 (19:40 +0000)]
Unreviewed GTK+ gardening. Mark a few failures, posting along the relevant
bug entries. Add a platform-specific baseline for one HTTP test.

* platform/gtk/TestExpectations:
* platform/gtk/http/tests/security/module-no-mime-type-expected.txt: Added.

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

21 months ago[Win] Update test expectations after r224324.
pvollan@apple.com [Fri, 3 Nov 2017 19:26:56 +0000 (19:26 +0000)]
[Win] Update test expectations after r224324.

Unreviewed test gardening.

* platform/win/css3/selectors3/html/css3-modsel-166-expected.txt:
* platform/win/css3/selectors3/html/css3-modsel-166a-expected.txt:
* platform/win/css3/selectors3/html/css3-modsel-39-expected.txt:
* platform/win/css3/selectors3/html/css3-modsel-39b-expected.txt:
* platform/win/fast/css/first-letter-float-after-float-expected.txt:

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

21 months ago[WinCairo] Add --wincairo option to run-webkit-tests
commit-queue@webkit.org [Fri, 3 Nov 2017 19:09:39 +0000 (19:09 +0000)]
[WinCairo] Add --wincairo option to run-webkit-tests
https://bugs.webkit.org/show_bug.cgi?id=179217

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

* Scripts/webkitpy/port/factory.py:
(platform_options):

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

21 months ago[WPE] Remove unneeded USE(LIBEPOXY) guards
mcatanzaro@igalia.com [Fri, 3 Nov 2017 18:57:42 +0000 (18:57 +0000)]
[WPE] Remove unneeded USE(LIBEPOXY) guards
https://bugs.webkit.org/show_bug.cgi?id=179228

Reviewed by Carlos Garcia Campos.

USE(LIBEPOXY) is already mandatory for WPE.

* platform/graphics/egl/GLContextEGLWPE.cpp:
* platform/graphics/wpe/PlatformDisplayWPE.cpp:

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

21 months agoMarked js/intl-datetimeformat.html as failing on High Sierra.
jlewis3@apple.com [Fri, 3 Nov 2017 18:47:27 +0000 (18:47 +0000)]
Marked js/intl-datetimeformat.html as failing on High Sierra.
https://bugs.webkit.org/show_bug.cgi?id=179208

Unreviewed test gardening.

* platform/mac-wk2/TestExpectations:

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

21 months ago[WPE][GTK] Avoid duplicating code for dist and distcheck targets
mcatanzaro@igalia.com [Fri, 3 Nov 2017 18:42:55 +0000 (18:42 +0000)]
[WPE][GTK] Avoid duplicating code for dist and distcheck targets
https://bugs.webkit.org/show_bug.cgi?id=179154

Reviewed by Carlos Garcia Campos.

.:

This commit just reduces some CMake code duplication between GTK and WPE.

* Source/PlatformGTK.cmake:
* Source/PlatformWPE.cmake:
* Source/cmake/WebKitDist.cmake: Added.

Tools:

Move the script out of Tools/gtk because it is already used by WPE. Also, drop the .py
prefix because it is executable.

* Scripts/make-dist: Renamed from Tools/gtk/make-dist.py.

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

21 months agoLayout viewport rect is too wide after window resize
commit-queue@webkit.org [Fri, 3 Nov 2017 18:32:19 +0000 (18:32 +0000)]
Layout viewport rect is too wide after window resize
https://bugs.webkit.org/show_bug.cgi?id=175235

Fix a formatting mistake that was introduced by r224241.

Patch by Ali Juma <ajuma@chromium.org> on 2017-11-03
Reviewed by Simon Fraser.

No change in behavior.

* platform/ScrollView.cpp:
(WebCore::ScrollView::updateScrollbars):

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

21 months agoImplement Service Worker Matching Registration algorithm
commit-queue@webkit.org [Fri, 3 Nov 2017 18:21:46 +0000 (18:21 +0000)]
Implement Service Worker Matching Registration algorithm
https://bugs.webkit.org/show_bug.cgi?id=178882

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

LayoutTests/imported/w3c:

* web-platform-tests/service-workers/service-worker/multi-globals/url-parsing.https-expected.txt:
* web-platform-tests/service-workers/service-worker/multiple-register.https-expected.txt:
* web-platform-tests/service-workers/service-worker/registration-basic.https-expected.txt:
* web-platform-tests/service-workers/service-worker/registration-scope.https-expected.txt:
* web-platform-tests/service-workers/service-worker/serviceworkerobject-scripturl.https-expected.txt:
* web-platform-tests/service-workers/service-worker/unregister-controller.https-expected.txt:
* web-platform-tests/service-workers/service-worker/unregister.https-expected.txt:

Source/WebCore:

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

Adding support for scope as part of the ServiceWorkerRegistrationKey to disambiguate several service workers registered with different scopes.
Adding the Service Worker Registration algorithm in SWServer and adding internals API to test it.
Making ServiceWorkerRegistrationKey a class to protect its internal field to be reused in wrong places.

Added preliminary support for clearing service workers for a given session ID as this is needed by WTR for stable testing.

* testing/Internals.cpp:
(WebCore::Internals::hasServiceWorkerRegistration):
* testing/Internals.h:
* testing/Internals.idl:
* workers/service/ServiceWorkerJobData.cpp:
(WebCore::ServiceWorkerJobData::registrationKey const):
* workers/service/ServiceWorkerRegistration.h:
* workers/service/ServiceWorkerRegistrationKey.cpp:
(WebCore::ServiceWorkerRegistrationKey::hash const):
(WebCore::ServiceWorkerRegistrationKey::operator== const):
(WebCore::ServiceWorkerRegistrationKey::isolatedCopy const):
* workers/service/ServiceWorkerRegistrationKey.h:
(WebCore::ServiceWorkerRegistrationKey::encode const):
(WebCore::ServiceWorkerRegistrationKey::decode):
* workers/service/server/SWClientConnection.h:
* workers/service/server/SWServer.cpp:
(WebCore::SWServer::clear):
(WebCore::SWServer::doRegistrationMatching const):
* workers/service/server/SWServer.h:
(WebCore::SWServer::Connection::doRegistrationMatching const):
* workers/service/server/SWServerJobQueue.cpp:
(WebCore::SWServerJobQueue::~SWServerJobQueue):
* workers/service/server/SWServerRegistration.h:

Source/WebKit:

Added IPC plumbery for matchRegistration request and response.
Added some limited clearing of workers and registrations.

* StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
(WebKit::WebSWServerConnection::matchRegistration):
* StorageProcess/ServiceWorker/WebSWServerConnection.h:
* StorageProcess/ServiceWorker/WebSWServerConnection.messages.in:
* StorageProcess/StorageProcess.cpp:
(WebKit::StorageProcess::deleteWebsiteData):
(WebKit::StorageProcess::deleteWebsiteDataForOrigins):
* WebProcess/Storage/WebSWClientConnection.cpp:
(WebKit::WebSWClientConnection::didMatchRegistration):
(WebKit::WebSWClientConnection::matchRegistration):
* WebProcess/Storage/WebSWClientConnection.h:
* WebProcess/Storage/WebSWClientConnection.messages.in:
* WebProcess/Storage/WebServiceWorkerProvider.h:

LayoutTests:

* TestExpectations:
* http/tests/workers/service/basic-register-exceptions-expected.txt:
* http/tests/workers/service/resources/basic-register.js: Fixing flakiness.
* http/tests/workers/service/service-worker-clear-expected.txt: Added.
* http/tests/workers/service/service-worker-clear.html: Added.

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

21 months agoAdd basic OffscreenCanvas interface
dino@apple.com [Fri, 3 Nov 2017 18:05:13 +0000 (18:05 +0000)]
Add basic OffscreenCanvas interface
https://bugs.webkit.org/show_bug.cgi?id=179213
<rdar://problem/35326778>

Reviewed by Sam Weinig.

Source/WebCore:

Add the basic infrastructure for the OffscreenCanvas
object, so it can be created from script.

Test: http/wpt/offscreen-canvas/offscreencanvas.constructor.html

* DerivedSources.make:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSEventTargetCustom.cpp:
* dom/EventTargetFactory.in:
* html/OffscreenCanvas.cpp: Added.
(WebCore::OffscreenCanvas::create):
(WebCore::OffscreenCanvas::OffscreenCanvas):
(WebCore::OffscreenCanvas::width const):
(WebCore::OffscreenCanvas::setWidth):
(WebCore::OffscreenCanvas::height const):
(WebCore::OffscreenCanvas::setHeight):
* html/OffscreenCanvas.h: Added.
* html/OffscreenCanvas.idl: Added.

LayoutTests:

Very basic test that exercises object construction.

* http/wpt/offscreen-canvas/offscreencanvas.constructor-expected.txt: Added.
* http/wpt/offscreen-canvas/offscreencanvas.constructor.html: Added.

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

21 months agoElement fullscreen should use FloatRects instead of IntRects in beganEnterFullScreenW...
commit-queue@webkit.org [Fri, 3 Nov 2017 18:03:51 +0000 (18:03 +0000)]
Element fullscreen should use FloatRects instead of IntRects in beganEnterFullScreenWithInitialFrame
https://bugs.webkit.org/show_bug.cgi?id=179033
rdar://problem/35309279

Patch by Jeremy Jones <jeremyj@apple.com> on 2017-11-03
Reviewed by Darin Adler.

Screen coordinates are floats, so use NSRect instead of IntRect on Mac.

* UIProcess/mac/WKFullScreenWindowController.h:
* UIProcess/mac/WKFullScreenWindowController.mm:
(-[WKFullScreenWindowController beganEnterFullScreenWithInitialFrame:finalFrame:]):
(-[WKFullScreenWindowController beganExitFullScreenWithInitialFrame:finalFrame:]):

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

21 months agoCrash inside ChildListMutationAccumulator::enqueueMutationRecord()
rniwa@webkit.org [Fri, 3 Nov 2017 17:10:42 +0000 (17:10 +0000)]
Crash inside ChildListMutationAccumulator::enqueueMutationRecord()
https://bugs.webkit.org/show_bug.cgi?id=179234
<rdar://problem/35287748>

Reviewed by Darin Adler.

Source/WebCore:

Fixed the crash by keeping MutationObserver referenced by MutationObserverInterestGroup alive.

Also added hasCallback() virtual function on MutationObserver to check whether the callback is alive
to work around the bug that JS function referenced by MutationObserver isn't kept alive.
We'll address this bug separately in https://webkit.org/b/179224.

Test: fast/dom/MutationObserver/disconnect-observer-while-mutation-records-are-enqueued-crash.html

* bindings/scripts/CodeGeneratorJS.pm:
(GenerateCallbackHeaderContent): Added an override for the newly added virtual hasCallback().
* dom/MutationCallback.h:
* dom/MutationObserver.cpp:
(WebCore::MutationObserver::deliver): Added the aforementioned workaround.
* dom/MutationObserverInterestGroup.cpp:
(WebCore::MutationObserverInterestGroup::MutationObserverInterestGroup): Fixed the crash by using Ref.
(WebCore::MutationObserverInterestGroup::enqueueMutationRecord): Ditto.
* dom/MutationObserverInterestGroup.h:
* dom/NativeNodeFilter.cpp:
(WebCore::NativeNodeFilter::hasCallback const): Always return true here. This function is never called
but we still need to implement it since NodeFilter has a pure virtual hasCallback() now.
* dom/NativeNodeFilter.h:
* dom/Node.cpp:
(WebCore::collectMatchingObserversForMutation): Use Ref to fix the crash.
(WebCore::Node::registeredMutationObservers): Ditto.
* dom/Node.h:
* dom/NodeFilter.h:

LayoutTests:

Added a regression test.

* fast/dom/MutationObserver/disconnect-observer-while-mutation-records-are-enqueued-crash-expected.txt: Added.
* fast/dom/MutationObserver/disconnect-observer-while-mutation-records-are-enqueued-crash.html: Added.

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

21 months agoRenderObject::*positioned() naming cleanup
zalan@apple.com [Fri, 3 Nov 2017 16:59:30 +0000 (16:59 +0000)]
RenderObject::*positioned() naming cleanup
https://bugs.webkit.org/show_bug.cgi?id=179206
<rdar://problem/35325254>

Reviewed by Darin Adler.

+isFixedPositioned()
+isAbsolutelyPositioned()
isRelPositioned() -> isRelativelyPositioned()

Covered by existing tests.

* css/CSSComputedStyleDeclaration.cpp:
(WebCore::positionOffsetValue):
* dom/Element.cpp:
(WebCore::layoutOverflowRectContainsAllDescendants):
* rendering/LayoutState.cpp:
(WebCore::LayoutState::LayoutState):
* rendering/LayoutState.h:
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::renderName const):
* rendering/RenderBox.cpp:
(WebCore::RenderBox::fixedElementLaysOutRelativeToFrame const):
(WebCore::RenderBox::foregroundIsKnownToBeOpaqueInRect const):
(WebCore::RenderBox::mapLocalToContainer const):
(WebCore::RenderBox::pushMappingToContainer const):
(WebCore::RenderBox::mapAbsoluteToLocalPoint const):
(WebCore::RenderBox::offsetFromContainer const):
(WebCore::RenderBox::containingBlockLogicalWidthForPositioned const):
(WebCore::RenderBox::containingBlockLogicalHeightForPositioned const):
* rendering/RenderBoxModelObject.cpp:
(WebCore::RenderBoxModelObject::adjustedPositionRelativeToOffsetParent const):
(WebCore::RenderBoxModelObject::offsetForInFlowPosition const):
* rendering/RenderDeprecatedFlexibleBox.cpp:
(WebCore::RenderDeprecatedFlexibleBox::renderName const):
* rendering/RenderFragmentedFlow.cpp:
(WebCore::RenderFragmentedFlow::adjustedPositionRelativeToOffsetParent const):
* rendering/RenderGeometryMap.cpp:
(WebCore::canMapBetweenRenderersViaLayers):
* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::renderName const):
* rendering/RenderInline.cpp:
(WebCore::RenderInline::renderName const):
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::paintLayer):
(WebCore::RenderLayer::calculateClipRects const):
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::updateCompositedBounds):
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::updateBacking):
(WebCore::RenderLayerCompositor::computeExtent const):
(WebCore::RenderLayerCompositor::reasonsForCompositing const):
(WebCore::RenderLayerCompositor::isViewportConstrainedFixedOrStickyLayer const):
(WebCore::RenderLayerCompositor::updateScrollCoordinatedLayer):
(WebCore::RenderLayerCompositor::registerAllViewportConstrainedLayers):
* rendering/RenderObject.cpp:
(WebCore::RenderObject::containingBlock const):
(WebCore::RenderObject::outputRenderObject const):
(WebCore::RenderObject::offsetParent const):
* rendering/RenderObject.h:
(WebCore::RenderObject::isPositioned const):
(WebCore::RenderObject::isInFlowPositioned const):
(WebCore::RenderObject::isFixedPositioned const):
(WebCore::RenderObject::isAbsolutePositioned const):
(WebCore::RenderObject::isRelativePositioned const):
(WebCore::RenderObject::isStickyPositioned const):
(WebCore::RenderObject::RenderObjectBitfields::RenderObjectBitfields):
(WebCore::RenderObject::RenderObjectBitfields::isRelativePositioned const):
(WebCore::RenderObject::RenderObjectBitfields::isPositioned const):
(WebCore::RenderObject::isRelPositioned const): Deleted.
(WebCore::RenderObject::RenderObjectBitfields::isRelPositioned const): Deleted.

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

21 months agoUse a single identifier type to identify Service Workers
cdumez@apple.com [Fri, 3 Nov 2017 16:37:04 +0000 (16:37 +0000)]
Use a single identifier type to identify Service Workers
https://bugs.webkit.org/show_bug.cgi?id=179192

Reviewed by Brady Eidson.

Source/WebCore:

Use a single identifier type to identify Service Workers. We had both a String
identifier and a uint64_t identifier for each service worker. We now consistently
use a ServiceWorkerIdentifier which is a strongly typed identifier backed by a
uint64_t.

* WebCore.xcodeproj/project.pbxproj:
* loader/ResourceLoaderOptions.h:
* loader/cache/CachedResourceRequest.cpp:
(WebCore::CachedResourceRequest::setSelectedServiceWorkerIdentifierIfNeeded):
* loader/cache/CachedResourceRequest.h:
* workers/service/ServiceWorker.cpp:
(WebCore::ServiceWorker::ServiceWorker):
* workers/service/ServiceWorker.h:
* workers/service/ServiceWorkerClient.cpp:
(WebCore::ServiceWorkerClient::postMessage):
* workers/service/ServiceWorkerContainer.cpp:
(WebCore::ServiceWorkerContainer::jobResolvedWithRegistration):
* workers/service/ServiceWorkerContextData.cpp:
(WebCore::ServiceWorkerContextData::isolatedCopy const):
* workers/service/ServiceWorkerContextData.h:
(WebCore::ServiceWorkerContextData::encode const):
(WebCore::ServiceWorkerContextData::decode):
* workers/service/ServiceWorkerIdentifier.h: Copied from Source/WebCore/workers/service/ServiceWorkerContextData.cpp.
* workers/service/ServiceWorkerRegistrationData.h:
(WebCore::ServiceWorkerRegistrationData::decode):
* workers/service/context/SWContextManager.cpp:
(WebCore::SWContextManager::serviceWorkerThreadProxy const):
(WebCore::SWContextManager::postMessageToServiceWorkerGlobalScope):
* workers/service/context/SWContextManager.h:
* workers/service/context/ServiceWorkerThread.cpp:
(WebCore::ServiceWorkerThread::ServiceWorkerThread):
* workers/service/context/ServiceWorkerThread.h:
(WebCore::ServiceWorkerThread::identifier const):
* workers/service/context/ServiceWorkerThreadProxy.h:
* workers/service/server/SWClientConnection.cpp:
(WebCore::SWClientConnection::postMessageToServiceWorkerClient):
* workers/service/server/SWClientConnection.h:
* workers/service/server/SWServer.cpp:
(WebCore::generateServiceWorkerIdentifier):
(WebCore::SWServer::Connection::scriptContextFailedToStart):
(WebCore::SWServer::Connection::scriptContextStarted):
(WebCore::SWServer::scriptContextFailedToStart):
(WebCore::SWServer::scriptContextStarted):
(WebCore::SWServer::updateWorker):
* workers/service/server/SWServer.h:
* workers/service/server/SWServerJobQueue.cpp:
(WebCore::SWServerJobQueue::scriptContextFailedToStart):
(WebCore::SWServerJobQueue::scriptContextStarted):
* workers/service/server/SWServerJobQueue.h:
* workers/service/server/SWServerRegistration.h:
(WebCore::SWServerRegistration::setActiveServiceWorkerIdentifier):
* workers/service/server/SWServerWorker.cpp:
(WebCore::SWServerWorker::SWServerWorker):
* workers/service/server/SWServerWorker.h:
(WebCore::SWServerWorker::create):
(WebCore::SWServerWorker::identifier const):

Source/WebKit:

Use a single identifier type to identify Service Workers. We had both a String
identifier and a uint64_t identifier for each service worker. We now consistently
use a ServiceWorkerIdentifier which is a strongly typed identifier backed by a
uint64_t.

* Scripts/webkit/messages.py:
(forward_declarations_and_headers):
(forward_declarations_and_headers.templates):
* StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
(WebKit::WebSWServerConnection::startFetch):
(WebKit::WebSWServerConnection::postMessageToServiceWorkerGlobalScope):
(WebKit::WebSWServerConnection::postMessageToServiceWorkerClient):
* StorageProcess/ServiceWorker/WebSWServerConnection.h:
* StorageProcess/ServiceWorker/WebSWServerConnection.messages.in:
* StorageProcess/StorageProcess.cpp:
(WebKit::StorageProcess::serviceWorkerContextFailedToStart):
(WebKit::StorageProcess::serviceWorkerContextStarted):
(WebKit::StorageProcess::postMessageToServiceWorkerClient):
* StorageProcess/StorageProcess.h:
* StorageProcess/StorageProcess.messages.in:
* WebProcess/Storage/WebSWClientConnection.cpp:
(WebKit::WebSWClientConnection::postMessageToServiceWorkerGlobalScope):
(WebKit::WebSWClientConnection::postMessageToServiceWorkerClient):
* WebProcess/Storage/WebSWClientConnection.h:
* WebProcess/Storage/WebSWClientConnection.messages.in:
* WebProcess/Storage/WebSWContextManagerConnection.cpp:
(WebKit::WebSWContextManagerConnection::updateServiceWorker):
(WebKit::WebSWContextManagerConnection::serviceWorkerStartedWithMessage):
(WebKit::WebSWContextManagerConnection::startFetch):
(WebKit::WebSWContextManagerConnection::postMessageToServiceWorkerGlobalScope):
(WebKit::WebSWContextManagerConnection::postMessageToServiceWorkerClient):
* WebProcess/Storage/WebSWContextManagerConnection.h:
* WebProcess/Storage/WebSWContextManagerConnection.messages.in:

Source/WTF:

Introduce class for strongly typed identifiers. This avoids mixing up
different types of identifiers.

* WTF.xcodeproj/project.pbxproj:
* wtf/ObjectIdentifier.h: Added.
(WTF::ObjectIdentifier::encode const):
(WTF::ObjectIdentifier::decode):
(WTF::ObjectIdentifier::operator== const):
(WTF::ObjectIdentifier::operator!= const):
(WTF::ObjectIdentifier::ObjectIdentifier):
(WTF::makeObjectIdentifier):
(WTF::ObjectIdentifierHash::hash):
(WTF::ObjectIdentifierHash::equal):
(WTF::HashTraits<ObjectIdentifier<T>>::emptyValue):
(WTF::HashTraits<ObjectIdentifier<T>>::constructDeletedValue):
(WTF::HashTraits<ObjectIdentifier<T>>::isDeletedValue):

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

21 months ago[Payment Request] show() should only be called with user activation
aestes@apple.com [Fri, 3 Nov 2017 16:35:59 +0000 (16:35 +0000)]
[Payment Request] show() should only be called with user activation
https://bugs.webkit.org/show_bug.cgi?id=179056

Reviewed by Sam Weinig.

Source/WebCore:

Updated existing tests to call PaymentRequest.show() with user activation.

* Modules/paymentrequest/PaymentRequest.cpp:
(WebCore::PaymentRequest::show):

LayoutTests:

* http/tests/paymentrequest/payment-address-attributes-and-toJSON-method.https.html:
* http/tests/paymentrequest/payment-request-canmakepayment-method.https.html:
* http/tests/paymentrequest/payment-request-change-shipping-address.https.html:
* http/tests/paymentrequest/payment-request-change-shipping-option.https.html:
* http/tests/paymentrequest/payment-request-show-method.https.html:
* http/tests/paymentrequest/payment-response-complete-method.https.html:
* http/tests/paymentrequest/payment-response-methodName-attribute.https.html:
* http/tests/paymentrequest/payment-response-payerEmail-attribute.https.html:
* http/tests/paymentrequest/payment-response-payerName-attribute.https.html:
* http/tests/paymentrequest/payment-response-payerPhone-attribute.https.html:
* http/tests/paymentrequest/resources/helpers.js:
(async.getPaymentRequestResponse):
* http/tests/paymentrequest/updateWith-method-pmi-handling.https.html:
* http/tests/resources/payment-request.js: Added.
(activateThen):
* http/tests/ssl/applepay/ApplePayMerchantValidationEvent.https.html:
* http/tests/ssl/applepay/ApplePayPaymentMethodUpdateEvent.https.html:
* http/tests/ssl/applepay/PaymentRequest.https.html:
* resources/ui-helper.js:
(window.UIHelper.activateElement):

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

21 months agoTestController platformAdjustContext should use provided WKContext for Mac
jbedard@apple.com [Fri, 3 Nov 2017 16:33:58 +0000 (16:33 +0000)]
TestController platformAdjustContext should use provided WKContext for Mac
https://bugs.webkit.org/show_bug.cgi?id=179124
<rdar://problem/35295176>

Reviewed by Darin Adler.

* WebKitTestRunner/cocoa/TestControllerCocoa.mm:
(WTR::initializeWebViewConfiguration): Use the provided WKContext, since that is
a WebProcessPool, instead of creating a second one.

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

21 months agoLayoutTests/imported/w3c:
Ms2ger@igalia.com [Fri, 3 Nov 2017 16:27:37 +0000 (16:27 +0000)]
LayoutTests/imported/w3c:
Update Event-timestamp-high-resolution.html.
https://bugs.webkit.org/show_bug.cgi?id=179242

Reviewed by Darin Adler.

Synchronise with upstream to make the test more robust.

* web-platform-tests/dom/events/Event-timestamp-high-resolution.html:

LayoutTests:
[WPE] Update Event-timestamp-high-resolution.html expectations.
https://bugs.webkit.org/show_bug.cgi?id=179242

Reviewed by Darin Adler.

The test now deals more gracefully with the fact that GamepadEvent is
not defined.

* platform/wpe/imported/w3c/web-platform-tests/dom/events/Event-timestamp-high-resolution-expected.txt:

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

21 months agoCachedCall (and its clients) needs overflow checks.
mark.lam@apple.com [Fri, 3 Nov 2017 16:03:07 +0000 (16:03 +0000)]
CachedCall (and its clients) needs overflow checks.
https://bugs.webkit.org/show_bug.cgi?id=179185

Reviewed by JF Bastien.

JSTests:

* stress/regress-179185.js: Added.

Source/JavaScriptCore:

* interpreter/CachedCall.h:
(JSC::CachedCall::CachedCall):
(JSC::CachedCall::hasOverflowedArguments):
* runtime/ArgList.h:
(JSC::MarkedArgumentBuffer::clear):
* runtime/StringPrototype.cpp:
(JSC::replaceUsingRegExpSearch):

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

21 months agoInvalidate node list when associated form control element is removed
dbates@webkit.org [Fri, 3 Nov 2017 15:41:10 +0000 (15:41 +0000)]
Invalidate node list when associated form control element is removed
https://bugs.webkit.org/show_bug.cgi?id=179232
<rdar://problem/35308269>

Reviewed by Ryosuke Niwa.

Source/WebCore:

A node list represents a live view of the DOM. Invalidate the node list
associated with a form element whenever one of its associated form control
elements is removed.

Test: fast/forms/node-list-remove-button-from-form.html

* html/HTMLFormElement.cpp:
(WebCore::HTMLFormElement::removeFormElement):

LayoutTests:

Add a test to ensure the node list returned by HTMLFormElement.elements stays synchronized
with the document.

* fast/forms/node-list-remove-button-from-form-expected.txt: Added.
* fast/forms/node-list-remove-button-from-form.html: Added.

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

21 months agoEnable display:contents by default as experimental feature
antti@apple.com [Fri, 3 Nov 2017 15:24:16 +0000 (15:24 +0000)]
Enable display:contents by default as experimental feature
https://bugs.webkit.org/show_bug.cgi?id=179239
<rdar://problem/35334612>

Reviewed by Darin Adler.

We pass most of the WPT tests. What remains is mostly flexbox related edge cases.

* Shared/WebPreferences.yaml:

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

21 months agoUse WK_IOS_TBA instead of WK_MAC_TBA to indicate availability of private functions...
fred.wang@free.fr [Fri, 3 Nov 2017 15:11:04 +0000 (15:11 +0000)]
Use WK_IOS_TBA instead of WK_MAC_TBA to indicate availability of private functions on iOS
https://bugs.webkit.org/show_bug.cgi?id=179238

Patch by Frederic Wang <fwang@igalia.com> on 2017-11-03
Reviewed by Darin Adler.

* UIProcess/API/Cocoa/WKWebViewPrivate.h:
* UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:

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

21 months agoAdd USE(APPLE_INTERNAL_SDK)-guards around SPI in ResourceHandle code
fred.wang@free.fr [Fri, 3 Nov 2017 15:01:44 +0000 (15:01 +0000)]
Add USE(APPLE_INTERNAL_SDK)-guards around SPI in ResourceHandle code
https://bugs.webkit.org/show_bug.cgi?id=136107

Based on patch by Daniel Bates <dabates@apple.com>
Patch by Frederic Wang <fwang@igalia.com> on 2017-11-03
Reviewed by Darin Adler.

No new tests, behavior unchanged.

* platform/network/ResourceHandleClient.h: Replace includes of private headers with CFNetworkSPI.h.
* platform/network/ResourceHandleInternal.h: Ditto.
* platform/network/ios/ResourceHandleIOS.mm: Add USE(APPLE_INTERNAL_SDK)-guard around SPI
headers and forward declare NSURLRequest SPI and constant _kCFStreamSSLTrustedLeafCertificates
for clients that build without the internal SDK. Add BSD license block to file.
(WebCore::ResourceHandle::createSSLPropertiesFromNSURLRequest): Fix code style issues; use
nullptr instead of 0, use reinterpret_cast instead of C-style cast, remove unnecessary
"using namespace WebCore"
and rename variables to improve readability.
* platform/network/mac/ResourceErrorMac.mm: Add USE(APPLE_INTERNAL_SDK)-guard around private
headers and add typedef for CFCachedURLResponseRef for clients that build without the
internal SDK.

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

21 months agoCrash in WebCore::RenderStyle::overflowX with display:contents
antti@apple.com [Fri, 3 Nov 2017 14:46:17 +0000 (14:46 +0000)]
Crash in WebCore::RenderStyle::overflowX with display:contents
https://bugs.webkit.org/show_bug.cgi?id=178857
<rdar://problem/35201120>

Reviewed by Zalan Bujtas.

LayoutTests/imported/w3c:

* web-platform-tests/css/css-display-3/display-contents-computed-style-expected.txt:

Source/WebCore:

Crash test by Renata Hodovan.

Tests: fast/css/display-contents-all.html
       fast/css/display-contents-document-element.html

* css/StyleResolver.cpp:
(WebCore::adjustDisplayContentsStyle):

For document element 'display:contents' should adjust to 'display:block' like it does for other display types.

LayoutTests:

* fast/css/display-contents-all-expected.html: Added.
* fast/css/display-contents-all.html: Added.
* fast/css/display-contents-document-element-expected.txt: Added.
* fast/css/display-contents-document-element.html: Added.

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

21 months ago[WPE] Enable the dom/ directory of web-platform-tests.
Ms2ger@igalia.com [Fri, 3 Nov 2017 11:44:34 +0000 (11:44 +0000)]
[WPE] Enable the dom/ directory of web-platform-tests.
https://bugs.webkit.org/show_bug.cgi?id=179180

Reviewed by Carlos Alberto Lopez Perez.

* platform/wpe/TestExpectations: Enable tests; copy expected timeout from generic expectation file.
* platform/wpe/imported/w3c/web-platform-tests/dom/events/Event-timestamp-high-resolution-expected.txt:
  Added; GamepadEvent is not enabled. (The fragility of the test is fixed upstream.)
* platform/wpe/imported/w3c/web-platform-tests/dom/events/EventTarget-dispatchEvent-expected.txt:
  Added; more subtests pass than in the generic expectation file.
* platform/wpe/imported/w3c/web-platform-tests/dom/nodes/Document-createEvent-expected.txt:
  Added; more subtests pass than in the generic expectation file.

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

21 months agoUnreviewed WPE gardening. Rebaselining tests affected by r224324.
zandobersek@gmail.com [Fri, 3 Nov 2017 10:23:10 +0000 (10:23 +0000)]
Unreviewed WPE gardening. Rebaselining tests affected by r224324.

* platform/wpe/css1/pseudo/firstletter-expected.txt:
* platform/wpe/css1/pseudo/multiple_pseudo_elements-expected.txt:
* platform/wpe/css2.1/t051202-c24-first-lttr-00-b-expected.txt:
* platform/wpe/css2.1/t051202-c26-psudo-nest-00-c-expected.txt:
* platform/wpe/css3/selectors3/html/css3-modsel-166-expected.txt:
* platform/wpe/css3/selectors3/html/css3-modsel-166a-expected.txt:
* platform/wpe/css3/selectors3/html/css3-modsel-39-expected.txt:
* platform/wpe/css3/selectors3/html/css3-modsel-39b-expected.txt:
* platform/wpe/css3/selectors3/xhtml/css3-modsel-166-expected.txt:
* platform/wpe/css3/selectors3/xhtml/css3-modsel-166a-expected.txt:
* platform/wpe/css3/selectors3/xhtml/css3-modsel-39-expected.txt:
* platform/wpe/css3/selectors3/xhtml/css3-modsel-39b-expected.txt:
* platform/wpe/css3/selectors3/xml/css3-modsel-166-expected.txt:
* platform/wpe/css3/selectors3/xml/css3-modsel-166a-expected.txt:
* platform/wpe/css3/selectors3/xml/css3-modsel-39-expected.txt:
* platform/wpe/css3/selectors3/xml/css3-modsel-39b-expected.txt:
* platform/wpe/fast/dynamic/first-letter-display-change-expected.txt:
* platform/wpe/ietestcenter/css3/text/textshadow-004-expected.txt:
* platform/wpe/svg/W3C-SVG-1.1/fonts-glyph-02-t-expected.txt:
* platform/wpe/svg/custom/glyph-selection-arabic-forms-expected.txt:
* platform/wpe/svg/text/select-textLength-spacingAndGlyphs-squeeze-2-expected.txt:
* platform/wpe/svg/text/select-textLength-spacingAndGlyphs-squeeze-3-expected.txt:
* platform/wpe/svg/text/select-textLength-spacingAndGlyphs-stretch-2-expected.txt:
* platform/wpe/svg/text/select-textLength-spacingAndGlyphs-stretch-3-expected.txt:

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

21 months agoWeb Inspector: Network Table - Include a secure lock indicator in the domain column
commit-queue@webkit.org [Fri, 3 Nov 2017 10:00:23 +0000 (10:00 +0000)]
Web Inspector: Network Table - Include a secure lock indicator in the domain column
https://bugs.webkit.org/show_bug.cgi?id=179233
<rdar://problem/34070883>

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2017-11-03
Reviewed by Devin Rousso.

* UserInterface/Views/NetworkTableContentView.css:
(.network-table .cell.domain > .lock):
* UserInterface/Views/NetworkTableContentView.js:
(WI.NetworkTableContentView.prototype.tablePopulateCell):
(WI.NetworkTableContentView.prototype._populateDomainCell):
Add a small lock icon by the domain if the request was https/wss.

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

21 months agoReplace some auto* with RefPtr within WebCore/html
jiewen_tan@apple.com [Fri, 3 Nov 2017 09:32:05 +0000 (09:32 +0000)]
Replace some auto* with RefPtr within WebCore/html
https://bugs.webkit.org/show_bug.cgi?id=179218
<rdar://problem/35102567>

Reviewed by Ryosuke Niwa.

No changes in behaviors.

In this patch, it replace some auto* pointers with RefPtrs. The way it achieves this goal is to wrap
the RHS with makeRefPtr(). Also, some methods have been modified to return RefPtrs directly. Those
include:
    HTMLInputElement::list,
    HTMLInputElement::dataList,
    HTMLLabelElement::control,
    HTMLLegendElement::associatedControl,
    HTMLSummaryElement::detailsElement,
    HTMLTableElement::tHead,
    HTMLTableElement::tFoot,
    HTMLTablePartElement::findParentTable,
    HTMLTableRowElement.cpp::findTable, local function
    RadioNodeList.cpp::toRadioButtonInputElement, local function
    CanvasStyle::canvasGradient,
    CanvasStyle::canvasPattern,
    WebGLRenderingContextBase::validateTextureBinding,
    GraphicsContext::strokeGradient,
    GraphicsContext::fillGradient.

* accessibility/AXObjectCache.cpp:
(WebCore::AXObjectCache::labelChanged):
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::correspondingControlForLabelElement const):
* accessibility/AccessibilityTable.cpp:
(WebCore::AccessibilityTable::addChildren):
(WebCore::AccessibilityTable::title const):
* accessibility/atk/WebKitAccessibleInterfaceTable.cpp:
(webkitAccessibleTableGetCaption):
* html/ColorInputType.cpp:
(WebCore::ColorInputType::suggestions const):
* html/FTPDirectoryDocument.cpp:
(WebCore::FTPDirectoryDocumentParser::loadDocumentTemplate):
* html/FileInputType.cpp:
(WebCore::FileInputType::appendFormData const):
(WebCore::FileInputType::disabledAttributeChanged):
(WebCore::FileInputType::multipleAttributeChanged):
* html/FormAssociatedElement.cpp:
(WebCore::FormAssociatedElement::formOwnerRemovedFromTree):
* html/HTMLBodyElement.cpp:
(WebCore::HTMLBodyElement::insertedIntoAncestor):
(WebCore::HTMLBodyElement::didFinishInsertingNode):
(WebCore::HTMLBodyElement::scrollTo):
* html/HTMLDetailsElement.cpp:
(WebCore::HTMLDetailsElement::isActiveSummary const):
(WebCore::HTMLDetailsElement::parseAttribute):
* html/HTMLDocument.cpp:
(WebCore::HTMLDocument::namedItem):
* html/HTMLElement.cpp:
(WebCore::HTMLElement::editabilityFromContentEditableAttr):
* html/HTMLFormControlElement.cpp:
(WebCore::HTMLFormControlElement::didAttachRenderers):
* html/HTMLFrameOwnerElement.cpp:
(WebCore:: const):
* html/HTMLFrameSetElement.cpp:
(WebCore::HTMLFrameSetElement::namedItem):
* html/HTMLHtmlElement.cpp:
(WebCore::HTMLHtmlElement::insertedByParser):
* html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::bestFitSourceFromPictureElement):
* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::defaultEventHandler):
(WebCore::HTMLInputElement::list const):
(WebCore::HTMLInputElement::dataList const):
(WebCore::HTMLInputElement::setupDateTimeChooserParameters):
* html/HTMLInputElement.h:
* html/HTMLLabelElement.cpp:
(WebCore::firstElementWithIdIfLabelable):
(WebCore::HTMLLabelElement::control const):
(WebCore::HTMLLabelElement::form const):
(WebCore::HTMLLabelElement::setActive):
(WebCore::HTMLLabelElement::setHovered):
(WebCore::HTMLLabelElement::willRespondToMouseClickEvents):
(WebCore::HTMLLabelElement::focus):
(WebCore::HTMLLabelElement::accessKeyAction):
* html/HTMLLabelElement.h:
* html/HTMLLegendElement.cpp:
(WebCore::HTMLLegendElement::associatedControl):
(WebCore::HTMLLegendElement::focus):
(WebCore::HTMLLegendElement::accessKeyAction):
(WebCore::HTMLLegendElement::form const):
* html/HTMLLegendElement.h:
* html/HTMLLinkElement.cpp:
(WebCore::HTMLLinkElement::setCSSStyleSheet):
(WebCore::HTMLLinkElement::addSubresourceAttributeURLs const):
* html/HTMLMediaElement.cpp:
(WebCore::needsAutoplayPlayPauseEventsQuirk):
(WebCore::HTMLMediaElement::loadResource):
(WebCore::HTMLMediaElement::updateActiveTextTrackCues):
(WebCore::HTMLMediaElement::removeTextTrack):
(WebCore::HTMLMediaElement::layoutSizeChanged):
* html/HTMLObjectElement.cpp:
(WebCore::shouldBeExposed):
(WebCore::HTMLObjectElement::appendFormData):
* html/HTMLOptGroupElement.cpp:
(WebCore::HTMLOptGroupElement::recalcSelectOptions):
* html/HTMLPictureElement.cpp:
(WebCore::HTMLPictureElement::viewportChangeAffectedPicture const):
* html/HTMLPlugInElement.cpp:
(WebCore::HTMLPlugInElement::bindingsInstance):
* html/HTMLPlugInImageElement.cpp:
(WebCore::HTMLPlugInImageElement::isImageType):
(WebCore::HTMLPlugInImageElement::willDetachRenderers):
(WebCore::HTMLPlugInImageElement::partOfSnapshotOverlay const):
(WebCore::HTMLPlugInImageElement::checkSizeChangeForSnapshotting):
* html/HTMLSlotElement.cpp:
(WebCore::HTMLSlotElement::attributeChanged):
(WebCore:: const):
* html/HTMLSourceElement.cpp:
(WebCore::HTMLSourceElement::parseAttribute):
* html/HTMLStyleElement.cpp:
(WebCore::HTMLStyleElement::addSubresourceAttributeURLs const):
* html/HTMLSummaryElement.cpp:
(WebCore::HTMLSummaryElement::detailsElement const):
* html/HTMLSummaryElement.h:
* html/HTMLTableElement.cpp:
(WebCore::HTMLTableElement::caption const):
(WebCore::HTMLTableElement::tHead const):
(WebCore::HTMLTableElement::tFoot const):
(WebCore::HTMLTableElement::createTHead):
(WebCore::HTMLTableElement::deleteTHead):
(WebCore::HTMLTableElement::createTFoot):
(WebCore::HTMLTableElement::deleteTFoot):
(WebCore::HTMLTableElement::createCaption):
(WebCore::HTMLTableElement::deleteCaption):
* html/HTMLTableElement.h:
* html/HTMLTablePartElement.cpp:
(WebCore::HTMLTablePartElement::findParentTable const):
* html/HTMLTablePartElement.h:
* html/HTMLTableRowElement.cpp:
(WebCore::findTable):
(WebCore::HTMLTableRowElement::rowIndex const):
(WebCore::findRows):
* html/HTMLTableSectionElement.cpp:
(WebCore::HTMLTableSectionElement::additionalPresentationAttributeStyle const):
* html/HTMLTrackElement.cpp:
(WebCore::HTMLTrackElement::mediaElement const):
* html/LinkIconCollector.cpp:
(WebCore::LinkIconCollector::iconsOfTypes):
* html/MediaDocument.cpp:
(WebCore::MediaDocumentParser::createDocumentStructure):
(WebCore::MediaDocument::replaceMediaElementTimerFired):
* html/MediaElementSession.cpp:
(WebCore::needsArbitraryUserGestureAutoplayQuirk):
(WebCore::isElementRectMostlyInMainFrame):
(WebCore::isElementLargeRelativeToMainFrame):
* html/PluginDocument.cpp:
(WebCore::PluginDocumentParser::createDocumentStructure):
(WebCore::PluginDocumentParser::appendBytes):
* html/RadioNodeList.cpp:
(WebCore::toRadioButtonInputElement):
(WebCore::RadioNodeList::value const):
(WebCore::RadioNodeList::setValue):
* html/RangeInputType.cpp:
(WebCore::RangeInputType::updateTickMarkValues):
* html/canvas/CanvasRenderingContext.cpp:
(WebCore::CanvasRenderingContext::wouldTaintOrigin):
* html/canvas/CanvasRenderingContext2D.cpp:
(WebCore::CanvasRenderingContext2D::setStrokeStyle):
(WebCore::CanvasRenderingContext2D::setFillStyle):
(WebCore::CanvasRenderingContext2D::fillInternal):
(WebCore::CanvasRenderingContext2D::strokeInternal):
(WebCore::CanvasRenderingContext2D::fillRect):
(WebCore::CanvasRenderingContext2D::strokeRect):
(WebCore::toStyle):
(WebCore::CanvasRenderingContext2D::drawTextInternal):
* html/canvas/CanvasStyle.h:
(WebCore::CanvasStyle::canvasGradient const):
(WebCore::CanvasStyle::canvasPattern const):
* html/canvas/WebGL2RenderingContext.cpp:
(WebCore::WebGL2RenderingContext::texStorage2D):
(WebCore::WebGL2RenderingContext::getFramebufferAttachmentParameter):
(WebCore::WebGL2RenderingContext::validateIndexArrayConservative):
* html/canvas/WebGLBuffer.h:
* html/canvas/WebGLRenderingContext.cpp:
(WebCore::WebGLRenderingContext::getFramebufferAttachmentParameter):
(WebCore::WebGLRenderingContext::validateIndexArrayConservative):
* html/canvas/WebGLRenderingContextBase.cpp:
(WebCore::WebGLRenderingContextBase::compressedTexImage2D):
(WebCore::WebGLRenderingContextBase::compressedTexSubImage2D):
(WebCore::WebGLRenderingContextBase::copyTexSubImage2D):
(WebCore::WebGLRenderingContextBase::generateMipmap):
(WebCore::WebGLRenderingContextBase::getTexParameter):
(WebCore::WebGLRenderingContextBase::texImage2DBase):
(WebCore::WebGLRenderingContextBase::validateTexFunc):
(WebCore::WebGLRenderingContextBase::texSubImage2D):
(WebCore::WebGLRenderingContextBase::texSubImage2DBase):
(WebCore::WebGLRenderingContextBase::copyTexImage2D):
(WebCore::WebGLRenderingContextBase::texImage2D):
(WebCore::WebGLRenderingContextBase::texParameter):
(WebCore::WebGLRenderingContextBase::validateTextureBinding):
* html/canvas/WebGLRenderingContextBase.h:
* html/parser/HTMLConstructionSite.cpp:
(WebCore::executeReparentTask):
(WebCore::executeTakeAllChildrenAndReparentTask):
(WebCore::HTMLConstructionSite::dispatchDocumentElementAvailableIfNeeded):
(WebCore::HTMLConstructionSite::createHTMLElementOrFindCustomElementInterface):
(WebCore::HTMLConstructionSite::findFosterSite):
* html/parser/HTMLPreloadScanner.cpp:
(WebCore::TokenPreloadScanner::StartTagScanner::processAttribute):
* html/parser/XSSAuditorDelegate.cpp:
(WebCore::XSSAuditorDelegate::generateViolationReport):
* html/shadow/TextControlInnerElements.cpp:
(WebCore::SearchFieldResultsButtonElement::defaultEventHandler):
* html/track/InbandGenericTextTrack.cpp:
(WebCore::InbandGenericTextTrack::updateGenericCue):
(WebCore::InbandGenericTextTrack::removeGenericCue):
* html/track/InbandTextTrack.cpp:
(WebCore::InbandTextTrack::willRemove):
* html/track/TextTrack.cpp:
(WebCore::TextTrack::addCue):
(WebCore::TextTrack::addRegion):
* html/track/VideoTrack.cpp:
(WebCore::VideoTrack::willRemove):
* inspector/InspectorCanvas.cpp:
(WebCore::InspectorCanvas::buildInitialState):
* platform/graphics/GraphicsContext.h:
(WebCore::GraphicsContext::strokeGradient const):
(WebCore::GraphicsContext::fillGradient const):
* rendering/svg/RenderSVGPath.cpp:
(WebCore::useStrokeStyleToFill):

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

21 months agoWeb Inspector: Canvas2D Profiling: highlight expensive context commands in the captur...
webkit@devinrousso.com [Fri, 3 Nov 2017 07:04:22 +0000 (07:04 +0000)]
Web Inspector: Canvas2D Profiling: highlight expensive context commands in the captured command log
https://bugs.webkit.org/show_bug.cgi?id=178302
<rdar://problem/33158849>

Reviewed by Brian Burg.

Source/JavaScriptCore:

* inspector/protocol/Recording.json:
Add `duration` to each Frame that represents the total time of all the recorded actions.

Source/WebCore:

No new tests, updated existing tests.

* inspector/InspectorCanvas.h:
* inspector/InspectorCanvas.cpp:
(WebCore::InspectorCanvas::recordAction):
(WebCore::InspectorCanvas::finalizeFrame):
(WebCore::InspectorCanvas::markNewFrame): Deleted.

* inspector/InspectorCanvasAgent.cpp:
(WebCore::InspectorCanvasAgent::didFinishRecordingCanvasFrame):

Source/WebInspectorUI:

* UserInterface/Models/RecordingFrame.js:
(WI.RecordingFrame):
(WI.RecordingFrame.fromPayload):
(WI.RecordingFrame.prototype.get duration):
(WI.RecordingFrame.prototype.toJSON):

* UserInterface/Views/RecordingNavigationSidebarPanel.js:
(WI.RecordingNavigationSidebarPanel.prototype.set recording):
* UserInterface/Views/RecordingNavigationSidebarPanel.css:
(.sidebar > .panel.navigation.recording > .content > .tree-outline .item.folder-icon > .status):

LayoutTests:

* inspector/canvas/recording-2d-expected.txt:
* inspector/canvas/recording-webgl-expected.txt:
* inspector/canvas/recording-webgl-snapshots-expected.txt:
* inspector/canvas/resources/recording-utilities.js:
(TestPage.registerInitializer):
* inspector/model/recording-expected.txt:
* inspector/model/recording.html:

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

21 months agoAdd license for MotionMark
jonlee@apple.com [Fri, 3 Nov 2017 06:20:22 +0000 (06:20 +0000)]
Add license for MotionMark
https://bugs.webkit.org/show_bug.cgi?id=179222

Reviewed by Ryosuke Niwa.

* MotionMark/about.html:
* MotionMark/developer.html:
* MotionMark/index.html:
* MotionMark/resources/debug-runner/graph.js:
* MotionMark/resources/debug-runner/motionmark.css:
* MotionMark/resources/debug-runner/motionmark.js:
* MotionMark/resources/debug-runner/tests.js:
* MotionMark/resources/extensions.js:
* MotionMark/resources/statistics.js:
* MotionMark/resources/strings.js:
* MotionMark/tests/3d/resources/webgl.js:
* MotionMark/tests/3d/webgl.html:
* MotionMark/tests/bouncing-particles/bouncing-canvas-images.html:
* MotionMark/tests/bouncing-particles/bouncing-canvas-shapes.html:
* MotionMark/tests/bouncing-particles/bouncing-css-images.html:
* MotionMark/tests/bouncing-particles/bouncing-css-shapes.html:
* MotionMark/tests/bouncing-particles/bouncing-svg-images.html:
* MotionMark/tests/bouncing-particles/bouncing-svg-shapes.html:
* MotionMark/tests/bouncing-particles/bouncing-tagged-images.html:
* MotionMark/tests/bouncing-particles/resources/bouncing-canvas-images.js:
* MotionMark/tests/bouncing-particles/resources/bouncing-canvas-particles.js:
* MotionMark/tests/bouncing-particles/resources/bouncing-canvas-shapes.js:
* MotionMark/tests/bouncing-particles/resources/bouncing-css-images.js:
* MotionMark/tests/bouncing-particles/resources/bouncing-css-shapes.js:
* MotionMark/tests/bouncing-particles/resources/bouncing-particles.js:
* MotionMark/tests/bouncing-particles/resources/bouncing-svg-images.js:
* MotionMark/tests/bouncing-particles/resources/bouncing-svg-particles.js:
* MotionMark/tests/bouncing-particles/resources/bouncing-svg-shapes.js:
* MotionMark/tests/bouncing-particles/resources/bouncing-tagged-images.js:
* MotionMark/tests/dom/compositing-transforms.html:
* MotionMark/tests/dom/focus.html:
* MotionMark/tests/dom/leaves.html:
* MotionMark/tests/dom/particles.html:
* MotionMark/tests/dom/resources/compositing-transforms.js:
* MotionMark/tests/dom/resources/dom-particles.js:
* MotionMark/tests/dom/resources/focus.js:
* MotionMark/tests/dom/resources/leaves.js:
* MotionMark/tests/master/canvas-stage.html:
* MotionMark/tests/master/focus.html:
* MotionMark/tests/master/image-data.html:
* MotionMark/tests/master/leaves.html:
* MotionMark/tests/master/multiply.html:
* MotionMark/tests/master/resources/canvas-stage.js:
* MotionMark/tests/master/resources/canvas-tests.js:
* MotionMark/tests/master/resources/focus.js:
* MotionMark/tests/master/resources/image-data.js:
* MotionMark/tests/master/resources/leaves.js:
* MotionMark/tests/master/resources/multiply.js:
* MotionMark/tests/master/resources/particles.js:
* MotionMark/tests/master/resources/svg-particles.js:
* MotionMark/tests/master/resources/text.js:
* MotionMark/tests/master/svg-particles.html:
* MotionMark/tests/master/text.html:
* MotionMark/tests/resources/main.js:
* MotionMark/tests/resources/math.js:
* MotionMark/tests/resources/stage.css:
* MotionMark/tests/simple/resources/simple-canvas-paths.js:
* MotionMark/tests/simple/resources/simple-canvas.js:
* MotionMark/tests/simple/resources/tiled-canvas-image.js:
* MotionMark/tests/simple/simple-canvas-paths.html:
* MotionMark/tests/simple/tiled-canvas-image.html:
* MotionMark/tests/template/resources/template-canvas.js:
* MotionMark/tests/template/resources/template-css.js:
* MotionMark/tests/template/resources/template-svg.js:
* MotionMark/tests/template/template-canvas.html:
* MotionMark/tests/template/template-css.html:
* MotionMark/tests/template/template-svg.html:

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

21 months agoDon't try to guess plugin MIME type from a file extension in a URL (no observable...
mjs@apple.com [Fri, 3 Nov 2017 06:08:11 +0000 (06:08 +0000)]
Don't try to guess plugin MIME type from a file extension in a URL (no observable effect)
https://bugs.webkit.org/show_bug.cgi?id=178333

Reviewed by Darin Adler.

Source/WebCore:

No test cases because I could not find an observable behavior difference,
even after trying many different plugin loading scenarios.

* html/HTMLPlugInImageElement.cpp:
(WebCore::HTMLPlugInImageElement::didAddUserAgentShadowRoot): loadedMIMEType --> serviceType
(WebCore::HTMLPlugInImageElement::restartSimilarPlugIns): ditto
(WebCore::HTMLPlugInImageElement::userDidClickSnapshot): ditto
(WebCore::HTMLPlugInImageElement::subframeLoaderWillCreatePlugIn): ditto
* html/HTMLPlugInImageElement.h:
(WebCore::HTMLPlugInImageElement::loadedMimeType const): Deleted. This was the one call site
for mimeTypeFromURL, and is otherwise just a wrapper for SerciceType()
* platform/URL.cpp:
(WebCore::mimeTypeFromURL): Deleted. This was the only use of MIMETypeDatabase in URL.
* platform/URL.h: Removed declaration for mimeTypeFromURL.
* WebCore.order: Removed mimeTypeFromURL.

Source/WebKit:

* WebProcess/Plugins/PluginView.cpp:
(WebKit::PluginView::pluginDidReceiveUserInteraction): loadedMIMEType --> serviceType
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::determinePrimarySnapshottedPlugIn): ditto

Source/WebKitLegacy/win:

* WebCoreSupport/WebFrameLoaderClient.cpp:
(WebFrameLoaderClient::objectContentType): Remove unnecessary call to mimeTypeFromURL

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

21 months ago[Curl] Fix cancellation process implementation
commit-queue@webkit.org [Fri, 3 Nov 2017 06:05:33 +0000 (06:05 +0000)]
[Curl] Fix cancellation process implementation
https://bugs.webkit.org/show_bug.cgi?id=179199

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

* platform/network/curl/CurlRequest.cpp:
(WebCore::CurlRequest::cancel):
(WebCore::CurlRequest::willSendData):
(WebCore::CurlRequest::didReceiveHeader):
(WebCore::CurlRequest::didReceiveData):
(WebCore::CurlRequest::completeDidReceiveResponse):
(WebCore::CurlRequest::pausedStatusChanged):
* platform/network/curl/CurlRequest.h:
(WebCore::CurlRequest::isSyncRequest const):
(WebCore::CurlRequest::isCompletedOrCancelled const):
(WebCore::CurlRequest::needToInvokeDidCancelTransfer const):
(WebCore::CurlRequest::isSyncRequest): Deleted.

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

21 months agoSW: Implement "Update Registration State" algorithm (unused for now)
beidson@apple.com [Fri, 3 Nov 2017 04:36:20 +0000 (04:36 +0000)]
SW: Implement "Update Registration State" algorithm (unused for now)
https://bugs.webkit.org/show_bug.cgi?id=179186

Reviewed by Chris Dumez.

Source/WebCore:

No new tests (No behavior change yet).

This algorithm is very simple, and this patch plumbs it through.
But it's not useful to start using this algorithm without "Update Worker State" also.
So to keep this patch small, it's unused for now. Will be used in the next patch.

* WebCore.xcodeproj/project.pbxproj:

* workers/service/ServiceWorkerContainer.cpp:
(WebCore::ServiceWorkerContainer::jobResolvedWithRegistration):

* workers/service/ServiceWorkerRegistration.cpp:
(WebCore::ServiceWorkerRegistration::ServiceWorkerRegistration):
(WebCore::ServiceWorkerRegistration::~ServiceWorkerRegistration):
(WebCore::ServiceWorkerRegistration::updateStateFromServer):
* workers/service/ServiceWorkerRegistration.h:

* workers/service/ServiceWorkerTypes.h: Copied from Source/WebCore/workers/service/server/SWServerRegistration.cpp.

* workers/service/server/SWClientConnection.cpp:
(WebCore::SWClientConnection::addServiceWorkerRegistration):
(WebCore::SWClientConnection::removeServiceWorkerRegistration):
(WebCore::SWClientConnection::updateRegistrationState):
* workers/service/server/SWClientConnection.h:

* workers/service/server/SWServer.cpp:
(WebCore::SWServer::Connection::addServiceWorkerRegistrationInServer):
(WebCore::SWServer::Connection::removeServiceWorkerRegistrationInServer):
(WebCore::SWServer::addClientServiceWorkerRegistration):
(WebCore::SWServer::removeClientServiceWorkerRegistration):
* workers/service/server/SWServer.h:
(WebCore::SWServer::getConnection):

* workers/service/server/SWServerJobQueue.cpp:
(WebCore::SWServerJobQueue::runRegisterJob):

* workers/service/server/SWServerRegistration.cpp:
(WebCore::SWServerRegistration::SWServerRegistration):
(WebCore::SWServerRegistration::updateRegistrationState):
(WebCore::SWServerRegistration::addClientServiceWorkerRegistration):
(WebCore::SWServerRegistration::removeClientServiceWorkerRegistration):
* workers/service/server/SWServerRegistration.h:

Source/WebKit:

* Scripts/webkit/messages.py:
(headers_for_type):

* Shared/WebCoreArgumentCoders.h:

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

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

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

21 months agoAssert that updateStyle and updateLayout are only called when it's safe to dispatch...
rniwa@webkit.org [Fri, 3 Nov 2017 03:48:11 +0000 (03:48 +0000)]
Assert that updateStyle and updateLayout are only called when it's safe to dispatch events
https://bugs.webkit.org/show_bug.cgi?id=179157
<rdar://problem/35144778>

Reviewed by Zalan Bujtas.

Added assertions to Document::updateStyleIfNeeded and Document::updateLayout that these functions are
only called when NoEventDispatchAssertion::isEventAllowedInMainThread() is true with two exceptions:
1. Inside SVGImage::draw which triggers a layout on a separate document.
2. While doing a nested layout for a frame flattening.

No new tests since there should be no behavioral changes.

* dom/ContainerNode.cpp:
(NoEventDispatchAssertion::DisableAssertionsInScope::s_existingCount): Deleted. This is now an instance
variable of DisableAssertionsInScope.
(ContainerNode::removeNodeWithScriptAssertion): Moved childrenChanged out of the scope since it could
invoke respondToChangedSelection via HTMLTextAreaElement::childrenChanged.
* dom/Document.cpp:
(WebCore::Document::updateStyleIfNeeded): Added the assertion. Allow updateWidgetPositions() to call
this function but exit early when checking needsStyleRecalc().
(WebCore::Document::updateLayout): Added the assertion.
* dom/NoEventDispatchAssertion.h:
(WebCore::NoEventDispatchAssertion::DisableAssertionsInScope::DisableAssertionsInScope): Made this class
store the original value of s_count as an instance variable to support re-entrancy.
(WebCore::NoEventDispatchAssertion::DisableAssertionsInScope::~DisableAssertionsInScope): Ditto.
* page/LayoutContext.cpp:
(WebCore::LayoutContext::runOrScheduleAsynchronousTasks): Temporarily disable the assertion. This is safe
since SVGImage has its own document.
* svg/SVGSVGElement.cpp:
(WebCore::checkIntersectionWithoutUpdatingLayout): Extracted out of SVGSVGElement::checkIntersection.
(WebCore::checkEnclosureWithoutUpdatingLayout): Extracted out of SVGSVGElement::checkEnclosure.
(WebCore::SVGSVGElement::getIntersectionList): Use checkIntersectionWithoutUpdatingLayout to avoid
calling updateLayoutIgnorePendingStylesheets while iterating over elements.
(WebCore::SVGSVGElement::getEnclosureList): Ditto.
(WebCore::SVGSVGElement::checkIntersection):
(WebCore::SVGSVGElement::checkEnclosure):
* svg/graphics/SVGImage.cpp:
(WebCore::SVGImage::draw): Temporarily disable the assertion. This is safe as SVGImage has its own page.

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

21 months agoFix Windows debug build after r224371
achristensen@apple.com [Fri, 3 Nov 2017 03:16:44 +0000 (03:16 +0000)]
Fix Windows debug build after r224371

* platform/graphics/win/DIBPixelData.h:

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

21 months agoUse CompletionHandlers for redirects
achristensen@apple.com [Fri, 3 Nov 2017 02:54:36 +0000 (02:54 +0000)]
Use CompletionHandlers for redirects
https://bugs.webkit.org/show_bug.cgi?id=179163

Reviewed by Tim Horton.

Source/WebCore:

Having functions sometimes have to remember to call client->continueWillSendRequest is fragile.
CompletionHandler asserts if it's not called once before destruction, and that's what we need here.
This will prevent future bugs, and make ResourceHandle look more like NetworkDataTask.

No change in behavior.

* loader/NetscapePlugInStreamLoader.cpp:
(WebCore::NetscapePlugInStreamLoader::willSendRequest):
* loader/NetscapePlugInStreamLoader.h:
* loader/ResourceLoader.cpp:
(WebCore::ResourceLoader::willSendRequest):
(WebCore::ResourceLoader::willSendRequestAsync):
* loader/ResourceLoader.h:
* loader/appcache/ApplicationCacheGroup.cpp:
(WebCore::ApplicationCacheGroup::willSendRequestAsync):
* loader/appcache/ApplicationCacheGroup.h:
* platform/network/BlobResourceHandle.cpp:
* platform/network/PingHandle.h:
* platform/network/ResourceHandle.h:
* platform/network/ResourceHandleClient.h:
* platform/network/SynchronousLoaderClient.cpp:
(WebCore::SynchronousLoaderClient::willSendRequestAsync):
* platform/network/SynchronousLoaderClient.h:
* platform/network/cf/ResourceHandleCFNet.cpp:
(WebCore::ResourceHandle::willSendRequest):
(WebCore::ResourceHandle::continueWillSendRequest): Deleted.
* platform/network/cf/ResourceHandleCFURLConnectionDelegate.h:
* platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.cpp:
(WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::willSendRequest):
(WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::continueWillSendRequest): Deleted.
* platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.h:
* platform/network/curl/ResourceHandleCurlDelegate.cpp:
(WebCore::ResourceHandleCurlDelegate::willSendRequest):
* platform/network/mac/ResourceHandleMac.mm:
(WebCore::ResourceHandle::willSendRequest):
(WebCore::ResourceHandle::continueWillSendRequest): Deleted.
* platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.h:
* platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm:
(-[WebCoreResourceHandleAsOperationQueueDelegate connection:willSendRequest:redirectResponse:]):
(-[WebCoreResourceHandleAsOperationQueueDelegate continueWillSendRequest:]): Deleted.
* platform/network/soup/ResourceHandleSoup.cpp:
(WebCore::doRedirect):
(WebCore::ResourceHandle::continueWillSendRequest): Deleted.

Source/WebKit:

* NetworkProcess/Downloads/BlobDownloadClient.cpp:
(WebKit::BlobDownloadClient::willSendRequestAsync):
* NetworkProcess/Downloads/BlobDownloadClient.h:
* NetworkProcess/NetworkDataTask.h:
* NetworkProcess/NetworkLoad.cpp:
(WebKit::NetworkLoad::~NetworkLoad):
(WebKit::NetworkLoad::continueWillSendRequest):
(WebKit::NetworkLoad::willSendRequestAsync):
* NetworkProcess/NetworkLoad.h:
* NetworkProcess/NetworkLoadClient.h:
* NetworkProcess/cocoa/NetworkSessionCocoa.mm:
(-[WKNetworkSessionDelegate URLSession:task:willPerformHTTPRedirection:newRequest:completionHandler:]):
(-[WKNetworkSessionDelegate URLSession:task:_schemeUpgraded:completionHandler:]):
* UIProcess/API/APIDownloadClient.h:
(API::DownloadClient::willSendRequest):
* UIProcess/API/C/WKContext.cpp:
(WKContextSetDownloadClient):
* UIProcess/Cocoa/DownloadClient.h:
* UIProcess/Cocoa/DownloadClient.mm:
(WebKit::DownloadClient::willSendRequest):
* WebProcess/Network/WebResourceLoader.cpp:
(WebKit::WebResourceLoader::willSendRequest):
* WebProcess/Plugins/PluginView.cpp:
(WebKit::PluginView::Stream::~Stream):
(WebKit::PluginView::Stream::continueLoad):
(WebKit::PluginView::Stream::willSendRequest):
* WebProcess/WebPage/WebURLSchemeTaskProxy.cpp:

Source/WebKitLegacy/mac:

* Plugins/Hosted/HostedNetscapePluginStream.h:
* Plugins/Hosted/HostedNetscapePluginStream.mm:
(WebKit::HostedNetscapePluginStream::willSendRequest):
* Plugins/WebNetscapePluginStream.h:
* Plugins/WebNetscapePluginStream.mm:
(WebNetscapePluginStream::willSendRequest):

Source/WebKitLegacy/win:

* Plugins/PluginStream.cpp:
(WebCore::PluginStream::willSendRequest):
* Plugins/PluginStream.h:
(WebCore::PluginStreamClient::~PluginStreamClient):
(WebCore::PluginStreamClient::streamDidFinishLoading):
(WebCore::PluginStream::create):
(WebCore::PluginStream::setLoadManually):

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

21 months agoReduce duplication in the toplevel Makefile
timothy_horton@apple.com [Fri, 3 Nov 2017 02:50:59 +0000 (02:50 +0000)]
Reduce duplication in the toplevel Makefile
https://bugs.webkit.org/show_bug.cgi?id=179204

Unreviewed build fix.

* Source/Makefile:
Take three. An empty SDKROOT should be like Mac (and build all the things).

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

21 months agoAdd a FileSystem namespace to FileSystem.cpp
commit-queue@webkit.org [Fri, 3 Nov 2017 02:33:25 +0000 (02:33 +0000)]
Add a FileSystem namespace to FileSystem.cpp
https://bugs.webkit.org/show_bug.cgi?id=179063

Patch by Christopher Reid <chris.reid@sony.com> on 2017-11-02
Reviewed by Darin Adler.

Source/WebCore:

No new tests, no change in behavior.

Adding a FileSystem namespace so its functions aren't global in WebCore.

* Modules/encryptedmedia/legacy/WebKitMediaKeySession.cpp:
* Modules/entriesapi/DOMFileSystem.cpp:
* Modules/entriesapi/FileSystemEntry.cpp:
* Modules/indexeddb/IDBDatabaseIdentifier.cpp:
* Modules/indexeddb/server/IDBServer.cpp:
* Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
* Modules/indexeddb/server/SQLiteIDBTransaction.cpp:
* Modules/indexeddb/shared/InProcessIDBServer.cpp:
* Modules/webdatabase/DatabaseTracker.cpp:
* Modules/webdatabase/OriginLock.cpp:
* Modules/webdatabase/OriginLock.h:
* fileapi/File.cpp:
* fileapi/FileCocoa.mm:
* html/FileListCreator.cpp:
* html/HTMLMediaElement.cpp:
* loader/appcache/ApplicationCacheStorage.cpp:
* page/Page.cpp:
* page/SecurityOrigin.cpp:
* page/SecurityOriginData.cpp:
* platform/FileHandle.cpp:
* platform/FileHandle.h:
* platform/FileStream.cpp:
* platform/FileStream.h:
* platform/FileSystem.cpp: Added FileSystem namespace
* platform/FileSystem.h: Added FileSystem namespace
* platform/SharedBuffer.cpp:
* platform/SharedBuffer.h:
* platform/cf/FileSystemCF.cpp: Added FileSystem namespace
* platform/cocoa/FileMonitorCocoa.mm:
* platform/cocoa/FileSystemCocoa.mm: Added FileSystem namespace
* platform/glib/FileMonitorGLib.cpp:
* platform/glib/FileSystemGlib.cpp: Added FileSystem namespace
* platform/glib/SharedBufferGlib.cpp:
* platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.mm:
* platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.mm:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
* platform/graphics/win/DIBPixelData.h:
* platform/ios/QuickLook.mm:
* platform/ios/WebItemProviderPasteboard.mm:
* platform/mac/FileSystemMac.mm: Added FileSystem namespace
* platform/network/BlobDataFileReference.cpp:
* platform/network/BlobRegistryImpl.cpp:
* platform/network/FormData.cpp:
* platform/network/cf/FormDataStreamCFNet.cpp:
* platform/network/cocoa/ResourceRequestCocoa.mm:
* platform/network/curl/CurlCacheEntry.cpp:
* platform/network/curl/CurlCacheEntry.h:
* platform/network/curl/CurlCacheManager.cpp:
* platform/network/curl/CurlDownload.cpp:
* platform/network/curl/CurlRequest.cpp:
* platform/network/curl/CurlRequest.h:
* platform/network/curl/ResourceHandleCurl.cpp:
* platform/network/mac/BlobDataFileReferenceMac.mm:
* platform/network/soup/ResourceRequestSoup.cpp:
* platform/network/soup/SoupNetworkSession.cpp:
* platform/posix/FileSystemPOSIX.cpp: Added FileSystem namespace
* platform/posix/SharedBufferPOSIX.cpp:
* platform/sql/SQLiteFileSystem.cpp:
* platform/text/hyphen/HyphenationLibHyphen.cpp:
* platform/win/FileSystemWin.cpp: Added FileSystem namespace
* rendering/RenderThemeGtk.cpp:
* rendering/RenderThemeWin.cpp:

Source/WebKit:

* NetworkProcess/Downloads/BlobDownloadClient.cpp:
* NetworkProcess/Downloads/BlobDownloadClient.h:
* NetworkProcess/NetworkDataTaskBlob.cpp:
* NetworkProcess/NetworkDataTaskBlob.h:
* NetworkProcess/NetworkProcess.cpp:
* NetworkProcess/cache/CacheStorageEngine.cpp:
* NetworkProcess/cache/CacheStorageEngineCaches.cpp:
* NetworkProcess/cache/NetworkCache.cpp:
* NetworkProcess/cache/NetworkCacheBlobStorage.cpp:
* NetworkProcess/cache/NetworkCacheData.cpp:
* NetworkProcess/cache/NetworkCacheFileSystem.cpp:
* NetworkProcess/cache/NetworkCacheIOChannelCocoa.mm:
* NetworkProcess/cache/NetworkCacheIOChannelSoup.cpp:
* NetworkProcess/cache/NetworkCacheStatistics.cpp:
* NetworkProcess/cache/NetworkCacheStorage.cpp:
* NetworkProcess/capture/NetworkCaptureManager.cpp:
* NetworkProcess/capture/NetworkCaptureManager.h:
* NetworkProcess/capture/NetworkCaptureRecorder.cpp:
* NetworkProcess/capture/NetworkCaptureResource.h:
* NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
* NetworkProcess/cocoa/NetworkSessionCocoa.mm:
* NetworkProcess/soup/NetworkProcessSoup.cpp:
* Shared/Plugins/Netscape/unix/NetscapePluginModuleUnix.cpp:
* Shared/Plugins/unix/PluginSearchPath.cpp:
* Shared/WebMemorySampler.cpp:
* Shared/WebMemorySampler.h:
* Shared/gtk/ProcessExecutablePathGtk.cpp:
* Shared/ios/ChildProcessIOS.mm:
* Shared/mac/ChildProcessMac.mm:
* Shared/mac/SandboxExtensionMac.mm:
* Shared/wpe/ProcessExecutablePathWPE.cpp:
* StorageProcess/StorageProcess.cpp:
* UIProcess/API/APIContentRuleListStore.cpp:
* UIProcess/API/glib/APIWebsiteDataStoreGLib.cpp:
* UIProcess/API/glib/IconDatabase.cpp:
* UIProcess/API/glib/WebKitFaviconDatabase.cpp:
* UIProcess/API/glib/WebKitFileChooserRequest.cpp:
* UIProcess/API/glib/WebKitWebContext.cpp:
* UIProcess/API/glib/WebKitWebsiteDataManager.cpp:
* UIProcess/Automation/WebAutomationSession.cpp:
* UIProcess/Cocoa/WebProcessPoolCocoa.mm:
* UIProcess/Cocoa/WebViewImpl.mm:
* UIProcess/Launcher/glib/ProcessLauncherGLib.cpp:
* UIProcess/Plugins/gtk/PluginInfoCache.cpp:
* UIProcess/Plugins/unix/PluginInfoStoreUnix.cpp:
* UIProcess/Plugins/unix/PluginProcessProxyUnix.cpp:
* UIProcess/ResourceLoadStatisticsPersistentStorage.cpp:
* UIProcess/WebStorage/LocalStorageDatabase.cpp:
* UIProcess/WebStorage/LocalStorageDatabaseTracker.cpp:
* UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
* UIProcess/WebsiteData/WebsiteDataStore.cpp:
* UIProcess/gtk/WebProcessPoolGtk.cpp:
* UIProcess/mac/WebPageProxyMac.mm:
* UIProcess/wpe/WebProcessPoolWPE.cpp:
* WebProcess/InjectedBundle/API/glib/WebKitExtensionManager.cpp:
* WebProcess/InjectedBundle/glib/InjectedBundleGlib.cpp:
* WebProcess/MediaCache/WebMediaKeyStorageManager.cpp:
* WebProcess/Plugins/Netscape/NetscapePluginStream.cpp:
* WebProcess/Plugins/Netscape/NetscapePluginStream.h:
* WebProcess/WebCoreSupport/SessionStateConversion.cpp:

Source/WebKitLegacy:

* Storage/StorageAreaSync.cpp:
* Storage/StorageSyncManager.cpp:
* Storage/StorageTracker.cpp:

Source/WebKitLegacy/mac:

* Misc/WebNSFileManagerExtras.mm:
* Storage/WebDatabaseProvider.mm:

Source/WebKitLegacy/win:

* Plugins/PluginDatabase.cpp:
* Plugins/PluginPackage.cpp:
* Plugins/PluginStream.cpp:
* Plugins/PluginStream.h:
* WebApplicationCache.cpp:
* WebDatabaseManager.cpp:
* WebDownloadCurl.cpp:
* WebPreferences.cpp:
* WebView.cpp:

Tools:

* DumpRenderTree/win/DumpRenderTree.cpp:
* TestWebKitAPI/Tests/WebCore/FileMonitor.cpp:
* TestWebKitAPI/Tests/WebCore/FileSystem.cpp:
* TestWebKitAPI/Tests/WebCore/SecurityOrigin.cpp:
* TestWebKitAPI/Tests/WebCore/SharedBufferTest.cpp:
* TestWebKitAPI/Tests/WebCore/cocoa/DatabaseTrackerTest.mm:
* TestWebKitAPI/Tests/WebKitCocoa/Download.mm:

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

21 months agoWeb Inspector: Canvas Tab: show supported GL extensions for selected canvas
webkit@devinrousso.com [Fri, 3 Nov 2017 01:53:17 +0000 (01:53 +0000)]
Web Inspector: Canvas Tab: show supported GL extensions for selected canvas
https://bugs.webkit.org/show_bug.cgi?id=179070
<rdar://problem/35278276>

Reviewed by Brian Burg.

Source/JavaScriptCore:

* inspector/protocol/Canvas.json:
Add `extensionEnabled` event that is fired each time `getExtension` is called with a
different string on a WebGL context.

Source/WebCore:

Test: inspector/canvas/extensions.html

* html/canvas/WebGL2RenderingContext.cpp:
(WebCore::WebGL2RenderingContext::getExtension):
* html/canvas/WebGLRenderingContext.cpp:
(WebCore::WebGLRenderingContext::getExtension):
Rework common logic into a macro for readability and to simplify adding calls to
InspectorInstrumentation functions.

* html/canvas/WebGLRenderingContextBase.h:
* html/canvas/WebGLRenderingContextBase.cpp:
(WebCore::WebGLRenderingContextBase::extensionIsEnabled):

* inspector/InspectorCanvasAgent.h:
* inspector/InspectorCanvasAgent.cpp:
(WebCore::InspectorCanvasAgent::enable):
(WebCore::InspectorCanvasAgent::didEnableExtension):

* inspector/InspectorInstrumentation.h:
(WebCore::InspectorInstrumentation::didEnableExtension):
* inspector/InspectorInstrumentation.cpp:
(WebCore::InspectorInstrumentation::didEnableExtensionImpl):

Source/WebInspectorUI:

* Localizations/en.lproj/localizedStrings.js:

* UserInterface/Protocol/CanvasObserver.js:
(WI.CanvasObserver.prototype.extensionEnabled):

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

* UserInterface/Models/Canvas.js:
(WI.Canvas.prototype.get extensions):
(WI.Canvas.prototype.enableExtension):
Maintain a Set of enabled extensions, and dispatch an event whenever an extension is enabled.

* UserInterface/Views/CanvasDetailsSidebarPanel.css:
(.sidebar > .panel.details.canvas .details-section.canvas-extensions .content > ul):
* UserInterface/Views/CanvasDetailsSidebarPanel.js:
(WI.CanvasDetailsSidebarPanel.prototype.set canvas):
(WI.CanvasDetailsSidebarPanel.prototype.initialLayout):
(WI.CanvasDetailsSidebarPanel.prototype.layout):
(WI.CanvasDetailsSidebarPanel.prototype._refreshAttributesSection):
(WI.CanvasDetailsSidebarPanel.prototype._refreshExtensionsSection):
Drive-by: hide Attributes section when the canvas has no attributes.
LayoutTests:

* inspector/canvas/extensions-expected.txt: Added.
* inspector/canvas/extensions.html: Added.

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

21 months agoDo not check for CORS in case response is coming from a service worker
commit-queue@webkit.org [Fri, 3 Nov 2017 01:36:37 +0000 (01:36 +0000)]
Do not check for CORS in case response is coming from a service worker
https://bugs.webkit.org/show_bug.cgi?id=179177

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

Source/WebCore:

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

As per fetch spec, CORS check (https://fetch.spec.whatwg.org/#cors-check) is done
within HTTP fetch (https://fetch.spec.whatwg.org/#http-fetch).
It does not apply to fetches handled by service workers.

* loader/SubresourceLoader.cpp:
(WebCore::SubresourceLoader::checkResponseCrossOriginAccessControl):

LayoutTests:

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

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

21 months agoMake ServiceWorker a Remote Inspector debuggable target
joepeck@webkit.org [Fri, 3 Nov 2017 01:30:01 +0000 (01:30 +0000)]
Make ServiceWorker a Remote Inspector debuggable target
https://bugs.webkit.org/show_bug.cgi?id=179043
<rdar://problem/34126008>

Reviewed by Brian Burg.

Source/JavaScriptCore:

* inspector/remote/RemoteControllableTarget.h:
* inspector/remote/RemoteInspectionTarget.h:
* inspector/remote/RemoteInspectorConstants.h:
Include a new ServiceWorker remote inspector target type.

* inspector/remote/cocoa/RemoteInspectorCocoa.mm:
(Inspector::RemoteInspector::listingForInspectionTarget const):
Implement listing for a ServiceWorker to include a URL like a page.

* inspector/remote/glib/RemoteInspectorGlib.cpp:
(Inspector::RemoteInspector::listingForInspectionTarget const):
Bail for ServiceWorker support in glib. They will need to implement their support.

Source/WebCore:

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

* workers/service/context/ServiceWorkerDebuggable.h: Added.
* workers/service/context/ServiceWorkerDebuggable.cpp: Added.
(WebCore::ServiceWorkerDebuggable::ServiceWorkerDebuggable):
(WebCore::ServiceWorkerDebuggable::connect):
(WebCore::ServiceWorkerDebuggable::disconnect):
(WebCore::ServiceWorkerDebuggable::dispatchMessageFromRemote):
ServiceWorker remote inspector target, exposes the script url to debuggers.
Pass the channel on to the inspector proxy to hook it up to the worker.

* workers/service/context/ServiceWorkerInspectorProxy.h:
* workers/service/context/ServiceWorkerInspectorProxy.cpp: Added.
(WebCore::ServiceWorkerInspectorProxy::ServiceWorkerInspectorProxy):
(WebCore::ServiceWorkerInspectorProxy::~ServiceWorkerInspectorProxy):
(WebCore::ServiceWorkerInspectorProxy::serviceWorkerTerminated):
Handle interesting events throughout a Service Worker life cycle.

(WebCore::ServiceWorkerInspectorProxy::connectToWorker):
(WebCore::ServiceWorkerInspectorProxy::disconnectFromWorker):
(WebCore::ServiceWorkerInspectorProxy::sendMessageToWorker):
(WebCore::ServiceWorkerInspectorProxy::sendMessageFromWorkerToFrontend):
Implement existing worker debugger hooks for connection setup and sending messages.
Inspector protocol messages come in on the MainThread and hop over to the
WorkerThread to be handled on the expected context thread. Likewise outgoing
messages hop back to be sent through the InspectorFrontend channel on MainThread.

* workers/service/context/ServiceWorkerThread.cpp:
(WebCore::ServiceWorkerThread::ServiceWorkerThread):
* workers/service/context/ServiceWorkerThread.h:
* workers/service/context/ServiceWorkerThreadProxy.h:
* workers/service/context/ServiceWorkerThreadProxy.cpp:
(WebCore::ServiceWorkerThreadProxy::ServiceWorkerThreadProxy):
(WebCore::ServiceWorkerThreadProxy::postMessageToDebugger):
Construct the new inspector proxy and debuggable registration.
Call lifecycle events and debugger hooks when appropriate.

Source/WebInspectorUI:

Customize the Web Inspector frontend for a ServiceWorker target.
Currently this just behaves like a JavaScript Context target because
we haven't yet added support for Networking capabilities.

* UserInterface/Controllers/DebuggerManager.js:
(WI.DebuggerManager.prototype.get knownNonResourceScripts):
Drive-by fix a bug where lazily initializing the Resources / Debugger tabs
would show Console evaluation scripts. We should ignore them, like we
do in other places.

* Localizations/en.lproj/localizedStrings.js:
* UserInterface/Controllers/AppController.js:
(WI.AppController):
(WI.AppController.debuggableTypeFromHost):
* UserInterface/Controllers/AppControllerBase.js:
* UserInterface/Controllers/TimelineManager.js:
(WI.TimelineManager.defaultTimelineTypes):
(WI.TimelineManager.availableTimelineTypes):
* UserInterface/Models/TimelineRecording.js:
(WI.TimelineRecording.sourceCodeTimelinesSupported):
* UserInterface/Protocol/MainTarget.js:
(WI.MainTarget.prototype.get displayName):
* UserInterface/Test/TestAppController.js:
* UserInterface/Views/DashboardContainerView.css:
(body:not(.web) .toolbar .dashboard-container):
(body.javascript .toolbar .dashboard-container): Deleted.
* UserInterface/Views/DefaultDashboardView.css:
(body:not(.web) .toolbar .dashboard.default > :matches(.resourcesCount, .resourcesSize, .time)):
(body.javascript .toolbar .dashboard.default > :matches(.resourcesCount, .resourcesSize, .time)): Deleted.
* UserInterface/Views/ResourceSidebarPanel.js:
(WI.ResourceSidebarPanel):
(WI.ResourceSidebarPanel.shouldPlaceResourcesAtTopLevel):
(WI.ResourceSidebarPanel.prototype.initialLayout):
(WI.ResourceSidebarPanel.prototype._addScript):
(WI.ResourceSidebarPanel.prototype._extraDomainsActivated):
* UserInterface/Views/Toolbar.js:

Source/WebKit:

* UIProcess/API/Cocoa/_WKRemoteWebInspectorViewController.h:
* UIProcess/API/Cocoa/_WKRemoteWebInspectorViewController.mm:
(debuggableTypeString):
Provide a way to start a Remote Web Inspector frontend for a ServiceWorker target type.

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