WebKit-https.git
3 years ago[Extra zoom mode] Suppress UI for inputs of type file in extra zoom mode
wenson_hsieh@apple.com [Thu, 12 Apr 2018 21:58:54 +0000 (21:58 +0000)]
[Extra zoom mode] Suppress UI for inputs of type file in extra zoom mode
https://bugs.webkit.org/show_bug.cgi?id=184556
<rdar://problem/39062239>

Reviewed by Andy Estes.

When running in this mode, we don't have the facilities to present document picker UI. For now, just make this
feature fail gracefully.

* UIProcess/ios/forms/WKFileUploadPanel.mm:
(-[WKFileUploadPanel presentWithParameters:resultListener:]):
(-[WKFileUploadPanel platformSupportsPickerViewController]):

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

3 years ago[Web Animations] Fix a host of small CSS Animations and CSS Transitions issues
graouts@webkit.org [Thu, 12 Apr 2018 21:25:56 +0000 (21:25 +0000)]
[Web Animations] Fix a host of small CSS Animations and CSS Transitions issues
https://bugs.webkit.org/show_bug.cgi?id=184555

Reviewed by Dean Jackson.

Source/WebCore:

A series of small and intertwined issues were preventing a number of CSS Animations and CSS Trantions
tests to fail when expressed as Web Animations.

* animation/AnimationTimeline.cpp:
(WebCore::AnimationTimeline::updateCSSAnimationsForElement): Pass the old and new RenderStyles to CSSAnimation::create()
since we're refactoring DeclarativeAnimation to create blending keyframes in initialize(), no longer requiring each subclass
to create them.
(WebCore::AnimationTimeline::cssAnimationForElementAndProperty): Return the animation, if any, for a property animated by
a CSS animation, so that we can determine if a property is already being animated when running a CSS Transition.
(WebCore::AnimationTimeline::updateCSSTransitionsForElement): Since a property can be specified twice in a "transition" property,
once via "all" and once explicitly, ensure we look at all currently running transitions for the currently-processed property to
see if we need to cancel this transition. Previously, we used to only see if it had been transitioned in the old style. We also
start transitions even if the duration is 0 provided the delay is a positive, non-zero value. Then, if there is a CSS Animation
for this property already running, use that animation's original unanimated style as the from value.
* animation/AnimationTimeline.h:
* animation/CSSAnimation.cpp:
(WebCore::CSSAnimation::create): The animation name is now set in the CSSAnimation constructor.
(WebCore::CSSAnimation::CSSAnimation): Set the animation name and keep a copy of the unanimated style such that we can
get it when a CSS Transition is created and takes precedence over this CSS Animation.
(WebCore::CSSAnimation::initialize): Deleted.
* animation/CSSAnimation.h:
* animation/CSSTransition.cpp:
(WebCore::CSSTransition::create):
(WebCore::CSSTransition::initialize):
* animation/CSSTransition.h:
* animation/DeclarativeAnimation.cpp:
(WebCore::DeclarativeAnimation::initialize): Call the new computeDeclarativeAnimationBlendingKeyframes() on the KeyframeEffect
directly in this method so that subclasses don't need to create it manually, but most important so that keyframes are created
before timing properties are set based on the backing animation.
* animation/DeclarativeAnimation.h:
* animation/KeyframeEffectReadOnly.cpp:
(WebCore::KeyframeEffectReadOnly::getKeyframes): Ensure we have a CSSValue before trying to serialize it.
(WebCore::KeyframeEffectReadOnly::computeDeclarativeAnimationBlendingKeyframes):
(WebCore::KeyframeEffectReadOnly::computeCSSAnimationBlendingKeyframes): Use the animation's unanimated style to compute keyframes,
instead of a default RenderStyle which would not use the right values for implicit keyframes.
(WebCore::KeyframeEffectReadOnly::stylesWouldYieldNewCSSTransitionsBlendingKeyframes const): Look at the property used to create
the transition rather than that specified on the backing Animation object since it can be CSSPropertyInvalid in the case of
"transition: all".
(WebCore::KeyframeEffectReadOnly::setAnimatedPropertiesInStyle): If we're dealing with a CSS animation, we consider the first and
last keyframes to always have the property listed since the underlying style was provided and should be captured.
* animation/KeyframeEffectReadOnly.h:
* style/StyleTreeResolver.cpp:
(WebCore::Style::TreeResolver::createAnimatedElementUpdate): Apply CSS Animations after CSS Trasitions since they take precedence.

LayoutTests:

Mark more tests as passing when the CSS Animations and CSS Transitions as Web Animations flag is on.

* animations/animation-border-overflow.html:
* animations/lineheight-animation.html:
* animations/missing-from-to-transforms.html:
* animations/missing-values-first-keyframe.html:
* animations/missing-values-last-keyframe.html:
* animations/transition-and-animation-1.html:
* animations/transition-and-animation-2.html:
* animations/transition-and-animation-3.html:
* animations/width-using-ems.html:
* compositing/layer-creation/mismatched-rotated-transform-animation-overlap.html:
* compositing/layer-creation/multiple-keyframes-animation-overlap.html:
* compositing/layer-creation/scale-rotation-animation-overlap.html:
* compositing/layer-creation/translate-scale-animation-overlap.html:
* css3/filters/filter-animation-from-none-hw.html:
* css3/filters/filter-animation-from-none-multi-hw.html:
* css3/filters/filter-animation-from-none-multi.html:
* css3/filters/filter-animation-from-none.html:
* imported/blink/transitions/unprefixed-transform.html:
* transitions/interrupted-all-transition.html:

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

3 years ago[Web Animations] Only cancel declarative animations upon element removal
graouts@webkit.org [Thu, 12 Apr 2018 21:23:48 +0000 (21:23 +0000)]
[Web Animations] Only cancel declarative animations upon element removal
https://bugs.webkit.org/show_bug.cgi?id=184553

Reviewed by Dean Jackson.

LayoutTests/imported/w3c:

Make some WPT tests opt into the CSS Animations and CSS Transtions as Web Animations flag.

* web-platform-tests/web-animations/interfaces/Animation/ready.html:
* web-platform-tests/web-animations/timing-model/animations/playing-an-animation.html:
* web-platform-tests/web-animations/timing-model/animations/reversing-an-animation.html:

Source/WebCore:

Ensure we only call cancel() on CSSAnimation and CSSTransition objects as we might otherwise reject
the ready promise and produce spurious logging from WPT tests.

* animation/AnimationTimeline.cpp:
(WebCore::AnimationTimeline::cancelDeclarativeAnimationsForElement):
(WebCore::AnimationTimeline::cancelAnimationsForElement): Deleted.
* animation/AnimationTimeline.h:
* dom/Element.cpp:
(WebCore::Element::removedFromAncestor):
* dom/PseudoElement.cpp:
(WebCore::PseudoElement::clearHostElement):
* rendering/updating/RenderTreeUpdater.cpp:
(WebCore::RenderTreeUpdater::tearDownRenderers):

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

3 years agopemfile.py should not assume POSIX line endings
ross.kirsling@sony.com [Thu, 12 Apr 2018 20:48:09 +0000 (20:48 +0000)]
pemfile.py should not assume POSIX line endings
https://bugs.webkit.org/show_bug.cgi?id=184507

Reviewed by Daniel Bates.

* Scripts/webkitpy/common/system/pemfile.py:
(_parse_pem_format):
* Scripts/webkitpy/common/system/pemfile_unittest.py:
(PemFileTest.test_parse_crlf):
(PemFileTest.test_parse_cr):

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

3 years agoConsolidate some PtrTags.
mark.lam@apple.com [Thu, 12 Apr 2018 20:14:21 +0000 (20:14 +0000)]
Consolidate some PtrTags.
https://bugs.webkit.org/show_bug.cgi?id=184552
<rdar://problem/39389404>

Reviewed by Filip Pizlo.

Consolidate CodeEntryPtrTag and CodeEntryWithArityCheckPtrTag into CodePtrTag.
Consolidate NearCallPtrTag and NearJumpPtrTag into NearCodePtrTag.

* assembler/AbstractMacroAssembler.h:
(JSC::AbstractMacroAssembler::repatchNearCall):
* assembler/MacroAssemblerARM.h:
(JSC::MacroAssemblerARM::readCallTarget):
* assembler/MacroAssemblerARMv7.h:
(JSC::MacroAssemblerARMv7::readCallTarget):
* assembler/MacroAssemblerMIPS.h:
(JSC::MacroAssemblerMIPS::readCallTarget):
* assembler/MacroAssemblerX86.h:
(JSC::MacroAssemblerX86::readCallTarget):
* assembler/MacroAssemblerX86_64.h:
(JSC::MacroAssemblerX86_64::readCallTarget):
* bytecode/AccessCase.cpp:
(JSC::AccessCase::generateImpl):
* bytecode/InlineAccess.cpp:
(JSC::InlineAccess::rewireStubAsJump):
* bytecode/PolymorphicAccess.cpp:
(JSC::PolymorphicAccess::regenerate):
* dfg/DFGJITCompiler.cpp:
(JSC::DFG::JITCompiler::linkOSRExits):
(JSC::DFG::JITCompiler::link):
(JSC::DFG::JITCompiler::compileFunction):
* dfg/DFGJITFinalizer.cpp:
(JSC::DFG::JITFinalizer::finalize):
(JSC::DFG::JITFinalizer::finalizeFunction):
* dfg/DFGOSREntry.cpp:
(JSC::DFG::prepareOSREntry):
* dfg/DFGOSRExit.cpp:
(JSC::DFG::OSRExit::executeOSRExit):
(JSC::DFG::adjustAndJumpToTarget):
(JSC::DFG::OSRExit::compileOSRExit):
* dfg/DFGOSRExitCompilerCommon.cpp:
(JSC::DFG::adjustAndJumpToTarget):
* dfg/DFGOperations.cpp:
* ftl/FTLJITCode.cpp:
(JSC::FTL::JITCode::executableAddressAtOffset):
* ftl/FTLJITFinalizer.cpp:
(JSC::FTL::JITFinalizer::finalizeCommon):
* ftl/FTLLazySlowPath.cpp:
(JSC::FTL::LazySlowPath::generate):
* ftl/FTLLink.cpp:
(JSC::FTL::link):
* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::compileCallOrConstruct):
(JSC::FTL::DFG::LowerDFGToB3::compileDirectCallOrConstruct):
(JSC::FTL::DFG::LowerDFGToB3::compileTailCall):
(JSC::FTL::DFG::LowerDFGToB3::compileCallOrConstructVarargsSpread):
(JSC::FTL::DFG::LowerDFGToB3::compileCallOrConstructVarargs):
(JSC::FTL::DFG::LowerDFGToB3::lazySlowPath):
* ftl/FTLOSRExitCompiler.cpp:
(JSC::FTL::compileFTLOSRExit):
* ftl/FTLOSRExitHandle.cpp:
(JSC::FTL::OSRExitHandle::emitExitThunk):
* jit/AssemblyHelpers.cpp:
(JSC::AssemblyHelpers::emitDumbVirtualCall):
* jit/JIT.cpp:
(JSC::JIT::compileWithoutLinking):
(JSC::JIT::link):
* jit/JITCall.cpp:
(JSC::JIT::compileOpCallSlowCase):
* jit/JITCode.cpp:
(JSC::JITCodeWithCodeRef::executableAddressAtOffset):
(JSC::NativeJITCode::addressForCall):
* jit/JITInlines.h:
(JSC::JIT::emitNakedCall):
(JSC::JIT::emitNakedTailCall):
* jit/JITMathIC.h:
(JSC::isProfileEmpty):
* jit/JITOpcodes.cpp:
(JSC::JIT::privateCompileHasIndexedProperty):
* jit/JITOperations.cpp:
* jit/JITPropertyAccess.cpp:
(JSC::JIT::stringGetByValStubGenerator):
(JSC::JIT::privateCompileGetByVal):
(JSC::JIT::privateCompileGetByValWithCachedId):
(JSC::JIT::privateCompilePutByVal):
(JSC::JIT::privateCompilePutByValWithCachedId):
* jit/JITThunks.cpp:
(JSC::JITThunks::hostFunctionStub):
* jit/Repatch.cpp:
(JSC::linkSlowFor):
(JSC::linkFor):
(JSC::linkPolymorphicCall):
* jit/SpecializedThunkJIT.h:
(JSC::SpecializedThunkJIT::finalize):
* jit/ThunkGenerators.cpp:
(JSC::virtualThunkFor):
(JSC::nativeForGenerator):
(JSC::boundThisNoArgsFunctionCallGenerator):
* llint/LLIntData.cpp:
(JSC::LLInt::initialize):
* llint/LLIntEntrypoint.cpp:
(JSC::LLInt::setEvalEntrypoint):
(JSC::LLInt::setProgramEntrypoint):
(JSC::LLInt::setModuleProgramEntrypoint):
* llint/LLIntSlowPaths.cpp:
(JSC::LLInt::LLINT_SLOW_PATH_DECL):
(JSC::LLInt::setUpCall):
* llint/LLIntThunks.cpp:
(JSC::LLInt::generateThunkWithJumpTo):
(JSC::LLInt::functionForCallEntryThunkGenerator):
(JSC::LLInt::functionForConstructEntryThunkGenerator):
(JSC::LLInt::functionForCallArityCheckThunkGenerator):
(JSC::LLInt::functionForConstructArityCheckThunkGenerator):
(JSC::LLInt::evalEntryThunkGenerator):
(JSC::LLInt::programEntryThunkGenerator):
(JSC::LLInt::moduleProgramEntryThunkGenerator):
* llint/LowLevelInterpreter.asm:
* llint/LowLevelInterpreter64.asm:
* runtime/NativeExecutable.cpp:
(JSC::NativeExecutable::finishCreation):
* runtime/NativeFunction.h:
(JSC::TaggedNativeFunction::TaggedNativeFunction):
(JSC::TaggedNativeFunction::operator NativeFunction):
* runtime/PtrTag.h:
* wasm/WasmBBQPlan.cpp:
(JSC::Wasm::BBQPlan::complete):
* wasm/WasmOMGPlan.cpp:
(JSC::Wasm::OMGPlan::work):
* wasm/WasmThunks.cpp:
(JSC::Wasm::throwExceptionFromWasmThunkGenerator):
(JSC::Wasm::throwStackOverflowFromWasmThunkGenerator):
(JSC::Wasm::triggerOMGTierUpThunkGenerator):
* wasm/js/WasmToJS.cpp:
(JSC::Wasm::wasmToJS):
* wasm/js/WebAssemblyFunction.h:
* yarr/YarrJIT.cpp:
(JSC::Yarr::YarrGenerator::compile):

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

3 years agoRemove block selection code
megan_gardner@apple.com [Thu, 12 Apr 2018 19:57:30 +0000 (19:57 +0000)]
Remove block selection code
https://bugs.webkit.org/show_bug.cgi?id=184470

Reviewed by Timothy Hatcher.

Remove block selection code that isn't run and is currently not even used.
Had to put this back in for a bug in the mid-year release, but we're past that
so it's time for this to go away.

* Platform/spi/ios/UIKitSPI.h:
* UIProcess/PageClient.h:
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* UIProcess/ios/PageClientImplIOS.h:
* UIProcess/ios/PageClientImplIOS.mm:
(WebKit::PageClientImpl::stopAssistingNode):
(WebKit::PageClientImpl::didUpdateBlockSelectionWithTouch): Deleted.
* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(toSelectionHandlePosition): Deleted.
(-[WKContentView _didUpdateBlockSelectionWithTouch:withFlags:growThreshold:shrinkThreshold:]): Deleted.
(-[WKContentView changeSelectionWithTouchAt:withSelectionTouch:baseIsStart:]): Deleted.
(-[WKContentView changeBlockSelectionWithTouchAt:withSelectionTouch:forHandle:]): Deleted.
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::saveImageToLibrary):
(WebKit::WebPageProxy::updateBlockSelectionWithTouch): Deleted.
(WebKit::WebPageProxy::didUpdateBlockSelectionWithTouch): Deleted.
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::rangeAtWordBoundaryForPosition):
(WebKit::distanceBetweenRectsForPosition): Deleted.
(WebKit::rectsEssentiallyTheSame): Deleted.
(WebKit::unionDOMRanges): Deleted.
(WebKit::computeEdgeCenter): Deleted.
(WebKit::WebPage::expandedRangeFromHandle): Deleted.
(WebKit::WebPage::contractedRangeFromHandle): Deleted.
(WebKit::WebPage::computeExpandAndShrinkThresholdsForHandle): Deleted.
(WebKit::WebPage::rangeForBlockAtPoint): Deleted.
(WebKit::shouldExpand): Deleted.
(WebKit::WebPage::changeBlockSelection): Deleted.
(WebKit::WebPage::updateBlockSelectionWithTouch): Deleted.

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

3 years agoFix flakiness in insecure-iframe-in-main-frame.html
krollin@apple.com [Thu, 12 Apr 2018 19:18:46 +0000 (19:18 +0000)]
Fix flakiness in insecure-iframe-in-main-frame.html
https://bugs.webkit.org/show_bug.cgi?id=184432

Reviewed by Daniel Bates.

Mark insecure-iframe-in-main-frame.html as no longer flaky. Tweak it
so that the frame-load events of the test window do no interleave with
the frame-load events of the window opened by the test so that any
non-deterministic behavior doesn't affect the order of the expect
sequence of messages.

* TestExpectations:
* http/tests/security/contentSecurityPolicy/block-all-mixed-content/insecure-iframe-in-main-frame-expected.txt:
* http/tests/security/contentSecurityPolicy/block-all-mixed-content/insecure-iframe-in-main-frame.html:
* platform/wk2/http/tests/security/contentSecurityPolicy/block-all-mixed-content/insecure-iframe-in-main-frame-expected.txt:

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

3 years agoRemove unused crash hook functionality
mcatanzaro@igalia.com [Thu, 12 Apr 2018 18:56:29 +0000 (18:56 +0000)]
Remove unused crash hook functionality
https://bugs.webkit.org/show_bug.cgi?id=183369

Reviewed by Alexey Proskuryakov.

WTFSetCrashHook and WTFInstallReportBacktraceOnCrashHook are not used on any platforms and
can be removed.

* wtf/Assertions.cpp:
* wtf/Assertions.h:

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

3 years agoDon't have selections get stuck in editable elements
megan_gardner@apple.com [Thu, 12 Apr 2018 18:50:33 +0000 (18:50 +0000)]
Don't have selections get stuck in editable elements
https://bugs.webkit.org/show_bug.cgi?id=184483

Reviewed by Timothy Hatcher.

When selecting in editable elements, if the keyboard does not come up, which is not required,
then the selections are stuck in that element. If you try and select something in web content,
it will only select in the editable element. By clearing the assisted node when clearing a selection,
it no longer sticks. Also, textSelectionAssistant should not be used as if we are currently editing.
Change it to the function we created for that purpose in a pervious patch.

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

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

3 years agoRaise the partial scavenge interval even more on x86-64
sbarati@apple.com [Thu, 12 Apr 2018 18:35:17 +0000 (18:35 +0000)]
Raise the partial scavenge interval even more on x86-64
https://bugs.webkit.org/show_bug.cgi?id=184551

Rubber-stamped by Filip Pizlo.

The JetStream regression didn't recover from my previous patch.
This is another attempt to get it to recover perf.

* bmalloc/Scavenger.cpp:
(bmalloc::Scavenger::threadRunLoop):

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

3 years agoUnreviewed, rolling out r230554.
ryanhaddad@apple.com [Thu, 12 Apr 2018 18:32:26 +0000 (18:32 +0000)]
Unreviewed, rolling out r230554.

The non-ASCII character in the filename causes issues with SVN

Reverted changeset:

"input.webkitEntries does not work as expected when folder
contains accented chars"
https://bugs.webkit.org/show_bug.cgi?id=184517
https://trac.webkit.org/changeset/230554

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

3 years ago[WPE] Move libWPEWebInspectorResources.so to pkglibdir
mcatanzaro@igalia.com [Thu, 12 Apr 2018 18:19:50 +0000 (18:19 +0000)]
[WPE] Move libWPEWebInspectorResources.so to pkglibdir
https://bugs.webkit.org/show_bug.cgi?id=184379

