WebKit-https.git
16 months agoExpose aggressiveTileRetentionEnabled in WKPreferences SPI to match C SPI
jeffm@apple.com [Tue, 20 Mar 2018 21:21:06 +0000 (21:21 +0000)]
Expose aggressiveTileRetentionEnabled in WKPreferences SPI to match C SPI
https://bugs.webkit.org/show_bug.cgi?id=183790

Reviewed by Alex Christensen.

Expose this property on macOS only.

* UIProcess/API/Cocoa/WKPreferences.mm:
(-[WKPreferences _setAggressiveTileRetentionEnabled:]):
(-[WKPreferences _aggressiveTileRetentionEnabled]):
* UIProcess/API/Cocoa/WKPreferencesPrivate.h:

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

16 months agoMIPS+Armv7 builds are broken since r229391
guijemont@igalia.com [Tue, 20 Mar 2018 20:37:46 +0000 (20:37 +0000)]
MIPS+Armv7 builds are broken since r229391
https://bugs.webkit.org/show_bug.cgi?id=183474

Reviewed by Yusuke Suzuki.

Add missing armv7 and mips operations and fix arguments to a call to
operationGetByValCell. This should fix compilation on MIPS and Armv7
(though it does not implement the missing setupArguments stuff in
CCallHelpers).

* assembler/MacroAssembler.h:
* assembler/MacroAssemblerARMv7.h:
(JSC::MacroAssemblerARMv7::swap):
* assembler/MacroAssemblerMIPS.h:
(JSC::MacroAssemblerMIPS::swap):
* dfg/DFGSpeculativeJIT32_64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* jit/FPRInfo.h:

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

16 months ago[Web Animations] Update the timing model when pending tasks schedule changes
commit-queue@webkit.org [Tue, 20 Mar 2018 20:29:57 +0000 (20:29 +0000)]
[Web Animations] Update the timing model when pending tasks schedule changes
https://bugs.webkit.org/show_bug.cgi?id=183785

Patch by Antoine Quint <graouts@apple.com> on 2018-03-20
Reviewed by Dean Jackson.

LayoutTests/imported/w3c:

Record a progression now that we correctly invalidate effects as their pending play
or pause task schedule changes. Setting an animation's effect resets pending tasks.

* web-platform-tests/web-animations/interfaces/Animation/effect-expected.txt:

Source/WebCore:

Changing the time at which a pending play or pause task is scheduled changes the pending
state of the animation and thus should notify that the timing model has changed and invalidate
the effect.

* animation/WebAnimation.cpp:
(WebCore::WebAnimation::setTimeToRunPendingPlayTask):
(WebCore::WebAnimation::setTimeToRunPendingPauseTask):
(WebCore::WebAnimation::updatePendingTasks):

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

16 months agoSLEEP_THREAD_FOR_DEBUGGER should not use fancy number literals
bburg@apple.com [Tue, 20 Mar 2018 20:26:17 +0000 (20:26 +0000)]
SLEEP_THREAD_FOR_DEBUGGER should not use fancy number literals
https://bugs.webkit.org/show_bug.cgi?id=183792

Reviewed by Timothy Hatcher.

* wtf/DebugUtilities.h: Remove the '_s' since this won't
compile when included by files compiled as Objective-C++.

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

16 months agoAdd and adopt WK_PLATFORM_NAME and adjust default feature defines
timothy_horton@apple.com [Tue, 20 Mar 2018 18:18:37 +0000 (18:18 +0000)]
Add and adopt WK_PLATFORM_NAME and adjust default feature defines
https://bugs.webkit.org/show_bug.cgi?id=183758
<rdar://problem/38017644>

Reviewed by Dan Bernstein.

* .../Configurations/Base.xcconfig:
* .../Configurations/FeatureDefines.xcconfig:
* WebCore.xcodeproj/project.pbxproj:
* wtf/FeatureDefines.h:

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

16 months agoImprove FunctionPtr and use it in the JIT CallRecord.
mark.lam@apple.com [Tue, 20 Mar 2018 18:10:16 +0000 (18:10 +0000)]
Improve FunctionPtr and use it in the JIT CallRecord.
https://bugs.webkit.org/show_bug.cgi?id=183756
<rdar://problem/38641335>

Reviewed by JF Bastien.

1. FunctionPtr hold a C/C++ function pointer by default.  Change its default
   PtrTag to reflect that.

2. Delete the FunctionPtr::value() method.  It is effectively a duplicate of
   executableAddress().

3. Fix the FunctionPtr constructor that takes arbitrary pointers to be able to
   take "any" pointer.  "any" in this case means that the pointer may not be typed
   as a C/C++ function to the C++ compiler (due to upstream casting or usage of
   void* as a storage type), but it is still expected to be pointing to a C/C++
   function.

4. Added a FunctionPtr constructor that takes another FunctionPtr.  This is a
   convenience constructor that lets us retag the underlying pointer.  The other
   FunctionPtr is still expected to point to a C/C++ function.

5. Added PtrTag assertion placeholder functions to be implemented later.

6. Change the JIT CallRecord to embed a FunctionPtr callee instead of a void* to
   pointer.  This improves type safety, and assists in getting pointer tagging
   right later.

7. Added versions of JIT callOperations methods that will take a PtrTag.
   This is preparation for more more pointer tagging work later.

* assembler/MacroAssemblerARM.h:
(JSC::MacroAssemblerARM::linkCall):
* assembler/MacroAssemblerARMv7.h:
(JSC::MacroAssemblerARMv7::linkCall):
* assembler/MacroAssemblerCodeRef.h:
(JSC::FunctionPtr::FunctionPtr):
(JSC::FunctionPtr::operator bool const):
(JSC::FunctionPtr::operator! const):
(JSC::ReturnAddressPtr::ReturnAddressPtr):
(JSC::MacroAssemblerCodePtr::retagged const):
(JSC::MacroAssemblerCodeRef::retaggedCode const):
(JSC::FunctionPtr::value const): Deleted.
* assembler/MacroAssemblerMIPS.h:
(JSC::MacroAssemblerMIPS::linkCall):
* assembler/MacroAssemblerX86.h:
(JSC::MacroAssemblerX86::linkCall):
* assembler/MacroAssemblerX86_64.h:
(JSC::MacroAssemblerX86_64::callWithSlowPathReturnType):
(JSC::MacroAssemblerX86_64::linkCall):
* bytecode/AccessCase.cpp:
(JSC::AccessCase::generateImpl):
* ftl/FTLSlowPathCall.cpp:
(JSC::FTL::SlowPathCallContext::makeCall):
* ftl/FTLSlowPathCall.h:
(JSC::FTL::callOperation):
* ftl/FTLThunks.cpp:
(JSC::FTL::osrExitGenerationThunkGenerator):
(JSC::FTL::lazySlowPathGenerationThunkGenerator):
(JSC::FTL::slowPathCallThunkGenerator):
* jit/JIT.cpp:
(JSC::JIT::link):
(JSC::JIT::privateCompileExceptionHandlers):
* jit/JIT.h:
(JSC::CallRecord::CallRecord):
(JSC::JIT::appendCall):
(JSC::JIT::appendCallWithSlowPathReturnType):
(JSC::JIT::callOperation):
(JSC::JIT::callOperationWithProfile):
(JSC::JIT::callOperationWithResult):
(JSC::JIT::callOperationNoExceptionCheck):
(JSC::JIT::callOperationWithCallFrameRollbackOnException):
* jit/JITArithmetic.cpp:
(JSC::JIT::emitMathICFast):
(JSC::JIT::emitMathICSlow):
* jit/JITInlines.h:
(JSC::JIT::emitNakedCall):
(JSC::JIT::emitNakedTailCall):
(JSC::JIT::appendCallWithExceptionCheck):
(JSC::JIT::appendCallWithExceptionCheckAndSlowPathReturnType):
(JSC::JIT::appendCallWithCallFrameRollbackOnException):
(JSC::JIT::appendCallWithExceptionCheckSetJSValueResult):
(JSC::JIT::appendCallWithExceptionCheckSetJSValueResultWithProfile):
* jit/JITPropertyAccess.cpp:
(JSC::JIT::emitSlow_op_get_by_val):
(JSC::JIT::emitSlow_op_put_by_val):
(JSC::JIT::privateCompileGetByValWithCachedId):
(JSC::JIT::privateCompilePutByVal):
(JSC::JIT::privateCompilePutByValWithCachedId):
* jit/JITPropertyAccess32_64.cpp:
(JSC::JIT::emitSlow_op_put_by_val):
* jit/Repatch.cpp:
(JSC::linkPolymorphicCall):
* jit/SlowPathCall.h:
(JSC::JITSlowPathCall::JITSlowPathCall):
(JSC::JITSlowPathCall::call):
* jit/ThunkGenerators.cpp:
(JSC::nativeForGenerator):
* runtime/PtrTag.h:
(JSC::nextPtrTagID):
(JSC::assertIsCFunctionPtr):
(JSC::assertIsNullOrCFunctionPtr):
(JSC::assertIsNotTagged):
(JSC::assertIsTagged):
(JSC::assertIsNullOrTagged):
(JSC::assertIsTaggedWith):
(JSC::assertIsNullOrTaggedWith):
(JSC::uniquePtrTagID): Deleted.

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

16 months ago[MIPS] Optimize generated JIT code for loads/stores
commit-queue@webkit.org [Tue, 20 Mar 2018 17:53:59 +0000 (17:53 +0000)]
[MIPS] Optimize generated JIT code for loads/stores
https://bugs.webkit.org/show_bug.cgi?id=183243

Patch by Stanislav Ocovaj <stanislav.ocovaj@rt-rk.com> on 2018-03-20
Reviewed by Yusuke Suzuki.

JIT generates three MIPS instructions for a load/store from/to an absolute address:

  lui adrTmpReg, address >> 16
  ori adrTmpReg, address & 0xffff
  lw dataReg, 0(adrTmpReg)

Since load/store instructions on MIPS have a 16-bit offset, lower 16 bits of the address can
be encoded into the load/store and ori instruction can be removed:

  lui adrTmpReg, (address + 0x8000) >> 16
  lw dataReg, (address & 0xffff)(adrTmpReg)

Also, in loads/stores with BaseIndex address, the left shift can be omitted if address.scale is 0.

* assembler/MacroAssemblerMIPS.h:
(JSC::MacroAssemblerMIPS::add32):
(JSC::MacroAssemblerMIPS::add64):
(JSC::MacroAssemblerMIPS::or32):
(JSC::MacroAssemblerMIPS::sub32):
(JSC::MacroAssemblerMIPS::convertibleLoadPtr):
(JSC::MacroAssemblerMIPS::load8):
(JSC::MacroAssemblerMIPS::load8SignedExtendTo32):
(JSC::MacroAssemblerMIPS::load32):
(JSC::MacroAssemblerMIPS::store8):
(JSC::MacroAssemblerMIPS::store32):
(JSC::MacroAssemblerMIPS::branchTest8):
(JSC::MacroAssemblerMIPS::branchAdd32):
(JSC::MacroAssemblerMIPS::loadDouble):
(JSC::MacroAssemblerMIPS::storeDouble):

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

16 months agoUnreviewed, rolling out r229726 and r229763.
cdumez@apple.com [Tue, 20 Mar 2018 17:08:05 +0000 (17:08 +0000)]
Unreviewed, rolling out r229726 and r229763.

Caused some API test failures on iOS

Reverted changesets:

"Make policy decisions asynchronous"
https://bugs.webkit.org/show_bug.cgi?id=180568
https://trac.webkit.org/changeset/229726

"Rebaseline three webarchive tests for WK2 after r229726."
https://bugs.webkit.org/show_bug.cgi?id=180568
https://trac.webkit.org/changeset/229763

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

16 months agoRebaseline three webarchive tests for WK2 after r229726.
ryanhaddad@apple.com [Tue, 20 Mar 2018 16:52:00 +0000 (16:52 +0000)]
Rebaseline three webarchive tests for WK2 after r229726.
https://bugs.webkit.org/show_bug.cgi?id=180568

Unreviewed test gardening.

* platform/wk2/webarchive/loading/missing-data-expected.txt: Added.
* platform/wk2/webarchive/loading/object-expected.txt: Added.
* platform/wk2/webarchive/loading/test-loading-archive-subresource-null-mimetype-expected.txt: Added.

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

16 months agoRebaseline three forms tests after r229730.
ryanhaddad@apple.com [Tue, 20 Mar 2018 16:25:32 +0000 (16:25 +0000)]
Rebaseline three forms tests after r229730.

Unreviewed test gardening.

* platform/mac/fast/forms/basic-selects-expected.txt:
* platform/mac/fast/forms/disabled-select-change-index-expected.txt:
* platform/mac/fast/forms/select-disabled-appearance-expected.txt:

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

16 months agoRebaseline a test after the case of the 'Strong Password' localized string was change...
ryanhaddad@apple.com [Tue, 20 Mar 2018 16:25:30 +0000 (16:25 +0000)]
Rebaseline a test after the case of the 'Strong Password' localized string was changed in r229724.

Unreviewed test gardening.

* platform/ios/fast/forms/auto-fill-button/input-strong-password-auto-fill-button-expected.txt:
* platform/mac/fast/forms/auto-fill-button/input-strong-password-auto-fill-button-expected.txt:

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

16 months agoSkip http/tests/storageAccess/grant-storage-access-under-opener.html on iOS debug.
ryanhaddad@apple.com [Tue, 20 Mar 2018 16:25:27 +0000 (16:25 +0000)]
Skip http/tests/storageAccess/grant-storage-access-under-opener.html on iOS debug.
https://bugs.webkit.org/show_bug.cgi?id=183714

Unreviewed test gardening.

* platform/ios-wk2/TestExpectations:

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

16 months ago[LayoutReloaded] Move Display.Box handling from FormattingContext to FormattingState
zalan@apple.com [Tue, 20 Mar 2018 16:14:28 +0000 (16:14 +0000)]
[LayoutReloaded] Move Display.Box handling from FormattingContext to FormattingState
https://bugs.webkit.org/show_bug.cgi?id=183779

Reviewed by Antti Koivisto.

* LayoutReloaded/FormattingContext/BlockFormatting/BlockFormattingContext.js:
(BlockFormattingContext.prototype._computeStaticPosition):
(BlockFormattingContext.prototype._computeOutOfFlowWidth):
(BlockFormattingContext.prototype._computeFloatingWidth):
(BlockFormattingContext.prototype._computeInFlowWidth):
(BlockFormattingContext.prototype._computeOutOfFlowHeight):
(BlockFormattingContext.prototype._computeFloatingHeight):
(BlockFormattingContext.prototype._computeInFlowHeight):
(BlockFormattingContext.prototype._horizontalConstraint):
(BlockFormattingContext.prototype._contentHeight):
(BlockFormattingContext.prototype._adjustBottomWithFIXME):
(BlockFormattingContext.prototype._computeInFlowPositionedPosition):
(BlockFormattingContext.prototype._computeOutOfFlowPosition):
* LayoutReloaded/FormattingContext/FloatingContext.js:
(FloatingContext.prototype.computePosition):
(FloatingContext.prototype._positionForClear):
(FloatingContext.prototype._computePositionToAvoidIntrudingFloats):
(FloatingContext.prototype._availableSpace):
(FloatingContext.prototype._adjustedFloatingPosition):
* LayoutReloaded/FormattingContext/FormattingContext.js:
(FormattingContext):
(FormattingContext.prototype.absoluteMarginBox):
(FormattingContext.prototype.absoluteBorderBox):
(FormattingContext.prototype.absolutePaddingBox):
(FormattingContext.prototype.absoluteContentBox):
(FormattingContext.prototype._toAbsolutePosition):
(FormattingContext.prototype._toRootAbsolutePosition):
(FormattingContext.prototype._addToLayoutQueue):
(FormattingContext.prototype.displayBox):
(FormattingContext.prototype._createDisplayBox): Deleted.
(FormattingContext.prototype.toDisplayBox): Deleted.
(FormattingContext.prototype.toLayoutBox): Deleted.
* LayoutReloaded/FormattingState/FormattingState.js:
(FormattingState):
(FormattingState.prototype.createDisplayBox):
(FormattingState.prototype.displayBox):

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

16 months ago[iOS] Grant IOKit preference access for the Home button
bfulgham@apple.com [Tue, 20 Mar 2018 15:34:30 +0000 (15:34 +0000)]
[iOS] Grant IOKit preference access for the Home button
https://bugs.webkit.org/show_bug.cgi?id=183754
<rdar://problem/38179704>

Reviewed by Eric Carlson.

* Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:

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

16 months ago[LayoutReloaded] Introduce FormattingState (Block/Inline/etc)
zalan@apple.com [Tue, 20 Mar 2018 15:12:33 +0000 (15:12 +0000)]
[LayoutReloaded] Introduce FormattingState (Block/Inline/etc)
https://bugs.webkit.org/show_bug.cgi?id=183777

Reviewed by Antti Koivisto.

This is in preparation for moving out states from the formatting contexts.

* LayoutReloaded/FormattingContext/BlockFormatting/BlockFormattingContext.js:
(BlockFormattingContext):
* LayoutReloaded/FormattingContext/FormattingContext.js:
(FormattingContext):
(FormattingContext.prototype.layoutState):
(FormattingContext.prototype.layoutContext):
(FormattingContext.prototype.layout):
* LayoutReloaded/FormattingContext/InlineFormatting/InlineFormattingContext.js:
(InlineFormattingContext):
* LayoutReloaded/FormattingState/BlockFormattingState.js: Copied from Tools/LayoutReloaded/LayoutContext.js.
(BlockFormattingState):
* LayoutReloaded/FormattingState/FormattingState.js: Copied from Tools/LayoutReloaded/LayoutContext.js.
(FormattingState):
(FormattingState.prototype.formattingContext):
(FormattingState.prototype.layoutContext):
(FormattingState.prototype._setFormattingContext):
* LayoutReloaded/FormattingState/InlineFormattingState.js: Copied from Tools/LayoutReloaded/LayoutContext.js.
(InlineFormattingState):
* LayoutReloaded/LayoutContext.js:
(LayoutContext):
(LayoutContext.prototype.layout):
(LayoutContext.prototype._createFormattingState):
(LayoutContext.prototype._createFormattingContext): Deleted.
* LayoutReloaded/LayoutReloaded.xcworkspace/contents.xcworkspacedata:
* LayoutReloaded/test/index.html:

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

16 months ago[Extra zoom mode] Adopt updated input view controller machinery for text input
wenson_hsieh@apple.com [Tue, 20 Mar 2018 14:36:12 +0000 (14:36 +0000)]
[Extra zoom mode] Adopt updated input view controller machinery for text input
https://bugs.webkit.org/show_bug.cgi?id=183765
<rdar://problem/36926269>

Reviewed by Tim Horton.

Adopt new classes for extra zoomed text inputs. Massage WKTextInputViewController into WKTextInputListView-
Controller and introduce WKFormControlListViewController, the eventual replacement for the base class
WKTextFormControlViewController that will act as the base class of all list-view-controller-based input UI in
extra zoom mode.

* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView presentTextInputViewController:]):
(-[WKContentView dismissTextInputViewController:]):
(-[WKContentView focusedFormControllerDidUpdateSuggestions:]):
(-[WKContentView _wheelChangedWithEvent:]):
* UIProcess/ios/forms/WKFormControlListViewController.h: Copied from Source/WebKit/UIProcess/ios/forms/WKTextInputViewController.h.
* UIProcess/ios/forms/WKFormControlListViewController.mm: Renamed from Source/WebKit/UIProcess/ios/forms/WKTextInputViewController.mm.
* UIProcess/ios/forms/WKTextInputListViewController.h: Copied from Source/WebKit/UIProcess/ios/forms/WKTextInputViewController.h.
* UIProcess/ios/forms/WKTextInputListViewController.mm: Renamed from Source/WebKit/UIProcess/ios/forms/WKTextInputViewController.h.
* WebKit.xcodeproj/project.pbxproj:

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

16 months agoWeb Inspector: Can't add a new class by editing class attribute in DOM outline
nvasilyev@apple.com [Tue, 20 Mar 2018 08:22:03 +0000 (08:22 +0000)]
Web Inspector: Can't add a new class by editing class attribute in DOM outline
https://bugs.webkit.org/show_bug.cgi?id=180890

Reviewed by Ryosuke Niwa.

Typing "my-foo my-bar" creates a single "my-foo\xA0my-bar" class name because
contentEditable-based attribute editor sometimes inserts non-breaking space characters (\xA0).

Replace all non-breaking space characters with the regular space characters when
commiting attribute change.

