WebKit-https.git
15 months agoREGRESSION(r230960): Browser tests under TimeSeriesChart fetchMeasurementSets all...
rniwa@webkit.org [Mon, 30 Apr 2018 23:43:45 +0000 (23:43 +0000)]
REGRESSION(r230960): Browser tests under TimeSeriesChart fetchMeasurementSets all fail
https://bugs.webkit.org/show_bug.cgi?id=185125

Reviewed by Saam Barati.

The bug was caused by mock-remote-api.js always loading PrivilegedAPI using require, which doesn't work in a browser.
Fixed the bug by explicitly requiring the right kind of PrivilegedAPI in each unit test instead.

* unit-tests/analysis-task-tests.js:
* unit-tests/buildbot-syncer-tests.js:
* unit-tests/commit-log-tests.js:
* unit-tests/commit-set-range-bisector-tests.js:
* unit-tests/commit-set-tests.js:
* unit-tests/measurement-set-tests.js:
* unit-tests/privileged-api-tests.js:
* unit-tests/resources/mock-remote-api.js:
(MockRemoteAPI.inject): Take PrivilegedAPI instead of the type string. Also fixed a bug that _token wasn't unset
after each unit test, and superfluous initializations of originalRemoteAPI and originalPrivilegedAPI.
* unit-tests/test-groups-tests.js:

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