Reviewed by Žan Doberšek.

Source/JavaScriptCore:

Load the module from the new location.

* PlatformWPE.cmake:
* inspector/remote/glib/RemoteInspectorUtils.cpp:
(Inspector::backendCommands):

Source/WebKit:

This is important to allow parallel installation.

* PlatformWPE.cmake:

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

3 years ago[MSE] Add isValid() assertions on PlatformTimeRanges::add() range ends
aboya@igalia.com [Thu, 12 Apr 2018 18:01:58 +0000 (18:01 +0000)]
[MSE] Add isValid() assertions on PlatformTimeRanges::add() range ends
https://bugs.webkit.org/show_bug.cgi?id=180253

Right now it's checked that start <= end but it's not checked that
neither of them is undefined.

When this happens, the bug can be hard to track down.

The assertion is not enabled for Mac because there is currently a test
that is hitting it.

Reviewed by Jer Noble.

* platform/graphics/PlatformTimeRanges.cpp:
(WebCore::PlatformTimeRanges::add):

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

3 years agoProcess::setIdentifier() / Process::identifier() do not need a lock
cdumez@apple.com [Thu, 12 Apr 2018 17:51:33 +0000 (17:51 +0000)]
Process::setIdentifier() / Process::identifier() do not need a lock
https://bugs.webkit.org/show_bug.cgi?id=184544

Reviewed by Brady Eidson.

Process::setIdentifier() / Process::identifier() do not need a lock.
Process::setIdentifier() gets called in ChildProcess::initialize(),
before we start any background threads. It is then safe to query
this process identifier later on from background threads without
locks.

* platform/Process.cpp:
(WebCore::Process::setIdentifier):
(WebCore::Process::identifier):

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

3 years agoUnreviewed, fix the Windows build.
graouts@webkit.org [Thu, 12 Apr 2018 17:41:37 +0000 (17:41 +0000)]
Unreviewed, fix the Windows build.

* animation/DocumentTimeline.cpp:
(WebCore::DocumentTimeline::computeExtentOfAnimation const):

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

3 years ago[Web Animations] Suspend animations when required
graouts@webkit.org [Thu, 12 Apr 2018 17:37:55 +0000 (17:37 +0000)]
[Web Animations] Suspend animations when required
https://bugs.webkit.org/show_bug.cgi?id=184541

Reviewed by Jon Lee.

Source/WebCore:

Animations managed by CSSAnimationController get suspended under a number of scenarios, we now add the possibility
to suspend animations on a DocumentTimeline as well such that Web Animations and CSS Animations and CSS Transitions
implemented as Web Animations get suspended under the same conditions as well. We also update the implementation for
Internals::numberOfActiveAnimations() such that tests checking that animations get suspended pass.

* animation/DocumentTimeline.cpp:
(WebCore::DocumentTimeline::suspendAnimations): When asked to be suspended, the DocumentTimeline cancels pending
invalidation tasks and updates all of the animations it manages, including those running on the compositor.
(WebCore::DocumentTimeline::resumeAnimations): When asked to be resumed, the DocumentTimeline resumes animations
it manages and rewinds its invalidation timer.
(WebCore::DocumentTimeline::animationsAreSuspended):
(WebCore::DocumentTimeline::numberOfActiveAnimationsForTesting const): Called by Internals::numberOfActiveAnimations(),
this returns the number of animations managed by this timeline that are not suspended.
(WebCore::DocumentTimeline::currentTime):
(WebCore::DocumentTimeline::timingModelDidChange): Ensure the invalidation timer is not rewound if the timeline
is suspended.
* animation/DocumentTimeline.h:
* animation/WebAnimation.cpp:
(WebCore::WebAnimation::setTimeline): When moving to a new timeline, ensure we match the new timeline's animation state.
(WebCore::WebAnimation::setSuspended): Toggle the accelerated running state of any backing hardware animations when
the suspension state of an animation changes.
* animation/WebAnimation.h:
(WebCore::WebAnimation::isSuspended const):
* dom/Document.cpp:
(WebCore::Document::didBecomeCurrentDocumentInFrame):
(WebCore::Document::resume):
* dom/Document.h:
* history/CachedFrame.cpp:
(WebCore::CachedFrameBase::restore):
* page/Frame.cpp:
(WebCore::Frame::clearTimers):
* page/Page.cpp:
(WebCore::Page::setIsVisibleInternal):
(WebCore::Page::hiddenPageCSSAnimationSuspensionStateChanged):
* testing/Internals.cpp:
(WebCore::Internals::numberOfActiveAnimations const):
(WebCore::Internals::animationsAreSuspended const):
(WebCore::Internals::suspendAnimations const):
(WebCore::Internals::resumeAnimations const):

LayoutTests:

Mark more tests as passing when the CSS Animations and CSS Transitions as Web Animations flag is on.

* animations/animation-controller-drt-api.html:
* animations/animation-followed-by-transition.html:
* fast/animation/css-animation-resuming-when-visible-with-style-change.html:
* fast/animation/css-animation-resuming-when-visible.html:

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

3 years ago[LayoutReloaded] Minor cleanup in LayoutSate
zalan@apple.com [Thu, 12 Apr 2018 17:26:55 +0000 (17:26 +0000)]
[LayoutReloaded] Minor cleanup in LayoutSate
https://bugs.webkit.org/show_bug.cgi?id=184546

Reviewed by Antti Koivisto.

* LayoutReloaded/FormattingContext/FormattingContext.js:
(FormattingContext.isInFormattingContext):
* LayoutReloaded/FormattingState/FormattingState.js:
(FormattingState.prototype.displayBoxes):
(FormattingState.prototype.displayBox):
(FormattingState.prototype._markSubTreeNeedsLayout):
(FormattingState):
(FormattingState.prototype.displayBoxMap): Deleted.
* LayoutReloaded/LayoutState.js:
(LayoutState.prototype.formattingStateForBox):
(LayoutState.prototype.needsLayout):
(LayoutState.prototype.displayBox):
(LayoutState.prototype._createFormattingState):
(LayoutState):
* LayoutReloaded/LayoutTree/Box.js:
(Layout.Box.prototype.isFormattingContextDescendant): Deleted.
* LayoutReloaded/LayoutTree/Container.js:
(Layout.Container.prototype.isContainingBlockDescendant): Deleted.
* LayoutReloaded/Utils.js:
(Utils._findDisplayBox):

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

3 years ago[Web Animations] Throttle animations when lowPowerMode is on
graouts@webkit.org [Thu, 12 Apr 2018 16:35:32 +0000 (16:35 +0000)]
[Web Animations] Throttle animations when lowPowerMode is on
https://bugs.webkit.org/show_bug.cgi?id=184540

Reviewed by Jon Lee.

Source/WebCore:

Ensure animations are sampled at a lower frequency when lowPowerMode is on.

* animation/DocumentTimeline.cpp:
(WebCore::DocumentTimeline::updateThrottlingState):
(WebCore::DocumentTimeline::animationInterval const):
(WebCore::DocumentTimeline::updateAnimationSchedule):
(WebCore::DocumentTimeline::scheduleAnimationResolution):
* animation/DocumentTimeline.h:
* page/Page.cpp:
(WebCore::Page::handleLowModePowerChange):
* testing/Internals.cpp:
(WebCore::Internals::animationsInterval const):

LayoutTests:

Mark one more test as passing when the CSS Animations and CSS Transitions as Web Animations flag is on.

* fast/animation/css-animation-throttling-lowPowerMode.html:

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

3 years ago[Web Animations] Ensure elements overlapping with elements animating also get composited
graouts@webkit.org [Thu, 12 Apr 2018 16:34:42 +0000 (16:34 +0000)]
[Web Animations] Ensure elements overlapping with elements animating also get composited
https://bugs.webkit.org/show_bug.cgi?id=184539

Reviewed by Jon Lee.

Source/WebCore:

A number of compositing tests failed because we didn't call into the Web Animations engine while various calls
on RenderLayer and RenderLayerBacking were made. We bring the functionality over from CSSAnimationController to
DocumentTimeline and KeyframeAnimation to KeyframeEffectReadOnly.

* animation/AnimationTimeline.cpp:
(WebCore::AnimationTimeline::animationsForElement const): Update this method's signature to be const since it
should be callable by other const method.
(WebCore::AnimationTimeline::animationsForElement): Deleted.
* animation/AnimationTimeline.h:
* animation/DocumentTimeline.cpp:
(WebCore::DocumentTimeline::computeExtentOfAnimation const): Adapt this method from CSSAnimationController.
(WebCore::DocumentTimeline::isRunningAnimationOnRenderer const): Adapt this method from CSSAnimationController.
(WebCore::DocumentTimeline::isRunningAcceleratedAnimationOnRenderer const): Adapt this method from CSSAnimationController.
* animation/DocumentTimeline.h:
* animation/KeyframeEffectReadOnly.cpp:
(WebCore::KeyframeEffectReadOnly::computeExtentOfTransformAnimation const): Bring this method over from KeyframeAnimation.
(WebCore::containsRotation): Bring this method over from KeyframeAnimation.
(WebCore::KeyframeEffectReadOnly::computeTransformedExtentViaTransformList const): Bring this method over from KeyframeAnimation.
(WebCore::KeyframeEffectReadOnly::computeTransformedExtentViaMatrix const): Bring this method over from KeyframeAnimation.
* animation/KeyframeEffectReadOnly.h:
(WebCore::KeyframeEffectReadOnly::animatedProperties const): DocumentTimeline::computeExtentOfAnimation() needs to get a list
of all animated properties to see if a transform is animated, so we now expose such a list.
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::currentTransform const): Update this method to call into DocumentTimeline if the CSS Animations
and CSS Transitions as Web Animations flag is on.
(WebCore::RenderLayer::calculateClipRects const): Update this method to call into DocumentTimeline if the CSS Animations
and CSS Transitions as Web Animations flag is on.
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::updateGeometry): Update this method to call into DocumentTimeline if the CSS Animations
and CSS Transitions as Web Animations flag is on.
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::isRunningTransformAnimation const): Update this method to call into DocumentTimeline
if the CSS Animations and CSS Transitions as Web Animations flag is on.
* rendering/RenderObject.h:
(WebCore::RenderObject::documentTimeline const):

LayoutTests:

Opt more tests in the CSS Animations and CSS Transitions as Web Animations runtime flag since they now pass.

* compositing/backing/backface-visibility-flip.html:
* compositing/layer-creation/overlap-animation-clipping.html:
* compositing/layer-creation/overlap-animation-container.html:
* compositing/layer-creation/overlap-animation.html:
* compositing/layer-creation/translate-animation-overlap.html:

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

3 years ago[DFG] Remove compileBigIntEquality in DFG 32bit
utatane.tea@gmail.com [Thu, 12 Apr 2018 16:11:22 +0000 (16:11 +0000)]
[DFG] Remove compileBigIntEquality in DFG 32bit
https://bugs.webkit.org/show_bug.cgi?id=184535

Reviewed by Saam Barati.

We can have the unified implementation for compileBigIntEquality.

* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::compileBigIntEquality):
* dfg/DFGSpeculativeJIT32_64.cpp:
(JSC::DFG::SpeculativeJIT::compileBigIntEquality): Deleted.
* dfg/DFGSpeculativeJIT64.cpp:
(JSC::DFG::SpeculativeJIT::compileBigIntEquality): Deleted.

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

3 years ago[WPE] Improve include hierarchy
mcatanzaro@igalia.com [Thu, 12 Apr 2018 15:51:10 +0000 (15:51 +0000)]
[WPE] Improve include hierarchy
https://bugs.webkit.org/show_bug.cgi?id=184376

Reviewed by Žan Doberšek.

Source/JavaScriptCore:

Install JSC headers under /usr/include/wpe-webkit-0.1/jsc instead of
/usr/include/wpe-0.1/WPE/jsc.

* PlatformWPE.cmake:

Source/WebKit:

Install our headers under /usr/include/wpe-webkit-0.1/wpe instead of
/usr/include/wpe-0.1/WPE/wpe. Too much WPE, not enough WebKit!

* PlatformWPE.cmake:
* wpe/wpe-webkit.pc.in:

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

3 years agoTry again to fix the build after r230560.
aestes@apple.com [Thu, 12 Apr 2018 15:34:48 +0000 (15:34 +0000)]
Try again to fix the build after r230560.

* NetworkProcess/cocoa/NetworkDataTaskCocoa.h:

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

3 years ago[Web Animations] Enable seeking for hardware animations
graouts@webkit.org [Thu, 12 Apr 2018 15:14:31 +0000 (15:14 +0000)]
[Web Animations] Enable seeking for hardware animations
https://bugs.webkit.org/show_bug.cgi?id=184518

Reviewed by Dean Jackson.

LayoutTests/imported/w3c:

Track a small regression in the Web Animations WPT tests.

* web-platform-tests/web-animations/animation-model/animation-types/interpolation-per-property-expected.txt:

Source/WebCore:

Hardware animations had lagged behind software animations in support and this patch bring their respective level
of support closer to one another. Importantly, we add the ability to seek an animation added to a GraphicsLayerCA
since many tests pause and seek animations to test their state. Animations may also have their playback state changed
along with their current time in the same run loop, so we now maintain a list of pending processing actions for
hardware animations.

* animation/DocumentTimeline.cpp:
(WebCore::DocumentTimeline::updateAnimationSchedule): If we have animations queued up for updates to their accelerated
state we can schedule animation resolution immediately since we've already established we'll have work to do.
(WebCore::DocumentTimeline::updateAnimations): Factor the updates of pending accelerated animations out in a dedicated
method.
(WebCore::DocumentTimeline::applyPendingAcceleratedAnimations): Go through all pending accelerated animations and update
their state.
* animation/KeyframeEffectReadOnly.cpp:
(WebCore::KeyframeEffectReadOnly::setBlendingKeyframes): Update the m_shouldRunAccelerated flag when setting blending keyframes.
(WebCore::KeyframeEffectReadOnly::apply): Ensure we finish accelerated animations if the progress is 1 or null (no longer active).
start accelerated animations if the animation is starting and always resolve styles in software as well to ensure that
hit testing will work as expected.
(WebCore::KeyframeEffectReadOnly::computeShouldRunAccelerated):
(WebCore::KeyframeEffectReadOnly::animationPlayStateDidChange): Called by WebAnimation when play() or pause() is called
with the appropriate flag.
(WebCore::KeyframeEffectReadOnly::animationDidSeek): Called by WebAnimation when the currentTime property is set.
(WebCore::KeyframeEffectReadOnly::addPendingAcceleratedAction): Add the provided action to the list of pending accelerated
actions and notify the animation that the accelerated state needs changing.
(WebCore::KeyframeEffectReadOnly::applyPendingAcceleratedActions): Called by DocumentTimeline, through WebAnimation, to apply
all pending accelerated actions.
(WebCore::KeyframeEffectReadOnly::backingAnimationForCompositedRenderer const): If we're dealing with a declarative animation,
we already have a backing Animation object, so use it directly. Otherwise, create one and ensure it reflects all timing properties
for the animation.
(WebCore::KeyframeEffectReadOnly::shouldRunAccelerated): Deleted.
(WebCore::KeyframeEffectReadOnly::startOrStopAccelerated): Deleted.
* animation/WebAnimation.cpp:
(WebCore::WebAnimation::setCurrentTime): Call animationDidSeek() on the effect to ensure its accelerated animation gets seeked.
(WebCore::WebAnimation::play): Call animationPlayStateDidChange() on the effect to ensure its accelerated animation is started or resumed.
(WebCore::WebAnimation::pause): Call animationPlayStateDidChange() on the effect to ensure its accelerated animation gets paused.
(WebCore::WebAnimation::acceleratedStateDidChange):
(WebCore::WebAnimation::applyPendingAcceleratedActions):
(WebCore::WebAnimation::acceleratedRunningStateDidChange): Deleted.
(WebCore::WebAnimation::startOrStopAccelerated): Deleted.
* platform/graphics/GraphicsLayer.h:
(WebCore::GraphicsLayer::seekAnimation):
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::addProcessingActionForAnimation): Add an AnimationProcessingAction to the list of such actions for a
given animation name. In case we already have a Remove action, we ignore the action since the hardware animation will have been
removed by the time we try to apply this processing action.
(WebCore::GraphicsLayerCA::pauseAnimation): Add a Pause processing action.
(WebCore::GraphicsLayerCA::seekAnimation): Add a Seek processing action.
(WebCore::GraphicsLayerCA::removeAnimation): Add a Remove processing action.
(WebCore::GraphicsLayerCA::updateAnimations): First ensure that all animations pending commit are committed and then update
all animations based on the actions added through addProcessingActionForAnimation().
(WebCore::GraphicsLayerCA::seekCAAnimationOnLayer): Generate a new animation based on the new seek time provided.
* platform/graphics/ca/GraphicsLayerCA.h:
(WebCore::GraphicsLayerCA::AnimationProcessingAction::AnimationProcessingAction):
* rendering/RenderBoxModelObject.cpp:
(WebCore::RenderBoxModelObject::animationSeeked):
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::animationSeeked):
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::requiresCompositingForAnimation const): Fix an issue where we would run the CSSAnimationController
logic even when the legacy animation engine was disabled.

LayoutTests:

Update current test expectations, some tests have regressed because they weren't probably running their hardware
animations. Followup patches will make them opt into CSS Animations and CSS Transitions as Web Animations again.

* animations/3d/transform-origin-vs-functions.html:
* animations/change-completed-animation-transform.html:
* animations/missing-values-first-keyframe.html:
* animations/missing-values-last-keyframe.html:
* animations/play-state-start-paused.html:
* compositing/contents-scale/animating.html:
* compositing/layer-creation/animation-overlap-with-children.html:
* compositing/overflow/overflow-positioning.html:
* compositing/visible-rect/animated.html:
* css3/filters/filter-animation-from-none-hw.html:
* css3/filters/filter-animation-from-none-multi-hw.html:
* css3/filters/filter-animation-from-none-multi.html:
* css3/filters/filter-animation-from-none.html:
* platform/mac-sierra/imported/w3c/web-platform-tests/web-animations/animation-model/animation-types/interpolation-per-property-expected.txt:

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

3 years ago[LayoutReloaded] Introduce needsLayout to InlineFormattingContext
zalan@apple.com [Thu, 12 Apr 2018 14:51:35 +0000 (14:51 +0000)]
[LayoutReloaded] Introduce needsLayout to InlineFormattingContext
https://bugs.webkit.org/show_bug.cgi?id=184538

Reviewed by Antti Koivisto.

* LayoutReloaded/FormattingContext/BlockFormatting/BlockFormattingContext.js:
(BlockFormattingContext.prototype._adjustBottomWithFIXME):
(BlockFormattingContext):
(BlockFormattingContext.prototype._firstInFlowChildWithNeedsLayout): Deleted.
(BlockFormattingContext.prototype._nextInFlowSiblingWithNeedsLayout): Deleted.
* LayoutReloaded/FormattingContext/FormattingContext.js:
(FormattingContext.prototype._firstInFlowChildWithNeedsLayout):
(FormattingContext.prototype._nextInFlowSiblingWithNeedsLayout):
(FormattingContext):
* LayoutReloaded/FormattingContext/InlineFormatting/InlineFormattingContext.js:
(InlineFormattingContext.prototype.layout):
(InlineFormattingContext.prototype._handleInlineContainer):
(InlineFormattingContext.prototype._handleInlineBlockContainer):
(InlineFormattingContext.prototype._handleInlineContent):
(InlineFormattingContext.prototype._clearAndMoveToNext):
(InlineFormattingContext):

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

3 years agoSkip the test fast/forms/file/entries-api/webkitEntries-nonascii-folder-name.html...
pvollan@apple.com [Thu, 12 Apr 2018 14:12:28 +0000 (14:12 +0000)]
Skip the test fast/forms/file/entries-api/webkitEntries-nonascii-folder-name.html on Windows.
https://bugs.webkit.org/show_bug.cgi?id=184537

Unreviewed test gardening.

* platform/win/TestExpectations:

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