* UserInterface/Views/DOMTreeElement.js:

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

16 months ago[DFG][FTL] Add vectorLengthHint for NewArray
utatane.tea@gmail.com [Tue, 20 Mar 2018 07:58:22 +0000 (07:58 +0000)]
[DFG][FTL] Add vectorLengthHint for NewArray
https://bugs.webkit.org/show_bug.cgi?id=183694

Reviewed by Saam Barati.

JSTests:

* stress/vector-length-hint-array-constructor.js: Added.
(shouldBe):
(test):
* stress/vector-length-hint-new-array.js: Added.
(shouldBe):
(test):

Source/JavaScriptCore:

While the following code is a common, it is not so efficient.

var array = [];
for (...) {
    ...
    array.push(...);
}

The array is always allocated with 0 vector length. And it is eventually grown.

We have ArrayAllocationProfile, and it tells us that the vector length hint for
the allocated arrays. This hint is already used for NewArrayBuffer. This patch
extends this support for NewArray DFG node.

This patch improves Kraken/stanford-crypto-aes 4%.

                              baseline                  patched

stanford-crypto-aes        64.069+-1.352             61.589+-1.274           might be 1.0403x faster

NewArray can be optimized.

                                               baseline                  patched

vector-length-hint-new-array               21.8157+-0.0882     ^     13.1764+-0.0942        ^ definitely 1.6557x faster
vector-length-hint-array-constructor       21.9076+-0.0987     ?     22.1168+-0.4814        ?

* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::handleConstantInternalFunction):
(JSC::DFG::ByteCodeParser::parseBlock):
* dfg/DFGNode.h:
(JSC::DFG::Node::hasVectorLengthHint):
(JSC::DFG::Node::vectorLengthHint):
* dfg/DFGSpeculativeJIT64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::compileNewArray):

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

16 months ago[DFG][FTL] Make ArraySlice(0) code tight
utatane.tea@gmail.com [Tue, 20 Mar 2018 07:12:56 +0000 (07:12 +0000)]
[DFG][FTL] Make ArraySlice(0) code tight
https://bugs.webkit.org/show_bug.cgi?id=183590

Reviewed by Saam Barati.

JSTests:

* stress/array-slice-with-zero.js: Added.
(shouldBe):
(test):
(test2):
* stress/array-slice-zero-args.js: Added.
(shouldBe):
(test):

Source/JavaScriptCore:

This patch tightens ArraySlice code, in particular, startIndex = 0 case.

1. We support array.slice() call. This is a well-used way to clone array.
For example, underscore.js uses this technique.

2. We remove several checks if the given index value is a proven constant.

* dfg/DFGBackwardsPropagationPhase.cpp:
(JSC::DFG::BackwardsPropagationPhase::propagate):
* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::handleIntrinsicCall):
* dfg/DFGFixupPhase.cpp:
(JSC::DFG::FixupPhase::fixupNode):
* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::emitPopulateSliceIndex):
(JSC::DFG::SpeculativeJIT::compileArraySlice):
We can skip some of checks if the given value is a proven constant.

* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::compileArraySlice):
Change below to belowOrEqual. It does not change meaning in the code. But it allows us
to fold BelowEqual(0, x) to true.

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

16 months agoApply some SDK checks in LocalDefaultSystemAppearance
timothy_horton@apple.com [Tue, 20 Mar 2018 06:26:36 +0000 (06:26 +0000)]
Apply some SDK checks in LocalDefaultSystemAppearance
https://bugs.webkit.org/show_bug.cgi?id=183767
<rdar://problem/38649611>

Reviewed by Zalan Bujtas.

* platform/mac/LocalDefaultSystemAppearance.h:
* platform/mac/LocalDefaultSystemAppearance.mm:
(WebCore::LocalDefaultSystemAppearance::LocalDefaultSystemAppearance):
(WebCore::LocalDefaultSystemAppearance::~LocalDefaultSystemAppearance):

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

16 months agoDrop s_exceptionInstructions static initializer
utatane.tea@gmail.com [Tue, 20 Mar 2018 05:34:48 +0000 (05:34 +0000)]
Drop s_exceptionInstructions static initializer
https://bugs.webkit.org/show_bug.cgi?id=183732

Reviewed by Darin Adler.

Make Instruction constructor constexpr to drop the static constructor
of LLInt::Data::s_exceptionInstructions.

* bytecode/Instruction.h:
(JSC::Instruction::Instruction):

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

16 months ago[LayoutReloaded] Layout.Box should not create the formatting context.
zalan@apple.com [Tue, 20 Mar 2018 05:02:41 +0000 (05:02 +0000)]
[LayoutReloaded] Layout.Box should not create the formatting context.
https://bugs.webkit.org/show_bug.cgi?id=183766

Reviewed by Antti Koivisto.

Since the formattingContext's lifetime is tied to the layout, the LayoutContext
should construct it instead.

* LayoutReloaded/FormattingContext/BlockFormatting/BlockFormattingContext.js:
(BlockFormattingContext):
(BlockFormattingContext.prototype.layout):
(BlockFormattingContext.prototype._layoutOutOfFlowDescendants):
(BlockFormattingContext.prototype._contentHeight):
* LayoutReloaded/FormattingContext/FormattingContext.js:
(FormattingContext):
(FormattingContext.prototype.layoutContext):
(FormattingContext.prototype.toDisplayBox):
(FormattingContext.prototype._outOfFlowDescendants):
* LayoutReloaded/FormattingContext/InlineFormatting/InlineFormattingContext.js:
(InlineFormattingContext):
(InlineFormattingContext.prototype.layout):
* LayoutReloaded/Layout.js:
(layout):
* LayoutReloaded/LayoutContext.js:
(LayoutContext.prototype.layout):
(LayoutContext.prototype._createFormattingContext):
(LayoutContext):
(LayoutContext.prototype.layoutFormattingContext): Deleted.
* LayoutReloaded/LayoutTree/Box.js:
(Layout.Box):
(Layout.Box.prototype.establishedFormattingContext): Deleted.
* LayoutReloaded/misc/headers/Box.h:

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

16 months agoInvestigate why __cpu_indicator_init is used
mitz@apple.com [Tue, 20 Mar 2018 03:26:15 +0000 (03:26 +0000)]
Investigate why __cpu_indicator_init is used
https://bugs.webkit.org/show_bug.cgi?id=183736

Reviewed by Tim Horton.

__cpu_indicator_init, which is a global initializer, was included in JavaScriptCore because
we were passing the -all_load option to the linker, causing it to bring in all members of
every static library being linked in, including the compiler runtime library. We only need
to load all members of WTF. The linker option for doing that is -force_load, and it requires
a path to the library. To support building against libWTF.a built locally as well as against
the copy that is in the SDK, we add a script build phase that palces a symbolic link to the
appropriate libWTF.a under the DerivedSources directory, and pass the path to that symlink
to the linker. Also, while cleaning up linker flags, make OTHER_LDFLAGS_HIDE_SYMBOLS less
verbose by eliminating every other -Wl, remove redundant -lobjc (libobjc is already listed
in the Link Binary With Libraries build phase), remove long-unsupported -Y,3, and stop
reexporting libobjc.

* Configurations/JavaScriptCore.xcconfig:
* JavaScriptCore.xcodeproj/project.pbxproj:

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

16 months agoClear style colors when setting default appearance
megan_gardner@apple.com [Tue, 20 Mar 2018 02:49:14 +0000 (02:49 +0000)]
Clear style colors when setting default appearance
https://bugs.webkit.org/show_bug.cgi?id=183759

Reviewed by Tim Horton.

Colors are cached and need to be cleared and recalculated.
Source/WebKit:

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

Source/WebKitLegacy/mac:

Refactor to do all style recalcs together.

* WebView/WebView.mm:
(-[WebView _setDefaultAppearanceAndClearStyle]):
(-[WebView _setUseSystemAppearance:]):
(-[WebView effectiveAppearanceDidChange]):

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

16 months agoWKWebView.ClearAppCache is a flaky API test failure on High Sierra.
cdumez@apple.com [Tue, 20 Mar 2018 02:34:25 +0000 (02:34 +0000)]
WKWebView.ClearAppCache is a flaky API test failure on High Sierra.
https://bugs.webkit.org/show_bug.cgi?id=181546
<rdar://problem/36444327>

Reviewed by Ryosuke Niwa.

in LocalStorageDatabaseTracker::deleteDatabasesModifiedSince(), add origin
to originIdentifiersToDelete if we cannot determine the last modification
time of the database file. This likely means the database file does not
exist. However, we still needs to make sure the origin gets removed from
the origins database and there may be *.wal / *.shm variants of the database
that are still on disk and need to be deleted.

* UIProcess/WebStorage/LocalStorageDatabaseTracker.cpp:
(WebKit::LocalStorageDatabaseTracker::deleteDatabasesModifiedSince):

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

16 months agoHave one service worker process per security origin
cdumez@apple.com [Tue, 20 Mar 2018 02:31:47 +0000 (02:31 +0000)]
Have one service worker process per security origin
https://bugs.webkit.org/show_bug.cgi?id=183600
<rdar://problem/35280128>

Reviewed by Brady Eidson.

Source/WebCore:

Split service workers from different origins into their own processes
for security reasons.

* workers/service/server/SWServer.cpp:
(WebCore::SWServer::addRegistrationFromStore):
(WebCore::SWServer::clear):
(WebCore::SWServer::tryInstallContextData):
(WebCore::SWServer::serverToContextConnectionCreated):
(WebCore::SWServer::installContextData):
(WebCore::SWServer::runServiceWorkerIfNecessary):
(WebCore::SWServer::markAllWorkersAsTerminated):
* workers/service/server/SWServer.h:
* workers/service/server/SWServerToContextConnection.cpp:
(WebCore::SWServerToContextConnection::SWServerToContextConnection):
(WebCore::SWServerToContextConnection::~SWServerToContextConnection):
(WebCore::SWServerToContextConnection::connectionForOrigin):
* workers/service/server/SWServerToContextConnection.h:
(WebCore::SWServerToContextConnection::origin):
* workers/service/server/SWServerWorker.cpp:
(WebCore::SWServerWorker::SWServerWorker):
(WebCore::SWServerWorker::securityOrigin const):
(WebCore::SWServerWorker::contextConnection):
* workers/service/server/SWServerWorker.h:

Source/WebKit:

Split service workers from different origins into their own processes
for security reasons.

* StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
(WebKit::WebSWServerConnection::startFetch):
(WebKit::WebSWServerConnection::postMessageToServiceWorker):
(WebKit::WebSWServerConnection::scheduleJobInServer):
* StorageProcess/ServiceWorker/WebSWServerToContextConnection.cpp:
(WebKit::WebSWServerToContextConnection::WebSWServerToContextConnection):
* StorageProcess/ServiceWorker/WebSWServerToContextConnection.h:
* StorageProcess/StorageProcess.cpp:
(WebKit::StorageProcess::connectionToContextProcessFromIPCConnection):
(WebKit::StorageProcess::didClose):
(WebKit::StorageProcess::connectionToContextProcessWasClosed):
(WebKit::StorageProcess::needsServerToContextConnectionForOrigin const):
(WebKit::StorageProcess::didReceiveMessage):
(WebKit::StorageProcess::createStorageToWebProcessConnection):
(WebKit::StorageProcess::serverToContextConnectionForOrigin):
(WebKit::StorageProcess::createServerToContextConnection):
* StorageProcess/StorageProcess.h:
* StorageProcess/StorageProcess.messages.in:
* StorageProcess/StorageToWebProcessConnection.cpp:
(WebKit::StorageToWebProcessConnection::didReceiveMessage):
(WebKit::StorageToWebProcessConnection::didClose):
* StorageProcess/StorageToWebProcessConnection.h:
* UIProcess/API/C/WKContext.cpp:
(WKContextTerminateServiceWorkerProcess):
* UIProcess/API/Cocoa/WKProcessPool.mm:
(-[WKProcessPool _terminateServiceWorkerProcesses]):
(-[WKProcessPool _webPageContentProcessCount]):
(-[WKProcessPool _serviceWorkerProcessCount]):
* UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
* UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::didReceiveAuthenticationChallenge):
(WebKit::NetworkProcessProxy::canAuthenticateAgainstProtectionSpace):
* UIProcess/ServiceWorkerProcessProxy.cpp:
(WebKit::ServiceWorkerProcessProxy::create):
(WebKit::ServiceWorkerProcessProxy::ServiceWorkerProcessProxy):
* UIProcess/ServiceWorkerProcessProxy.h:
(isType):
* UIProcess/Storage/StorageProcessProxy.cpp:
(WebKit::StorageProcessProxy::getStorageProcessConnection):
(WebKit::StorageProcessProxy::didFinishLaunching):
(WebKit::StorageProcessProxy::establishWorkerContextConnectionToStorageProcess):
(WebKit::StorageProcessProxy::establishWorkerContextConnectionToStorageProcessForExplicitSession):
* UIProcess/Storage/StorageProcessProxy.h:
* UIProcess/Storage/StorageProcessProxy.messages.in:
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::getStorageProcessConnection):
(WebKit::WebProcessPool::establishWorkerContextConnectionToStorageProcess):
(WebKit::WebProcessPool::createNewWebProcess):
(WebKit::WebProcessPool::disconnectProcess):
(WebKit::WebProcessPool::createNewWebProcessRespectingProcessCountLimit):
(WebKit::WebProcessPool::createWebPage):
(WebKit::WebProcessPool::updateServiceWorkerUserAgent):
(WebKit::WebProcessPool::mayHaveRegisteredServiceWorkers):
(WebKit::WebProcessPool::pageBeginUsingWebsiteDataStore):
(WebKit::WebProcessPool::terminateServiceWorkerProcesses):
(WebKit::WebProcessPool::updateProcessAssertions):
(WebKit::WebProcessPool::serviceWorkerProcessProxyFromPageID const):
* UIProcess/WebProcessPool.h:
* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::getStorageProcessConnection):

Tools:

Add API test coverage.

* TestWebKitAPI/Tests/WebKitCocoa/ServiceWorkerBasic.mm:

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

16 months ago[LayoutReloaded] Remove border/padding/contentBox() functions from Layout.Box
zalan@apple.com [Tue, 20 Mar 2018 02:30:51 +0000 (02:30 +0000)]
[LayoutReloaded] Remove border/padding/contentBox() functions from Layout.Box
https://bugs.webkit.org/show_bug.cgi?id=183761

Reviewed by Antti Koivisto.

Display.Box has them.

* LayoutReloaded/FormattingContext/BlockFormatting/BlockFormattingContext.js:
(BlockFormattingContext.prototype._computeOutOfFlowWidth):
(BlockFormattingContext.prototype._computeOutOfFlowHeight):
(BlockFormattingContext.prototype._horizontalConstraint):
(BlockFormattingContext.prototype._contentHeight):
(BlockFormattingContext.prototype._adjustBottomWithFIXME):
(BlockFormattingContext.prototype._computeOutOfFlowPosition):
* LayoutReloaded/FormattingContext/FloatingContext.js:
(FloatingContext.prototype._availableSpace):
* LayoutReloaded/FormattingContext/FormattingContext.js:
(FormattingContext.prototype.absoluteBorderBox):
(FormattingContext.prototype.absolutePaddingBox):
(FormattingContext.prototype.absoluteContentBox):
* LayoutReloaded/LayoutTree/Box.js:
(Layout.Box.prototype.isDescendantOf):
(Layout.Box):
(Layout.Box.prototype.borderBox): Deleted.
(Layout.Box.prototype.paddingBox): Deleted.
(Layout.Box.prototype.contentBox): Deleted.

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

16 months agoAdd a layout test verifying AppCache resource fetches have the document's cookie...
beidson@apple.com [Tue, 20 Mar 2018 02:27:57 +0000 (02:27 +0000)]
Add a layout test verifying AppCache resource fetches have the document's cookie in place.
https://bugs.webkit.org/show_bug.cgi?id=183757

Reviewed by Alex Christensen.

* http/tests/appcache/document-cookie-expected.txt: Added.
* http/tests/appcache/document-cookie.php: Added.
* http/tests/appcache/resources/cookie-protected-script.php: Added.
* http/tests/appcache/resources/document-cookie.manifest: Added.

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

16 months agoHave select element respect current appearance
megan_gardner@apple.com [Tue, 20 Mar 2018 01:21:23 +0000 (01:21 +0000)]
Have select element respect current appearance
https://bugs.webkit.org/show_bug.cgi?id=183753

Reviewed by Tim Horton.

Not currently testable, will add tests in a later patch.

Have the menu lists/select elements follow the system colors.

* rendering/RenderThemeMac.mm:
(WebCore::RenderThemeMac::adjustMenuListStyle const):

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

16 months agoAX: embedded attachments do not work correctly with text marker APIs on macOS
n_wang@apple.com [Tue, 20 Mar 2018 01:08:53 +0000 (01:08 +0000)]
AX: embedded attachments do not work correctly with text marker APIs on macOS
https://bugs.webkit.org/show_bug.cgi?id=183751

Reviewed by Chris Fleizach.

In WebKit1, embedded attachments are not working well with text marker APIs.
We should use the corresponding attachment view in the following cases:
1. Hit testing on an attachment object.
2. Getting the attachment object at a text marker position.
3. Asking for the associated element with NSAccessibilityAttachmentTextAttribute.

Not able to construct a layout test because it relies on embedded attachments.

* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(AXAttributeStringSetElement):
(-[WebAccessibilityObjectWrapper accessibilityHitTest:]):
(-[WebAccessibilityObjectWrapper accessibilityAttributeValue:forParameter:]):

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

16 months agoUpdate Perf buildbot syncing scripts for Buildbot 0.9
aakash_jain@apple.com [Tue, 20 Mar 2018 00:20:46 +0000 (00:20 +0000)]
Update Perf buildbot syncing scripts for Buildbot 0.9
https://bugs.webkit.org/show_bug.cgi?id=175969

Reviewed by Ryosuke Niwa.

* tools/js/buildbot-triggerable.js:
(BuildbotTriggerable.prototype.initSyncers): Switch from Deprecated version to new version of getBuilderNameToIDMap.
* tools/js/buildbot-syncer.js:
(BuildbotSyncer.prototype.scheduleRequestInGroupIfAvailable): Switch from Deprecated version to new version of scheduleRequest.
(BuildbotSyncer.prototype.pullBuildbot): Switch from Deprecated version to new version of pathForPendingBuilds, _pullRecentBuilds
and BuildbotBuildEntry. Parse the pending build-requests data in Buildbot 0.9 format.
* unit-tests/buildbot-syncer-tests.js: Updated as per Buildbot 0.9 code.
* server-tests/tools-sync-buildbot-integration-tests.js: Ditto.
* server-tests/tools-buildbot-triggerable-tests.js: Ditto.
* server-tests/resources/mock-data.js: Ditto.
(MockData.pendingBuildsUrl): Method to construct pendingBuildsUrl in Buildbot 0.9 format.
(MockData.recentBuildsUrl): Ditto for recent builds url.
(MockData.statusUrl): Ditto for status url.
(MockData.builderIDForName): Method to get builder ID from builder name.

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

16 months agoUnreviewed, another quick fix for r229699
jiewen_tan@apple.com [Mon, 19 Mar 2018 23:15:38 +0000 (23:15 +0000)]
Unreviewed, another quick fix for r229699

Restricts ENABLE_WEB_AUTHN to only macOS and iOS.

Source/JavaScriptCore:

* Configurations/FeatureDefines.xcconfig:

Source/WebCore:

* Configurations/FeatureDefines.xcconfig:

Source/WebCore/PAL:

* Configurations/FeatureDefines.xcconfig:

Source/WebKit:

* Configurations/FeatureDefines.xcconfig:

Source/WebKitLegacy/mac:

* Configurations/FeatureDefines.xcconfig:

Tools:

* TestWebKitAPI/Configurations/FeatureDefines.xcconfig:
* TestWebKitAPI/Tests/ios/LocalAuthenticator.mm:

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

16 months agoMake policy decisions asynchronous
cdumez@apple.com [Mon, 19 Mar 2018 23:12:19 +0000 (23:12 +0000)]
Make policy decisions asynchronous
https://bugs.webkit.org/show_bug.cgi?id=180568
<rdar://problem/37131297>

Reviewed by Alex Christensen.

Source/WebKit:

Get rid of synchronous IPC and synchronous code paths for policy delegates.
Policy decisions are now all made asynchronously and rely on asynchronous
IPC.

This code change is based on work by Alex Christensen.

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::receivedPolicyDecision):
(WebKit::WebPageProxy::decidePolicyForNavigationAction):
(WebKit::WebPageProxy::decidePolicyForResponse):
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse):
(WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):