15 months ago<img src=mp4> does not display on ios despite Accept: video/* advertisement
jer.noble@apple.com [Mon, 30 Apr 2018 23:42:22 +0000 (23:42 +0000)]
<img src=mp4> does not display on ios despite Accept: video/* advertisement
https://bugs.webkit.org/show_bug.cgi?id=185029
<rdar://problem/39771989>

Reviewed by Eric Carlson.

Source/WebCore:

Returning "NO" from resourceLoader:shouldWaitForLoadingOfResource: signals that the load failed,
even if the resource request is successfully fulfilled prior to the return. Always return YES in
the case that loading succeeded.

* platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.mm:
(-[WebCoreSharedBufferResourceLoaderDelegate resourceLoader:shouldWaitForLoadingOfRequestedResource:]):

LayoutTests:

* platform/ios/TestExpectations:

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

15 months agoREGRESSION(r230914) Selecting text on this apple.com page makes it vanish
zalan@apple.com [Mon, 30 Apr 2018 23:16:42 +0000 (23:16 +0000)]
REGRESSION(r230914) Selecting text on this apple.com page makes it vanish
https://bugs.webkit.org/show_bug.cgi?id=185142
<rdar://problem/39821446>

Reviewed by Simon Fraser.

Source/WebCore:

Set the overflow rect on the inline textbox when needed.

Test: fast/text/simple-line-layout-selection-with-overflow.html

* rendering/SimpleLineLayoutFunctions.cpp:
(WebCore::SimpleLineLayout::initializeInlineTextBox):
(WebCore::SimpleLineLayout::generateLineBoxTree):
(WebCore::SimpleLineLayout::initializeInlineBox): Deleted.

LayoutTests:

* fast/text/simple-line-layout-selection-with-overflow-expected.html: Added.
* fast/text/simple-line-layout-selection-with-overflow.html: Added.

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

15 months agoApply PtrTags to the MetaAllocator and friends.
mark.lam@apple.com [Mon, 30 Apr 2018 22:29:21 +0000 (22:29 +0000)]
Apply PtrTags to the MetaAllocator and friends.
https://bugs.webkit.org/show_bug.cgi?id=185110
<rdar://problem/39533895>

Reviewed by Saam Barati.

Source/JavaScriptCore:

1. LinkBuffer now takes a MacroAssemblerCodePtr instead of a void* pointer.
2. Apply pointer tagging to the boundary pointers of the FixedExecutableMemoryPool,
   and add a sanity check to verify that allocated code buffers are within those
   bounds.

* assembler/LinkBuffer.cpp:
(JSC::LinkBuffer::finalizeCodeWithoutDisassemblyImpl):
(JSC::LinkBuffer::copyCompactAndLinkCode):
(JSC::LinkBuffer::linkCode):
(JSC::LinkBuffer::allocate):
* assembler/LinkBuffer.h:
(JSC::LinkBuffer::LinkBuffer):
(JSC::LinkBuffer::debugAddress):
(JSC::LinkBuffer::code):
* assembler/MacroAssemblerCodeRef.h:
(JSC::MacroAssemblerCodeRef::MacroAssemblerCodeRef):
* bytecode/InlineAccess.cpp:
(JSC::linkCodeInline):
(JSC::InlineAccess::rewireStubAsJump):
* dfg/DFGJITCode.cpp:
(JSC::DFG::JITCode::findPC):
* ftl/FTLJITCode.cpp:
(JSC::FTL::JITCode::findPC):
* jit/ExecutableAllocator.cpp:
(JSC::FixedVMPoolExecutableAllocator::FixedVMPoolExecutableAllocator):
(JSC::FixedVMPoolExecutableAllocator::jitWriteThunkGenerator):
(JSC::ExecutableAllocator::allocate):
* jit/ExecutableAllocator.h:
(JSC::isJITPC):
(JSC::performJITMemcpy):
* jit/JIT.cpp:
(JSC::JIT::link):
* jit/JITMathIC.h:
(JSC::isProfileEmpty):
* runtime/JSCPtrTag.h:
* wasm/WasmCallee.cpp:
(JSC::Wasm::Callee::Callee):
* wasm/WasmFaultSignalHandler.cpp:
(JSC::Wasm::trapHandler):

Source/WTF:

1. Introduce a MetaAllocatorPtr smart pointer to do pointer tagging.
2. Use MetaAllocatorPtr in MetaAllocator and MetaAllocatorHandle.

* WTF.xcodeproj/project.pbxproj:
* wtf/CMakeLists.txt:
* wtf/MetaAllocator.cpp:
(WTF::MetaAllocator::release):
(WTF::MetaAllocatorHandle::MetaAllocatorHandle):
(WTF::MetaAllocatorHandle::shrink):
(WTF::MetaAllocatorHandle::dump const):
(WTF::MetaAllocator::allocate):
(WTF::MetaAllocator::findAndRemoveFreeSpace):
(WTF::MetaAllocator::addFreeSpaceFromReleasedHandle):
(WTF::MetaAllocator::addFreshFreeSpace):
(WTF::MetaAllocator::debugFreeSpaceSize):
(WTF::MetaAllocator::addFreeSpace):
(WTF::MetaAllocator::allocFreeSpaceNode):
* wtf/MetaAllocator.h:
(WTF::MetaAllocatorTracker::find):
(WTF::MetaAllocator::FreeSpaceNode::FreeSpaceNode):
(WTF::MetaAllocator::FreeSpaceNode::sizeInBytes):
(WTF::MetaAllocator::FreeSpaceNode::key):
* wtf/MetaAllocatorHandle.h:
(WTF::MetaAllocatorHandle::start const):
(WTF::MetaAllocatorHandle::end const):
(WTF::MetaAllocatorHandle::startAsInteger const):
(WTF::MetaAllocatorHandle::endAsInteger const):
(WTF::MetaAllocatorHandle::sizeInBytes const):
(WTF::MetaAllocatorHandle::containsIntegerAddress const):
(WTF::MetaAllocatorHandle::key):
* wtf/MetaAllocatorPtr.h: Added.
(WTF::MetaAllocatorPtr::MetaAllocatorPtr):
(WTF::MetaAllocatorPtr:: const):
(WTF::MetaAllocatorPtr::operator bool const):
(WTF::MetaAllocatorPtr::operator! const):
(WTF::MetaAllocatorPtr::operator== const):
(WTF::MetaAllocatorPtr::operator!= const):
(WTF::MetaAllocatorPtr::operator+ const):
(WTF::MetaAllocatorPtr::operator- const):
(WTF::MetaAllocatorPtr::operator+=):
(WTF::MetaAllocatorPtr::operator-=):
(WTF::MetaAllocatorPtr::isEmptyValue const):
(WTF::MetaAllocatorPtr::isDeletedValue const):
(WTF::MetaAllocatorPtr::hash const):
(WTF::MetaAllocatorPtr::emptyValue):
(WTF::MetaAllocatorPtr::deletedValue):
(WTF::MetaAllocatorPtrHash::hash):
(WTF::MetaAllocatorPtrHash::equal):
* wtf/PtrTag.h:

Tools:

Update the test to match MetaAllocator changes in WTF.

* TestWebKitAPI/Tests/WTF/MetaAllocator.cpp:
(TestWebKitAPI::TEST_F):
(WTF::tagForPtr):
(WTF::ptrTagName):

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

15 months agoAdd WKUIDelegatePrivate equivalent of WKPageContextMenuClient getContextMenuFromPropo...
commit-queue@webkit.org [Mon, 30 Apr 2018 22:21:42 +0000 (22:21 +0000)]
Add WKUIDelegatePrivate equivalent of WKPageContextMenuClient getContextMenuFromProposedMenuAsync
https://bugs.webkit.org/show_bug.cgi?id=180955

Patch by Alex Christensen <achristensen@webkit.org> on 2018-04-30
Reviewed by Andy Estes.

Source/WebKit:

* UIProcess/API/APIContextMenuClient.h:
(API::ContextMenuClient::menuFromProposedMenu):
* UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
* UIProcess/Cocoa/UIDelegate.h:
* UIProcess/Cocoa/UIDelegate.mm:
(WebKit::UIDelegate::setDelegate):
(WebKit::UIDelegate::ContextMenuClient::menuFromProposedMenu):
* UIProcess/mac/WebContextMenuProxyMac.mm:
(WebKit::WebContextMenuProxyMac::showContextMenuWithItems):

Tools:

* TestWebKitAPI/Tests/WebKit/mac/ContextMenuImgWithVideo.mm:
(-[ContextMenuImgWithVideoDelegate _webView:contextMenu:forElement:]):
(-[ContextMenuImgWithVideoDelegate _webView:getContextMenuFromProposedMenu:forElement:userInfo:completionHandler:]):

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

15 months agoMove the MayBePrototype JSCell header bit to InlineTypeFlags
keith_miller@apple.com [Mon, 30 Apr 2018 22:13:10 +0000 (22:13 +0000)]
Move the MayBePrototype JSCell header bit to InlineTypeFlags
https://bugs.webkit.org/show_bug.cgi?id=185143

Reviewed by Mark Lam.

* runtime/IndexingType.h:
* runtime/JSCellInlines.h:
(JSC::JSCell::setStructure):
(JSC::JSCell::mayBePrototype const):
(JSC::JSCell::didBecomePrototype):
* runtime/JSTypeInfo.h:
(JSC::TypeInfo::mayBePrototype):
(JSC::TypeInfo::mergeInlineTypeFlags):

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

15 months agoRemove unneeded exception check from String.fromCharCode
keith_miller@apple.com [Mon, 30 Apr 2018 21:38:26 +0000 (21:38 +0000)]
Remove unneeded exception check from String.fromCharCode
https://bugs.webkit.org/show_bug.cgi?id=185083

Reviewed by Mark Lam.

* runtime/StringConstructor.cpp:
(JSC::stringFromCharCode):

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

15 months agoUse some C++17 features
jfbastien@apple.com [Mon, 30 Apr 2018 21:17:59 +0000 (21:17 +0000)]
Use some C++17 features
https://bugs.webkit.org/show_bug.cgi?id=185135

Reviewed by Alex Christensen.

.:

As discussed here [0] let's move WebKit to a subset of C++17. We
now require GCC 6 [1] which means that, according to [2] we can
use the following C++17 language features (I removed some
uninteresting ones):

 - New auto rules for direct-list-initialization
 - static_assert with no message
 - typename in a template template parameter
 - Nested namespace definition
 - Attributes for namespaces and enumerators
 - u8 character literals
 - Allow constant evaluation for all non-type template arguments
 - Fold Expressions
 - Unary fold expressions and empty parameter packs
 - __has_include in preprocessor conditional
 - Differing begin and end types in range-based for
 - Improving std::pair and std::tuple

Consult the Tony Tables [3] to see before / after examples.

Of course we can use any library feature if we're willing to
import them to WTF (and they don't require language support).

  [0]: https://lists.webkit.org/pipermail/webkit-dev/2018-March/029922.html
  [1]: https://trac.webkit.org/changeset/231152/webkit
  [2]: https://en.cppreference.com/w/cpp/compiler_support
  [3]: https://github.com/tvaneerd/cpp17_in_TTs/blob/master/ALL_IN_ONE.md

* Source/cmake/WebKitCompilerFlags.cmake:

Source/WebCore:

As discussed here [0] let's move WebKit to a subset of C++17. We
now require GCC 6 [1] which means that, according to [2] we can
use the following C++17 language features (I removed some
uninteresting ones):

 - New auto rules for direct-list-initialization
 - static_assert with no message
 - typename in a template template parameter
 - Nested namespace definition
 - Attributes for namespaces and enumerators
 - u8 character literals
 - Allow constant evaluation for all non-type template arguments
 - Fold Expressions
 - Unary fold expressions and empty parameter packs
 - __has_include in preprocessor conditional
 - Differing begin and end types in range-based for
 - Improving std::pair and std::tuple

Consult the Tony Tables [3] to see before / after examples.

Of course we can use any library feature if we're willing to
import them to WTF (and they don't require language support).

  [0]: https://lists.webkit.org/pipermail/webkit-dev/2018-March/029922.html
  [1]: https://trac.webkit.org/changeset/231152/webkit
  [2]: https://en.cppreference.com/w/cpp/compiler_support
  [3]: https://github.com/tvaneerd/cpp17_in_TTs/blob/master/ALL_IN_ONE.md

* DerivedSources.make:
* platform/URLParser.cpp: work around an odd GCC 6 bug with class
  static value as a template parameter.
(WebCore::URLParser::percentDecode):
(WebCore::URLParser::domainToASCII):
(WebCore::URLParser::hasForbiddenHostCodePoint):
(WebCore::URLParser::parseHostAndPort):
* platform/URLParser.h:

Source/WebKit:

As discussed here [0] let's move WebKit to a subset of C++17. We
now require GCC 6 [1] which means that, according to [2] we can
use the following C++17 language features (I removed some
uninteresting ones):

 - New auto rules for direct-list-initialization
 - static_assert with no message
 - typename in a template template parameter
 - Nested namespace definition
 - Attributes for namespaces and enumerators
 - u8 character literals
 - Allow constant evaluation for all non-type template arguments
 - Fold Expressions
 - Unary fold expressions and empty parameter packs
 - __has_include in preprocessor conditional
 - Differing begin and end types in range-based for
 - Improving std::pair and std::tuple

Consult the Tony Tables [3] to see before / after examples.

Of course we can use any library feature if we're willing to
import them to WTF (and they don't require language support).

  [0]: https://lists.webkit.org/pipermail/webkit-dev/2018-March/029922.html
  [1]: https://trac.webkit.org/changeset/231152/webkit
  [2]: https://en.cppreference.com/w/cpp/compiler_support
  [3]: https://github.com/tvaneerd/cpp17_in_TTs/blob/master/ALL_IN_ONE.md

* Configurations/Base.xcconfig:
* DerivedSources.make:
* PlatformMac.cmake:

Source/WebKitLegacy:

* PlatformMac.cmake:

Source/WebKitLegacy/mac:

* Configurations/WebKitLegacy.xcconfig:

Source/WTF:

* wtf/StdLibExtras.h: libstdc++ doesn't say it's C++17 when it
defines std::conjunction. Use the feature test macro instead.

Tools:

* DumpRenderTree/PlatformMac.cmake:
* gtk/ycm_extra_conf.py:
(FlagsForFile):

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

15 months agoMeasurementSet._constructUrl should construct absolute url.
dewei_zhu@apple.com [Mon, 30 Apr 2018 21:06:05 +0000 (21:06 +0000)]
MeasurementSet._constructUrl should construct absolute url.
https://bugs.webkit.org/show_bug.cgi?id=185137

Reviewed by Ryosuke Niwa.

MeasurementSet._constructUrl should not construct an url with relative path.

* public/v3/models/measurement-set.js: Should use '/api/measurement-set...' and '/data/measurement-set-...'
for uncached and cached fetching.
* unit-tests/measurement-set-tests.js: Updated unit tests.
(const.set MeasurementSet):

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

15 months ago[Extra zoom mode] Respect the existing shrink-to-fit attribute instead of using min...
wenson_hsieh@apple.com [Mon, 30 Apr 2018 20:56:39 +0000 (20:56 +0000)]
[Extra zoom mode] Respect the existing shrink-to-fit attribute instead of using min-device-width
https://bugs.webkit.org/show_bug.cgi?id=185132
<rdar://problem/39834562>

Reviewed by Tim Horton.

Source/WebCore:

Removes the `min-device-width` attribute added in r231095. Instead, we key this behavior off of the
`shrink-to-fit` attribute introduced for multitasking on iPad, such that `shrink-to-fit=no` achieves the same
behavior as `min-device-width=0` in extra zoom mode. See comments below for more detail.

Adjusted an existing layout test: fast/viewport/extrazoom/viewport-change-min-device-width.html.

* dom/ViewportArguments.cpp:
(WebCore::setViewportFeature):
(WebCore::operator<<):
* dom/ViewportArguments.h:

Removes the `minDeviceWidth` viewport argument.

* page/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::setMinDeviceWidthEnabled): Deleted.
(WebCore::RuntimeEnabledFeatures::minDeviceWidthEnabled const): Deleted.

Removes the runtime switch for `min-device-width`.

* page/ViewportConfiguration.cpp:
(WebCore::platformDeviceWidthOverride):

Hard-code the override device width in extra zoom mode.

(WebCore::ViewportConfiguration::shouldOverrideDeviceWidthAndShrinkToFit const):

In extra zoom mode, override the device width only if shrink-to-fit has not been expliticly disabled, and the
device width is less than the override device width.

(WebCore::ViewportConfiguration::shouldIgnoreHorizontalScalingConstraints const):
(WebCore::ViewportConfiguration::shouldIgnoreScalingConstraintsRegardlessOfContentSize const):
(WebCore::ViewportConfiguration::updateConfiguration):
(WebCore::ViewportConfiguration::updateMinimumLayoutSize):

Do not override the minimum layout size if `shrink-to-fit` has been explicitly explicitly disabled, or if the
device width is greater than the override device width.

(WebCore::computedMinDeviceWidth): Deleted.
(WebCore::ViewportConfiguration::shouldOverrideDeviceWidthWithMinDeviceWidth const): Deleted.
* page/ViewportConfiguration.h:

Source/WebKit:

Remove the experimental feature for `min-device-width`.

* Shared/WebPreferences.yaml:

LayoutTests:

Modifies an existing layout test to try out different values of `shrink-to-fit` instead of using the
`min-device-width` attribute. This test now begins with the default viewport configuration, then explicitly
disables `shrink-to-fit` by setting the attribute to a few different values (which should all achieve the same
effect), and lastly explicitly re-enables `shrink-to-fit` by setting the attribute value to several values that
should behave the same as `shrink-to-fit=yes`.

* fast/viewport/extrazoom/viewport-change-min-device-width.html:

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

15 months agoMandate H264 hardware encoder for Mac in libwebrtc
youenn@apple.com [Mon, 30 Apr 2018 20:28:22 +0000 (20:28 +0000)]
Mandate H264 hardware encoder for Mac in libwebrtc
https://bugs.webkit.org/show_bug.cgi?id=184835

Reviewed by Eric Carlson.

Tested manually through console traces that hardware VCP encoder code path is actually used instead of software VCP encoder code path.

* Source/webrtc/sdk/objc/Framework/Classes/VideoToolbox/RTCVideoEncoderH264.mm:
(-[RTCVideoEncoderH264 resetCompressionSessionWithPixelFormat:]):
* WebKit/0001-Update-RTCVideoEncoderH264.mm-for-WebKit.patch: Added to cover this change and changes made in bug 184668 and 183961.

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

15 months agoMove StructureIsImmortal to out of line flags.
keith_miller@apple.com [Mon, 30 Apr 2018 20:22:08 +0000 (20:22 +0000)]
Move StructureIsImmortal to out of line flags.
https://bugs.webkit.org/show_bug.cgi?id=185101

Reviewed by Saam Barati.

This will free up a bit in the inline flags where we can move the
isPrototype bit to. This will, in turn, free a bit for use in
implementing copy on write butterflies.

Also, this patch removes an assertion from Structure::typeInfo()
that inadvertently makes the function invalid to call while
cleaning up the vm.

* heap/HeapCellType.cpp:
(JSC::DefaultDestroyFunc::operator() const):
* runtime/JSCell.h:
* runtime/JSCellInlines.h:
(JSC::JSCell::callDestructor): Deleted.
* runtime/JSTypeInfo.h:
(JSC::TypeInfo::hasStaticPropertyTable):
(JSC::TypeInfo::structureIsImmortal const):
* runtime/Structure.h:

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

15 months agoSerialize font-variation-settings with double-quotes per spec
commit-queue@webkit.org [Mon, 30 Apr 2018 19:56:28 +0000 (19:56 +0000)]
Serialize font-variation-settings with double-quotes per spec
https://bugs.webkit.org/show_bug.cgi?id=182542

Patch by Chris Nardi <cnardi@chromium.org> on 2018-04-30
Reviewed by Myles C. Maxfield.

Source/WebCore:

According to the CSSOM spec [1], all strings should be serialized with double-quotes.
The axis name in font-variation-settings was previously serialized with single-quotes;
change this to double-quotes to match the spec and non-WebKit browsers.

[1]: https://drafts.csswg.org/cssom/#common-serializing-idioms

Updated fast/text/variations/getComputedStyle.html to test the change.

* css/CSSFontVariationValue.cpp:
(WebCore::CSSFontVariationValue::customCSSText const):

LayoutTests:

Updated test to verify double-quotes are used.

* fast/text/variations/getComputedStyle-expected.txt:
* fast/text/variations/getComputedStyle.html:

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

15 months agoInclude breadcrumb for tracking resource loading into CFNetwork
krollin@apple.com [Mon, 30 Apr 2018 19:31:50 +0000 (19:31 +0000)]
Include breadcrumb for tracking resource loading into CFNetwork
https://bugs.webkit.org/show_bug.cgi?id=184837
rdar://problem/39575411

Reviewed by Brent Fulgham.

When starting the network-based loading of a resource, log the
description provided by NetworkDataTask. On Cocoa, this is implemented
to return the description property in NSURLSessionTask. This
information better allows us to track a resource load through the
WebContent process, the Networking process, and the Cocoa networking
layers.

* NetworkProcess/NetworkDataTask.cpp:
(WebKit::NetworkDataTask::description const):
* NetworkProcess/NetworkDataTask.h:
* NetworkProcess/NetworkLoad.cpp:
(WebKit::NetworkLoad::description const):
* NetworkProcess/NetworkLoad.h:
* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::NetworkResourceLoader::startNetworkLoad):
* NetworkProcess/cocoa/NetworkDataTaskCocoa.h:
* NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
(WebKit::NetworkDataTaskCocoa::description const):

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

15 months agoFix bad use of RunLoop::main().dispatch() in MessagePort::dispatchMessages()
cdumez@apple.com [Mon, 30 Apr 2018 19:13:33 +0000 (19:13 +0000)]
Fix bad use of RunLoop::main().dispatch() in MessagePort::dispatchMessages()
https://bugs.webkit.org/show_bug.cgi?id=185134

Reviewed by Geoffrey Garen.

Fix bad use of RunLoop::main().dispatch() in MessagePort::dispatchMessages(). This code runs on iOS WebKitLegacy
and it is therefore unsafe to use RunLoop::main() here. We want to use callOnMainThread() instead to run code on
the WebThread.

* dom/MessagePort.cpp:
(WebCore::MessagePort::dispatchMessages):

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

15 months ago[JSC] Remove arity fixup check if the number of parameters is 1
utatane.tea@gmail.com [Mon, 30 Apr 2018 18:02:08 +0000 (18:02 +0000)]
[JSC] Remove arity fixup check if the number of parameters is 1
https://bugs.webkit.org/show_bug.cgi?id=183984

Reviewed by Mark Lam.

If the number of parameters is one (|this|), we never hit arity fixup check.
We do not need to emit arity fixup check code.

* dfg/DFGDriver.cpp:
(JSC::DFG::compileImpl):
* dfg/DFGJITCompiler.cpp:
(JSC::DFG::JITCompiler::compileFunction):
* dfg/DFGJITCompiler.h:
* ftl/FTLLink.cpp:
(JSC::FTL::link):
* jit/JIT.cpp:
(JSC::JIT::compileWithoutLinking):

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

15 months agoMake color-filter affect caret-color
simon.fraser@apple.com [Mon, 30 Apr 2018 17:51:51 +0000 (17:51 +0000)]
Make color-filter affect caret-color
https://bugs.webkit.org/show_bug.cgi?id=185129
rdar://problem/39829066

Reviewed by Tim Horton.
Source/WebCore:

Transform the colors used to compare the caret color with the background through
color-filter (since we want contrasting colors after filters are applied), and
transform caret-color itself.

Test: css3/color-filters/color-filter-caret-color.html

* editing/FrameSelection.cpp:
(WebCore::CaretBase::paintCaret const):

LayoutTests:

* css3/color-filters/color-filter-caret-color-expected.html: Added.
* css3/color-filters/color-filter-caret-color.html: Added.

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

15 months agoUse WordLock instead of std::mutex for Threading
utatane.tea@gmail.com [Mon, 30 Apr 2018 17:30:26 +0000 (17:30 +0000)]
Use WordLock instead of std::mutex for Threading
https://bugs.webkit.org/show_bug.cgi?id=185121

Reviewed by Geoffrey Garen.

Source/bmalloc:

Add constexpr to explicitly describe that bmalloc::Mutex constructor is constexpr.

* bmalloc/Mutex.h:

Source/JavaScriptCore:

ThreadGroup starts using WordLock.

* heap/MachineStackMarker.h:
(JSC::MachineThreads::getLock):

Source/WTF:

Before r231151, WordLock depends on ThreadSpecific. It means that our Threading implementation
cannot use this lock since Threading primitives could touch these locks after ThreadSpecific
for that WordLock is destroyed.

Now WordLock is changed not to use ThreadSpecific. So it does not depend on our Threading
mechanism and our Threading can start using WordLock internally.

This patch changes WTF::Thread and WTF::ThreadGroup to use WordLock instead of std::mutex.

And add constexpr to explicitly describe that Lock, Condition, and WordLock constructors are constexpr.

* wtf/Condition.h:
* wtf/Lock.h:
* wtf/ThreadGroup.h:
(WTF::ThreadGroup::getLock):
* wtf/Threading.cpp:
(WTF::Thread::didExit):
(WTF::Thread::addToThreadGroup):
(WTF::Thread::removeFromThreadGroup):
* wtf/Threading.h:
* wtf/ThreadingPthreads.cpp:
(WTF::Thread::changePriority):
(WTF::Thread::waitForCompletion):
(WTF::Thread::detach):
(WTF::Thread::signal):
(WTF::Thread::establishPlatformSpecificHandle):
* wtf/ThreadingWin.cpp:
(WTF::Thread::changePriority):
(WTF::Thread::waitForCompletion):
(WTF::Thread::detach):
(WTF::Thread::establishPlatformSpecificHandle):
(WTF::Thread::initializeTLSKey):
(WTF::Thread::currentDying):
(WTF::Thread::get):
(WTF::Thread::initializeTLS):
(WTF::Thread::destructTLS):
(WTF::threadMapMutex): Deleted.
* wtf/WordLock.h:

Tools:

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

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

15 months ago[iOS] Try to unlock PDF documents before printing them
aestes@apple.com [Mon, 30 Apr 2018 16:16:40 +0000 (16:16 +0000)]
[iOS] Try to unlock PDF documents before printing them
https://bugs.webkit.org/show_bug.cgi?id=185084
<rdar://problem/39356622>

Reviewed by Dan Bernstein.

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

Stored the password that successfully unlocked the current PDF document.

(-[WKPDFView _wk_printedDocument]):

Used the stored password to unlock the CGPDFDocument we create for printing.

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

15 months ago[GTK] Webkit should spoof as Safari on a Mac when on Chase.com
mcatanzaro@igalia.com [Mon, 30 Apr 2018 15:16:14 +0000 (15:16 +0000)]
[GTK] Webkit should spoof as Safari on a Mac when on Chase.com
https://bugs.webkit.org/show_bug.cgi?id=185103

Reviewed by Carlos Garcia Campos.

Source/WebCore:

Send a fake user agent to chase.com to make it work.

* platform/UserAgentQuirks.cpp:
(WebCore::urlRequiresMacintoshPlatform):
(WebCore::UserAgentQuirks::stringForQuirk): Also, remove this stale comment.

Tools:

* TestWebKitAPI/Tests/WebCore/UserAgentQuirks.cpp:
(TestWebKitAPI::TEST):

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

15 months agoMake color-filter affect <attachment>
simon.fraser@apple.com [Mon, 30 Apr 2018 05:24:11 +0000 (05:24 +0000)]
Make color-filter affect <attachment>
https://bugs.webkit.org/show_bug.cgi?id=185122
rdar://problem/39818763

Reviewed by Tim Horton.

Convert the colors used to render <attachment> through color-filter, except
for those parts that render over the icon (like the progress bar).

Not easily testable.

* rendering/RenderThemeMac.mm:
(WebCore::titleTextColorForAttachment):
(WebCore::AttachmentLayout::layOutTitle):
(WebCore::AttachmentLayout::layOutSubtitle):
(WebCore::paintAttachmentIconBackground):
(WebCore::paintAttachmentTitleBackground):
(WebCore::paintAttachmentPlaceholderBorder):

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

15 months agoB3 should run tail duplication at the bitter end
fpizlo@apple.com [Sun, 29 Apr 2018 23:41:55 +0000 (23:41 +0000)]
B3 should run tail duplication at the bitter end
https://bugs.webkit.org/show_bug.cgi?id=185123

Reviewed by Geoffrey Garen.

Also added an option to disable taildup. This appears to be a 1% AsmBench speed-up. It's neutral
everywhere else.

The goal of this change is to allow us to run path specialization after switch lowering but
before tail duplication.

* b3/B3Generate.cpp:
(JSC::B3::generateToAir):
* runtime/Options.h:

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

15 months agoFix color-filter to apply to SVG colors
simon.fraser@apple.com [Sun, 29 Apr 2018 17:30:35 +0000 (17:30 +0000)]
Fix color-filter to apply to SVG colors
https://bugs.webkit.org/show_bug.cgi?id=185113
rdar://problem/39665082

Reviewed by Dean Jackson.
Source/WebCore:

Convert SVG colors through color-filter operations for the places in SVG
that use color, namely fill and stroke, gradients, lighting colors and
drop-shadow.

Test: css3/color-filters/svg/color-filter-inline-svg.html

* rendering/svg/RenderSVGResourceGradient.cpp:
(WebCore::RenderSVGResourceGradient::applyResource):
* rendering/svg/RenderSVGResourceGradient.h:
* rendering/svg/RenderSVGResourceLinearGradient.cpp:
(WebCore::RenderSVGResourceLinearGradient::buildGradient const):
* rendering/svg/RenderSVGResourceLinearGradient.h:
* rendering/svg/RenderSVGResourceRadialGradient.cpp:
(WebCore::RenderSVGResourceRadialGradient::buildGradient const):
* rendering/svg/RenderSVGResourceRadialGradient.h:
* rendering/svg/RenderSVGResourceSolidColor.cpp:
(WebCore::RenderSVGResourceSolidColor::applyResource):
* svg/SVGFEDiffuseLightingElement.cpp:
(WebCore::SVGFEDiffuseLightingElement::setFilterEffectAttribute):
(WebCore::SVGFEDiffuseLightingElement::build):
* svg/SVGFEDropShadowElement.cpp:
(WebCore::SVGFEDropShadowElement::build):
* svg/SVGFEFloodElement.cpp:
(WebCore::SVGFEFloodElement::build):
* svg/SVGFESpecularLightingElement.cpp:
(WebCore::SVGFESpecularLightingElement::setFilterEffectAttribute):
(WebCore::SVGFESpecularLightingElement::build):

LayoutTests:

* css3/color-filters/svg/color-filter-inline-svg-expected.html: Added.
* css3/color-filters/svg/color-filter-inline-svg.html: Added.

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

15 months ago[CMake] Require GCC 6
mcatanzaro@igalia.com [Sun, 29 Apr 2018 17:29:56 +0000 (17:29 +0000)]
[CMake] Require GCC 6
https://bugs.webkit.org/show_bug.cgi?id=184985

Reviewed by Alex Christensen.

.:

Require it.

* CMakeLists.txt:

Source/WebCore:

Remove a GCC 5 fallback path. This seems to be the only such fallback path in WebKit.

* platform/graphics/FourCC.h:
(WebCore::FourCC::FourCC):

Source/WTF:

Stop enforcing GCC version in Compiler.h. It's better to do this in the build system. And I
don't like having the same check in two different places.

* wtf/Compiler.h:

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

15 months agoWordLock doesn't need per-thread data
ggaren@apple.com [Sun, 29 Apr 2018 17:29:13 +0000 (17:29 +0000)]
WordLock doesn't need per-thread data
https://bugs.webkit.org/show_bug.cgi?id=185119

Reviewed by Yusuke Suzuki.

The stack is per-thread data, so we can stack-allocate our ThreadData.

This eliminates malloc() and high-level WTF threading primitives from
WordLock, making WordLock more portable to non-WTF code, including
bmalloc.

(NOTE: This patch makes the bug fixed in r231148 100% reproducible.)

* wtf/WordLock.cpp:
(WTF::WordLock::lockSlow): Allocate ThreadData on the stack.

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

15 months ago[LFC] Implement Display::Box functions
zalan@apple.com [Sun, 29 Apr 2018 16:09:38 +0000 (16:09 +0000)]
[LFC] Implement Display::Box functions
https://bugs.webkit.org/show_bug.cgi?id=185116

Reviewed by Antti Koivisto.

* layout/displaytree/DisplayBox.cpp:
(WebCore::Display::Box::Box):
(WebCore::Display::Box::~Box):
(WebCore::Display::Box::marginBox const):
(WebCore::Display::Box::borderBox const):
(WebCore::Display::Box::paddingBox const):
(WebCore::Display::Box::contentBox const):
* layout/displaytree/DisplayBox.h:
(WebCore::Display::Box::rect const):
(WebCore::Display::Box::top const):
(WebCore::Display::Box::left const):
(WebCore::Display::Box::bottom const):
(WebCore::Display::Box::right const):
(WebCore::Display::Box::topLeft const):
(WebCore::Display::Box::bottomRight const):
(WebCore::Display::Box::size const):
(WebCore::Display::Box::width const):
(WebCore::Display::Box::height const):
(WebCore::Display::Box::marginTop const):
(WebCore::Display::Box::marginLeft const):
(WebCore::Display::Box::marginBottom const):
(WebCore::Display::Box::marginRight const):
(WebCore::Display::Box::parent const):
(WebCore::Display::Box::nextSibling const):
(WebCore::Display::Box::previousSibling const):
(WebCore::Display::Box::firstChild const):
(WebCore::Display::Box::lastChild const):
(WebCore::Display::Box::setRect):
(WebCore::Display::Box::setTopLeft):
(WebCore::Display::Box::setTop):
(WebCore::Display::Box::setLeft):
(WebCore::Display::Box::setSize):
(WebCore::Display::Box::setWidth):
(WebCore::Display::Box::setHeight):
(WebCore::Display::Box::setMarginTop):
(WebCore::Display::Box::setMarginLeft):
(WebCore::Display::Box::setMarginBottom):
(WebCore::Display::Box::setMarginRight):
(WebCore::Display::Box::setBorderTop):
(WebCore::Display::Box::setBorderLeft):
(WebCore::Display::Box::setBorderBottom):
(WebCore::Display::Box::setBorderRight):
(WebCore::Display::Box::setPaddingTop):
(WebCore::Display::Box::setPaddingLeft):
(WebCore::Display::Box::setPaddingBottom):
(WebCore::Display::Box::setPaddingRight):
(WebCore::Display::Box::setParent):
(WebCore::Display::Box::setNextSibling):
(WebCore::Display::Box::setPreviousSibling):
(WebCore::Display::Box::setFirstChild):
(WebCore::Display::Box::setLastChild):

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

15 months agoMake RestrictedHTTPResponseAccess flag true by default
youenn@apple.com [Sun, 29 Apr 2018 15:32:51 +0000 (15:32 +0000)]
Make RestrictedHTTPResponseAccess flag true by default
https://bugs.webkit.org/show_bug.cgi?id=185089

Reviewed by Geoffrey Garen.

* page/RuntimeEnabledFeatures.h:

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

15 months agoFixed a very unlikely race condition in WTF::WordLock
ggaren@apple.com [Sun, 29 Apr 2018 15:23:52 +0000 (15:23 +0000)]
Fixed a very unlikely race condition in WTF::WordLock
https://bugs.webkit.org/show_bug.cgi?id=185117

Reviewed by Saam Barati.

The race goes like this:

Thread L is in lockSlowCase() and thread U is in unlockSlowCase();

- U acquires queueHead->parkingLock.
- U sets queueHead->shouldPark = false
- U releases queueHead->parkingLock.
- L spuriously wakes up from queueHead->parkingLock.wait()
- L acquires queueHead->parkingLock.
- L notices that queueHead->shouldPark = false, and acquires the WordLock
- L finishes all its work and exits, freeing queueHead
- U notifies queueHead->parkingLock (after free) and crashes or deadlocks

These conditions are currently so unlikely that I don't know how to test
them. I noticed this race because I changed WordLock's allocation pattern
to allow queueHead to be freed more often, and I crashed / deadlocked 100%.

Shout out to <http://en.cppreference.com/w/cpp/thread/condition_variable/notify_one>
for explaining this.

* benchmarks/ToyLocks.h: Fixed build.

* wtf/WordLock.cpp:
(WTF::WordLock::unlockSlow): Hold the lock a little longer to avoid
this race.

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

15 months agoUnreviewed, rolling out r231137.
commit-queue@webkit.org [Sun, 29 Apr 2018 13:33:25 +0000 (13:33 +0000)]
Unreviewed, rolling out r231137.
https://bugs.webkit.org/show_bug.cgi?id=185118

It is breaking Test262 language/expressions/multiplication
/order-of-evaluation.js (Requested by caiolima on #webkit).

Reverted changeset:

"[ESNext][BigInt] Implement support for "*" operation"
https://bugs.webkit.org/show_bug.cgi?id=183721
https://trac.webkit.org/changeset/231137

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

15 months ago[Cocoa] Set HTTPOnly flag when converting Cookie to NSHTTPCookie
commit-queue@webkit.org [Sun, 29 Apr 2018 05:26:40 +0000 (05:26 +0000)]
[Cocoa] Set HTTPOnly flag when converting Cookie to NSHTTPCookie
https://bugs.webkit.org/show_bug.cgi?id=185052

Patch by Sihui Liu <sihui_liu@apple.com> on 2018-04-28
Reviewed by Geoffrey Garen.

Source/WebCore:

Set HTTPOnly for NSHTTPCookie when it's converted from Cookie, so the WebKit APIs could
create NSHTTPCookie with correct HTTPOnly flag. Also, reverted the change made to operator
function because we want the Cookie class to act as a wrapper for NSHTTPCookie and leverage
its equal function.

Modified API test: WebKit.WKHTTPCookieStoreHttpOnly

* platform/network/cocoa/CookieCocoa.mm:
(WebCore::Cookie::operator NSHTTPCookie * const):
(WebCore::Cookie::operator== const):
* platform/network/cocoa/NetworkStorageSessionCocoa.mm:
(WebCore::NetworkStorageSession::deleteCookie):

Tools:

Modified API test to provide correct test cases for HTTPOnly flag.

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

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

15 months agoWe don't model regexp effects properly
sbarati@apple.com [Sun, 29 Apr 2018 01:17:06 +0000 (01:17 +0000)]
We don't model regexp effects properly
https://bugs.webkit.org/show_bug.cgi?id=185059
<rdar://problem/39736150>

Reviewed by Filip Pizlo.

JSTests:

* stress/regexp-exec-test-effectful-last-index.js: Added.
(assert):
(foo):
(i.regexLastIndex.toString):
(bar):

Source/JavaScriptCore:

RegExp exec/test can do arbitrary effects when toNumbering the lastIndex if
the regexp is global.

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

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

15 months ago[iOS] Present an action sheet when long-pressing on PDF links
aestes@apple.com [Sun, 29 Apr 2018 00:51:35 +0000 (00:51 +0000)]
[iOS] Present an action sheet when long-pressing on PDF links
https://bugs.webkit.org/show_bug.cgi?id=185093
<rdar://problem/39356651>

Reviewed by Dan Bernstein.

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

Called -[WKActionSheetAssistant cleanupSheet].

(-[WKPDFView web_setContentProviderData:suggestedFilename:]):

Created a WKActionSheetAssistant with the host view as the assistant view and
ourselves as the delegate.

(-[WKPDFView _URLWithPageIndex:]):

Added. Creates a URL to the current page with a page number fragment appended.

(-[WKPDFView _goToURL:atLocation:]):

Added. Navigates to a URL with a synthetic mouse click at a location in host view
coordinates.

(-[WKPDFView pdfHostViewController:goToURL:]):
(-[WKPDFView pdfHostViewController:goToPageIndex:withViewFrustum:]):

Called -_goToURL:atLocation:. Used -_URLWithPageIndex: to construct an NSURL from
a page index.

(-[WKPDFView _showActionSheetForURL:atLocation:]):

Added. Populates _positionInformation with a URL and location and calls
-[WKActionSheetAssistant showLinkSheet].

(-[WKPDFView pdfHostViewController:didLongPressURL:atLocation:]):
(-[WKPDFView pdfHostViewController:didLongPressPageIndex:atLocation:]):

Called -_showActionSheetForURL:atLocation:. Used -_URLWithPageIndex: to construct
an NSURL from a page index.

(-[WKPDFView positionInformationForActionSheetAssistant:]):

Returned _positionInformation.

(-[WKPDFView actionSheetAssistant:performAction:]):

Populated the pasteboard with plain text and URL representations of
_positionInformation.url.

(-[WKPDFView actionSheetAssistant:openElementAtLocation:]):

Called -_goToURL:atLocation.

(-[WKPDFView actionSheetAssistant:shareElementWithURL:rect:]):

Created a UIWKSelectionAssistant and called -showShareSheetFor:fromRect:.

(-[WKPDFView actionSheetAssistant:shouldIncludeAppLinkActionsForElement:]):

Returned API::UIClient::shouldIncludeAppLinkActionsForElement().

(-[WKPDFView actionSheetAssistant:decideActionsForElement:defaultActions:]):

Returned API::UIClient::actionsForElement()l

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

15 months agoToken misspelled "tocken" in error message string
commit-queue@webkit.org [Sat, 28 Apr 2018 23:32:27 +0000 (23:32 +0000)]
Token misspelled "tocken" in error message string
https://bugs.webkit.org/show_bug.cgi?id=185030

Patch by Rick Waldron <waldron.rick@gmail.com> on 2018-04-28
Reviewed by Saam Barati.

JSTests:

* ChakraCore/test/Basics/IdsWithEscapes.baseline-jsc: Fix typo "tocken" => "token"
* stress/destructuring-assignment-syntax.js: Fix typo "tocken" => "token"
* stress/error-messages-for-in-operator-should-not-crash.js: Fix typo "tocken" => "token"
* stress/reserved-word-with-escape.js: Fix typo "tocken" => "token"
(testSyntaxError.String.raw.v):
(String.raw.SyntaxError.Cannot.use.the.keyword.string_appeared_here.as.a.name):
(testSyntaxError.String.raw.a):

Source/JavaScriptCore:

* parser/Parser.cpp: Fix typo "tocken" => "token" in SyntaxError message string
(JSC::Parser<LexerType>::Parser):
(JSC::Parser<LexerType>::didFinishParsing):
(JSC::Parser<LexerType>::parseSourceElements):
(JSC::Parser<LexerType>::parseAsyncGeneratorFunctionSourceElements):
(JSC::Parser<LexerType>::parseVariableDeclaration):
(JSC::Parser<LexerType>::parseWhileStatement):
(JSC::Parser<LexerType>::parseVariableDeclarationList):
(JSC::Parser<LexerType>::createBindingPattern):
(JSC::Parser<LexerType>::parseArrowFunctionSingleExpressionBodySourceElements):
(JSC::Parser<LexerType>::parseObjectRestElement):
(JSC::Parser<LexerType>::parseDestructuringPattern):
(JSC::Parser<LexerType>::parseForStatement):
(JSC::Parser<LexerType>::parseBreakStatement):
(JSC::Parser<LexerType>::parseContinueStatement):
(JSC::Parser<LexerType>::parseThrowStatement):
(JSC::Parser<LexerType>::parseWithStatement):
(JSC::Parser<LexerType>::parseSwitchStatement):
(JSC::Parser<LexerType>::parseSwitchClauses):
(JSC::Parser<LexerType>::parseTryStatement):
(JSC::Parser<LexerType>::parseBlockStatement):
(JSC::Parser<LexerType>::parseFormalParameters):
(JSC::Parser<LexerType>::parseFunctionParameters):
(JSC::Parser<LexerType>::parseFunctionInfo):
(JSC::Parser<LexerType>::parseExpressionOrLabelStatement):
(JSC::Parser<LexerType>::parseExpressionStatement):
(JSC::Parser<LexerType>::parseIfStatement):
(JSC::Parser<LexerType>::parseAssignmentExpression):
(JSC::Parser<LexerType>::parseConditionalExpression):
(JSC::Parser<LexerType>::parseBinaryExpression):
(JSC::Parser<LexerType>::parseObjectLiteral):
(JSC::Parser<LexerType>::parseStrictObjectLiteral):
(JSC::Parser<LexerType>::parseArrayLiteral):
(JSC::Parser<LexerType>::parseArguments):
(JSC::Parser<LexerType>::parseMemberExpression):
(JSC::operatorString):
(JSC::Parser<LexerType>::parseUnaryExpression):
(JSC::Parser<LexerType>::printUnexpectedTokenText):

Tools:

* Scripts/test262/test262-expectations.yaml: Fix typo "tocken" => "token"

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

15 months ago[LFC] Add LayoutTreeBuilder class to generate the layout tree
zalan@apple.com [Sat, 28 Apr 2018 23:13:04 +0000 (23:13 +0000)]
[LFC] Add LayoutTreeBuilder class to generate the layout tree
https://bugs.webkit.org/show_bug.cgi?id=185108

Reviewed by Antti Koivisto.

This is for testing purposes.

* WebCore.xcodeproj/project.pbxproj:
* layout/FormattingState.cpp:
(WebCore::Layout::FormattingState::~FormattingState):
* layout/FormattingState.h:
* layout/LayoutContext.h:
* layout/blockformatting/BlockFormattingState.cpp:
(WebCore::Layout::BlockFormattingState::~BlockFormattingState):
* layout/blockformatting/BlockFormattingState.h:
* layout/inlineformatting/InlineFormattingState.cpp:
(WebCore::Layout::InlineFormattingState::~InlineFormattingState):
* layout/inlineformatting/InlineFormattingState.h:
* layout/layouttree/LayoutBlockContainer.h:
* layout/layouttree/LayoutBox.h:
* layout/layouttree/LayoutContainer.h:
* layout/layouttree/LayoutInlineContainer.h:
* layout/layouttree/LayoutTreeBuilder.cpp: Added.
(WebCore::Layout::TreeBuilder::createLayoutTree):
(WebCore::Layout::TreeBuilder::createSubTree):
(WebCore::Layout::outputLayoutBox):
(WebCore::Layout::outputLayoutTree):
(WebCore::Layout::TreeBuilder::showLayoutTree):
(WebCore::Layout::printLayoutTreeForLiveDocuments):
* layout/layouttree/LayoutTreeBuilder.h: Copied from Source/WebCore/layout/layouttree/LayoutBlockContainer.h.
* page/mac/PageMac.mm:
(WebCore::Page::platformInitialize):

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

15 months ago[LFC] Implement BlockMarginCollapse functions.
zalan@apple.com [Sat, 28 Apr 2018 23:12:31 +0000 (23:12 +0000)]
[LFC] Implement BlockMarginCollapse functions.
https://bugs.webkit.org/show_bug.cgi?id=185036

Reviewed by Antti Koivisto.

* layout/blockformatting/BlockMarginCollapse.cpp:
(WebCore::Layout::marginValue):
(WebCore::Layout::BlockMarginCollapse::BlockMarginCollapse):
(WebCore::Layout::BlockMarginCollapse::marginTop const):
(WebCore::Layout::BlockMarginCollapse::marginBottom const):
(WebCore::Layout::BlockMarginCollapse::isMarginTopCollapsedWithSibling const):
(WebCore::Layout::BlockMarginCollapse::isMarginBottomCollapsedWithSibling const):
(WebCore::Layout::BlockMarginCollapse::isMarginTopCollapsedWithParent const):
(WebCore::Layout::BlockMarginCollapse::isMarginBottomCollapsedWithParent const):
(WebCore::Layout::BlockMarginCollapse::nonCollapsedMarginTop const):
(WebCore::Layout::BlockMarginCollapse::nonCollapsedMarginBottom const):
(WebCore::Layout::BlockMarginCollapse::collapsedMarginTopFromFirstChild const):
(WebCore::Layout::BlockMarginCollapse::collapsedMarginBottomFromLastChild const):
(WebCore::Layout::BlockMarginCollapse::hasAdjoiningMarginTopAndBottom const):
* layout/blockformatting/BlockMarginCollapse.h:
* layout/layouttree/LayoutBox.h:
(WebCore::Layout::Box::style const):

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

15 months ago[iOS] Allow com.apple.WebKit.Networking to look up com.apple.wifi.manager
aestes@apple.com [Sat, 28 Apr 2018 23:10:36 +0000 (23:10 +0000)]
[iOS] Allow com.apple.WebKit.Networking to look up com.apple.wifi.manager
https://bugs.webkit.org/show_bug.cgi?id=185114
<rdar://problem/39808763>

Reviewed by Wenson Hsieh.

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

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

15 months ago[ESNext][BigInt] Implement support for "*" operation
ticaiolima@gmail.com [Sat, 28 Apr 2018 17:37:21 +0000 (17:37 +0000)]
[ESNext][BigInt] Implement support for "*" operation
https://bugs.webkit.org/show_bug.cgi?id=183721

Reviewed by Saam Barati.

JSTests:

* bigIntTests.yaml:
* stress/big-int-mul-jit.js: Added.
* stress/big-int-mul-to-primitive-precedence.js: Added.
* stress/big-int-mul-to-primitive.js: Added.
* stress/big-int-mul-type-error.js: Added.
* stress/big-int-mul-wrapped-value.js: Added.
* stress/big-int-multiplication.js: Added.
* stress/big-int-multiply-memory-stress.js: Added.

Source/JavaScriptCore:

Added BigInt support into times binary operator into LLInt and on
JITOperations profiledMul and unprofiledMul. We are also replacing all
uses of int to unsigned when there is no negative values for
variables.

* dfg/DFGConstantFoldingPhase.cpp:
(JSC::DFG::ConstantFoldingPhase::foldConstants):
* jit/JITOperations.cpp:
* runtime/CommonSlowPaths.cpp:
(JSC::SLOW_PATH_DECL):
* runtime/JSBigInt.cpp:
(JSC::JSBigInt::JSBigInt):
(JSC::JSBigInt::allocationSize):
(JSC::JSBigInt::createWithLength):
(JSC::JSBigInt::toString):
(JSC::JSBigInt::multiply):
(JSC::JSBigInt::digitDiv):
(JSC::JSBigInt::internalMultiplyAdd):
(JSC::JSBigInt::multiplyAccumulate):
(JSC::JSBigInt::equals):
(JSC::JSBigInt::absoluteDivSmall):
(JSC::JSBigInt::calculateMaximumCharactersRequired):
(JSC::JSBigInt::toStringGeneric):
(JSC::JSBigInt::rightTrim):
(JSC::JSBigInt::allocateFor):
(JSC::JSBigInt::parseInt):
(JSC::JSBigInt::digit):
(JSC::JSBigInt::setDigit):
* runtime/JSBigInt.h:
* runtime/Operations.h:
(JSC::jsMul):

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

15 months agoRevise sandboxes to allow additional IOKit property access
bfulgham@apple.com [Sat, 28 Apr 2018 16:57:48 +0000 (16:57 +0000)]
Revise sandboxes to allow additional IOKit property access
https://bugs.webkit.org/show_bug.cgi?id=185095
<rdar://problem/39809455>

Reviewed by Eric Carlson.

Update the WebContent and Plugin processes to allow additional IOKit property access.

* PluginProcess/mac/com.apple.WebKit.plugin-common.sb.in:
* WebProcess/com.apple.WebProcess.sb.in:

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

15 months agoUnreviewed, rolling out r231131.
commit-queue@webkit.org [Sat, 28 Apr 2018 14:49:55 +0000 (14:49 +0000)]
Unreviewed, rolling out r231131.
https://bugs.webkit.org/show_bug.cgi?id=185112

It is breaking Debug build due to unchecked exception
(Requested by caiolima on #webkit).

Reverted changeset:

"[ESNext][BigInt] Implement support for "*" operation"
https://bugs.webkit.org/show_bug.cgi?id=183721
https://trac.webkit.org/changeset/231131

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

15 months ago[GTK] WebProcess from WebKitGtk+ 2.19.92 SIGSEVs in WebCore::TextureMapperGL::~Textur...
carlosgc@webkit.org [Sat, 28 Apr 2018 09:49:17 +0000 (09:49 +0000)]
[GTK] WebProcess from WebKitGtk+ 2.19.92 SIGSEVs in WebCore::TextureMapperGL::~TextureMapperGL
https://bugs.webkit.org/show_bug.cgi?id=184040

Reviewed by Michael Catanzaro.

This can happen when using single shared process model or when the process limit is reached in multiple process
model. In this case, all pages in the same web process with accelerated compositing enabled share the same
compositing thread. Every page sets its GL context as current when rendering a frame, but not when invalidating
the threaded compositor when the page is closed. So, if a hidden tab is closed, the threaded compositor is
invalidated and the GL resources of the current context (the visible page) are destroyed. This is also causing
the blank pages issue when closing a tab related to another one, the current one stops rendering anything because
its GL context has been released. We should make the threaded compositor context current when invalidating it.

* Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
(WebKit::ThreadedCompositor::invalidate):

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

15 months ago[ESNext][BigInt] Implement support for "*" operation
ticaiolima@gmail.com [Sat, 28 Apr 2018 06:11:57 +0000 (06:11 +0000)]
[ESNext][BigInt] Implement support for "*" operation
https://bugs.webkit.org/show_bug.cgi?id=183721

Reviewed by Saam Barati.

JSTests:

* bigIntTests.yaml:
* stress/big-int-mul-jit.js: Added.
* stress/big-int-mul-to-primitive-precedence.js: Added.
* stress/big-int-mul-to-primitive.js: Added.
* stress/big-int-mul-type-error.js: Added.
* stress/big-int-mul-wrapped-value.js: Added.
* stress/big-int-multiplication.js: Added.
* stress/big-int-multiply-memory-stress.js: Added.

Source/JavaScriptCore:

Added BigInt support into times binary operator into LLInt and on
JITOperations profiledMul and unprofiledMul. We are also replacing all
uses of int to unsigned when there is no negative values for
variables.

* dfg/DFGConstantFoldingPhase.cpp:
(JSC::DFG::ConstantFoldingPhase::foldConstants):
* jit/JITOperations.cpp:
* runtime/CommonSlowPaths.cpp:
(JSC::SLOW_PATH_DECL):
* runtime/JSBigInt.cpp:
(JSC::JSBigInt::JSBigInt):
(JSC::JSBigInt::allocationSize):
(JSC::JSBigInt::createWithLength):
(JSC::JSBigInt::toString):
(JSC::JSBigInt::multiply):
(JSC::JSBigInt::digitDiv):
(JSC::JSBigInt::internalMultiplyAdd):
(JSC::JSBigInt::multiplyAccumulate):
(JSC::JSBigInt::equals):
(JSC::JSBigInt::absoluteDivSmall):
(JSC::JSBigInt::calculateMaximumCharactersRequired):
(JSC::JSBigInt::toStringGeneric):
(JSC::JSBigInt::rightTrim):
(JSC::JSBigInt::allocateFor):
(JSC::JSBigInt::parseInt):
(JSC::JSBigInt::digit):
(JSC::JSBigInt::setDigit):
* runtime/JSBigInt.h:
* runtime/Operations.h:
(JSC::jsMul):

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

15 months agoAdd logging when SpringBoard enables WebThread
ddkilzer@apple.com [Sat, 28 Apr 2018 05:53:03 +0000 (05:53 +0000)]
Add logging when SpringBoard enables WebThread
<https://webkit.org/b/185100>
<rdar://problem/39746542>

Reviewed by Daniel Bates.

Source/WebCore:

* platform/RuntimeApplicationChecks.h:
(WebCore::IOSApplication::isSpringBoard): Add declaration.
* platform/cocoa/RuntimeApplicationChecksCocoa.mm:
(WebCore::IOSApplication::isSpringBoard): Add implementation.
* platform/ios/wak/WebCoreThread.mm:
(WebThreadEnable): Call RELEASE_LOG_FAULT() if this is called by
SpringBoard.

Source/WTF:

* wtf/Assertions.h:
(RELEASE_LOG_FAULT): Add macro to call os_log_fault().
* wtf/Platform.h: Drive-by fix to enable USE(OS_LOG) on
public iOS SDKs since <rdar://problem/27758343> was
fixed in iOS 11.0.

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

15 months agoMake the first 64 bits of JSString look like a double JSValue
jfbastien@apple.com [Sat, 28 Apr 2018 03:32:24 +0000 (03:32 +0000)]
Make the first 64 bits of JSString look like a double JSValue
https://bugs.webkit.org/show_bug.cgi?id=185081

Reviewed by Filip Pizlo.

We can be clever about how we lay out JSString so that, were it
reinterpreted as a JSValue, it would look like a double.

* assembler/MacroAssemblerX86Common.h:
(JSC::MacroAssemblerX86Common::and16):
* assembler/X86Assembler.h:
(JSC::X86Assembler::andw_mr):
* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::compileMakeRope):
* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::compileMakeRope):
* ftl/FTLOutput.h:
(JSC::FTL::Output::store32As8):
(JSC::FTL::Output::store32As16):
* runtime/JSString.h:
(JSC::JSString::JSString):

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

15 months agoFix crash in DocumentLoader::startLoadingMainResource
krollin@apple.com [Sat, 28 Apr 2018 01:09:11 +0000 (01:09 +0000)]
Fix crash in DocumentLoader::startLoadingMainResource
https://bugs.webkit.org/show_bug.cgi?id=185088
rdar://problem/39689263

Reviewed by Chris Dumez.

Add a "protectedThis" to address a case where a deleted "this" was
accessed in a RELEASE_LOG statement.

No new tests -- covered by existing tests, which now pass.

* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::startLoadingMainResource):

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

15 months agoUnreviewed test gardening for iOS and macOS.
ryanhaddad@apple.com [Sat, 28 Apr 2018 00:53:41 +0000 (00:53 +0000)]
Unreviewed test gardening for iOS and macOS.

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

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

15 months agoREGRESSION: Touch events fail to dispatch to the page in all cases.
timothy@apple.com [Sat, 28 Apr 2018 00:52:13 +0000 (00:52 +0000)]
REGRESSION: Touch events fail to dispatch to the page in all cases.

https://bugs.webkit.org/show_bug.cgi?id=185097
rdar://problem/39731995

Reviewed by Tim Horton.

* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView gestureRecognizer:shouldRecognizeSimultaneouslyWithGestureRecognizer:]):
Consult internal gesture recognizers, otherwise NO might get returned.

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

15 months agoClean up color-filter tests.
simon.fraser@apple.com [Sat, 28 Apr 2018 00:27:39 +0000 (00:27 +0000)]
Clean up color-filter tests.

Detab the files.

Remove calls to internals.settings.setColorFilterEnabled() which aren't needed, since
WebKitTestRunner and DumpRenderTree turn the feature on by default.

* css3/color-filters/color-filter-backgrounds-borders-expected.html:
* css3/color-filters/color-filter-backgrounds-borders.html:
* css3/color-filters/color-filter-box-shadow-expected.html:
* css3/color-filters/color-filter-box-shadow.html:
* css3/color-filters/color-filter-brightness-expected.html:
* css3/color-filters/color-filter-brightness.html:
* css3/color-filters/color-filter-color-property-expected.html:
* css3/color-filters/color-filter-color-property-list-item-expected.html:
* css3/color-filters/color-filter-color-property-list-item.html:
* css3/color-filters/color-filter-color-property.html:
* css3/color-filters/color-filter-color-text-decorations-expected.html:
* css3/color-filters/color-filter-color-text-decorations.html:
* css3/color-filters/color-filter-column-rule-expected.html:
* css3/color-filters/color-filter-column-rule.html:
* css3/color-filters/color-filter-contrast-expected.html:
* css3/color-filters/color-filter-contrast.html:
* css3/color-filters/color-filter-current-color-expected.html:
* css3/color-filters/color-filter-current-color.html:
* css3/color-filters/color-filter-filter-list-expected.html:
* css3/color-filters/color-filter-filter-list.html:
* css3/color-filters/color-filter-gradients-expected.html:
* css3/color-filters/color-filter-gradients.html:
* css3/color-filters/color-filter-grayscale-expected.html:
* css3/color-filters/color-filter-grayscale.html:
* css3/color-filters/color-filter-hue-rotate-expected.html:
* css3/color-filters/color-filter-hue-rotate.html:
* css3/color-filters/color-filter-inherits-expected.html:
* css3/color-filters/color-filter-inherits.html:
* css3/color-filters/color-filter-invert-expected.html:
* css3/color-filters/color-filter-invert.html:
* css3/color-filters/color-filter-opacity-expected.html:
* css3/color-filters/color-filter-opacity.html:
* css3/color-filters/color-filter-outline-expected.html:
* css3/color-filters/color-filter-outline.html:
* css3/color-filters/color-filter-parsing.html:
* css3/color-filters/color-filter-saturate-expected.html:
* css3/color-filters/color-filter-saturate.html:
* css3/color-filters/color-filter-sepia-expected.html:
* css3/color-filters/color-filter-sepia.html:
* css3/color-filters/color-filter-text-decoration-shadow-expected.html:
* css3/color-filters/color-filter-text-decoration-shadow.html:
* css3/color-filters/color-filter-text-emphasis-expected.html:
* css3/color-filters/color-filter-text-emphasis.html:
* css3/color-filters/color-filter-text-shadow-expected.html:
* css3/color-filters/color-filter-text-shadow.html:
* css3/color-filters/color-filter-text-stroke.html:

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

15 months agoImplement color-filter for text stroke
simon.fraser@apple.com [Sat, 28 Apr 2018 00:27:32 +0000 (00:27 +0000)]
Implement color-filter for text stroke
https://bugs.webkit.org/show_bug.cgi?id=185098

Reviewed by Alan Bujtas.
Source/WebCore:

Transform the text stroke color through color-filter.

Test: css3/color-filters/color-filter-text-stroke.html

* rendering/TextPaintStyle.cpp:
(WebCore::computeTextPaintStyle):

LayoutTests:

* css3/color-filters/color-filter-text-stroke-expected.html: Added.
* css3/color-filters/color-filter-text-stroke.html: Added.

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

15 months agoImplement animation for color-filter
simon.fraser@apple.com [Sat, 28 Apr 2018 00:27:29 +0000 (00:27 +0000)]
Implement animation for color-filter
https://bugs.webkit.org/show_bug.cgi?id=185092
rdar://problem/39773810

Reviewed by Tim Horton.

Source/WebCore:

Implement animation of color-filter.

This requires tracking whether the color-filter function lists match for both old and new
animation code paths.

The filter-related ProperyWappers in CSSPropertyAnimation are cleaned up to use a single wrapper,
which has to pass the propertyID to the blend function so we know which "lists match" to check.
This wrapper reports that its accelerated for filter and backdrop-filter, but not color-filter.

Test: css3/color-filters/color-filter-animation.html

* animation/CSSPropertyBlendingClient.h:
* animation/KeyframeEffectReadOnly.cpp:
(WebCore::KeyframeEffectReadOnly::setBlendingKeyframes):
(WebCore::KeyframeEffectReadOnly::checkForMatchingColorFilterFunctionLists):
* animation/KeyframeEffectReadOnly.h:
* page/animation/AnimationBase.h:
* page/animation/CSSPropertyAnimation.cpp:
(WebCore::blendFunc):
(WebCore::PropertyWrapperFilter::PropertyWrapperFilter):
(WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
(WebCore::PropertyWrapperAcceleratedFilter::PropertyWrapperAcceleratedFilter): Deleted.
(WebCore::PropertyWrapperAcceleratedBackdropFilter::PropertyWrapperAcceleratedBackdropFilter): Deleted.
(WebCore::PropertyWrapperAcceleratedBackdropFilter::animationIsAccelerated const): Deleted.
(WebCore::PropertyWrapperAcceleratedBackdropFilter::blend const): Deleted.
* page/animation/ImplicitAnimation.cpp:
(WebCore::ImplicitAnimation::reset):
(WebCore::ImplicitAnimation::checkForMatchingColorFilterFunctionLists):
* page/animation/ImplicitAnimation.h:
* page/animation/KeyframeAnimation.cpp:
(WebCore::KeyframeAnimation::KeyframeAnimation):
(WebCore::KeyframeAnimation::checkForMatchingColorFilterFunctionLists):
* page/animation/KeyframeAnimation.h:

LayoutTests:

Fix the testing to recognize unprefixed filter, and color-filter.

Add a color-filter animation test.

* animations/resources/animation-test-helpers.js:
(getPropertyValue):
(comparePropertyValue):
* css3/color-filters/color-filter-animation-expected.txt: Added.
* css3/color-filters/color-filter-animation.html: Added.

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

15 months ago[WinCairo] Support --no-copy for jsc tests in wincairo tests, add copying of dlls...
commit-queue@webkit.org [Sat, 28 Apr 2018 00:21:55 +0000 (00:21 +0000)]
[WinCairo] Support --no-copy for jsc tests in wincairo tests, add copying of dlls for copy case
https://bugs.webkit.org/show_bug.cgi?id=185049

Patch by Stephan Szabo <stephan.szabo@sony.com> on 2018-04-27
Reviewed by Keith Miller.

* Scripts/run-javascriptcore-tests:
(runJSCStressTests):
* Scripts/run-jsc-stress-tests:

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

15 months agoRebaseline imported/w3c/web-platform-tests/url/url-setters.html after r231110.
ryanhaddad@apple.com [Sat, 28 Apr 2018 00:07:38 +0000 (00:07 +0000)]
Rebaseline imported/w3c/web-platform-tests/url/url-setters.html after r231110.

Unreviewed test gardening..

* web-platform-tests/url/url-setters-expected.txt:

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

15 months agoUpdate TestExpectations for fast/loader/submit-form-while-parsing-2.html.
ryanhaddad@apple.com [Sat, 28 Apr 2018 00:02:56 +0000 (00:02 +0000)]
Update TestExpectations for fast/loader/submit-form-while-parsing-2.html.
https://bugs.webkit.org/show_bug.cgi?id=184051

Unreviewed test gardening.

* platform/mac-wk2/TestExpectations:

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

15 months agoMark http/wpt/resource-timing/rt-resources-per-worker.html as flaky on iOS.
ryanhaddad@apple.com [Sat, 28 Apr 2018 00:02:54 +0000 (00:02 +0000)]
Mark http/wpt/resource-timing/rt-resources-per-worker.html as flaky on iOS.
https://bugs.webkit.org/show_bug.cgi?id=180260

Unreviewed test gardening.

* platform/ios/TestExpectations:

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

15 months ago[JSC][ARM64][Linux] Add collectCPUFeatures using auxiliary vector
utatane.tea@gmail.com [Sat, 28 Apr 2018 00:01:14 +0000 (00:01 +0000)]
[JSC][ARM64][Linux] Add collectCPUFeatures using auxiliary vector
https://bugs.webkit.org/show_bug.cgi?id=185055

Reviewed by JF Bastien.

This patch is paving the way to emitting jscvt instruction if possible.
To do that, we need to determine jscvt instruction is supported in the
given CPU.

We add a function collectCPUFeatures, which is responsible to collect
CPU features if necessary. In Linux, we can use auxiliary vector to get
the information without parsing /proc/cpuinfo.

Currently, nobody calls this function. It is later called when we emit
jscvt instruction. To make it possible, we also need to add disassembler
support too.

* assembler/AbstractMacroAssembler.h:
* assembler/MacroAssemblerARM64.cpp:
(JSC::MacroAssemblerARM64::collectCPUFeatures):
* assembler/MacroAssemblerARM64.h:
* assembler/MacroAssemblerX86Common.h:

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

15 months ago[LFC] Add FormattingContext::computeWidth/computeHeight logic.
zalan@apple.com [Fri, 27 Apr 2018 23:46:31 +0000 (23:46 +0000)]
[LFC] Add FormattingContext::computeWidth/computeHeight logic.
https://bugs.webkit.org/show_bug.cgi?id=185091

Reviewed by Antti Koivisto.

Inflow width and height can't really be computed without knowing the exact context.

* layout/FormattingContext.cpp:
(WebCore::Layout::FormattingContext::computeWidth const):
(WebCore::Layout::FormattingContext::computeHeight const):
(WebCore::Layout::FormattingContext::computeOutOfFlowWidth const):
(WebCore::Layout::FormattingContext::computeFloatingWidth const):
(WebCore::Layout::FormattingContext::computeOutOfFlowHeight const):
(WebCore::Layout::FormattingContext::computeFloatingHeight const):
* layout/FormattingContext.h:
* layout/blockformatting/BlockFormattingContext.cpp:
(WebCore::Layout::BlockFormattingContext::computeInFlowWidth const):
(WebCore::Layout::BlockFormattingContext::computeInFlowHeight const):
(WebCore::Layout::BlockFormattingContext::computeWidth const): Deleted.
(WebCore::Layout::BlockFormattingContext::computeHeight const): Deleted.
* layout/blockformatting/BlockFormattingContext.h:
* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::computeInFlowWidth const):
(WebCore::Layout::InlineFormattingContext::computeInFlowHeight const):
* layout/inlineformatting/InlineFormattingContext.h:

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

15 months agoAlso run foldPathConstants before mussing up SSA
fpizlo@apple.com [Fri, 27 Apr 2018 23:43:30 +0000 (23:43 +0000)]
Also run foldPathConstants before mussing up SSA
https://bugs.webkit.org/show_bug.cgi?id=185069

Reviewed by Saam Barati.

This isn't needed now, but will be once I implement the phase in bug 185060.

This could be a speed-up, or a slow-down, independent of that phase. Most likely it's neutral.
Local testing seems to suggest that it's neutral. Anyway, whatever it ends up being, I want it to
be landed separately and measured separately from that phase.

It's probably nice for sanity to have this and reduceStrength run before tail duplication and
another round of reduceStrength, since that make for something that is closer to a fixpoint. But
it will increase FTL compile times. So, there's no way to guess if this change is good, bad, or
neutral. It all depends on what programs typically look like.

* b3/B3Generate.cpp:
(JSC::B3::generateToAir):

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

15 months agoPSON: Triggering a navigation to an invalid URL creates a new WebContent process
rniwa@webkit.org [Fri, 27 Apr 2018 22:30:43 +0000 (22:30 +0000)]
PSON: Triggering a navigation to an invalid URL creates a new WebContent process
https://bugs.webkit.org/show_bug.cgi?id=185066

Reviewed by Youenn Fablet.

Source/WebKit:

Don't create a new WebContent process when the target URL is invalid as well as when the source URL is invalid.

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

Tools:

Added a new test case (ProcessSwap.NavigateToInvalidURL) for navigating to an invalid URL.
WebKit should not swap WebContent process in this case.

* TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm:
(-[PSONNavigationDelegate webView:didFailProvisionalNavigation:withError:]):
(-[PSONUIDelegate webView:runJavaScriptAlertPanelWithMessage:initiatedByFrame:completionHandler:]):

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

15 months agoUse WindowProxy instead of DOMWindow in our IDL
cdumez@apple.com [Fri, 27 Apr 2018 22:11:00 +0000 (22:11 +0000)]
Use WindowProxy instead of DOMWindow in our IDL
https://bugs.webkit.org/show_bug.cgi?id=185022

Reviewed by Sam Weinig.

Source/WebCore:

Stop using DOMWindow in all of our IDL files and use WindowProxy as
per their respective specifications. As a result, the implementation
as also updated to use WindowProxy type instead of DOMWindow.

* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSDOMConvertWindowProxy.h: Removed.
* bindings/js/JSWindowProxy.cpp:
(WebCore::JSWindowProxy::windowProxy const):
(WebCore::JSWindowProxy::toWrapped):
* bindings/js/JSWindowProxy.h:
(WebCore::window):
Use static_cast<>() instead of jsCast<>() because jsCast<>()
relies on classInfo() which is not allowed to be called during
JS sweep due to an assertion inside classInfo(). The JSWindowProxy
objects are held strongly by the WindowProxy so we know the JSWindowProxy
object is not getting destroyed here.

(WebCore::toJS):
* bindings/js/WindowProxy.cpp:
(WebCore::WindowProxy::globalObject):
* bindings/js/WindowProxy.h:
(WebCore::WindowProxy::frame const):
* bindings/scripts/CodeGenerator.pm:
(IsBuiltinType):
(ComputeIsCallbackInterface):
(ComputeIsCallbackFunction):
* bindings/scripts/CodeGeneratorJS.pm:
(AddToIncludesForIDLType):
(GetBaseIDLType):
(NativeToJSValueDOMConvertNeedsState):
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::jsTestObjPrototypeFunctionOverloadedMethod9Body):
(WebCore::jsTestObjPrototypeFunctionOverloadedMethodOverloadDispatcher):
* bindings/scripts/test/TestObj.idl:
* dom/CompositionEvent.cpp:
(WebCore::CompositionEvent::CompositionEvent):
(WebCore::CompositionEvent::initCompositionEvent):
* dom/CompositionEvent.h:
* dom/CompositionEvent.idl:
* dom/Document.cpp:
(WebCore::Document::defaultView const):
* dom/Document.h:
* dom/Document.idl:
* dom/DocumentTouch.cpp:
(WebCore::DocumentTouch::createTouch):
* dom/DocumentTouch.h:
* dom/DocumentTouch.idl:
* dom/FocusEvent.cpp:
(WebCore::FocusEvent::FocusEvent):
* dom/FocusEvent.h:
* dom/InputEvent.cpp:
(WebCore::InputEvent::create):
(WebCore::InputEvent::InputEvent):
* dom/InputEvent.h:
* dom/KeyboardEvent.cpp:
(WebCore::KeyboardEvent::KeyboardEvent):
(WebCore::KeyboardEvent::create):
(WebCore::KeyboardEvent::initKeyboardEvent):
(WebCore::KeyboardEvent::charCode const):
* dom/KeyboardEvent.h:
* dom/KeyboardEvent.idl:
* dom/MessageEvent.h:
* dom/MessageEvent.idl:
* dom/MouseEvent.cpp:
(WebCore::MouseEvent::create):
(WebCore::MouseEvent::MouseEvent):
(WebCore::MouseEvent::initMouseEvent):
(WebCore::MouseEvent::initMouseEventQuirk):
* dom/MouseEvent.h:
* dom/MouseEvent.idl:
* dom/MouseRelatedEvent.cpp:
(WebCore::MouseRelatedEvent::MouseRelatedEvent):
(WebCore::MouseRelatedEvent::init):
(WebCore::MouseRelatedEvent::frameViewFromWindowProxy):
(WebCore::MouseRelatedEvent::initCoordinates):
(WebCore::MouseRelatedEvent::documentToAbsoluteScaleFactor const):
(WebCore::MouseRelatedEvent::computePageLocation):
(WebCore::MouseRelatedEvent::locationInRootViewCoordinates const):
* dom/MouseRelatedEvent.h:
* dom/Node.cpp:
* dom/SimulatedClick.cpp:
* dom/TextEvent.cpp:
(WebCore::TextEvent::create):
(WebCore::TextEvent::createForPlainTextPaste):
(WebCore::TextEvent::createForFragmentPaste):
(WebCore::TextEvent::createForDrop):
(WebCore::TextEvent::createForDictation):
(WebCore::TextEvent::TextEvent):
(WebCore::TextEvent::initTextEvent):
* dom/TextEvent.h:
* dom/TextEvent.idl:
* dom/TouchEvent.idl:
* dom/UIEvent.cpp:
(WebCore::UIEvent::UIEvent):
(WebCore::UIEvent::initUIEvent):
* dom/UIEvent.h:
(WebCore::UIEvent::create):
(WebCore::UIEvent::view const):
* dom/UIEvent.idl:
* dom/UIEventInit.h:
* dom/UIEventInit.idl:
* dom/UIEventWithKeyState.h:
(WebCore::UIEventWithKeyState::UIEventWithKeyState):
* dom/WheelEvent.cpp:
(WebCore::WheelEvent::WheelEvent):
(WebCore::WheelEvent::create):
(WebCore::WheelEvent::initWebKitWheelEvent):
* dom/WheelEvent.h:
* dom/WheelEvent.idl:
* editing/AlternativeTextController.cpp:
(WebCore::AlternativeTextController::insertDictatedText):
* editing/Editor.cpp:
(WebCore::Editor::pasteAsPlainText):
(WebCore::Editor::pasteAsFragment):
(WebCore::Editor::setComposition):
* html/HTMLDocument.cpp:
(WebCore::HTMLDocument::namedItem):
* html/HTMLDocument.h:
* html/HTMLDocument.idl:
* html/HTMLFrameElement.idl:
* html/HTMLFrameOwnerElement.cpp:
(WebCore::HTMLFrameOwnerElement::contentWindow const):
* html/HTMLFrameOwnerElement.h:
* html/HTMLFrameSetElement.cpp:
(WebCore::HTMLFrameSetElement::namedItem):
* html/HTMLFrameSetElement.h:
* html/HTMLFrameSetElement.idl:
* html/HTMLIFrameElement.idl:
* html/ImageDocument.cpp:
* page/DOMWindow.cpp:
(WebCore::PostMessageTimer::PostMessageTimer):
(WebCore::PostMessageTimer::event):
(WebCore::DOMWindow::postMessage):
* page/DragController.cpp:
(WebCore::DragController::dispatchTextInputEventFor):
* page/EventHandler.cpp:
(WebCore::EventHandler::handleTextInputEvent):

Source/WebKitLegacy/mac:

* DOM/DOMAbstractView.mm:
(kit):
(toWindowProxy):
* DOM/DOMAbstractViewInternal.h:
* DOM/DOMDocument.mm:
(-[DOMDocument defaultView]):
(-[DOMDocument getComputedStyle:pseudoElement:]):
(-[DOMDocument getMatchedCSSRules:pseudoElement:authorOnly:]):
* DOM/DOMHTMLFrameElement.mm:
(-[DOMHTMLFrameElement contentWindow]):
* DOM/DOMHTMLIFrameElement.mm:
(-[DOMHTMLIFrameElement contentWindow]):
* DOM/DOMKeyboardEvent.mm:
(-[DOMKeyboardEvent initKeyboardEvent:canBubble:cancelable:view:keyIdentifier:location:ctrlKey:altKey:shiftKey:metaKey:altGraphKey:]):
(-[DOMKeyboardEvent initKeyboardEvent:canBubble:cancelable:view:keyIdentifier:location:ctrlKey:altKey:shiftKey:metaKey:]):
(-[DOMKeyboardEvent initKeyboardEvent:canBubble:cancelable:view:keyIdentifier:keyLocation:ctrlKey:altKey:shiftKey:metaKey:altGraphKey:]):
(-[DOMKeyboardEvent initKeyboardEvent:canBubble:cancelable:view:keyIdentifier:keyLocation:ctrlKey:altKey:shiftKey:metaKey:]):
* DOM/DOMMouseEvent.mm:
(-[DOMMouseEvent initMouseEvent:canBubble:cancelable:view:detail:screenX:screenY:clientX:clientY:ctrlKey:altKey:shiftKey:metaKey:button:relatedTarget:]):
* DOM/DOMTextEvent.mm:
(-[DOMTextEvent initTextEvent:canBubbleArg:cancelableArg:viewArg:dataArg:]):
* DOM/DOMUIEvent.mm:
(-[DOMUIEvent view]):
(-[DOMUIEvent initUIEvent:canBubble:cancelable:view:detail:]):
* DOM/DOMWheelEvent.mm:
(-[DOMWheelEvent initWheelEvent:wheelDeltaY:view:screenX:screenY:clientX:clientY:ctrlKey:altKey:shiftKey:metaKey:]):

Source/WebKitLegacy/win:

* DOMCoreClasses.cpp:
(DOMDocument::getComputedStyle):

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

15 months agoAX: Accessibility needs to know which part of the content view is visible on iOS
n_wang@apple.com [Fri, 27 Apr 2018 21:58:33 +0000 (21:58 +0000)]
AX: Accessibility needs to know which part of the content view is visible on iOS
https://bugs.webkit.org/show_bug.cgi?id=185085
<rdar://problem/39801363>

Reviewed by Chris Fleizach.

Source/WebCore:

Exposed unobscuredContentRect() to iOS accessibility object wrapper.

Test: accessibility/ios-simulator/unobscured-content-rect.html

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

Tools:

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

LayoutTests:

* accessibility/ios-simulator/unobscured-content-rect-expected.txt: Added.
* accessibility/ios-simulator/unobscured-content-rect.html: Added.
* platform/ios-wk1/TestExpectations:

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

15 months agoRefactor filter list checking code
simon.fraser@apple.com [Fri, 27 Apr 2018 21:35:56 +0000 (21:35 +0000)]
Refactor filter list checking code
https://bugs.webkit.org/show_bug.cgi?id=185087

Reviewed by Alan Bujtas.

Deduplicate code between filter and backdrop-filter for checking whether function lists
match, by making a shared function that takes a std::function.

The call sites have to declare the return type (-> const FilterOperations&) to avoid std::function
converting the return type into a value.

* animation/KeyframeEffectReadOnly.cpp:
(WebCore::KeyframeEffectReadOnly::checkForMatchingFilterFunctionLists const):
(WebCore::KeyframeEffectReadOnly::checkForMatchingFilterFunctionLists):
(WebCore::KeyframeEffectReadOnly::checkForMatchingBackdropFilterFunctionLists):
* animation/KeyframeEffectReadOnly.h:
* page/animation/KeyframeAnimation.cpp:
(WebCore::KeyframeAnimation::checkForMatchingFilterFunctionLists const):
(WebCore::KeyframeAnimation::checkForMatchingFilterFunctionLists):
(WebCore::KeyframeAnimation::checkForMatchingBackdropFilterFunctionLists):
* page/animation/KeyframeAnimation.h:

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

15 months agoRegression(r222392?): Events can have a negative timestamp which causes app breakage
cdumez@apple.com [Fri, 27 Apr 2018 21:21:30 +0000 (21:21 +0000)]
Regression(r222392?): Events can have a negative timestamp which causes app breakage
https://bugs.webkit.org/show_bug.cgi?id=185040
<rdar://problem/39638051>

Reviewed by Wenson Hsieh.

The real fix is in UIKit when generating the touch timestamps. However, this patch
does some hardening to make sure that Event.timestamp can never return a negative
value even if something goes wrong.

* dom/Event.cpp:
(WebCore::Event::timeStampForBindings const):

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

15 months agoURL::appendEncodedHostName is using the deprecated uidna_IDNToASCII function
bfulgham@apple.com [Fri, 27 Apr 2018 19:44:02 +0000 (19:44 +0000)]
URL::appendEncodedHostName is using the deprecated uidna_IDNToASCII function
https://bugs.webkit.org/show_bug.cgi?id=184836

Patch by Christopher Reid <chris.reid@sony.com> on 2018-04-27
Reviewed by Alex Christensen.

Source/WebCore:

Update URL::appendEncodedHostName to use uidna_nameToASCII as done in r208902.

Test: LayoutTests\fast\url\url-hostname-encoding.html

* platform/URL.cpp:

LayoutTests:

Verify that setting the host or hostname of URL objects will use IDNA2008.

* fast/url/url-hostname-encoding-expected.txt: Added.
* fast/url/url-hostname-encoding.html: Added.

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

15 months agoCachedRawResource is not handling incremental data computation correctly
youenn@apple.com [Fri, 27 Apr 2018 19:34:54 +0000 (19:34 +0000)]
CachedRawResource is not handling incremental data computation correctly
https://bugs.webkit.org/show_bug.cgi?id=184936
<rdar://problem/38798141>

Reviewed by Darin Adler.

* loader/cache/CachedRawResource.cpp:
(WebCore::CachedRawResource::updateBuffer): Fixing style.

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

15 months ago[LFC] Implement BlockFormattingContext::layout logic and its dependencies
zalan@apple.com [Fri, 27 Apr 2018 18:17:46 +0000 (18:17 +0000)]
[LFC] Implement BlockFormattingContext::layout logic and its dependencies
https://bugs.webkit.org/show_bug.cgi?id=185024

Reviewed by Antti Koivisto.

This patch implements the logic for block formatting context according to
https://www.w3.org/TR/CSS22/visuren.html#block-formatting

1. Traverse the tree iteratively (in post-order fashion) and compute the width/static position for the containers as
we visit the descendant nodes until we hit a leaf node.
2. Compute the position/geometry of the leaf node and move over to its sibling(s).
3. Finalize the container's height/final position as we climb back on the tree.
4. Run layout on the out-of-flow descendants.

Note that subtrees with a formatting context root need to be laid out completely before moving on to the next box.
The formatting root box is laid out in the formatting context it lives in, however its descendants get laid out
in a separate formatting context (excluding out-of-flow boxes that don't belong to the root).

* layout/FloatingContext.cpp:
(WebCore::Layout::FloatingContext::FloatingContext):
(WebCore::Layout::FloatingContext::computePosition):
* layout/FormattingContext.cpp:
(WebCore::Layout::FormattingContext::placeInFlowPositionedChildren const):
(WebCore::Layout::FormattingContext::layoutOutOfFlowDescendants const):
* layout/FormattingContext.h:
* layout/LayoutContext.cpp:
(WebCore::Layout::LayoutContext::updateLayout):
(WebCore::Layout::LayoutContext::establishedFormattingState):
* layout/LayoutContext.h:
* layout/blockformatting/BlockFormattingContext.cpp:
(WebCore::Layout::BlockFormattingContext::layout const):
(WebCore::Layout::BlockFormattingContext::layout): Deleted.
* layout/blockformatting/BlockFormattingContext.h:
* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::layout const):
(WebCore::Layout::InlineFormattingContext::layout): Deleted.
* layout/inlineformatting/InlineFormattingContext.h:

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

15 months agoUse NetworkLoadChecker for XHR/fetch loads
youenn@apple.com [Fri, 27 Apr 2018 18:10:18 +0000 (18:10 +0000)]
Use NetworkLoadChecker for XHR/fetch loads
https://bugs.webkit.org/show_bug.cgi?id=184741

Reviewed by Chris Dumez.

LayoutTests/imported/w3c:

* web-platform-tests/XMLHttpRequest/send-authentication-basic-cors-expected.txt:
* web-platform-tests/XMLHttpRequest/send-network-error-async-events.sub-expected.txt:
* web-platform-tests/cors/late-upload-events-expected.txt:
* web-platform-tests/fetch/api/basic/mode-same-origin.any-expected.txt:
* web-platform-tests/fetch/api/basic/scheme-about.any-expected.txt:
* web-platform-tests/fetch/api/basic/scheme-about.any.worker-expected.txt:
* web-platform-tests/fetch/api/redirect/redirect-to-dataurl-expected.txt:
* web-platform-tests/service-workers/service-worker/redirected-response.https-expected.txt:

Source/WebCore:

Covered by existing tests.

* loader/DocumentThreadableLoader.cpp:
(WebCore::DocumentThreadableLoader::shouldSetHTTPHeadersToKeep const):
We need to set this option for CORS done in NetworkProcess.
(WebCore::DocumentThreadableLoader::DocumentThreadableLoader):
Set httpHeadersTokeep when needed (service worker or CORS loads).
Remove the synchronous disabling of preflight since this is now also done for asynchronous loads.
(WebCore::DocumentThreadableLoader::checkURLSchemeAsCORSEnabled):
Helper routine to make the same check for both simple and preflight case.
This allows more consistent error logging between WK1 and WK2.
(WebCore::DocumentThreadableLoader::makeCrossOriginAccessRequest):
Skip preflight in case this is done in NetworkProcess.
(WebCore::DocumentThreadableLoader::makeSimpleCrossOriginAccessRequest):
(WebCore::isResponseComingFromNetworkProcess):
(WebCore::DocumentThreadableLoader::redirectReceived):
Bypass security checks when they are already done in NetworkProcess.
(WebCore::DocumentThreadableLoader::didFail):
In case of AccessControl error, it might be due to a CSP check done in NetworkProcess.
Check it again to enable specific CSP console logging and error reporting.
(WebCore::DocumentThreadableLoader::loadRequest):
Recreating the error in case of synchronous loads to be able to log it adequately.
(WebCore::DocumentThreadableLoader::isDoingSecurityChecksInNetworkProcess const):
* loader/DocumentThreadableLoader.h:
* loader/SubresourceLoader.cpp:
(WebCore::SubresourceLoader::checkResponseCrossOriginAccessControl):
Specific handling of SameOrigin credential mode for which cross-origin load will not use any credential.
(WebCore::SubresourceLoader::checkRedirectionCrossOriginAccessControl):
We keep the application headers so that DocumentThreadableLoader does not have to restart a brand new load.
* loader/cache/CachedResourceLoader.cpp:
(WebCore::CachedResourceLoader::requestResource):
DocumentThreadableLoader is setting referrer and origin directly. Until we fix that, we remove them from the original requests
as applications are not supposed to set these headers.

Source/WebKit:

* NetworkProcess/NetworkCORSPreflightChecker.cpp:
(WebKit::NetworkCORSPreflightChecker::didCompleteWithError):
Pass the preflight error as completion error if any.
* NetworkProcess/NetworkLoad.cpp:
(WebKit::NetworkLoad::willPerformHTTPRedirection):
Set response source to Network so that checks relying on that are correct.
* NetworkProcess/NetworkLoadChecker.cpp:
(WebKit::NetworkLoadChecker::validateResponse):
Adding Oppaqueredirect tainting.
(NetworkLoadChecker::doesNotNeedCORSCheck):
Adding a check to only activate CORS checks for CORS enabled schemes.
Non CORS enabled schemes loads should have failed in WebProcess already.
(WebKit::NetworkLoadChecker::checkCORSRedirectedRequest):
Remove Authorization header as done by SubresourceLoader.
(WebKit::NetworkLoadChecker::checkCORSRequestWithPreflight):
If error is cancellation, we still want to call the completion handler.
* NetworkProcess/NetworkResourceLoader.cpp:
Activate network load checker for all types of loads.
(WebKit::NetworkResourceLoader::willSendRedirectedRequest):
Handle manual redirection by directly calling didReceiveResponse.

LayoutTests:

* TestExpectations:
* http/tests/security/contentSecurityPolicy/1.1/child-src/worker-redirect-blocked-expected.txt:
* http/tests/security/contentSecurityPolicy/connect-src-eventsource-redirect-to-blocked-expected.txt:
* http/tests/security/contentSecurityPolicy/connect-src-xmlhttprequest-redirect-to-blocked-expected.txt:
* http/tests/security/contentSecurityPolicy/worker-csp-blocks-xhr-redirect-cross-origin-expected.txt:
* http/tests/xmlhttprequest/access-control-and-redirects-async-expected.txt:
* http/tests/xmlhttprequest/access-control-and-redirects-expected.txt:
* platform/mac-wk1/http/tests/security/contentSecurityPolicy/connect-src-eventsource-redirect-to-blocked-expected.txt: Added.
* platform/mac-wk1/http/tests/security/contentSecurityPolicy/worker-csp-blocks-xhr-redirect-cross-origin-expected.txt: Added.
* platform/mac-wk1/http/tests/xmlhttprequest/access-control-and-redirects-async-expected.txt: Added.
* platform/mac-wk1/imported/w3c/web-platform-tests/XMLHttpRequest/late-upload-events-expected.txt: Added.
* platform/mac-wk1/imported/w3c/web-platform-tests/XMLHttpRequest/send-authentication-basic-cors-expected.txt: Added.
* platform/mac-wk1/imported/w3c/web-platform-tests/XMLHttpRequest/send-network-error-async-events.sub-expected.txt: Added.
* platform/win/http/tests/security/contentSecurityPolicy/connect-src-eventsource-redirect-to-blocked-expected.txt: Added.
* platform/win/http/tests/security/contentSecurityPolicy/connect-src-xmlhttprequest-redirect-to-blocked-expected.txt: Added.
* platform/win/http/tests/security/contentSecurityPolicy/worker-csp-blocks-xhr-redirect-cross-origin-expected.txt: Added.
* platform/win/http/tests/xmlhttprequest/access-control-and-redirects-async-expected.txt: Added.
* platform/win/imported/w3c/web-platform-tests/XMLHttpRequest/late-upload-events-expected.txt: Added.
* platform/win/imported/w3c/web-platform-tests/XMLHttpRequest/send-authentication-basic-cors-expected.txt: Added.
* platform/win/imported/w3c/web-platform-tests/XMLHttpRequest/send-network-error-async-events.sub-expected.txt: Added.

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

15 months agoAdd an experimental feature flag for viewport "min-device-width"
wenson_hsieh@apple.com [Fri, 27 Apr 2018 18:03:15 +0000 (18:03 +0000)]
Add an experimental feature flag for viewport "min-device-width"
https://bugs.webkit.org/show_bug.cgi?id=185050
<rdar://problem/39624038>

Reviewed by Tim Horton.

Source/WebCore:

Add MinDeviceWidthEnabled as a new runtime-enabled feature.

* dom/ViewportArguments.cpp:
(WebCore::setViewportFeature):

Gate the parsing of "min-device-width" on the runtime-enabled feature being flipped on.

* page/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::setMinDeviceWidthEnabled):
(WebCore::RuntimeEnabledFeatures::minDeviceWidthEnabled const):

Source/WebKit:

Add MinDeviceWidthEnabled as a new experimental feature, on by default in extra zoom mode and off elsewhere.

* Shared/WebPreferences.yaml:
* Shared/WebPreferencesDefaultValues.h:

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

15 months agoMake color-filter transform gradient colors
simon.fraser@apple.com [Fri, 27 Apr 2018 17:59:25 +0000 (17:59 +0000)]
Make color-filter transform gradient colors
https://bugs.webkit.org/show_bug.cgi?id=185080

Reviewed by Zalan Bujtas.
Source/WebCore:

In CSSGradientValue::computeStops(), transform the color of each gradient color
stop through the color filter. Having a color filter makes the gradient uncacheable.

Color filters can add alpha, so we also have to fix up CSSGradientValue::knownToBeOpaque()
to take a RenderStyle and convert the colors before testing opaqueness. Clean up some related
functions to take const RenderStyle&.

Test: css3/color-filters/color-filter-gradients.html

* css/CSSCrossfadeValue.cpp:
(WebCore::subimageKnownToBeOpaque):
* css/CSSFilterImageValue.cpp:
(WebCore::CSSFilterImageValue::knownToBeOpaque const):
* css/CSSFilterImageValue.h:
* css/CSSGradientValue.cpp:
(WebCore::CSSGradientValue::image):
(WebCore::CSSGradientValue::computeStops):
(WebCore::CSSGradientValue::knownToBeOpaque const):
(WebCore::CSSLinearGradientValue::createGradient):
(WebCore::CSSRadialGradientValue::createGradient):
* css/CSSGradientValue.h:
* css/CSSImageGeneratorValue.cpp:
(WebCore::CSSImageGeneratorValue::knownToBeOpaque const):
* css/CSSImageValue.cpp:
(WebCore::CSSImageValue::knownToBeOpaque const):
* css/CSSImageValue.h:

LayoutTests:

* css3/color-filters/color-filter-gradients-expected.html: Added.
* css3/color-filters/color-filter-gradients.html: Added.

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

15 months agoUnreviewed, rolling out r231086.
ryanhaddad@apple.com [Fri, 27 Apr 2018 17:22:35 +0000 (17:22 +0000)]
Unreviewed, rolling out r231086.

Caused JSC test failures due to an unchecked exception.

Reverted changeset:

"[ESNext][BigInt] Implement support for "*" operation"
https://bugs.webkit.org/show_bug.cgi?id=183721
https://trac.webkit.org/changeset/231086

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

15 months agoUIDelegate::UIClient::didResignInputElementStrongPasswordAppearance() is applicable...
dbates@webkit.org [Fri, 27 Apr 2018 17:20:36 +0000 (17:20 +0000)]
UIDelegate::UIClient::didResignInputElementStrongPasswordAppearance() is applicable to both Mac and iOS
https://bugs.webkit.org/show_bug.cgi?id=185079
<rdar://problem/39794960>

I inadvertently forgot to move the UIDelegate field webViewDidResignInputElementStrongPasswordAppearanceWithUserInfo
outside the PLATFORM(MAC)-guard.

* UIProcess/Cocoa/UIDelegate.h:

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

15 months agoUIDelegate::UIClient::didResignInputElementStrongPasswordAppearance() is applicable...
dbates@webkit.org [Fri, 27 Apr 2018 17:11:59 +0000 (17:11 +0000)]
UIDelegate::UIClient::didResignInputElementStrongPasswordAppearance() is applicable to both Mac and iOS
https://bugs.webkit.org/show_bug.cgi?id=185079
<rdar://problem/39794960>

Reviewed by Andy Estes.

* UIProcess/Cocoa/UIDelegate.h:
* UIProcess/Cocoa/UIDelegate.mm:
(WebKit::UIDelegate::setDelegate):
(WebKit::UIDelegate::UIClient::didResignInputElementStrongPasswordAppearance):

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

15 months agoDisable color-filter tests on Windows for now
simon.fraser@apple.com [Fri, 27 Apr 2018 16:30:23 +0000 (16:30 +0000)]
Disable color-filter tests on Windows for now
https://bugs.webkit.org/show_bug.cgi?id=185076

The experimental feature for color-filter is off by default, and Windows WebKit API
would have to change to enable it, so just skip the tests for now.

* platform/win/TestExpectations:

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

15 months agoFix color-filter to apply to text decorations
simon.fraser@apple.com [Fri, 27 Apr 2018 16:11:12 +0000 (16:11 +0000)]
Fix color-filter to apply to text decorations
https://bugs.webkit.org/show_bug.cgi?id=185068
<rdar://problem/39782136>

Reviewed by Alan Bujtas.
Source/WebCore:

Transform the colors of text shadows, and the shadows of text-decorations through
the color-filter.

Rather than clone the ShadowData stored on TextPainter and TextDecorationPainter
(which would have awkward ownership implications) we pass the color filters through
and just map the color through it before painting.

Re-order the members of TextPainter a little to optimize padding.

Also fix a bug where FilterOperations::transformColor() could transform an invalid
color to a valid one; we never want this.

Tests: css3/color-filters/color-filter-text-decoration-shadow.html
       css3/color-filters/color-filter-text-shadow.html

* platform/graphics/filters/FilterOperations.cpp:
(WebCore::FilterOperations::transformColor const):
* rendering/InlineTextBox.cpp:
(WebCore::InlineTextBox::paintMarkedTextForeground):
(WebCore::InlineTextBox::paintMarkedTextDecoration):
* rendering/TextDecorationPainter.cpp:
(WebCore::TextDecorationPainter::paintTextDecoration):
* rendering/TextDecorationPainter.h:
(WebCore::TextDecorationPainter::setTextShadow):
(WebCore::TextDecorationPainter::setShadowColorFilter):
(WebCore::TextDecorationPainter::addTextShadow): Deleted.
* rendering/TextPainter.cpp:
(WebCore::ShadowApplier::ShadowApplier):
(WebCore::TextPainter::paintTextWithShadows):
(WebCore::TextPainter::paintTextAndEmphasisMarksIfNeeded): Simplify the logic that only paints the shadow
on the first iteration.
(WebCore::TextPainter::paintRange):
* rendering/TextPainter.h:
(WebCore::TextPainter::setShadowColorFilter):
* rendering/svg/SVGInlineTextBox.cpp:
(WebCore::SVGInlineTextBox::paintTextWithShadows):

LayoutTests:

* css3/color-filters/color-filter-text-decoration-shadow-expected.html: Added.
* css3/color-filters/color-filter-text-decoration-shadow.html: Added.
* css3/color-filters/color-filter-text-shadow-expected.html: Added.
* css3/color-filters/color-filter-text-shadow.html: Added.

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

15 months agoMark CSS color filters tests as failing on Windows.
pvollan@apple.com [Fri, 27 Apr 2018 16:09:49 +0000 (16:09 +0000)]
Mark CSS color filters tests as failing on Windows.
https://bugs.webkit.org/show_bug.cgi?id=185075

Unreviewed test gardening.

* platform/win/TestExpectations:

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

15 months agoUnreviewed test gardening, update expectations for test262/intl402/PluralRules tests...
ryanhaddad@apple.com [Fri, 27 Apr 2018 16:08:28 +0000 (16:08 +0000)]
Unreviewed test gardening, update expectations for test262/intl402/PluralRules tests after r231047.

* test262.yaml: Mark tests as passing.

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

15 months agoRename minimumLayoutSize to viewLayoutSize
wenson_hsieh@apple.com [Fri, 27 Apr 2018 16:07:19 +0000 (16:07 +0000)]
Rename minimumLayoutSize to viewLayoutSize
https://bugs.webkit.org/show_bug.cgi?id=185050
<rdar://problem/39624038>

Reviewed by Tim Horton.

Source/WebCore:

See WebKit/ChangeLog for more information. No change in behavior.

* page/ViewportConfiguration.cpp:
(WebCore::ViewportConfiguration::ViewportConfiguration):
(WebCore::ViewportConfiguration::setViewLayoutSize):

Remove a FIXME comment that is addressed by this refactoring.

(WebCore::ViewportConfiguration::shouldOverrideDeviceWidthWithMinDeviceWidth const):
(WebCore::ViewportConfiguration::initialScaleFromSize const):
(WebCore::ViewportConfiguration::minimumScale const):
(WebCore::ViewportConfiguration::updateMinimumLayoutSize):
(WebCore::ViewportConfiguration::setMinimumLayoutSize): Deleted.
* page/ViewportConfiguration.h:
(WebCore::ViewportConfiguration::viewLayoutSize const):
(WebCore::ViewportConfiguration::viewSize const): Deleted.

Source/WebKit:

Renames minimumLayoutSize to viewLayoutSize, since the minimum layout size in ViewportConfiguration is now
different from the minimum layout size that is currently pushed down from the UI process (e.g. WKWebView SPI) in
the case where `min-device-width` is used to override the minimum layout size.

* Shared/WebPageCreationParameters.cpp:
(WebKit::WebPageCreationParameters::encode const):
(WebKit::WebPageCreationParameters::decode):
* Shared/WebPageCreationParameters.h:
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _processDidExit]):
(-[WKWebView activeViewLayoutSize:]):
(-[WKWebView _dispatchSetViewLayoutSize:]):
(-[WKWebView _frameOrBoundsChanged]):
(-[WKWebView _minimumLayoutSizeOverride]):
(-[WKWebView _setViewLayoutSizeOverride:]):
(-[WKWebView _beginAnimatedResizeWithUpdates:]):
(-[WKWebView _endAnimatedResize]):
(-[WKWebView _overrideLayoutParametersWithMinimumLayoutSize:maximumUnobscuredSizeOverride:]):
(-[WKWebView _clearOverrideLayoutParameters]):
(-[WKWebView _minimumLayoutWidth]):
(-[WKWebView _setMinimumLayoutWidth:]):
(-[WKWebView activeMinimumLayoutSize:]): Deleted.
(-[WKWebView _dispatchSetMinimumLayoutSize:]): Deleted.
(-[WKWebView _setMinimumLayoutSizeOverride:]): Deleted.
(-[WKWebView _overrideLayoutParametersWithMinimumLayoutSize:minimumLayoutSizeForMinimalUI:maximumUnobscuredSizeOverride:]): Deleted.

Remove unused SPI that has been deprecated since iOS 9, has a simple drop-in replacement, and no longer has any
internal clients.

* UIProcess/API/Cocoa/WKWebViewPrivate.h:
* UIProcess/Cocoa/WebViewImpl.mm:
(WebKit::WebViewImpl::setMinimumSizeForAutoLayout):
(WebKit::WebViewImpl::minimumSizeForAutoLayout const):
(WebKit::WebViewImpl::setIntrinsicContentSize):
* UIProcess/DrawingAreaProxy.h:
(WebKit::DrawingAreaProxy::viewLayoutSizeDidChange):
(WebKit::DrawingAreaProxy::minimumLayoutSizeDidChange): Deleted.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::creationParameters):
(WebKit::WebPageProxy::setViewLayoutSize):
(WebKit::WebPageProxy::setMinimumLayoutSize): Deleted.
* UIProcess/WebPageProxy.h:
(WebKit::WebPageProxy::viewLayoutSize const):
(WebKit::WebPageProxy::minimumLayoutSize const): Deleted.
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::dynamicViewportSizeUpdate):
(WebKit::WebPageProxy::setViewportConfigurationViewLayoutSize):
(WebKit::WebPageProxy::setViewportConfigurationMinimumLayoutSize): Deleted.
* UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.h:
* UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm:
(WebKit::TiledCoreAnimationDrawingAreaProxy::viewLayoutSizeDidChange):
(WebKit::TiledCoreAnimationDrawingAreaProxy::didUpdateGeometry):
(WebKit::TiledCoreAnimationDrawingAreaProxy::intrinsicContentSizeDidChange):
(WebKit::TiledCoreAnimationDrawingAreaProxy::willSendUpdateGeometry):
(WebKit::TiledCoreAnimationDrawingAreaProxy::minimumLayoutSizeDidChange): Deleted.
* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::transitionToCommittedForNewPage):
* WebProcess/WebPage/ViewGestureGeometryCollector.cpp:
(WebKit::ViewGestureGeometryCollector::collectGeometryForSmartMagnificationGesture):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::m_credentialsMessenger):
(WebKit::WebPage::setViewLayoutSize):
(WebKit::WebPage::setMinimumLayoutSize): Deleted.
* WebProcess/WebPage/WebPage.h:
(WebKit::WebPage::viewLayoutSize const):
(WebKit::WebPage::minimumLayoutSize const): Deleted.
* WebProcess/WebPage/WebPage.messages.in:
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::setViewportConfigurationViewLayoutSize):
(WebKit::WebPage::dynamicViewportSizeUpdate):
(WebKit::WebPage::setViewportConfigurationMinimumLayoutSize): Deleted.
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
(WebKit::TiledCoreAnimationDrawingArea::updateIntrinsicContentSizeIfNeeded):
(WebKit::TiledCoreAnimationDrawingArea::updateGeometry):

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

15 months ago[LFC] Formatting contexts should create floating states.
zalan@apple.com [Fri, 27 Apr 2018 15:40:16 +0000 (15:40 +0000)]
[LFC] Formatting contexts should create floating states.
https://bugs.webkit.org/show_bug.cgi?id=185032

Reviewed by Antti Koivisto.

This patch implements the logic for sharing floating states across multiple formatting contexts.
At this point this is mostly about inline formatting contexts. They either create a new floating state
or inherit it from the parent formatting context.

* layout/FloatingState.cpp:
(WebCore::Layout::FloatingState::FloatingState):
* layout/FloatingState.h:
(WebCore::Layout::FloatingState::create):
* layout/FormattingContext.cpp:
(WebCore::Layout::FormattingContext::FormattingContext):
* layout/FormattingContext.h:
(WebCore::Layout::FormattingContext::layoutContext const):
* layout/FormattingState.cpp:
(WebCore::Layout::FormattingState::FormattingState):
* layout/FormattingState.h:
(WebCore::Layout::FormattingState::floatingState const):
* layout/LayoutContext.cpp:
(WebCore::Layout::LayoutContext::updateLayout):
(WebCore::Layout::LayoutContext::formattingStateForBox const):
(WebCore::Layout::LayoutContext::establishedFormattingState):
(WebCore::Layout::LayoutContext::formattingContext):
(WebCore::Layout::LayoutContext::formattingState): Deleted.
* layout/LayoutContext.h:
* layout/blockformatting/BlockFormattingContext.cpp:
(WebCore::Layout::BlockFormattingContext::BlockFormattingContext):
(WebCore::Layout::BlockFormattingContext::createFormattingState const):
(WebCore::Layout::BlockFormattingContext::createOrFindFloatingState const):
(WebCore::Layout::BlockFormattingContext::formattingState const): Deleted.
* layout/blockformatting/BlockFormattingContext.h:
* layout/blockformatting/BlockFormattingState.cpp:
(WebCore::Layout::BlockFormattingState::BlockFormattingState):
* layout/blockformatting/BlockFormattingState.h:
* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::InlineFormattingContext):
(WebCore::Layout::InlineFormattingContext::createFormattingState const):
(WebCore::Layout::InlineFormattingContext::createOrFindFloatingState const):
(WebCore::Layout::InlineFormattingContext::formattingState const): Deleted.
* layout/inlineformatting/InlineFormattingContext.h:
* layout/inlineformatting/InlineFormattingState.cpp:
(WebCore::Layout::InlineFormattingState::InlineFormattingState):
* layout/inlineformatting/InlineFormattingState.h:
* layout/layouttree/LayoutBox.cpp:
(WebCore::Layout::Box::formattingContextRoot const):
* layout/layouttree/LayoutBox.h:

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

15 months ago[Extra zoom mode] Add a mechanism to override default viewport behaviors in extra...
wenson_hsieh@apple.com [Fri, 27 Apr 2018 15:35:50 +0000 (15:35 +0000)]
[Extra zoom mode] Add a mechanism to override default viewport behaviors in extra zoom mode
https://bugs.webkit.org/show_bug.cgi?id=185050
<rdar://problem/39624038>

Reviewed by Tim Horton.

Source/WebCore:

Currently, in extra zoom mode, there's no way for web pages to opt out of the default viewport behaviors
(namely, laying out at a larger width and shrinking to fit) when the web view is very tall and narrow. This
patch adds a new experimental viewport attribute, "min-device-width", that can be used to prevent WebKit from
automatically clamping the web view width to a greater value for the device width in this scenario.

Note that after this patch, logic that plumbs a minimumLayoutSize from WKWebView to the viewport configuration
will need to be renamed to reflect that this size is no longer the minimum layout size, but rather, the view
size that is used for viewport device dimensions by default. This refactoring will be done in a followup part.

See per-method comments below for more detail.

Test: fast/viewport/extrazoom/viewport-change-min-device-width.html

* dom/ViewportArguments.cpp:
(WebCore::setViewportFeature):
(WebCore::operator<<):
* dom/ViewportArguments.h:

Removes `m_forceHorizontalShrinkToFit` (more detail below).

* page/ViewportConfiguration.cpp:
(WebCore::computedMinDeviceWidth):
(WebCore::ViewportConfiguration::ViewportConfiguration):
(WebCore::ViewportConfiguration::setMinimumLayoutSize):

Instead of directly setting the minimum layout size, setMinimumLayoutSize now first sets the view size (i.e. the
size we use for `device-width` in the viewport meta tag), and then updates the minimum layout size.

(WebCore::ViewportConfiguration::shouldOverrideDeviceWidthWithMinDeviceWidth const):

Replaces `m_forceHorizontalShrinkToFit`. Whether or not we shrink to fit is now determined by whether the
min-device-width attribute is actively clamping the width of the view.

(WebCore::ViewportConfiguration::shouldIgnoreHorizontalScalingConstraints const):
(WebCore::ViewportConfiguration::shouldIgnoreScalingConstraintsRegardlessOfContentSize const):
(WebCore::ViewportConfiguration::updateMinimumLayoutSize):

Computes and sets the minimum layout size using the view size, taking the minimum device width into account if
needed.

(WebCore::ViewportConfiguration::description const):
(WebCore::ViewportConfiguration::setForceHorizontalShrinkToFit): Deleted.
* page/ViewportConfiguration.h:

Source/WebKit:

Remove the forceHorizontalViewportShrinkToFit and minimumAllowedLayoutWidth SPI hooks from WebKit, and
additionally remove all logic for plumbing viewSize to WebCore. See WebCore/ChangeLog for more information.

* Shared/VisibleContentRectUpdateInfo.cpp:
(WebKit::VisibleContentRectUpdateInfo::encode const):
(WebKit::VisibleContentRectUpdateInfo::decode):
(WebKit::operator<<):
* Shared/VisibleContentRectUpdateInfo.h:
(WebKit::VisibleContentRectUpdateInfo::VisibleContentRectUpdateInfo):
(WebKit::VisibleContentRectUpdateInfo::allowShrinkToFit const):
(WebKit::operator==):
(WebKit::VisibleContentRectUpdateInfo::forceHorizontalShrinkToFit const): Deleted.
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _initializeWithConfiguration:]):
(-[WKWebView activeMinimumLayoutSize:]):
(-[WKWebView _dispatchSetMinimumLayoutSize:]):
(-[WKWebView _frameOrBoundsChanged]):
(-[WKWebView _setMinimumLayoutSizeOverride:]):
(-[WKWebView _beginAnimatedResizeWithUpdates:]):
(-[WKWebView _endAnimatedResize]):
(-[WKWebView _minimumAllowedLayoutWidth]): Deleted.
(-[WKWebView _setMinimumAllowedLayoutWidth:]): Deleted.
(-[WKWebView activeMinimumLayoutSizes:]): Deleted.
(-[WKWebView _dispatchSetMinimumLayoutSize:viewSize:]): Deleted.
(-[WKWebView _setForceHorizontalViewportShrinkToFit:]): Deleted.
(-[WKWebView _forceHorizontalViewportShrinkToFit]): Deleted.
* UIProcess/API/Cocoa/WKWebViewPrivate.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::creationParameters):
* UIProcess/WebPageProxy.h:
* UIProcess/ios/WKContentView.mm:
(-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:obscuredInsets:unobscuredSafeAreaInsets:inputViewBounds:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:enclosedInScrollableAncestorView:]):
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::dynamicViewportSizeUpdate):
(WebKit::WebPageProxy::setViewportConfigurationMinimumLayoutSize):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::m_credentialsMessenger):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::setViewportConfigurationMinimumLayoutSize):
(WebKit::WebPage::dynamicViewportSizeUpdate):
(WebKit::WebPage::updateVisibleContentRects):

Tools:

Remove a test that's no longer useful, now that the SPI it was testing is gone. This functionality is now
tested by the layout test added in this patch.

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/ios/ViewportSizingTests.mm: Removed.

LayoutTests:

Add a new layout test to check that:
• By default (with no `min-device-width` override), shrink-to-fit and expanded minimum layout sizes takes effect.
• `min-device-width` can be used to bail out of shrink-to-fit and viewport behaviors.
• A large `min-device-width` can be used to make extra zoom mode viewport heuristics even more aggressive.

* TestExpectations:
* fast/viewport/extrazoom/viewport-change-min-device-width.html: Added.
* resources/ui-helper.js:
(window.UIHelper.zoomScale):
(window.UIHelper):

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

15 months ago[LFC] Formatting contexts should take const Box&
zalan@apple.com [Fri, 27 Apr 2018 14:40:24 +0000 (14:40 +0000)]
[LFC] Formatting contexts should take const Box&
https://bugs.webkit.org/show_bug.cgi?id=185031

Reviewed by Sam Weinig.

The formatting root boxes are supposed to be all const. The only reason why
they are not is because WeakPtr<> does not support const objects yet.
Use const_cast instead (remove it when WeakPtr<> gains const support).

* layout/FormattingContext.cpp:
(WebCore::Layout::FormattingContext::FormattingContext):
* layout/FormattingContext.h:
* layout/LayoutContext.cpp:
(WebCore::Layout::LayoutContext::LayoutContext):
(WebCore::Layout::LayoutContext::formattingContext):
* layout/LayoutContext.h:
* layout/blockformatting/BlockFormattingContext.cpp:
(WebCore::Layout::BlockFormattingContext::BlockFormattingContext):
* layout/blockformatting/BlockFormattingContext.h:
* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::InlineFormattingContext):
* layout/inlineformatting/InlineFormattingContext.h:

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

15 months ago[LFC] Add layout tree iterators.
zalan@apple.com [Fri, 27 Apr 2018 14:34:47 +0000 (14:34 +0000)]
[LFC] Add layout tree iterators.
https://bugs.webkit.org/show_bug.cgi?id=185058

Reviewed by Antti Koivisto.

They work exactly like the renderer tree iterators.

* WebCore.xcodeproj/project.pbxproj:
* layout/layouttree/LayoutAncestorIterator.h: Added.
(WebCore::Layout::LayoutAncestorIterator<T>::LayoutAncestorIterator):
(WebCore::Layout::LayoutAncestorIterator<T>::operator):
(WebCore::Layout::LayoutAncestorIteratorAdapter<T>::LayoutAncestorIteratorAdapter):
(WebCore::Layout::LayoutAncestorIteratorAdapter<T>::begin const):
(WebCore::Layout::LayoutAncestorIteratorAdapter<T>::end const):
(WebCore::Layout::LayoutAncestorIteratorAdapter<T>::first const):
(WebCore::Layout::ancestorsOfType):
(WebCore::Layout::lineageOfType):
* layout/layouttree/LayoutBox.cpp:
* layout/layouttree/LayoutChildIterator.h: Added.
(WebCore::Layout::LayoutChildtIterator<T>::LayoutChildtIterator):
(WebCore::Layout::LayoutChildtIterator<T>::operator):
(WebCore::Layout::LayoutChildtIteratorAdapter<T>::LayoutChildtIteratorAdapter):
(WebCore::Layout::LayoutChildtIteratorAdapter<T>::begin const):
(WebCore::Layout::LayoutChildtIteratorAdapter<T>::end const):
(WebCore::Layout::LayoutChildtIteratorAdapter<T>::first const):
(WebCore::Layout::LayoutChildtIteratorAdapter<T>::last const):
(WebCore::Layout::childrenOfType):
* layout/layouttree/LayoutIterator.h: Added.
(WebCore::Layout::isLayoutBoxOfType):
(WebCore::Layout::Traversal::firstChild):
(WebCore::Layout::Traversal::lastChild):
(WebCore::Layout::Traversal::nextSibling):
(WebCore::Layout::Traversal::previousSibling):
(WebCore::Layout::Traversal::findAncestorOfType):
(WebCore::Layout::Traversal::nextAncestorSibling):
(WebCore::Layout::Traversal::nextWithin):
(WebCore::Layout::Traversal::firstWithin):
(WebCore::Layout::Traversal::next):
(WebCore::Layout::LayoutIterator<T>::LayoutIterator):
(WebCore::Layout::LayoutIterator<T>::traverseNextSibling):
(WebCore::Layout::LayoutIterator<T>::traverseNext):
(WebCore::Layout::LayoutIterator<T>::traversePreviousSibling):
(WebCore::Layout::LayoutIterator<T>::traverseAncestor):
(WebCore::Layout::LayoutIterator<T>::operator const):
(WebCore::Layout:: const):
(WebCore::Layout::= const):

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

15 months ago[GTK] Mark a few new test failures
csaavedra@igalia.com [Fri, 27 Apr 2018 11:47:37 +0000 (11:47 +0000)]
[GTK] Mark a few new test failures

Unreviewed gardening.
* platform/gtk/TestExpectations: Related to r230817

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

15 months agoUnreviewed, rolling out r231089.
commit-queue@webkit.org [Fri, 27 Apr 2018 10:07:58 +0000 (10:07 +0000)]
Unreviewed, rolling out r231089.
https://bugs.webkit.org/show_bug.cgi?id=185071

Broke and made crash some WPE EME tests (Requested by calvaris
on #webkit).

Reverted changeset:

"[EME][GStreamer] Move the decryptor from AppendPipeline to
PlaybackPipeline."
https://bugs.webkit.org/show_bug.cgi?id=181855
https://trac.webkit.org/changeset/231089

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

15 months agoREGRESSION(r230812): [WPE][GTK] WebKitWebViewSessionState.cpp throws away encoded...
carlosgc@webkit.org [Fri, 27 Apr 2018 08:40:52 +0000 (08:40 +0000)]
REGRESSION(r230812): [WPE][GTK] WebKitWebViewSessionState.cpp throws away encoded BackForwardList identifier
https://bugs.webkit.org/show_bug.cgi?id=184823

Reviewed by Michael Catanzaro.

Bump session sate format version to 2 and stop encoding the backfoward list item identifier, since it's always
regenerated.

* UIProcess/API/glib/WebKitWebViewSessionState.cpp:
(encodeBackForwardListItemState): Always encode version 2.
(encodeBackForwardListState): Ditto.
(encodeSessionState): Ditto.
(decodeBackForwardListItemStateV1): Decode list item state for version 1.
(decodeBackForwardListItemState): Receive the version and call decodeBackForwardListItemStateV1() if it's 1 or
use the version 2 otherwise.
(decodeSessionState): Load data for known formats and use the one that worked to decode it.

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

15 months ago[EME][GStreamer] Move the decryptor from AppendPipeline to PlaybackPipeline.
commit-queue@webkit.org [Fri, 27 Apr 2018 07:33:53 +0000 (07:33 +0000)]
[EME][GStreamer] Move the decryptor from AppendPipeline to PlaybackPipeline.
https://bugs.webkit.org/show_bug.cgi?id=181855

Patch by Yacine Bandou <yacine.bandou_ext@softathome.com> on 2018-04-27
Reviewed by Xabier Rodriguez-Calvar.

The goal of this move is to handle the limitation of SVP (Secure Video Path) memory size.

When the decryptor is in the AppendPipeline and we use SVP, we buffer in MediaSource queue
the decrypted GstBuffers that are in SVP memory.
This behavior cause an out-of-memory error, because we are limited in SVP memory size.

By moving the decryptor in PlaybackPipeline, we avoid to buffer the decrypted GstBuffers
which use the SVP memory and we buffer the encrypted GstBuffers that are in system memory.

This new architecture also allows to start the buffering before obtaining the DRM license
and it makes easier to manage dynamic change of the license or Key.

The decryptor is auto plugged by GStreamer playbin in PlaybackPipeline.

SVP: Secure Video Path also named trusted or protected video path, it is a memory which is
protected by a hardware access control engine, it is not accessible to other unauthorised
software or hardware components.

Tests:
    media/encrypted-media/clearKey/clearKey-cenc-audio-playback-mse.html
    media/encrypted-media/clearKey/clearKey-cenc-video-playback-mse.html

* platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp:
(webkitMediaCommonEncryptionDecryptSinkEventHandler):
* platform/graphics/gstreamer/mse/AppendPipeline.cpp:
(WebCore::dumpAppendState):
(WebCore::AppendPipeline::AppendPipeline):
(WebCore::AppendPipeline::handleNeedContextSyncMessage):
(WebCore::AppendPipeline::handleAppsrcNeedDataReceived):
(WebCore::AppendPipeline::setAppendState):
(WebCore::AppendPipeline::parseDemuxerSrcPadCaps):
(WebCore::AppendPipeline::appsinkNewSample):
(WebCore::AppendPipeline::connectDemuxerSrcPadToAppsinkFromAnyThread):
(WebCore::AppendPipeline::disconnectDemuxerSrcPadFromAppsinkFromAnyThread):
(WebCore::appendPipelineElementMessageCallback): Deleted.
(WebCore::AppendPipeline::handleElementMessage): Deleted.
(WebCore::AppendPipeline::dispatchPendingDecryptionStructure): Deleted.
(WebCore::AppendPipeline::dispatchDecryptionStructure): Deleted.
* platform/graphics/gstreamer/mse/AppendPipeline.h:
* platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
(WebCore::MediaPlayerPrivateGStreamerMSE::attemptToDecryptWithInstance):
* platform/graphics/gstreamer/mse/PlaybackPipeline.cpp:

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

15 months ago[EME][GStreamer] Add a new message "decrypt-key-needed" send from the decryptor to...
commit-queue@webkit.org [Fri, 27 Apr 2018 07:27:45 +0000 (07:27 +0000)]
[EME][GStreamer] Add a new message "decrypt-key-needed" send from the decryptor to the application.
https://bugs.webkit.org/show_bug.cgi?id=181858

Patch by Yacine Bandou <yacine.bandou_ext@softathome.com> on 2018-04-27
Reviewed by Xabier Rodriguez-Calvar.

Add a new message "decrypt-key-needed" that the decryptor can send when it doesn't have an available key.
This message should be handled by the application in order to dispatch or send the key to the decryptor.
This patch is a preparation for the patch 181855.
With the patch 181855, the decryptor will be in the PlaybackPipeline instead of AppendPipeline, thus we can
get the DRM license or key before to instantiate or load the decryptor plugin in PlaybackPipeline.
When the decryptor plugin is instantiated or loaded, it should able to ask the application to resend
the DRM license or key by using this new message "decrypt-key-needed".

* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::handleMessage):
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
(WebCore::MediaPlayerPrivateGStreamerBase::dispatchCDMInstance):
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
* platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp:
(webkitMediaCommonEncryptionDecryptTransformInPlace):

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

15 months agoExtend create-analysis-test API to be able to create with confirming test group.
dewei_zhu@apple.com [Fri, 27 Apr 2018 06:22:00 +0000 (06:22 +0000)]
Extend create-analysis-test API to be able to create with confirming test group.
https://bugs.webkit.org/show_bug.cgi?id=184958

Reviewed by Ryosuke Niwa.

Extend create-analysis-test API to be able to create an analysis task with confirming test group.
Update create analysis task UI in chart pane to adapt this new API.
Refactored '/privileged-api/create-test-group' API to share some creating test group logic with '/privileged-api/create-analysis-task' API.
Moved the shared logic to commit-sets-helpers.php.

* public/api/analysis-tasks.php: Use 'require_once' instead of 'require'.
* public/include/commit-sets-helpers.php: Added.
(create_test_group_and_build_requests): A helper function that creates test group and build requests for a analysis
task. In long term, this should be a class to avoid passing long argument list around.
(insert_commit_sets_and_construct_configuration_list): Based on commit sets returns build and test configurations.
(insert_build_request_for_configuration): Insert build requests based on configuration.
(commit_sets_from_revision_sets): Returns commit sets from given revision set list.
* public/privileged-api/create-analysis-task.php: Added the ability to create analysis task with confirming test
groups when repetition count is specified.
* public/privileged-api/create-test-group.php: Moved shared function to commit-sets-helpers.php.
* public/v3/models/analysis-task.js:
(AnalysisTask.create): Instead of accepting run ids, it now accepts points and test group name and confirming iterations.
It will conditionally add test group information into parameter when confirming iterations is a positive number.
(AnalysisTask):
* public/v3/models/commit-set.js:
(CommitSet.revisionSetsFromCommitSets): Move 'TestGroup._revisionSetsFromCommitSets' since CommitSet class is more
appropriate place and it will be shared by both TestGroup and AnalysisTask
(CommitSet):
* public/v3/models/test-group.js:
(TestGroup.createWithTask): Adapt 'CommitSet.revisionSetsFromCommitSets'.
(TestGroup.createWithCustomConfiguration): Adapt 'CommitSet.revisionSetsFromCommitSets'.
(TestGroup.createAndRefetchTestGroups): Adapt 'CommitSet.revisionSetsFromCommitSets'.
(TestGroup._revisionSetsFromCommitSets): Deleted and moved to 'CommitSet.revisionSetsFromCommitSets'.
* public/v3/pages/chart-pane.js:
(ChartPane.prototype.didConstructShadowTree): Added the logic to disable options when checkbox for creating confirming
test group is unchecked.
(ChartPane.prototype._analyzeRange): Conditionally create confirming test group from UI.
(ChartPane.cssTemplate):
* server-tests/privileged-api-create-analysis-task-tests.js: Added unit tests. Added a unit test for 'NodePrivilegedAPI'.
* unit-tests/analysis-task-tests.js: Added unit tests.
* unit-tests/commit-set-tests.js: Added unit test for 'CommitSet.revisionSetsFromCommitSets'.
* unit-tests/resources/mock-remote-api.js: Reset csrf token when BrowserPrivilegedAPI is used.
(MockRemoteAPI.inject):

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

15 months ago[ESNext][BigInt] Implement support for "*" operation
ticaiolima@gmail.com [Fri, 27 Apr 2018 04:18:32 +0000 (04:18 +0000)]
[ESNext][BigInt] Implement support for "*" operation
https://bugs.webkit.org/show_bug.cgi?id=183721

Reviewed by Saam Barati.

JSTests:

* bigIntTests.yaml:
* stress/big-int-mul-jit.js: Added.
* stress/big-int-mul-to-primitive-precedence.js: Added.
* stress/big-int-mul-to-primitive.js: Added.
* stress/big-int-mul-type-error.js: Added.
* stress/big-int-mul-wrapped-value.js: Added.
* stress/big-int-multiplication.js: Added.
* stress/big-int-multiply-memory-stress.js: Added.

Source/JavaScriptCore:

Added BigInt support into times binary operator into LLInt and on
JITOperations profiledMul and unprofiledMul. We are also replacing all
uses of int to unsigned when there is no negative values for
variables.

* dfg/DFGConstantFoldingPhase.cpp:
(JSC::DFG::ConstantFoldingPhase::foldConstants):
* jit/JITOperations.cpp:
* runtime/CommonSlowPaths.cpp:
(JSC::SLOW_PATH_DECL):
* runtime/JSBigInt.cpp:
(JSC::JSBigInt::JSBigInt):
(JSC::JSBigInt::allocationSize):
(JSC::JSBigInt::createWithLength):
(JSC::JSBigInt::toString):
(JSC::JSBigInt::multiply):
(JSC::JSBigInt::digitDiv):
(JSC::JSBigInt::internalMultiplyAdd):
(JSC::JSBigInt::multiplyAccumulate):
(JSC::JSBigInt::equals):
(JSC::JSBigInt::absoluteDivSmall):
(JSC::JSBigInt::calculateMaximumCharactersRequired):
(JSC::JSBigInt::toStringGeneric):
(JSC::JSBigInt::rightTrim):
(JSC::JSBigInt::allocateFor):
(JSC::JSBigInt::parseInt):
(JSC::JSBigInt::digit):
(JSC::JSBigInt::setDigit):
* runtime/JSBigInt.h:
* runtime/Operations.h:
(JSC::jsMul):

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

15 months agoUpdate code style guidelines to mention braced initialization style.
ross.kirsling@sony.com [Fri, 27 Apr 2018 04:00:01 +0000 (04:00 +0000)]
Update code style guidelines to mention braced initialization style.
https://bugs.webkit.org/show_bug.cgi?id=185053

Reviewed by Ryosuke Niwa.

* code-style.md:
Add a clause to the Spacing section about braced initialization.
(Also, fix an erroneous element ID on a neighboring line.)

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

15 months agotex[Sub]Image2D slow when passing in a <canvas>, faster with ImageData.
commit-queue@webkit.org [Fri, 27 Apr 2018 02:00:25 +0000 (02:00 +0000)]
tex[Sub]Image2D slow when passing in a <canvas>, faster with ImageData.
https://bugs.webkit.org/show_bug.cgi?id=184843
<rdar://problem/34898868>

Patch by Justin Fan <justin_fan@apple.com> on 2018-04-26
Reviewed by Simon Fraser.

On certain test pages passing 2d canvas objects to gl.texSubImage2D, we spend significant time doing an alpha unpremultiplication in FormatConverter::convert on a single thread.
For now, I am introducing use of the Accelerate framework to do canvas alpha unpremultiplication, specifically for RGBA8 > RGBA8.
This improves this rendering path by a factor of ~4. The rest of FormatConverter could use similar improvements; filed https://bugs.webkit.org/show_bug.cgi?id=185064 for these.

* platform/graphics/FormatConverter.cpp:
(WebCore::FormatConverter::convert):

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

15 months agoREGRESSION (r231039): RunUnitTests step reports disabled tests as failures
ryanhaddad@apple.com [Fri, 27 Apr 2018 01:25:10 +0000 (01:25 +0000)]
REGRESSION (r231039): RunUnitTests step reports disabled tests as failures
https://bugs.webkit.org/show_bug.cgi?id=185061

Reviewed by Aakash Jain.

* BuildSlaveSupport/build.webkit.org-config/steps.py:
(RunUnitTests.countFailures): Return the difference between the total number of tests run and the number that passed.
* BuildSlaveSupport/build.webkit.org-config/steps_unittest.py: Add a test.

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

15 months agoImplement rendering support for the color-filter CSS property
simon.fraser@apple.com [Fri, 27 Apr 2018 00:10:48 +0000 (00:10 +0000)]
Implement rendering support for the color-filter CSS property
https://bugs.webkit.org/show_bug.cgi?id=185047
rdar://problem/39664967

Reviewed by Tim Horton.

Source/WebCore:

The color-filter property transforms CSS colors just before painting. To support this,
add to RenderStyle colorByApplyingColorFilter() and visitedDependentColorWithColorFilter().
At most calls sites that transform colors for rendering, replace calls to
visitedDependentColor() with visitedDependentColorWithColorFilter(). The few locations
that don't use visitedDependentColor() (e.g. for shadows) call colorByApplyingColorFilter().

Color transformation is implemented via a new virtual function on FilterOperation;
BasicColorMatrixFilterOperation overrides this to use a new ColorMatrix class to
do color math, and BasicComponentTransferFilterOperation to do the equivalent of component
transfer operations. The math in both cases matches that for SVG filters, with the exception
that color components are stored as floats through multiple filters and then mapped to
normal 0-255 color components at the end.

Tests: css3/color-filters/color-filter-backgrounds-borders.html
       css3/color-filters/color-filter-box-shadow.html
       css3/color-filters/color-filter-brightness.html
       css3/color-filters/color-filter-color-property-list-item.html
       css3/color-filters/color-filter-color-property.html
       css3/color-filters/color-filter-color-text-decorations.html
       css3/color-filters/color-filter-column-rule.html
       css3/color-filters/color-filter-contrast.html
       css3/color-filters/color-filter-current-color.html
       css3/color-filters/color-filter-filter-list.html
       css3/color-filters/color-filter-grayscale.html
       css3/color-filters/color-filter-hue-rotate.html
       css3/color-filters/color-filter-inherits.html
       css3/color-filters/color-filter-invert.html
       css3/color-filters/color-filter-opacity.html
       css3/color-filters/color-filter-outline.html
       css3/color-filters/color-filter-saturate.html
       css3/color-filters/color-filter-sepia.html
       css3/color-filters/color-filter-text-emphasis.html

* html/HTMLTextFormControlElement.cpp:
(WebCore::HTMLTextFormControlElement::adjustInnerTextStyle const):
* page/FrameView.cpp:
(WebCore::FrameView::documentBackgroundColor const):
* platform/graphics/ColorUtilities.cpp:
(WebCore::ColorMatrix::ColorMatrix):
(WebCore::ColorMatrix::makeIdentity):
(WebCore::ColorMatrix::grayscaleMatrix):
(WebCore::ColorMatrix::saturationMatrix):
(WebCore::ColorMatrix::hueRotateMatrix):
(WebCore::ColorMatrix::sepiaMatrix):
(WebCore::ColorMatrix::transformColorComponents const):
* platform/graphics/ColorUtilities.h:
* platform/graphics/filters/FilterOperation.cpp:
(WebCore::BasicColorMatrixFilterOperation::transformColor const):
(WebCore::BasicComponentTransferFilterOperation::transformColor const):
* platform/graphics/filters/FilterOperation.h:
(WebCore::FilterOperation::transformColor const):
* platform/graphics/filters/FilterOperations.cpp:
(WebCore::FilterOperations::transformColor const):
* platform/graphics/filters/FilterOperations.h:
* rendering/BorderEdge.cpp:
(WebCore::BorderEdge::getBorderEdgeInfo):
* rendering/EllipsisBox.cpp:
(WebCore::EllipsisBox::paint):
(WebCore::EllipsisBox::paintSelection):
* rendering/InlineFlowBox.cpp:
(WebCore::InlineFlowBox::paintBoxDecorations):
* rendering/InlineTextBox.cpp:
(WebCore::InlineTextBox::paintMarkedTextForeground):
(WebCore::InlineTextBox::paintMarkedTextDecoration):
(WebCore::InlineTextBox::paintCompositionUnderline const):
* rendering/RenderBox.cpp:
(WebCore::RenderBox::paintRootBoxFillLayers):
(WebCore::RenderBox::paintBackground):
(WebCore::RenderBox::getBackgroundPaintedExtent const):
(WebCore::RenderBox::backgroundIsKnownToBeOpaqueInRect const):
(WebCore::RenderBox::backgroundHasOpaqueTopLayer const):
* rendering/RenderBoxModelObject.cpp:
(WebCore::applyBoxShadowForBackground):
(WebCore::RenderBoxModelObject::paintFillLayerExtended):
(WebCore::RenderBoxModelObject::boxShadowShouldBeAppliedToBackground const):
(WebCore::RenderBoxModelObject::paintBoxShadow):
* rendering/RenderDetailsMarker.cpp:
(WebCore::RenderDetailsMarker::paint):
* rendering/RenderElement.cpp:
(WebCore::RenderElement::selectionColor const):
(WebCore::RenderElement::selectionBackgroundColor const):
(WebCore::RenderElement::paintFocusRing):
(WebCore::RenderElement::paintOutline):
* rendering/RenderFileUploadControl.cpp:
(WebCore::RenderFileUploadControl::paintObject):
* rendering/RenderFrameSet.cpp:
(WebCore::RenderFrameSet::paintColumnBorder):
(WebCore::RenderFrameSet::paintRowBorder):
* rendering/RenderImage.cpp:
(WebCore::RenderImage::paintReplaced):
(WebCore::RenderImage::paintAreaElementFocusRing):
* rendering/RenderInline.cpp:
(WebCore::RenderInline::paintOutline):
* rendering/RenderLayerBacking.cpp:
(WebCore::canDirectlyCompositeBackgroundBackgroundImage):
(WebCore::RenderLayerBacking::rendererBackgroundColor const):
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::rootOrBodyStyleChanged):
* rendering/RenderListBox.cpp:
(WebCore::RenderListBox::paintItemForeground):
(WebCore::RenderListBox::paintItemBackground):
* rendering/RenderListMarker.cpp:
(WebCore::RenderListMarker::paint):
* rendering/RenderMenuList.cpp:
(RenderMenuList::itemStyle const):
(RenderMenuList::getItemBackgroundColor const):
(RenderMenuList::menuStyle const):
* rendering/RenderMultiColumnSet.cpp:
(WebCore::RenderMultiColumnSet::paintColumnRules):
* rendering/RenderSearchField.cpp:
(WebCore::RenderSearchField::menuStyle const):
* rendering/RenderTable.h:
(WebCore::RenderTable::bgColor const):
* rendering/RenderTableCell.cpp:
(WebCore::RenderTableCell::computeCollapsedStartBorder const):
(WebCore::RenderTableCell::computeCollapsedEndBorder const):
(WebCore::RenderTableCell::computeCollapsedBeforeBorder const):
(WebCore::RenderTableCell::computeCollapsedAfterBorder const):
(WebCore::RenderTableCell::paintBackgroundsBehindCell):
* rendering/RenderTableSection.cpp:
(WebCore::RenderTableSection::paintRowGroupBorder):
* rendering/RenderTheme.cpp:
(WebCore::RenderTheme::paintSliderTicks):
* rendering/TextDecorationPainter.cpp:
(WebCore::decorationColor):
* rendering/TextPaintStyle.cpp:
(WebCore::computeTextPaintStyle):
* rendering/mathml/MathOperator.cpp:
(WebCore::MathOperator::paint):
* rendering/mathml/RenderMathMLFraction.cpp:
(WebCore::RenderMathMLFraction::paint):
* rendering/mathml/RenderMathMLMenclose.cpp:
(WebCore::RenderMathMLMenclose::paint):
* rendering/mathml/RenderMathMLRoot.cpp:
(WebCore::RenderMathMLRoot::paint):
* rendering/mathml/RenderMathMLToken.cpp:
(WebCore::RenderMathMLToken::paint):
* rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::visitedDependentColorWithColorFilter const):
(WebCore::RenderStyle::colorByApplyingColorFilter const):
* rendering/style/RenderStyle.h:

Source/WebKitLegacy/mac:

The body background should reflect the filtered color.

* WebView/WebFrame.mm:
(-[WebFrame _bodyBackgroundColor]):
* WebView/WebView.mm:
(-[WebView updateTextTouchBar]): No logic change, just cleanup.

LayoutTests:

Tests for color-filter rendering.

* css3/color-filters/color-filter-backgrounds-borders-expected.html: Added.
* css3/color-filters/color-filter-backgrounds-borders.html: Added.
* css3/color-filters/color-filter-box-shadow-expected.html: Added.
* css3/color-filters/color-filter-box-shadow.html: Added.
* css3/color-filters/color-filter-brightness-expected.html: Added.
* css3/color-filters/color-filter-brightness.html: Added.
* css3/color-filters/color-filter-color-property-expected.html: Added.
* css3/color-filters/color-filter-color-property-list-item-expected.html: Added.
* css3/color-filters/color-filter-color-property-list-item.html: Added.
* css3/color-filters/color-filter-color-property.html: Added.
* css3/color-filters/color-filter-color-text-decorations-expected.html: Added.
* css3/color-filters/color-filter-color-text-decorations.html: Added.
* css3/color-filters/color-filter-column-rule-expected.html: Added.
* css3/color-filters/color-filter-column-rule.html: Added.
* css3/color-filters/color-filter-contrast-expected.html: Added.
* css3/color-filters/color-filter-contrast.html: Added.
* css3/color-filters/color-filter-current-color-expected.html: Added.
* css3/color-filters/color-filter-current-color.html: Added.
* css3/color-filters/color-filter-filter-list-expected.html: Added.
* css3/color-filters/color-filter-filter-list.html: Added.
* css3/color-filters/color-filter-grayscale-expected.html: Added.
* css3/color-filters/color-filter-grayscale.html: Added.
* css3/color-filters/color-filter-hue-rotate-expected.html: Added.
* css3/color-filters/color-filter-hue-rotate.html: Added.
* css3/color-filters/color-filter-inherits-expected.html: Added.
* css3/color-filters/color-filter-inherits.html: Added.
* css3/color-filters/color-filter-invert-expected.html: Added.
* css3/color-filters/color-filter-invert.html: Added.
* css3/color-filters/color-filter-opacity-expected.html: Added.
* css3/color-filters/color-filter-opacity.html: Added.
* css3/color-filters/color-filter-outline-expected.html: Added.
* css3/color-filters/color-filter-outline.html: Added.
* css3/color-filters/color-filter-saturate-expected.html: Added.
* css3/color-filters/color-filter-saturate.html: Added.
* css3/color-filters/color-filter-sepia-expected.html: Added.
* css3/color-filters/color-filter-sepia.html: Added.
* css3/color-filters/color-filter-text-emphasis-expected.html: Added.
* css3/color-filters/color-filter-text-emphasis.html: Added.

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

15 months agoUnreviewed build fix; fix WebInspectorUI copy resources step after r231063.
jer.noble@apple.com [Thu, 26 Apr 2018 23:30:21 +0000 (23:30 +0000)]
Unreviewed build fix; fix WebInspectorUI copy resources step after r231063.

* Configurations/Base.xcconfig:

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

15 months agoAdd timeout for ensurePositionInformationIsUpToDate
megan_gardner@apple.com [Thu, 26 Apr 2018 23:27:19 +0000 (23:27 +0000)]
Add timeout for ensurePositionInformationIsUpToDate
https://bugs.webkit.org/show_bug.cgi?id=184567

Reviewed by Wenson Hsieh.

We are having long hang times for WebKit, and this is one of the culprits.
If we do not get an answer for positionInformation in a reasonable amount of time, we should timeout,
so as to not hang the UI.

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

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

15 months agoGardening: Speculative build fix for Windows.
mark.lam@apple.com [Thu, 26 Apr 2018 22:59:04 +0000 (22:59 +0000)]
Gardening: Speculative build fix for Windows.
https://bugs.webkit.org/show_bug.cgi?id=184976
<rdar://problem/39723901>

Not reviewed.

Source/JavaScriptCore:

* runtime/JSCPtrTag.h:

Source/WebCore:

* cssjit/CSSPtrTag.h:

Source/WTF:

* wtf/PtrTag.h:
(WTF::makePtrTagHash): Undo last speculative build fix that did not work for 64-bit.

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

15 months agoShow punycode if URL contains Latin small letter o with dot below character
bfulgham@apple.com [Thu, 26 Apr 2018 22:50:55 +0000 (22:50 +0000)]
Show punycode if URL contains Latin small letter o with dot below character
https://bugs.webkit.org/show_bug.cgi?id=185051
<rdar://problem/39459297>

Reviewed by David Kilzer.

Source/WebCore:

Revise our "lookalike character" logic to include the small Latin o
with dot below character.

Test: fast/url/host.html

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

LayoutTests:

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

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

15 months agoGardening: Windows build fix.
mark.lam@apple.com [Thu, 26 Apr 2018 21:53:28 +0000 (21:53 +0000)]
Gardening: Windows build fix.

Not reviewed.

* runtime/Options.cpp:

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

15 months agoTry again to fix the iOS build after r231063.
aestes@apple.com [Thu, 26 Apr 2018 21:48:32 +0000 (21:48 +0000)]
Try again to fix the iOS build after r231063.

* Configurations/Base.xcconfig:

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

15 months ago[iOS] LayoutTest http/tests/quicklook/hide-referer-on-navigation.html is failing
commit-queue@webkit.org [Thu, 26 Apr 2018 21:41:39 +0000 (21:41 +0000)]
[iOS] LayoutTest http/tests/quicklook/hide-referer-on-navigation.html is failing
https://bugs.webkit.org/show_bug.cgi?id=184825
<rdar://problem/38924997>

Patch by Sihui Liu <sihui_liu@apple.com> on 2018-04-26
Reviewed by Geoffrey Garen.

Policy decisions are made asynchronously now, so we need to set the async flag of this test.

* http/tests/quicklook/hide-referer-on-navigation.html:

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

15 months agoWK_COCOA_TOUCH the WK_ACCESSIBILITY_LDFLAGS
jer.noble@apple.com [Thu, 26 Apr 2018 21:40:31 +0000 (21:40 +0000)]
WK_COCOA_TOUCH the WK_ACCESSIBILITY_LDFLAGS
https://bugs.webkit.org/show_bug.cgi?id=185007
<rdar://problem/39735943>

Reviewed by Timothy Hatcher.

* Configurations/WebKit.xcconfig:

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

15 months agoUnreviewed build fix; fix iOS TAPI build step after r231063.
jer.noble@apple.com [Thu, 26 Apr 2018 21:32:05 +0000 (21:32 +0000)]
Unreviewed build fix; fix iOS TAPI build step after r231063.

* Configurations/WebKit.xcconfig:

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

15 months agoAdd release bots for WinCairo.
ross.kirsling@sony.com [Thu, 26 Apr 2018 21:26:19 +0000 (21:26 +0000)]
Add release bots for WinCairo.
https://bugs.webkit.org/show_bug.cgi?id=185042

Reviewed by Lucas Forschler.

* BuildSlaveSupport/build.webkit.org-config/config.json:
Add a release build bot and two test bots, replacing the outdated WinCairo release bots.

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