3 years agoFix the build after r230560.
aestes@apple.com [Thu, 12 Apr 2018 13:47:20 +0000 (13:47 +0000)]
Fix the build after r230560.

* NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
(WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa):

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

3 years ago[GStreamer] Speed up GStreamer dependency build by removing examples compilation
calvaris@igalia.com [Thu, 12 Apr 2018 10:19:32 +0000 (10:19 +0000)]
[GStreamer] Speed up GStreamer dependency build by removing examples compilation
https://bugs.webkit.org/show_bug.cgi?id=184528

Reviewed by Philippe Normand.

* gstreamer/jhbuild.modules: Added --disable-examples for GStreamer package.

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

3 years agoUnreviewed, skip JIT tests if it isn't enabled
tpopela@redhat.com [Thu, 12 Apr 2018 09:22:00 +0000 (09:22 +0000)]
Unreviewed, skip JIT tests if it isn't enabled

See https://bugs.webkit.org/show_bug.cgi?id=182730.

* stress/big-int-spec-to-primitive.js:
* stress/big-int-spec-to-this.js:

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

3 years agoUnreviewed, fix GStreamer builds
calvaris@igalia.com [Thu, 12 Apr 2018 09:21:04 +0000 (09:21 +0000)]
Unreviewed, fix GStreamer builds

* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::handleMessage): We were
passing a String to a GST_WARNING call.

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

3 years ago[WPE] Switch testing process to using WPEBackend-fdo
zandobersek@gmail.com [Thu, 12 Apr 2018 08:19:35 +0000 (08:19 +0000)]
[WPE] Switch testing process to using WPEBackend-fdo
https://bugs.webkit.org/show_bug.cgi?id=184357

Reviewed by Carlos Alberto Lopez Perez.

.:

* Source/cmake/FindWPEBackend-fdo.cmake: Renamed from Source/cmake/FindWPEBackend-mesa.cmake.

Tools:

Switch WPE testing to using the WPEBackend-fdo implementation that
depends on the WL_bind_wayland_display EGL extension, as defined under
the freedesktop.org project.
https://cgit.freedesktop.org/mesa/mesa/tree/docs/specs/WL_bind_wayland_display.spec

HeadlessViewBackend is refactored to use the WPEBackend-fdo API, but
otherwise is not changed in functionality.

Unit tests now have to unconditionally use HeadlessViewBackend as a
wpe_view_backend provider, since WPEBackend-fdo does not provide a
default wpe_view_backend implementation. Unit tests covering that are
adjusted to instead use a mock wpe_view_backend interface.

* Scripts/webkitdirs.pm:
(builtDylibPathForName): Fix the libWPEWebKit.so name to also include
the API version that was added in r230449.
* Scripts/webkitpy/port/waylanddriver.py:
(WaylandDriver._setup_environ_for_test): Export EGL_PLATFORM=wayland.
* Scripts/webkitpy/port/wpe.py:
(WPEPort._driver_class): Use WaylandDriver by default.
* TestWebKitAPI/PlatformWebView.h:
(): Deleted.
* TestWebKitAPI/Tests/WebKitGLib/TestWebKitWebView.cpp:
(testWebViewWebBackend):
* TestWebKitAPI/glib/WebKitGLib/TestMain.h:
(Test::createWebViewBackend):
* TestWebKitAPI/wpe/PlatformWebViewWPE.cpp:
(TestWebKitAPI::PlatformWebView::~PlatformWebView):
(TestWebKitAPI::PlatformWebView::initialize):
* wpe/HeadlessViewBackend/CMakeLists.txt:
* wpe/HeadlessViewBackend/HeadlessViewBackend.cpp:
(getEGLDisplay):
(HeadlessViewBackend::HeadlessViewBackend):
(HeadlessViewBackend::~HeadlessViewBackend):
(HeadlessViewBackend::backend const):
(HeadlessViewBackend::createSnapshot):
(HeadlessViewBackend::performUpdate):
(HeadlessViewBackend::makeCurrent): Deleted.
* wpe/HeadlessViewBackend/HeadlessViewBackend.h:
* wpe/jhbuild.modules: Module name cleanup. Dyz version is bumped.

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

3 years agoUnreviewed WPE gardening. Adding or updating more baselines affected by
zandobersek@gmail.com [Thu, 12 Apr 2018 08:01:36 +0000 (08:01 +0000)]
Unreviewed WPE gardening. Adding or updating more baselines affected by
web-platform-test syncs in r230330, r230353 and r230445.

* platform/wpe/imported/w3c/web-platform-tests/FileAPI: Added.
* platform/wpe/imported/w3c/web-platform-tests/FileAPI/url: Added.
* platform/wpe/imported/w3c/web-platform-tests/FileAPI/url/url-with-fetch.any-expected.txt: Added.
* platform/wpe/imported/w3c/web-platform-tests/FileAPI/url/url-with-fetch.any.worker-expected.txt: Added.
* platform/wpe/imported/w3c/web-platform-tests/fetch/api/redirect/redirect-location-expected.txt: Added.
* platform/wpe/imported/w3c/web-platform-tests/fetch/api/redirect/redirect-location-worker-expected.txt: Added.
* platform/wpe/imported/w3c/web-platform-tests/fetch/api/redirect/redirect-method-expected.txt:
* platform/wpe/imported/w3c/web-platform-tests/fetch/api/redirect/redirect-method-worker-expected.txt:
* platform/wpe/imported/w3c/web-platform-tests/fetch/api/request: Added.
* platform/wpe/imported/w3c/web-platform-tests/fetch/api/request/request-keepalive-quota-expected.txt: Added.
* platform/wpe/imported/w3c/web-platform-tests/html/dom/interfaces-expected.txt:
* platform/wpe/imported/w3c/web-platform-tests/html/dom/reflection-embedded-expected.txt:
* platform/wpe/imported/w3c/web-platform-tests/html/dom/reflection-forms-expected.txt:
* platform/wpe/imported/w3c/web-platform-tests/html/semantics/embedded-content/media-elements/mime-types/canPlayType-expected.txt:
* platform/wpe/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-area-element: Added.
* platform/wpe/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-area-element/area-download-click-expected.txt: Added.
* platform/wpe/imported/w3c/web-platform-tests/html/semantics/text-level-semantics: Added.
* platform/wpe/imported/w3c/web-platform-tests/html/semantics/text-level-semantics/the-a-element: Added.
* platform/wpe/imported/w3c/web-platform-tests/html/semantics/text-level-semantics/the-a-element/a-download-click-expected.txt: Added.
* platform/wpe/imported/w3c/web-platform-tests/streams: Added.
* platform/wpe/imported/w3c/web-platform-tests/streams/readable-byte-streams: Added.
* platform/wpe/imported/w3c/web-platform-tests/streams/readable-byte-streams/general-expected.txt: Added.
* platform/wpe/imported/w3c/web-platform-tests/touch-events: Added.
* platform/wpe/imported/w3c/web-platform-tests/touch-events/historical-expected.txt: Added.
* platform/wpe/imported/w3c/web-platform-tests/webaudio: Added.
* platform/wpe/imported/w3c/web-platform-tests/webaudio/the-audio-api: Added.
* platform/wpe/imported/w3c/web-platform-tests/webaudio/the-audio-api/the-mediaelementaudiosourcenode-interface: Added.
* platform/wpe/imported/w3c/web-platform-tests/webaudio/the-audio-api/the-mediaelementaudiosourcenode-interface/mediaElementAudioSourceToScriptProcessorTest-expected.txt: Added.

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

3 years ago[iOS] Add a mechanism for holding Wi-Fi assertions
aestes@apple.com [Thu, 12 Apr 2018 07:55:11 +0000 (07:55 +0000)]
[iOS] Add a mechanism for holding Wi-Fi assertions
https://bugs.webkit.org/show_bug.cgi?id=184520
<rdar://problem/39025726>

Reviewed by Sam Weinig.

Add plumbing for holding a Wi-Fi assertion on iOS as long as there are active
network data tasks. This functionality is turned off by default right now.

* Configurations/Network-iOS.entitlements:
* NetworkProcess/cocoa/NetworkDataTaskCocoa.h:
* NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
(WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa):
* NetworkProcess/cocoa/WiFiAssertionHolder.cpp: Added.
(WebKit::ensureWiFiManagerClient): Create a global WiFiManagerClient when needed.
(WebKit::WiFiAssertionHolder::WiFiAssertionHolder): If this is the first active
Wi-Fi assertion holder, set the client's type to kWiFiClientTypeBackground.
(WebKit::WiFiAssertionHolder::~WiFiAssertionHolder): If the last active Wi-Fi
assertion holder is being destroyed, set the client's type back to
kWiFiClientTypeNormal.
* NetworkProcess/cocoa/WiFiAssertionHolder.h: Added.
* Platform/Logging.h: Added a logging channel for Wi-Fi assertions.
* Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb:
* WebKit.xcodeproj/project.pbxproj:

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

3 years ago[GTK] Switch to use always complex text code path
carlosgc@webkit.org [Thu, 12 Apr 2018 07:01:57 +0000 (07:01 +0000)]
[GTK] Switch to use always complex text code path
https://bugs.webkit.org/show_bug.cgi?id=183285

Reviewed by Michael Catanzaro.

Source/WebKit:

Now that we have branched for 2.20, it's a good time to try using complex text path always. We can simply force
it for GTK+ port and see how it works for the whole release cycle and if we don't notice any issues or
performance regressions we release 2.22 with complex text path forced. A debug env variable is added to switch
back to auto without having to recompile. After 2.22 is released we can make a final decision and remove the env
variable.

* UIProcess/gtk/WebProcessPoolGtk.cpp:
(WebKit::WebProcessPool::platformInitializeWebProcess): Force complex text code path unless
WEBKIT_FORCE_COMPLEX_TEXT is present and set to 0.

Tools:

Keep the auto mode for the layout tests to avoid having to rebaseline a lot of tests.

* WebKitTestRunner/gtk/main.cpp:
(main): Set WEBKIT_FORCE_COMPLEX_TEXT to 0 unless it's already present in the environment.

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

3 years ago[GLIB] Handle strings containing null characters
carlosgc@webkit.org [Thu, 12 Apr 2018 06:59:35 +0000 (06:59 +0000)]
[GLIB] Handle strings containing null characters
https://bugs.webkit.org/show_bug.cgi?id=184450

Reviewed by Michael Catanzaro.

Source/JavaScriptCore:

We should be able to evaluate scripts containing null characters and to handle strings that contains them
too. In JavaScript strings are not null-terminated, they can contain null characters. This patch adds a length
parameter to jsc_context_valuate() to pass the script length (or -1 if it's null terminated), and new functions
jsc_value_new_string_from_bytes() and jsc_value_to_string_as_bytes() using GBytes to store strings that might
contain null characters.

* API/OpaqueJSString.cpp:
(OpaqueJSString::create): Add a create constructor that takes the String.
* API/OpaqueJSString.h:
(OpaqueJSString::OpaqueJSString): Add a constructor that takes the String.
* API/glib/JSCContext.cpp:
(jsc_context_evaluate): Add length parameter.
(jsc_context_evaluate_with_source_uri): Ditto.
* API/glib/JSCContext.h:
* API/glib/JSCValue.cpp:
(jsc_value_new_string_from_bytes):
(jsc_value_to_string):
(jsc_value_to_string_as_bytes):
(jsc_value_object_is_instance_of): Pass length to evaluate.
* API/glib/JSCValue.h:
* API/glib/docs/jsc-glib-4.0-sections.txt:

Tools:

Add test case for strings with null characters and update all calls to evaluate to pass the script length.

* TestWebKitAPI/PlatformGTK.cmake:
* TestWebKitAPI/PlatformWPE.cmake:
* TestWebKitAPI/Tests/JavaScriptCore/glib/TestJSC.cpp:
(testJSCBasic):
(testJSCFunction):
(testJSCObject):
(testJSCClass):
(testJSCPrototypes):
(testJSCExceptions):
(testJSCPromises):
(testJSCGarbageCollector):
(testJSCWeakValue):
(testsJSCVirtualMachine):
(testsJSCAutocleanups):
* TestWebKitAPI/Tests/JavaScriptCore/glib/script.js: Added.
* TestWebKitAPI/Tests/WebKitGLib/DOMElementTest.cpp:
(DOMElementTest::testAutoFill):
* TestWebKitAPI/Tests/WebKitGLib/EditorTest.cpp:
(WebKitWebEditorTest::testSelectionChanged):
* TestWebKitAPI/Tests/WebKitGLib/FrameTest.cpp:
(WebKitFrameTest::testJavaScriptValues):
* TestWebKitAPI/Tests/WebKitGLib/WebExtensionTest.cpp:
(consoleMessageSentCallback):
(methodCallCallback):

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

3 years ago[WPE] Make WebKitWebViewBackend object mandatory for webkit_web_view_new*() constructors
zandobersek@gmail.com [Thu, 12 Apr 2018 05:53:26 +0000 (05:53 +0000)]
[WPE] Make WebKitWebViewBackend object mandatory for webkit_web_view_new*() constructors
https://bugs.webkit.org/show_bug.cgi?id=184513

Reviewed by Michael Catanzaro.

Source/WebKit:

webkit_web_view_new*() constructors should always expect a non-null
WebKitWebViewBackend object, forcing the user to specify how the
wpe_view_backend object is managed for the WebKitWebView that's being
created.

webkitWebViewBackendCreateDefault() and the default
_WebKitWebViewBackend() constructor are removed. WPE-specific
webkit_web_view_new*() entrypoints are updated to bail if the passed-in
WebKitWebViewBackend object is null. Documentation is updated
accordingly.

* UIProcess/API/glib/WebKitWebView.cpp:
(webkitWebViewConstructed):
* UIProcess/API/wpe/WebKitWebViewBackend.cpp:
(webkitWebViewBackendCreateDefault): Deleted.
* UIProcess/API/wpe/WebKitWebViewBackendPrivate.h:
* UIProcess/API/wpe/WebKitWebViewWPE.cpp:
(webkit_web_view_new):
(webkit_web_view_new_with_context):
(webkit_web_view_new_with_related_view):
(webkit_web_view_new_with_settings):
(webkit_web_view_new_with_user_content_manager):

Tools:

Update the WPE-specific testWebViewWebBackend() test case, removing the
test that passes a null WebKitWebViewBackend object to the
webkit_web_view_new() call.

Helper createWebViewBackend() that's called via Test::createWebView()
variations is updated to, in case of not using the headless backend,
return a WebKitWebViewBackend instance that wraps around a
default wpe_view_backend object.

* TestWebKitAPI/Tests/WebKitGLib/TestWebKitWebView.cpp:
(testWebViewWebBackend):
* TestWebKitAPI/glib/WebKitGLib/TestMain.h:
(Test::createWebViewBackend):

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

3 years ago[JSC] Add CCallHelpers::CellValue to wrap JSCell GPR to convert it to EncodedJSValue
utatane.tea@gmail.com [Thu, 12 Apr 2018 04:27:24 +0000 (04:27 +0000)]
[JSC] Add CCallHelpers::CellValue to wrap JSCell GPR to convert it to EncodedJSValue
https://bugs.webkit.org/show_bug.cgi?id=184500

Reviewed by Mark Lam.

Instead of passing JSValue::JSCellTag to callOperation meta-program to convert
JSCell GPR to EncodedJSValue in 32bit code, we add CallHelpers::CellValue.
It is a wrapper for GPRReg, like TrustedImmPtr for pointer value. When poking
CellValue, 32bit code emits JSValue::CellTag automatically. In 64bit, we just
poke held GPR. The benefit from this CellValue is that we can use the same code
for 32bit and 64bit. This patch removes several ifdefs.

* bytecode/AccessCase.cpp:
(JSC::AccessCase::generateImpl):
* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::compileCallDOMGetter):
(JSC::DFG::SpeculativeJIT::compileGetDirectPname):
(JSC::DFG::SpeculativeJIT::cachedPutById):
* dfg/DFGSpeculativeJIT32_64.cpp:
(JSC::DFG::SpeculativeJIT::cachedGetById):
(JSC::DFG::SpeculativeJIT::cachedGetByIdWithThis):
* jit/CCallHelpers.h:
(JSC::CCallHelpers::CellValue::CellValue):
(JSC::CCallHelpers::CellValue::gpr const):
(JSC::CCallHelpers::setupArgumentsImpl):

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

3 years ago[LayoutReloaded] Introduce needsLayout flag
zalan@apple.com [Thu, 12 Apr 2018 04:19:30 +0000 (04:19 +0000)]
[LayoutReloaded] Introduce needsLayout flag
https://bugs.webkit.org/show_bug.cgi?id=184527

Reviewed by Antti Koivisto.

Use the formatting state to mark boxes dirty.

* LayoutReloaded/FormattingContext/BlockFormatting/BlockFormattingContext.js:
(BlockFormattingContext.prototype.layout):
(BlockFormattingContext.prototype._firstInFlowChildWithNeedsLayout):
(BlockFormattingContext.prototype._nextInFlowSiblingWithNeedsLayout):
(BlockFormattingContext):
* LayoutReloaded/FormattingContext/FormattingContext.js:
(FormattingContext.prototype._layoutOutOfFlowDescendants):
* LayoutReloaded/FormattingState/FormattingState.js:
(FormattingState):
(FormattingState.prototype.markNeedsLayout):
(FormattingState.prototype.clearNeedsLayout):
(FormattingState.prototype.needsLayout):
(FormattingState.prototype.layoutNeeded):
(FormattingState.prototype._markSubTreeNeedsLayout):
* LayoutReloaded/LayoutState.js:
(LayoutState.prototype.formattingStateForBox):
(LayoutState.prototype.setNeedsLayout):
(LayoutState.prototype.needsLayout):
* LayoutReloaded/LayoutTree/Box.js:
(Layout.Box.prototype.isFormattingContextDescendant):
* LayoutReloaded/LayoutTree/Container.js:
(Layout.Container.prototype.isContainingBlockDescendant):

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

3 years agoinput.webkitEntries does not work as expected when folder contains accented chars
cdumez@apple.com [Thu, 12 Apr 2018 03:55:51 +0000 (03:55 +0000)]
input.webkitEntries does not work as expected when folder contains accented chars
https://bugs.webkit.org/show_bug.cgi?id=184517
<rdar://problem/39265537>

Reviewed by Ryosuke Niwa.

Source/WebCore:

Use String::fromUTF8() to construct a WTF String from the char* returned by
dirname() in FileSystem::directoryName(). Previously, we were just calling
the String constructor, which would treat the input as latin 1 instead of
UTF-8.

Test: fast/forms/file/entries-api/webkitEntries-nonascii-folder-name.html

* platform/posix/FileSystemPOSIX.cpp:
(WebCore::FileSystem::directoryName):

LayoutTests:

Add layout test coverage.

* fast/forms/file/entries-api/webkitEntries-nonascii-folder-name-expected.txt: Added.
* fast/forms/file/entries-api/webkitEntries-nonascii-folder-name.html: Added.

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

3 years agoraise partial scavenge interval on x86-64
sbarati@apple.com [Thu, 12 Apr 2018 02:44:06 +0000 (02:44 +0000)]
raise partial scavenge interval on x86-64
https://bugs.webkit.org/show_bug.cgi?id=184521

Rubber-stamped by Filip Pizlo.

This patch is an attempt to recover the 1-3% JetStream regression
my initial partial scavenging patch introduced on some Macs.

* bmalloc/Scavenger.cpp:
(bmalloc::Scavenger::threadRunLoop):

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

3 years agoUnreviewed, rolling out r230523.
said@apple.com [Thu, 12 Apr 2018 01:09:15 +0000 (01:09 +0000)]
Unreviewed, rolling out r230523.

Introduced MotionMark regression

Reverted changeset:

"Deactivate the WindowServer connection for the WebContent
process."
https://bugs.webkit.org/show_bug.cgi?id=184451
https://trac.webkit.org/changeset/230523

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

3 years ago[curl][WebKit] Implement NetworkDataTaskCurl
Hironori.Fujii@sony.com [Thu, 12 Apr 2018 00:53:26 +0000 (00:53 +0000)]
[curl][WebKit] Implement NetworkDataTaskCurl
https://bugs.webkit.org/show_bug.cgi?id=184488