LayoutTests:

Rebaseline tests for WebKit2. The issue is that some tests dump policy delegate calls
and things now happen in a slightly different order now that those delegates are
asynchronous.

* TestExpectations:
* http/tests/security/contentSecurityPolicy/block-all-mixed-content/insecure-css-in-main-frame-expected.txt:
* platform/ios/http/tests/loading/simple-subframe-expected.txt:
* platform/mac-wk2/http/tests/loading/simple-subframe-expected.txt: Copied from LayoutTests/platform/ios/http/tests/loading/simple-subframe-expected.txt.
* platform/wk2/fast/loader/fragment-navigation-base-blank-expected.txt: Copied from LayoutTests/platform/mac/webarchive/loading/mainresource-null-mimetype-crash-expected.txt.
* platform/wk2/fast/loader/iframe-meta-refresh-base-blank-expected.txt: Copied from LayoutTests/platform/wk2/http/tests/loading/authentication-after-redirect-stores-wrong-credentials/authentication-after-redirect-stores-wrong-credentials-expected.txt.
* platform/wk2/fast/loader/iframe-set-location-base-blank-expected.txt: Copied from LayoutTests/platform/wk2/http/tests/loading/authentication-after-redirect-stores-wrong-credentials/authentication-after-redirect-stores-wrong-credentials-expected.txt.
* platform/wk2/fast/loader/main-document-url-for-non-http-loads-expected.txt: Added.
* platform/wk2/fast/loader/refresh-iframe-base-blank-expected.txt: Copied from LayoutTests/platform/wk2/http/tests/loading/authentication-after-redirect-stores-wrong-credentials/authentication-after-redirect-stores-wrong-credentials-expected.txt.
* platform/wk2/fast/loader/subframe-removes-itself-expected.txt: Copied from LayoutTests/platform/mac/webarchive/loading/mainresource-null-mimetype-crash-expected.txt.
* platform/wk2/http/tests/contentdispositionattachmentsandbox/cross-origin-frames-disabled-expected.txt: Added.
* platform/wk2/http/tests/contentextensions/block-everything-unless-domain-expected.txt: Added.
* platform/wk2/http/tests/loading/authentication-after-redirect-stores-wrong-credentials/authentication-after-redirect-stores-wrong-credentials-expected.txt:
* platform/wk2/http/tests/loading/bad-server-subframe-expected.txt: Added.
* platform/wk2/http/tests/loading/basic-auth-load-URL-with-consecutive-slashes-expected.txt:
* platform/wk2/http/tests/loading/redirect-with-no-location-crash-expected.txt: Copied from LayoutTests/platform/mac/webarchive/loading/mainresource-null-mimetype-crash-expected.txt.
* platform/wk2/http/tests/loading/server-redirect-for-provisional-load-caching-expected.txt: Added.
* platform/wk2/http/tests/loading/slow-parsing-subframe-expected.txt: Added.
* platform/wk2/http/tests/misc/will-send-request-returns-null-on-redirect-expected.txt: Added.
* platform/wk2/http/tests/misc/window-dot-stop-expected.txt: Added.
* platform/wk2/http/tests/navigation/redirect-preserves-fragment-expected.txt: Added.
* platform/wk2/http/tests/navigation/redirect-to-fragment-expected.txt: Added.
* platform/wk2/http/tests/navigation/redirect-to-invalid-url-expected.txt: Added.
* platform/wk2/http/tests/security/XFrameOptions/x-frame-options-allowall-expected.txt: Added.
* platform/wk2/http/tests/security/XFrameOptions/x-frame-options-deny-expected.txt: Added.
* platform/wk2/http/tests/security/XFrameOptions/x-frame-options-ignore-deny-meta-tag-expected.txt: Added.
* platform/wk2/http/tests/security/XFrameOptions/x-frame-options-ignore-deny-meta-tag-in-body-expected.txt: Added.
* platform/wk2/http/tests/security/XFrameOptions/x-frame-options-ignore-deny-meta-tag-parent-same-origin-allow-expected.txt: Added.
* platform/wk2/http/tests/security/XFrameOptions/x-frame-options-ignore-deny-meta-tag-parent-same-origin-deny-expected.txt: Added.
* platform/wk2/http/tests/security/XFrameOptions/x-frame-options-invalid-expected.txt: Added.
* platform/wk2/http/tests/security/XFrameOptions/x-frame-options-multiple-headers-conflict-expected.txt: Added.
* platform/wk2/http/tests/security/XFrameOptions/x-frame-options-multiple-headers-sameorigin-allow-expected.txt: Added.
* platform/wk2/http/tests/security/XFrameOptions/x-frame-options-multiple-headers-sameorigin-deny-expected.txt: Added.
* platform/wk2/http/tests/security/XFrameOptions/x-frame-options-parent-same-origin-allow-expected.txt: Added.
* platform/wk2/http/tests/security/XFrameOptions/x-frame-options-parent-same-origin-deny-expected.txt: Added.
* platform/wk2/http/tests/security/blocked-on-redirect-expected.txt: Added.
* platform/wk2/http/tests/security/contentSecurityPolicy/block-all-mixed-content/data-url-iframe-in-main-frame-expected.txt: Copied from LayoutTests/platform/mac/webarchive/loading/mainresource-null-mimetype-crash-expected.txt.
* platform/wk2/http/tests/security/contentSecurityPolicy/block-all-mixed-content/insecure-css-in-iframe-expected.txt: Added.
* platform/wk2/http/tests/security/contentSecurityPolicy/block-all-mixed-content/insecure-css-in-iframe-report-only-expected.txt: Added.
* platform/wk2/http/tests/security/contentSecurityPolicy/block-all-mixed-content/insecure-css-in-main-frame-expected.txt: Copied from LayoutTests/http/tests/security/contentSecurityPolicy/block-all-mixed-content/insecure-css-in-main-frame-expected.txt.
* platform/wk2/http/tests/security/contentSecurityPolicy/block-all-mixed-content/insecure-iframe-in-iframe-expected.txt: Added.
* platform/wk2/http/tests/security/contentSecurityPolicy/block-all-mixed-content/insecure-iframe-in-main-frame-expected.txt: Added.
* platform/wk2/http/tests/security/contentSecurityPolicy/block-all-mixed-content/insecure-image-in-iframe-expected.txt: Added.
* platform/wk2/http/tests/security/contentSecurityPolicy/block-all-mixed-content/insecure-image-in-iframe-with-enforced-and-report-policies-expected.txt: Added.
* platform/wk2/http/tests/security/contentSecurityPolicy/block-all-mixed-content/insecure-image-in-iframe-with-inherited-policy-expected.txt: Added.
* platform/wk2/http/tests/security/contentSecurityPolicy/block-all-mixed-content/insecure-image-in-javascript-url-iframe-in-iframe-expected.txt: Added.
* platform/wk2/http/tests/security/contentSecurityPolicy/block-all-mixed-content/insecure-image-in-main-frame-expected.txt: Copied from LayoutTests/http/tests/security/contentSecurityPolicy/block-all-mixed-content/insecure-css-in-main-frame-expected.txt.
* platform/wk2/http/tests/security/contentSecurityPolicy/block-all-mixed-content/insecure-image-in-xslt-document-in-iframe-with-inherited-policy-expected.txt: Added.
* platform/wk2/http/tests/security/contentSecurityPolicy/block-all-mixed-content/insecure-plugin-in-iframe-expected.txt: Added.
* platform/wk2/http/tests/security/contentSecurityPolicy/block-all-mixed-content/insecure-plugin-in-main-frame-expected.txt: Copied from LayoutTests/http/tests/security/contentSecurityPolicy/block-all-mixed-content/insecure-css-in-main-frame-expected.txt.
* platform/wk2/http/tests/security/contentSecurityPolicy/block-all-mixed-content/insecure-script-in-iframe-expected.txt: Added.
* platform/wk2/http/tests/security/contentSecurityPolicy/block-all-mixed-content/insecure-script-in-iframe-with-inherited-policy-expected.txt: Added.
* platform/wk2/http/tests/security/contentSecurityPolicy/block-all-mixed-content/insecure-script-in-main-frame-expected.txt: Copied from LayoutTests/http/tests/security/contentSecurityPolicy/block-all-mixed-content/insecure-css-in-main-frame-expected.txt.
* platform/wk2/http/tests/security/contentSecurityPolicy/block-all-mixed-content/insecure-xhr-asynchronous-in-iframe-expected.txt: Added.
* platform/wk2/http/tests/security/contentSecurityPolicy/block-all-mixed-content/insecure-xhr-asynchronous-in-main-frame-expected.txt: Added.
* platform/wk2/http/tests/security/contentSecurityPolicy/block-all-mixed-content/insecure-xhr-synchronous-in-iframe-expected.txt: Added.
* platform/wk2/http/tests/security/contentSecurityPolicy/block-all-mixed-content/insecure-xhr-synchronous-in-main-frame-expected.txt: Added.
* platform/wk2/http/tests/security/contentSecurityPolicy/block-all-mixed-content/secure-image-after-upgrade-in-iframe-expected.txt: Copied from LayoutTests/platform/mac/webarchive/loading/mainresource-null-mimetype-crash-expected.txt.
* platform/wk2/http/tests/security/contentSecurityPolicy/block-all-mixed-content/secure-image-after-upgrade-redirect-in-iframe-expected.txt: Copied from LayoutTests/platform/mac/webarchive/loading/mainresource-null-mimetype-crash-expected.txt.
* platform/wk2/http/tests/security/contentSecurityPolicy/upgrade-insecure-requests/iframe-upgrade.https-expected.txt: Added.
* platform/wk2/http/tests/security/contentSecurityPolicy/upgrade-insecure-requests/proper-nested-upgrades-expected.txt: Added.
* platform/wk2/http/tests/security/contentSecurityPolicy/upgrade-insecure-requests/upgrade-insecure-css-in-iframe-expected.txt: Copied from LayoutTests/platform/mac/webarchive/loading/mainresource-null-mimetype-crash-expected.txt.
* platform/wk2/http/tests/security/contentSecurityPolicy/upgrade-insecure-requests/upgrade-redirect-http-to-https-script-in-iframe-expected.txt: Copied from LayoutTests/platform/mac/webarchive/loading/mainresource-null-mimetype-crash-expected.txt.
* platform/wk2/http/tests/security/contentSecurityPolicy/upgrade-insecure-requests/upgrade-redirect-https-to-http-script-in-iframe-expected.txt: Copied from LayoutTests/platform/mac/webarchive/loading/mainresource-null-mimetype-crash-expected.txt.
* platform/wk2/http/tests/security/http-0.9/iframe-blocked-expected.txt: Added.
* platform/wk2/http/tests/security/mixedContent/about-blank-iframe-in-main-frame-expected.txt: Added.
* platform/wk2/http/tests/security/mixedContent/data-url-iframe-in-main-frame-expected.txt: Copied from LayoutTests/platform/mac/webarchive/loading/mainresource-null-mimetype-crash-expected.txt.
* platform/wk2/http/tests/security/mixedContent/data-url-script-in-iframe-expected.txt: Copied from LayoutTests/platform/mac/webarchive/loading/mainresource-null-mimetype-crash-expected.txt.
* platform/wk2/http/tests/security/mixedContent/empty-url-plugin-in-frame-expected.txt: Copied from LayoutTests/platform/mac/webarchive/loading/mainresource-null-mimetype-crash-expected.txt.
* platform/wk2/http/tests/security/mixedContent/insecure-css-in-iframe-expected.txt: Copied from LayoutTests/platform/mac/webarchive/loading/mainresource-null-mimetype-crash-expected.txt.
* platform/wk2/http/tests/security/mixedContent/insecure-css-in-main-frame-expected.txt: Added.
* platform/wk2/http/tests/security/mixedContent/insecure-css-with-secure-cookies-expected.txt: Added.
* platform/wk2/http/tests/security/mixedContent/insecure-executable-css-with-secure-cookies-expected.txt: Added.
* platform/wk2/http/tests/security/mixedContent/insecure-form-in-iframe-expected.txt: Copied from LayoutTests/platform/mac/webarchive/loading/mainresource-null-mimetype-crash-expected.txt.
* platform/wk2/http/tests/security/mixedContent/insecure-form-in-main-frame-expected.txt: Added.
* platform/wk2/http/tests/security/mixedContent/insecure-iframe-in-iframe-expected.txt: Added.
* platform/wk2/http/tests/security/mixedContent/insecure-iframe-in-main-frame-expected.txt: Added.
* platform/wk2/http/tests/security/mixedContent/insecure-image-in-iframe-expected.txt: Copied from LayoutTests/platform/mac/webarchive/loading/mainresource-null-mimetype-crash-expected.txt.
* platform/wk2/http/tests/security/mixedContent/javascript-url-form-in-main-frame-expected.txt: Added.
* platform/wk2/http/tests/security/mixedContent/redirect-http-to-https-iframe-in-main-frame-expected.txt: Added.
* platform/wk2/http/tests/security/mixedContent/redirect-http-to-https-script-in-iframe-expected.txt: Added.
* platform/wk2/http/tests/security/mixedContent/redirect-https-to-http-iframe-in-main-frame-expected.txt: Added.
* platform/wk2/http/tests/security/mixedContent/redirect-https-to-http-image-secure-cookies-block-expected.txt: Added.
* platform/wk2/http/tests/security/mixedContent/redirect-https-to-http-image-secure-cookies-expected.txt: Added.
* platform/wk2/http/tests/security/mixedContent/redirect-https-to-http-script-in-iframe-expected.txt: Copied from LayoutTests/platform/mac/webarchive/loading/mainresource-null-mimetype-crash-expected.txt.
* platform/wk2/http/tests/security/xssAuditor/script-tag-with-callbacks-expected.txt: Copied from LayoutTests/platform/mac/webarchive/loading/mainresource-null-mimetype-crash-expected.txt.
* platform/wk2/inspector/page/frameScheduledNavigation-expected.txt: Added.
* platform/wk2/loader/go-back-cached-main-resource-expected.txt: Added.
* platform/wk2/webarchive/loading/mainresource-null-mimetype-crash-expected.txt: Copied from LayoutTests/platform/mac/webarchive/loading/mainresource-null-mimetype-crash-expected.txt.
* platform/wk2/webarchive/loading/test-loading-archive-expected.txt: Copied from LayoutTests/platform/mac/webarchive/loading/mainresource-null-mimetype-crash-expected.txt.
* platform/wk2/webarchive/loading/video-in-webarchive-expected.txt: Renamed from LayoutTests/platform/mac/webarchive/loading/mainresource-null-mimetype-crash-expected.txt.

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

16 months ago[LayoutReloaded] Move statically positioned absolute box positioning to _computeOutOf...
zalan@apple.com [Mon, 19 Mar 2018 22:58:10 +0000 (22:58 +0000)]
[LayoutReloaded] Move statically positioned absolute box positioning to _computeOutOfFlowPosition
https://bugs.webkit.org/show_bug.cgi?id=183750

Reviewed by Antti Koivisto.

* LayoutReloaded/DisplayTree/Box.js:
(Display.Box.prototype.setTop):
(Display.Box.prototype.paddingBox):
(Display.Box.prototype.contentBox):
(Display.Box):
* LayoutReloaded/FormattingContext/BlockFormatting/BlockFormattingContext.js:
(BlockFormattingContext.prototype._computeStaticPosition):
(BlockFormattingContext.prototype._layoutOutOfFlowDescendants):
(BlockFormattingContext.prototype._computeOutOfFlowPosition):
* LayoutReloaded/FormattingContext/FormattingContext.js:
(FormattingContext.prototype.absoluteMarginBox):
(FormattingContext.prototype.absoluteBorderBox):
(FormattingContext.prototype.absolutePaddingBox):
(FormattingContext.prototype.absoluteContentBox):
(FormattingContext.prototype._toAbsolutePosition):
(FormattingContext.prototype._toRootAbsolutePosition):
(FormattingContext.prototype.toDisplayBox):
* LayoutReloaded/LayoutTree/InitialBlockContainer.js:
(Layout.InitialBlockContainer.prototype.establishesBlockFormattingContext):
(Layout.InitialBlockContainer):
(Layout.InitialBlockContainer.prototype.paddingBox): Deleted.
(Layout.InitialBlockContainer.prototype.contentBox): Deleted.
* LayoutReloaded/Utils.js:
(Utils.isStaticallyPositioned):

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

16 months agoFix case of Strong Password localized string
dbates@webkit.org [Mon, 19 Mar 2018 22:47:39 +0000 (22:47 +0000)]
Fix case of Strong Password localized string

* English.lproj/Localizable.strings:
* platform/LocalizedStrings.cpp:
(WebCore::autoFillStrongPasswordLabel):

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

16 months agoWebKit.WebsitePoliciesAutoplayQuirks API test times out with async policy delegates
cdumez@apple.com [Mon, 19 Mar 2018 22:30:57 +0000 (22:30 +0000)]
WebKit.WebsitePoliciesAutoplayQuirks API test times out with async policy delegates
https://bugs.webkit.org/show_bug.cgi?id=183702
<rdar://problem/38566060>

Reviewed by Alex Christensen.

Source/WebCore:

The issue is that the test calls loadHTMLString then loadRequest right after, without
waiting for the first load to complete first. loadHTMLString is special as it relies
on substitute data and which schedules a timer to commit the data. When doing the
navigation policy check for the following loadRequest(), the substitute data timer
would fire and commit its data and load. This would in turn cancel the pending
navigation policy check for the loadRequest().

With sync policy delegates, this is not an issue because we take care of stopping
all loaders when receiving the policy decision, which happens synchronously. However,
when the policy decision happens asynchronously, the pending substitute data load
does not get cancelled in time and it gets committed.

To address the issue, we now cancel any pending provisional load before doing the
navigation policy check.

Test: fast/loader/inner-iframe-loads-data-url-into-parent-on-unload-crash-async-delegate.html

* loader/FrameLoader.cpp:
(WebCore::FrameLoader::clearProvisionalLoadForPolicyCheck):
* loader/FrameLoader.h:
* loader/PolicyChecker.cpp:
(WebCore::PolicyChecker::checkNavigationPolicy):
Cancel any pending provisional load before starting the navigation policy check. This call
needs to be here rather than in the call site of policyChecker().checkNavigationPolicy()
because there is code in PolicyChecker::checkNavigationPolicy() which relies on
FrameLoader::activeDocumentLoader().
Also, we only cancel the provisional load if there is a policy document loader. In some
rare cases (when we receive a redirect after navigation policy has been decided for the
initial request), the provisional document loader needs to receive navigation policy
decisions so we cannot clear the provisional document loader in such case.

Tools:

Add API test coverage.

* TestWebKitAPI/Tests/WebKitCocoa/WebsitePolicies.mm:
(-[AsyncAutoplayPoliciesDelegate webView:decidePolicyForNavigationAction:decisionHandler:]):
(-[AsyncAutoplayPoliciesDelegate _webView:decidePolicyForNavigationAction:decisionHandler:]):
(-[AsyncAutoplayPoliciesDelegate _webView:handleAutoplayEvent:withFlags:]):
(TEST):

LayoutTests:

Add variant of fast/loader/inner-iframe-loads-data-url-into-parent-on-unload-crash.html with async navigation
delegate since the previous iteration of this patch broke this test case.

* fast/loader/inner-iframe-loads-data-url-into-parent-on-unload-crash-async-delegate-expected.txt: Added.
* fast/loader/inner-iframe-loads-data-url-into-parent-on-unload-crash-async-delegate.html: Added.

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

16 months agoREGRESSION(r225340): WPE port should not be getting EGL X11 types on ANGLE
clopez@igalia.com [Mon, 19 Mar 2018 22:05:17 +0000 (22:05 +0000)]
REGRESSION(r225340): WPE port should not be getting EGL X11 types on ANGLE
https://bugs.webkit.org/show_bug.cgi?id=183749

Reviewed by Alex Christensen.

Add back the USE_WPE ifdef.

* changes.diff:
* include/EGL/eglplatform.h:

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

16 months agoWeb Inspector: clean up WKWebView configuration code
bburg@apple.com [Mon, 19 Mar 2018 21:22:51 +0000 (21:22 +0000)]
Web Inspector: clean up WKWebView configuration code
https://bugs.webkit.org/show_bug.cgi?id=183747
<rdar://problem/38629343>

Reviewed by Timothy Hatcher.

* UIProcess/mac/WKInspectorViewController.mm:
(-[WKInspectorViewController webView]): Always use system
appearance for Inspector's web content.

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