Reviewed by Alex Christensen.

* NetworkProcess/NetworkDataTask.cpp:
(WebKit::NetworkDataTask::create):
* NetworkProcess/curl/NetworkDataTaskCurl.cpp: Added.
(WebKit::NetworkDataTaskCurl::NetworkDataTaskCurl):
(WebKit::NetworkDataTaskCurl::~NetworkDataTaskCurl):
(WebKit::NetworkDataTaskCurl::resume):
(WebKit::NetworkDataTaskCurl::suspend):
(WebKit::NetworkDataTaskCurl::cancel):
(WebKit::NetworkDataTaskCurl::invalidateAndCancel):
(WebKit::NetworkDataTaskCurl::state const):
(WebKit::NetworkDataTaskCurl::createCurlRequest):
(WebKit::NetworkDataTaskCurl::curlDidSendData):
(WebKit::NetworkDataTaskCurl::curlDidReceiveResponse):
(WebKit::NetworkDataTaskCurl::curlDidReceiveBuffer):
(WebKit::NetworkDataTaskCurl::curlDidComplete):
(WebKit::NetworkDataTaskCurl::curlDidFailWithError):
(WebKit::NetworkDataTaskCurl::shouldRedirectAsGET):
(WebKit::NetworkDataTaskCurl::willPerformHTTPRedirection):
(WebKit::NetworkDataTaskCurl::tryHttpAuthentication):
(WebKit::NetworkDataTaskCurl::restartWithCredential):
(WebKit::NetworkDataTaskCurl::appendCookieHeader):
(WebKit::NetworkDataTaskCurl::handleCookieHeaders):
* NetworkProcess/curl/NetworkDataTaskCurl.h: Added.
* PlatformWin.cmake:

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

3 years ago[Build fix] Replace CompactJITCodeMap with JITCodeMap.
mark.lam@apple.com [Wed, 11 Apr 2018 22:46:55 +0000 (22:46 +0000)]
[Build fix] Replace CompactJITCodeMap with JITCodeMap.
https://bugs.webkit.org/show_bug.cgi?id=184512
<rdar://problem/35391728>

Not reviewed.

* bytecode/CodeBlock.h:
* jit/JITCodeMap.h:

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

3 years agoReplace CompactJITCodeMap with JITCodeMap.
mark.lam@apple.com [Wed, 11 Apr 2018 22:09:09 +0000 (22:09 +0000)]
Replace CompactJITCodeMap with JITCodeMap.
https://bugs.webkit.org/show_bug.cgi?id=184512
<rdar://problem/35391728>

Reviewed by Filip Pizlo.

* CMakeLists.txt:
* JavaScriptCore.xcodeproj/project.pbxproj:
* bytecode/CodeBlock.h:
(JSC::CodeBlock::setJITCodeMap):
(JSC::CodeBlock::jitCodeMap const):
(JSC::CodeBlock::jitCodeMap): Deleted.
* dfg/DFGOSRExit.cpp:
(JSC::DFG::OSRExit::executeOSRExit):
* dfg/DFGOSRExitCompilerCommon.cpp:
(JSC::DFG::adjustAndJumpToTarget):
* jit/AssemblyHelpers.cpp:
(JSC::AssemblyHelpers::decodedCodeMapFor): Deleted.
* jit/AssemblyHelpers.h:
* jit/CompactJITCodeMap.h: Removed.
* jit/JIT.cpp:
(JSC::JIT::link):
* jit/JITCodeMap.h: Added.
(JSC::JITCodeMap::Entry::Entry):
(JSC::JITCodeMap::Entry::bytecodeIndex const):
(JSC::JITCodeMap::Entry::codeLocation):
(JSC::JITCodeMap::append):
(JSC::JITCodeMap::finish):
(JSC::JITCodeMap::find const):
(JSC::JITCodeMap::operator bool const):
* llint/LLIntSlowPaths.cpp:
(JSC::LLInt::LLINT_SLOW_PATH_DECL):

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

3 years agoPreventively expect UTF8 strings from libwebrtc SDP and error messages
youenn@apple.com [Wed, 11 Apr 2018 21:49:28 +0000 (21:49 +0000)]
Preventively expect UTF8 strings from libwebrtc SDP and error messages
https://bugs.webkit.org/show_bug.cgi?id=184509

Reviewed by Eric Carlson.

Source/WebCore:

Make WebCore code expect any libwebrtc string to contain UTF-8.
Currently SDPs do not contain any UTF-8 specific character
but https://tools.ietf.org/html/rfc4566 allows it.

Add Internals API to set track id so that we can inject UTF-8 inside some WebRTC tests.
Test: webrtc/utf8-sdp.html

* Modules/mediastream/MediaStreamTrack.h:
(WebCore::MediaStreamTrack::setIdForTesting):
* Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
(WebCore::fromStdString):
(WebCore::fromSessionDescription):
(WebCore::LibWebRTCMediaEndpoint::doSetLocalDescription):
(WebCore::LibWebRTCMediaEndpoint::doSetRemoteDescription):
(WebCore::LibWebRTCMediaEndpoint::mediaStreamFromRTCStream):
(WebCore::LibWebRTCMediaEndpoint::addRemoteTrack):
(WebCore::LibWebRTCMediaEndpoint::addDataChannel):
(WebCore::LibWebRTCMediaEndpoint::OnIceCandidate):
(WebCore::LibWebRTCMediaEndpoint::createSessionDescriptionSucceeded):
(WebCore::LibWebRTCMediaEndpoint::createSessionDescriptionFailed):
(WebCore::LibWebRTCMediaEndpoint::setLocalSessionDescriptionFailed):
(WebCore::LibWebRTCMediaEndpoint::setRemoteSessionDescriptionFailed):
(WebCore::trackId): Deleted.
* Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
(WebCore::fromStdString):
(WebCore::LibWebRTCPeerConnectionBackend::doAddIceCandidate):
(WebCore::createReceiverForSource):
* platform/mediastream/MediaStreamTrackPrivate.h:
(WebCore::MediaStreamTrackPrivate::setIdForTesting):
* testing/Internals.cpp:
(WebCore::Internals::setMediaStreamTrackIdentifier):
* testing/Internals.h:
* testing/Internals.idl:

LayoutTests:

* webrtc/utf8-sdp-expected.txt: Added.
* webrtc/utf8-sdp.html: Added.

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

3 years ago[Extra zoom mode] Support pushing input view controllers onto the navigation stack
wenson_hsieh@apple.com [Wed, 11 Apr 2018 21:06:48 +0000 (21:06 +0000)]
[Extra zoom mode] Support pushing input view controllers onto the navigation stack
https://bugs.webkit.org/show_bug.cgi?id=184397
<rdar://problem/39265294>

Reviewed by Timothy Hatcher.

Currently, all input view controllers in extra zoom mode are presented modally. However, the latest iteration of
the HI specification depicts most of these view controllers (with the exception of time pickers) being presented
and dismissed via navigation stack. Since WebKit's iOS API surface doesn't force clients to embed WKWebViews
within a view controller with a corresponding UINavigationController, we cannot always guarantee that UI
presented when focusing form controls in a web view will be pushed onto the navigation stack; as such, the
approach taken in this patch will automatically allow WKWebView clients that already embed WKWebViews within a
UINavigationController to hook into this behavior, with modal presentation as a fallback.

At a high level, this patch makes the following tweaks to implement this behavior:

1. Store the currently presented view controller using a single member variable
   (_presentedFullScreenInputViewController) instead of having one for each type. This makes bookkeepping around
   which view controller to present or dismiss much more straightforward.

2. Replace WKFocusedFormControlViewController with just WKFocusedFormControlView. This addresses problems with
   pushing an input view controller onto the navigation stack after presenting the focused form control view
   controller modally. Now, we'll only need to present or push one view controller on the navigation stack.

3. Remove -handleWheelEvent: forwarding to date and time pickers. Pushing date picker view controllers onto the
   navigation stack rather than presenting them modally means that we end up in a state where neither the
   WKContentView nor WKTimePickerViewController are first responder, which renders time pickers unusable.
   Instead, have the WKTimePickerViewController actually become first responder when presenting.

4. Lastly, and most importantly: change -presentViewControllerForCurrentAssistedNode and
   -dismissAllInputViewControllers to try and push onto a navigation stack if possible, and fall back to modal
   presentation.

* UIProcess/ios/WKContentViewInteraction.h:

Remove the separate member variables for each type of input view controller, and instead have one to keep track
of the current (and only) presented input view controller.

* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _willStartScrollingOrZooming]):
(-[WKContentView _didEndScrollingOrZooming]):
(-[WKContentView _startAssistingNode:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):
(-[WKContentView _stopAssistingNode]):

Boilerplate renaming of _focusedFormControlViewController => _focusedFormControlView.

(-[WKContentView reloadContextViewForPresentedListViewController]):

Adjust for consolidation of the different input view controller member variables to a single member (see changes
in WKContentViewInteraction.h).

(-[WKContentView addFocusedFormControlOverlay]):
(-[WKContentView removeFocusedFormControlOverlay]):
(-[WKContentView presentViewControllerForCurrentAssistedNode]):
(-[WKContentView dismissAllInputViewControllers:]):

Add an `animated` argument. In the case where a different view controller was presented after presenting the
input view controller, this allows us to dismiss the other view controller with animation, and directly reveal
the web view or focus overlay underneath.

(-[WKContentView focusedFormControlViewDidSubmit:]):
(-[WKContentView focusedFormControlViewDidCancel:]):
(-[WKContentView focusedFormControlViewDidBeginEditing:]):
(-[WKContentView rectForFocusedFormControlView:]):
(-[WKContentView nextRectForFocusedFormControlView:]):
(-[WKContentView previousRectForFocusedFormControlView:]):
(-[WKContentView scrollViewForFocusedFormControlView:]):
(-[WKContentView actionNameForFocusedFormControlView:]):
(-[WKContentView focusedFormControlViewDidRequestNextNode:]):
(-[WKContentView focusedFormControlViewDidRequestPreviousNode:]):
(-[WKContentView hasNextNodeForFocusedFormControlView:]):
(-[WKContentView hasPreviousNodeForFocusedFormControlView:]):
(-[WKContentView focusedFormControllerDidUpdateSuggestions:]):

Boilerplate renaming of focus overlay delegate methods.

(-[WKContentView _wheelChangedWithEvent:]):

Remove event forwarding hacks for date and time inputs, now that they directly become first responder.

(-[WKContentView presentFocusedFormControlViewController:]): Deleted.
(-[WKContentView dismissFocusedFormControlViewController:]): Deleted.

Renamed to -addFocusedFormControlOverlay and -removeFocusedFormControlOverlay.

(-[WKContentView dismissAllInputViewControllers]): Deleted.
(-[WKContentView focusedFormControlControllerDidSubmit:]): Deleted.
(-[WKContentView focusedFormControlControllerDidCancel:]): Deleted.
(-[WKContentView focusedFormControlControllerDidBeginEditing:]): Deleted.
(-[WKContentView rectForFocusedFormControlController:inCoordinateSpace:]): Deleted.
(-[WKContentView nextRectForFocusedFormControlController:inCoordinateSpace:]): Deleted.
(-[WKContentView previousRectForFocusedFormControlController:inCoordinateSpace:]): Deleted.
(-[WKContentView scrollViewForFocusedFormControlController:]): Deleted.
(-[WKContentView actionNameForFocusedFormControlController:]): Deleted.
(-[WKContentView focusedFormControlControllerDidRequestNextNode:]): Deleted.
(-[WKContentView focusedFormControlControllerDidRequestPreviousNode:]): Deleted.
(-[WKContentView hasNextNodeForFocusedFormControlController:]): Deleted.
(-[WKContentView hasPreviousNodeForFocusedFormControlController:]): Deleted.
* UIProcess/ios/forms/WKFocusedFormControlViewController.h: Removed.
* UIProcess/ios/forms/WKFocusedFormControlViewController.mm: Removed.

Completely remove WKFocusedFormControlViewController; instead, just directly place the focused form overlay in
the WKWebView's hierarchy. In the case where we have a navigation stack to push to, we can no longer modally
present the focused form overlay as a separate view controller using the UINavigationController, and then
immediately push the input view controller on top of the navigation stack, since the navigation stack isn't
updated until after the animation of the focused form overlay presentation is complete. Rather than hack around
this limitation by dispatch_after-ing after presenting the overlay's view controller, we should just make the
overlay a view. This also fixes the case where a client embedding a WKWebView that is smaller than the bounds of
the screen will no longer see the entire screen dim when focusing an input, but instead, just the web content.

* WebKit.xcodeproj/project.pbxproj:

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

3 years agoFix TestInvocation class for newer versions of clang.
jbedard@apple.com [Wed, 11 Apr 2018 20:38:21 +0000 (20:38 +0000)]
Fix TestInvocation class for newer versions of clang.
https://bugs.webkit.org/show_bug.cgi?id=184508
<rdar://problem/39328648>

Reviewed by Alexey Proskuryakov.

Declare TestInvocation to be final so it does not require a virtual destructor.

* WebKitTestRunner/TestInvocation.h:

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

3 years agoCache glyphs (using display lists) when painting at high frequency
commit-queue@webkit.org [Wed, 11 Apr 2018 20:29:49 +0000 (20:29 +0000)]
Cache glyphs (using display lists) when painting at high frequency
https://bugs.webkit.org/show_bug.cgi?id=178750
<rdar://problem/35201729>

Patch by Said Abou-Hallawa <sabouhallawa@apple.com> on 2018-04-11
Reviewed by Antti Koivisto.

This patch adds support for caching of glyph drawing commands when painting
at high frequency. Caching the glyph drawing will be done using DisplayLists.

GlyphDisplayListCache is basically a hash map which maps InlineTextBox
or SimpleLineLayout::Run to DisplayList. Before adding a new entry to it
we have to check whether the conditions for caching the glyph DisplayList
are met or not. If no entry is found for a given run, a new DisplayList
is created and a new entry is add to the cache.

* WebCore.xcodeproj/project.pbxproj:
* page/MemoryRelease.cpp:
(WebCore::releaseNoncriticalMemory): Make GlyphDisplayListCache respond
to memory pressure.

* platform/graphics/FontCascade.cpp:
(WebCore::FontCascade::displayListForTextRun const):
* platform/graphics/FontCascade.h:
(WebCore::FontCascade::displayListForTextRun):
Record the drawing of a glyph run into a DisplayList.

* rendering/GlyphDisplayListCache.h: Added.
(WebCore::GlyphDisplayListCache::singleton):
(WebCore::GlyphDisplayListCache::get):
(WebCore::GlyphDisplayListCache::remove):
(WebCore::GlyphDisplayListCache::clear):
(WebCore::GlyphDisplayListCache::size const):
(WebCore::GlyphDisplayListCache::sizeInBytes const):
A simple cache for the TextRun DisplayList. Adding a new entry in the
cache happens under restricted conditions. So this cache is not expected
to grow much.

* rendering/InlineTextBox.cpp:
(WebCore::InlineTextBox::~InlineTextBox):
(WebCore::InlineTextBox::paint):
(WebCore::InlineTextBox::paintMarkedTexts):
(WebCore::InlineTextBox::paintMarkedTextBackground):
(WebCore::InlineTextBox::paintMarkedTextForeground):
(WebCore::InlineTextBox::paintMarkedTextDecoration):
(WebCore::InlineTextBox::paintCompositionBackground):
(WebCore::InlineTextBox::paintCompositionUnderlines const):
(WebCore::InlineTextBox::paintCompositionUnderline const):
* rendering/InlineTextBox.h:
(WebCore::InlineTextBox::paintMarkedTexts):
InlineTextBox::paintMarkedTextForeground() now requires PaintInfo to know
whether the entry in the GlyphDisplayListCache should be removed or not.
Change all the GraphicsContext arguments to be PaintInfo.

* rendering/SimpleLineLayout.cpp:
(WebCore::SimpleLineLayout::Layout::~Layout):
* rendering/SimpleLineLayout.h:
* rendering/SimpleLineLayoutFunctions.cpp:
(WebCore::SimpleLineLayout::paintFlow):
(WebCore::SimpleLineLayout::simpleLineLayoutWillBeDeleted):
* rendering/SimpleLineLayoutFunctions.h:
* rendering/SimpleLineLayoutResolver.h:
(WebCore::SimpleLineLayout::RunResolver::Run::simpleRun const):
Implement the glyph caching for SimpleLineLayout::Run.

* rendering/TextPainter.cpp:
(WebCore::TextPainter::paintTextOrEmphasisMarks): If the DisplayList is
available, replay it back into the GraphicsContext. Make sure to reset to
the DisplayList pointer to nullptr after painting.

(WebCore::TextPainter::clearGlyphDisplayLists):
(WebCore::TextPainter::shouldUseGlyphDisplayList): Check whether we should
use DisplayList to the draw glyph run.

* rendering/TextPainter.h:
(WebCore::TextPainter::setGlyphDisplayListIfNeeded): Check whether we should
should use DisplayList to the draw glyph run and if we should, ensure first
the DisplayList is cached and set it in the TextPainter so it uses it when
the run is painted.

(WebCore::TextPainter::removeGlyphDisplayList): Remove the cached DisplayList
entry for a glyph layout run.

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

3 years ago[DFG] Remove CompareSlowPathGenerator
utatane.tea@gmail.com [Wed, 11 Apr 2018 20:02:29 +0000 (20:02 +0000)]
[DFG] Remove CompareSlowPathGenerator
https://bugs.webkit.org/show_bug.cgi?id=184492

Reviewed by Mark Lam.

Now CompareSlowPathGenerator is just calling a specified function.
This can be altered with slowPathCall. This patch removes CompareSlowPathGenerator.

We also remove some of unnecessary USE(JSVALUE32_64) / USE(JSVALUE64) ifdefs by
introducing a new constructor for GPRTemporary.

* JavaScriptCore.xcodeproj/project.pbxproj:
* dfg/DFGCompareSlowPathGenerator.h: Removed.
* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::GPRTemporary::GPRTemporary):
(JSC::DFG::SpeculativeJIT::compileIsCellWithType):
(JSC::DFG::SpeculativeJIT::compileIsTypedArrayView):
(JSC::DFG::SpeculativeJIT::compileToObjectOrCallObjectConstructor):
(JSC::DFG::SpeculativeJIT::compileIsObject):
(JSC::DFG::SpeculativeJIT::nonSpeculativeNonPeepholeCompare):
(JSC::DFG::SpeculativeJIT::nonSpeculativePeepholeBranch):
* dfg/DFGSpeculativeJIT.h:
(JSC::DFG::GPRTemporary::GPRTemporary):
* dfg/DFGSpeculativeJIT64.cpp:
(JSC::DFG::SpeculativeJIT::nonSpeculativeNonPeepholeStrictEq):

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

3 years agoGraphicsLayerCA::createPlatformCALayer always disables extended color in its backing...
bfulgham@apple.com [Wed, 11 Apr 2018 19:52:56 +0000 (19:52 +0000)]
GraphicsLayerCA::createPlatformCALayer always disables extended color in its backing store
https://bugs.webkit.org/show_bug.cgi?id=184367
<rdar://problem/39249074>

Reviewed by Simon Fraser.

'createPlatformCALayer' always passes a nil widget, which early returns from 'screenSupportsExtendedColor'
with false. Instead, we should just pass the widget (nil or not) to the screen properties methods,
which will use the primary screen if no screen is specified. I.e., we shouldn't do an early return
here if the passed widget is nil.

* platform/mac/PlatformScreenMac.mm:
(WebCore::screenSupportsExtendedColor):

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

3 years agoPass FetchOptions and SecurityOrigin as load parameters from WebProcess to NetworkProcess
youenn@apple.com [Wed, 11 Apr 2018 19:05:08 +0000 (19:05 +0000)]
Pass FetchOptions and SecurityOrigin as load parameters from WebProcess to NetworkProcess
https://bugs.webkit.org/show_bug.cgi?id=184374

Reviewed by Chris Dumez.

Source/WebCore:

Add support for SecurityOrigin encode/decode routines.

* page/SecurityOrigin.h:

Source/WebKit:

Pass full FetchOptions parameters as part of NetworkResourceLoadParameters.
This will allow handling redirection mode as well as credentials in case of cross origin redirections.
In case of SameOrigin credentials and there is a redirection from same-origin to cross-origin,
we will be able to stop using credentials without going to WebProcess.

To handle properly cross-origin checks, we have to be able to use SecurityOrigin as in WebProcess.
We make WebProcess sends Origin Access White list information to NetworkProcess.
This allows supporting the white list when doing loading in NetworkProcess.
This only works consistently if all WebProcesses share the same whitelist.

* NetworkProcess/NetworkConnectionToWebProcess.cpp:
(WebKit::NetworkConnectionToWebProcess::loadPing):
(WebKit::NetworkConnectionToWebProcess::addOriginAccessWhitelistEntry):
(WebKit::NetworkConnectionToWebProcess::removeOriginAccessWhitelistEntry):
(WebKit::NetworkConnectionToWebProcess::resetOriginAccessWhitelists):
* NetworkProcess/NetworkConnectionToWebProcess.h:
* NetworkProcess/NetworkConnectionToWebProcess.messages.in:
* NetworkProcess/NetworkLoadChecker.cpp:
(WebKit::NetworkLoadChecker::NetworkLoadChecker):
(WebKit::NetworkLoadChecker::checkRedirection):
(WebKit::NetworkLoadChecker::continueCheckingRequest):
(WebKit::NetworkLoadChecker::checkCORSRequest):
(WebKit::NetworkLoadChecker::checkCORSRedirectedRequest):
(WebKit::NetworkLoadChecker::checkCORSRequestWithPreflight):
(WebKit::NetworkLoadChecker::doesNotNeedCORSCheck const):
* NetworkProcess/NetworkLoadChecker.h:
(WebKit::NetworkLoadChecker::create):
* NetworkProcess/NetworkResourceLoadParameters.cpp:
(WebKit::NetworkResourceLoadParameters::encode const):
(WebKit::NetworkResourceLoadParameters::decode):
* NetworkProcess/NetworkResourceLoadParameters.h:
* NetworkProcess/PingLoad.cpp:
(WebKit::PingLoad::PingLoad):
(WebKit::PingLoad::willPerformHTTPRedirection):
* NetworkProcess/PingLoad.h:
* WebProcess/InjectedBundle/InjectedBundle.cpp:
(WebKit::InjectedBundle::addOriginAccessWhitelistEntry):
(WebKit::InjectedBundle::removeOriginAccessWhitelistEntry):
(WebKit::InjectedBundle::resetOriginAccessWhitelists):
* WebProcess/Network/WebLoaderStrategy.cpp:
(WebKit::WebLoaderStrategy::startPingLoad):

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

3 years ago[GStreamer] Use of playbin3 when USE_PLAYBIN3 environment variable is set
commit-queue@webkit.org [Wed, 11 Apr 2018 18:33:39 +0000 (18:33 +0000)]
[GStreamer] Use of playbin3 when USE_PLAYBIN3 environment variable is set
https://bugs.webkit.org/show_bug.cgi?id=184498

Patch by Thibault Saunier <tsaunier@igalia.com> on 2018-04-11
Reviewed by Philippe Normand.

.:

This is the same behaviour as with playbin itself.

Make sure to keep using "playbin" for MediaSource.

* Source/cmake/GStreamerDefinitions.cmake:

Source/WebCore:

[GStreamer] Use of playbin3 when USE_PLAYBIN3 environment variable is set

This is the same behaviour as with playbin itself.

Make sure to keep using "playbin" for MediaSource.

No test added as this is basically a small rework of the way we expose a feature.

* platform/graphics/gstreamer/AudioTrackPrivateGStreamer.cpp:
* platform/graphics/gstreamer/AudioTrackPrivateGStreamer.h:
* platform/graphics/gstreamer/GRefPtrGStreamer.cpp:
* platform/graphics/gstreamer/GRefPtrGStreamer.h:
* platform/graphics/gstreamer/InbandTextTrackPrivateGStreamer.cpp:
* platform/graphics/gstreamer/InbandTextTrackPrivateGStreamer.h:
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::load):
(WebCore::MediaPlayerPrivateGStreamer::enableTrack):
(WebCore::MediaPlayerPrivateGStreamer::handleMessage):
(WebCore::MediaPlayerPrivateGStreamer::createGSTPlayBin):
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
* platform/graphics/gstreamer/TrackPrivateBaseGStreamer.cpp:
(WebCore::TrackPrivateBaseGStreamer::disconnect):
(WebCore::TrackPrivateBaseGStreamer::tagsChanged):
* platform/graphics/gstreamer/TrackPrivateBaseGStreamer.h:
* platform/graphics/gstreamer/VideoTrackPrivateGStreamer.cpp:
* platform/graphics/gstreamer/VideoTrackPrivateGStreamer.h:

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

3 years agoIDN spoofing with Hebrew combining characters
achristensen@apple.com [Wed, 11 Apr 2018 17:31:53 +0000 (17:31 +0000)]
IDN spoofing with Hebrew combining characters
https://bugs.webkit.org/show_bug.cgi?id=184472
<rdar://problem/39148687>

Reviewed by Brent Fulgham.

Source/WebCore:

Covered by new API tests.

* platform/mac/WebCoreNSURLExtras.mm:
(WebCore::isLookalikeCharacter):
Punycode-encode hosts with Hebrew combining marks that look like dots
and Vav with a combining dot above like we do with dotless i and j.

Tools:

* TestWebKitAPI/Tests/WebCore/cocoa/URLExtras.mm:
(TestWebKitAPI::TEST):

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

3 years ago[GTK] Unreviewed test gardening
aboya@igalia.com [Wed, 11 Apr 2018 17:27:33 +0000 (17:27 +0000)]
[GTK] Unreviewed test gardening
https://bugs.webkit.org/show_bug.cgi?id=184506

* TestExpectations:
* platform/gtk/TestExpectations:
* platform/gtk/imported/w3c/web-platform-tests/media-source/mediasource-is-type-supported-expected.txt:
* platform/ios-wk1/TestExpectations:
* platform/ios-wk2/TestExpectations:
* platform/mac/TestExpectations:
* platform/win/TestExpectations:

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

3 years agoShow punycode if URL contains Latin dum character
bfulgham@apple.com [Wed, 11 Apr 2018 17:03:55 +0000 (17:03 +0000)]
Show punycode if URL contains Latin dum character
https://bugs.webkit.org/show_bug.cgi?id=184477
<rdar://problem/39121999>

Reviewed by David Kilzer.

Source/WebCore:

Revise our "lookalike character" logic to include the small
Latin dum character.

Test: fast/url/host.html

* platform/mac/WebCoreNSURLExtras.mm:
(WebCore::isLookalikeCharacter):

LayoutTests:

* fast/url/host-expected.txt:
* fast/url/host.html:

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

3 years ago[GTK] WaylandCompositorDisplay leaks its wl_display
mcatanzaro@igalia.com [Wed, 11 Apr 2018 16:58:23 +0000 (16:58 +0000)]
[GTK] WaylandCompositorDisplay leaks its wl_display
https://bugs.webkit.org/show_bug.cgi?id=184406

Reviewed by Carlos Garcia Campos.

Source/WebCore:

Well, this was harder than expected. We really just want to fix a small leak in the WebKit
layer, but that requires a change in how WaylandCompositorDisplay calls the
PlatformDisplayWayland constructor, to pass NativeDisplayOwned::Yes. That means
WaylandCompositorDisplay can no longer use PlatformDisplayWayland's protected default
constructor. Problem is that the normal PlatformDisplayWayland constructor calls
PlatformDisplayWayland::initialize, which calls PlatformDisplayWayland::registryGlobal,
which is a virtual function. The WaylandCompositorDisplay portion of the object is not
constructed yet at this point, so WaylandCompositorDisplay::registryGlobal will never be
called if we do that. I had to revert the previous version of this fix due to this problem.
It had broken accelerated compositing.

I'm reminded of Effective C++ item #9: Never call virtual functions during construction or
destruction ("because such calls will never go to a more derived class than that of the
currently executing constructor or destructor"). This code is fragile and likely to break
again in the future, so let's refactor it a bit. Instead of calling initialize in the
constructor, we'll call it from create functions. We'll have to add a couple create
functions, and make the constructor protected to ensure it's not possible to create a
PlatformDisplayWayland without initializing it. For good parallelism, do the same for the
other PlatformDisplay classes.

This commit additionally removes PlatformDisplayWayland's protected default constructor,
since it's not needed anymore.

The NativeDisplayOwned arguments to the PlatformDisplay constructors are now mandatory,
instead of using NativeDisplayOwned::No as the default value, since that was dangerously
close to being the cause of this leak, and the constructors are now accessed from private
create functions anyway. Some more caution when using default parameter values is warranted
in the future.

Lastly, since we have to change PlatformDisplay::createPlatformDisplay to use the new create
functions, take the opportunity to move things around a bit for clarity. There should be no
change in behavior. I was just disappointed that the PlatformDisplayWPE creation was at the
bottom of the function, after a comment indicating that normal display creation has failed,
which is not the case for WPE.

This all might have been a bit overkill, since the leak could probably have been fixed by
passing nullptr to the PlatformDisplayWayland constructor for the wl_display and not
removing WaylandCompositorDisplay's call to PlatformDisplayWayland::initialize. But the
correctness of that code would then rely on implementation details of initialize, so this
refactor seems better.

No new tests since there *should* be no behavior change. Then again, I'm touching
PlatformDisplay, and history shows we don't have the greatest track record of touching this
code without introducing problems.

* platform/graphics/PlatformDisplay.cpp:
(WebCore::PlatformDisplay::createPlatformDisplay):
* platform/graphics/PlatformDisplay.h:
* platform/graphics/wayland/PlatformDisplayWayland.cpp:
(WebCore::PlatformDisplayWayland::create):
(WebCore::PlatformDisplayWayland::create):
(WebCore::PlatformDisplayWayland::createHeadless):
(WebCore::PlatformDisplayWayland::PlatformDisplayWayland):
(WebCore::PlatformDisplayWayland::initialize):
* platform/graphics/wayland/PlatformDisplayWayland.h:
* platform/graphics/win/PlatformDisplayWin.h:
* platform/graphics/wpe/PlatformDisplayWPE.cpp:
(WebCore::create):
* platform/graphics/wpe/PlatformDisplayWPE.h:
* platform/graphics/x11/PlatformDisplayX11.cpp:
(WebCore::PlatformDisplayX11::create):
(WebCore::PlatformDisplayX11::create):
(WebCore::PlatformDisplayX11::createHeadless):
* platform/graphics/x11/PlatformDisplayX11.h:

Source/WebKit:

Since we allocate our own wl_display here, need to chain up to the parent constructor
passing NativeDisplayOwned::Yes, or it won't ever be released. Move the initialize call to
the create function to ensure it's called after the constructor completes.

* WebProcess/gtk/WaylandCompositorDisplay.cpp:
(WebKit::WaylandCompositorDisplay::create): Fix a log message (drive-by).
(WebKit::WaylandCompositorDisplay::WaylandCompositorDisplay):

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

3 years agoUse more r-values in NetworkResourceLoader
youenn@apple.com [Wed, 11 Apr 2018 16:56:38 +0000 (16:56 +0000)]
Use more r-values in NetworkResourceLoader
https://bugs.webkit.org/show_bug.cgi?id=184478

Reviewed by Chris Dumez.

Pass load parameters as r-values to remove some unneeded copies.
Ditto for ResourceRequest inside NetworkResourceLoader.

* NetworkProcess/NetworkConnectionToWebProcess.cpp:
(WebKit::NetworkConnectionToWebProcess::scheduleResourceLoad):
(WebKit::NetworkConnectionToWebProcess::performSynchronousLoad):
* NetworkProcess/NetworkConnectionToWebProcess.h:
* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::NetworkResourceLoader::NetworkResourceLoader):
(WebKit::NetworkResourceLoader::start):
(WebKit::NetworkResourceLoader::retrieveCacheEntry):
(WebKit::NetworkResourceLoader::startNetworkLoad):
(WebKit::NetworkResourceLoader::continueWillSendRequest):
(WebKit::NetworkResourceLoader::validateCacheEntry):
* NetworkProcess/NetworkResourceLoader.h:

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

3 years ago[Extra zoom mode] Missing label when focusing a <select> with a title attribute but...
wenson_hsieh@apple.com [Wed, 11 Apr 2018 16:43:53 +0000 (16:43 +0000)]
[Extra zoom mode] Missing label when focusing a <select> with a title attribute but no associated <label>
https://bugs.webkit.org/show_bug.cgi?id=184352
<rdar://problem/39237683>

Reviewed by Andy Estes.

Source/WebKit:

Currently, AssistedNodeInformation only sends the `title` of input elements to the UI process. This means that
any information requested in the UI process that is dependent on the `title` of the focused element is broken
in the case of select elements. An existing example of this is the title of the table view controller used to
present select menus on iPad.

To fix this, we simply send the `title` of the focused element across, as long as the focused element is an
HTMLElement. This ensures that there's label text when focusing unlabeled select elements with titles in extra
zoom mode, and also fixes a currenly broken codepath where we show the title of the select in the presented view
controller's title.

Test: fast/forms/ios/ipad/select-with-title.html

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

Add new testing SPI to fetch the title of the UITableViewController presented for the currently focused select
element.

* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView selectFormPopoverTitle]):
* UIProcess/ios/forms/WKFormSelectControl.h:
* UIProcess/ios/forms/WKFormSelectControl.mm:
(-[WKFormSelectControl selectFormPopoverTitle]):
* UIProcess/ios/forms/WKFormSelectPopover.h:
* UIProcess/ios/forms/WKFormSelectPopover.mm:
(-[WKSelectPopover initWithView:hasGroups:]):
(-[WKSelectPopover tableViewController]):
* WebProcess/WebPage/ios/WebPageIOS.mm:

Always send the title across if the focused node is an HTMLElement.

(WebKit::WebPage::getAssistedNodeInformation):

Tools:

Add support for UIScriptController::selectFormPopoverTitle, which returns the title of the current select
popover's UITableViewController (for testing purposes).

* DumpRenderTree/ios/UIScriptControllerIOS.mm:
(WTR::UIScriptController::selectFormPopoverTitle const):
* TestRunnerShared/UIScriptContext/Bindings/UIScriptController.idl:
* TestRunnerShared/UIScriptContext/UIScriptController.cpp:
(WTR::UIScriptController::selectFormPopoverTitle const):
* TestRunnerShared/UIScriptContext/UIScriptController.h:
* WebKitTestRunner/ios/UIScriptControllerIOS.mm:
(WTR::UIScriptController::selectFormPopoverTitle const):

LayoutTests:

Add a new layout test to check that the title of select elements is propagated to the UI process upon focus.
This title is used for several purposes, one of them being the title of select menus in the table view
controller presented when tapping on a select on an iPad, so the test checks that the title of the select is
shown here.

Also moves a select-related helper into UIHelper from basic-gestures.js (since this doesn't involve user gesture
simulation in any way) and also introduces a new UIHelper method for querying the title of the select menu that
is currently being presented.

* fast/forms/ios/ipad/multiple-select-updates-renderer.html:
* fast/forms/ios/ipad/select-with-title-expected.txt: Added.
* fast/forms/ios/ipad/select-with-title.html: Copied from LayoutTests/fast/forms/ios/ipad/multiple-select-updates-renderer.html.
* resources/basic-gestures.js:
* resources/ui-helper.js:
(window.UIHelper.selectFormAccessoryPickerRow):
(window.UIHelper.selectFormPopoverTitle):
(window.UIHelper):

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

3 years agoUnreviewed, rolling out r230508.
ryanhaddad@apple.com [Wed, 11 Apr 2018 16:01:31 +0000 (16:01 +0000)]
Unreviewed, rolling out r230508.

Breaks internal builds.

Reverted changeset:

"Remove block selection code"
https://bugs.webkit.org/show_bug.cgi?id=184470
https://trac.webkit.org/changeset/230508

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

3 years agoMark imported/w3c/web-platform-tests/html/semantics/embedded-content/the-embed-elemen...
ryanhaddad@apple.com [Wed, 11 Apr 2018 15:58:43 +0000 (15:58 +0000)]
Mark imported/w3c/web-platform-tests/html/semantics/embedded-content/the-embed-element/embed-in-object-fallback.html as flaky.
https://bugs.webkit.org/show_bug.cgi?id=184456

Unreviewed test gardening.

* platform/mac-wk1/TestExpectations:

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

3 years agoFix a WebRTC data channel issue for non-ASCII characters.
commit-queue@webkit.org [Wed, 11 Apr 2018 15:28:37 +0000 (15:28 +0000)]
Fix a WebRTC data channel issue for non-ASCII characters.

At the sender side, buffer size are calulcated after UTF8 encoding. At the
receiver side, strings are constructed with UTF8 data.

https://bugs.webkit.org/show_bug.cgi?id=184481

Patch by Jianjun Zhu <jianjun.zhu@intel.com> on 2018-04-11
Reviewed by Youenn Fablet.

LayoutTests/imported/w3c:

* web-platform-tests/webrtc/RTCDataChannel-send-expected.txt:

Source/WebCore:

Updated test:
LayoutTests/imported/w3c/web-platform-tests/webrtc/RTCDataChannel-send-expected.txt

* Modules/mediastream/libwebrtc/LibWebRTCDataChannelHandler.cpp:
(WebCore::LibWebRTCDataChannelHandler::sendStringData):
(WebCore::LibWebRTCDataChannelHandler::OnMessage):

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

3 years agoDeactivate the WindowServer connection for the WebContent process.
pvollan@apple.com [Wed, 11 Apr 2018 14:29:39 +0000 (14:29 +0000)]
Deactivate the WindowServer connection for the WebContent process.
https://bugs.webkit.org/show_bug.cgi?id=184451
<rdar://problem/38313938>

Reviewed by Brent Fulgham.

Defining ENABLE_WEBPROCESS_WINDOWSERVER_BLOCKING as 1 will deactivate the WindowServer connection
for the WebContent process by enabling the call to 'CGSSetDenyWindowServerConnections(true)' on
process startup. After calling this function, every attempt to establish a connection to the
WindowServer from the WebContent process will fail, except for CA render server connections.

* wtf/FeatureDefines.h:

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

3 years agoImageFrame type used by non-Cocoa image decoder should not be the same as that used...
antti@apple.com [Wed, 11 Apr 2018 13:47:26 +0000 (13:47 +0000)]
ImageFrame type used by non-Cocoa image decoder should not be the same as that used by ImageSource
https://bugs.webkit.org/show_bug.cgi?id=184418

Reviewed by Said Abou-Hallawa.

ScalableImageDecoder uses ImageFrame class which is meant to be an implementation detail of ImageSource.
There are bunch of fields and methods in the type that are only used by one or the other client. For hackability
there should be an unrelated frame type for ScalableImageDecoder.

This patch adds ScalableImageDecoderFrame type used in ScalableImageDecoder only. It then cleans up
unneeded things from both ImageFrame and ScalableImageDecoderFrame.

* platform/ImageDecoders.cmake:
* platform/graphics/ImageFrame.cpp:
(WebCore::ImageFrame::operator=):
(WebCore::ImageFrame::clearImage):
(WebCore::ImageFrame::size const):
(WebCore::ImageFrame::initialize): Deleted.
* platform/graphics/ImageFrame.h:
(WebCore::ImageFrame::setDisposalMethod): Deleted.
(WebCore::ImageFrame::disposalMethod const): Deleted.
(WebCore::ImageFrame::backingStore const): Deleted.
(WebCore::ImageFrame::hasBackingStore const): Deleted.
* platform/image-decoders/ScalableImageDecoder.cpp:
(WebCore::ScalableImageDecoder::frameIsCompleteAtIndex const):
(WebCore::ScalableImageDecoder::frameDurationAtIndex const):
(WebCore::ScalableImageDecoder::createFrameImageAtIndex):
* platform/image-decoders/ScalableImageDecoder.h:
* platform/image-decoders/ScalableImageDecoderFrame.cpp: Copied from Source/WebCore/platform/graphics/ImageFrame.cpp.
(WebCore::ScalableImageDecoderFrame::ScalableImageDecoderFrame):
(WebCore::ScalableImageDecoderFrame::~ScalableImageDecoderFrame):
(WebCore::ScalableImageDecoderFrame::operator=):
(WebCore::ScalableImageDecoderFrame::setDecodingStatus):
(WebCore::ScalableImageDecoderFrame::decodingStatus const):
(WebCore::ScalableImageDecoderFrame::clearImage):
(WebCore::ScalableImageDecoderFrame::clear):
(WebCore::ScalableImageDecoderFrame::initialize):
(WebCore::ScalableImageDecoderFrame::size const):
(WebCore::ImageFrame::ImageFrame): Deleted.
(WebCore::ImageFrame::~ImageFrame): Deleted.
(WebCore::ImageFrame::defaultFrame): Deleted.
(WebCore::ImageFrame::operator=): Deleted.
(WebCore::ImageFrame::setDecodingStatus): Deleted.
(WebCore::ImageFrame::decodingStatus const): Deleted.
(WebCore::ImageFrame::clearImage): Deleted.
(WebCore::ImageFrame::clear): Deleted.
(WebCore::ImageFrame::initialize): Deleted.
(WebCore::ImageFrame::size const): Deleted.
(WebCore::ImageFrame::hasNativeImage const): Deleted.
(WebCore::ImageFrame::hasFullSizeNativeImage const): Deleted.
(WebCore::ImageFrame::hasDecodedNativeImageCompatibleWithOptions const): Deleted.
(WebCore::ImageFrame::singlePixelSolidColor const): Deleted.
* platform/image-decoders/ScalableImageDecoderFrame.h: Copied from Source/WebCore/platform/graphics/ImageFrame.h.
(WebCore::ScalableImageDecoderFrame::ScalableImageDecoderFrame):
(WebCore::ScalableImageDecoderFrame::disposalMethod const):
(WebCore::ScalableImageDecoderFrame::hasAlpha const):
(WebCore::ScalableImageDecoderFrame::hasBackingStore const):
(WebCore::ImageFrame::ImageFrame): Deleted.
(WebCore::ImageFrame::isInvalid const): Deleted.
(WebCore::ImageFrame::isPartial const): Deleted.
(WebCore::ImageFrame::isComplete const): Deleted.
(WebCore::ImageFrame::sizeRespectingOrientation const): Deleted.
(WebCore::ImageFrame::frameBytes const): Deleted.
(WebCore::ImageFrame::subsamplingLevel const): Deleted.
(WebCore::ImageFrame::setDisposalMethod): Deleted.
(WebCore::ImageFrame::disposalMethod const): Deleted.
(WebCore::ImageFrame::nativeImage const): Deleted.
(WebCore::ImageFrame::setOrientation): Deleted.
(WebCore::ImageFrame::orientation const): Deleted.
(WebCore::ImageFrame::setDuration): Deleted.
(WebCore::ImageFrame::duration const): Deleted.
(WebCore::ImageFrame::setHasAlpha): Deleted.
(WebCore::ImageFrame::hasAlpha const): Deleted.
(WebCore::ImageFrame::hasNativeImage): Deleted.
(WebCore::ImageFrame::hasFullSizeNativeImage): Deleted.
(WebCore::ImageFrame::hasMetadata const): Deleted.
(WebCore::ImageFrame::backingStore const): Deleted.
(WebCore::ImageFrame::hasBackingStore const): Deleted.
* platform/image-decoders/bmp/BMPImageDecoder.cpp:
(WebCore::BMPImageDecoder::frameBufferAtIndex):
* platform/image-decoders/bmp/BMPImageDecoder.h:
* platform/image-decoders/bmp/BMPImageReader.h:
(WebCore::BMPImageReader::setBuffer):
* platform/image-decoders/gif/GIFImageDecoder.cpp:
(WebCore::GIFImageDecoder::findFirstRequiredFrameToDecode):
(WebCore::GIFImageDecoder::frameBufferAtIndex):
(WebCore::GIFImageDecoder::clearFrameBufferCache):
(WebCore::GIFImageDecoder::haveDecodedRow):
(WebCore::GIFImageDecoder::frameComplete):
(WebCore::GIFImageDecoder::initFrameBuffer):
* platform/image-decoders/gif/GIFImageDecoder.h:
* platform/image-decoders/gif/GIFImageReader.cpp:
(GIFImageReader::parse):
* platform/image-decoders/gif/GIFImageReader.h:
(GIFFrameContext::GIFFrameContext):
* platform/image-decoders/ico/ICOImageDecoder.cpp:
(WebCore::ICOImageDecoder::frameBufferAtIndex):
* platform/image-decoders/ico/ICOImageDecoder.h:
* platform/image-decoders/jpeg/JPEGImageDecoder.cpp:
(WebCore::JPEGImageDecoder::frameBufferAtIndex):
(WebCore::setPixel):
(WebCore::JPEGImageDecoder::outputScanlines):
(WebCore::JPEGImageDecoder::jpegComplete):
* platform/image-decoders/jpeg/JPEGImageDecoder.h:
* platform/image-decoders/png/PNGImageDecoder.cpp:
(WebCore::PNGImageDecoder::frameBufferAtIndex):
(WebCore::PNGImageDecoder::rowAvailable):
(WebCore::PNGImageDecoder::readChunks):
(WebCore::PNGImageDecoder::clearFrameBufferCache):
(WebCore::PNGImageDecoder::initFrameBuffer):
(WebCore::PNGImageDecoder::frameComplete):
* platform/image-decoders/png/PNGImageDecoder.h:
* platform/image-decoders/webp/WEBPImageDecoder.cpp:
(WebCore::WEBPImageDecoder::frameBufferAtIndex):
(WebCore::WEBPImageDecoder::findFirstRequiredFrameToDecode):
(WebCore::WEBPImageDecoder::decodeFrame):
(WebCore::WEBPImageDecoder::initFrameBuffer):
(WebCore::WEBPImageDecoder::applyPostProcessing):
(WebCore::WEBPImageDecoder::clearFrameBufferCache):
* platform/image-decoders/webp/WEBPImageDecoder.h:

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

3 years ago[Web Animations] Turn Web Animations on by default
commit-queue@webkit.org [Wed, 11 Apr 2018 12:05:45 +0000 (12:05 +0000)]
[Web Animations] Turn Web Animations on by default
https://bugs.webkit.org/show_bug.cgi?id=184491

Patch by Antoine Quint <graouts@apple.com> on 2018-04-11
Reviewed by Simon Fraser.

Source/WebCore:

* page/RuntimeEnabledFeatures.h:

Source/WebKit:

* Shared/WebPreferences.yaml:

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

3 years agoUnreviewed, build fix for 32bit
utatane.tea@gmail.com [Wed, 11 Apr 2018 09:37:14 +0000 (09:37 +0000)]
Unreviewed, build fix for 32bit
https://bugs.webkit.org/show_bug.cgi?id=184236

* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::compileGetDirectPname):

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

3 years agoUnreviewed WPE gardening. Updating expectations and moving baselines
zandobersek@gmail.com [Wed, 11 Apr 2018 09:36:39 +0000 (09:36 +0000)]
Unreviewed WPE gardening. Updating expectations and moving baselines
for EME and WebCryptoAPI tests after W3C sync in r230445.

* platform/wpe/TestExpectations:
* platform/wpe/imported/w3c/web-platform-tests/WebCryptoAPI/: Updated.
* platform/wpe/imported/w3c/web-platform-tests/encrypted-media/: Updated.

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

3 years agoFix warning in HashTools.h for newer versions of clang
rniwa@webkit.org [Wed, 11 Apr 2018 08:57:41 +0000 (08:57 +0000)]
Fix warning in HashTools.h for newer versions of clang
https://bugs.webkit.org/show_bug.cgi?id=184489

Reviewed by Alexey Proskuryakov.

Removed "register" storage class specififer as it has been deprecated in C++11.

* platform/HashTools.h:

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

3 years ago[DFG] Remove duplicate 32bit code more
utatane.tea@gmail.com [Wed, 11 Apr 2018 07:44:58 +0000 (07:44 +0000)]
[DFG] Remove duplicate 32bit code more
https://bugs.webkit.org/show_bug.cgi?id=184236

Reviewed by Mark Lam.

Remove duplicate 32bit code more aggressively part 2.

* JavaScriptCore.xcodeproj/project.pbxproj:
* dfg/DFGCompareSlowPathGenerator.h: Added.
(JSC::DFG::CompareSlowPathGenerator::CompareSlowPathGenerator):
Drop boxing part. Use unblessedBooleanResult in DFGSpeculativeJIT side instead.

* dfg/DFGOperations.cpp:
* dfg/DFGOperations.h:
* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::compileOverridesHasInstance):
(JSC::DFG::SpeculativeJIT::compileLoadVarargs):
(JSC::DFG::SpeculativeJIT::compileIsObject):
(JSC::DFG::SpeculativeJIT::compileCheckNotEmpty):
(JSC::DFG::SpeculativeJIT::compilePutByIdFlush):
(JSC::DFG::SpeculativeJIT::compilePutById):
(JSC::DFG::SpeculativeJIT::compilePutByIdDirect):
(JSC::DFG::SpeculativeJIT::compileNewArrayWithSize):
(JSC::DFG::SpeculativeJIT::compileMiscStrictEq):
(JSC::DFG::SpeculativeJIT::emitInitializeButterfly):
(JSC::DFG::SpeculativeJIT::compileAllocateNewArrayWithSize):
(JSC::DFG::SpeculativeJIT::compileHasIndexedProperty):
(JSC::DFG::SpeculativeJIT::compileGetDirectPname):
(JSC::DFG::SpeculativeJIT::compileExtractCatchLocal):
(JSC::DFG::SpeculativeJIT::cachedPutById):
(JSC::DFG::SpeculativeJIT::nonSpeculativeNonPeepholeCompare):
(JSC::DFG::SpeculativeJIT::nonSpeculativePeepholeBranch):
(JSC::DFG::SpeculativeJIT::nonSpeculativeCompare): Deleted.
* dfg/DFGSpeculativeJIT.h:
(JSC::DFG::SpeculativeJIT::selectScratchGPR): Deleted.
* dfg/DFGSpeculativeJIT32_64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
(JSC::DFG::SpeculativeJIT::cachedPutById): Deleted.
(JSC::DFG::SpeculativeJIT::nonSpeculativePeepholeBranch): Deleted.
(JSC::DFG::CompareAndBoxBooleanSlowPathGenerator::CompareAndBoxBooleanSlowPathGenerator): Deleted.
(JSC::DFG::CompareAndBoxBooleanSlowPathGenerator::generateInternal): Deleted.
(JSC::DFG::SpeculativeJIT::nonSpeculativeNonPeepholeCompare): Deleted.
(JSC::DFG::SpeculativeJIT::compileMiscStrictEq): Deleted.
(JSC::DFG::SpeculativeJIT::emitInitializeButterfly): Deleted.
(JSC::DFG::SpeculativeJIT::compileAllocateNewArrayWithSize): Deleted.
* dfg/DFGSpeculativeJIT64.cpp:
(JSC::DFG::SpeculativeJIT::nonSpeculativeNonPeepholeStrictEq):
(JSC::DFG::SpeculativeJIT::compile):
(JSC::DFG::SpeculativeJIT::cachedPutById): Deleted.
(JSC::DFG::SpeculativeJIT::nonSpeculativePeepholeBranch): Deleted.
(JSC::DFG::CompareAndBoxBooleanSlowPathGenerator::CompareAndBoxBooleanSlowPathGenerator): Deleted.
(): Deleted.
(JSC::DFG::SpeculativeJIT::nonSpeculativeNonPeepholeCompare): Deleted.
(JSC::DFG::SpeculativeJIT::compileMiscStrictEq): Deleted.
(JSC::DFG::SpeculativeJIT::emitInitializeButterfly): Deleted.
(JSC::DFG::SpeculativeJIT::compileAllocateNewArrayWithSize): Deleted.
* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::compileHasIndexedProperty):
operationHasIndexedPropertyByInt starts returning unblessed boolean with size_t.

* jit/AssemblyHelpers.h:
(JSC::AssemblyHelpers::loadValue):
(JSC::AssemblyHelpers::selectScratchGPR):
(JSC::AssemblyHelpers::constructRegisterSet):
* jit/RegisterSet.h:
(JSC::RegisterSet::setAny):
Clean up selectScratchGPR code to pass JSValueRegs.

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

3 years ago[ESNext][BigInt] Add support for BigInt in SpeculatedType
ticaiolima@gmail.com [Wed, 11 Apr 2018 05:49:31 +0000 (05:49 +0000)]
[ESNext][BigInt] Add support for BigInt in SpeculatedType
https://bugs.webkit.org/show_bug.cgi?id=182470

Reviewed by Saam Barati.

JSTests:

* stress/big-int-spec-to-primitive.js: Added.
* stress/big-int-spec-to-this.js: Added.
* stress/big-int-strict-equals-jit.js: Added.
* stress/big-int-strict-spec-to-this.js: Added.
* stress/big-int-type-of-proven-type.js: Added.

Source/JavaScriptCore:

This patch introduces the SpecBigInt type to DFG to enable BigInt
speculation into DFG and FTL.

With SpecBigInt introduction, we can then specialize "===" operations
to BigInts. As we are doing for some cells, we first check if operands
are pointing to the same JSCell, and if it is false, we
fallback to "operationCompareStrictEqCell". The idea in further
patches is to implement BigInt equality check directly in
assembly.

We are also adding support for BigInt constant folding into
TypeOf operation.

* bytecode/SpeculatedType.cpp:
(JSC::dumpSpeculation):
(JSC::speculationFromClassInfo):
(JSC::speculationFromStructure):
(JSC::speculationFromJSType):
(JSC::speculationFromString):
* bytecode/SpeculatedType.h:
(JSC::isBigIntSpeculation):
* dfg/DFGAbstractInterpreterInlines.h:
(JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects):
* dfg/DFGAbstractValue.cpp:
(JSC::DFG::AbstractValue::set):
* dfg/DFGConstantFoldingPhase.cpp:
(JSC::DFG::ConstantFoldingPhase::foldConstants):
* dfg/DFGFixupPhase.cpp:
(JSC::DFG::FixupPhase::fixupNode):
(JSC::DFG::FixupPhase::fixupToThis):
(JSC::DFG::FixupPhase::observeUseKindOnNode):
* dfg/DFGInferredTypeCheck.cpp:
(JSC::DFG::insertInferredTypeCheck):
* dfg/DFGNode.h:
(JSC::DFG::Node::shouldSpeculateBigInt):
* dfg/DFGPredictionPropagationPhase.cpp:
* dfg/DFGSafeToExecute.h:
(JSC::DFG::SafeToExecuteEdge::operator()):
* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::compileStrictEq):
(JSC::DFG::SpeculativeJIT::speculateBigInt):
(JSC::DFG::SpeculativeJIT::speculate):
* dfg/DFGSpeculativeJIT.h:
* dfg/DFGSpeculativeJIT32_64.cpp:
(JSC::DFG::SpeculativeJIT::compileBigIntEquality):
* dfg/DFGSpeculativeJIT64.cpp:
(JSC::DFG::SpeculativeJIT::compileBigIntEquality):
* dfg/DFGUseKind.cpp:
(WTF::printInternal):
* dfg/DFGUseKind.h:
(JSC::DFG::typeFilterFor):
(JSC::DFG::isCell):
* ftl/FTLCapabilities.cpp:
(JSC::FTL::canCompile):
* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::compileCompareStrictEq):
(JSC::FTL::DFG::LowerDFGToB3::checkInferredType):
(JSC::FTL::DFG::LowerDFGToB3::speculate):
(JSC::FTL::DFG::LowerDFGToB3::isNotBigInt):
(JSC::FTL::DFG::LowerDFGToB3::speculateBigInt):
* jit/AssemblyHelpers.cpp:
(JSC::AssemblyHelpers::branchIfNotType):
* jit/AssemblyHelpers.h:
(JSC::AssemblyHelpers::branchIfBigInt):
(JSC::AssemblyHelpers::branchIfNotBigInt):
* runtime/InferredType.cpp:
(JSC::InferredType::Descriptor::forValue):
(JSC::InferredType::Descriptor::putByIdFlags const):
(JSC::InferredType::Descriptor::merge):
(WTF::printInternal):
* runtime/InferredType.h:
* runtime/JSBigInt.h:

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

3 years agoIsoHeapImpl::scavenge* needs to grab the lock
sbarati@apple.com [Wed, 11 Apr 2018 04:57:43 +0000 (04:57 +0000)]
IsoHeapImpl::scavenge* needs to grab the lock
https://bugs.webkit.org/show_bug.cgi?id=184461

Reviewed by Filip Pizlo.

Another thread could be modifying the linked list that the scavenge* methods traverse.

* bmalloc/IsoHeapImplInlines.h:
(bmalloc::IsoHeapImpl<Config>::scavenge):
(bmalloc::IsoHeapImpl<Config>::scavengeToHighWatermark):

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

3 years agoUnreviewed test fix after r230468
bfulgham@apple.com [Wed, 11 Apr 2018 04:16:56 +0000 (04:16 +0000)]
Unreviewed test fix after r230468

Roll out an assertion added in r230468 that should not be present
until https://bugs.webkit.org/show_bug.cgi?id=184451 is landed.

* Shared/mac/HangDetectionDisablerMac.mm:
(WebKit::setClientsMayIgnoreEvents):

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

3 years agoFrameSelection::appearanceUpdateTimerFired should be robust against layout passes...
wenson_hsieh@apple.com [Wed, 11 Apr 2018 03:44:00 +0000 (03:44 +0000)]
FrameSelection::appearanceUpdateTimerFired should be robust against layout passes underneath it
https://bugs.webkit.org/show_bug.cgi?id=183395
<rdar://problem/38055732>

Reviewed by Zalan Bujtas.

Source/WebCore:

In the case where a FrameSelection updates its appearance when m_appearanceUpdateTimer is fired, the
FrameSelection's Frame is unprotected, and can be removed by arbitrary script. This patch applies a simple
mitigation by wrapping the Frame in a Ref when firing the appearance update timer.

Test: editing/selection/iframe-update-selection-appearance.html

* editing/FrameSelection.cpp:
(WebCore::FrameSelection::appearanceUpdateTimerFired):

LayoutTests:

Add a new layout test that passes if we didn't crash.

* editing/selection/iframe-update-selection-appearance-expected.txt: Added.
* editing/selection/iframe-update-selection-appearance.html: Added.

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

3 years agoUnreviewed follow-up to r230468.
bfulgham@apple.com [Wed, 11 Apr 2018 02:49:10 +0000 (02:49 +0000)]
Unreviewed follow-up to r230468.

Switch some RELEASE_ASSERTs in hot codepaths to normal DEBUG asserts.

Source/WebCore:

* page/mac/EventHandlerMac.mm:
(WebCore::lastEventIsMouseUp):
(WebCore::EventHandler::sendFakeEventsAfterWidgetTracking):
* platform/mac/EventLoopMac.mm:
(WebCore::EventLoop::cycle):

Source/WebKit:

* UIProcess/mac/PageClientImplMac.mm:
(WebKit::PageClientImpl::isViewWindowActive):
(WebKit::PageClientImpl::setCursor):

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

3 years agoUnreviewed, fix the iOS build
wenson_hsieh@apple.com [Wed, 11 Apr 2018 02:46:09 +0000 (02:46 +0000)]
Unreviewed, fix the iOS build

I accidentally exported an inline function in r230506.

* page/ViewportConfiguration.h:
(WebCore::ViewportConfiguration::viewSize const):

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

3 years agoAX: Expose strong password fields on iOS
n_wang@apple.com [Wed, 11 Apr 2018 02:08:16 +0000 (02:08 +0000)]
AX: Expose strong password fields on iOS
https://bugs.webkit.org/show_bug.cgi?id=184465
<rdar://problem/39325104>

Reviewed by Chris Fleizach.

Source/WebCore:

Exposed the strong password field on iOS. And made sure
we are returning its actual value in accessibilityValue.

Test: accessibility/ios-simulator/strong-password-field.html

* accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
(-[WebAccessibilityObjectWrapper _accessibilityIsStrongPasswordField]):
(-[WebAccessibilityObjectWrapper accessibilityValue]):

Tools:

* DumpRenderTree/ios/AccessibilityUIElementIOS.mm:
(AccessibilityUIElement::boolAttributeValue):
* WebKitTestRunner/InjectedBundle/ios/AccessibilityUIElementIOS.mm:
(WTR::AccessibilityUIElement::boolAttributeValue):

LayoutTests:

* accessibility/ios-simulator/strong-password-field-expected.txt: Added.
* accessibility/ios-simulator/strong-password-field.html: Added.

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

3 years ago[Win] Add UserAgentWin.cpp
Hironori.Fujii@sony.com [Wed, 11 Apr 2018 01:52:40 +0000 (01:52 +0000)]
[Win] Add UserAgentWin.cpp
https://bugs.webkit.org/show_bug.cgi?id=184438

Reviewed by Michael Catanzaro.

Source/WebCore:

No new tests (No behavior change).

* PlatformWin.cmake:
* platform/win/UserAgentWin.cpp: Added.
(WebCore::standardUserAgent):
(WebCore::standardUserAgentForURL):

Source/WebKit:

* WebProcess/WebPage/win/WebPageWin.cpp:
(WebKit::WebPage::platformUserAgent const):
Use WebCore::standardUserAgentForURL.

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

3 years agoRemove block selection code
megan_gardner@apple.com [Wed, 11 Apr 2018 01:26:30 +0000 (01:26 +0000)]
Remove block selection code
https://bugs.webkit.org/show_bug.cgi?id=184470

Reviewed by Timothy Hatcher.

Remove block selection code that isn't run and is currently not even used.
Had to put this back in for a bug in the mid-year release, but we're past that
so it's time for this to go away.

* Platform/spi/ios/UIKitSPI.h:
* UIProcess/PageClient.h:
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* UIProcess/ios/PageClientImplIOS.h:
* UIProcess/ios/PageClientImplIOS.mm:
(WebKit::PageClientImpl::stopAssistingNode):
(WebKit::PageClientImpl::didUpdateBlockSelectionWithTouch): Deleted.
* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(toSelectionHandlePosition): Deleted.
(-[WKContentView _didUpdateBlockSelectionWithTouch:withFlags:growThreshold:shrinkThreshold:]): Deleted.
(-[WKContentView changeSelectionWithTouchAt:withSelectionTouch:baseIsStart:]): Deleted.
(-[WKContentView changeBlockSelectionWithTouchAt:withSelectionTouch:forHandle:]): Deleted.
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::saveImageToLibrary):
(WebKit::WebPageProxy::updateBlockSelectionWithTouch): Deleted.
(WebKit::WebPageProxy::didUpdateBlockSelectionWithTouch): Deleted.
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::rangeAtWordBoundaryForPosition):
(WebKit::distanceBetweenRectsForPosition): Deleted.
(WebKit::rectsEssentiallyTheSame): Deleted.
(WebKit::unionDOMRanges): Deleted.
(WebKit::computeEdgeCenter): Deleted.
(WebKit::WebPage::expandedRangeFromHandle): Deleted.
(WebKit::WebPage::contractedRangeFromHandle): Deleted.
(WebKit::WebPage::computeExpandAndShrinkThresholdsForHandle): Deleted.
(WebKit::WebPage::rangeForBlockAtPoint): Deleted.
(WebKit::shouldExpand): Deleted.
(WebKit::WebPage::changeBlockSelection): Deleted.
(WebKit::WebPage::updateBlockSelectionWithTouch): Deleted.

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

3 years agoMark legacy-animation-engine/compositing tests as failures on Windows.
pvollan@apple.com [Wed, 11 Apr 2018 01:25:03 +0000 (01:25 +0000)]
Mark legacy-animation-engine/compositing tests as failures on Windows.
https://bugs.webkit.org/show_bug.cgi?id=184482

Unreviewed test gardening.

* platform/win/TestExpectations:

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

3 years ago[Extra zoom mode] Add a mechanism to zoom to fixed scales when double tapping in...
wenson_hsieh@apple.com [Wed, 11 Apr 2018 01:02:53 +0000 (01:02 +0000)]
[Extra zoom mode] Add a mechanism to zoom to fixed scales when double tapping in extra zoom mode
https://bugs.webkit.org/show_bug.cgi?id=184435
<rdar://problem/38726260>

Reviewed by Dean Jackson.

Source/WebCore:

Expose the size of the platform view. By default, in extra zoom mode, this *not* the same as the minimum layout
size, since we lay out at a large width and then shrink down to real device dimensions when computing the
initial scale (see r229063).

ViewGestureGeometryCollector uses this in the process of computing a target zoom scale when double tapping.

* page/ViewportConfiguration.h:
(WebCore::ViewportConfiguration::viewSize const):

Source/WebKit:

Adds support for an alternate codepath when computing a zoom rect when double tapping that doesn't take the hit-
tested node into account, and instead cycles the zoom scale between 2 fixed values (in addition to the initial
scale). In the next patch, these fixed scales will be determined by computing zoom scales needed to make most of
the text on the page legible (i.e. the first text legibility zoom scale), and another to make all of the text on
the page legible, with the exception of outliers (this is the second text legibility zoom scale).

See comments below for more detail.

* UIProcess/Cocoa/ViewGestureController.h:
* UIProcess/Cocoa/ViewGestureController.messages.in:
* UIProcess/ios/SmartMagnificationController.h:
* UIProcess/ios/SmartMagnificationController.messages.in:
* UIProcess/ios/SmartMagnificationController.mm:
(WebKit::SmartMagnificationController::didCollectGeometryForSmartMagnificationGesture):
* UIProcess/mac/ViewGestureControllerMac.mm:
(WebKit::ViewGestureController::didCollectGeometryForSmartMagnificationGesture):
* WebProcess/WebPage/ViewGestureGeometryCollector.cpp:
(WebKit::ViewGestureGeometryCollector::dispatchDidCollectGeometryForSmartMagnificationGesture):

Rename the boolean `isReplacedElement` argument to `fitEntireRect` instead. The UI process only uses this on iOS
to determine whether or not to fit the entire element rect to the viewport and add padding. This patch renames
this variable because we are not zooming to a replaced element in the case where text legibility on the page
(rather than element geometry) is being used to figure out the zoom scale, but we still want to fit the entire
target rect to the viewport.

(WebKit::ViewGestureGeometryCollector::collectGeometryForSmartMagnificationGesture):

If text legiblity zoom scaling is preferred, then compute first and second-level text legibility zoom scales to
zoom to upon double tap (where the second zoom scale is greater than the first). To choose a target zoom
scale, choose the lowest target zoom scale that is at least a small amount less than the current scale. If
neither of the two scales fulfill this description, then zoom back out to the initial scale. This has the effect
of consistently cycling between all three zoom scales as the user double taps.

(WebKit::ViewGestureGeometryCollector::computeTextLegibilityScales):

Introduce a new helper method that computes and caches target scales to zoom to when double tapping to zoom. If
a cached pair of target scales is already present, it skips this computation and immediately returns it.

(WebKit::ViewGestureGeometryCollector::computeZoomInformationForNode):
(WebKit::ViewGestureGeometryCollector::computeMinimumAndMaximumViewportScales const):

Factor out logic to compute min and max zoom scales into a separate helper, and call it from both
computeZoomInformationForNode and computeTextLegibilityScales.

(WebKit::ViewGestureGeometryCollector::mainFrameDidLayout):

Invalidate cached text legibility scales when layout is triggered.

* WebProcess/WebPage/ViewGestureGeometryCollector.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::mainFrameDidLayout):
* WebProcess/WebPage/WebPage.h:
(WebKit::WebPage::viewportConfiguration const):

Expose WebPage's ViewportConfiguration as a const reference.

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

Adds a platform hook for opting into text-legibility-based zoom scaling instead of regular hit-testing-based
zoom scaling heuristics.

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

3 years agoFix availability annotations for _WKAttachment SPI
wenson_hsieh@apple.com [Wed, 11 Apr 2018 00:41:09 +0000 (00:41 +0000)]
Fix availability annotations for _WKAttachment SPI
https://bugs.webkit.org/show_bug.cgi?id=184473
<rdar://problem/39319732>

Reviewed by Dan Bernstein.

_WKAttachmentInfo is available in WK_MAC_TBA and WK_IOS_TBA, but the SPI method -[_WKAttachment requestInfo:]
is currently available in macOS 10.13.4 and iOS 11.3. Instead, the availability of this SPI should match the
availability of the SPI object it depends on.

* UIProcess/API/Cocoa/_WKAttachment.h:

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

3 years ago[Win][WebKit] LibWebRTCProvider::webRTCAvailable is an undefined symbol
Hironori.Fujii@sony.com [Wed, 11 Apr 2018 00:39:59 +0000 (00:39 +0000)]
[Win][WebKit] LibWebRTCProvider::webRTCAvailable is an undefined symbol
https://bugs.webkit.org/show_bug.cgi?id=184437

Reviewed by Michael Catanzaro.

No new tests (No behavior change).

* PlatformWin.cmake: Added LibWebRTCProviderWin.cpp.
* platform/mediastream/libwebrtc/LibWebRTCProviderWin.cpp: Added.
(WebCore::LibWebRTCProvider::webRTCAvailable):

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

3 years agoMark legacy-animation-engine/animations/animation-callback-timestamp.html as flaky.
ryanhaddad@apple.com [Tue, 10 Apr 2018 23:42:03 +0000 (23:42 +0000)]
Mark legacy-animation-engine/animations/animation-callback-timestamp.html as flaky.
https://bugs.webkit.org/show_bug.cgi?id=184459

Unreviewed test gardening.

* platform/mac/TestExpectations:

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

3 years agoUnreviewed build fix.
cdumez@apple.com [Tue, 10 Apr 2018 23:38:29 +0000 (23:38 +0000)]
Unreviewed build fix.

Those enum value names were too generic and would cause conflicts.

* Modules/webvr/VRDisplayCapabilities.h:
(WebCore::VRDisplayCapabilities::hasPosition const):
(WebCore::VRDisplayCapabilities::hasOrientation const):
(WebCore::VRDisplayCapabilities::hasExternalDisplay const):
(WebCore::VRDisplayCapabilities::canPresent const):
* platform/vr/VRPlatformDisplay.h:
* platform/vr/openvr/VRPlatformDisplayOpenVR.cpp:
(WebCore::VRPlatformDisplayOpenVR::VRPlatformDisplayOpenVR):

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

3 years agobmalloc should do partial scavenges more frequently
sbarati@apple.com [Tue, 10 Apr 2018 23:34:42 +0000 (23:34 +0000)]
bmalloc should do partial scavenges more frequently
https://bugs.webkit.org/show_bug.cgi?id=184176

Reviewed by Filip Pizlo.

This patch adds the ability for bmalloc to do a partial scavenge.
bmalloc will now do a partial scavenge with some frequency even
when the heap is growing.

For Heap, this means tracking the high water mark of where the Heap
has allocated since the last scavenge. Partial scavenging is just
decommitting entries in the LargeMap that are past this high water
mark. Because we allocate in first fit order out of LargeMap, tracking
the high water mark is a good heuristic of how much memory a partial
scavenge should decommit.

For IsoHeaps, each IsoDirectory also keeps track of its high water mark
for the furthest page it allocates into. Similar to Heap, we scavenge pages
past that high water mark. IsoHeapImpl then tracks the high water mark
for the IsoDirectory it allocates into. We then scavenge all directories
including and past the directory high water mark. This includes scavenging
the inline directory when its the only thing we allocate out of since
the last scavenge.

This patch also adds some other capabilities to bmalloc:

Heaps and IsoHeaps now track how much memory is freeable. Querying
this number is now cheap.

Heaps no longer hold the global lock when decommitting large ranges.
Instead, that range is just marked as non eligible to be allocated.
Then, without the lock held, the scavenger will decommit those ranges.
Once this is done, the scavenger will then reacquire the lock and mark
these ranges as eligible. This lessens lock contention between the
scavenger and the allocation slow path since threads that are taking an
allocation slow path can now allocate concurrently to the scavenger's
decommits. The main consideration in adding this functionality is that
a large allocation may fail while the scavenger is in the process of
decommitting memory. When the Heap fails to allocate a large range when
the scavenger is in the middle of a decommit, Heap will wait for the
Scavenger to finish and then it will try to allocate a large range again.

Decommitting from Heap now aggregates the ranges to decommit and tries to
merge them together to lower the number of calls to vmDeallocatePhysicalPages.
This is analogous to what IsoHeaps already do.

* bmalloc.xcodeproj/project.pbxproj:
* bmalloc/Allocator.cpp:
(bmalloc::Allocator::tryAllocate):
(bmalloc::Allocator::allocateImpl):
(bmalloc::Allocator::reallocate):
(bmalloc::Allocator::refillAllocatorSlowCase):
(bmalloc::Allocator::allocateLarge):
* bmalloc/BulkDecommit.h: Added.
(bmalloc::BulkDecommit::addEager):
(bmalloc::BulkDecommit::addLazy):
(bmalloc::BulkDecommit::processEager):
(bmalloc::BulkDecommit::processLazy):
(bmalloc::BulkDecommit::add):
(bmalloc::BulkDecommit::process):
* bmalloc/Deallocator.cpp:
(bmalloc::Deallocator::scavenge):
(bmalloc::Deallocator::processObjectLog):
(bmalloc::Deallocator::deallocateSlowCase):
* bmalloc/Deallocator.h:
(bmalloc::Deallocator::lineCache):
* bmalloc/Heap.cpp:
(bmalloc::Heap::freeableMemory):
(bmalloc::Heap::markAllLargeAsEligibile):
(bmalloc::Heap::decommitLargeRange):
(bmalloc::Heap::scavenge):
(bmalloc::Heap::scavengeToHighWatermark):
(bmalloc::Heap::deallocateLineCache):
(bmalloc::Heap::allocateSmallChunk):
(bmalloc::Heap::deallocateSmallChunk):
(bmalloc::Heap::allocateSmallPage):
(bmalloc::Heap::deallocateSmallLine):
(bmalloc::Heap::allocateSmallBumpRangesByMetadata):
(bmalloc::Heap::allocateSmallBumpRangesByObject):
(bmalloc::Heap::splitAndAllocate):
(bmalloc::Heap::tryAllocateLarge):
(bmalloc::Heap::allocateLarge):
(bmalloc::Heap::isLarge):
(bmalloc::Heap::largeSize):
(bmalloc::Heap::shrinkLarge):
(bmalloc::Heap::deallocateLarge):
(bmalloc::Heap::externalCommit):
(bmalloc::Heap::externalDecommit):
* bmalloc/Heap.h:
(bmalloc::Heap::allocateSmallBumpRanges):
(bmalloc::Heap::derefSmallLine):
* bmalloc/IsoDirectory.h:
* bmalloc/IsoDirectoryInlines.h:
(bmalloc::passedNumPages>::takeFirstEligible):
(bmalloc::passedNumPages>::didBecome):
(bmalloc::passedNumPages>::didDecommit):
(bmalloc::passedNumPages>::scavengePage):
(bmalloc::passedNumPages>::scavenge):
(bmalloc::passedNumPages>::scavengeToHighWatermark):
(bmalloc::passedNumPages>::freeableMemory): Deleted.
* bmalloc/IsoHeapImpl.h:
* bmalloc/IsoHeapImplInlines.h:
(bmalloc::IsoHeapImpl<Config>::takeFirstEligible):
(bmalloc::IsoHeapImpl<Config>::scavenge):
(bmalloc::IsoHeapImpl<Config>::scavengeToHighWatermark):
(bmalloc::IsoHeapImpl<Config>::freeableMemory):
(bmalloc::IsoHeapImpl<Config>::isNowFreeable):
(bmalloc::IsoHeapImpl<Config>::isNoLongerFreeable):
* bmalloc/LargeMap.cpp:
(bmalloc::LargeMap::remove):
(bmalloc::LargeMap::markAllAsEligibile):
* bmalloc/LargeMap.h:
(bmalloc::LargeMap::size):
(bmalloc::LargeMap::at):
* bmalloc/LargeRange.h:
(bmalloc::LargeRange::setEligible):
(bmalloc::LargeRange::isEligibile const):
(bmalloc::canMerge):
* bmalloc/ObjectType.cpp:
(bmalloc::objectType):
* bmalloc/Scavenger.cpp:
(bmalloc::PrintTime::PrintTime):
(bmalloc::PrintTime::~PrintTime):
(bmalloc::PrintTime::print):
(bmalloc::Scavenger::timeSinceLastFullScavenge):
(bmalloc::Scavenger::timeSinceLastPartialScavenge):
(bmalloc::Scavenger::scavenge):
(bmalloc::Scavenger::partialScavenge):
(bmalloc::Scavenger::freeableMemory):
(bmalloc::Scavenger::threadRunLoop):
* bmalloc/Scavenger.h:
* bmalloc/SmallLine.h:
(bmalloc::SmallLine::refCount):
(bmalloc::SmallLine::ref):
(bmalloc::SmallLine::deref):
* bmalloc/SmallPage.h:
(bmalloc::SmallPage::refCount):
(bmalloc::SmallPage::hasFreeLines const):
(bmalloc::SmallPage::setHasFreeLines):
(bmalloc::SmallPage::ref):
(bmalloc::SmallPage::deref):
* bmalloc/bmalloc.cpp:
(bmalloc::api::tryLargeZeroedMemalignVirtual):
(bmalloc::api::freeLargeVirtual):

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

3 years agoAvoid constructing a service worker RegistrationStore for private sessions
cdumez@apple.com [Tue, 10 Apr 2018 23:19:53 +0000 (23:19 +0000)]
Avoid constructing a service worker RegistrationStore for private sessions
https://bugs.webkit.org/show_bug.cgi?id=184463
<rdar://problem/36613948>

Reviewed by Youenn Fablet.

Avoid constructing a service worker RegistrationStore for private sessions since there
is no need for persistence and the registrationDatabaseDirectory is the empty string in
such cases.

Source/WebCore:

* workers/service/server/SWServer.cpp:
(WebCore::SWServer::removeRegistration):
(WebCore::SWServer::clearAll):
(WebCore::SWServer::clear):
(WebCore::SWServer::SWServer):
(WebCore::SWServer::didFinishActivation):
* workers/service/server/SWServer.h:

Source/WebKit:

* StorageProcess/StorageProcess.cpp:
(WebKit::StorageProcess::initializeWebsiteDataStore):

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

3 years agohttp/tests/security/shape-image-cors-redirect-error-message-logging-*.html tests...
krollin@apple.com [Tue, 10 Apr 2018 23:06:05 +0000 (23:06 +0000)]
http/tests/security/shape-image-cors-redirect-error-message-logging-*.html tests are flaky
https://bugs.webkit.org/show_bug.cgi?id=155634
<rdar://problem/39326489>

Reviewed by Youenn Fablet.

These tests no longer appear to be flaky. I believe they were
addressed in <https://trac.webkit.org/changeset/217069/webkit>. After
enabling the test and rebasing the results, I ran run-webkit-tests
with --repeat-each=20 --iterations=20, and then I wrapped the
run-webkit-tests command in a loop that invoked it 20 times.

* TestExpectations:
* http/tests/security/shape-image-cors-redirect-error-message-logging-1-expected.txt:
* http/tests/security/shape-image-cors-redirect-error-message-logging-2-expected.txt:
* http/tests/security/shape-image-cors-redirect-error-message-logging-3-expected.txt:
* http/tests/security/shape-image-cors-redirect-error-message-logging-4-expected.txt:

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

3 years agoUnreviewed build fix.
cdumez@apple.com [Tue, 10 Apr 2018 22:48:49 +0000 (22:48 +0000)]
Unreviewed build fix.

* page/LayoutContext.cpp:
(WebCore::LayoutContext::~LayoutContext):
* page/LayoutContext.h:

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

3 years ago[iOS] Navigate to URL and page number annotations in WKPDFView
aestes@apple.com [Tue, 10 Apr 2018 22:35:46 +0000 (22:35 +0000)]
[iOS] Navigate to URL and page number annotations in WKPDFView
https://bugs.webkit.org/show_bug.cgi?id=184410