16 months ago[Extra zoom mode] Require fullscreen for video playback
eric.carlson@apple.com [Mon, 19 Mar 2018 21:22:15 +0000 (21:22 +0000)]
[Extra zoom mode] Require fullscreen for video playback
https://bugs.webkit.org/show_bug.cgi?id=183742
<rdar://problem/38235862>

Reviewed by Jer Noble.

Source/WebCore:

* Modules/modern-media-controls/media/playback-support.js:
(PlaybackSupport.prototype.syncControl): Always show the play button.
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::updatePlayState): Return immediately if playback requires fullscreen
(WebCore::HTMLMediaElement::didBecomeFullscreenElement): Call updatePlayState in case
playback is pending.
* html/HTMLMediaElement.h:
* platform/cocoa/VideoFullscreenModel.h:
(WebCore::VideoFullscreenModel::presentingViewController): New.
(WebCore::VideoFullscreenModel::createVideoFullscreenViewController): New.
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayerLayer):
(WebCore::MediaPlayerPrivateAVFoundationObjC::setVideoFullscreenMode):
* platform/ios/PlaybackSessionInterfaceAVKit.mm:
(WebCore::PlaybackSessionInterfaceAVKit::seekableRangesChanged):

* platform/ios/VideoFullscreenInterfaceAVKit.h:
* platform/ios/VideoFullscreenInterfaceAVKit.mm: Wrap AVPlayerLayerView so we can change its
behavior.
(WebAVPlayerLayerView_playerLayer):
(WebAVPlayerLayerView_videoView):
(allocWebAVPlayerLayerViewInstance):
(-[WebAVPlayerViewController initWithFullscreenInterface:]):
(-[WebAVPlayerViewController playerViewControllerShouldHandleDoneButtonTap:]):
(-[WebAVPlayerViewController enterFullScreenAnimated:completionHandler:]):
(-[WebAVPlayerViewController exitFullScreenAnimated:completionHandler:]):
(-[WebAVPlayerViewController NO_RETURN_DUE_TO_ASSERT]):
(-[WebAVPlayerViewController isPictureInPicturePossible]):
(-[WebAVPlayerViewController isPictureInPictureActive]):
(-[WebAVPlayerViewController isPictureInPictureSuspended]):
(-[WebAVPlayerViewController pictureInPictureActive]):
(-[WebAVPlayerViewController pictureInPictureWasStartedWhenEnteringBackground]):
(-[WebAVPlayerViewController view]):
(-[WebAVPlayerViewController showsPlaybackControls]):
(-[WebAVPlayerViewController setShowsPlaybackControls:]):
(-[WebAVPlayerViewController setAllowsPictureInPicturePlayback:]):
(-[WebAVPlayerViewController setDelegate:]):
(-[WebAVPlayerViewController setPlayerController:]):
(-[WebAVPlayerViewController avPlayerViewController]):
(-[WebAVPlayerViewController removeFromParentViewController]):
(VideoFullscreenInterfaceAVKit::setupFullscreen):
(fallbackViewController):
(VideoFullscreenInterfaceAVKit::presentingViewController):
(VideoFullscreenInterfaceAVKit::shouldExitFullscreenWithReason):
(VideoFullscreenInterfaceAVKit::doSetup):
(WebCore::supportsPictureInPicture):

Source/WebCore/PAL:

* pal/spi/cocoa/AVKitSPI.h:

Source/WebKit:

* UIProcess/Cocoa/VideoFullscreenManagerProxy.h:
* UIProcess/Cocoa/VideoFullscreenManagerProxy.mm:
(-[WKVideoFullScreenViewController initWithAVPlayerViewController:]):
(-[WKVideoFullScreenViewController viewDidLoad]):
(-[WKVideoFullScreenViewController prefersStatusBarHidden]):
(WebKit::VideoFullscreenModelContext::presentingViewController):
(WebKit::VideoFullscreenModelContext::createVideoFullscreenViewController):
* WebProcess/cocoa/VideoFullscreenManager.mm:
(WebKit::VideoFullscreenManager::didEnterFullscreen):

Source/WTF:

* wtf/Platform.h:

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

16 months agotest-webkitpy no longer runs WebKit2 tests
dbates@webkit.org [Mon, 19 Mar 2018 21:12:17 +0000 (21:12 +0000)]
test-webkitpy no longer runs WebKit2 tests
https://bugs.webkit.org/show_bug.cgi?id=183724

Reviewed by Alexey Proskuryakov.

Source/WebKit:

Fixes an issue where Python emits errors "global name reset_results is not defined" when
running tests in messages_unittest.py using test-webkitpy.

Currently messages_unittest.py conditionally defines the global variable reset_results
when run as the main program (i.e. __name__ == "__main__"). When messages_unittest.py is
imported as a module as test-webkitpy does then it is not considered the main program
;=> the top-level script environment is not __main__ ;=> we do not define the global
variable reset_results. Instead we should unconditionally define the global variable
reset_results.

* Scripts/webkit/messages_unittest.py:

Tools:

The WebKit2 tests have seen been moved from Source/WebKit2/Scripts/webkit2 to Source/WebKit/Scripts/webkit.

* Scripts/webkitpy/test/main.py:
(main):

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

16 months agoMake run-webkit-app work for non-GUI apps
dbates@webkit.org [Mon, 19 Mar 2018 20:49:03 +0000 (20:49 +0000)]
Make run-webkit-app work for non-GUI apps
https://bugs.webkit.org/show_bug.cgi?id=183701

Reviewed by Lucas Forschler.

Launch the app directly if it is an executable file. Otherwise, assume it is an app bundle
and launch it using open(1) as we currently do.

Note that open(1) is meant for launching GUI apps. Standard output and standard error are
not sent to the tty when using open(1) to launch a non-GUI app.

* Scripts/run-webkit-app: We make the assumption that
* Scripts/webkitdirs.pm:
    - Define and export constant DO_NOT_USE_OPEN_COMMAND.

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

16 months agorun-webkit-app -g does not work
dbates@webkit.org [Mon, 19 Mar 2018 20:43:36 +0000 (20:43 +0000)]
run-webkit-app -g does not work
https://bugs.webkit.org/show_bug.cgi?id=183699

Reviewed by Lucas Forschler.

Check for the optional command line argument -g/--guard-malloc before taking the
first argument passed to be the path to the app to run.

* Scripts/run-webkit-app:

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

16 months agoFunctionPtr should be passed by value.
mark.lam@apple.com [Mon, 19 Mar 2018 20:22:30 +0000 (20:22 +0000)]
FunctionPtr should be passed by value.
https://bugs.webkit.org/show_bug.cgi?id=183746
<rdar://problem/38625311>

Reviewed by JF Bastien.

It's meant to be an encapsulation of a C/C++ function pointer.  There are cases
where we use it to pass JIT compiled code (e.g. the VM thunks/stubs), but they are
treated as if they are C/C++ functions.

Regardless, there's no need to pass it by reference.

* assembler/MacroAssemblerCodeRef.h:
* dfg/DFGJITCompiler.h:
(JSC::DFG::JITCompiler::appendCall):
* dfg/DFGSpeculativeJIT.h:
(JSC::DFG::SpeculativeJIT::appendCall):
(JSC::DFG::SpeculativeJIT::appendCallWithCallFrameRollbackOnException):
(JSC::DFG::SpeculativeJIT::appendCallWithCallFrameRollbackOnExceptionSetResult):
(JSC::DFG::SpeculativeJIT::appendCallSetResult):
* jit/JIT.h:
(JSC::JIT::appendCall):
(JSC::JIT::appendCallWithSlowPathReturnType):
* jit/JITInlines.h:
(JSC::JIT::appendCallWithExceptionCheck):
(JSC::JIT::appendCallWithExceptionCheckAndSlowPathReturnType):
(JSC::JIT::appendCallWithCallFrameRollbackOnException):
(JSC::JIT::appendCallWithExceptionCheckSetJSValueResult):
(JSC::JIT::appendCallWithExceptionCheckSetJSValueResultWithProfile):

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

16 months agoUnreviewed, a quick fix for r229699
jiewen_tan@apple.com [Mon, 19 Mar 2018 20:06:21 +0000 (20:06 +0000)]
Unreviewed, a quick fix for r229699

* pal/spi/cocoa/DeviceIdentitySPI.h:

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

16 months agoWhen the WebContent process is blocked from accessing the WindowServer, the call...
pvollan@apple.com [Mon, 19 Mar 2018 18:04:39 +0000 (18:04 +0000)]
When the WebContent process is blocked from accessing the WindowServer, the call CVDisplayLinkCreateWithCGDisplay will fail.
https://bugs.webkit.org/show_bug.cgi?id=183604
<rdar://problem/38305109>

Reviewed by Brent Fulgham.

Source/WebCore:

The call to CVDisplayLinkCreateWithCGDisplay can instead be made in the UIProcess. Notify the WebContent process
about display updates by sending a message from the UIProcess on each screen update. This patch adds an extra
IPC step when notifying the WebContent process about display updates. However, the MotionMark benchmark shows no
performance regression when running it with this patch. A possible explanation for this is that the high priority
display link thread is now running in the UIProcess instead of the WebContent process, which means there will be
more available CPU resources for the WebContent process. A run loop observer is added to make sure that only one
display callback (for each display observer) is executed in a single iteration of the run loop. This will make
sure we are not filling the IPC message queue with unhandled display link messages.

No new tests, covered by existing tests.

* platform/graphics/DisplayRefreshMonitor.h:
(WebCore::DisplayRefreshMonitor::displayLinkFired):
* platform/graphics/DisplayRefreshMonitorManager.cpp:
(WebCore::DisplayRefreshMonitorManager::displayWasUpdated):
* platform/graphics/DisplayRefreshMonitorManager.h:
* platform/graphics/mac/DisplayRefreshMonitorMac.h:

Source/WebKit:

* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* UIProcess/mac/DisplayLink.cpp: Added.
(WebKit::DisplayLink::DisplayLink):
(WebKit::DisplayLink::~DisplayLink):
(WebKit::DisplayLink::displayLinkCallback):
* UIProcess/mac/DisplayLink.h: Added.
* UIProcess/mac/WebPageProxyMac.mm:
(WebKit::WebPageProxy::startDisplayRefreshMonitor):
(WebKit::WebPageProxy::stopDisplayRefreshMonitor):
* WebKit.xcodeproj/project.pbxproj:
* WebProcess/WebPage/DrawingArea.cpp:
(WebKit::DrawingArea::createDisplayRefreshMonitor):
* WebProcess/WebPage/DrawingArea.h:
* WebProcess/WebPage/DrawingArea.messages.in:
* WebProcess/WebPage/mac/DrawingAreaMac.cpp: Added.
(WebKit::DisplayRefreshMonitorMac::create):
(WebKit::DisplayRefreshMonitorMac::DisplayRefreshMonitorMac):
(WebKit::DisplayRefreshMonitorMac::~DisplayRefreshMonitorMac):
(WebKit::DisplayRefreshMonitorMac::requestRefreshCallback):
(WebKit::DisplayRefreshMonitorMac::displayLinkFired):
(WebKit::DrawingArea::screenWasRefreshed):
(WebKit::DrawingArea::createDisplayRefreshMonitor):

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

16 months agoEnsure local appearance actually mirrors the app's appearance
megan_gardner@apple.com [Mon, 19 Mar 2018 17:29:57 +0000 (17:29 +0000)]
Ensure local appearance actually mirrors the app's appearance
https://bugs.webkit.org/show_bug.cgi?id=183743

Reviewed by Tim Horton.

Not currently testable, will add tests in a later patch.

Current appearance isn't always accurate by default and needs to be set manually.

* platform/mac/LocalDefaultSystemAppearance.mm:
(WebCore::LocalDefaultSystemAppearance::LocalDefaultSystemAppearance):

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

17 months agoUnreviewed GCC 4.9 build-fix after r229672.
zandobersek@gmail.com [Mon, 19 Mar 2018 08:40:56 +0000 (08:40 +0000)]
Unreviewed GCC 4.9 build-fix after r229672.

* platform/graphics/nicosia/cairo/NicosiaCairoOperationRecorder.cpp:
(Nicosia::createCommand): Don't depend on implicit conversion of the
returning std::unique_ptr<> object, and instead only wrap the
heap-allocated PaintingOperation-derived in a std::unique_ptr<> at the
point of return.

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

17 months agoUnreviewed, rolling out r229689.
commit-queue@webkit.org [Mon, 19 Mar 2018 03:38:39 +0000 (03:38 +0000)]
Unreviewed, rolling out r229689.
https://bugs.webkit.org/show_bug.cgi?id=183735

Causes fast/loader/inner-iframe-loads-data-url-into-parent-on-
unload-crash.html to fail with async delegates (Requested by
cdumez_ on #webkit).

Reverted changeset:

"WebKit.WebsitePoliciesAutoplayQuirks API test times out with
async policy delegates"
https://bugs.webkit.org/show_bug.cgi?id=183702
https://trac.webkit.org/changeset/229689

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

17 months ago[LayoutReloaded] Remove left/right width/height getters from Layout.Box
zalan@apple.com [Mon, 19 Mar 2018 03:00:26 +0000 (03:00 +0000)]
[LayoutReloaded] Remove left/right width/height getters from Layout.Box
https://bugs.webkit.org/show_bug.cgi?id=183734

Reviewed by Antti Koivisto.

...and use Display.Box instead.

* LayoutReloaded/DisplayTree/Box.js:
(Display.Box.prototype.bottomRight):
(Display.Box.prototype.size):
(Display.Box.prototype.height):
(Display.Box.prototype.width):
* LayoutReloaded/FormattingContext/BlockFormatting/BlockFormattingContext.js:
(BlockFormattingContext.prototype._computeStaticPosition):
(BlockFormattingContext.prototype._adjustBottomWithFIXME):
(BlockFormattingContext.prototype._computeInFlowPositionedPosition):
(BlockFormattingContext.prototype._computeOutOfFlowPosition):
* LayoutReloaded/FormattingContext/FloatingContext.js:
(FloatingContext.prototype._positionForClear):
(FloatingContext.prototype._computePositionToAvoidIntrudingFloats):
(FloatingContext.prototype._adjustedFloatingPosition):
* LayoutReloaded/FormattingContext/FormattingContext.js:
(FormattingContext.prototype.absoluteMarginBox):
(FormattingContext.prototype.absoluteBorderBox):
(FormattingContext.prototype.absolutePaddingBox):
(FormattingContext.prototype.absoluteContentBox):
(FormattingContext.prototype._toAbsolutePosition):
(FormattingContext.prototype._toRootAbsolutePosition):
* LayoutReloaded/LayoutTree/Box.js:
(Layout.Box.prototype.rect): Deleted.
(Layout.Box.prototype.topLeft): Deleted.
(Layout.Box.prototype.bottomRight): Deleted.
* LayoutReloaded/Utils.js:
(Utils._dumpBox):
(Utils.mapToContainer): Deleted.

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

17 months ago[LayoutReloaded] Remove left/right width/height setters from Layout.Box
zalan@apple.com [Mon, 19 Mar 2018 01:28:58 +0000 (01:28 +0000)]
[LayoutReloaded] Remove left/right width/height setters from Layout.Box
https://bugs.webkit.org/show_bug.cgi?id=183731

Reviewed by Antti Koivisto.

...and use Display.Box instead.

* LayoutReloaded/FormattingContext/BlockFormatting/BlockFormattingContext.js:
(BlockFormattingContext.prototype._computeStaticPosition):
(BlockFormattingContext.prototype._computeOutOfFlowWidth):
(BlockFormattingContext.prototype._computeFloatingWidth):
(BlockFormattingContext.prototype._computeInFlowWidth):
(BlockFormattingContext.prototype._computeOutOfFlowHeight):
(BlockFormattingContext.prototype._computeFloatingHeight):
(BlockFormattingContext.prototype._computeInFlowHeight):
(BlockFormattingContext.prototype._computeInFlowPositionedPosition):
(BlockFormattingContext.prototype._computeOutOfFlowPosition):
* LayoutReloaded/FormattingContext/FloatingContext.js:
(FloatingContext.prototype.computePosition):
* LayoutReloaded/FormattingContext/FormattingContext.js:
(FormattingContext.prototype._toDisplayBox):
(FormattingContext.prototype._toLayoutBox):
* LayoutReloaded/Layout.js:
(layout):
* LayoutReloaded/LayoutTree/Box.js:
(Layout.Box.prototype.setTopLeft): Deleted.
(Layout.Box.prototype.setSize): Deleted.
(Layout.Box.prototype.setWidth): Deleted.
(Layout.Box.prototype.setHeight): Deleted.

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

17 months ago[LayoutReloaded] Collect out-of-flow positioned boxes for a given formatting context.
zalan@apple.com [Sun, 18 Mar 2018 16:41:46 +0000 (16:41 +0000)]
[LayoutReloaded] Collect out-of-flow positioned boxes for a given formatting context.
https://bugs.webkit.org/show_bug.cgi?id=183730

Reviewed by Antti Koivisto.

Collect and layout out-of-flow positioned boxes as the final step of the formatting context layout.

* LayoutReloaded/FormattingContext/BlockFormatting/BlockFormattingContext.js:
(BlockFormattingContext.prototype.layout):
(BlockFormattingContext.prototype._placeInFlowPositionedChildren):
(BlockFormattingContext.prototype._layoutOutOfFlowDescendants):
(BlockFormattingContext.prototype._placePositionedDescendants): Deleted.
(BlockFormattingContext.prototype._placeOutOfFlowDescendants): Deleted.
* LayoutReloaded/FormattingContext/FormattingContext.js:
(FormattingContext.prototype._toAbsolutePosition):
(FormattingContext.prototype._outOfFlowDescendants):
(FormattingContext):
* LayoutReloaded/LayoutTree/Box.js:
(Layout.Box.prototype.nextInFlowOrFloatSibling):
(Layout.Box.prototype.isDescendantOf):
* LayoutReloaded/LayoutTree/Container.js:
(Layout.Container.prototype.firstInFlowOrFloatChild):
(Layout.Container.prototype.hasInFlowOrFloatChild):
(Layout.Container.prototype.outOfFlowDescendants):
(Layout.Container):
* LayoutReloaded/Utils.js:
(Utils.isDescendantOf): Deleted.
(Utils.collectOutOfFlowDescendants): Deleted.

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

17 months agoCorrect redefined fnfErr type
timothy_horton@apple.com [Sun, 18 Mar 2018 05:53:13 +0000 (05:53 +0000)]
Correct redefined fnfErr type
https://bugs.webkit.org/show_bug.cgi?id=183728
<rdar://problem/38590063>

Reviewed by Dan Bernstein.

* platform/network/cf/FormDataStreamCFNet.cpp:
CFStreamError's error parameter takes a SInt32, not an int.
Make sure our redefinition has a compatible type.

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

17 months ago[WebAuthN] Implement authenticatorMakeCredential
jiewen_tan@apple.com [Sun, 18 Mar 2018 01:12:48 +0000 (01:12 +0000)]
[WebAuthN] Implement authenticatorMakeCredential
https://bugs.webkit.org/show_bug.cgi?id=183527
<rdar://problem/35275886>

Reviewed by Brent Fulgham.

Source/WebCore:

This patch does the following few things:
1) It implements the authenticatorMakeCredential logic from the spec: https://www.w3.org/TR/webauthn/#op-make-cred.
2) It tweaks enocding and deocding of PublicKeyCredentialCreationOptions between UIProccess and WebProcess.
3) It soft links LocalAuthentication.Framework to WebCore, which was linked to WebKit.
4) It creates SPI header for DeviceIdentity.Framework, and provides stubs to link it to WebCore.

Here is a detailed explanantion of 1):
1. A helper class called LocalAuthenticator is crafted to represent Apple platform attached authenticator, i.e.
the devices themselves. All operations are currently restricted to iOS at this moment as macOS lacks attestation
support.
2. To do testing, this helper class is then moved from WebKit to WebCore even though all operations can only happens
in the UIProcess. We currently lack the ability to pretend a https environment in TestWebKitAPI which is required by
the WebAuthN API, and thus it is moved to WebCore to perform unit tesing flavor API tests. This is not enough as it
can't test message exchange between the UI and Web processes. We will address this in a subsequent patch.
3. More on testing: The attestation process is abstracted into a protected method such that the testing enviroment can
override it with self attestation as network access is restricted in the WebKit testing enviroment. Also, swizzlers of
LocalAuthentication API are provided to override the behavoir of LAContext.
4. More on testing: The actual Apple attestation can only happen in real device and with network access, therefore
it can only be covered by manual tests at this moment.
5. Back to LocalAuthenticator, it currently has two public methods:
        5.1. makeCredential(): This method is the one does all the magic.
        + It first checks some parameters.
        + It then invokes LAContext to get user consent.
        + It then talks to Apple Attestation Privacy CA to do attestations.
        + It then stores necessary information into the Keychain.
        + Finally it generates the attestation object.
        5.2 isAvailable():
        To check if a LocalAuthenticator is available or not.
6. Even though files are of .mm format, they are written in a way that mixes NS, CF and C++ types. Here is the rule:
        6.1 Use CF type only if it is requested by APIs.
        6.2 Use NS type to manipulate all Objc objects.
        6.3 Use C++ otherwise.

Covered by API tests.

* Configurations/WebCore.xcconfig:
* Modules/credentialmanagement/CredentialsMessenger.cpp:
(WebCore::getIdFromAttestationObject): Deleted.
Decoding attestation object is tedious. UIProcess will instead return credential ID and attestation object
at the same time. Therefore, this method is removed.
* Modules/credentialmanagement/CredentialsMessenger.h:
(WebCore::CreationReturnBundle::CreationReturnBundle): Deleted.
(WebCore::AssertionReturnBundle::AssertionReturnBundle): Deleted.
* Modules/webauthn/COSEConstants.h: Copied from Source/WebCore/Modules/webauthn/PublicKeyCredentialType.h.
* Modules/webauthn/PublicKeyCredentialCreationOptions.h:
(WebCore::PublicKeyCredentialCreationOptions::isolatedPartialCopyPtr const):
(WebCore::PublicKeyCredentialCreationOptions::Parameters::encode const):
(WebCore::PublicKeyCredentialCreationOptions::Parameters::decode):
(WebCore::PublicKeyCredentialCreationOptions::encode const):
(WebCore::PublicKeyCredentialCreationOptions::decode):
* Modules/webauthn/PublicKeyCredentialDescriptor.h:
(WebCore::PublicKeyCredentialDescriptor::encode const):
(WebCore::PublicKeyCredentialDescriptor::decode):
* Modules/webauthn/PublicKeyCredentialType.h:
* Modules/webauthn/cocoa/LocalAuthenticator.h: Copied from Source/WebCore/Modules/webauthn/PublicKeyCredentialCreationOptions.h.
* Modules/webauthn/cocoa/LocalAuthenticator.mm: Added.
(WebCore::LocalAuthenticatorInternal::freePtrs):
(WebCore::LocalAuthenticator::makeCredential const):
(WebCore::LocalAuthenticator::isAvailable const):
(WebCore::LocalAuthenticator::issueClientCertificate const):
* SourcesCocoa.txt:
* WebCore.xcodeproj/project.pbxproj:
* platform/cocoa/LocalAuthenticationSoftLink.h: Copied from Source/WebCore/Modules/webauthn/PublicKeyCredentialType.h.
* platform/cocoa/LocalAuthenticationSoftLink.mm: Added.
* testing/MockCredentialsMessenger.cpp:
(WebCore::MockCredentialsMessenger::setCreationReturnBundle):
(WebCore::MockCredentialsMessenger::makeCredential):
(WebCore::MockCredentialsMessenger::makeCredentialReply):
(WebCore::MockCredentialsMessenger::setAttestationObject): Deleted.
* testing/MockCredentialsMessenger.h:
* testing/MockCredentialsMessenger.idl:

Source/WebCore/PAL:

* PAL.xcodeproj/project.pbxproj:
* pal/spi/cocoa/DeviceIdentitySPI.h: Copied from Source/WebKit/UIProcess/CredentialManagement/WebCredentialsMessengerProxy.h.

Source/WebKit:

* UIProcess/CredentialManagement/WebCredentialsMessengerProxy.cpp:
(WebKit::WebCredentialsMessengerProxy::WebCredentialsMessengerProxy):
(WebKit::WebCredentialsMessengerProxy::makeCredential):
(WebKit::WebCredentialsMessengerProxy::getAssertion):
(WebKit::WebCredentialsMessengerProxy::isUserVerifyingPlatformAuthenticatorAvailable):
(WebKit::WebCredentialsMessengerProxy::exceptionReply):
(WebKit::WebCredentialsMessengerProxy::makeCredentialReply):
* UIProcess/CredentialManagement/WebCredentialsMessengerProxy.h:
* UIProcess/CredentialManagement/WebCredentialsMessengerProxy.messages.in:
* UIProcess/CredentialManagement/cocoa/WebCredentialsMessengerProxyCocoa.mm: Removed.
* WebKit.xcodeproj/project.pbxproj:
* WebProcess/CredentialManagement/WebCredentialsMessenger.cpp:
(WebKit::WebCredentialsMessenger::makeCredential):
(WebKit::WebCredentialsMessenger::makeCredentialReply):
* WebProcess/CredentialManagement/WebCredentialsMessenger.h:
* WebProcess/CredentialManagement/WebCredentialsMessenger.messages.in:

Tools:

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/ios/LocalAuthenticator.mm: Added.
(TestWebKitAPI::getTestKey):
(TestWebKitAPI::cleanUpKeychain):
(TestWebKitAPI::LACantEvaluatePolicySwizzler::LACantEvaluatePolicySwizzler):
(TestWebKitAPI::LACantEvaluatePolicySwizzler::cantEvaluatePolicy):
(TestWebKitAPI::LACanEvaluatePolicySwizzler::LACanEvaluatePolicySwizzler):
(TestWebKitAPI::LACanEvaluatePolicySwizzler::canEvaluatePolicy):
(TestWebKitAPI::LAEvaluatePolicyFailedSwizzler::LAEvaluatePolicyFailedSwizzler):
(TestWebKitAPI::LAEvaluatePolicyFailedSwizzler::evaluatePolicyFailed):
(TestWebKitAPI::LAEvaluatePolicyPassedSwizzler::LAEvaluatePolicyPassedSwizzler):
(TestWebKitAPI::LAEvaluatePolicyPassedSwizzler::evaluatePolicyPassed):
(TestWebKitAPI::TestLocalAuthenticator::setFailureFlag):
(TestWebKitAPI::TEST):

WebKitLibraries:

* WebKitPrivateFrameworkStubs/iOS/11/DeviceIdentity.framework/DeviceIdentity.tbd: Added.

LayoutTests:

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

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

17 months ago[LayoutReloaded] BlockFormattingContext::placePositionedDescendants takes care of...
zalan@apple.com [Sun, 18 Mar 2018 00:24:57 +0000 (00:24 +0000)]
[LayoutReloaded] BlockFormattingContext::placePositionedDescendants takes care of both in- and out-of-flow placement
https://bugs.webkit.org/show_bug.cgi?id=183727

Reviewed by Antti Koivisto.

* LayoutReloaded/FormattingContext/BlockFormatting/BlockFormattingContext.js:
(BlockFormattingContext.prototype.layout):
(BlockFormattingContext.prototype._placePositionedDescendants):
(BlockFormattingContext.prototype._placeInFlowPositionedChildren):
(BlockFormattingContext.prototype._placeOutOfFlowDescendants):
* LayoutReloaded/test/absolute-position-when-containing-block-is-not-in-the-formatting-context.html: Added.
* LayoutReloaded/test/absolute-position-when-containing-block-is-not-in-the-formatting-context2.html: Added.
* LayoutReloaded/test/index.html:
* LayoutReloaded/test/relative-position-when-containing-block-is-not-in-the-formatting-context.html: Added.

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

17 months agoTests fail in messages_unittest.py
dbates@webkit.org [Sat, 17 Mar 2018 22:35:16 +0000 (22:35 +0000)]
Tests fail in messages_unittest.py
https://bugs.webkit.org/show_bug.cgi?id=183725

Partial revert of r222113. The messages generator machinery does not know when
it is sufficient to emit an include for wtf/Forward.h as opposed to a concrete
header.

* Scripts/webkit/LegacyMessages-expected.h:
* Scripts/webkit/Messages-expected.h:

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

17 months ago[LayoutReloaded] Ensure that positioning happens within the formatting context
zalan@apple.com [Sat, 17 Mar 2018 20:49:54 +0000 (20:49 +0000)]
[LayoutReloaded] Ensure that positioning happens within the formatting context
https://bugs.webkit.org/show_bug.cgi?id=183722

Reviewed by Antti Koivisto.

All sizing and positioning need to happen in the formatting context that the box lives in
including the final position of in- and out-of-flow descendants.

* LayoutReloaded/FormattingContext/BlockFormatting/BlockFormattingContext.js:
(BlockFormattingContext.prototype.layout):
(BlockFormattingContext.prototype._placeInFlowPositionedChildren):
* LayoutReloaded/LayoutTree/Box.js:
(Layout.Box.prototype.establishesBlockFormattingContext):
(Layout.Box.prototype.isPositioned):
(Layout.Box.prototype.isRelativelyPositioned):
(Layout.Box.prototype.isAbsolutelyPositioned):
(Layout.Box.prototype.isOutOfFlowPositioned):
(Layout.Box.prototype.containingBlock):
(Layout.Box.prototype.isRelativePositioned): Deleted.
(Layout.Box.prototype.isAbsolutePositioned): Deleted.
* LayoutReloaded/Utils.js:
(Utils.isRelativelyPositioned):
(Utils.isAbsolutelyPositioned):
(Utils.isRelativePositioned): Deleted.
(Utils.isAbsolutePositioned): Deleted.
* LayoutReloaded/misc/headers/Box.h:

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

17 months agoCorrect debug assertion in Range::borderAndTextRects
bfulgham@apple.com [Sat, 17 Mar 2018 06:44:40 +0000 (06:44 +0000)]
Correct debug assertion in Range::borderAndTextRects
https://bugs.webkit.org/show_bug.cgi?id=183710
<rdar://problem/38466976>

Reviewed by Ryosuke Niwa.

Source/WebCore:

A debug assertion will fire if Range::borderAndTextRects is asked to evaluate a set of selected elements, where one of the elements does not have a parent.

We should consider a nullptr parent as satisfying the condition of a parent not being present in the selection set.

Tests: fast/dom/range/range-selection-empty-body.html

* dom/Range.cpp:
(WebCore::Range::borderAndTextRects const):

LayoutTests:

* fast/dom/Range/range-selection-empty-body-expected.txt: Added.
* fast/dom/Range/range-selection-empty-body.html: Added.

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

17 months agoPut the DOM in IsoHeaps
fpizlo@apple.com [Sat, 17 Mar 2018 06:11:00 +0000 (06:11 +0000)]
Put the DOM in IsoHeaps
https://bugs.webkit.org/show_bug.cgi?id=183546

Source/bmalloc:

Reviewed by Simon Fraser.

Make it easy to runtime-disable IsoHeaps.

* bmalloc/Allocator.h:
* bmalloc/IsoTLS.cpp:
(bmalloc::IsoTLS::determineMallocFallbackState):
* bmalloc/IsoTLS.h:
* bmalloc/IsoTLSInlines.h:
(bmalloc::IsoTLS::allocateSlow):
(bmalloc::IsoTLS::deallocateSlow):

Source/WebCore:

Reviewed by Daniel Bates.

No new tests because no change in behavior.

This puts all descendants of WebCore::Node in isoheaps, so that UAFs on the DOM cannot be
used for RCE attacks. This probably also makes it harder to use UAFs for UXSS, since it means
that DOM UAFs cannot be used for universal read gadgets.

This looks neutral on Speedometer and membuster, though I did have one round of testing
that led me to believe that membuster was regressed - I just wasn't able to reproduce that
result on subsequent testing.

* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* dom/Attr.cpp:
* dom/Attr.h:
* dom/CDATASection.cpp:
* dom/CDATASection.h:
* dom/CharacterData.cpp:
* dom/CharacterData.h:
* dom/Comment.cpp:
* dom/Comment.h:
* dom/ContainerNode.cpp:
* dom/ContainerNode.h:
* dom/Document.cpp:
* dom/Document.h:
* dom/DocumentFragment.cpp:
* dom/DocumentFragment.h:
* dom/DocumentType.cpp:
* dom/DocumentType.h:
* dom/Node.cpp:
* dom/Node.h:
* dom/ProcessingInstruction.cpp:
* dom/ProcessingInstruction.h:
* dom/PseudoElement.cpp:
* dom/PseudoElement.h:
* dom/ShadowRoot.cpp:
* dom/ShadowRoot.h:
* dom/StyledElement.cpp:
* dom/StyledElement.h:
* dom/TemplateContentDocumentFragment.cpp: Added.
* dom/TemplateContentDocumentFragment.h:
* dom/Text.cpp:
* dom/Text.h:
* dom/XMLDocument.cpp: Added.
* dom/XMLDocument.h:
* html/FTPDirectoryDocument.cpp:
* html/FTPDirectoryDocument.h:
* html/FileInputType.cpp:
* html/HTMLAnchorElement.cpp:
* html/HTMLAnchorElement.h:
* html/HTMLAppletElement.cpp:
* html/HTMLAppletElement.h:
* html/HTMLAreaElement.cpp:
* html/HTMLAreaElement.h:
* html/HTMLAttachmentElement.cpp:
* html/HTMLAttachmentElement.h:
* html/HTMLBDIElement.cpp: Added.
* html/HTMLBDIElement.h:
* html/HTMLBRElement.cpp:
* html/HTMLBRElement.h:
* html/HTMLBaseElement.cpp:
* html/HTMLBaseElement.h:
* html/HTMLBodyElement.cpp:
* html/HTMLBodyElement.h:
* html/HTMLButtonElement.cpp:
* html/HTMLButtonElement.h:
* html/HTMLCanvasElement.cpp:
* html/HTMLCanvasElement.h:
* html/HTMLDListElement.cpp:
* html/HTMLDListElement.h:
* html/HTMLDataElement.cpp:
* html/HTMLDataElement.h:
* html/HTMLDataListElement.cpp:
* html/HTMLDataListElement.h:
* html/HTMLDetailsElement.cpp:
* html/HTMLDetailsElement.h:
* html/HTMLDirectoryElement.cpp:
* html/HTMLDirectoryElement.h:
* html/HTMLDivElement.cpp:
* html/HTMLDivElement.h:
* html/HTMLDocument.cpp:
* html/HTMLDocument.h:
* html/HTMLElement.cpp:
* html/HTMLElement.h:
* html/HTMLEmbedElement.cpp:
* html/HTMLEmbedElement.h:
* html/HTMLFieldSetElement.cpp:
* html/HTMLFieldSetElement.h:
* html/HTMLFontElement.cpp:
* html/HTMLFontElement.h:
* html/HTMLFormControlElement.cpp:
* html/HTMLFormControlElement.h:
* html/HTMLFormControlElementWithState.cpp:
* html/HTMLFormControlElementWithState.h:
* html/HTMLFormElement.cpp:
* html/HTMLFormElement.h:
* html/HTMLFrameElement.cpp:
* html/HTMLFrameElement.h:
* html/HTMLFrameElementBase.cpp:
* html/HTMLFrameElementBase.h:
* html/HTMLFrameOwnerElement.cpp:
* html/HTMLFrameOwnerElement.h:
* html/HTMLFrameSetElement.cpp:
* html/HTMLFrameSetElement.h:
* html/HTMLHRElement.cpp:
* html/HTMLHRElement.h:
* html/HTMLHeadElement.cpp:
* html/HTMLHeadElement.h:
* html/HTMLHeadingElement.cpp:
* html/HTMLHeadingElement.h:
* html/HTMLHtmlElement.cpp:
* html/HTMLHtmlElement.h:
* html/HTMLIFrameElement.cpp:
* html/HTMLIFrameElement.h:
* html/HTMLImageElement.cpp:
* html/HTMLImageElement.h:
* html/HTMLInputElement.cpp:
* html/HTMLInputElement.h:
* html/HTMLKeygenElement.cpp:
* html/HTMLKeygenElement.h:
* html/HTMLLIElement.cpp:
* html/HTMLLIElement.h:
* html/HTMLLabelElement.cpp:
* html/HTMLLabelElement.h:
* html/HTMLLegendElement.cpp:
* html/HTMLLegendElement.h:
* html/HTMLLinkElement.cpp:
* html/HTMLLinkElement.h:
* html/HTMLMapElement.cpp:
* html/HTMLMapElement.h:
* html/HTMLMarqueeElement.cpp:
* html/HTMLMarqueeElement.h:
* html/HTMLMenuElement.cpp:
* html/HTMLMenuElement.h:
* html/HTMLMenuItemElement.cpp:
* html/HTMLMenuItemElement.h:
* html/HTMLMetaElement.cpp:
* html/HTMLMetaElement.h:
* html/HTMLMeterElement.cpp:
* html/HTMLMeterElement.h:
* html/HTMLModElement.cpp:
* html/HTMLModElement.h:
* html/HTMLOListElement.cpp:
* html/HTMLOListElement.h:
* html/HTMLObjectElement.cpp:
* html/HTMLObjectElement.h:
* html/HTMLOptGroupElement.cpp:
* html/HTMLOptGroupElement.h:
* html/HTMLOptionElement.cpp:
* html/HTMLOptionElement.h:
* html/HTMLOutputElement.cpp:
* html/HTMLOutputElement.h:
* html/HTMLParagraphElement.cpp:
* html/HTMLParagraphElement.h:
* html/HTMLParamElement.cpp:
* html/HTMLParamElement.h:
* html/HTMLPictureElement.cpp:
* html/HTMLPictureElement.h:
* html/HTMLPlugInElement.cpp:
* html/HTMLPlugInElement.h:
* html/HTMLPlugInImageElement.cpp:
* html/HTMLPlugInImageElement.h:
* html/HTMLPreElement.cpp:
* html/HTMLPreElement.h:
* html/HTMLProgressElement.cpp:
* html/HTMLProgressElement.h:
* html/HTMLQuoteElement.cpp:
* html/HTMLQuoteElement.h:
* html/HTMLScriptElement.cpp:
* html/HTMLScriptElement.h:
* html/HTMLSelectElement.cpp:
* html/HTMLSelectElement.h:
* html/HTMLSlotElement.cpp:
* html/HTMLSlotElement.h:
* html/HTMLSourceElement.cpp:
* html/HTMLSourceElement.h:
* html/HTMLSpanElement.cpp:
* html/HTMLSpanElement.h:
* html/HTMLStyleElement.cpp:
* html/HTMLStyleElement.h:
* html/HTMLSummaryElement.cpp:
* html/HTMLSummaryElement.h:
* html/HTMLTableCaptionElement.cpp:
* html/HTMLTableCaptionElement.h:
* html/HTMLTableCellElement.cpp:
* html/HTMLTableCellElement.h:
* html/HTMLTableColElement.cpp:
* html/HTMLTableColElement.h:
* html/HTMLTableElement.cpp:
* html/HTMLTableElement.h:
* html/HTMLTablePartElement.cpp:
* html/HTMLTablePartElement.h:
* html/HTMLTableRowElement.cpp:
* html/HTMLTableRowElement.h:
* html/HTMLTableSectionElement.cpp:
* html/HTMLTableSectionElement.h:
* html/HTMLTemplateElement.cpp:
* html/HTMLTemplateElement.h:
* html/HTMLTextAreaElement.cpp:
* html/HTMLTextAreaElement.h:
* html/HTMLTextFormControlElement.cpp:
* html/HTMLTextFormControlElement.h:
* html/HTMLTimeElement.cpp:
* html/HTMLTimeElement.h:
* html/HTMLTitleElement.cpp:
* html/HTMLTitleElement.h:
* html/HTMLTrackElement.cpp:
* html/HTMLTrackElement.h:
* html/HTMLUListElement.cpp:
* html/HTMLUListElement.h:
* html/HTMLUnknownElement.cpp: Added.
* html/HTMLUnknownElement.h:
* html/HTMLWBRElement.cpp:
* html/HTMLWBRElement.h:
* html/ImageDocument.cpp:
* html/ImageDocument.h:
* html/LabelableElement.cpp:
* html/LabelableElement.h:
* html/MediaController.cpp:
(MediaController::create): Deleted.
(MediaController::MediaController): Deleted.
(MediaController::addMediaElement): Deleted.
(MediaController::removeMediaElement): Deleted.
(MediaController::containsMediaElement const): Deleted.
(MediaController::buffered const): Deleted.
(MediaController::seekable const): Deleted.
(MediaController::played): Deleted.
(MediaController::duration const): Deleted.
(MediaController::currentTime const): Deleted.
(MediaController::setCurrentTime): Deleted.
(MediaController::unpause): Deleted.
(MediaController::play): Deleted.
(MediaController::pause): Deleted.
(MediaController::setDefaultPlaybackRate): Deleted.
(MediaController::playbackRate const): Deleted.
(MediaController::setPlaybackRate): Deleted.
(MediaController::setVolume): Deleted.
(MediaController::setMuted): Deleted.
(playbackStateWaiting): Deleted.
(playbackStatePlaying): Deleted.
(playbackStateEnded): Deleted.
(MediaController::playbackState const): Deleted.
(MediaController::reportControllerState): Deleted.
(eventNameForReadyState): Deleted.
(MediaController::updateReadyState): Deleted.
(MediaController::updatePlaybackState): Deleted.
(MediaController::updateMediaElements): Deleted.
(MediaController::bringElementUpToSpeed): Deleted.
(MediaController::isBlocked const): Deleted.
(MediaController::hasEnded const): Deleted.
(MediaController::scheduleEvent): Deleted.
(MediaController::asyncEventTimerFired): Deleted.
(MediaController::clearPositionTimerFired): Deleted.
(MediaController::hasAudio const): Deleted.
(MediaController::hasVideo const): Deleted.
(MediaController::hasClosedCaptions const): Deleted.
(MediaController::setClosedCaptionsVisible): Deleted.
(MediaController::supportsScanning const): Deleted.
(MediaController::beginScrubbing): Deleted.
(MediaController::endScrubbing): Deleted.
(MediaController::beginScanning): Deleted.
(MediaController::endScanning): Deleted.
(MediaController::canPlay const): Deleted.
(MediaController::isLiveStream const): Deleted.
(MediaController::hasCurrentSrc const): Deleted.
(MediaController::returnToRealtime): Deleted.
(MediaController::startTimeupdateTimer): Deleted.
(MediaController::scheduleTimeupdateEvent): Deleted.
* html/MediaDocument.cpp:
* html/MediaDocument.h:
* html/PluginDocument.cpp:
* html/PluginDocument.h:
* html/RubyElement.cpp:
* html/RubyElement.h:
* html/RubyTextElement.cpp:
* html/RubyTextElement.h:
* html/TextDocument.cpp:
* html/TextDocument.h:
* html/shadow/AutoFillButtonElement.cpp:
* html/shadow/AutoFillButtonElement.h:
* html/shadow/DetailsMarkerControl.cpp:
* html/shadow/DetailsMarkerControl.h:
* html/shadow/ImageControlsRootElement.cpp:
* html/shadow/ImageControlsRootElement.h:
* html/shadow/MediaControlElementTypes.cpp:
* html/shadow/MediaControlElementTypes.h:
* html/shadow/MediaControlElements.cpp:
* html/shadow/MediaControlElements.h:
* html/shadow/MediaControls.cpp:
* html/shadow/MediaControls.h:
* html/shadow/ProgressShadowElement.cpp:
* html/shadow/ProgressShadowElement.h:
* html/shadow/SliderThumbElement.cpp:
* html/shadow/SliderThumbElement.h:
* html/shadow/SpinButtonElement.cpp:
* html/shadow/SpinButtonElement.h:
* html/shadow/TextControlInnerElements.cpp:
* html/shadow/TextControlInnerElements.h:
* html/shadow/YouTubeEmbedShadowElement.cpp:
* html/shadow/YouTubeEmbedShadowElement.h:
* html/shadow/mac/ImageControlsButtonElementMac.cpp:
* html/shadow/mac/ImageControlsButtonElementMac.h:
* html/shadow/mac/ImageControlsRootElementMac.cpp:
* html/shadow/mac/ImageControlsRootElementMac.h:
* html/track/TextTrackCueGeneric.cpp:
* html/track/VTTCue.cpp:
* html/track/VTTCue.h:
* html/track/WebVTTElement.cpp:
* html/track/WebVTTElement.h:
* loader/SinkDocument.cpp:
* loader/SinkDocument.h:
* mathml/MathMLAnnotationElement.cpp:
* mathml/MathMLAnnotationElement.h:
* mathml/MathMLElement.cpp:
* mathml/MathMLElement.h:
* mathml/MathMLFractionElement.cpp:
* mathml/MathMLFractionElement.h:
* mathml/MathMLMathElement.cpp:
* mathml/MathMLMathElement.h:
* mathml/MathMLMencloseElement.cpp:
* mathml/MathMLMencloseElement.h:
* mathml/MathMLOperatorElement.cpp:
* mathml/MathMLOperatorElement.h:
* mathml/MathMLPaddedElement.cpp:
* mathml/MathMLPaddedElement.h:
* mathml/MathMLPresentationElement.cpp:
* mathml/MathMLPresentationElement.h:
* mathml/MathMLRootElement.cpp:
* mathml/MathMLRootElement.h:
* mathml/MathMLRowElement.cpp:
* mathml/MathMLRowElement.h:
* mathml/MathMLScriptsElement.cpp:
* mathml/MathMLScriptsElement.h:
* mathml/MathMLSelectElement.cpp:
* mathml/MathMLSelectElement.h:
* mathml/MathMLSpaceElement.cpp:
* mathml/MathMLSpaceElement.h:
* mathml/MathMLTokenElement.cpp:
* mathml/MathMLTokenElement.h:
* mathml/MathMLUnderOverElement.cpp:
* mathml/MathMLUnderOverElement.h:
* mathml/MathMLUnknownElement.cpp: Added.
* mathml/MathMLUnknownElement.h:
* svg/SVGAElement.cpp:
* svg/SVGAElement.h:
* svg/SVGAltGlyphDefElement.cpp:
* svg/SVGAltGlyphDefElement.h:
* svg/SVGAltGlyphElement.cpp:
* svg/SVGAltGlyphElement.h:
* svg/SVGAltGlyphItemElement.cpp:
* svg/SVGAltGlyphItemElement.h:
* svg/SVGAnimateColorElement.cpp:
* svg/SVGAnimateColorElement.h:
* svg/SVGAnimateElement.cpp:
* svg/SVGAnimateElement.h:
* svg/SVGAnimateElementBase.cpp:
* svg/SVGAnimateElementBase.h:
* svg/SVGAnimateMotionElement.cpp:
* svg/SVGAnimateMotionElement.h:
* svg/SVGAnimateTransformElement.cpp:
* svg/SVGAnimateTransformElement.h:
* svg/SVGAnimationElement.cpp:
* svg/SVGAnimationElement.h:
* svg/SVGCircleElement.cpp:
* svg/SVGCircleElement.h:
* svg/SVGClipPathElement.cpp:
* svg/SVGClipPathElement.h:
* svg/SVGComponentTransferFunctionElement.cpp:
* svg/SVGComponentTransferFunctionElement.h:
* svg/SVGCursorElement.cpp:
* svg/SVGCursorElement.h:
* svg/SVGDefsElement.cpp:
* svg/SVGDefsElement.h:
* svg/SVGDescElement.cpp:
* svg/SVGDescElement.h:
* svg/SVGDocument.cpp:
* svg/SVGDocument.h:
* svg/SVGElement.cpp:
* svg/SVGElement.h:
* svg/SVGEllipseElement.cpp:
* svg/SVGEllipseElement.h:
* svg/SVGFEBlendElement.cpp:
* svg/SVGFEBlendElement.h:
* svg/SVGFEColorMatrixElement.cpp:
* svg/SVGFEColorMatrixElement.h:
* svg/SVGFEComponentTransferElement.cpp:
* svg/SVGFEComponentTransferElement.h:
* svg/SVGFECompositeElement.cpp:
* svg/SVGFECompositeElement.h:
* svg/SVGFEConvolveMatrixElement.cpp:
* svg/SVGFEConvolveMatrixElement.h:
* svg/SVGFEDiffuseLightingElement.cpp:
* svg/SVGFEDiffuseLightingElement.h:
* svg/SVGFEDisplacementMapElement.cpp:
* svg/SVGFEDisplacementMapElement.h:
* svg/SVGFEDropShadowElement.cpp:
* svg/SVGFEDropShadowElement.h:
* svg/SVGFEFloodElement.cpp:
* svg/SVGFEFloodElement.h:
* svg/SVGFEGaussianBlurElement.cpp:
* svg/SVGFEGaussianBlurElement.h:
* svg/SVGFEImageElement.cpp:
* svg/SVGFEImageElement.h:
* svg/SVGFELightElement.cpp:
* svg/SVGFELightElement.h:
* svg/SVGFEMergeElement.cpp:
* svg/SVGFEMergeElement.h:
* svg/SVGFEMergeNodeElement.cpp:
* svg/SVGFEMergeNodeElement.h:
* svg/SVGFEMorphologyElement.cpp:
* svg/SVGFEMorphologyElement.h:
* svg/SVGFEOffsetElement.cpp:
* svg/SVGFEOffsetElement.h:
* svg/SVGFESpecularLightingElement.cpp:
* svg/SVGFESpecularLightingElement.h:
* svg/SVGFETileElement.cpp:
* svg/SVGFETileElement.h:
* svg/SVGFETurbulenceElement.cpp:
* svg/SVGFETurbulenceElement.h:
* svg/SVGFilterElement.cpp:
* svg/SVGFilterElement.h:
* svg/SVGFilterPrimitiveStandardAttributes.cpp:
* svg/SVGFilterPrimitiveStandardAttributes.h:
* svg/SVGFontFaceElement.cpp:
* svg/SVGFontFaceElement.h:
* svg/SVGFontFaceFormatElement.cpp:
* svg/SVGFontFaceFormatElement.h:
* svg/SVGFontFaceNameElement.cpp:
* svg/SVGFontFaceNameElement.h:
* svg/SVGFontFaceSrcElement.cpp:
* svg/SVGFontFaceSrcElement.h:
* svg/SVGFontFaceUriElement.cpp:
* svg/SVGFontFaceUriElement.h:
* svg/SVGForeignObjectElement.cpp:
* svg/SVGForeignObjectElement.h:
* svg/SVGGElement.cpp:
* svg/SVGGElement.h:
* svg/SVGGlyphElement.cpp:
* svg/SVGGlyphElement.h:
* svg/SVGGlyphRefElement.cpp:
* svg/SVGGlyphRefElement.h:
* svg/SVGGradientElement.cpp:
* svg/SVGGradientElement.h:
* svg/SVGGraphicsElement.cpp:
* svg/SVGGraphicsElement.h:
* svg/SVGHKernElement.cpp:
* svg/SVGHKernElement.h:
* svg/SVGImageElement.cpp:
* svg/SVGImageElement.h:
* svg/SVGLineElement.cpp:
* svg/SVGLineElement.h:
* svg/SVGLinearGradientElement.cpp:
* svg/SVGLinearGradientElement.h:
* svg/SVGMPathElement.cpp:
* svg/SVGMPathElement.h:
* svg/SVGMarkerElement.cpp:
* svg/SVGMarkerElement.h:
* svg/SVGMaskElement.cpp:
* svg/SVGMaskElement.h:
* svg/SVGMetadataElement.cpp:
* svg/SVGMetadataElement.h:
* svg/SVGMissingGlyphElement.cpp:
* svg/SVGMissingGlyphElement.h:
* svg/SVGPathElement.cpp:
* svg/SVGPathElement.h:
* svg/SVGPatternElement.cpp:
* svg/SVGPatternElement.h:
* svg/SVGPolyElement.cpp:
* svg/SVGPolyElement.h:
* svg/SVGPolygonElement.cpp:
* svg/SVGPolygonElement.h:
* svg/SVGPolylineElement.cpp:
* svg/SVGPolylineElement.h:
* svg/SVGRadialGradientElement.cpp:
* svg/SVGRadialGradientElement.h:
* svg/SVGRectElement.cpp:
* svg/SVGRectElement.h:
* svg/SVGSVGElement.cpp:
* svg/SVGSVGElement.h:
* svg/SVGScriptElement.cpp:
* svg/SVGScriptElement.h:
* svg/SVGSetElement.cpp:
* svg/SVGSetElement.h:
* svg/SVGStopElement.cpp:
* svg/SVGStopElement.h:
* svg/SVGStyleElement.cpp:
* svg/SVGStyleElement.h:
* svg/SVGSwitchElement.cpp:
* svg/SVGSwitchElement.h:
* svg/SVGSymbolElement.cpp:
* svg/SVGSymbolElement.h:
* svg/SVGTRefElement.cpp:
* svg/SVGTRefElement.h:
* svg/SVGTSpanElement.cpp:
* svg/SVGTSpanElement.h:
* svg/SVGTextContentElement.cpp:
* svg/SVGTextContentElement.h:
* svg/SVGTextElement.cpp:
* svg/SVGTextElement.h:
* svg/SVGTextPathElement.cpp:
* svg/SVGTextPathElement.h:
* svg/SVGTextPositioningElement.cpp:
* svg/SVGTextPositioningElement.h:
* svg/SVGTitleElement.cpp:
* svg/SVGTitleElement.h:
* svg/SVGUnknownElement.cpp: Added.
* svg/SVGUnknownElement.h:
* svg/SVGUseElement.cpp:
* svg/SVGUseElement.h:
* svg/SVGVKernElement.cpp:
* svg/SVGVKernElement.h:
* svg/SVGViewElement.cpp:
* svg/SVGViewElement.h:
* svg/animation/SVGSMILElement.cpp:
* svg/animation/SVGSMILElement.h:

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

17 months agoUnreviewed, rolling out r229688.
wenson_hsieh@apple.com [Sat, 17 Mar 2018 05:58:06 +0000 (05:58 +0000)]
Unreviewed, rolling out r229688.

There's a solution that doesn't require this SPI.

Reverted changeset:

"Add SPI to expose width and height anchors for WKWebView's
content view"
https://bugs.webkit.org/show_bug.cgi?id=183711
https://trac.webkit.org/changeset/229688

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

17 months ago[LayoutReloaded] Move move functions to the base class from BlockFormattingContext
zalan@apple.com [Sat, 17 Mar 2018 04:34:02 +0000 (04:34 +0000)]
[LayoutReloaded] Move move functions to the base class from BlockFormattingContext
https://bugs.webkit.org/show_bug.cgi?id=183719

Reviewed by Antti Koivisto.

* LayoutReloaded/FormattingContext/BlockFormatting/BlockFormattingContext.js:
(BlockFormattingContext):
(BlockFormattingContext.prototype.layout):
(BlockFormattingContext.prototype._shrinkToFitWidth):
(BlockFormattingContext.prototype._toAbsolutePosition): Deleted.
(BlockFormattingContext.prototype._needsLayout): Deleted.
(BlockFormattingContext.prototype._addToLayoutQueue): Deleted.
(BlockFormattingContext.prototype._nextInLayoutQueue): Deleted.
(BlockFormattingContext.prototype._removeFromLayoutQueue): Deleted.
(BlockFormattingContext.prototype._createDisplayBox): Deleted.
(BlockFormattingContext.prototype._toDisplayBox): Deleted.
(BlockFormattingContext.prototype._toLayoutBox): Deleted.
* LayoutReloaded/FormattingContext/FormattingContext.js:
(FormattingContext):
(FormattingContext.prototype._toAbsolutePosition):
(FormattingContext.prototype._descendantNeedsLayout):
(FormattingContext.prototype._addToLayoutQueue):
(FormattingContext.prototype._nextInLayoutQueue):
(FormattingContext.prototype._removeFromLayoutQueue):
(FormattingContext.prototype._createDisplayBox):
(FormattingContext.prototype._toDisplayBox):
(FormattingContext.prototype._toLayoutBox):
* LayoutReloaded/FormattingContext/InlineFormatting/InlineFormattingContext.js:
(InlineFormattingContext.prototype.layout):

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

17 months agoAdd a test verifying that an AppCache manifest request includes credentials
youenn@apple.com [Sat, 17 Mar 2018 02:43:24 +0000 (02:43 +0000)]
Add a test verifying that an AppCache manifest request includes credentials
https://bugs.webkit.org/show_bug.cgi?id=183716

Reviewed by Chris Dumez.

* http/tests/appcache/appcache-cookies-expected.txt: Added.
* http/tests/appcache/appcache-cookies.html: Added.
* http/tests/appcache/resources/appcache-cookies-test.html: Added.
* http/tests/appcache/resources/manifest-if-cookie.php: Added.

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

17 months agoEnsure Document::responseReceived and clearResource are called on the main thread
youenn@apple.com [Sat, 17 Mar 2018 00:39:45 +0000 (00:39 +0000)]
Ensure Document::responseReceived and clearResource are called on the main thread
https://bugs.webkit.org/show_bug.cgi?id=183709

Reviewed by Chris Dumez.

No change of behavior.

* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::responseReceived):
(WebCore::DocumentLoader::clearMainResource):

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

17 months agoWebKit.WebsitePoliciesAutoplayQuirks API test times out with async policy delegates
cdumez@apple.com [Sat, 17 Mar 2018 00:38:12 +0000 (00:38 +0000)]
WebKit.WebsitePoliciesAutoplayQuirks API test times out with async policy delegates
https://bugs.webkit.org/show_bug.cgi?id=183702

Reviewed by Alex Christensen.

Source/WebCore:

The issue is that the test calls loadHTMLString then loadRequest right after, without
waiting for the first load to complete first. loadHTMLString is special as it relies
on substitute data and which schedules a timer to commit the data. When doing the
navigation policy check for the following loadRequest(), the substitute data timer
would fire and commit its data and load. This would in turn cancel the pending
navigation policy check for the loadRequest().

With sync policy delegates, this is not an issue because we take care of stopping
all loaders when receiving the policy decision, which happens synchronously. However,
when the policy decision happens asynchronously, the pending substitute data load
does not get cancelled in time and it gets committed.

To address the issue, this patch updates loadWithDocumentLoader() to cancel any
provisional load when there is an asynchronous navigation policy decision pending.

Change covered by new API test.

* loader/FrameLoader.cpp:
(WebCore::FrameLoader::loadWithDocumentLoader):

Tools:

Add API test coverage.

* TestWebKitAPI/Tests/WebKitCocoa/WebsitePolicies.mm:
(-[AsyncAutoplayPoliciesDelegate webView:decidePolicyForNavigationAction:decisionHandler:]):
(-[AsyncAutoplayPoliciesDelegate _webView:decidePolicyForNavigationAction:decisionHandler:]):
(-[AsyncAutoplayPoliciesDelegate _webView:handleAutoplayEvent:withFlags:]):
(TEST):

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

17 months agoAdd SPI to expose width and height anchors for WKWebView's content view
wenson_hsieh@apple.com [Fri, 16 Mar 2018 23:56:53 +0000 (23:56 +0000)]
Add SPI to expose width and height anchors for WKWebView's content view
https://bugs.webkit.org/show_bug.cgi?id=183711
<rdar://problem/38562899>

Reviewed by Tim Horton.

Source/WebKit:

Add _contentWidthAnchor and _contentHeightAnchor SPI to WKWebView for internal clients to be able to reason
about the size of the content view on iOS using autolayout.

Test: WebKit.AutoLayoutPositionHeaderAndFooterViewsInScrollView.

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

Tools:

Adds an API test exercising the new SPI.

* TestWebKitAPI/Tests/WebKitCocoa/AutoLayoutIntegration.mm:
(checkCGRect):
(TEST):

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

17 months agoBuildbotBuildEntry creates an incorrect url for pending builds
aakash_jain@apple.com [Fri, 16 Mar 2018 23:48:37 +0000 (23:48 +0000)]
BuildbotBuildEntry creates an incorrect url for pending builds
https://bugs.webkit.org/show_bug.cgi?id=183670

Reviewed by Ryosuke Niwa.

* tools/js/buildbot-syncer.js:
(BuildbotBuildEntry.prototype.initialize): Fetch buildrequestid from Buildbot.
(BuildbotBuildEntry.prototype.url): Construct url for pending build using buildrequestid from Buildbot.
* unit-tests/buildbot-syncer-tests.js: Updated unit-test.

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

17 months agoWeb Inspector: Elements: "Force Print Media Styles" should not persist across Web...
nvasilyev@apple.com [Fri, 16 Mar 2018 23:43:41 +0000 (23:43 +0000)]
Web Inspector: Elements: "Force Print Media Styles" should not persist across Web Inspector sessions
https://bugs.webkit.org/show_bug.cgi?id=183708
<rdar://problem/36452183>

Reviewed by Matt Baker.

* UserInterface/Base/Main.js:
(WI.loaded):
* UserInterface/Views/DOMTreeContentView.js:
(WI.DOMTreeContentView):
(WI.DOMTreeContentView.prototype._showPrintStylesChanged):
(WI.DOMTreeContentView.prototype._togglePrintStyles):
(WI.DOMTreeContentView.prototype._showPrintStylesSettingChanged): Deleted.
(WI.DOMTreeContentView.prototype._togglePrintStylesSetting): Deleted.

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