Reviewed by Timothy Hatcher.

Implemented navigation to URL and page number (same-document) link annotations in PDFs.

* UIProcess/ios/WKPDFView.mm:
(-[WKPDFView _scrollToURLFragment:]):
(-[WKPDFView web_didSameDocumentNavigation:]):
(-[WKPDFView pdfHostViewController:updatePageCount:]):
(-[WKPDFView pdfHostViewController:goToURL:]):
(-[WKPDFView pdfHostViewController:goToPageIndex:withViewFrustum:]):

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

3 years ago[iOS] WKPDFView should conform to _WKWebViewPrintProvider
aestes@apple.com [Tue, 10 Apr 2018 22:26:45 +0000 (22:26 +0000)]
[iOS] WKPDFView should conform to _WKWebViewPrintProvider
https://bugs.webkit.org/show_bug.cgi?id=184471

Reviewed by Dan Bernstein.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _printProvider]):

The print provider will always be either _contentView or _customContentView, but
might not be _currentContentView.

* UIProcess/ios/WKPDFView.mm:
(-[WKPDFView _wk_pageCountForPrintFormatter:]):

Asked _hostViewController for the page count, clamped to 1 if
-[_WKWebViewPrintFormatter snapshotFirstPage] is YES.

(-[WKPDFView _wk_printedDocument]):

Created a CGPDFDocumentRef from _data and returned it.

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

3 years agoBeacon redirect responses should be CORS validated
youenn@apple.com [Tue, 10 Apr 2018 22:16:27 +0000 (22:16 +0000)]
Beacon redirect responses should be CORS validated
https://bugs.webkit.org/show_bug.cgi?id=184378

Reviewed by Chris Dumez.

Source/WebKit:

Add CORS checks to any redirection response if mode is CORS.
Update response tainting and redirected accordingly.

* NetworkProcess/NetworkLoadChecker.cpp:
(WebKit::NetworkLoadChecker::checkRedirection):
(WebKit::NetworkLoadChecker::validateResponse):
* NetworkProcess/NetworkLoadChecker.h:
* NetworkProcess/PingLoad.cpp:
(WebKit::PingLoad::willPerformHTTPRedirection):

LayoutTests:

* TestExpectations:
* http/wpt/beacon/cors/cors-redirect-failure-expected.txt: Added.
* http/wpt/beacon/cors/cors-redirect-failure.html: Added.
* http/wpt/beacon/resources/redirect.py:
(main):

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

3 years agoUnreviewed, fix cloop build.
fpizlo@apple.com [Tue, 10 Apr 2018 21:16:21 +0000 (21:16 +0000)]
Unreviewed, fix cloop build.

* dfg/DFGAbstractInterpreterClobberState.cpp:

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

3 years agowebrtc/datachannel/bufferedAmountLowThreshold tests are failing on WK1
youenn@apple.com [Tue, 10 Apr 2018 21:13:55 +0000 (21:13 +0000)]
webrtc/datachannel/bufferedAmountLowThreshold tests are failing on WK1
https://bugs.webkit.org/show_bug.cgi?id=184427

Reviewed by Eric Carlson.

Decrease the size of the string sent as one chunk as it may create timeouts.
Instead, we will call more often the send method untile reaching the threshold.

* platform/mac-wk1/TestExpectations:
* webrtc/datachannel/bufferedAmountLowThreshold-default.html:
* webrtc/datachannel/bufferedAmountLowThreshold.html:

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

3 years agowebrtc/datachannel/basic-tcp.html will crash with an invalid crash
youenn@apple.com [Tue, 10 Apr 2018 21:13:14 +0000 (21:13 +0000)]
webrtc/datachannel/basic-tcp.html will crash with an invalid crash
https://bugs.webkit.org/show_bug.cgi?id=178285
<rdar://problem/34985374>

Reviewed by Eric Carlson.

Disable SIGPIPE for WebRTC sockets on Mac as well.

* Source/webrtc/rtc_base/physicalsocketserver.cc:
* WebKit/0001-Disable-SIGPIPE-for-WebRTC-sockets.patch: Added.

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

3 years agoMake the ASSERT in MarkedSpace::sizeClassToIndex() a RELEASE_ASSERT.
mark.lam@apple.com [Tue, 10 Apr 2018 20:58:57 +0000 (20:58 +0000)]
Make the ASSERT in MarkedSpace::sizeClassToIndex() a RELEASE_ASSERT.
https://bugs.webkit.org/show_bug.cgi?id=184464
<rdar://problem/39323947>

Reviewed by Saam Barati.

* heap/MarkedSpace.h:
(JSC::MarkedSpace::sizeClassToIndex):

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

3 years agoMediaSessionManageriOS should defer creation of MPVolumeView until it needs to monito...
commit-queue@webkit.org [Tue, 10 Apr 2018 20:31:01 +0000 (20:31 +0000)]
MediaSessionManageriOS should defer creation of MPVolumeView until it needs to monitor AirPlay routes
https://bugs.webkit.org/show_bug.cgi?id=184373
<rdar://problem/35177606>

Patch by Jeremy Jones <jeremyj@apple.com> on 2018-04-10
Reviewed by Eric Carlson.

No change of behavior.

This delays the creation of MPVolumeView until airplay routes are monitored.
MPVolumeView is now also released when monitoring ends.
This makes sure the MP* objects are only accessed from a UI safe thread. WebCore's "MainThread" may be different that the UI thread.
Since this state change is necessarily asynchronous, starting and stopping must prevent races to keep state coherent.

* platform/audio/ios/MediaSessionManagerIOS.mm:
(-[WebMediaSessionHelper initWithCallback:]):
(-[WebMediaSessionHelper dealloc]):
(-[WebMediaSessionHelper startMonitoringAirPlayRoutes]):
(-[WebMediaSessionHelper stopMonitoringAirPlayRoutes]):
(-[WebMediaSessionHelper allocateVolumeView]): Deleted.
(-[WebMediaSessionHelper setVolumeView:]): Deleted.

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

3 years agoLoading of multipart response was cancelled because of content policy set in WebFrame...
commit-queue@webkit.org [Tue, 10 Apr 2018 19:46:40 +0000 (19:46 +0000)]
Loading of multipart response was cancelled because of content policy set in WebFrameLoaderClient::dispatchDecidePolicyForResponse
https://bugs.webkit.org/show_bug.cgi?id=184268
<rdar://problem/39144446>

Patch by Sihui Liu <sihui_liu@apple.com> on 2018-04-10
Reviewed by Chris Dumez.

Source/WebCore:

The assertion is no longer true after the change, because multiple resources could have same
url. Used if condition here to make sure we only delete specified resource.

No new tests. Updated an existing test to test the stop loading case by not using injected
bundle policy: http/tests/multipart/multipart-html.php.

* loader/cache/CachedResourceLoader.cpp:
(WebCore::CachedResourceLoader::removeCachedResource):

Source/WebKit:

Webpage for multipart stream responses failed to refresh because content policy was set to
be ignore when provisonalDocumentLoader was null and navigation ID could not be retrieved.
As loading should not stop in this case, we set navigation ID 0 and still ask for content
policy.

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

LayoutTests:

* http/tests/multipart/multipart-html-expected.txt:
* http/tests/multipart/multipart-html.php:

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

3 years agoDFG AI and clobberize should agree with each other
fpizlo@apple.com [Tue, 10 Apr 2018 19:45:54 +0000 (19:45 +0000)]
DFG AI and clobberize should agree with each other
https://bugs.webkit.org/show_bug.cgi?id=184440

Reviewed by Saam Barati.

JSTests:

Add tests for all of the bugs I fixed.

* stress/direct-arguments-out-of-bounds-change-structure.js: Added.
(foo):
* stress/new-typed-array-cse-effects.js: Added.
(foo):
* stress/scoped-arguments-out-of-bounds-change-structure.js: Added.
(foo.theO):
(foo):
* stress/string-from-char-code-change-structure-not-dead.js: Added.
(foo):
(i.valueOf):
(weirdValue.valueOf):
* stress/string-from-char-code-change-structure.js: Added.
(foo):
(i.valueOf):
(weirdValue.valueOf):

Source/JavaScriptCore:

One way to fix bugs involving underapproximation in AI or clobberize is to assert that they
agree with each other. That's what this patch does: it adds an assertion that AI's structure
state tracking must be equivalent to JSCell_structureID being clobbered.

One subtlety is that AI sometimes folds away structure clobbering using information that
clobberize doesn't have. So, we track this wuth special kinds of AI states (FoldedClobber and
ObservedTransitions).

This fixes a bunch of cases of AI missing clobberStructures/clobberWorld and one case of
clobberize missing a write(Heap).

This also makes some cases more precise in order to appease the assertion. Making things more
precise might make things faster, but I didn't measure it because that wasn't the goal.

* JavaScriptCore.xcodeproj/project.pbxproj:
* Sources.txt:
* dfg/DFGAbstractInterpreter.h:
* dfg/DFGAbstractInterpreterClobberState.cpp: Added.
(WTF::printInternal):
* dfg/DFGAbstractInterpreterClobberState.h: Added.
(JSC::DFG::mergeClobberStates):
* dfg/DFGAbstractInterpreterInlines.h:
(JSC::DFG::AbstractInterpreter<AbstractStateType>::startExecuting):
(JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects):
(JSC::DFG::AbstractInterpreter<AbstractStateType>::didFoldClobberWorld):
(JSC::DFG::AbstractInterpreter<AbstractStateType>::clobberStructures):
(JSC::DFG::AbstractInterpreter<AbstractStateType>::didFoldClobberStructures):
(JSC::DFG::AbstractInterpreter<AbstractStateType>::observeTransition):
(JSC::DFG::AbstractInterpreter<AbstractStateType>::observeTransitions):
(JSC::DFG::AbstractInterpreter<AbstractStateType>::setDidClobber): Deleted.
* dfg/DFGAtTailAbstractState.h:
(JSC::DFG::AtTailAbstractState::setClobberState):
(JSC::DFG::AtTailAbstractState::mergeClobberState):
(JSC::DFG::AtTailAbstractState::setDidClobber): Deleted.
* dfg/DFGCFAPhase.cpp:
(JSC::DFG::CFAPhase::performBlockCFA):
* dfg/DFGClobberSet.cpp:
(JSC::DFG::writeSet):
* dfg/DFGClobberSet.h:
* dfg/DFGClobberize.h:
(JSC::DFG::clobberize):
* dfg/DFGConstantFoldingPhase.cpp:
(JSC::DFG::ConstantFoldingPhase::foldConstants):
* dfg/DFGInPlaceAbstractState.h:
(JSC::DFG::InPlaceAbstractState::clobberState const):
(JSC::DFG::InPlaceAbstractState::didClobberOrFolded const):
(JSC::DFG::InPlaceAbstractState::didClobber const):
(JSC::DFG::InPlaceAbstractState::setClobberState):
(JSC::DFG::InPlaceAbstractState::mergeClobberState):
(JSC::DFG::InPlaceAbstractState::setDidClobber): Deleted.

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

3 years ago[iOS] Use PDFKit to render PDFs in WKWebView
aestes@apple.com [Tue, 10 Apr 2018 19:42:35 +0000 (19:42 +0000)]
[iOS] Use PDFKit to render PDFs in WKWebView
https://bugs.webkit.org/show_bug.cgi?id=184387

Reviewed by Beth Dakin.

Source/WebKit:

Adopted PDFHostViewController for rendering PDFs in WKWebView.

This patch implements rendering the PDF document and page number indicator. Link
navigation, find-in-page, and printing will be implemented in follow-up patches.

WKLegacyPDFView is still the default PDF view.

* Configurations/WebKit.xcconfig:

Linked WebKit with PDFKit on iOS.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _currentContentView]):
(-[WKWebView viewForZoomingInScrollView:]):

When WKPDFView loads a PDF document, it replaces itself with a view vended by
PDFHostViewController as the WKScrollView's content view. Abstracted WKWebView's
concept of the "current content view" to be either the WKContentView or a view of
the custom content view's choosing (-web_contentView).

(-[WKWebView scrollViewWillBeginZooming:withView:]):
(-[WKWebView scrollViewDidZoom:]):
(-[WKWebView scrollViewDidEndZooming:withView:atScale:]):

Forwarded these calls to _customContentView if it responds to the equivalent
WKWebViewContentProvider selectors.

* UIProcess/Cocoa/WKWebViewContentProvider.h:

Defined new protocol selectors.

* UIProcess/Cocoa/WKWebViewContentProviderRegistry.mm:
(-[WKWebViewContentProviderRegistry init]):
* UIProcess/ios/WKLegacyPDFView.h:
* UIProcess/ios/WKLegacyPDFView.mm:

Changed ENABLE(WKPDFVIEW) to ENABLE(WKLEGACYPDFVIEW).

(-[WKLegacyPDFView web_contentView]):

Added. Returns self as the content view.

* UIProcess/ios/WKPDFView.h: Added.
* UIProcess/ios/WKPDFView.mm: Added.
(-[WKPDFView dealloc]):

Removed the host view and page number indicator from their superviews.

(-[WKPDFView gestureRecognizerShouldBegin:]):

Forwarded to _hostViewController.

(-[WKPDFView web_initWithFrame:webView:]):

Set ours and the scroll view's background color to UIColor.grayColor to match
WKLegacyPDFView.

(-[WKPDFView web_setContentProviderData:suggestedFilename:]):

Created a PDFHostViewController and set its root view as the scroll view's content
view after removing the WKPDFView itself. This allows WKPDFView to act as a
placeholder content view until the PDF is loaded. Added the host view controller's
page number indicator to the fixed overlay view. Finally, loaded the PDF document
by calling -[PDFHostViewController setDocumentData:withScrollView:].

(-[WKPDFView _offsetForPageNumberIndicator]):

Computed an offset for the page number indicator like WKLegacyPDFView did, taking
into account the overlaid accessory views inset, computed unobscured safe area
inset, and computed obscured inset.

(-[WKPDFView _movePageNumberIndicatorToPoint:animated:]):

Moved the page number indicator using the margin and animation duration from
WKLegacyPDFView.

(-[WKPDFView _updateLayoutAnimated:]):

Added a convenience method to update the PDF view layout and position the page
number indicator.

(-[WKPDFView web_setMinimumSize:]):

Updated our own frame in case we are still the placeholder content view.
Called -_updateLayoutAnimated:.

(-[WKPDFView web_setOverlaidAccessoryViewsInset:]):

Stored the inset and called -_updateLayoutAnimated:.

(-[WKPDFView web_computedContentInsetDidChange]):

Called -_updateLayoutAnimated:.

(-[WKPDFView web_setFixedOverlayView:]):

Stored the fixed overlay view.

(-[WKPDFView web_didSameDocumentNavigation:]):
(-[WKPDFView web_countStringMatches:options:maxCount:]):
(-[WKPDFView web_findString:options:maxCount:]):
(-[WKPDFView web_hideFindUI]):

Added FIXMEs.

(-[WKPDFView web_contentView]):

If there is a host view controller, return its root view. Otherwise, return self.

(-[WKPDFView web_scrollViewDidScroll:]):
(-[WKPDFView web_scrollViewWillBeginZooming:withView:]):
(-[WKPDFView web_scrollViewDidEndZooming:withView:atScale:]):
(-[WKPDFView web_scrollViewDidZoom:]):

Called -[PDFHostViewController updatePDFViewLayout].

(-[WKPDFView web_dataRepresentation]):

Returned _data.

(-[WKPDFView web_suggestedFilename]):

Returned _suggestedFilename.

(-[WKPDFView web_isBackground]):

Returned self.isBackground.

* UIProcess/ios/WKSystemPreviewView.mm:
(-[WKSystemPreviewView web_contentView]):

Added. Returns self as the content view.

* WebKit.xcodeproj/project.pbxproj:

Source/WTF:

* wtf/FeatureDefines.h: Defined ENABLE_WKLEGACYPDFVIEW and ENABLE_WKPDFVIEW.

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

3 years agoExecutableToCodeBlockEdge::visitChildren() should be cool with m_codeBlock being...
fpizlo@apple.com [Tue, 10 Apr 2018 18:04:07 +0000 (18:04 +0000)]
ExecutableToCodeBlockEdge::visitChildren() should be cool with m_codeBlock being null since we clear it in finalizeUnconditionally()
https://bugs.webkit.org/show_bug.cgi?id=184460
<rdar://problem/37610966>

Reviewed by Mark Lam.

* bytecode/ExecutableToCodeBlockEdge.cpp:
(JSC::ExecutableToCodeBlockEdge::visitChildren):

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

3 years agoREGRESSION(r227341 and r227742): AI and clobberize should be precise and consistent...
fpizlo@apple.com [Tue, 10 Apr 2018 17:57:29 +0000 (17:57 +0000)]
REGRESSION(r227341 and r227742): AI and clobberize should be precise and consistent about the effectfulness of CompareEq
https://bugs.webkit.org/show_bug.cgi?id=184455

Reviewed by Michael Saboff.

LICM is sort of an assertion that AI is as precise as clobberize about effects. If clobberize
says that something is not effectful, then LICM will try to hoist it. But LICM's AI hack
(AtTailAbstractState) cannot handle hoisting of things that have effects. So, if AI thinks that
the thing being hoisted does have effects, then we get a crash.

In r227341, we incorrectly told AI that CompareEq(Untyped:, _) is effectful. In fact, only
ComapreEq(Untyped:, Untyped:) is effectful, and clobberize knew this already. As a result, LICM
would blow up if we hoisted CompareEq(Untyped:, Other:), which clobberize knew wasn't
effectful.

Instead of fixing this by making AI precise, in r227742 we made matters worse by then breaking
clobberize to also think that CompareEq(Untyped:, _) is effectful.

This fixes the whole situation by teaching both clobberize and AI that the only effectful form
of CompareEq is ComapreEq(Untyped:, Untyped:).

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

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

3 years ago[LayoutReloaded] Add support for out-of-flow descendants in inline formatting context.
zalan@apple.com [Tue, 10 Apr 2018 17:21:50 +0000 (17:21 +0000)]
[LayoutReloaded] Add support for out-of-flow descendants in inline formatting context.
https://bugs.webkit.org/show_bug.cgi?id=184454

Reviewed by Antti Koivisto.

When the containing block of an out-of-flow positioned element establishes an inline formatting context.
This is mostly about moving out-of-flow logic from BlockFormattingContext to the base class.

* LayoutReloaded/FormattingContext/BlockFormatting/BlockFormattingContext.js:
(BlockFormattingContext.prototype._adjustBottomWithFIXME):
(BlockFormattingContext):
(BlockFormattingContext.prototype._layoutOutOfFlowDescendants): Deleted.
(BlockFormattingContext.prototype._computeOutOfFlowWidth): Deleted.
(BlockFormattingContext.prototype._computeInFlowWidth): Deleted.
(BlockFormattingContext.prototype._computeOutOfFlowHeight): Deleted.
(BlockFormattingContext.prototype._computeOutOfFlowPosition): Deleted.
(BlockFormattingContext.prototype._shrinkToFitWidth): Deleted.
* LayoutReloaded/FormattingContext/FormattingContext.js:
(FormattingContext.prototype._placeInFlowPositionedChildren):
(FormattingContext.prototype._computeInFlowWidth):
(FormattingContext.prototype._layoutOutOfFlowDescendants):
(FormattingContext.prototype._computeOutOfFlowWidth):
(FormattingContext.prototype._computeOutOfFlowHeight):
(FormattingContext.prototype._computeOutOfFlowPosition):
(FormattingContext.prototype._shrinkToFitWidth):
* LayoutReloaded/FormattingContext/InlineFormatting/InlineFormattingContext.js:
(InlineFormattingContext.prototype.layout):
(InlineFormattingContext.prototype._handleInlineContainer):
(InlineFormattingContext.prototype._handleInlineBlockContainer):
(InlineFormattingContext.prototype._placeOutOfFlowDescendants): Deleted.
* LayoutReloaded/test/index.html:
* LayoutReloaded/test/inline-with-out-of-flow-descendant.html: Added.

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