17 months agoSkip editing/pasteboard/data-transfer-get-data-on-pasting-html-uses-blob-url.html...
ryanhaddad@apple.com [Fri, 16 Mar 2018 22:46:12 +0000 (22:46 +0000)]
Skip editing/pasteboard/data-transfer-get-data-on-pasting-html-uses-blob-url.html on iOS.
https://bugs.webkit.org/show_bug.cgi?id=183219

Unreviewed test gardening.

* platform/ios/TestExpectations:

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

17 months agoAdd _useSystemAppearance to WKView
megan_gardner@apple.com [Fri, 16 Mar 2018 22:22:43 +0000 (22:22 +0000)]
Add _useSystemAppearance to WKView
https://bugs.webkit.org/show_bug.cgi?id=183706
<rdar://problem/38516584>

Reviewed by Tim Horton.

Plumb useSystemAppearance and other supporting functions to WKView

* UIProcess/API/Cocoa/WKViewPrivate.h:
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _initializeWithConfiguration:]):
(-[WKWebView _useSystemAppearance]):
(-[WKWebView _setUseSystemAppearance:]):
(-[WKWebView effectiveAppearanceDidChange]):
* UIProcess/API/mac/WKView.mm:
(-[WKView effectiveAppearanceDidChange]):
(-[WKView _setUseSystemAppearance:]):
(-[WKView _useSystemAppearance]):
(-[WKView _setDefaultAppearance:]):
* UIProcess/Cocoa/WebViewImpl.h:
* UIProcess/Cocoa/WebViewImpl.mm:
(WebKit::WebViewImpl::setUseSystemAppearance):
(WebKit::WebViewImpl::useSystemAppearance):
(WebKit::WebViewImpl::setDefaultAppearance):

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

17 months agoSet a trap to catch an infrequent form-related nullptr crash
bfulgham@apple.com [Fri, 16 Mar 2018 21:17:27 +0000 (21:17 +0000)]
Set a trap to catch an infrequent form-related nullptr crash
https://bugs.webkit.org/show_bug.cgi?id=183704
<rdar://problem/37579354>

Reviewed by Ryosuke Niwa.

Source/WebCore:

Make FormState a FrameDestructionObserver. We expect all relevant FormState objects to have been
cleaned up prior to the frame being destroyed. If we find such a case, we'd like to see the
stack trace to see what's going on.

* loader/FormState.cpp:
(WebCore::FormState::FormState):
(WebCore::FormState::willDetachPage): RELEASE_ASSERT_NOT_REACHED if we ever get here.
* loader/FormState.h:

Source/WebKit:

Add a RELEASE_ASSERT to see if we ever encounter a nullptr WebCore frame.

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

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

17 months agoAX: AccessibilityNodeObject::textForLabelElement() doesn't follow AccName calculation...
jdiggs@igalia.com [Fri, 16 Mar 2018 21:01:25 +0000 (21:01 +0000)]
AX: AccessibilityNodeObject::textForLabelElement() doesn't follow AccName calculation rules
https://bugs.webkit.org/show_bug.cgi?id=183661

Reviewed by Chris Fleizach.

Source/WebCore:

Have AccessibilityNodeObject::textForLabelElement() return the value from
accessibleNameForNode() instead of innerText(). The former falls back on
the latter if there is no author-provided accessible name.

Tests: accessibility/aria-label-on-label-element.html
       accessibility/label-with-pseudo-elements.html

* accessibility/AccessibilityNodeObject.cpp:
(WebCore::AccessibilityNodeObject::textForLabelElement const):
(WebCore::AccessibilityNodeObject::titleElementText const):

LayoutTests:

* accessibility/aria-label-on-label-element-expected.txt: Moved from Mac tests to shared tests.
* accessibility/aria-label-on-label-element.html: Moved from Mac tests to shared tests.
* accessibility/label-with-pseudo-elements-expected.txt: Added.
* accessibility/label-with-pseudo-elements.html: Added.
* platform/gtk/accessibility/aria-label-on-label-element-expected.txt: Added.
* platform/gtk/accessibility/label-with-pseudo-elements-expected.txt: Added.
* platform/mac/accessibility/label-with-pseudo-elements-expected.txt: Added.
* platform/win/accessibility/label-with-pseudo-elements-expected.txt: Added.

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

17 months ago[Curl] Fix crash on websocket with bad handshake message.
commit-queue@webkit.org [Fri, 16 Mar 2018 20:56:01 +0000 (20:56 +0000)]
[Curl] Fix crash on websocket with bad handshake message.
https://bugs.webkit.org/show_bug.cgi?id=183686

Patch by Basuke Suzuki <Basuke.Suzuki@sony.com> on 2018-03-16
Reviewed by Youenn Fablet.

The closing cleanup was called multiple times. Add flag to detect
it is already closed or not.

No new tests because it is covered by existing test:
- LayoutTests/http/tests/websocket/tests/hybi/bad-handshake-crash.html

* platform/network/curl/SocketStreamHandleImpl.h:
* platform/network/curl/SocketStreamHandleImplCurl.cpp:
(WebCore::SocketStreamHandleImpl::platformClose):
(WebCore::SocketStreamHandleImpl::didReceiveData):

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

17 months agoMake Fullscreen API an Experimental Feature
jer.noble@apple.com [Fri, 16 Mar 2018 20:06:58 +0000 (20:06 +0000)]
Make Fullscreen API an Experimental Feature
https://bugs.webkit.org/show_bug.cgi?id=183662

Reviewed by Jon Lee.

Source/WebCore:

The Fullscreen APIs should be guarded by a Setting, so they are not present in the DOM when the
Experimental Feature is disabled.

* dom/Document.idl:
* dom/Element.idl:

Source/WebKit:

Add the ability to have a conditional for whether an Experimental Feature is "visible", separate from
whether the preference is available, for definining platform-specific Experimental Features.

* Scripts/GeneratePreferences.rb:
* Scripts/PreferencesTemplates/WebPreferencesExperimentalFeatures.cpp.erb:
* Shared/WebPreferences.yaml:

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

17 months agoEnsure that style is updated when the effective appearance changes
megan_gardner@apple.com [Fri, 16 Mar 2018 18:47:44 +0000 (18:47 +0000)]
Ensure that style is updated when the effective appearance changes
https://bugs.webkit.org/show_bug.cgi?id=183690
<rdar://problem/38385900>

Reviewed by Tim Horton and Wenson Hsieh.

Source/WebCore:

Only exposing a function to outside WebCore, no tests needed.

* page/Page.h:

Source/WebKit:

Respond to and respect the effective appearance changing.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView effectiveAppearanceDidChange]):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::setDefaultAppearance):

Source/WebKitLegacy/mac:

Respond to and respect the effective appearance changing.

* WebView/WebView.mm:
(-[WebView _setUseSystemAppearance:]):
(-[WebView effectiveAppearanceDidChange]):

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

17 months agoWebKit.RestoreSessionStateContainingScrollRestorationDefault API test is failing...
cdumez@apple.com [Fri, 16 Mar 2018 18:33:48 +0000 (18:33 +0000)]
WebKit.RestoreSessionStateContainingScrollRestorationDefault API test is failing with async policy delegates
https://bugs.webkit.org/show_bug.cgi?id=183679

Reviewed by Alex Christensen.

Source/WebCore:

Update CachedRawResource::didAddClient() to not send data until we've received
the policy decision for the response.

No new tests, covered by new API test.

* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::handleSubstituteDataLoadNow):
(WebCore::DocumentLoader::responseReceived):
* loader/DocumentLoader.h:
* loader/DocumentThreadableLoader.cpp:
(WebCore::DocumentThreadableLoader::responseReceived):
* loader/DocumentThreadableLoader.h:
* loader/MediaResourceLoader.cpp:
(WebCore::MediaResource::responseReceived):
* loader/MediaResourceLoader.h:
* loader/appcache/ApplicationCacheResourceLoader.cpp:
(WebCore::ApplicationCacheResourceLoader::responseReceived):
* loader/appcache/ApplicationCacheResourceLoader.h:
* loader/cache/CachedRawResource.cpp:
(WebCore::CachedRawResource::didAddClient):
(WebCore::CachedRawResource::responseReceived):
* loader/cache/CachedRawResourceClient.h:
(WebCore::CachedRawResourceClient::responseReceived):
* loader/cache/KeepaliveRequestTracker.cpp:
(WebCore::KeepaliveRequestTracker::responseReceived):
* loader/cache/KeepaliveRequestTracker.h:
* platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.h:
* platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.mm:
(WebCore::WebCoreAVFResourceLoader::responseReceived):

Tools:

Add API test coverage.

* TestWebKitAPI/Tests/WebKit/RestoreSessionState.cpp:
(TestWebKitAPI::decidePolicyForNavigationAction):
(TestWebKitAPI::decidePolicyForResponse):
(TestWebKitAPI::TEST):

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

17 months agoName Service Worker threads differently from regular Worker threads
youenn@apple.com [Fri, 16 Mar 2018 17:38:23 +0000 (17:38 +0000)]
Name Service Worker threads differently from regular Worker threads
https://bugs.webkit.org/show_bug.cgi?id=183698

Reviewed by Chris Dumez.

No observable change of behavior.
For debugging purposes, knowing that a thread is a service worker thread might help give context.
It might also identify on a crash log whether the process is a service worker process or a regular web process.

* workers/WorkerThread.cpp:
(WebCore::WorkerThread::start):
* workers/WorkerThread.h:
(WebCore::WorkerThread::isServiceWorkerThread const):
* workers/service/context/ServiceWorkerThread.h:

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

17 months agoIceCandidates leak on webrtc/datachannel/basic.html and other tests
youenn@apple.com [Fri, 16 Mar 2018 17:31:54 +0000 (17:31 +0000)]
IceCandidates leak on webrtc/datachannel/basic.html and other tests
https://bugs.webkit.org/show_bug.cgi?id=183676
<rdar://problem/36116228>

Reviewed by Eric Carlson.

Covered by manual testing using --leaks option on WK1.
WebKit should not release the candidates since libwebrtc is not taking ownership.

* Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
(WebCore::LibWebRTCPeerConnectionBackend::doSetLocalDescription):
(WebCore::LibWebRTCPeerConnectionBackend::doSetRemoteDescription):

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

17 months ago[Nicosia] Add Cairo-specific GraphicsContext operation recorder
zandobersek@gmail.com [Fri, 16 Mar 2018 17:14:12 +0000 (17:14 +0000)]
[Nicosia] Add Cairo-specific GraphicsContext operation recorder
https://bugs.webkit.org/show_bug.cgi?id=183593

Reviewed by Carlos Garcia Campos.

Add Nicosia::CairoOperationRecorder, GraphicsContextImpl implementation
that records all GraphicsContext operations for deferred replay on a
different thread. Recording here mostly consists of storing all the
Cairo resources in a thread-safe manner, which is eased by the atomic
reference counting used in Cairo.

Nicosia::PaintingOperation derivatives are used for operations or state
updates that require recording. Instances of these classes are appended
to a Vector<> object that is then pushed into a thread pool in
Nicosia::PaintingEngineThreaded , replaying all the operations against
the Cairo context established from an associated target Nicosia::Buffer.

This GraphicsContextImpl implementation is now used in the
PaintingContextCairo::ForRecording constructor to construct the
GraphicsContext implementation that will be used for recording.

* platform/TextureMapper.cmake:
* platform/graphics/nicosia/cairo/NicosiaCairoOperationRecorder.cpp: Added.
(Nicosia::getContext):
(Nicosia::OperationData::arg const const):
(Nicosia::createCommand):
(Nicosia::CairoOperationRecorder::CairoOperationRecorder):
(Nicosia::m_commandList):
(Nicosia::CairoOperationRecorder::updateState):
(Nicosia::CairoOperationRecorder::clearShadow):
(Nicosia::CairoOperationRecorder::setLineCap):
(Nicosia::CairoOperationRecorder::setLineDash):
(Nicosia::CairoOperationRecorder::setLineJoin):
(Nicosia::CairoOperationRecorder::setMiterLimit):
(Nicosia::CairoOperationRecorder::fillRect):
(Nicosia::CairoOperationRecorder::fillRoundedRect):
(Nicosia::CairoOperationRecorder::fillRectWithRoundedHole):
(Nicosia::CairoOperationRecorder::fillPath):
(Nicosia::CairoOperationRecorder::fillEllipse):
(Nicosia::CairoOperationRecorder::strokeRect):
(Nicosia::CairoOperationRecorder::strokePath):
(Nicosia::CairoOperationRecorder::strokeEllipse):
(Nicosia::CairoOperationRecorder::clearRect):
(Nicosia::CairoOperationRecorder::drawGlyphs):
(Nicosia::CairoOperationRecorder::drawImage):
(Nicosia::CairoOperationRecorder::drawTiledImage):
(Nicosia::CairoOperationRecorder::drawNativeImage):
(Nicosia::CairoOperationRecorder::drawPattern):
(Nicosia::CairoOperationRecorder::drawRect):
(Nicosia::CairoOperationRecorder::drawLine):
(Nicosia::CairoOperationRecorder::drawLinesForText):
(Nicosia::CairoOperationRecorder::drawLineForDocumentMarker):
(Nicosia::CairoOperationRecorder::drawEllipse):
(Nicosia::CairoOperationRecorder::drawPath):
(Nicosia::CairoOperationRecorder::drawFocusRing):
(Nicosia::CairoOperationRecorder::save):
(Nicosia::CairoOperationRecorder::restore):
(Nicosia::CairoOperationRecorder::translate):
(Nicosia::CairoOperationRecorder::rotate):
(Nicosia::CairoOperationRecorder::scale):
(Nicosia::CairoOperationRecorder::concatCTM):
(Nicosia::CairoOperationRecorder::setCTM):
(Nicosia::CairoOperationRecorder::getCTM):
(Nicosia::CairoOperationRecorder::beginTransparencyLayer):
(Nicosia::CairoOperationRecorder::endTransparencyLayer):
(Nicosia::CairoOperationRecorder::clip):
(Nicosia::CairoOperationRecorder::clipOut):
(Nicosia::CairoOperationRecorder::clipPath):
(Nicosia::CairoOperationRecorder::clipBounds):
(Nicosia::CairoOperationRecorder::applyDeviceScaleFactor):
(Nicosia::CairoOperationRecorder::roundToDevicePixels):
(Nicosia::CairoOperationRecorder::append):
* platform/graphics/nicosia/cairo/NicosiaCairoOperationRecorder.h: Added.
* platform/graphics/nicosia/cairo/NicosiaPaintingContextCairo.cpp:
(Nicosia::PaintingContextCairo::ForRecording::ForRecording):

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

17 months ago[LayoutReloaded] Introduce Display.Box
zalan@apple.com [Fri, 16 Mar 2018 17:12:24 +0000 (17:12 +0000)]
[LayoutReloaded] Introduce Display.Box
https://bugs.webkit.org/show_bug.cgi?id=183700

Reviewed by Antti Koivisto.

Display.Box objects will end up in the display(box) tree. Currently
they are just hanging off of the Layout.Box objects.

* LayoutReloaded/DisplayTree/Box.js: Added.
(Display.Box):
(Display.Box.prototype.rect):
(Display.Box.prototype.top):
(Display.Box.prototype.left):
(Display.Box.prototype.bottom):
(Display.Box.prototype.right):
(Display.Box.prototype.topLeft):
(Display.Box.prototype.bottomRight):
(Display.Box.prototype.setTopLeft):
(Display.Box.prototype.setSize):
(Display.Box.prototype.setWidth):
(Display.Box.prototype.setHeight):
(Display.Box.prototype.borderBox):
(Display.Box.prototype.paddingBox):
(Display.Box.prototype.contentBox):
* LayoutReloaded/FormattingContext/BlockFormatting/BlockFormattingContext.js:
(BlockFormattingContext):
(BlockFormattingContext.prototype.layout):
(BlockFormattingContext.prototype._toAbsolutePosition):
(BlockFormattingContext.prototype._needsLayout):
(BlockFormattingContext.prototype._addToLayoutQueue):
(BlockFormattingContext.prototype._nextInLayoutQueue):
(BlockFormattingContext.prototype._removeFromLayoutQueue):
(BlockFormattingContext.prototype._createDisplayBox):
(BlockFormattingContext.prototype._toDisplayBox):
(BlockFormattingContext.prototype._toLayoutBox):
* LayoutReloaded/Layout.js:
(layout):
* LayoutReloaded/LayoutReloaded.xcworkspace/contents.xcworkspacedata:
* LayoutReloaded/LayoutTree/Box.js:
(Layout.Box):
(Layout.Box.prototype.setDisplayBox):
(Layout.Box.prototype.displayBox):
(Layout.Box.prototype.rect):
(Layout.Box.prototype.setTopLeft):
(Layout.Box.prototype.setSize):
(Layout.Box.prototype.setWidth):
(Layout.Box.prototype.setHeight):
(Layout.Box.prototype.borderBox):
(Layout.Box.prototype.paddingBox):
(Layout.Box.prototype.contentBox):
* LayoutReloaded/test/index.html:

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

17 months ago[TexMap] Clean up TextureMapperLayer constructor
zandobersek@gmail.com [Fri, 16 Mar 2018 17:07:26 +0000 (17:07 +0000)]
[TexMap] Clean up TextureMapperLayer constructor
https://bugs.webkit.org/show_bug.cgi?id=183634

Reviewed by Michael Catanzaro.

In the TextureMapperLayer header, only declare the constructor, and move
all the previous member initialization to the point of declaration of
these member variables.

In the TextureMapperLayer implementation file, the constructor and
destructor are moved into proper order at the top of the file. The
former is defaulted, and the latter remains unchanged.

No change in behavior.

* platform/graphics/texmap/TextureMapperLayer.cpp:
(WebCore::TextureMapperLayer::~TextureMapperLayer):
* platform/graphics/texmap/TextureMapperLayer.h:

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

17 months agoImprove error message when Gigacage cannot allocate virtual memory
mcatanzaro@igalia.com [Fri, 16 Mar 2018 17:06:03 +0000 (17:06 +0000)]
Improve error message when Gigacage cannot allocate virtual memory
https://bugs.webkit.org/show_bug.cgi?id=183329

Reviewed by Filip Pizlo.

We've discovered that Deja Dup monitor sets a virtual memory limit, breaking Gigacage. Since
it runs in the background on a fresh out-of-the-box install of Ubuntu, this is not good.
That will have to be fixed by Deja Dup, but there is concern that other applications might
try this, or that users will set a virtual memory limit for the entire desktop session. Of
particular concern is the possibility that users might have copypasted a ulimit line into
a session startup script without understanding it. Let's try to make it slightly easier to
understand what's going wrong.

* bmalloc/Gigacage.cpp:
(Gigacage::ensureGigacage):

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

17 months agoURLSchemeHandler.Basic API test fails with async policy delegates
cdumez@apple.com [Fri, 16 Mar 2018 16:11:54 +0000 (16:11 +0000)]
URLSchemeHandler.Basic API test fails with async policy delegates
https://bugs.webkit.org/show_bug.cgi?id=183678

Reviewed by Alex Christensen.

Source/WebKit:

The issue is that the client calls _didPerformRedirection / didReceiveResponse / didReceiveData / didFinish
on the URLScheme task one after the one, synchronously. However, redirects and responses can be processed
asynchronously. To address the issue, we now queue operations requested by the client if we're waiting
for an async policy delegate.

* WebProcess/WebPage/WebURLSchemeTaskProxy.cpp:
(WebKit::WebURLSchemeTaskProxy::didPerformRedirection):
(WebKit::WebURLSchemeTaskProxy::didReceiveResponse):
(WebKit::WebURLSchemeTaskProxy::didReceiveData):
(WebKit::WebURLSchemeTaskProxy::didComplete):
(WebKit::WebURLSchemeTaskProxy::processNextPendingTask):
* WebProcess/WebPage/WebURLSchemeTaskProxy.h:
(WebKit::WebURLSchemeTaskProxy::queueTask):

Tools:

Add API test coverage.

* TestWebKitAPI/Tests/WebKitCocoa/WKURLSchemeHandler-1.mm:
(-[URLSchemeHandlerAsyncNavigationDelegate webView:decidePolicyForNavigationAction:decisionHandler:]):
(-[URLSchemeHandlerAsyncNavigationDelegate webView:decidePolicyForNavigationResponse:decisionHandler:]):
(TEST):

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

17 months agoLayoutTests/imported/w3c:
csaavedra@igalia.com [Fri, 16 Mar 2018 15:12:25 +0000 (15:12 +0000)]
LayoutTests/imported/w3c:
Unreviewed rebaseline

These seem to have been forgotten, update baseline as it seemed needed.
* web-platform-tests/dom/events/EventListener-invoke-legacy-expected.txt:
* web-platform-tests/dom/nodes/Document-createElement-namespace-expected.txt:
* web-platform-tests/encrypted-media/idlharness-expected.txt:

LayoutTests:
[WPE] Rebaseline for web-platform-tests specific test

Unreviewed gardening.
* platform/wpe/imported/w3c/web-platform-tests/html/dom/interfaces-expected.txt:

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

17 months ago[LayoutReloaded] Utils.computed* functions should just take node instead of box.
zalan@apple.com [Fri, 16 Mar 2018 14:52:42 +0000 (14:52 +0000)]
[LayoutReloaded] Utils.computed* functions should just take node instead of box.
https://bugs.webkit.org/show_bug.cgi?id=183697

Reviewed by Antti Koivisto.

This is in preparation for introducing the display tree.

* LayoutReloaded/FormattingContext/BlockFormatting/BlockFormattingContext.js:
(BlockFormattingContext.prototype._computeOutOfFlowWidth):
(BlockFormattingContext.prototype._computeFloatingWidth):
(BlockFormattingContext.prototype._computeInFlowWidth):
(BlockFormattingContext.prototype._computeOutOfFlowHeight):
(BlockFormattingContext.prototype._computeFloatingHeight):
(BlockFormattingContext.prototype._computeInFlowHeight):
(BlockFormattingContext.prototype._shrinkToFitWidth):
* LayoutReloaded/FormattingContext/BlockFormatting/BlockMarginCollapse.js:
(BlockMarginCollapse._nonCollapsedMarginTop):
(BlockMarginCollapse._nonCollapsedMarginBottom):
(BlockMarginCollapse._collapsedMarginTopFromFirstChild):
(BlockMarginCollapse._collapsedMarginBottomFromLastChild):
* LayoutReloaded/FormattingContext/FormattingContext.js:
(FormattingContext.prototype.marginTop):
(FormattingContext.prototype.marginLeft):
(FormattingContext.prototype.marginBottom):
(FormattingContext.prototype.marginRight):
* LayoutReloaded/LayoutTree/Box.js:
(Layout.Box.prototype.paddingBox):
(Layout.Box.prototype.contentBox):
(Layout.Box):
* LayoutReloaded/Utils.js:
(Utils.computedMarginTop):
(Utils.computedMarginLeft):
(Utils.computedMarginBottom):
(Utils.computedMarginRight):
(Utils.computedBorderTopLeft):
(Utils.computedBorderBottomRight):
(Utils.computedPaddingTopLeft):
(Utils.computedPaddingBottomRight):
(Utils.computedBorderAndPaddingTop):
(Utils.computedBorderAndPaddingLeft):
(Utils.computedBorderAndPaddingBottom):
(Utils.computedBorderAndPaddingRight):
(Utils.computedHorizontalBorderAndPadding):
(Utils.computedVerticalBorderAndPadding):
(Utils.computedLineHeight):
(Utils.hasClearLeft):
(Utils.hasClearRight):
(Utils.hasClearBoth):

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

17 months ago[GTK] When using EGL, request an OpenGL core profile when possible
magomez@igalia.com [Fri, 16 Mar 2018 11:51:58 +0000 (11:51 +0000)]
[GTK] When using EGL, request an OpenGL core profile when possible
https://bugs.webkit.org/show_bug.cgi?id=178719

Reviewed by Carlos Garcia Campos.

When using EGL and OpenGL, try to request a context with version >= 3.2 with a core profile
whenever possible. In order to to this, we require EGL version 1.5 or version 1.4 with the
extension EGL_KHR_create_context. If EGL requirements are not met, or we cannot get a
context with version >= 3.2 then use whatever EGL gives us.

Covered by existent tests.

* platform/graphics/egl/GLContextEGL.cpp:
(WebCore::GLContextEGL::createWindowContext):
(WebCore::GLContextEGL::createPbufferContext):
(WebCore::GLContextEGL::createSurfacelessContext):
(WebCore::GLContextEGL::createContextForEGLVersion):
* platform/graphics/egl/GLContextEGL.h:
* platform/graphics/egl/GLContextEGLWPE.cpp:
(WebCore::GLContextEGL::createWPEContext):
* platform/graphics/egl/GLContextEGLWayland.cpp:
(WebCore::GLContextEGL::createWaylandContext):
* platform/graphics/egl/GLContextEGLX11.cpp:
(WebCore::GLContextEGL::createPixmapContext):

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

17 months ago[GTK][WPE] Remove baselines for FileAPI test.
csaavedra@igalia.com [Fri, 16 Mar 2018 10:05:03 +0000 (10:05 +0000)]
[GTK][WPE] Remove baselines for FileAPI test.

Unreviewed gardening. Now with service workers the results in both
WPE and GTK+ are the same as the default expectation.
* platform/gtk/imported/w3c/web-platform-tests/FileAPI/historical.https-expected.txt: Removed.
* platform/wpe/imported/w3c/web-platform-tests/FileAPI/historical.https-expected.txt: Removed.

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

17 months agoSuppress GCC warnings by using #include instead of #import
csaavedra@igalia.com [Fri, 16 Mar 2018 09:46:01 +0000 (09:46 +0000)]
Suppress GCC warnings by using #include instead of #import

Unreviewed.
* UIProcess/SystemPreviewController.cpp:

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

17 months ago[TexMap] Don't use the TextureMapperAnimation::Client interface to apply animation
zandobersek@gmail.com [Fri, 16 Mar 2018 08:43:26 +0000 (08:43 +0000)]
[TexMap] Don't use the TextureMapperAnimation::Client interface to apply animation
https://bugs.webkit.org/show_bug.cgi?id=183656

Reviewed by Carlos Garcia Campos.

Don't have the TextureMapperLayer class inherit from the
TextureMapperAnimation::Client interface just for the purposes of
synchronization of animation-affected attributes in syncAnimations().
For that purpose it's enough to provide a struct that is passed to that
method, and with the TextureMapperAnimation class filling out any of the
animated attributes that need to be updated.

TextureMapperAnimation::ApplicationResult struct is introducted for that
purpose. std::optional<> members in it are assigned values during the
application process, if an appropriate animation affects them. The
relevant member values in TextureMapperLayer are then updated, or value
from the default state is used.

TextureMapperAnimation::Client is removed.

No new tests -- no change in behavior.

* platform/graphics/texmap/TextureMapperAnimation.cpp:
(WebCore::TextureMapperAnimation::apply):
(WebCore::TextureMapperAnimation::applyInternal):
(WebCore::TextureMapperAnimations::apply):
* platform/graphics/texmap/TextureMapperAnimation.h:
* platform/graphics/texmap/TextureMapperLayer.cpp:
(WebCore::TextureMapperLayer::syncAnimations):
(WebCore::TextureMapperLayer::setAnimatedTransform): Deleted.
(WebCore::TextureMapperLayer::setAnimatedOpacity): Deleted.
(WebCore::TextureMapperLayer::setAnimatedFilters): Deleted.
* platform/graphics/texmap/TextureMapperLayer.h:

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

17 months agoWeb Inspector: Canvas Tab: main WebGL canvas on acko.net has no reported size
webkit@devinrousso.com [Fri, 16 Mar 2018 07:01:01 +0000 (07:01 +0000)]
Web Inspector: Canvas Tab: main WebGL canvas on acko.net has no reported size
https://bugs.webkit.org/show_bug.cgi?id=178798
<rdar://problem/35175740>

Reviewed by Brian Burg.

When the main frame navigates, the DOMAgent would recieve two InspectorInstrumentation calls,
one when the frame begins its navigation and the other when the document for that frame has
loaded. Both of these would discard the DOMAgent's bindings, which included the map of
`nodeId`s. This was an issue for canvases, as the frontend would be notified whenever any
canvas is created, which would usually occur before the `DOMContentLoaded` event is fired.
As a result, the canvases would attempt to retrieve their associated node, only to have the
DOMAgent discard those bindings quickly thereafter.

This patch removes DOMAgent's and DOMDebuggerAgent's (parity) instrumentation hooks for the
latter event, ensuring that the bindings are only discarded once.

* inspector/agents/InspectorDOMAgent.h:
* inspector/agents/InspectorDOMAgent.cpp:
(WebCore::InspectorDOMAgent::mainFrameDOMContentLoaded): Deleted.

* inspector/agents/InspectorDOMDebuggerAgent.h:
* inspector/agents/InspectorDOMDebuggerAgent.cpp:
(WebCore::InspectorDOMDebuggerAgent::frameDocumentUpdated): Added.
(WebCore::InspectorDOMDebuggerAgent::mainFrameDOMContentLoaded): Deleted.

* inspector/InspectorInstrumentation.cpp:
(WebCore::InspectorInstrumentation::domContentLoadedEventFiredImpl):
(WebCore::InspectorInstrumentation::frameDocumentUpdatedImpl):

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

17 months ago[LayoutReloaded] Should never need to go beyond the root container when asking for...
zalan@apple.com [Fri, 16 Mar 2018 04:13:26 +0000 (04:13 +0000)]
[LayoutReloaded] Should never need to go beyond the root container when asking for the containing block.
https://bugs.webkit.org/show_bug.cgi?id=183691

Reviewed by Antti Koivisto.

While laying out the boxes in a block formatting context, if we happen to need
to get to the containing block of a box to compute geometry, it should always be a
descendant of the root container (or the root container itself).
Nothing outside of the formatting context should be able to impact the boxes inside.

* LayoutReloaded/FormattingContext/BlockFormatting/BlockFormattingContext.js:
(BlockFormattingContext.prototype._computeOutOfFlowPosition):
(BlockFormattingContext.prototype._toAbsolutePosition):
(BlockFormattingContext):
* LayoutReloaded/FormattingContext/BlockFormatting/BlockMarginCollapse.js:
(BlockMarginCollapse._isMarginTopCollapsedWithParent):
(BlockMarginCollapse._isMarginBottomCollapsedWithParent):
* LayoutReloaded/LayoutTree/Box.js:
(Layout.Box.prototype.isRootBox):
(Layout.Box.prototype.isRootElement): Deleted.
* LayoutReloaded/Utils.js:
(Utils.isDescendantOf):
(Utils.mapStaticToAbsolute): Deleted.
* LayoutReloaded/misc/headers/Box.h:

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

17 months agoInclude CADisplayLink explicitly where needed, instead of all of CA
timothy_horton@apple.com [Fri, 16 Mar 2018 02:57:42 +0000 (02:57 +0000)]
Include CADisplayLink explicitly where needed, instead of all of CA
https://bugs.webkit.org/show_bug.cgi?id=183689
<rdar://problem/38528719>

Reviewed by Wenson Hsieh.

* platform/graphics/ios/DisplayRefreshMonitorIOS.mm:

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

17 months agoInclude MobileCoreServices in the WebCore prefix header
timothy_horton@apple.com [Fri, 16 Mar 2018 02:19:33 +0000 (02:19 +0000)]
Include MobileCoreServices in the WebCore prefix header
https://bugs.webkit.org/show_bug.cgi?id=183688
<rdar://problem/38527621>

Reviewed by Dan Bernstein.

* WebCorePrefix.h:

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

17 months agoAvoid defining commonly-named system macros on all Cocoa platforms
timothy_horton@apple.com [Fri, 16 Mar 2018 01:46:55 +0000 (01:46 +0000)]
Avoid defining commonly-named system macros on all Cocoa platforms
https://bugs.webkit.org/show_bug.cgi?id=183687

Reviewed by Dan Bernstein.

* wtf/Platform.h:

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

17 months agoCreate MediaQueryParserContext to provide additional context for the evaluation of...
megan_gardner@apple.com [Fri, 16 Mar 2018 01:12:39 +0000 (01:12 +0000)]
Create MediaQueryParserContext to provide additional context for the evaluation of media queries
https://bugs.webkit.org/show_bug.cgi?id=183677

Reviewed by Tim Horton.

We need additional context for parsing media queries to make sure they are parsed correctly and valid.

Source/WebCore:

Not currently testable, will add tests in a later patch.

* WebCore.xcodeproj/project.pbxproj:
* css/MediaList.cpp:
(WebCore::MediaQuerySet::create):
(WebCore::MediaQuerySet::set):
(WebCore::MediaQuerySet::add):
(WebCore::MediaQuerySet::remove):
* css/MediaList.h:
* css/MediaQueryEvaluator.cpp:
(WebCore::MediaQueryEvaluator::mediaAttributeMatches):
* css/MediaQueryExpression.cpp:
(WebCore::featureWithValidIdent):
(WebCore::featureWithValidDensity):
(WebCore::featureWithValidPositiveLength):
(WebCore::featureWithPositiveInteger):
(WebCore::featureWithPositiveNumber):
(WebCore::featureWithZeroOrOne):
(WebCore::isFeatureValidWithoutValue):
(WebCore::MediaQueryExpression::MediaQueryExpression):
* css/MediaQueryExpression.h:
* css/MediaQueryMatcher.cpp:
(WebCore::MediaQueryMatcher::matchMedia):
* css/MediaQueryParserContext.cpp: Added.
(WebCore::MediaQueryParserContext::MediaQueryParserContext):
* css/MediaQueryParserContext.h: Added.
(WebCore::MediaQueryParserContext::MediaQueryParserContext):
* css/StyleMedia.cpp:
(WebCore::StyleMedia::matchMedium const):
* css/StyleRuleImport.cpp:
(WebCore::StyleRuleImport::StyleRuleImport):
(WebCore::StyleRuleImport::setCSSStyleSheet):
* css/parser/CSSParser.cpp:
(WebCore::CSSParserContext::CSSParserContext):
(WebCore::operator==):
* css/parser/CSSParserImpl.cpp:
(WebCore::CSSParserImpl::consumeImportRule):
(WebCore::CSSParserImpl::consumeMediaRule):
* css/parser/MediaQueryParser.cpp:
(WebCore::MediaQueryParser::parseMediaQuerySet):
(WebCore::MediaQueryParser::parseMediaCondition):
(WebCore::MediaQueryParser::MediaQueryParser):
(WebCore::MediaQueryData::addExpression):
* css/parser/MediaQueryParser.h:
(WebCore::MediaQueryData::setMediaQueryParserContext):
* css/parser/SizesAttributeParser.cpp:
(WebCore::SizesAttributeParser::parse):
* dom/DOMImplementation.cpp:
(WebCore::DOMImplementation::createCSSStyleSheet):
* dom/InlineStyleSheetOwner.cpp:
(WebCore::InlineStyleSheetOwner::createSheet):
* dom/ProcessingInstruction.cpp:
(WebCore::ProcessingInstruction::setCSSStyleSheet):
* html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::bestFitSourceFromPictureElement):
* html/HTMLLinkElement.cpp:
(WebCore::HTMLLinkElement::process):
(WebCore::HTMLLinkElement::initializeStyleSheet):
(WebCore::HTMLLinkElement::setCSSStyleSheet):
* html/HTMLLinkElement.h:
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::selectNextSourceChild):
* html/HTMLSourceElement.cpp:
(WebCore::HTMLSourceElement::parsedMediaAttribute const):
* html/HTMLSourceElement.h:
* html/HTMLStyleElement.cpp:
(WebCore::HTMLStyleElement::parseAttribute):
* html/parser/HTMLPreloadScanner.cpp:
(WebCore::TokenPreloadScanner::StartTagScanner::processAttribute):

Source/WebKitLegacy/mac:

* DOM/DOM.mm:
(-[DOMHTMLLinkElement _mediaQueryMatches]):

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

17 months agoRebaselined test on macOS WK1 after r229642.
jlewis3@apple.com [Fri, 16 Mar 2018 00:16:27 +0000 (00:16 +0000)]
Rebaselined test on macOS WK1 after r229642.

Unreviewed test gardening.

* platform/mac-wk1/fast/forms/file/entries-api/webkitdirectory-open-panel-expected.txt:

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

17 months agoUnreviewed, mark location-protocol-setter-non-broken-async-delegate.html as flaky...
cdumez@apple.com [Thu, 15 Mar 2018 23:44:29 +0000 (23:44 +0000)]
Unreviewed, mark location-protocol-setter-non-broken-async-delegate.html as flaky on all platforms, not just WK1

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

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

17 months agoFix MSVC run-time check after r229391.
ross.kirsling@sony.com [Thu, 15 Mar 2018 23:07:04 +0000 (23:07 +0000)]
Fix MSVC run-time check after r229391.
https://bugs.webkit.org/show_bug.cgi?id=183673

Reviewed by Keith Miller.

Replaces attempted fix from r229424/r229432.
Apparently MSVC doesn't like it when a zero-length std::array is defined without explicit braces.

* jit/CCallHelpers.h:
(JSC::CCallHelpers::clampArrayToSize):

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

17 months agoUnreviewed, rolling out r229639.
commit-queue@webkit.org [Thu, 15 Mar 2018 23:00:58 +0000 (23:00 +0000)]
Unreviewed, rolling out r229639.
https://bugs.webkit.org/show_bug.cgi?id=183683

it is causing a crash in API tests (Requested by youenn on
#webkit).

Reverted changeset:

"ActiveDOMObject should assert that they are destroyed in the
thread they are created"
https://bugs.webkit.org/show_bug.cgi?id=183671
https://trac.webkit.org/changeset/229639

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

17 months agoAdd and adopt WK_ALTERNATE_FRAMEWORKS_DIR in ANGLE
timothy_horton@apple.com [Thu, 15 Mar 2018 22:43:02 +0000 (22:43 +0000)]
Add and adopt WK_ALTERNATE_FRAMEWORKS_DIR in ANGLE
https://bugs.webkit.org/show_bug.cgi?id=183675
<rdar://problem/38515281>

Reviewed by Dan Bernstein.

Source/JavaScriptCore:

* JavaScriptCore.xcodeproj/project.pbxproj:
Don't install the JSC alias if we're installing to an alternate location.
This should have been a part of r229637.

Source/ThirdParty/ANGLE:

* ANGLE.xcodeproj/project.pbxproj:
* Configurations/ANGLE.xcconfig:
* Configurations/Base.xcconfig:

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

17 months agoBad configuration parameters should make RTCPeerConnection constructor throw
youenn@apple.com [Thu, 15 Mar 2018 22:41:31 +0000 (22:41 +0000)]
Bad configuration parameters should make RTCPeerConnection constructor throw
https://bugs.webkit.org/show_bug.cgi?id=183615

Reviewed by Eric Carlson.

LayoutTests/imported/w3c:

* web-platform-tests/webrtc/RTCConfiguration-bundlePolicy-expected.txt:
* web-platform-tests/webrtc/RTCConfiguration-iceServers-expected.txt:
* web-platform-tests/webrtc/rtcpeerconnection/rtcpeerconnection-constructor-expected.txt:

Source/WebCore:

Implement more of https://w3c.github.io/webrtc-pc/#set-pc-configuration.
Throw an error whenever underlying libwebrtc set configuration fails.

Covered by rebased test.

* Modules/mediastream/PeerConnectionBackend.h:
* Modules/mediastream/RTCPeerConnection.cpp:
(WebCore::iceServersFromConfiguration):
(WebCore::RTCPeerConnection::initializeConfiguration):
(WebCore::RTCPeerConnection::setConfiguration):
* Modules/mediastream/RTCPeerConnection.js:
(initializeRTCPeerConnection):
* Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.h:

LayoutTests:

Removed tests that are subsumed by WPT ones.

* fast/mediastream/RTCPeerConnection-expected.txt: Removed.
* fast/mediastream/RTCPeerConnection-getConfiguration-expected.txt: Removed.
* fast/mediastream/RTCPeerConnection-getConfiguration.html: Removed.
* fast/mediastream/RTCPeerConnection.html: Removed.
* platform/gtk/TestExpectations:
* platform/ios/TestExpectations:

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

17 months agoreplaceTrack triggers negotiationneeded
youenn@apple.com [Thu, 15 Mar 2018 22:36:42 +0000 (22:36 +0000)]
replaceTrack triggers negotiationneeded
https://bugs.webkit.org/show_bug.cgi?id=180342
<rdar://problem/35822426>

Reviewed by Eric Carlson.

Source/WebCore:

Covered by updated test.
Fix the case of replacing a track for which data is already flowing.
We should probably do the same for null tracks when fully implementing transceivers.

* Modules/mediastream/RTCPeerConnection.cpp:
(WebCore::RTCPeerConnection::enqueueReplaceTrackTask):

LayoutTests:

* webrtc/video-replace-track.html:

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