WebKit-https.git
2 years agortc::PacketOptions should have its own IPC encoding/decoding routines
commit-queue@webkit.org [Thu, 5 Oct 2017 03:54:39 +0000 (03:54 +0000)]
rtc::PacketOptions should have its own IPC encoding/decoding routines
https://bugs.webkit.org/show_bug.cgi?id=177812

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

Replacing rtc::PacketOptions IPC encoding/decoding from passing the structure as individual parameters to the structure as a parameter.
Introducing WebKit::RTCPacketOptions as a wrapper around it for which encode/decode routines are added.
Updating code using rtc::PacketOptions accordingly.

* NetworkProcess/webrtc/NetworkRTCSocket.cpp:
(WebKit::NetworkRTCSocket::sendTo):
* NetworkProcess/webrtc/NetworkRTCSocket.h:
* NetworkProcess/webrtc/NetworkRTCSocket.messages.in:
* Platform/IPC/Decoder.cpp:
(IPC::Decoder::operator>>):
(IPC::Decoder::decode):
* Platform/IPC/Decoder.h:
* Platform/IPC/Encoder.cpp:
(IPC::Encoder::encode):
* Platform/IPC/Encoder.h:
* Shared/RTCPacketOptions.cpp: Added.
(WebKit::RTCPacketOptions::encode const):
(WebKit::RTCPacketOptions::decode):
* Shared/RTCPacketOptions.h: Added.
* WebKit.xcodeproj/project.pbxproj:
* WebProcess/Network/webrtc/LibWebRTCSocket.cpp:
(WebKit::LibWebRTCSocket::SendTo):

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

2 years agobmalloc mutex should be adaptive
fpizlo@apple.com [Thu, 5 Oct 2017 03:05:42 +0000 (03:05 +0000)]
bmalloc mutex should be adaptive
https://bugs.webkit.org/show_bug.cgi?id=177839

Reviewed by Michael Saboff.

Source/bmalloc:

This pulls the WordLock algorithm into bmalloc, mostly by copy-pasting the code. We need to
copy paste because sometimes we build WTF without bmalloc, so WTF cannot rely on bmalloc for
anything other than malloc.

* bmalloc/Algorithm.h:
(bmalloc::compareExchangeWeak):
(bmalloc::compareExchangeStrong):
* bmalloc/PerThread.h:
* bmalloc/StaticMutex.cpp:
(bmalloc::StaticMutex::lockSlow):
(bmalloc::StaticMutex::unlockSlow):
(bmalloc::StaticMutex::lockSlowCase): Deleted.
* bmalloc/StaticMutex.h:
(bmalloc::StaticMutex::try_lock):
(bmalloc::StaticMutex::isLocked const):
(bmalloc::StaticMutex::init):
(bmalloc::StaticMutex::tryLock):
(bmalloc::StaticMutex::lock):
(bmalloc::StaticMutex::unlock):
(bmalloc::sleep): Deleted.
(bmalloc::waitUntilFalse): Deleted.

Source/WTF:

Add some comments that I thought of while copy-pasting this code.

* wtf/LockAlgorithmInlines.h:
* wtf/WordLock.cpp:

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

2 years agoLink WebCore against CFNetwork in the CMake build
timothy_horton@apple.com [Thu, 5 Oct 2017 02:57:01 +0000 (02:57 +0000)]
Link WebCore against CFNetwork in the CMake build
https://bugs.webkit.org/show_bug.cgi?id=177910

Reviewed by Ryosuke Niwa.

* PlatformMac.cmake:
This is enough to get WebKit1 MiniBrowser running; otherwise, we
crash trying to access the public suffix list.

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

2 years agoMake pertinent AccessCases watch the poly proto watchpoint
sbarati@apple.com [Thu, 5 Oct 2017 02:47:59 +0000 (02:47 +0000)]
Make pertinent AccessCases watch the poly proto watchpoint
https://bugs.webkit.org/show_bug.cgi?id=177765

Reviewed by Keith Miller.

JSTests:

* microbenchmarks/poly-proto-and-non-poly-proto-same-ic.js: Added.
(assert):
(foo.C):
(foo):
(validate):
* stress/poly-proto-clear-stub.js: Added.
(assert):
(foo.C):
(foo):

Source/JavaScriptCore:

This patch makes it so that stubs that encounter a structure with a
valid poly proto watchpoint will watch the poly proto watchpoint. This
ensures that if the watchpoint is fired, the stub will be cleared
and have a chance to regenerate. In an ideal world, this will lead
to the stub generating better code since it may never encounter the
non-poly proto structure again.

This patch also fixes a bug in the original poly proto code where
I accidentally had a condition inverted. The bad code caused a
stub that continually cached two structures which are structurally
equivalent but with different prototype objects to always clear itself.
The code should have been written differently. It should have only
cleared if the poly proto watchpoint *was not* fired. The code
accidentally cleared only if stub *was* fired.

* bytecode/AccessCase.cpp:
(JSC::AccessCase::commit):
* bytecode/PolymorphicAccess.cpp:
(JSC::PolymorphicAccess::addCases):
(WTF::printInternal):
* bytecode/PolymorphicAccess.h:
(JSC::AccessGenerationResult::shouldResetStubAndFireWatchpoints const):
(JSC::AccessGenerationResult::addWatchpointToFire):
(JSC::AccessGenerationResult::fireWatchpoints):
(JSC::AccessGenerationResult::shouldResetStub const): Deleted.
* bytecode/StructureStubInfo.cpp:
(JSC::StructureStubInfo::addAccessCase):
(JSC::StructureStubInfo::reset):
* bytecode/Watchpoint.h:
(JSC::InlineWatchpointSet::inflate):
* jit/Repatch.cpp:
(JSC::fireWatchpointsAndClearStubIfNeeded):
(JSC::tryCacheGetByID):
(JSC::repatchGetByID):
(JSC::tryCachePutByID):
(JSC::repatchPutByID):
(JSC::tryCacheIn):
(JSC::repatchIn):
(JSC::tryRepatchIn): Deleted.

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

2 years agoBreak out new touch debugging code into seperate file
megan_gardner@apple.com [Thu, 5 Oct 2017 00:02:05 +0000 (00:02 +0000)]
Break out new touch debugging code into seperate file
https://bugs.webkit.org/show_bug.cgi?id=177796

Reviewed by Simon Fraser.

Encapsulate the new debug touch code into it's own file.
This allows for cleaner code and a better way to show the touches
in a completely separate window, which should also be in screen
coordinates, and not subject to any transforms that get put on the
WebViews.

* TestRunnerShared/spi/UIKitTestSPI.h:
* WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj:
* WebKitTestRunner/ios/HIDDebugTouchWindow.h: Added.
* WebKitTestRunner/ios/HIDDebugTouchWindow.mm: Added.
(+[HIDDebugTouchWindow sharedHIDDebugTouchWindow]):
(-[HIDDebugTouchWindow init]):
(-[HIDDebugTouchWindow dealloc]):
(-[HIDDebugTouchWindow updateDebugIndicatorForTouch:withPointInWindowCoordinates:isTouching:]):
(-[HIDDebugTouchWindow initDebugViewsIfNeeded]):
* WebKitTestRunner/ios/HIDEventGenerator.h:
* WebKitTestRunner/ios/HIDEventGenerator.mm:
(-[HIDEventGenerator init]):
(-[HIDEventGenerator _createIOHIDEventWithInfo:]):
(-[HIDEventGenerator _createIOHIDEventType:]):
(-[HIDEventGenerator _updateTouchPoints:count:]):
(-[HIDEventGenerator touchDownAtPoints:touchCount:]):
(-[HIDEventGenerator touchDown:touchCount:]):
(-[HIDEventGenerator liftUpAtPoints:touchCount:]):
(-[HIDEventGenerator liftUp:touchCount:]):
(-[HIDEventGenerator moveToPoints:touchCount:duration:]):
(-[HIDEventGenerator initDebugViewsIfNeeded]): Deleted.
(-[HIDEventGenerator updateDebugIndicatorForTouch:withPoint:isTouching:]): Deleted.
* WebKitTestRunner/ios/TestControllerIOS.mm:
(WTR::TestController::updatePlatformSpecificTestOptionsForTest const):

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

2 years agoHave TextDecorationPainter hold an OptionSet of decorations
dbates@webkit.org [Wed, 4 Oct 2017 23:58:02 +0000 (23:58 +0000)]
Have TextDecorationPainter hold an OptionSet of decorations
https://bugs.webkit.org/show_bug.cgi?id=177889

Reviewed by Simon Fraser.

Currently TextDecorationPainter implicitly maintains the set of one or more TextDecoration
flags in a instance variable bitmask of type TextDecoration. Instead we should represent
this set explicitly as an OptionSet to improve readability of the code.

For now we have the TextDecorationPainter constructor and TextDecorationPainter::stylesForRenderer()
to take the set of decorations as an unsigned value to avoid the need to update callers.
We will look to apply a similar change throughout the code in <https://bugs.webkit.org/show_bug.cgi?id=176844>.

No functionality changed. So, no new tests.

* rendering/TextDecorationPainter.cpp:
(WebCore::TextDecorationPainter::TextDecorationPainter): For now, changed data type for passed
decorations from TextDecoration to unsigned to convey that it is a bitmask.
(WebCore::TextDecorationPainter::paintTextDecoration): Renamed linesAreOpaque to areLinesOpaque
while I am here. Fixed some minor style issues.
(WebCore::collectStylesForRenderer): Modified to take the remaining decorations as an OptionSet,
and removed an unnecessary copy of these decorations by taking advantage of the fact that they
are passed by value.
(WebCore::TextDecorationPainter::stylesForRenderer): Convert the passed decorations to an OptionSet as needed to
pass to collectStylesForRenderer().
* rendering/TextDecorationPainter.h: Change m_decoration from TextDecoration to OptionSet<TextDecoration>
and rename it to m_decorations to reflect that it is used as a set of one or more TextDecoration flags.
Also remove unnecessary initializer for m_isPrinting while I am here and group it with the other boolean,
m_isHorizontal. There is exactly one constructor for this class and it initializes m_isPrinting.

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

2 years agoWeb Inspector: Improve CanvasManager recording events
mattbaker@apple.com [Wed, 4 Oct 2017 23:51:47 +0000 (23:51 +0000)]
Web Inspector: Improve CanvasManager recording events
https://bugs.webkit.org/show_bug.cgi?id=177762

Reviewed by Devin Rousso.

Source/JavaScriptCore:

* inspector/protocol/Canvas.json:
Renamed events for clarity and consistency; made recording data optional.

Source/WebCore:

Dispatch Canvas.recordingFinished regardless of whether any actions were
recorded. Without this extra guarantee, the frontend has to keep track
of additional state to determine whether a recording is in progress.

* inspector/InspectorCanvasAgent.cpp:
(WebCore::InspectorCanvasAgent::startRecording):
(WebCore::InspectorCanvasAgent::stopRecording):
(WebCore::InspectorCanvasAgent::didFinishRecordingCanvasFrame):
(WebCore::InspectorCanvasAgent::requestRecording): Deleted.
(WebCore::InspectorCanvasAgent::cancelRecording): Deleted.
* inspector/InspectorCanvasAgent.h:

Source/WebInspectorUI:

* UserInterface/Controllers/CanvasManager.js:
(WI.CanvasManager.prototype.startRecording):
(WI.CanvasManager.prototype.stopRecording):
(WI.CanvasManager.prototype.recordingFinished):
Replace the RecordingFinished event with a pair of events. RecordingStarted
is sent when CanvasAgent.startRecording succeeds. RecordingStopped is
sent when a recordingFinished event is received from the backend, or
when a call to CanvasAgent.stopRecording fails.

* UserInterface/Views/CanvasContentView.js:
(WI.CanvasContentView.prototype.initialLayout):
(WI.CanvasContentView.prototype._toggleRecording):
(WI.CanvasContentView.prototype._recordingStarted):
(WI.CanvasContentView.prototype._recordingFinished): Deleted.
Update recording status when CanvasManager fires recording events,
instead of immediately after clicking the record button.

LayoutTests:

Update tests for renamed CanvasManager event.

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

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

2 years agoAX: Make video objects accessible on iOS
n_wang@apple.com [Wed, 4 Oct 2017 23:43:13 +0000 (23:43 +0000)]
AX: Make video objects accessible on iOS
https://bugs.webkit.org/show_bug.cgi?id=177788
<rdar://problem/34778028>

Reviewed by Chris Fleizach.

Source/WebCore:

Exposed certain <video> elements on iOS:
1. If they have no controls attribute set and have playsinline attribute set, that means
   normally there are custom controls provided.
2. Without autoplay attribute set. From iOS 10, with the motivation to improve performace by
   replacing GIF with <video>, elements will now honor the autoplay attribute if they
   have no audio. So normally those <video> elements are not interactive.

Also provided functions to let iOS users interact with the video elements:
- Play/Pause: accessibilityActivate
- Fast forward: accessibilityIncrement
- Rewind: accessibilityDecrement

Test: accessibility/ios-simulator/video-elements-ios.html

* WebCore.xcodeproj/project.pbxproj:
* accessibility/AXObjectCache.cpp:
(WebCore::createFromRenderer):
* accessibility/AccessibilityMediaObject.cpp: Added.
(WebCore::AccessibilityMediaObject::AccessibilityMediaObject):
(WebCore::AccessibilityMediaObject::~AccessibilityMediaObject):
(WebCore::AccessibilityMediaObject::create):
(WebCore::AccessibilityMediaObject::computeAccessibilityIsIgnored const):
(WebCore::AccessibilityMediaObject::mediaElement const):
(WebCore::AccessibilityMediaObject::stringValue const):
(WebCore::AccessibilityMediaObject::interactiveVideoDuration const):
(WebCore::AccessibilityMediaObject::mediaSeek):
(WebCore::AccessibilityMediaObject::toggleMute):
(WebCore::AccessibilityMediaObject::increment):
(WebCore::AccessibilityMediaObject::decrement):
(WebCore::AccessibilityMediaObject::press):
(WebCore::AccessibilityMediaObject::hasControlsAttributeSet const):
(WebCore::AccessibilityMediaObject::isPlaying const):
(WebCore::AccessibilityMediaObject::isMuted const):
(WebCore::AccessibilityMediaObject::isAutoplayEnabled const):
(WebCore::AccessibilityMediaObject::isPlayingInline const):
(WebCore::AccessibilityMediaObject::enterFullscreen const):
* accessibility/AccessibilityMediaObject.h: Added.
* accessibility/AccessibilityObject.cpp:
* accessibility/AccessibilityObject.h:
(WebCore::AccessibilityObject::isMediaObject const):
* accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
(-[WebAccessibilityObjectWrapper accessibilityIsWebInteractiveVideo]):
(-[WebAccessibilityObjectWrapper interactiveVideoDescription]):
(-[WebAccessibilityObjectWrapper accessibilityIsMediaPlaying]):
(-[WebAccessibilityObjectWrapper accessibilityIsMediaMuted]):
(-[WebAccessibilityObjectWrapper accessibilityToggleMuteForMedia]):
(-[WebAccessibilityObjectWrapper accessibilityVideoEnterFullscreen]):
(-[WebAccessibilityObjectWrapper determineIsAccessibilityElement]):
(-[WebAccessibilityObjectWrapper stringValueShouldBeUsedInLabel]):
(-[WebAccessibilityObjectWrapper accessibilityLabel]):

LayoutTests:

* accessibility/ios-simulator/video-elements-ios-expected.txt: Added.
* accessibility/ios-simulator/video-elements-ios.html: Added.

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

2 years agoInclude Pasteboard.h for all in WebCoreArgumentCoders
don.olmstead@sony.com [Wed, 4 Oct 2017 23:27:45 +0000 (23:27 +0000)]
Include Pasteboard.h for all in WebCoreArgumentCoders
https://bugs.webkit.org/show_bug.cgi?id=177902

Reviewed by Alex Christensen.

* Shared/WebCoreArgumentCoders.cpp:

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

2 years agoAdd basic support for the version of DataTransferItemList.add that takes a File
wenson_hsieh@apple.com [Wed, 4 Oct 2017 22:28:08 +0000 (22:28 +0000)]
Add basic support for the version of DataTransferItemList.add that takes a File
https://bugs.webkit.org/show_bug.cgi?id=177853
<rdar://problem/34807346>

Reviewed by Ryosuke Niwa.

Source/WebCore:

Adds very basic support for DataTransferItemList.add(File). So far, a File added in this way can only be read
back from the same DataTransfer, during dragstart or copy. This File isn't written to the platform pasteboard
yet, so even dropping or pasting in the same page will not transfer the File, but this brings us closer to
parity with other browsers. See per-method comments for details.

Tests: editing/pasteboard/data-transfer-item-list-add-file-multiple-times.html
       editing/pasteboard/data-transfer-item-list-add-file-on-copy.html
       editing/pasteboard/data-transfer-item-list-add-file-on-drag.html

* dom/DataTransfer.cpp:
(WebCore::DataTransfer::updateFileList):

Recompute the DataTransfer's FileList. This behaves the same way as destroying the FileList altogether and
building it from scratch, but we avoid that approach because the FileList object needs to maintain the same DOM
wrapper after a File-backed item is removed.

(WebCore::DataTransfer::itemListDidAddFile):

Add the newly appended DataTransferItem's File to the DataTransfer's FileList.

(WebCore::DataTransfer::types const):

Return only the "Files" type if there are file-backed items in the DataTransfer's item list.

(WebCore::DataTransfer::updatedFilesForFileList const):
(WebCore::DataTransfer::files const):
* dom/DataTransfer.h:
* dom/DataTransferItem.h:
(WebCore::DataTransferItem::file const):
* dom/DataTransferItemList.cpp:
(WebCore::DataTransferItemList::add):
(WebCore::DataTransferItemList::remove):
(WebCore::DataTransferItemList::clear):

When removing a File, only clear from the DataTransfer's pasteboard if the removed item is not a File (otherwise,
clearing a File that shares the same type as some other item in the pasteboard will erroneously clear that other
item as well). Additionally, call out to the DataTransfer to update the FileList.

* dom/DataTransferItemList.h:
(WebCore::DataTransferItemList::hasItems const):
(WebCore::DataTransferItemList::items const):

Add helpers for directly accessing an item list's items. items() should be used in conjunction with hasItems().
This route is taken to (1) avoid having to copy the vector of Files, and (2) to avoid generating m_items if it
doesn't already exist.

LayoutTests:

Add tests to verify that Files can be added to and removed from the DataTransferItemList, and also read back via
both the item list and the DataTransfer's FileList when copying and dragging. Additionally, adds a test that adds
and removes the same File to the DataTransferItemList multiple times.

* TestExpectations:
* editing/pasteboard/data-transfer-item-list-add-file-multiple-times-expected.txt: Added.
* editing/pasteboard/data-transfer-item-list-add-file-multiple-times.html: Added.
* editing/pasteboard/data-transfer-item-list-add-file-on-copy-expected.txt: Added.
* editing/pasteboard/data-transfer-item-list-add-file-on-copy.html: Added.
* editing/pasteboard/data-transfer-item-list-add-file-on-drag-expected.txt: Added.
* editing/pasteboard/data-transfer-item-list-add-file-on-drag.html: Added.
* platform/ios-simulator-wk1/TestExpectations:
* platform/mac-wk1/TestExpectations:

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

2 years agoRenderMultiColumnFlow populate/evacuate should not disable layout state.
zalan@apple.com [Wed, 4 Oct 2017 21:29:50 +0000 (21:29 +0000)]
RenderMultiColumnFlow populate/evacuate should not disable layout state.
https://bugs.webkit.org/show_bug.cgi?id=177894
<rdar://problem/34818696>

Reviewed by Antti Koivisto.

Populate/evacuate methods are not called at layout time.

Covered by existing tests.

* rendering/RenderMultiColumnFlow.cpp:
(WebCore::RenderMultiColumnFlow::populate):
(WebCore::RenderMultiColumnFlow::evacuateAndDestroy):

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

2 years agoRemove unused variables in lambdas for network process cache
ddkilzer@apple.com [Wed, 4 Oct 2017 21:15:32 +0000 (21:15 +0000)]
Remove unused variables in lambdas for network process cache
<https://webkit.org/b/177878>
<rdar://problem/34038482>

Reviewed by Tim Horton.

* NetworkProcess/cache/CacheStorageEngine.cpp:
(WebKit::CacheStorage::Engine::open):
(WebKit::CacheStorage::Engine::putRecords):
(WebKit::CacheStorage::Engine::deleteMatchingRecords):
* NetworkProcess/cache/CacheStorageEngineConnection.cpp:
(WebKit::CacheStorageEngineConnection::reference):
- Remove unused |this| from lambda captures.

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

2 years agoWTF: Update std::expected to match current proposal
jfbastien@apple.com [Wed, 4 Oct 2017 20:54:26 +0000 (20:54 +0000)]
WTF: Update std::expected to match current proposal
https://bugs.webkit.org/show_bug.cgi?id=177881

Reviewed by Mark Lam.

Source/JavaScriptCore:

Update API.

* wasm/WasmB3IRGenerator.cpp:
* wasm/WasmModule.cpp:
(JSC::Wasm::makeValidationResult):
* wasm/WasmParser.h:
* wasm/WasmValidate.cpp:
* wasm/generateWasmValidateInlinesHeader.py:
(loadMacro):
(storeMacro):

Source/WTF:

The proposal is likely to be in C++20 and I've been asked to help co-champion
it. I'm therefore updating our implementation to more closely match the current
proposal, and to make sure it'll work for us if standardized.

 - Rename UnexpectedType to Unexpected to match the proposal.
 - Remove relational operators, only equality / inequality remains.
 - Fix minor type signatures.
 - Add UnexpectedType typedef.
 - Uncomment rebind implementation.
 - Add in-place construction tag, as well as explicit error construction tag.
 - Add template unexpected constructor.
 - Note that make_unexpected isn't in the proposal anymore, but we keep it because we don't have C++17 deduction guides.
 - Remove hashing, which isn't in the proposal anymore.

* wtf/Expected.h:
(WTF::Unexpected::Unexpected):
(WTF::Unexpected::value const):
(WTF::operator==):
(WTF::operator!=):
(WTF::makeUnexpected):
(WTF::Expected::Expected):
(WTF::Expected::operator=):
(WTF::Expected::getUnexpected const):

Tools:

The proposal is likely to be in C++20 and I've been asked to help co-champion
it. I'm therefore updating our implementation to more closely match the current
proposal, and to make sure it'll work for us if standardized.

 - Rename UnexpectedType to Unexpected to match the proposal.
 - Remove relational operators, only equality / inequality remains.
 - Fix minor type signatures.
 - Add UnexpectedType typedef.
 - Uncomment rebind implementation.
 - Add in-place construction tag, as well as explicit error construction tag.
 - Add template unexpected constructor.
 - Note that make_unexpected isn't in the proposal anymore, but we keep it because we don't have C++17 deduction guides.
 - Remove hashing, which isn't in the proposal anymore.

* TestWebKitAPI/Tests/WTF/Expected.cpp:
(WTF::operator<<):
(TestWebKitAPI::TEST):

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

2 years agoRemove failure expectation for async-func-decl-dstr-obj-id-put-unresolvable-no-strict.js.
ryanhaddad@apple.com [Wed, 4 Oct 2017 20:51:20 +0000 (20:51 +0000)]
Remove failure expectation for async-func-decl-dstr-obj-id-put-unresolvable-no-strict.js.

Unreviewed test gardening.

* test262.yaml:

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

2 years ago[WinCairo] add PLATFORM(WIN) configurations to config.h
commit-queue@webkit.org [Wed, 4 Oct 2017 20:46:53 +0000 (20:46 +0000)]
[WinCairo] add PLATFORM(WIN) configurations to config.h
https://bugs.webkit.org/show_bug.cgi?id=177846

Patch by Stephan Szabo <stephan.szabo@sony.com> on 2017-10-04
Reviewed by Alex Christensen.

* config.h:

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

2 years agohttps://bugs.webkit.org/show_bug.cgi?id=177888
lforschler@apple.com [Wed, 4 Oct 2017 20:27:03 +0000 (20:27 +0000)]
https://bugs.webkit.org/show_bug.cgi?id=177888
WebKitArchiveSupport - add API Gateway to source control
This is a swagger configuration export via AWS API Gateway console.

Rubber-stamped by Alexey Proskuryakov.

* WebKitArchiveSupport/AWS-APIGateway: Added.
* WebKitArchiveSupport/AWS-APIGateway/stage-v2.json: Added.

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

2 years agoRenderMultiColumnFlow::m_beingEvacuated is redundant.
zalan@apple.com [Wed, 4 Oct 2017 20:23:10 +0000 (20:23 +0000)]
RenderMultiColumnFlow::m_beingEvacuated is redundant.
https://bugs.webkit.org/show_bug.cgi?id=177886
<rdar://problem/34815997>

Reviewed by Simon Fraser.

m_beingEvacuated was introduced to protect RenderMultiColumnFlow from triggering
remove/insert code while the column is being destroyed and the descendants are getting reparented.
However,
1. the setMultiColumnFlow(nullptr) call already protects from triggering the remove callback
2. When adding the children back to their original position, we should not be able to find
this column as the enclosing block anymore (simply because we are moving the children as siblings
to the multicol renderer)

Covered by existing tests.

* rendering/RenderMultiColumnFlow.cpp:
(WebCore::RenderMultiColumnFlow::RenderMultiColumnFlow):
(WebCore::RenderMultiColumnFlow::evacuateAndDestroy):
(WebCore::RenderMultiColumnFlow::fragmentedFlowDescendantInserted):
(WebCore::RenderMultiColumnFlow::fragmentedFlowRelativeWillBeRemoved):
* rendering/RenderMultiColumnFlow.h:

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

2 years agoWebAssembly: address no VM / JS follow-ups
jfbastien@apple.com [Wed, 4 Oct 2017 20:20:43 +0000 (20:20 +0000)]
WebAssembly: address no VM / JS follow-ups
https://bugs.webkit.org/show_bug.cgi?id=177887

Reviewed by Saam Barati.

All minor fixes, no functional changes.

* wasm/WasmB3IRGenerator.cpp:
(JSC::Wasm::B3IRGenerator::B3IRGenerator):
(JSC::Wasm::B3IRGenerator::restoreWebAssemblyGlobalState):
(JSC::Wasm::B3IRGenerator::addCurrentMemory):
(JSC::Wasm::B3IRGenerator::addCall):
(JSC::Wasm::B3IRGenerator::addCallIndirect):
* wasm/WasmContext.cpp:
(JSC::Wasm::Context::store):
* wasm/WasmMemoryMode.h:
* wasm/WasmTable.h:
* wasm/js/JSWebAssemblyInstance.cpp:
(JSC::JSWebAssemblyInstance::JSWebAssemblyInstance):
* wasm/js/JSWebAssemblyTable.cpp:
(JSC::JSWebAssemblyTable::JSWebAssemblyTable):
(JSC::JSWebAssemblyTable::grow):

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

2 years agoMark http/wpt/cache-storage/cache-quota.any.html as flaky on Windows.
pvollan@apple.com [Wed, 4 Oct 2017 20:12:15 +0000 (20:12 +0000)]
Mark http/wpt/cache-storage/cache-quota.any.html as flaky on Windows.
https://bugs.webkit.org/show_bug.cgi?id=177891

Unreviewed test gardening.

* platform/win/TestExpectations:

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

2 years agoAdd support for using Probe DFG OSR Exit behind a runtime flag.
mark.lam@apple.com [Wed, 4 Oct 2017 20:00:01 +0000 (20:00 +0000)]
Add support for using Probe DFG OSR Exit behind a runtime flag.
https://bugs.webkit.org/show_bug.cgi?id=177844
<rdar://problem/34801425>

Reviewed by Saam Barati.

Source/JavaScriptCore:

This is based on the code originally posted in https://bugs.webkit.org/show_bug.cgi?id=175144
(in r221774 and r221832) with some optimizations and bug fixes added.  The probe
based DFG OSR Exit is only enabled if Options::useProbeOSRExit() is true.  We're
landing this behind an option switch to make it easier to tune performance using
the probe based OSR exit.

* JavaScriptCore.xcodeproj/project.pbxproj:
* assembler/MacroAssembler.cpp:
(JSC::stdFunctionCallback):
* assembler/MacroAssemblerPrinter.cpp:
(JSC::Printer::printCallback):
* assembler/ProbeContext.cpp:
(JSC::Probe::executeProbe):
(JSC::Probe::flushDirtyStackPages):
* assembler/ProbeContext.h:
(JSC::Probe::Context::Context):
(JSC::Probe::Context::arg):
* assembler/ProbeFrame.h: Added.
(JSC::Probe::Frame::Frame):
(JSC::Probe::Frame::argument):
(JSC::Probe::Frame::operand):
(JSC::Probe::Frame::setArgument):
(JSC::Probe::Frame::setOperand):
(JSC::Probe::Frame::get):
(JSC::Probe::Frame::set):
* assembler/ProbeStack.cpp:
(JSC::Probe::Page::lowWatermarkFromVisitingDirtyChunks):
(JSC::Probe::Stack::Stack):
(JSC::Probe::Stack::lowWatermarkFromVisitingDirtyPages):
* assembler/ProbeStack.h:
(JSC::Probe::Stack::Stack):
(JSC::Probe::Stack::lowWatermark):
(JSC::Probe::Stack::set):
(JSC::Probe::Stack::savedStackPointer const):
(JSC::Probe::Stack::setSavedStackPointer):
(JSC::Probe::Stack::newStackPointer const): Deleted.
(JSC::Probe::Stack::setNewStackPointer): Deleted.
* bytecode/ArrayProfile.h:
(JSC::ArrayProfile::observeArrayMode):
* bytecode/CodeBlock.cpp:
(JSC::CodeBlock::updateOSRExitCounterAndCheckIfNeedToReoptimize):
* bytecode/CodeBlock.h:
(JSC::CodeBlock::addressOfOSRExitCounter): Deleted.
* bytecode/ExecutionCounter.h:
(JSC::ExecutionCounter::hasCrossedThreshold const):
(JSC::ExecutionCounter::setNewThresholdForOSRExit):
* bytecode/MethodOfGettingAValueProfile.cpp:
(JSC::MethodOfGettingAValueProfile::reportValue):
* bytecode/MethodOfGettingAValueProfile.h:
* dfg/DFGDriver.cpp:
(JSC::DFG::compileImpl):
* dfg/DFGJITCompiler.cpp:
(JSC::DFG::JITCompiler::linkOSRExits):
(JSC::DFG::JITCompiler::link):
* dfg/DFGOSRExit.cpp:
(JSC::DFG::jsValueFor):
(JSC::DFG::restoreCalleeSavesFor):
(JSC::DFG::saveCalleeSavesFor):
(JSC::DFG::restoreCalleeSavesFromVMEntryFrameCalleeSavesBuffer):
(JSC::DFG::copyCalleeSavesToVMEntryFrameCalleeSavesBuffer):
(JSC::DFG::saveOrCopyCalleeSavesFor):
(JSC::DFG::createDirectArgumentsDuringExit):
(JSC::DFG::createClonedArgumentsDuringExit):
(JSC::DFG::emitRestoreArguments):
(JSC::DFG::OSRExit::executeOSRExit):
(JSC::DFG::reifyInlinedCallFrames):
(JSC::DFG::adjustAndJumpToTarget):
(JSC::DFG::printOSRExit):
* dfg/DFGOSRExit.h:
(JSC::DFG::OSRExitState::OSRExitState):
* dfg/DFGThunks.cpp:
(JSC::DFG::osrExitThunkGenerator):
* dfg/DFGThunks.h:
* dfg/DFGVariableEventStream.cpp:
(JSC::DFG::tryToSetConstantRecovery):
(JSC::DFG::VariableEventStream::reconstruct const):
(JSC::DFG::VariableEventStream::tryToSetConstantRecovery const): Deleted.
* dfg/DFGVariableEventStream.h:
* profiler/ProfilerOSRExit.h:
(JSC::Profiler::OSRExit::incCount):
* runtime/JSCJSValue.h:
* runtime/JSCJSValueInlines.h:
* runtime/Options.h:

Tools:

Enable --useProbeOSrExit=true for dfg-eager and ftl-no-cjit-validate-sampling-profiler
test configurations.

* Scripts/run-jsc-stress-tests:

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

2 years agoUnreviewed, rolling out r222840.
ryanhaddad@apple.com [Wed, 4 Oct 2017 19:47:32 +0000 (19:47 +0000)]
Unreviewed, rolling out r222840.

This change breaks internal builds.

Reverted changeset:

"Generate a compile error if release is built without compiler
optimizations"
https://bugs.webkit.org/show_bug.cgi?id=177665
http://trac.webkit.org/changeset/222840

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

2 years agoUnreviewed, rolling out r222775.
commit-queue@webkit.org [Wed, 4 Oct 2017 19:31:38 +0000 (19:31 +0000)]
Unreviewed, rolling out r222775.
https://bugs.webkit.org/show_bug.cgi?id=177890

Significantly increased the WebKit build time (Requested by
rniwa on #webkit).

Reverted changeset:

"Build libwebrtc unit tests executables"
https://bugs.webkit.org/show_bug.cgi?id=177211
http://trac.webkit.org/changeset/222775

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

2 years agoWeb Inspector: Detail Views for resources in Network Tab
joepeck@webkit.org [Wed, 4 Oct 2017 19:17:30 +0000 (19:17 +0000)]
Web Inspector: Detail Views for resources in Network Tab
https://bugs.webkit.org/show_bug.cgi?id=177553

Reviewed by Devin Rousso.

* Localizations/en.lproj/localizedStrings.js:
* UserInterface/Main.html:
New strings and resources.

* UserInterface/Base/Main.js:
(WI._focusedContentBrowser):
Detect nested content browsers instead of only top level tab content browsers.

* UserInterface/Base/Setting.js:
Add a new global setting for which Network Detail view is preferred.

* UserInterface/Views/ContentBrowser.css:
(.content-browser > .navigation-bar .item):
(.content-browser > .navigation-bar > .item): Deleted.
Generalize a navigation item style so it works on items nested inside a group.

* UserInterface/Views/ContentBrowser.js:
(WI.ContentBrowser.prototype._updateContentViewSelectionPathNavigationItem):
(WI.ContentBrowser.prototype._updateContentViewNavigationItems):
(WI.ContentBrowser.prototype._removeAllNavigationItems):
Give ContentBrowser a way to group all ContentView specific navigation items
inside a GroupNavigationItem. This lets the client decide what to do with
those navigation items, instead of default behavior in the navigation bar.

* UserInterface/Views/ContentViewContainer.js:
(WI.ContentViewContainer.prototype.showContentView):
Avoid a flash when showContentView is called with the current content view.

* UserInterface/Views/FlexibleSpaceNavigationItem.css:
(:matches(.navigation-bar, .toolbar) .item.flexible-space.align-start > .item):
(:matches(.navigation-bar, .toolbar) .item.flexible-space.align-end > .item):
When containing a navigation item decide where you want the items to align to.

* UserInterface/Views/FlexibleSpaceNavigationItem.js:
(WI.FlexibleSpaceNavigationItem):
(WI.FlexibleSpaceNavigationItem.prototype.updateLayout):
Provide an option to embed a NavigationItem within a FlexibleSpace. Its behavior right
now is rather simple. If the embedded Item fits in the current available space it is
shown. If it doesn't fit, it is hidden and we have just a flexible space. This is used
in the network detail view's navigation bar to keep the main navigation items centered
while allowing for buttons to show up on the side without affecting the centering.

* UserInterface/Views/NavigationBar.js:
(WI.NavigationBar):
(WI.NavigationBar.prototype._mouseDown):
(WI.NavigationBar.prototype._mouseUp):
Simplify event registration. This would also help avoid cases where we
might have registered multiple mousedown handlers.

* UserInterface/Views/GroupNavigationItem.js:
(WI.GroupNavigationItem):
(WI.GroupNavigationItem.prototype.get navigationItems):
(WI.GroupNavigationItem.prototype.set navigationItems):
(WI.GroupNavigationItem.prototype.get width):
(WI.GroupNavigationItem.prototype.get minimumWidth):
(WI.GroupNavigationItem.prototype._updateItems):
* UserInterface/Views/HierarchicalPathNavigationItem.js:
(WI.HierarchicalPathNavigationItem):
(WI.HierarchicalPathNavigationItem.prototype.set components):
(WI.HierarchicalPathNavigationItem.prototype.updateLayout):
(WI.HierarchicalPathNavigationItem.prototype._updateComponentsIfNeeded):
Defer DOM modifications until layout for NavigationItems container classes
that change items/components dynamically. This reduces UI flashing in the
bar when items/components change by coalescing all DOM updates at the same
time; when the NavigationBar does its next layout.

* UserInterface/Views/NetworkResourceDetailView.css:
(.network-resource-detail):
(.network-resource-detail .navigation-bar):
(.network-resource-detail .item.close > .glyph):
(.network-resource-detail .item.close > .glyph:hover):
(.network-resource-detail .item.close > .glyph:active):
(.network .network-resource-detail .navigation-bar .item.radio.button.text-only):
(.network .network-resource-detail .navigation-bar .item.radio.button.text-only.selected):
(.network-resource-detail > .content-browser):
Styles for the detail view's navigation bar.

* UserInterface/Views/NetworkResourceDetailView.js: Added.
(WI.NetworkResourceDetailView):
(WI.NetworkResourceDetailView.prototype.get resource):
(WI.NetworkResourceDetailView.prototype.shown):
(WI.NetworkResourceDetailView.prototype.hidden):
(WI.NetworkResourceDetailView.prototype.dispose):
(WI.NetworkResourceDetailView.prototype.initialLayout):
(WI.NetworkResourceDetailView.prototype._showPreferredContentView):
(WI.NetworkResourceDetailView.prototype._showContentViewForNavigationItem):
(WI.NetworkResourceDetailView.prototype._navigationItemSelected):
(WI.NetworkResourceDetailView.prototype._handleCloseButton):
ContentBrowser with customized navigation bar. This container has a fixed
list of ContentViews all relating to the Resource. The detail view has
a single delegate method for its close button. Since it maintains a
ContentBrowser it needs to expose shown/hidden/dispose logic to ensure
proper ContentView lifecycle events.

* UserInterface/Views/NetworkTableContentView.css:
(.showing-detail .table .cell:not(.name)):
(.showing-detail .table .resizer:not(:first-of-type)):
* UserInterface/Views/NetworkTableContentView.js:
(WI.NetworkTableContentView):
(WI.NetworkTableContentView.prototype.shown):
(WI.NetworkTableContentView.prototype.hidden):
(WI.NetworkTableContentView.prototype.closed):
(WI.NetworkTableContentView.prototype.reset):
(WI.NetworkTableContentView.prototype.networkResourceDetailViewClose):
(WI.NetworkTableContentView.prototype.tableSortChanged):
(WI.NetworkTableContentView.prototype.tableCellClicked):
(WI.NetworkTableContentView.prototype.tableSelectedRowChanged):
(WI.NetworkTableContentView.prototype.layout):
(WI.NetworkTableContentView.prototype._hideResourceDetailView):
(WI.NetworkTableContentView.prototype._showResourceDetailView):
(WI.NetworkTableContentView.prototype._positionDetailView):
(WI.NetworkTableContentView.prototype._updateFilteredEntries):
(WI.NetworkTableContentView.prototype._typeFilterScopeBarSelectionChanged):
(WI.NetworkTableContentView.prototype._restoreSelectedRow):
(WI.NetworkTableContentView.prototype._tableNameColumnDidChangeWidth):
Behavior for selecting a row and showing / hiding the detail view.
The detail view is positioned beside the Network Table's "name" column
and resizes when that column resizes.

* UserInterface/Views/Resizer.css:
(.resizer):
* UserInterface/Views/Table.css:
(.table > .resizers):
* UserInterface/Views/Table.js:
(WI.Table):
(WI.Table.prototype.get scrollContainer):
(WI.Table.prototype._positionResizerElements):
To let clients customize the table a bit, put resizers into their own
container and expose the scroll container.

* UserInterface/Views/Variables.css:
(:root):
Add a new button hover color, slightly lighter than the existing button active color.

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

2 years agoFix typo.
antti@apple.com [Wed, 4 Oct 2017 18:59:04 +0000 (18:59 +0000)]
Fix typo.

Unreviewed.

* rendering/RenderView.cpp:
(WebCore::RenderView::willBeDestroyed):

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

2 years ago3 poly-proto JSC tests timing out on debug after r222827
sbarati@apple.com [Wed, 4 Oct 2017 18:56:32 +0000 (18:56 +0000)]
3 poly-proto JSC tests timing out on debug after r222827
https://bugs.webkit.org/show_bug.cgi?id=177880

Rubber stamped by Mark Lam.

* microbenchmarks/poly-proto-access.js:
* typeProfiler/deltablue-for-of.js:
* typeProfiler/getter-richards.js:

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

2 years agoWeb Inspector: Fix Beacon and Ping folderization issues
joepeck@webkit.org [Wed, 4 Oct 2017 18:55:19 +0000 (18:55 +0000)]
Web Inspector: Fix Beacon and Ping folderization issues
https://bugs.webkit.org/show_bug.cgi?id=177885

Reviewed by Matt Baker.

* Localizations/en.lproj/localizedStrings.js:
* UserInterface/Views/NetworkTableContentView.js:
(WI.NetworkTableContentView.shortDisplayNameForResourceType):
Use common capitalized UIString "Ping". It gets lowercased later.

* UserInterface/Models/ResourceCollection.js:
Add missing verifier.

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

2 years agoTeach TextDecorationPainter about pseudo styles
dbates@webkit.org [Wed, 4 Oct 2017 18:55:14 +0000 (18:55 +0000)]
Teach TextDecorationPainter about pseudo styles
https://bugs.webkit.org/show_bug.cgi?id=177882

Reviewed by Simon Fraser.

As a step towards implementing support for CSS pseudo elements ::spelling-error and ::grammar-error
(https://bugs.webkit.org/show_bug.cgi?id=175784) teach TextDecorationPainter about pseudo styles.

* rendering/TextDecorationPainter.cpp:
(WebCore::TextDecorationPainter::TextDecorationPainter): Modified to take an optional
pseudo style (defaults to NOPSEUDO - no pseudo style).
(WebCore::collectStylesForRenderer): Modified to take a pseudo style. Note that getCachedPseudoStyle()
is only defined on RenderText and RenderElement objects (i.e. it is not a virtual function on RenderObject).
So, we must explicitly type check the renderer and cast appropriately before calling it. We may want
to consider making it virtual in the future if we find there are more call sites that would benefit
from polymorphism.
(WebCore::TextDecorationPainter::stylesForRenderer): Modified to take an optional
pseudo style (defaults to NOPSEUDO - no pseudo style).
* rendering/TextDecorationPainter.h:

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

2 years agoAdd assert verifying all renderers get destroyed
antti@apple.com [Wed, 4 Oct 2017 18:52:08 +0000 (18:52 +0000)]
Add assert verifying all renderers get destroyed
https://bugs.webkit.org/show_bug.cgi?id=177870

Reviewed by Zalan Bujtas.

* rendering/RenderView.cpp:
(WebCore::RenderView::willBeDestroyed):

    Add assert to verify all renderers for this tree have been destroyed before the RenderView is.

* rendering/RenderView.h:

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

2 years agoTextDecorationPainter::m_wavyOffset should be a float
dbates@webkit.org [Wed, 4 Oct 2017 18:37:47 +0000 (18:37 +0000)]
TextDecorationPainter::m_wavyOffset should be a float
https://bugs.webkit.org/show_bug.cgi?id=177883

Reviewed by Simon Fraser.

In r194447 we extracted the text decoration painting code from InlineTextBox into
TextDecorationPainter and changed the data type of the wavy offset from float to int.
We use floating point numbers throughout the painting code and should store the wavy
offset as a float.

* rendering/TextDecorationPainter.cpp:
(WebCore::TextDecorationPainter::TextDecorationPainter): Use C++ uniform initializer
syntax to initialize member fields.
(WebCore::TextDecorationPainter::paintTextDecoration): Change int to float.
* rendering/TextDecorationPainter.h: Remove unnecessary equal initializer for m_wavyOffset
as this class has exactly one constructor and it always initializes it.

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

2 years agoWeb Inspector: Remove unused `representedObject` parameter from GeneralTreeElementPat...
mattbaker@apple.com [Wed, 4 Oct 2017 18:32:28 +0000 (18:32 +0000)]
Web Inspector: Remove unused `representedObject` parameter from GeneralTreeElementPathComponent constructor
https://bugs.webkit.org/show_bug.cgi?id=177561

Reviewed by Joseph Pecoraro.

* UserInterface/Views/GeneralTreeElementPathComponent.js:
(WI.GeneralTreeElementPathComponent):
(WI.GeneralTreeElementPathComponent.prototype.get generalTreeElement):
(WI.GeneralTreeElementPathComponent.prototype.get previousSibling):
(WI.GeneralTreeElementPathComponent.prototype.get nextSibling):

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

2 years agoWeb Inspector: After enabling the new Network Tab in experimental settings, the netwo...
commit-queue@webkit.org [Wed, 4 Oct 2017 18:30:38 +0000 (18:30 +0000)]
Web Inspector: After enabling the new Network Tab in experimental settings, the network tab disappears
https://bugs.webkit.org/show_bug.cgi?id=177774
<rdar://problem/34771647>

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

* UserInterface/Views/SettingsTabContentView.js:
When enabling the new network tab, ensure it gets added to the list of open tabs.
Place it where the old network tab was so the UI is as consistent as possible.

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

2 years agoUnreviewed, marking tco-catch.js as a failure after test262 update
joepeck@webkit.org [Wed, 4 Oct 2017 17:57:22 +0000 (17:57 +0000)]
Unreviewed, marking tco-catch.js as a failure after test262 update
https://bugs.webkit.org/show_bug.cgi?id=177859

* test262.yaml:

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

2 years agoRemove OpenWebRTC backend
commit-queue@webkit.org [Wed, 4 Oct 2017 17:50:07 +0000 (17:50 +0000)]
Remove OpenWebRTC backend
https://bugs.webkit.org/show_bug.cgi?id=177868

Patch by Youenn Fablet <youenn@apple.com> on 2017-10-04
Reviewed by Alejandro G. Castro.

Source/WebCore:

* CMakeLists.txt:
* DerivedSources.make:
* Modules/mediastream/MediaEndpointPeerConnection.cpp: Removed.
* Modules/mediastream/MediaEndpointPeerConnection.h: Removed.
* Modules/mediastream/MediaEndpointSessionDescription.cpp: Removed.
* Modules/mediastream/MediaEndpointSessionDescription.h: Removed.
* Modules/mediastream/SDPProcessor.cpp: Removed.
* Modules/mediastream/SDPProcessor.h: Removed.
* Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
* WebCore.xcodeproj/project.pbxproj:
* platform/GStreamer.cmake:
* platform/graphics/MediaPlayer.cpp:
(WebCore::buildMediaEnginesVector):
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::supportsType):
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerOwr.cpp: Removed.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerOwr.h: Removed.
* platform/mediastream/MediaEndpoint.cpp: Removed.
* platform/mediastream/MediaEndpoint.h: Removed.
* platform/mediastream/MediaEndpointSessionConfiguration.h: Removed.
* platform/mediastream/SDPProcessorScriptResource.cpp: Removed.
* platform/mediastream/SDPProcessorScriptResource.h: Removed.
* platform/mediastream/openwebrtc/MediaEndpointOwr.cpp: Removed.
* platform/mediastream/openwebrtc/MediaEndpointOwr.h: Removed.
* platform/mediastream/openwebrtc/OpenWebRTCUtilities.cpp: Removed.
* platform/mediastream/openwebrtc/OpenWebRTCUtilities.h: Removed.
* platform/mediastream/openwebrtc/RealtimeAudioSourceOwr.h: Removed.
* platform/mediastream/openwebrtc/RealtimeMediaSourceCenterOwr.cpp: Removed.
* platform/mediastream/openwebrtc/RealtimeMediaSourceCenterOwr.h: Removed.
* platform/mediastream/openwebrtc/RealtimeMediaSourceOwr.cpp: Removed.
* platform/mediastream/openwebrtc/RealtimeMediaSourceOwr.h: Removed.
* platform/mediastream/openwebrtc/RealtimeVideoSourceOwr.h: Removed.
* platform/mock/MockMediaEndpoint.cpp: Removed.
* platform/mock/MockMediaEndpoint.h: Removed.
* platform/mock/MockRealtimeMediaSource.cpp:
(WebCore::MockRealtimeMediaSource::MockRealtimeMediaSource):
* platform/mock/MockRealtimeMediaSource.h:
* testing/Internals.cpp:
(WebCore::Internals::Internals):
(WebCore::Internals::enableMockMediaEndpoint): Deleted.
* testing/Internals.h:

LayoutTests:

* platform/gtk/TestExpectations:

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

2 years agoRemove RenderTreeInternalMutationScope
zalan@apple.com [Wed, 4 Oct 2017 17:48:39 +0000 (17:48 +0000)]
Remove RenderTreeInternalMutationScope
https://bugs.webkit.org/show_bug.cgi?id=177875
<rdar://problem/34813088>

Reviewed by Antti Koivisto.

RenderTree mutation is in the past now. -and we've got assertions in place.

Not testable.

* page/FrameView.cpp:
(WebCore::FrameView::layout):
* rendering/RenderMultiColumnFlow.cpp:
(WebCore::RenderMultiColumnFlow::populate):
(WebCore::RenderMultiColumnFlow::evacuateAndDestroy):
* rendering/RenderQuote.cpp:
(WebCore::RenderQuote::updateTextRenderer):
(WebCore::RenderQuote::updateRenderer):
* rendering/RenderView.h:
(WebCore::RenderTreeInternalMutationScope::RenderTreeInternalMutationScope): Deleted.
(WebCore::RenderTreeInternalMutationScope::~RenderTreeInternalMutationScope): Deleted.

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

2 years agowebkitpy.tool.steps.steps_unittest.StepsTest.test_runtests_api is flakey
jbedard@apple.com [Wed, 4 Oct 2017 17:34:45 +0000 (17:34 +0000)]
webkitpy.tool.steps.steps_unittest.StepsTest.test_runtests_api is flakey
https://bugs.webkit.org/show_bug.cgi?id=177751
<rdar://problem/34769470>

Reviewed by Daniel Bates.

Port._build_path() calls Tools/Scripts/webkit-build-directory and caches this
result. When capturing output from the MockExecutive, the first invocation of
Port._build_path() will log the running of Tools/Scripts/webkit-build-directory
but subsequent invocations will not.

* Scripts/webkitpy/tool/steps/steps_unittest.py:
(StepsTest):
(StepsTest.setUp): Cache the build path before running tests.

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

2 years ago[GTK] WebKit2GTK+ does not handle touchmove and touchend events correctly
aperez@igalia.com [Wed, 4 Oct 2017 17:33:27 +0000 (17:33 +0000)]
[GTK] WebKit2GTK+ does not handle touchmove and touchend events correctly
https://bugs.webkit.org/show_bug.cgi?id=158531

Reviewed by Carlos Alberto Lopez Perez.

Do not bypass WebCore event handling when receiving touch events.

Based on a patch by Andre Moreira Magalhaes <andre.magalhaes@collabora.co.uk>.
Thanks to Carlos Garnacho <carlosg@gnome.org> for helping out reviewing the code.

* UIProcess/API/gtk/PageClientImpl.cpp:
(WebKit::PageClientImpl::doneWithTouchEvent): Make sure touchend reaches gesture controller if touchbegin evet got to it.
* UIProcess/API/gtk/WebKitWebViewBase.cpp:
(webkitWebViewBaseTouchEvent): Do not invoke gesture controller directly by bypassing WebCore event handling.
* UIProcess/gtk/GestureController.cpp:
(WebKit::GestureController::reset): Added.
(WebKit::GestureController::handleEvent): Reset gesture controller when touchpadupdate/end is received without touchbegin.
(WebKit::GestureController::Gesture::reset): Added.
* UIProcess/gtk/GestureController.h:

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

2 years agoUnreviewed GTK+ gardening. Remove tests from expectations passing since freetype...
carlosgc@webkit.org [Wed, 4 Oct 2017 17:14:24 +0000 (17:14 +0000)]
Unreviewed GTK+ gardening. Remove tests from expectations passing since freetype upgrade in r221670.

* platform/gtk/TestExpectations:

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

2 years agoUnreviewed, marking one async iterator test262 test failed
utatane.tea@gmail.com [Wed, 4 Oct 2017 17:04:26 +0000 (17:04 +0000)]
Unreviewed, marking one async iterator test262 test failed
https://bugs.webkit.org/show_bug.cgi?id=177859

* test262.yaml:

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

2 years agoRebaseline fast/xmlhttprequest/set-dangerous-headers.html and http/tests/xmlhttpreque...
ryanhaddad@apple.com [Wed, 4 Oct 2017 16:56:28 +0000 (16:56 +0000)]
Rebaseline fast/xmlhttprequest/set-dangerous-headers.html and http/tests/xmlhttprequest/set-dangerous-headers.html
https://bugs.webkit.org/show_bug.cgi?id=177829

Unreviewed test gardening.

* fast/xmlhttprequest/set-dangerous-headers-expected.txt:
* http/tests/xmlhttprequest/set-dangerous-headers-expected.txt:

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

2 years ago[JHBuild][GTK][WKE] Circular dependency between harfbuzz and freetype6
clopez@igalia.com [Wed, 4 Oct 2017 16:54:16 +0000 (16:54 +0000)]
[JHBuild][GTK][WKE] Circular dependency between harfbuzz and freetype6
https://bugs.webkit.org/show_bug.cgi?id=177865

Reviewed by Michael Catanzaro.

Build freetype6 without harfbuzz support.
This seems to be what distros like Fedora, Debian or OpenEmbedded do.
Also explicitly enable support for freetype and fontconfig on harfbuzz.

* gtk/jhbuild.modules: Enable also support for icu.
* wpe/jhbuild.modules:

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

2 years agoUnreviewed: fix GTK debug build after r222841.
magomez@igalia.com [Wed, 4 Oct 2017 15:18:00 +0000 (15:18 +0000)]
Unreviewed: fix GTK debug build after r222841.

* platform/image-decoders/webp/WEBPImageDecoder.cpp:
(WebCore::WEBPImageDecoder::initFrameBuffer):

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

2 years agoUnreviewed WPE gardening.
zandobersek@gmail.com [Wed, 4 Oct 2017 15:10:00 +0000 (15:10 +0000)]
Unreviewed WPE gardening.

* platform/wpe/TestExpectations: Unskip tests under http/wpt/. Manage
expectations for failures that are currently present.

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

2 years ago[Test262] Update Test262 to Oct 4 version
utatane.tea@gmail.com [Wed, 4 Oct 2017 14:42:03 +0000 (14:42 +0000)]
[Test262] Update Test262 to Oct 4 version
https://bugs.webkit.org/show_bug.cgi?id=177859

Reviewed by Sam Weinig.

JSTests:

Let's rebaseline test262. Since it includes the latest changes to ArrayIterator::next,
we no longer need to mark it skip/fail. Also this update includes bunch of BigInt tests.

* test262.yaml:
* test262/harness/promiseHelper.js: Renamed from JSTests/test262/harness/PromiseHelper.js.
(checkSequence):
* test262/harness/typeCoercion.js:
(testCoercibleToIndexZero):
(testCoercibleToIndexOne):
(testCoercibleToIndexFromIndex):
(testNotCoercibleToIndex.testPrimitiveValue):
(testNotCoercibleToInteger):
(testCoercibleToBigIntZero.testPrimitiveValue):
(testCoercibleToBigIntZero):
(testCoercibleToBigIntOne.testPrimitiveValue):
(testCoercibleToBigIntOne):
(testPrimitiveValue):
(testCoercibleToBigIntFromBigInt):
(testNotCoercibleToBigInt.testPrimitiveValue):
(testNotCoercibleToBigInt.testStringValue):
(testNotCoercibleToBigInt):
* test262/test/built-ins/Array/from/proto-from-ctor-realm.js:
* test262/test/built-ins/Array/length/define-own-prop-length-overflow-realm.js:
* test262/test/built-ins/Array/of/proto-from-ctor-realm.js:
* test262/test/built-ins/Array/proto-from-ctor-realm.js:
* test262/test/built-ins/Array/prototype/concat/create-proto-from-ctor-realm-array.js:
* test262/test/built-ins/Array/prototype/concat/create-proto-from-ctor-realm-non-array.js:
* test262/test/built-ins/Array/prototype/filter/create-proto-from-ctor-realm-array.js:
* test262/test/built-ins/Array/prototype/filter/create-proto-from-ctor-realm-non-array.js:
* test262/test/built-ins/Array/prototype/map/create-proto-from-ctor-realm-array.js:
* test262/test/built-ins/Array/prototype/map/create-proto-from-ctor-realm-non-array.js:
* test262/test/built-ins/Array/prototype/slice/create-proto-from-ctor-realm-array.js:
* test262/test/built-ins/Array/prototype/slice/create-proto-from-ctor-realm-non-array.js:
* test262/test/built-ins/Array/prototype/splice/create-proto-from-ctor-realm-array.js:
* test262/test/built-ins/Array/prototype/splice/create-proto-from-ctor-realm-non-array.js:
* test262/test/built-ins/ArrayBuffer/proto-from-ctor-realm.js:
* test262/test/built-ins/BigInt/asIntN/bigint-tobigint.js:
(testCoercibleToBigIntZero):
(testCoercibleToBigIntOne):
(testNotCoercibleToBigInt):
(MyError): Deleted.
(valueOf): Deleted.
(toString): Deleted.
(Symbol.toPrimitive): Deleted.
* test262/test/built-ins/BigInt/asIntN/bits-toindex.js:
(testCoercibleToIndexZero):
(testCoercibleToIndexOne):
(testNotCoercibleToIndex):
(MyError): Deleted.
(assert.sameValue.BigInt.asIntN.valueOf): Deleted.
(assert.sameValue.BigInt.asIntN.toString): Deleted.
(BigInt.asIntN.Symbol.toPrimitive): Deleted.
(BigInt.asIntN.valueOf): Deleted.
(BigInt.asIntN.toString): Deleted.
* test262/test/built-ins/BigInt/asUintN/arithmetic.js: Added.
* test262/test/built-ins/BigInt/asUintN/asUintN.js: Added.
* test262/test/built-ins/BigInt/asUintN/bigint-tobigint.js: Added.
(testCoercibleToBigIntZero):
(testCoercibleToBigIntOne):
(testNotCoercibleToBigInt):
* test262/test/built-ins/BigInt/asUintN/bits-toindex.js: Added.
(testCoercibleToIndexZero):
(testCoercibleToIndexOne):
(testNotCoercibleToIndex):
* test262/test/built-ins/BigInt/asUintN/length.js: Added.
* test262/test/built-ins/BigInt/asUintN/name.js: Added.
* test262/test/built-ins/BigInt/asUintN/order-of-steps.js: Added.
(bits.valueOf):
(bigint.valueOf):
* test262/test/built-ins/BigInt/prototype/valueOf/length.js: Added.
* test262/test/built-ins/BigInt/prototype/valueOf/name.js: Added.
* test262/test/built-ins/BigInt/prototype/valueOf/prop-desc.js: Added.
* test262/test/built-ins/BigInt/prototype/valueOf/return.js: Added.
* test262/test/built-ins/BigInt/prototype/valueOf/this-value-invalid-object-throws.js: Added.
* test262/test/built-ins/BigInt/prototype/valueOf/this-value-invalid-primitive-throws.js: Added.
* test262/test/built-ins/Boolean/proto-from-ctor-realm.js:
* test262/test/built-ins/DataView/proto-from-ctor-realm-sab.js:
* test262/test/built-ins/DataView/proto-from-ctor-realm.js:
* test262/test/built-ins/Date/proto-from-ctor-realm-one.js:
* test262/test/built-ins/Date/proto-from-ctor-realm-two.js:
* test262/test/built-ins/Date/proto-from-ctor-realm-zero.js:
* test262/test/built-ins/Error/proto-from-ctor-realm.js:
* test262/test/built-ins/Function/call-bind-this-realm-undef.js:
* test262/test/built-ins/Function/call-bind-this-realm-value.js:
* test262/test/built-ins/Function/internals/Call/class-ctor-realm.js:
* test262/test/built-ins/Function/internals/Construct/base-ctor-revoked-proxy-realm.js:
* test262/test/built-ins/Function/internals/Construct/derived-return-val-realm.js:
* test262/test/built-ins/Function/internals/Construct/derived-this-uninitialized-realm.js:
* test262/test/built-ins/Function/proto-from-ctor-realm.js:
* test262/test/built-ins/Function/prototype/bind/get-fn-realm.js:
* test262/test/built-ins/Function/prototype/bind/proto-from-ctor-realm.js:
* test262/test/built-ins/GeneratorFunction/proto-from-ctor-realm.js:
* test262/test/built-ins/JSON/stringify/bigint-order.js: Added.
(replacer):
(BigInt.prototype.toJSON):
* test262/test/built-ins/JSON/stringify/bigint-replacer.js: Added.
(replacer):
* test262/test/built-ins/JSON/stringify/bigint-tojson.js: Added.
(BigInt.prototype.toJSON):
* test262/test/built-ins/JSON/stringify/bigint.js:
* test262/test/built-ins/Map/proto-from-ctor-realm.js:
* test262/test/built-ins/Number/S9.3.1_A2_U180E.js:
* test262/test/built-ins/Number/S9.3.1_A3_T1_U180E.js:
* test262/test/built-ins/Number/S9.3.1_A3_T2_U180E.js:
* test262/test/built-ins/Number/proto-from-ctor-realm.js:
* test262/test/built-ins/Object/proto-from-ctor.js:
* test262/test/built-ins/Promise/proto-from-ctor-realm.js:
* test262/test/built-ins/Proxy/apply/arguments-realm.js:
* test262/test/built-ins/Proxy/apply/trap-is-not-callable-realm.js:
* test262/test/built-ins/Proxy/construct/arguments-realm.js:
* test262/test/built-ins/Proxy/construct/trap-is-not-callable-realm.js:
* test262/test/built-ins/Proxy/construct/trap-is-undefined-proto-from-ctor-realm.js:
* test262/test/built-ins/Proxy/defineProperty/desc-realm.js:
* test262/test/built-ins/Proxy/defineProperty/null-handler-realm.js:
* test262/test/built-ins/Proxy/defineProperty/targetdesc-configurable-desc-not-configurable-realm.js:
* test262/test/built-ins/Proxy/defineProperty/targetdesc-not-compatible-descriptor-not-configurable-target-realm.js:
* test262/test/built-ins/Proxy/defineProperty/targetdesc-not-compatible-descriptor-realm.js:
* test262/test/built-ins/Proxy/defineProperty/targetdesc-undefined-not-configurable-descriptor-realm.js:
* test262/test/built-ins/Proxy/defineProperty/targetdesc-undefined-target-is-not-extensible-realm.js:
* test262/test/built-ins/Proxy/defineProperty/trap-is-not-callable-realm.js:
* test262/test/built-ins/Proxy/deleteProperty/trap-is-not-callable-realm.js:
* test262/test/built-ins/Proxy/get-fn-realm.js:
* test262/test/built-ins/Proxy/get/trap-is-not-callable-realm.js:
* test262/test/built-ins/Proxy/getOwnPropertyDescriptor/result-type-is-not-object-nor-undefined-realm.js:
* test262/test/built-ins/Proxy/getOwnPropertyDescriptor/trap-is-not-callable-realm.js:
* test262/test/built-ins/Proxy/getPrototypeOf/trap-is-not-callable-realm.js:
* test262/test/built-ins/Proxy/has/trap-is-not-callable-realm.js:
* test262/test/built-ins/Proxy/isExtensible/trap-is-not-callable-realm.js:
* test262/test/built-ins/Proxy/ownKeys/return-not-list-object-throws-realm.js:
* test262/test/built-ins/Proxy/ownKeys/trap-is-not-callable-realm.js:
* test262/test/built-ins/Proxy/preventExtensions/trap-is-not-callable-realm.js:
* test262/test/built-ins/Proxy/set/trap-is-not-callable-realm.js:
* test262/test/built-ins/Proxy/setPrototypeOf/trap-is-not-callable-realm.js:
* test262/test/built-ins/RegExp/S15.10.2.12_A1_T1.js:
(i6.replace):
(i6b.replace):
* test262/test/built-ins/RegExp/dotall/with-dotall-unicode.js:
* test262/test/built-ins/RegExp/dotall/with-dotall.js:
* test262/test/built-ins/RegExp/dotall/without-dotall-unicode.js:
* test262/test/built-ins/RegExp/dotall/without-dotall.js:
* test262/test/built-ins/RegExp/proto-from-ctor-realm.js:
* test262/test/built-ins/RegExp/prototype/Symbol.split/splitter-proto-from-ctor-realm.js:
* test262/test/built-ins/RegExp/u180e.js: Added.
* test262/test/built-ins/Set/proto-from-ctor-realm.js:
* test262/test/built-ins/SharedArrayBuffer/proto-from-ctor-realm.js:
* test262/test/built-ins/String/proto-from-ctor-realm.js:
* test262/test/built-ins/String/prototype/endsWith/String.prototype.endsWith_Fail.js:
* test262/test/built-ins/String/prototype/endsWith/String.prototype.endsWith_Fail_2.js:
* test262/test/built-ins/String/prototype/endsWith/String.prototype.endsWith_Success.js:
* test262/test/built-ins/String/prototype/endsWith/String.prototype.endsWith_Success_2.js:
* test262/test/built-ins/String/prototype/endsWith/String.prototype.endsWith_Success_3.js:
* test262/test/built-ins/String/prototype/endsWith/String.prototype.endsWith_Success_4.js:
* test262/test/built-ins/String/prototype/endsWith/coerced-values-of-position.js:
* test262/test/built-ins/String/prototype/endsWith/endsWith.js:
* test262/test/built-ins/String/prototype/endsWith/length.js:
* test262/test/built-ins/String/prototype/endsWith/name.js:
* test262/test/built-ins/String/prototype/endsWith/return-abrupt-from-position-as-symbol.js:
* test262/test/built-ins/String/prototype/endsWith/return-abrupt-from-position.js:
* test262/test/built-ins/String/prototype/endsWith/return-abrupt-from-searchstring-as-symbol.js:
* test262/test/built-ins/String/prototype/endsWith/return-abrupt-from-searchstring-regexp-test.js:
* test262/test/built-ins/String/prototype/endsWith/return-abrupt-from-searchstring.js:
* test262/test/built-ins/String/prototype/endsWith/return-abrupt-from-this-as-symbol.js:
* test262/test/built-ins/String/prototype/endsWith/return-abrupt-from-this.js:
* test262/test/built-ins/String/prototype/endsWith/return-false-if-search-start-is-less-than-zero.js:
* test262/test/built-ins/String/prototype/endsWith/return-true-if-searchstring-is-empty.js:
* test262/test/built-ins/String/prototype/endsWith/searchstring-found-with-position.js:
* test262/test/built-ins/String/prototype/endsWith/searchstring-found-without-position.js:
* test262/test/built-ins/String/prototype/endsWith/searchstring-is-regexp-throws.js:
* test262/test/built-ins/String/prototype/endsWith/searchstring-not-found-with-position.js:
* test262/test/built-ins/String/prototype/endsWith/searchstring-not-found-without-position.js:
* test262/test/built-ins/String/prototype/endsWith/this-is-null-throws.js:
* test262/test/built-ins/String/prototype/endsWith/this-is-undefined-throws.js:
* test262/test/built-ins/String/prototype/includes/String.prototype.includes_FailBadLocation.js:
* test262/test/built-ins/String/prototype/includes/String.prototype.includes_FailLocation.js:
* test262/test/built-ins/String/prototype/includes/String.prototype.includes_FailMissingLetter.js:
* test262/test/built-ins/String/prototype/includes/String.prototype.includes_Success.js:
* test262/test/built-ins/String/prototype/includes/String.prototype.includes_SuccessNoLocation.js:
* test262/test/built-ins/String/prototype/includes/String.prototype.includes_lengthProp.js:
* test262/test/built-ins/String/prototype/includes/coerced-values-of-position.js:
* test262/test/built-ins/String/prototype/includes/includes.js:
* test262/test/built-ins/String/prototype/includes/length.js:
* test262/test/built-ins/String/prototype/includes/name.js:
* test262/test/built-ins/String/prototype/includes/return-abrupt-from-position-as-symbol.js:
* test262/test/built-ins/String/prototype/includes/return-abrupt-from-position.js:
* test262/test/built-ins/String/prototype/includes/return-abrupt-from-searchstring-as-symbol.js:
* test262/test/built-ins/String/prototype/includes/return-abrupt-from-searchstring-regexp-test.js:
* test262/test/built-ins/String/prototype/includes/return-abrupt-from-searchstring.js:
* test262/test/built-ins/String/prototype/includes/return-abrupt-from-this-as-symbol.js:
* test262/test/built-ins/String/prototype/includes/return-abrupt-from-this.js:
* test262/test/built-ins/String/prototype/includes/return-false-with-out-of-bounds-position.js:
* test262/test/built-ins/String/prototype/includes/return-true-if-searchstring-is-empty.js:
* test262/test/built-ins/String/prototype/includes/searchstring-found-with-position.js:
* test262/test/built-ins/String/prototype/includes/searchstring-found-without-position.js:
* test262/test/built-ins/String/prototype/includes/searchstring-is-regexp-throws.js:
* test262/test/built-ins/String/prototype/includes/searchstring-not-found-with-position.js:
* test262/test/built-ins/String/prototype/includes/searchstring-not-found-without-position.js:
* test262/test/built-ins/String/prototype/includes/this-is-null-throws.js:
* test262/test/built-ins/String/prototype/includes/this-is-undefined-throws.js:
* test262/test/built-ins/String/prototype/toLocaleLowerCase/Final_Sigma_U180E.js:
* test262/test/built-ins/String/prototype/toLowerCase/Final_Sigma_U180E.js:
* test262/test/built-ins/String/prototype/trim/u180e.js:
* test262/test/built-ins/Symbol/for/cross-realm.js:
* test262/test/built-ins/Symbol/hasInstance/cross-realm.js:
* test262/test/built-ins/Symbol/isConcatSpreadable/cross-realm.js:
* test262/test/built-ins/Symbol/iterator/cross-realm.js:
* test262/test/built-ins/Symbol/keyFor/cross-realm.js:
* test262/test/built-ins/Symbol/match/cross-realm.js:
* test262/test/built-ins/Symbol/replace/cross-realm.js:
* test262/test/built-ins/Symbol/search/cross-realm.js:
* test262/test/built-ins/Symbol/species/cross-realm.js:
* test262/test/built-ins/Symbol/split/cross-realm.js:
* test262/test/built-ins/Symbol/toPrimitive/cross-realm.js:
* test262/test/built-ins/Symbol/toStringTag/cross-realm.js:
* test262/test/built-ins/Symbol/unscopables/cross-realm.js:
* test262/test/built-ins/ThrowTypeError/distinct-cross-realm.js:
* test262/test/built-ins/TypedArrays/buffer-arg-proto-from-ctor-realm-sab.js:
* test262/test/built-ins/TypedArrays/buffer-arg-proto-from-ctor-realm.js:
* test262/test/built-ins/TypedArrays/internals/DefineOwnProperty/detached-buffer-realm.js:
* test262/test/built-ins/TypedArrays/internals/Get/detached-buffer-realm.js:
* test262/test/built-ins/TypedArrays/internals/GetOwnProperty/detached-buffer-realm.js:
* test262/test/built-ins/TypedArrays/internals/HasProperty/detached-buffer-realm.js:
* test262/test/built-ins/TypedArrays/internals/Set/detached-buffer-realm.js:
* test262/test/built-ins/TypedArrays/length-arg-proto-from-ctor-realm.js:
* test262/test/built-ins/TypedArrays/no-args-proto-from-ctor-realm.js:
* test262/test/built-ins/TypedArrays/object-arg-proto-from-ctor-realm.js:
* test262/test/built-ins/TypedArrays/typedarray-arg-other-ctor-buffer-ctor-custom-species-proto-from-ctor-realm.js:
* test262/test/built-ins/TypedArrays/typedarray-arg-proto-from-ctor-realm.js:
* test262/test/built-ins/TypedArrays/typedarray-arg-same-ctor-buffer-ctor-species-custom-proto-from-ctor-realm.js:
* test262/test/built-ins/WeakMap/proto-from-ctor-realm.js:
* test262/test/built-ins/WeakSet/proto-from-ctor-realm.js:
* test262/test/built-ins/parseFloat/S15.1.2.3_A2_T10_U180E.js:
* test262/test/built-ins/parseInt/S15.1.2.2_A2_T10_U180E.js:
* test262/test/intl402/NumberFormat/prototype/formatToParts/length.js:
* test262/test/language/comments/mongolian-vowel-separator-multi.js:
* test262/test/language/comments/mongolian-vowel-separator-single-eval.js:
* test262/test/language/comments/mongolian-vowel-separator-single.js:
* test262/test/language/eval-code/indirect/realm.js:
* test262/test/language/expressions/assignment/dstr-obj-rest-order.js: Added.
(o.get z):
(o.get a):
* test262/test/language/expressions/call/eval-realm-indirect.js:
* test262/test/language/expressions/generators/eval-body-proto-realm.js:
* test262/test/language/expressions/greater-than-or-equal/bigint-and-bigint.js: Added.
* test262/test/language/expressions/greater-than-or-equal/bigint-and-non-finite.js: Added.
* test262/test/language/expressions/greater-than-or-equal/bigint-and-number-extremes.js: Added.
* test262/test/language/expressions/greater-than-or-equal/bigint-and-number.js:
* test262/test/language/expressions/greater-than/bigint-and-bigint.js: Added.
* test262/test/language/expressions/greater-than/bigint-and-non-finite.js: Added.
* test262/test/language/expressions/greater-than/bigint-and-number-extremes.js: Added.
* test262/test/language/expressions/greater-than/bigint-and-number.js:
* test262/test/language/expressions/less-than-or-equal/bigint-and-bigint.js: Added.
* test262/test/language/expressions/less-than-or-equal/bigint-and-non-finite.js: Added.
* test262/test/language/expressions/less-than-or-equal/bigint-and-number-extremes.js: Added.
* test262/test/language/expressions/less-than-or-equal/bigint-and-number.js:
* test262/test/language/expressions/less-than/bigint-and-bigint.js: Added.
* test262/test/language/expressions/less-than/bigint-and-non-finite.js: Added.
* test262/test/language/expressions/less-than/bigint-and-number-extremes.js: Added.
* test262/test/language/expressions/less-than/bigint-and-number.js:
* test262/test/language/expressions/new/non-ctor-err-realm.js:
* test262/test/language/expressions/super/realm.js:
* test262/test/language/expressions/tagged-template/cache-realm.js:
* test262/test/language/expressions/template-literal/mongolian-vowel-separator-eval.js:
* test262/test/language/expressions/template-literal/mongolian-vowel-separator.js:
* test262/test/language/literals/regexp/mongolian-vowel-separator-eval.js:
* test262/test/language/literals/regexp/mongolian-vowel-separator.js:
* test262/test/language/literals/string/mongolian-vowel-separator-eval.js:
* test262/test/language/literals/string/mongolian-vowel-separator.js:
* test262/test/language/statements/for-of/dstr-obj-rest-order.js: Added.
(o.get z):
(o.get a):
* test262/test/language/statements/for-of/iterator-next-reference.js:
(next):
(iterator.next): Deleted.
(x.of.iterable.): Deleted.
(x.of.iterable.get return): Deleted.
(x.of.iterable.iterator.next): Deleted.
* test262/test/language/types/reference/get-value-prop-base-primitive-realm.js:
* test262/test/language/types/reference/put-value-prop-base-primitive-realm.js:
* test262/test/language/white-space/mongolian-vowel-separator-eval.js:
* test262/test/language/white-space/mongolian-vowel-separator.js:
* test262/test262-Revision.txt:

Tools:

* Scripts/import-test262-tests:

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

2 years agoRenderFragmentContainerRange should not hold raw pointers.
zalan@apple.com [Wed, 4 Oct 2017 14:37:19 +0000 (14:37 +0000)]
RenderFragmentContainerRange should not hold raw pointers.
https://bugs.webkit.org/show_bug.cgi?id=177854
<rdar://problem/34805954>

Reviewed by Antti Koivisto.

m_startFragment and m_endFragment object's lifetimes are not tied to the lifetime of
RenderFragmentContainerRange.

Covered by existing tests.

* rendering/RenderFragmentedFlow.cpp:
(WebCore::RenderFragmentedFlow::setFragmentRangeForBox):
* rendering/RenderFragmentedFlow.h:

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

2 years agoUnreviewed WPE build fix after r222837
mcatanzaro@igalia.com [Wed, 4 Oct 2017 14:24:41 +0000 (14:24 +0000)]
Unreviewed WPE build fix after r222837
https://bugs.webkit.org/show_bug.cgi?id=177449

* Shared/wpe/WebEventFactory.cpp:
(WebKit::wallTimeForEventTime):

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

2 years agoRenderMultiColumnSpannerPlaceholder should not hold raw pointers.
zalan@apple.com [Wed, 4 Oct 2017 14:14:13 +0000 (14:14 +0000)]
RenderMultiColumnSpannerPlaceholder should not hold raw pointers.
https://bugs.webkit.org/show_bug.cgi?id=177840
<rdar://problem/34800109>

Reviewed by Sam Weinig.

Though we should always have a spanner as long as there's a RenderMultiColumnSpannerPlaceholder,
the spanner inject/removal logic is complicated enough to protect them with WeakPtr.

Covered by existing tests.

* rendering/RenderMultiColumnSpannerPlaceholder.cpp:
(WebCore::RenderMultiColumnSpannerPlaceholder::RenderMultiColumnSpannerPlaceholder):
* rendering/RenderMultiColumnSpannerPlaceholder.h:

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

2 years ago[GTK] GtkUtilities.h should not be included in libs not linked to GTK
mcatanzaro@igalia.com [Wed, 4 Oct 2017 14:07:19 +0000 (14:07 +0000)]
[GTK] GtkUtilities.h should not be included in libs not linked to GTK
https://bugs.webkit.org/show_bug.cgi?id=177860

Reviewed by Carlos Garcia Campos.

* platform/FreeType.cmake:
* platform/gtk/GtkUtilities.cpp:
(WebCore::topLevelPath): Deleted.
(WebCore::webkitBuildDirectory): Deleted.
* platform/gtk/GtkUtilities.h:
(WebCore::wallTimeForEvent):
* platform/text/hyphen/HyphenationLibHyphen.cpp:
(WebCore::topLevelPath):
(WebCore::webkitBuildDirectory):

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

2 years ago[Harfbuzz] Implement ComplexTextController on top of HarfBuzz
carlosgc@webkit.org [Wed, 4 Oct 2017 13:51:19 +0000 (13:51 +0000)]
[Harfbuzz] Implement ComplexTextController on top of HarfBuzz
https://bugs.webkit.org/show_bug.cgi?id=167956

Source/WebCore:

Reviewed by Myles C. Maxfield.

Implement ComplexTextController using HarfBuzz and remove HarfBuzzShaper.

Covered by existing tests, a rebaseline will be neeed.

* platform/FreeType.cmake:
* platform/graphics/ComplexTextController.cpp:
(WebCore::TextLayoutDeleter::operator() const): Enable TextLayout when using HarfBuzz.
(WebCore::FontCascade::createLayout const): Ditto.
(WebCore::FontCascade::width): Ditto.
* platform/graphics/ComplexTextController.h:
(WebCore::ComplexTextController::ComplexTextRun::create): Add constructor that receives an hb_buffer_t.
* platform/graphics/Font.cpp:
(WebCore::Font::variantCapsSupportsCharacterForSynthesis const): Simple implementation for non-cocoa ports.
* platform/graphics/FontCascade.cpp:
(WebCore::FontCascade::getGlyphsAndAdvancesForComplexText const): Moved from FontCascadeCocoa.mm.
(WebCore::FontCascade::floatWidthForComplexText const): Ditto.
(WebCore::FontCascade::adjustSelectionRectForComplexText const): Ditto.
(WebCore::FontCascade::offsetForPositionForComplexText const): Ditto.
* platform/graphics/cairo/FontCairoHarfbuzzNG.cpp:
(WebCore::FontCascade::fontForCombiningCharacterSequence const): Normalize the sequence and get the font of the
base character.
* platform/graphics/cocoa/FontCascadeCocoa.mm:
* platform/graphics/harfbuzz/ComplexTextControllerHarfBuzz.cpp:
(WebCore::harfBuzzPositionToFloat):
(WebCore::ComplexTextController::ComplexTextRun::ComplexTextRun):
(WebCore::fontFeatures):
(WebCore::characterScript):
(WebCore::scriptsAreCompatibleForCharacters):
(WebCore::findNextRun):
(WebCore::ComplexTextController::collectComplexTextRunsForCharacters):
* platform/graphics/harfbuzz/HarfBuzzFaceCairo.cpp:
(WebCore::harfBuzzGetGlyph): Check here if the character is a white space and use the space or zeroWidthSpace
to ensure we get a glyph.
* platform/graphics/harfbuzz/HarfBuzzShaper.cpp: Removed.
* platform/graphics/harfbuzz/HarfBuzzShaper.h: Removed.
* platform/graphics/harfbuzz/HbUniquePtr.h: Added.
(WebCore::HbPtrDeleter::operator() const):
(WebCore::HbPtrDeleter<hb_font_t>::operator() const):
(WebCore::HbPtrDeleter<hb_buffer_t>::operator() const):
* platform/graphics/opentype/OpenTypeMathData.h: Use HbUniquePtr.

LayoutTests:

Unreviewed GTK+ gardening. Rebaseline tests.

* platform/gtk/css1/font_properties/font-expected.png:
* platform/gtk/css1/font_properties/font-expected.txt:
* platform/gtk/css1/pseudo/firstline-expected.png:
* platform/gtk/css1/pseudo/firstline-expected.txt:
* platform/gtk/css1/pseudo/multiple_pseudo_elements-expected.png:
* platform/gtk/css1/pseudo/multiple_pseudo_elements-expected.txt:
* platform/gtk/css2.1/t051201-c23-first-line-00-b-expected.png:
* platform/gtk/css2.1/t051201-c23-first-line-00-b-expected.txt:
* platform/gtk/css2.1/t051202-c26-psudo-nest-00-c-expected.png:
* platform/gtk/css2.1/t051202-c26-psudo-nest-00-c-expected.txt:
* platform/gtk/css2.1/t0905-c5525-fltwidth-00-c-g-expected.png:
* platform/gtk/css2.1/t0905-c5525-fltwidth-00-c-g-expected.txt:
* platform/gtk/css2.1/t1508-c527-font-00-b-expected.png:
* platform/gtk/css2.1/t1508-c527-font-00-b-expected.txt:
* platform/gtk/css2.1/t1508-c527-font-06-b-expected.png:
* platform/gtk/css2.1/t1508-c527-font-06-b-expected.txt:
* platform/gtk/css2.1/t1508-c527-font-07-b-expected.png:
* platform/gtk/css2.1/t1508-c527-font-07-b-expected.txt:
* platform/gtk/css2.1/t1508-c527-font-10-c-expected.png:
* platform/gtk/css2.1/t1508-c527-font-10-c-expected.txt:
* platform/gtk/editing/selection/vertical-rl-rtl-extend-line-backward-br-expected.png:
* platform/gtk/editing/selection/vertical-rl-rtl-extend-line-backward-br-expected.txt:
* platform/gtk/editing/selection/vertical-rl-rtl-extend-line-backward-p-expected.png:
* platform/gtk/editing/selection/vertical-rl-rtl-extend-line-backward-p-expected.txt:
* platform/gtk/editing/selection/vertical-rl-rtl-extend-line-forward-br-expected.png:
* platform/gtk/editing/selection/vertical-rl-rtl-extend-line-forward-br-expected.txt:
* platform/gtk/editing/selection/vertical-rl-rtl-extend-line-forward-p-expected.png:
* platform/gtk/editing/selection/vertical-rl-rtl-extend-line-forward-p-expected.txt:
* platform/gtk/fast/css/text-overflow-ellipsis-text-align-center-expected.png:
* platform/gtk/fast/css/text-overflow-ellipsis-text-align-center-expected.txt:
* platform/gtk/fast/css/text-overflow-ellipsis-text-align-left-expected.png:
* platform/gtk/fast/css/text-overflow-ellipsis-text-align-left-expected.txt:
* platform/gtk/fast/text/atsui-negative-spacing-features-expected.png:
* platform/gtk/fast/text/atsui-negative-spacing-features-expected.txt:
* platform/gtk/fast/text/atsui-pointtooffset-calls-cg-expected.png:
* platform/gtk/fast/text/atsui-pointtooffset-calls-cg-expected.txt:
* platform/gtk/fast/text/atsui-rtl-override-selection-expected.png:
* platform/gtk/fast/text/atsui-rtl-override-selection-expected.txt:
* platform/gtk/fast/text/atsui-spacing-features-expected.png:
* platform/gtk/fast/text/atsui-spacing-features-expected.txt:
* platform/gtk/fast/text/emphasis-expected.png:
* platform/gtk/fast/text/emphasis-expected.txt:
* platform/gtk/fast/text/international/bold-bengali-expected.png:
* platform/gtk/fast/text/international/bold-bengali-expected.txt:
* platform/gtk/fast/text/international/hebrew-vowels-expected.png:
* platform/gtk/fast/text/international/hebrew-vowels-expected.txt:
* platform/gtk/fast/text/international/thai-baht-space-expected.png:
* platform/gtk/fast/text/international/thai-baht-space-expected.txt:
* platform/gtk/fast/text/international/thai-line-breaks-expected.png:
* platform/gtk/fast/text/international/thai-line-breaks-expected.txt:
* platform/gtk/fast/text/large-text-composed-char-dos-expected.txt: Added.
* platform/gtk/svg/W3C-I18N/g-dirLTR-ubNone-expected.png:
* platform/gtk/svg/W3C-I18N/g-dirLTR-ubNone-expected.txt:
* platform/gtk/svg/W3C-I18N/g-dirLTR-ubOverride-expected.png:
* platform/gtk/svg/W3C-I18N/g-dirLTR-ubOverride-expected.txt:
* platform/gtk/svg/W3C-I18N/g-dirRTL-ubNone-expected.png:
* platform/gtk/svg/W3C-I18N/g-dirRTL-ubNone-expected.txt:
* platform/gtk/svg/W3C-I18N/g-dirRTL-ubOverride-expected.png:
* platform/gtk/svg/W3C-I18N/g-dirRTL-ubOverride-expected.txt:
* platform/gtk/svg/W3C-I18N/text-dirLTR-ubNone-expected.png:
* platform/gtk/svg/W3C-I18N/text-dirLTR-ubNone-expected.txt:
* platform/gtk/svg/W3C-I18N/text-dirLTR-ubOverride-expected.png:
* platform/gtk/svg/W3C-I18N/text-dirLTR-ubOverride-expected.txt:
* platform/gtk/svg/W3C-I18N/text-dirRTL-ubNone-expected.png:
* platform/gtk/svg/W3C-I18N/text-dirRTL-ubNone-expected.txt:
* platform/gtk/svg/W3C-I18N/text-dirRTL-ubOverride-expected.png:
* platform/gtk/svg/W3C-I18N/text-dirRTL-ubOverride-expected.txt:
* platform/gtk/svg/W3C-I18N/tspan-dirLTR-ubEmbed-in-rtl-context-expected.png:
* platform/gtk/svg/W3C-I18N/tspan-dirLTR-ubEmbed-in-rtl-context-expected.txt:
* platform/gtk/svg/W3C-I18N/tspan-dirLTR-ubNone-in-rtl-context-expected.png:
* platform/gtk/svg/W3C-I18N/tspan-dirLTR-ubNone-in-rtl-context-expected.txt:
* platform/gtk/svg/W3C-I18N/tspan-dirLTR-ubOverride-in-rtl-context-expected.png:
* platform/gtk/svg/W3C-I18N/tspan-dirLTR-ubOverride-in-rtl-context-expected.txt:
* platform/gtk/svg/W3C-I18N/tspan-dirRTL-ubOverride-in-rtl-context-expected.png:
* platform/gtk/svg/W3C-I18N/tspan-dirRTL-ubOverride-in-rtl-context-expected.txt:
* platform/gtk/svg/W3C-I18N/tspan-direction-rtl-expected.png:
* platform/gtk/svg/W3C-I18N/tspan-direction-rtl-expected.txt:
* platform/gtk/svg/text/bidi-tspans-expected.png:
* platform/gtk/svg/text/bidi-tspans-expected.txt:
* platform/gtk/svg/text/select-textLength-spacing-squeeze-1-expected.png:
* platform/gtk/svg/text/select-textLength-spacing-squeeze-1-expected.txt:
* platform/gtk/svg/text/select-textLength-spacing-squeeze-2-expected.png:
* platform/gtk/svg/text/select-textLength-spacing-squeeze-2-expected.txt:
* platform/gtk/svg/text/select-textLength-spacing-stretch-2-expected.png:
* platform/gtk/svg/text/select-textLength-spacing-stretch-2-expected.txt:
* platform/gtk/svg/text/select-textLength-spacing-stretch-3-expected.png:
* platform/gtk/svg/text/select-textLength-spacing-stretch-3-expected.txt:

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

2 years agoUnreviewed, fix typo in function name scanDirectoryForDicionaries
mcatanzaro@igalia.com [Wed, 4 Oct 2017 12:48:52 +0000 (12:48 +0000)]
Unreviewed, fix typo in function name scanDirectoryForDicionaries
https://bugs.webkit.org/show_bug.cgi?id=177866

* platform/text/hyphen/HyphenationLibHyphen.cpp:
(WebCore::scanDirectoryForDictionaries):
(WebCore::scanTestDictionariesDirectoryIfNecessary):
(WebCore::availableLocales):
(WebCore::scanDirectoryForDicionaries): Deleted.

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

2 years agoAdd animation support for WebP images
magomez@igalia.com [Wed, 4 Oct 2017 12:36:10 +0000 (12:36 +0000)]
Add animation support for WebP images
https://bugs.webkit.org/show_bug.cgi?id=113124

Reviewed by Žan Doberšek.

.:

* Source/cmake/FindWebP.cmake:

Source/WebCore:

Implement decoding of WebP animations.

Test: fast/images/animated-webp.html

* platform/graphics/ImageBackingStore.h:
(WebCore::ImageBackingStore::blendPixel):
* platform/image-decoders/webp/WEBPImageDecoder.cpp:
(WebCore::WEBPImageDecoder::WEBPImageDecoder):
(WebCore::WEBPImageDecoder::~WEBPImageDecoder):
(WebCore::WEBPImageDecoder::setData):
(WebCore::WEBPImageDecoder::repetitionCount const):
(WebCore::WEBPImageDecoder::frameBufferAtIndex):
(WebCore::WEBPImageDecoder::findFirstRequiredFrameToDecode):
(WebCore::WEBPImageDecoder::decode):
(WebCore::WEBPImageDecoder::decodeFrame):
(WebCore::WEBPImageDecoder::initFrameBuffer):
(WebCore::WEBPImageDecoder::applyPostProcessing):
(WebCore::WEBPImageDecoder::parseHeader):
(WebCore::WEBPImageDecoder::clearFrameBufferCache):
* platform/image-decoders/webp/WEBPImageDecoder.h:

LayoutTests:

Add a new test for WebP animations and skip it on ios, mac and win. Also unskip some
webp tests that are passing on gtk.

* fast/images/animated-webp-expected.html: Added.
* fast/images/animated-webp.html: Added.
* fast/images/resources/awebp00-ref.webp: Added.
* fast/images/resources/awebp00.webp: Added.
* fast/images/resources/awebp01-ref.webp: Added.
* fast/images/resources/awebp01.webp: Added.
* fast/images/resources/awebp02-ref.webp: Added.
* fast/images/resources/awebp02.webp: Added.
* fast/images/resources/awebp03-ref.webp: Added.
* fast/images/resources/awebp03.webp: Added.
* fast/images/resources/awebp04-ref.webp: Added.
* fast/images/resources/awebp04.webp: Added.
* fast/images/resources/awebp05-ref.webp: Added.
* fast/images/resources/awebp05.webp: Added.
* fast/images/resources/awebp06-ref.webp: Added.
* fast/images/resources/awebp06.webp: Added.
* fast/images/resources/awebp07-ref.webp: Added.
* fast/images/resources/awebp07.webp: Added.
* fast/images/resources/awebp08-ref.webp: Added.
* fast/images/resources/awebp08.webp: Added.
* fast/images/resources/awebp09-ref.webp: Added.
* fast/images/resources/awebp09.webp: Added.
* platform/gtk/TestExpectations:
* platform/ios/TestExpectations:
* platform/mac/TestExpectations:
* platform/win/TestExpectations:

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

2 years agoGenerate a compile error if release is built without compiler optimizations
clopez@igalia.com [Wed, 4 Oct 2017 12:08:55 +0000 (12:08 +0000)]
Generate a compile error if release is built without compiler optimizations
https://bugs.webkit.org/show_bug.cgi?id=177665

Reviewed by Michael Catanzaro.

.:

Default to RelWithDebInfo if CMAKE_BUILD_TYPE is unset.

* CMakeLists.txt:

Source/JavaScriptCore:

Pass -DRELEASE_WITHOUT_OPTIMIZATIONS to testair.cpp and testb3.cpp because
this files are compiled with -O0 for build speed reasons after r195639.

* JavaScriptCore.xcodeproj/project.pbxproj:

Source/WTF:

For GCC and Clang, generate an error at build time that will alert
the developer that she is trying to build Release without any compiler
optimization. A build time error is much better than an unexpected
"oh, WebKit is really slow ..."  situation later.

If this was intended, then we tell the developer that she can continue
by just setting -DRELEASE_WITHOUT_OPTIMIZATIONS in the list of build
flags.

The intention of this patch is to ensure that nobody builds Release
without enabling compiler optimization by mistake.

* wtf/Compiler.h:

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

2 years agoUse blob URL when pasting RTFD instead of overriding DocumentLoader
rniwa@webkit.org [Wed, 4 Oct 2017 11:06:15 +0000 (11:06 +0000)]
Use blob URL when pasting RTFD instead of overriding DocumentLoader
https://bugs.webkit.org/show_bug.cgi?id=177801
<rdar://problem/34542270>

Reviewed by Wenson Hsieh.

Source/WebCore:

Before this patch, pasting RTFD resulted in images and other subresources in RTFD are being placed
into the document using WebKit fake URL, and DocumentLoader was overridden to return the appropriate
data upon resource requests. This is bad because there is no mechanism for websites to access its content.

Like r222119 and r208451, this patch fixes thie problem by using a blob URL instead of a WebKit fake URL.
This patch also adds a Blob::create variant which takes a SharedBuffer.

API Tests: PasteRTFD

* editing/WebCorePasteboardFileReader.cpp:
(WebCore::WebCorePasteboardFileReader::readBuffer):
* editing/cocoa/WebContentReaderCocoa.mm:
(WebCore::DeferredLoadingScope): Extracted out of createFragmentAndAddResources for clarity.
(WebCore::DeferredLoadingScope::DeferredLoadingScope):
(WebCore::DeferredLoadingScope::~DeferredLoadingScope):
(WebCore::createFragmentAndAddResources): Instead of adding resources to document loader, replace each
URL in the document by a blob URL.
(WebCore::WebContentReader::readImage):
* editing/markup.cpp:
(WebCore::replaceSubresourceURLs): Added. A helper to replace each URL in the document fragment by a blob
URL created for each subresource. This won't work for iframes or srcset but that's okay for now since DOM
constructed from RTFD doesn't use either.
* editing/markup.h:
* fileapi/Blob.cpp:
(WebCore::Blob::Blob): Added a variant which takes a SharedBuffer.
* fileapi/Blob.h:
(WebCore::Blob::create): Ditto.

Source/WebKit:

Fixed the assertion failure when RTFD content is empty.

* UIProcess/Cocoa/WebPasteboardProxyCocoa.mm:
(WebKit::WebPasteboardProxy::getPasteboardBufferForType):

Tools:

Added a regression test for an assertion failure when pasting an empty RTFD as well as a test for pasting
RTFD with an image, which should result in an image element with a blob URL.

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKitCocoa/PasteImage.mm:
* TestWebKitAPI/Tests/WebKitCocoa/PasteRTFD.mm:
* TestWebKitAPI/Tests/WebKitCocoa/paste-rtfd.html:

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

2 years agoAllow building without WOFF enabled
tpopela@redhat.com [Wed, 4 Oct 2017 10:03:20 +0000 (10:03 +0000)]
Allow building without WOFF enabled

Reviewed by Michael Catanzaro.

Don't force the WOFF to be turned on, but follow what is set in cmake.

* wtf/Platform.h:

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

2 years agoREGRESSION(r222392): [WPE][GTK] Many forms tests are failing due to broken event...
mcatanzaro@igalia.com [Wed, 4 Oct 2017 09:49:24 +0000 (09:49 +0000)]
REGRESSION(r222392): [WPE][GTK] Many forms tests are failing due to broken event timestamps
https://bugs.webkit.org/show_bug.cgi?id=177449

Reviewed by Chris Dumez.

Source/WebCore:

* platform/gtk/GtkUtilities.cpp:
(WebCore::wallTimeForEvent):
* platform/gtk/GtkUtilities.h:
(WebCore::wallTimeForEvent):

Source/WebKit:

* Shared/wpe/WebEventFactory.cpp:
(WebKit::wallTimeForEventTime):

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

2 years ago[GTK][WPE] Fix playback of GIFs
magomez@igalia.com [Wed, 4 Oct 2017 09:09:00 +0000 (09:09 +0000)]
[GTK][WPE] Fix playback of GIFs
https://bugs.webkit.org/show_bug.cgi?id=176089

Reviewed by Carlos Garcia Campos.

Allow GIFImageReader to decode again already decoded frames. Thanks to this, we don't
need to delete the GIFImageReader when GIFImageDecoder::clearFrameBufferCache() is
called, and the we don't need the lock to avoid crashes in that situation.

Covered by existent tests.

* platform/image-decoders/gif/GIFImageDecoder.cpp:
(WebCore::GIFImageDecoder::clearFrameBufferCache):
(WebCore::GIFImageDecoder::decode):
* platform/image-decoders/gif/GIFImageDecoder.h:
* platform/image-decoders/gif/GIFImageReader.cpp:
(GIFImageReader::decode):

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

2 years agoUnreviewed build fix.
gns@gnome.org [Wed, 4 Oct 2017 08:38:23 +0000 (08:38 +0000)]
Unreviewed build fix.

Use different enum value for the check. UP_DEVICE_LEVEL_NORMAL is only available on newer
upower.

* platform/glib/LowPowerModeNotifierGLib.cpp:
(WebCore::LowPowerModeNotifier::updateState):

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

2 years ago[GLib] Let WebCore know of low power situations
gns@gnome.org [Wed, 4 Oct 2017 07:46:25 +0000 (07:46 +0000)]
[GLib] Let WebCore know of low power situations
https://bugs.webkit.org/show_bug.cgi?id=177810

Reviewed by Carlos Garcia Campos.

.:

WebCore can use knowledge of low power situations to throttle timers and avoid expensive
checks, lowering power usage. We can use upower's warning level to let WebCore know we are
in such a situation.

* Source/cmake/OptionsGTK.cmake: depend on upower-glib.
* Source/cmake/FindUPowerGLib.cmake: Added.

Source/WebCore:

WebCore can use knowledge of low power situations to throttle timers and avoid expensive
checks, lowering power usage. We can use upower's warning level to let WebCore know we are
in such a situation.

No tests as there is no way to mock upower.

* PlatformGTK.cmake: add new file.
* PlatformWPE.cmake: add new file.
* platform/LowPowerModeNotifier.cpp: use upower-glib to know about low power situations.
* platform/LowPowerModeNotifier.h: includes upower header as UpClient and UpDevice are not forward
declaration-friendly.
* platform/glib/LowPowerModeNotifierGLib.cpp: Added.
(WebCore::LowPowerModeNotifier::LowPowerModeNotifier):
(WebCore::LowPowerModeNotifier::updateState): update low power mode from warning-level.
(WebCore::LowPowerModeNotifier::warningLevelCallback): track upower's warning-level to know when
a low power situation occurs.
(WebCore::LowPowerModeNotifier::~LowPowerModeNotifier): stop tracking the warning-level signal.
(WebCore::LowPowerModeNotifier::isLowPowerModeEnabled const):

Tools:

* gtk/install-dependencies: add upower-glib dev packages for Debian, Arch and Fedora.

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

2 years agoAX: [ATK] aria-pressed="mixed" should be exposed via ATK_STATE_INDETERMINATE
jdiggs@igalia.com [Wed, 4 Oct 2017 07:33:08 +0000 (07:33 +0000)]
AX: [ATK] aria-pressed="mixed" should be exposed via ATK_STATE_INDETERMINATE
https://bugs.webkit.org/show_bug.cgi?id=177807

Reviewed by Chris Fleizach.

Source/WebCore:

Include toggle buttons in the element types for which the mixed state is checked
and exposed via ATK_STATE_INDETERMINATE if found. Also only do the role checks when
AccessibilityObject::isIndeterminate() has returned false.

Test: accessibility/gtk/aria-pressed-mixed-value.html

* accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
(setAtkStateSetFromCoreObject):

LayoutTests:

* accessibility/gtk/aria-pressed-mixed-value-expected.txt: Added.
* accessibility/gtk/aria-pressed-mixed-value.html: Added.

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

2 years agoAX: [ATK] ARIA tabpanel role should be exposed as ATK_ROLE_SCROLL_PANE
jdiggs@igalia.com [Wed, 4 Oct 2017 07:32:02 +0000 (07:32 +0000)]
AX: [ATK] ARIA tabpanel role should be exposed as ATK_ROLE_SCROLL_PANE
https://bugs.webkit.org/show_bug.cgi?id=177815

Reviewed by Chris Fleizach.

Source/WebCore:

Change the mapping of TabPanelRole from ATK_ROLE_PANEL to ATK_ROLE_SCROLL_PANE.

No new tests because this mapping is already covered by aria-tab-roles.html and
roles-exposed.html. The platform expectations for each test have been updated.

* accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
(atkRole):

LayoutTests:

Updated expectations to reflect new mapping.

* platform/gtk/accessibility/aria-tab-roles-expected.txt: Added.
* platform/gtk/accessibility/roles-exposed-expected.txt: Updated.

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

2 years agoUse WeakPtr in RenderFullScreen
antti@apple.com [Wed, 4 Oct 2017 06:54:20 +0000 (06:54 +0000)]
Use WeakPtr in RenderFullScreen
https://bugs.webkit.org/show_bug.cgi?id=177827

Reviewed by Zalan Bujtas.

Make Document::m_fullScreenRenderer RenderFullScreen::m_placeholder WeakPtrs
and get rid of the custom nulling code.

* dom/Document.cpp:
(WebCore::Document::destroyRenderTree):
(WebCore::Document::webkitWillEnterFullScreenForElement):
(WebCore::Document::webkitDidExitFullScreenForElement):
(WebCore::Document::setFullScreenRenderer):
(WebCore::Document::fullScreenRendererDestroyed): Deleted.
* dom/Document.h:
(WebCore::Document::fullScreenRenderer const):
* rendering/RenderFullScreen.cpp:
(WebCore::RenderFullScreen::RenderFullScreen):
(WebCore::RenderFullScreen::willBeDestroyed):
(WebCore::RenderFullScreen::createPlaceholder):
(WebCore::RenderFullScreenPlaceholder::willBeDestroyed): Deleted.
(WebCore::RenderFullScreen::setPlaceholder): Deleted.
* rendering/RenderFullScreen.h:

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

2 years agoEnable pasteboard custom data in macOS 10.12 and earlier
rniwa@webkit.org [Wed, 4 Oct 2017 05:15:29 +0000 (05:15 +0000)]
Enable pasteboard custom data in macOS 10.12 and earlier
https://bugs.webkit.org/show_bug.cgi?id=177855

Reviewed by Wenson Hsieh.

Make customPasteboardDataEnabled return true on macOS 10.12 and earlier as long as the app is Safari.

* page/Settings.cpp:
(WebCore::Settings::customPasteboardDataEnabled):

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

2 years agoSource/JavaScriptCore:
jond@apple.com [Wed, 4 Oct 2017 03:33:25 +0000 (03:33 +0000)]
Source/JavaScriptCore:
Update WebAssembly to "Supported"
https://bugs.webkit.org/show_bug.cgi?id=177831

Reviewed by Alexey Proskuryakov.

Cleaned up Async Iteration and Object rest/spread to use "In Development"
instead of "In development".

* features.json:

Source/WebCore:
Update several features to "Supported"
https://bugs.webkit.org/show_bug.cgi?id=177831

Reviewed by Alexey Proskuryakov.

Update Media Capture and Streams, Performance Observer, Resource Timing, User Timing,
Web Cryptography, and WebRTC.

* features.json:

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

2 years ago[Curl] Reimplement CurlDownload with CurlRequest
commit-queue@webkit.org [Wed, 4 Oct 2017 03:15:28 +0000 (03:15 +0000)]
[Curl] Reimplement CurlDownload with CurlRequest
https://bugs.webkit.org/show_bug.cgi?id=177779

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

Source/WebCore:

* platform/network/curl/CurlContext.cpp:
(WebCore::CurlHandle::enableAllowedProtocols):
(WebCore::CurlHandle::enableFollowLocation): Deleted.
(WebCore::CurlHandle::getEffectiveURL): Deleted.
* platform/network/curl/CurlContext.h:
* platform/network/curl/CurlDownload.cpp:
(WebCore::CurlDownload::~CurlDownload):
(WebCore::CurlDownload::init):
(WebCore::CurlDownload::start):
(WebCore::CurlDownload::cancel):
(WebCore::CurlDownload::createCurlRequest):
(WebCore::CurlDownload::curlDidReceiveResponse):
(WebCore::CurlDownload::curlDidReceiveBuffer):
(WebCore::CurlDownload::curlDidComplete):
(WebCore::CurlDownload::curlDidFailWithError):
(WebCore::CurlDownload::shouldRedirectAsGET):
(WebCore::CurlDownload::willSendRequest):
(WebCore::CurlDownload::getResponse const): Deleted.
(WebCore::CurlDownload::retain): Deleted.
(WebCore::CurlDownload::release): Deleted.
(WebCore::CurlDownload::setupTransfer): Deleted.
(WebCore::CurlDownload::didCompleteTransfer): Deleted.
(WebCore::CurlDownload::didCancelTransfer): Deleted.
(WebCore::CurlDownload::closeFile): Deleted.
(WebCore::CurlDownload::moveFileToDestination): Deleted.
(WebCore::CurlDownload::writeDataToFile): Deleted.
(WebCore::CurlDownload::didReceiveHeader): Deleted.
(WebCore::CurlDownload::didReceiveData): Deleted.
(WebCore::CurlDownload::didReceiveResponse): Deleted.
(WebCore::CurlDownload::didReceiveDataOfLength): Deleted.
(WebCore::CurlDownload::didFinish): Deleted.
(WebCore::CurlDownload::didFail): Deleted.
(WebCore::CurlDownload::writeCallback): Deleted.
(WebCore::CurlDownload::headerCallback): Deleted.
* platform/network/curl/CurlDownload.h:
(WebCore::CurlDownloadListener::didReceiveResponse):
* platform/network/curl/CurlRequest.cpp:
(WebCore::CurlRequest::didReceiveData):
(WebCore::CurlRequest::finalizeTransfer):
(WebCore::CurlRequest::enableDownloadToFile):
(WebCore::CurlRequest::getDownloadedFilePath):
(WebCore::CurlRequest::writeDataToDownloadFileIfEnabled):
(WebCore::CurlRequest::closeDownloadFile):
* platform/network/curl/CurlRequest.h:
(WebCore::CurlRequest::create):
* platform/network/curl/ResourceHandleCurlDelegate.cpp:
(WebCore::ResourceHandleCurlDelegate::createCurlRequest):
* platform/network/curl/ResourceHandleCurlDelegate.h:

Source/WebKitLegacy/win:

* WebDownload.h:
* WebDownloadCurl.cpp:
(WebDownload::init):
(WebDownload::didReceiveResponse):

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

2 years agoImplement polymorphic prototypes
sbarati@apple.com [Wed, 4 Oct 2017 01:53:18 +0000 (01:53 +0000)]
Implement polymorphic prototypes
https://bugs.webkit.org/show_bug.cgi?id=176391

Reviewed by Filip Pizlo.

JSTests:

* microbenchmarks/poly-proto-access.js: Added.
(assert):
(foo.C):
(foo.C.prototype.get bar):
(foo):
(bar):
* microbenchmarks/poly-proto-put-transition-speed.js: Added.
(assert):
(makePolyProtoObject.foo.C):
(makePolyProtoObject.foo):
(makePolyProtoObject):
(performSet):
* microbenchmarks/poly-proto-setter-speed.js: Added.
(assert):
(makePolyProtoObject.foo.C):
(makePolyProtoObject.foo.C.prototype.set p):
(makePolyProtoObject.foo):
(makePolyProtoObject):
(performSet):
* stress/constructor-with-return.js:
(i.tests.forEach.Constructor):
(i.tests.forEach):
(tests.forEach.Constructor): Deleted.
(tests.forEach): Deleted.
* stress/dom-jit-with-poly-proto.js: Added.
(assert):
(makePolyProtoObject.foo.C):
(makePolyProtoObject.foo):
(makePolyProtoObject):
(validate):
* stress/poly-proto-custom-value-and-accessor.js: Added.
(assert):
(makePolyProtoObject.foo.C):
(makePolyProtoObject.foo):
(makePolyProtoObject):
(items.forEach):
(set get for):
* stress/poly-proto-intrinsic-getter-correctness.js: Added.
(assert):
(makePolyProtoObject.foo.C):
(makePolyProtoObject.foo):
(makePolyProtoObject):
(foo):
* stress/poly-proto-miss.js: Added.
(makePolyProtoInstanceWithNullPrototype.foo.C):
(makePolyProtoInstanceWithNullPrototype.foo):
(makePolyProtoInstanceWithNullPrototype):
(assert):
(validate):
* stress/poly-proto-op-in-caching.js: Added.
(assert):
(makePolyProtoObject.foo.C):
(makePolyProtoObject.foo):
(makePolyProtoObject):
(validate):
(validate2):
* stress/poly-proto-put-transition.js: Added.
(assert):
(makePolyProtoObject.foo.C):
(makePolyProtoObject.foo):
(makePolyProtoObject):
(performSet):
(i.obj.__proto__.set p):
* stress/poly-proto-set-prototype.js: Added.
(assert):
(let.alternateProto.get x):
(let.alternateProto2.get y):
(let.alternateProto2.get x):
(foo.C):
(foo):
(validate):
* stress/poly-proto-setter.js: Added.
(assert):
(makePolyProtoObject.foo.C):
(makePolyProtoObject.foo.C.prototype.set p):
(makePolyProtoObject.foo.C.prototype.get p):
(makePolyProtoObject.foo):
(makePolyProtoObject):
(performSet):
* stress/poly-proto-using-inheritance.js: Added.
(assert):
(foo.C):
(foo.C.prototype.get baz):
(foo):
(bar.C):
(bar):
(validate):
* stress/primitive-poly-proto.js: Added.
(makePolyProtoInstance.foo.C):
(makePolyProtoInstance.foo):
(makePolyProtoInstance):
(assert):
(validate):
* stress/prototype-is-not-js-object.js: Added.
(foo.bar):
(foo):
(assert):
(validate):
* stress/try-get-by-id-poly-proto.js: Added.
(assert):
(makePolyProtoObject.foo.C):
(makePolyProtoObject.foo):
(makePolyProtoObject):
(tryGetByIdText):
(x.__proto__.get bar):
(validate):
* typeProfiler/overflow.js:

Source/JavaScriptCore:

This patch changes JSC's object model with respect to where the prototype
of an object is stored. Previously, it was always stored as
a constant value inside Structure. So an object's structure used to
always tell you what its prototype is. Anytime an object changed
its prototype, it would do a structure transition. This enables
a large class of optimizations: just by doing a structure check,
we know what the prototype is.

However, this design falls down when you have many objects that
have the same shape, but only differ in what their prototype value
is. This arises in many JS programs. A simple, and probably common, example
is when the program has a constructor inside of a function:
```
function foo() {
    class C {
        constructor() { this.field1 = 42; ...; this.fieldN = 42; }
        method1() { doStuffWith(this.field); }
        method2() { doStuffWith(this.field); }
    }
    let c = new C;
    do things with c;
    }
repeatedly call foo() here.
```

Before this patch, in the above program, each time `new C` created an
object, it would create an object with a different structure. The
reason for this is that each time foo is called, there is a new
instance of C.prototype. However, each `new C` that was created
with have identical shape sans its prototype value. This would
cause all ICs that used `c` to quickly give up on any form of caching
because they would see too many structures and give up and permanently
divert control flow to the slow path.

This patch fixes this issue by expanding the notion of where the prototype
of an object is stored. There are now two notions of where the prototype
is stored. A Structure can now be in two modes:
1. Mono proto mode. This is the same mode as we used to have. It means
the structure itself has a constant prototype value.
2. Poly proto mode. This means the structure knows nothing about the
prototype value itself. Objects with this structure store their prototype
in normal object field storage. The structure will tell you the offset of
this prototype inside the object's storage. As of today, we only reserve
inline slots for the prototype field because poly proto only occurs
for JSFinalObject. However, this will be expanded to support out of line
offsets in a future patch when we extend poly proto to work when we inherit
from builtin types like Map and Array.

In this initial patch, we do poly proto style inline caching whenever
we see an object that is poly proto or if an object in its prototype lookup
chain is poly proto. Poly proto ICs work by verifying the lookup chain
at runtime. This essentially boils down to performing structure checks
up the prototype chain. In a future patch, we're going to extend object
property condition set to work with objects that don't have poly proto bases.

Initially, accesses that have poly proto access chains will always turn
into GetById/PutById in the DFG. In a future patch, I'm going to teach
the DFG how to inline certain accesses that have poly proto in the access
chain.

One of most interesting parts about this patch is how we decide when to go
poly proto. This patch uses a profiling based approach. An IC will inform
a watchpoint that it sees an opportunity when two Structure's are structurally
the same, sans the base object's prototype. This means that two structures
have equivalent shapes all the way up the prototype chain. To support fast
structural comparison, we compute a hash for a structure based on the properties
it has. We compute this hash as we add properties to the structure. This
computation is nearly free since we always add UniquedStringImpl*'s which
already have their hashes computed. To compare structural equivalence, we
just compare hash values all the way up the prototype chain. This means we
can get hash conflicts between two structures, but it's extremely rare. First,
it'll be rare for two structures to have the same hash. Secondly, we only
consider structures originating from the same executable.

How we set up this poly proto watchpoint is crucial to its design. When we create_this
an object originating from some executable, that executable will create a Box<InlineWatchpointSet>.
Each structure that originates from this executable will get a copy of that
Box<InlineWatchpointSet>. As that structure transitions to new structures,
they too will get a copy of that Box<InilneWatchpointSet>. Therefore, when
invalidating an arbitrary structure's poly proto watchpoint, we will know
the next time we create_this from that executable that it had been
invalidated, and that we should create an object with a poly proto
structure. We also use the pointer value of this Box<InlineWatchpointSet>
to determine if two structures originated from the same executable. This
pruning will severely limit the chances of getting a hash conflict in practice.

This patch is neutral on my MBP on traditional JS benchmarks like Octane/Kraken/Sunspider.
It may be a 1-2% ARES-6 progression.

This patch is between neutral and a 9x progression on the various tests
I added. Most of the microbenchmarks are progressed by at least 50%.

* JavaScriptCore.xcodeproj/project.pbxproj:
* Sources.txt:
* builtins/BuiltinNames.cpp:
* builtins/BuiltinNames.h:
(JSC::BuiltinNames::BuiltinNames):
(JSC::BuiltinNames::underscoreProtoPrivateName const):
* bytecode/AccessCase.cpp:
(JSC::AccessCase::AccessCase):
(JSC::AccessCase::create):
(JSC::AccessCase::commit):
(JSC::AccessCase::guardedByStructureCheck const):
(JSC::AccessCase::canReplace const):
(JSC::AccessCase::dump const):
(JSC::AccessCase::visitWeak const):
(JSC::AccessCase::propagateTransitions const):
(JSC::AccessCase::generateWithGuard):
(JSC::AccessCase::generateImpl):
* bytecode/AccessCase.h:
(JSC::AccessCase::usesPolyProto const):
(JSC::AccessCase::AccessCase):
* bytecode/CodeBlock.cpp:
(JSC::CodeBlock::finishCreation):
* bytecode/GetByIdStatus.cpp:
(JSC::GetByIdStatus::computeForStubInfoWithoutExitSiteFeedback):
* bytecode/GetterSetterAccessCase.cpp:
(JSC::GetterSetterAccessCase::GetterSetterAccessCase):
(JSC::GetterSetterAccessCase::create):
* bytecode/GetterSetterAccessCase.h:
* bytecode/InternalFunctionAllocationProfile.h:
(JSC::InternalFunctionAllocationProfile::createAllocationStructureFromBase):
* bytecode/IntrinsicGetterAccessCase.cpp:
(JSC::IntrinsicGetterAccessCase::IntrinsicGetterAccessCase):
* bytecode/IntrinsicGetterAccessCase.h:
* bytecode/ModuleNamespaceAccessCase.cpp:
(JSC::ModuleNamespaceAccessCase::ModuleNamespaceAccessCase):
* bytecode/ObjectAllocationProfile.cpp: Added.
(JSC::ObjectAllocationProfile::initializeProfile):
(JSC::ObjectAllocationProfile::possibleDefaultPropertyCount):
* bytecode/ObjectAllocationProfile.h:
(JSC::ObjectAllocationProfile::clear):
(JSC::ObjectAllocationProfile::initialize): Deleted.
(JSC::ObjectAllocationProfile::possibleDefaultPropertyCount): Deleted.
* bytecode/ObjectPropertyConditionSet.cpp:
* bytecode/PolyProtoAccessChain.cpp: Added.
(JSC::PolyProtoAccessChain::create):
(JSC::PolyProtoAccessChain::needImpurePropertyWatchpoint const):
(JSC::PolyProtoAccessChain::operator== const):
(JSC::PolyProtoAccessChain::dump const):
* bytecode/PolyProtoAccessChain.h: Added.
(JSC::PolyProtoAccessChain::clone):
(JSC::PolyProtoAccessChain:: const):
(JSC::PolyProtoAccessChain::operator!= const):
(JSC::PolyProtoAccessChain::forEach const):
* bytecode/PolymorphicAccess.cpp:
(JSC::PolymorphicAccess::addCases):
(JSC::PolymorphicAccess::regenerate):
(WTF::printInternal):
* bytecode/PolymorphicAccess.h:
(JSC::AccessGenerationResult::shouldResetStub const):
(JSC::AccessGenerationState::AccessGenerationState):
* bytecode/PropertyCondition.cpp:
(JSC::PropertyCondition::isStillValidAssumingImpurePropertyWatchpoint const):
* bytecode/ProxyableAccessCase.cpp:
(JSC::ProxyableAccessCase::ProxyableAccessCase):
(JSC::ProxyableAccessCase::create):
* bytecode/ProxyableAccessCase.h:
* bytecode/PutByIdStatus.cpp:
(JSC::PutByIdStatus::computeForStubInfo):
* bytecode/StructureStubInfo.cpp:
(JSC::StructureStubInfo::addAccessCase):
* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::load):
(JSC::DFG::ByteCodeParser::parseBlock):
* dfg/DFGGraph.cpp:
(JSC::DFG::Graph::canDoFastSpread):
* dfg/DFGOperations.cpp:
* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::compileInstanceOfForObject):
(JSC::DFG::SpeculativeJIT::compileInstanceOf):
* dfg/DFGSpeculativeJIT.h:
* dfg/DFGSpeculativeJIT64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::compileInstanceOf):
* jit/JITOpcodes.cpp:
(JSC::JIT::emit_op_instanceof):
* jit/JITOpcodes32_64.cpp:
(JSC::JIT::emit_op_instanceof):
* jit/Repatch.cpp:
(JSC::tryCacheGetByID):
(JSC::tryCachePutByID):
(JSC::tryRepatchIn):
* jsc.cpp:
(WTF::DOMJITGetterBaseJSObject::DOMJITGetterBaseJSObject):
(WTF::DOMJITGetterBaseJSObject::createStructure):
(WTF::DOMJITGetterBaseJSObject::create):
(WTF::DOMJITGetterBaseJSObject::DOMJITAttribute::DOMJITAttribute):
(WTF::DOMJITGetterBaseJSObject::DOMJITAttribute::slowCall):
(WTF::DOMJITGetterBaseJSObject::DOMJITAttribute::callDOMGetter):
(WTF::DOMJITGetterBaseJSObject::customGetter):
(WTF::DOMJITGetterBaseJSObject::finishCreation):
(GlobalObject::finishCreation):
(functionCreateDOMJITGetterBaseJSObject):
* llint/LLIntSlowPaths.cpp:
(JSC::LLInt::LLINT_SLOW_PATH_DECL):
* runtime/ArrayPrototype.cpp:
(JSC::holesMustForwardToPrototype):
(JSC::fastJoin):
(JSC::arrayProtoFuncReverse):
(JSC::moveElements):
* runtime/ClonedArguments.cpp:
(JSC::ClonedArguments::createEmpty):
(JSC::ClonedArguments::createWithInlineFrame):
(JSC::ClonedArguments::createWithMachineFrame):
(JSC::ClonedArguments::createByCopyingFrom):
* runtime/CommonSlowPaths.cpp:
(JSC::SLOW_PATH_DECL):
* runtime/FunctionExecutable.cpp:
(JSC::FunctionExecutable::visitChildren):
* runtime/FunctionExecutable.h:
* runtime/FunctionRareData.cpp:
(JSC::FunctionRareData::initializeObjectAllocationProfile):
* runtime/FunctionRareData.h:
* runtime/InternalFunction.cpp:
(JSC::InternalFunction::createSubclassStructureSlow):
* runtime/JSArray.cpp:
(JSC::JSArray::fastSlice):
(JSC::JSArray::shiftCountWithArrayStorage):
(JSC::JSArray::shiftCountWithAnyIndexingType):
(JSC::JSArray::isIteratorProtocolFastAndNonObservable):
* runtime/JSArrayInlines.h:
(JSC::JSArray::canFastCopy):
* runtime/JSCJSValue.cpp:
(JSC::JSValue::dumpInContextAssumingStructure const):
* runtime/JSFunction.cpp:
(JSC::JSFunction::prototypeForConstruction):
(JSC::JSFunction::allocateAndInitializeRareData):
(JSC::JSFunction::initializeRareData):
(JSC::JSFunction::getOwnPropertySlot):
* runtime/JSFunction.h:
* runtime/JSMap.cpp:
(JSC::JSMap::isIteratorProtocolFastAndNonObservable):
(JSC::JSMap::canCloneFastAndNonObservable):
* runtime/JSObject.cpp:
(JSC::JSObject::putInlineSlow):
(JSC::JSObject::createInitialIndexedStorage):
(JSC::JSObject::createArrayStorage):
(JSC::JSObject::convertUndecidedToArrayStorage):
(JSC::JSObject::convertInt32ToArrayStorage):
(JSC::JSObject::convertDoubleToArrayStorage):
(JSC::JSObject::convertContiguousToArrayStorage):
(JSC::JSObject::ensureInt32Slow):
(JSC::JSObject::ensureDoubleSlow):
(JSC::JSObject::ensureContiguousSlow):
(JSC::JSObject::ensureArrayStorageSlow):
(JSC::JSObject::setPrototypeDirect):
(JSC::JSObject::ordinaryToPrimitive const):
(JSC::JSObject::putByIndexBeyondVectorLength):
(JSC::JSObject::putDirectIndexSlowOrBeyondVectorLength):
(JSC::JSObject::getEnumerableLength):
(JSC::JSObject::anyObjectInChainMayInterceptIndexedAccesses const):
(JSC::JSObject::prototypeChainMayInterceptStoreTo):
(JSC::JSObject::needsSlowPutIndexing const):
(JSC::JSObject::suggestedArrayStorageTransition const):
* runtime/JSObject.h:
(JSC::JSObject::finishCreation):
(JSC::JSObject::getPrototypeDirect const):
(JSC::JSObject::getPropertySlot):
* runtime/JSObjectInlines.h:
(JSC::JSObject::getPropertySlot):
(JSC::JSObject::getNonIndexPropertySlot):
(JSC::JSObject::putInlineForJSObject):
* runtime/JSPropertyNameEnumerator.h:
(JSC::propertyNameEnumerator):
* runtime/JSSet.cpp:
(JSC::JSSet::isIteratorProtocolFastAndNonObservable):
(JSC::JSSet::canCloneFastAndNonObservable):
* runtime/LazyClassStructure.h:
(JSC::LazyClassStructure::prototypeConcurrently const): Deleted.
* runtime/Operations.cpp:
(JSC::normalizePrototypeChain):
* runtime/Operations.h:
* runtime/Options.h:
* runtime/PrototypeMap.cpp:
(JSC::PrototypeMap::createEmptyStructure):
(JSC::PrototypeMap::emptyStructureForPrototypeFromBaseStructure):
(JSC::PrototypeMap::emptyObjectStructureForPrototype):
(JSC::PrototypeMap::clearEmptyObjectStructureForPrototype):
* runtime/PrototypeMap.h:
* runtime/Structure.cpp:
(JSC::Structure::Structure):
(JSC::Structure::create):
(JSC::Structure::holesMustForwardToPrototype const):
(JSC::Structure::changePrototypeTransition):
(JSC::Structure::isCheapDuringGC):
(JSC::Structure::toStructureShape):
(JSC::Structure::dump const):
(JSC::Structure::canCachePropertyNameEnumerator const):
(JSC::Structure::anyObjectInChainMayInterceptIndexedAccesses const): Deleted.
(JSC::Structure::needsSlowPutIndexing const): Deleted.
(JSC::Structure::suggestedArrayStorageTransition const): Deleted.
(JSC::Structure::prototypeForLookup const): Deleted.
(JSC::Structure::prototypeChainMayInterceptStoreTo): Deleted.
(JSC::Structure::canUseForAllocationsOf): Deleted.
* runtime/Structure.h:
* runtime/StructureChain.h:
* runtime/StructureInlines.h:
(JSC::Structure::create):
(JSC::Structure::storedPrototypeObject const):
(JSC::Structure::storedPrototypeStructure const):
(JSC::Structure::storedPrototype const):
(JSC::prototypeForLookupPrimitiveImpl):
(JSC::Structure::prototypeForLookup const):
(JSC::Structure::prototypeChain const):
(JSC::Structure::isValid const):
(JSC::Structure::add):
(JSC::Structure::setPropertyTable):
(JSC::Structure::shouldConvertToPolyProto):
* runtime/StructureRareData.h:
* runtime/TypeProfilerLog.cpp:
(JSC::TypeProfilerLog::processLogEntries):
* runtime/TypeSet.cpp:
(JSC::TypeSet::addTypeInformation):
* runtime/TypeSet.h:
* runtime/WriteBarrier.h:
(JSC::WriteBarrierBase<Unknown>::isInt32 const):

Source/WTF:

* wtf/Box.h:
(WTF::Box::operator bool const):
(WTF::Box::operator bool): Deleted.
Make Box movable. Also ensure its operator bool doesn't do an atomic increment.
* wtf/RefPtr.h:
(WTF::RefPtr::operator bool const):
Add `explicit operator bool()` for RefPtr.

Tools:

* Scripts/run-jsc-stress-tests:

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

2 years agoCorrect nullptr dereference during shutdown
bfulgham@apple.com [Wed, 4 Oct 2017 01:40:30 +0000 (01:40 +0000)]
Correct nullptr dereference during shutdown
https://bugs.webkit.org/show_bug.cgi?id=177845
<rdar://problem/33651405>

Reviewed by Chris Dumez.

It looks like the ResourceLoadStatisticsPersistentStorage destructor is calling code that attempts
to use member variables in its owning class (WebResourceLoadStatisticsStore). Since these may have
already been destroyed, they are in an invalid state when accessed.

* UIProcess/ResourceLoadStatisticsPersistentStorage.cpp:
(WebKit::ResourceLoadStatisticsPersistentStorage::~ResourceLoadStatisticsPersistentStorage): Do not call
finishAllPendingWorkSynchronously() in the destructor, since it relies on the m_memoryStore to be
a reference to completely valid object.
* UIProcess/WebResourceLoadStatisticsStore.cpp:
(WebKit::WebResourceLoadStatisticsStore::~WebResourceLoadStatisticsStore): Instead, call
'finishAllPendingWorkSynchronously' here, when the object is still in a known valid state.

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

2 years agoCreate a SPIR-V assembler
mmaxfield@apple.com [Wed, 4 Oct 2017 00:53:29 +0000 (00:53 +0000)]
Create a SPIR-V assembler
https://bugs.webkit.org/show_bug.cgi?id=177726

Reviewed by Filip Pizlo.

Khronos has released a json file containing every SPIR-V opcode and operand at
https://github.com/KhronosGroup/SPIRV-Headers/blob/master/include/spirv/1.2/spirv.core.grammar.json
This patch creates a function which loads this file (via the fetch API), parses it, and creates
an object which holds two things:
- For each opcode, a class which accepts the appropriate operands
- For each enum type, an object which holds each enum value
The constructor for each opcode is smart enough to do some basic type-checking of the argument,
according to the types listed in Khronos's json file.

This patch also includes an example .html file which outputs a dummy SPIR-V program,
which happens to be compatible with the SPIR-V demo at
https://github.com/KhronosGroup/Vulkan-LoaderAndValidationLayers/blob/master/demos/cube.cpp
If you modify this demo to use the generated SPIR-V program, you can see the result in
action.

This patch also commits a copy of Khronos's json file mentioned above. This isn't the first
Khronos file we've committed into our repository with this license, so there shouldn't be any
problems there.

* WebGPUShadingLanguageRI/SPIR-V.js: Added.
(SPIRV.):
(SPIRVAssembler):
(SPIRVAssembler.prototype.append):
(SPIRVAssembler.prototype.get size):
(SPIRVAssembler.prototype.get storage):
(SPIRVAssembler.prototype.get result):
* WebGPUShadingLanguageRI/SPIRV.html: Added.
* WebGPUShadingLanguageRI/spirv.core.grammar.json: Added.

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

2 years agoModerize WebKit's back forward list code
achristensen@apple.com [Wed, 4 Oct 2017 00:51:24 +0000 (00:51 +0000)]
Moderize WebKit's back forward list code
https://bugs.webkit.org/show_bug.cgi?id=177843

Reviewed by Tim Horton.

Use Ref instead of RefPtr when possible.
Use references instead of pointers when possible.
Remove unnecessary null checks.
Reduce unnecessary Vector copying.

* Shared/SessionState.h:
* Shared/WebBackForwardListItem.h:
* UIProcess/API/APILoaderClient.h:
(API::LoaderClient::didChangeBackForwardList):
(API::LoaderClient::shouldKeepCurrentBackForwardListItemInList):
* UIProcess/API/C/WKPage.cpp:
(WKPageSetPageLoaderClient):
* UIProcess/WebBackForwardList.cpp:
(WebKit::WebBackForwardList::pageClosed):
(WebKit::WebBackForwardList::addItem):
(WebKit::WebBackForwardList::goToItem):
(WebKit::WebBackForwardList::currentItem const):
(WebKit::WebBackForwardList::backItem const):
(WebKit::WebBackForwardList::forwardItem const):
(WebKit::WebBackForwardList::itemAtIndex const):
(WebKit::WebBackForwardList::backListAsAPIArrayWithLimit const):
(WebKit::WebBackForwardList::forwardListAsAPIArrayWithLimit const):
(WebKit::WebBackForwardList::removeAllItems):
(WebKit::WebBackForwardList::clear):
(WebKit::WebBackForwardList::backForwardListState const):
(WebKit::WebBackForwardList::restoreFromState):
* UIProcess/WebBackForwardList.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::reattachToWebProcessWithItem):
(WebKit::WebPageProxy::initializeWebPage):
(WebKit::WebPageProxy::didChangeBackForwardList):
(WebKit::WebPageProxy::shouldKeepCurrentBackForwardListItemInList):
(WebKit::WebPageProxy::backForwardGoToItem):
* UIProcess/WebPageProxy.h:
* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::registerNewWebBackForwardListItem):
* UIProcess/WebProcessProxy.h:
* WebProcess/WebPage/WebBackForwardListProxy.cpp:
(WebKit::WebBackForwardListProxy::itemAtIndex):

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

2 years agoMove scroll snap point unregistration from willBeRemovedFromTree to willBeDestroyed
zalan@apple.com [Wed, 4 Oct 2017 00:13:33 +0000 (00:13 +0000)]
Move scroll snap point unregistration from willBeRemovedFromTree to willBeDestroyed
https://bugs.webkit.org/show_bug.cgi?id=177830
<rdar://problem/34796065>

Reviewed by Antti Koivisto.

willBeRemovedFromTree is called conditionally, relying on unregistering objects in there is highly error prone.

Covered by existing tests.

* rendering/RenderBox.cpp:
(WebCore::RenderBox::willBeDestroyed):
(WebCore::RenderBox::willBeRemovedFromTree): Deleted.
* rendering/RenderBox.h:

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

2 years agoAX: [ATK] ARIA menuitems should be exposed with ATK_ROLE_MENU_ITEM even when it's...
jdiggs@igalia.com [Wed, 4 Oct 2017 00:05:10 +0000 (00:05 +0000)]
AX: [ATK] ARIA menuitems should be exposed with ATK_ROLE_MENU_ITEM even when it's the child of group role
https://bugs.webkit.org/show_bug.cgi?id=177811

Reviewed by Chris Fleizach.

Source/WebCore:

AccessibilityNodeObject::remapAriaRoleDueToParent() remaps ARIA menuitems to the
MenuButtonRole AccessibilityRole when the menuitem's parent is an ARIA group, but
the ATK code was not handling that remapped role value. As a result, the element
was being exposed as ATK_ROLE_UNKNOWN. Add MenuButtonRole to the AccessibilityRole
types exposed as ATK_ROLE_MENU_ITEM.

Test: accessibility/gtk/menu-with-group-child-tree.html

* accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
(atkRole):

LayoutTests:

* accessibility/gtk/menu-with-group-child-tree-expected.txt: Added.
* accessibility/gtk/menu-with-group-child-tree.html: Added.

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

2 years agoAX: [ATK] aria-rowindex set on row element is not being exposed
jdiggs@igalia.com [Wed, 4 Oct 2017 00:03:12 +0000 (00:03 +0000)]
AX: [ATK] aria-rowindex set on row element is not being exposed
https://bugs.webkit.org/show_bug.cgi?id=177821

Reviewed by Chris Fleizach.

Source/WebCore:

Expose the value of aria-rowindex when set on a row as an object
attribute, as we already do when it's set on a cell.

Test: accessibility/gtk/aria-rowindex-on-row.html

* accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
(webkitAccessibleGetAttributes):

LayoutTests:

* accessibility/gtk/aria-rowindex-on-row-expected.txt: Added.
* accessibility/gtk/aria-rowindex-on-row.html: Added.

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

2 years agoSharedStringHashStore should support removing hashes
cdumez@apple.com [Tue, 3 Oct 2017 23:59:33 +0000 (23:59 +0000)]
SharedStringHashStore should support removing hashes
https://bugs.webkit.org/show_bug.cgi?id=177770

Reviewed by Alex Christensen.

Source/WebKit:

SharedStringHashStore should support removing hashes. It currently only supports adding hashes or
clearing all of them, which is sufficient for the VisitedLinkStore but will not be for Service
Worker purposes.

* Shared/SharedStringHashStore.cpp:
(WebKit::SharedStringHashStore::SharedStringHashStore):
(WebKit::SharedStringHashStore::add):
(WebKit::SharedStringHashStore::remove):
(WebKit::SharedStringHashStore::contains):
(WebKit::SharedStringHashStore::clear):
(WebKit::SharedStringHashStore::resizeTable):
(WebKit::SharedStringHashStore::pendingOperationsTimerFired):
* Shared/SharedStringHashStore.h:
* Shared/SharedStringHashTable.cpp:
(WebKit::SharedStringHashTable::remove):
* Shared/SharedStringHashTable.h:
* UIProcess/API/Cocoa/_WKVisitedLinkStore.h:
* UIProcess/API/Cocoa/_WKVisitedLinkStore.mm:
(-[_WKVisitedLinkStore containsVisitedLinkWithURL:]):
(-[_WKVisitedLinkStore removeVisitedLinkWithURL:]):
* UIProcess/VisitedLinkStore.cpp:
(WebKit::VisitedLinkStore::containsVisitedLinkHash):
(WebKit::VisitedLinkStore::removeVisitedLinkHash):
(WebKit::VisitedLinkStore::didUpdateSharedStringHashes):
* UIProcess/VisitedLinkStore.h:

Tools:

Add API test coverage.

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKitCocoa/VisitedLinkStore.mm: Added.
(TestWebKitAPI::TEST):

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

2 years agoShare code to normalize an HTTP method
dbates@webkit.org [Tue, 3 Oct 2017 23:35:41 +0000 (23:35 +0000)]
Share code to normalize an HTTP method
https://bugs.webkit.org/show_bug.cgi?id=177837

Reviewed by Andy Estes.

Currently we duplicate code in XMLHttpRequest and FetchRequest to normalize an HTTP method.
We should add a common helper function and update both classes to make use of it.

No functionality changed. So, no new tests.

* Modules/fetch/FetchRequest.cpp:
(WebCore::setMethod): Modified to use WebCore::normalizeHTTPMethod().
* platform/network/HTTPParsers.cpp:
(WebCore::normalizeHTTPMethod): Moved from XMLHttpRequest.cpp.
* platform/network/HTTPParsers.h:
* xml/XMLHttpRequest.cpp:
(WebCore::XMLHttpRequest::open): Modified to use WebCore::normalizeHTTPMethod().
(WebCore::XMLHttpRequest::uppercaseKnownHTTPMethod): Deleted; moved to HTTPParsers.cpp.
* xml/XMLHttpRequest.h:

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

2 years agoRemove some duplicate w3c tests for media tracks.
Ms2ger@igalia.com [Tue, 3 Oct 2017 23:17:12 +0000 (23:17 +0000)]
Remove some duplicate w3c tests for media tracks.
https://bugs.webkit.org/show_bug.cgi?id=177819

Reviewed by Youenn Fablet.

All these tests also exist in
imported/w3c/web-platform-tests/html/semantics/embedded-content/media-elements/interfaces,
where they are kept up-to-date with upstream.

* media/track/w3c/interfaces/HTMLMediaElement/addTextTrack-expected.txt: Removed.
* media/track/w3c/interfaces/HTMLMediaElement/addTextTrack.html: Removed.
* media/track/w3c/interfaces/HTMLMediaElement/textTracks-expected.txt: Removed.
* media/track/w3c/interfaces/HTMLMediaElement/textTracks.html: Removed.
* media/track/w3c/interfaces/HTMLTrackElement/default-expected.txt: Removed.
* media/track/w3c/interfaces/HTMLTrackElement/default.html: Removed.
* media/track/w3c/interfaces/HTMLTrackElement/label-expected.txt: Removed.
* media/track/w3c/interfaces/HTMLTrackElement/label.html: Removed.
* media/track/w3c/interfaces/HTMLTrackElement/readyState-expected.txt: Removed.
* media/track/w3c/interfaces/HTMLTrackElement/readyState.html: Removed.
* media/track/w3c/interfaces/HTMLTrackElement/srclang-expected.txt: Removed.
* media/track/w3c/interfaces/HTMLTrackElement/srclang.html: Removed.
* media/track/w3c/interfaces/HTMLTrackElement/track-expected.txt: Removed.
* media/track/w3c/interfaces/HTMLTrackElement/track.html: Removed.
* media/track/w3c/interfaces/TextTrack/addCue-expected.txt: Removed.
* media/track/w3c/interfaces/TextTrack/addCue.html: Removed.
* media/track/w3c/interfaces/TextTrack/constants-expected.txt: Removed.
* media/track/w3c/interfaces/TextTrack/constants.html: Removed.
* media/track/w3c/interfaces/TextTrack/kind-expected.txt: Removed.
* media/track/w3c/interfaces/TextTrack/kind.html: Removed.
* media/track/w3c/interfaces/TextTrack/label-expected.txt: Removed.
* media/track/w3c/interfaces/TextTrack/label.html: Removed.
* media/track/w3c/interfaces/TextTrack/language-expected.txt: Removed.
* media/track/w3c/interfaces/TextTrack/language.html: Removed.
* media/track/w3c/interfaces/TextTrack/mode-expected.txt: Removed.
* media/track/w3c/interfaces/TextTrack/mode.html: Removed.
* media/track/w3c/interfaces/TextTrack/oncuechange-expected.txt: Removed.
* media/track/w3c/interfaces/TextTrack/oncuechange.html: Removed.
* media/track/w3c/interfaces/TextTrack/removeCue-expected.txt: Removed.
* media/track/w3c/interfaces/TextTrack/removeCue.html: Removed.
* media/track/w3c/interfaces/TextTrackCue/endTime-expected.txt: Removed.
* media/track/w3c/interfaces/TextTrackCue/endTime.html: Removed.
* media/track/w3c/interfaces/TextTrackCue/id-expected.txt: Removed.
* media/track/w3c/interfaces/TextTrackCue/id.html: Removed.
* media/track/w3c/interfaces/TextTrackCue/pauseOnExit-expected.txt: Removed.
* media/track/w3c/interfaces/TextTrackCue/pauseOnExit.html: Removed.
* media/track/w3c/interfaces/TextTrackCue/startTime-expected.txt: Removed.
* media/track/w3c/interfaces/TextTrackCue/startTime.html: Removed.
* media/track/w3c/interfaces/TextTrackCue/track-expected.txt: Removed.
* media/track/w3c/interfaces/TextTrackCue/track.html: Removed.
* media/track/w3c/interfaces/TextTrackCueList/getCueById-expected.txt: Removed.
* media/track/w3c/interfaces/TextTrackCueList/getCueById.html: Removed.
* media/track/w3c/interfaces/TextTrackCueList/length-expected.txt: Removed.
* media/track/w3c/interfaces/TextTrackCueList/length.html: Removed.
* media/track/w3c/interfaces/TextTrackList/length-expected.txt: Removed.
* media/track/w3c/interfaces/TextTrackList/length.html: Removed.
* media/track/w3c/interfaces/TextTrackList/onaddtrack-expected.txt: Removed.
* media/track/w3c/interfaces/TextTrackList/onaddtrack.html: Removed.
* media/track/w3c/interfaces/TextTrackList/onremovetrack-expected.txt: Removed.
* media/track/w3c/interfaces/TextTrackList/onremovetrack.html: Removed.
* platform/ios/TestExpectations: Removed references to removed tests.
* platform/mac/TestExpectations: Removed references to removed tests.

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

2 years agoXMLHttpRequest.setRequestHeader() should allow Content-Transfer-Encoding header;...
dbates@webkit.org [Tue, 3 Oct 2017 23:12:34 +0000 (23:12 +0000)]
XMLHttpRequest.setRequestHeader() should allow Content-Transfer-Encoding header; remove
duplicate logic to check for a forbidden XHR header field
https://bugs.webkit.org/show_bug.cgi?id=177829
<rdar://problem/34798441>

LayoutTests/imported/w3c:

Update expected result now that we match the XHR standard, <https://xhr.spec.whatwg.org> (09/08/2017).

We no longer consider Content-Transfer-Encoding and User-Agent forbidden headers as per
the standard.

* web-platform-tests/XMLHttpRequest/setrequestheader-header-allowed-expected.txt:

LayoutTests:

Update tests and expected results now that we match the XHR standard, <https://xhr.spec.whatwg.org> (09/08/2017).

We no longer consider Content-Transfer-Encoding and User-Agent forbidden headers as per
the standard.

* fast/xmlhttprequest/set-dangerous-headers-expected.txt:
* fast/xmlhttprequest/set-dangerous-headers-in-dashboard.html:
* fast/xmlhttprequest/set-dangerous-headers.html:
* http/tests/xmlhttprequest/check-combining-headers-expected.txt:
* http/tests/xmlhttprequest/set-dangerous-headers-expected.txt:
* http/tests/xmlhttprequest/set-dangerous-headers.html:

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

2 years agoFix missing import for BenchmarkRunner.
dewei_zhu@apple.com [Tue, 3 Oct 2017 23:08:27 +0000 (23:08 +0000)]
Fix missing import for BenchmarkRunner.
https://bugs.webkit.org/show_bug.cgi?id=177842

Reviewed by Ryosuke Niwa.

'show_results' requires BenchmarkRunner.

* Scripts/webkitpy/benchmark_runner/run_benchmark.py:

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

2 years agoShare code to determine a forbidden method
dbates@webkit.org [Tue, 3 Oct 2017 22:40:35 +0000 (22:40 +0000)]
Share code to determine a forbidden method
https://bugs.webkit.org/show_bug.cgi?id=177833

Reviewed by Andy Estes.

Currently we duplicate code in XMLHttpRequest and FetchRequest to determine if a method is
forbidden. We should add a common helper function and update both classes to make use of it.

No functionality changed. So, no new tests.

* Modules/fetch/FetchRequest.cpp:
(WebCore::setMethod): Modified to use WebCore::isForbiddenMethod().
* platform/network/HTTPParsers.cpp:
(WebCore::isForbiddenMethod): Added.
* platform/network/HTTPParsers.h:
* xml/XMLHttpRequest.cpp:
(WebCore::XMLHttpRequest::open): Modified to use WebCore::isForbiddenMethod().
(WebCore::XMLHttpRequest::isAllowedHTTPMethod): Deleted.
* xml/XMLHttpRequest.h:

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

2 years agoRenderMenuList should not hold raw pointers
zalan@apple.com [Tue, 3 Oct 2017 22:39:49 +0000 (22:39 +0000)]
RenderMenuList should not hold raw pointers
https://bugs.webkit.org/show_bug.cgi?id=177836

Reviewed by Antti Koivisto.

While both m_buttonText and m_innerBlock are child renderers of
the RenderMenuList, so the their lifecycles are supposed to tied
to the parent object, this patch removes some manual raw pointer managing.

Covered by existing tests.

* rendering/RenderMenuList.cpp:
(WebCore::RenderMenuList::RenderMenuList):
(WebCore::RenderMenuList::createInnerBlock):
(RenderMenuList::takeChild):
(RenderMenuList::setText):
* rendering/RenderMenuList.h:

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

2 years agoAdd long press and drag test
megan_gardner@apple.com [Tue, 3 Oct 2017 22:12:37 +0000 (22:12 +0000)]
Add long press and drag test
https://bugs.webkit.org/show_bug.cgi?id=177289

Reviewed by Wenson Hsieh.

Adding a test to test the long press and then drag functionality of selection.
Also add additional helper functions to basic gestures, so that this and other
tests can be written. Mostly deals with not lifting between gestures.

* fast/events/touch/ios/long-press-then-drag-to-select-text-expected.txt: Added.
* fast/events/touch/ios/long-press-then-drag-to-select-text.html: Added.
* fast/events/touch/ios/resources/basic-gestures.js:
(longPressAndHoldAtPoint):
(touchAndDragFromPointToPoint):

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

2 years agoInclude a few widespread WTF headers in WebCorePrefix.h
timothy_horton@apple.com [Tue, 3 Oct 2017 21:56:53 +0000 (21:56 +0000)]
Include a few widespread WTF headers in WebCorePrefix.h
https://bugs.webkit.org/show_bug.cgi?id=173481

* WebCorePrefix.h:
Turn this off on Windows because it doesn't work; needs further investigation.

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

2 years agoSkip imported/w3c/web-platform-tests/payment-request/rejects_if_not_active.https...
ryanhaddad@apple.com [Tue, 3 Oct 2017 21:27:36 +0000 (21:27 +0000)]
Skip imported/w3c/web-platform-tests/payment-request/rejects_if_not_active.https.html on iOS.
https://bugs.webkit.org/show_bug.cgi?id=177832

Unreviewed test gardening.

* platform/ios-wk2/TestExpectations:

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

2 years agoInclude a few widespread WTF headers in WebCorePrefix.h
timothy_horton@apple.com [Tue, 3 Oct 2017 21:12:38 +0000 (21:12 +0000)]
Include a few widespread WTF headers in WebCorePrefix.h
https://bugs.webkit.org/show_bug.cgi?id=173481

Reviewed by Alex Christensen.

* WebCorePrefix.h:
These are four of the headers that contribute the most pre-processed
source to the WebCore build. They (and their dependents) change infrequently
enough that a world rebuild of WebCore when they change seems like an
acceptable tradeoff for the ~9% reduction in WebCore build time that I
measure from this change.

We can't do this on macOS 10.12 because of https://bugs.llvm.org/show_bug.cgi?id=33520.

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

2 years agoFix API tests after r222794.
achristensen@apple.com [Tue, 3 Oct 2017 21:10:49 +0000 (21:10 +0000)]
Fix API tests after r222794.
https://bugs.webkit.org/show_bug.cgi?id=177825

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::willGoToBackForwardListItem):
Sometimes there's no navigation client.

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

2 years agoLayout Test http/tests/inspector/network/beacon-type.html is flaky.
joepeck@webkit.org [Tue, 3 Oct 2017 21:10:24 +0000 (21:10 +0000)]
Layout Test http/tests/inspector/network/beacon-type.html is flaky.
https://bugs.webkit.org/show_bug.cgi?id=177834

Unreviewed test gardening.

* http/tests/inspector/network/beacon-type.html:
* http/tests/inspector/network/ping-type.html:
Don't wait for the resource to finish loading if it has already finished loading.
Logs showed the resource had already finished loading earlier, before this
promise microtask started running.

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

2 years agoXMLHttpRequest.setRequestHeader() should allow Content-Transfer-Encoding header;...
dbates@webkit.org [Tue, 3 Oct 2017 20:55:59 +0000 (20:55 +0000)]
XMLHttpRequest.setRequestHeader() should allow Content-Transfer-Encoding header; remove
duplicate logic to check for a forbidden XHR header field
https://bugs.webkit.org/show_bug.cgi?id=177829

Reviewed by Alexey Proskuryakov.

Source/WebCore:

Use isForbiddenHeaderName() (defined in HTTPParsers.h) to check if the header field specified
to XMLHttpRequest.setRequestHeader() is allowed. Among other benefits this makes the behavior
of XMLHttpRequest.setRequestHeader() more closely aligned with the behavior of this method in
the XHR standard, <https://xhr.spec.whatwg.org> (8 September 2017). In particular, XMLHttpRequest.setRequestHeader()
no longer forbids setting the header Content-Transfer-Encoding. This header has not been
considered a forbidden header since <https://www.w3.org/TR/2012/WD-XMLHttpRequest-20121206/>.

* xml/XMLHttpRequest.cpp:
(WebCore::XMLHttpRequest::setRequestHeader):
(WebCore::isForbiddenRequestHeader): Deleted.
(WebCore::XMLHttpRequest::isAllowedHTTPHeader): Deleted.
* xml/XMLHttpRequest.h:

LayoutTests:

Update tests and test results now that we no longer consider Content-Transfer-Encoding a
forbidden header.

* fast/xmlhttprequest/set-dangerous-headers-expected.txt:
* fast/xmlhttprequest/set-dangerous-headers-in-dashboard.html:
* fast/xmlhttprequest/set-dangerous-headers.html:
* http/tests/xmlhttprequest/set-dangerous-headers-expected.txt:
* http/tests/xmlhttprequest/set-dangerous-headers.html:

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

2 years agoUnreviewed, rolling out r222686, r222695, and r222698.
ryanhaddad@apple.com [Tue, 3 Oct 2017 20:51:00 +0000 (20:51 +0000)]
Unreviewed, rolling out r222686, r222695, and r222698.
https://bugs.webkit.org/show_bug.cgi?id=177835

Caused LayoutTests to crash in
WebCore::TimerBase::setNextFireTime (Requested by ryanhaddad
on #webkit).

Reverted changesets:

"[Settings] Replace SettingsMacros.h with a generated base
class for Settings"
https://bugs.webkit.org/show_bug.cgi?id=177681
http://trac.webkit.org/changeset/222686

"[Settings] Enums should not be passed by const reference"
https://bugs.webkit.org/show_bug.cgi?id=177727
http://trac.webkit.org/changeset/222695

"[Settings] Move remaining simple settings to Settings.in"
https://bugs.webkit.org/show_bug.cgi?id=177730
http://trac.webkit.org/changeset/222698

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

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

2 years agoUnreviewed test gardening. Add debugging to flakey test.
joepeck@webkit.org [Tue, 3 Oct 2017 20:36:22 +0000 (20:36 +0000)]
Unreviewed test gardening. Add debugging to flakey test.

* http/tests/inspector/network/beacon-type.html:
Add some debugging to try and understand why this test times out.

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

2 years ago[WPE] Bump deps to add support for xdg-shell-unstable-v6 protocol
commit-queue@webkit.org [Tue, 3 Oct 2017 20:32:00 +0000 (20:32 +0000)]
[WPE] Bump deps to add support for xdg-shell-unstable-v6 protocol
https://bugs.webkit.org/show_bug.cgi?id=177820

Patch by Olivier Blin <olivier.blin@softathome.com> on 2017-10-03
Reviewed by Žan Doberšek.

gnome-shell does not advertize the xdg-shell protocol anymore, but xdg-shell-unstable-v6 instead.
Support has been added in WPEBackend-mesa, we need to update the requirements.
wayland-1.10 is needed for wl_proxy_get_version(), used in the generated headers.

* wpe/jhbuild.modules:

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

2 years agoImplement quality-of-service tiers in WebCoreDecompressionSession
jer.noble@apple.com [Tue, 3 Oct 2017 19:56:34 +0000 (19:56 +0000)]
Implement quality-of-service tiers in WebCoreDecompressionSession
https://bugs.webkit.org/show_bug.cgi?id=177769

Reviewed by Dean Jackson.

VTDecompressionSession will suggest quality-of-service tiers to be used when decompression
can't keep up with playback speed. Use a simple exponential-moving-average heuristic to
determine when to move up and down the tiers.

Drive-by fix: When frames are so late that they miss the display deadline, mark them as
dropped rather than just delayed.

* platform/graphics/cocoa/WebCoreDecompressionSession.h:
* platform/graphics/cocoa/WebCoreDecompressionSession.mm:
(WebCore::WebCoreDecompressionSession::ensureDecompressionSessionForSample):
(WebCore::WebCoreDecompressionSession::decodeSample):
(WebCore::WebCoreDecompressionSession::handleDecompressionOutput):
(WebCore::WebCoreDecompressionSession::automaticDequeue):
(WebCore::WebCoreDecompressionSession::enqueueDecodedSample):
(WebCore::WebCoreDecompressionSession::resetQosTier):
(WebCore::WebCoreDecompressionSession::increaseQosTier):
(WebCore::WebCoreDecompressionSession::decreaseQosTier):
(WebCore::WebCoreDecompressionSession::updateQosWithDecodeTimeStatistics):
* platform/cocoa/VideoToolboxSoftLink.cpp:
* platform/cocoa/VideoToolboxSoftLink.h:

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

2 years agoAdd ObjC equivalent of WKPageLoaderClient.pluginDidFail
achristensen@apple.com [Tue, 3 Oct 2017 19:23:27 +0000 (19:23 +0000)]
Add ObjC equivalent of WKPageLoaderClient.pluginDidFail
https://bugs.webkit.org/show_bug.cgi?id=177787
<rdar://problem/22387633>

Reviewed by Tim Horton.

* UIProcess/API/APILoaderClient.h:
(API::LoaderClient::didFailToInitializePlugin):
* UIProcess/API/APINavigationClient.h:
(API::NavigationClient::canHandleDidFailToInitializePlugIn const):
(API::NavigationClient::didFailToInitializePlugIn):
* UIProcess/API/C/WKPage.cpp:
(WKPageSetPageLoaderClient):
* UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h:
* UIProcess/Cocoa/NavigationState.h:
* UIProcess/Cocoa/NavigationState.mm:
(WebKit::NavigationState::setNavigationDelegate):
(WebKit::NavigationState::NavigationClient::canHandleDidFailToInitializePlugIn const):
(WebKit::NavigationState::NavigationClient::didFailToInitializePlugIn):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::didFailToInitializePlugin):

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

2 years agoWeb Inspector: Layers tab sidebar's DOM highlight should be by row hover, not row...
commit-queue@webkit.org [Tue, 3 Oct 2017 19:21:54 +0000 (19:21 +0000)]
Web Inspector: Layers tab sidebar's DOM highlight should be by row hover, not row selection
https://bugs.webkit.org/show_bug.cgi?id=177690

Patch by Ross Kirsling <ross.kirsling@sony.com> on 2017-10-03
Reviewed by Devin Rousso.

* UserInterface/Views/LayerDetailsSidebarPanel.js:
(WI.LayerDetailsSidebarPanel):
(WI.LayerDetailsSidebarPanel.prototype._buildDataGrid):
(WI.LayerDetailsSidebarPanel.prototype._dataGridSelectedNodeChanged):
(WI.LayerDetailsSidebarPanel.prototype._dataGridMouseMove):
(WI.LayerDetailsSidebarPanel.prototype._dataGridMouseLeave):
(WI.LayerDetailsSidebarPanel.prototype._hideDOMNodeHighlight):
(WI.LayerDetailsSidebarPanel.prototype._dataGridFocused): Deleted.
(WI.LayerDetailsSidebarPanel.prototype._dataGridBlurred): Deleted.
(WI.LayerDetailsSidebarPanel.prototype._highlightSelectedNode): Deleted.

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

2 years ago[GTK] Support the "system" CSS font family
aperez@igalia.com [Tue, 3 Oct 2017 19:21:19 +0000 (19:21 +0000)]
[GTK] Support the "system" CSS font family
https://bugs.webkit.org/show_bug.cgi?id=177755

Reviewed by Carlos Garcia Campos.

Obtain the system UI font from the GtkSettings::gtk-font-name property

Source/WebCore:

Test: platform/gtk/fonts/systemFont.html

* platform/graphics/freetype/FontCacheFreeType.cpp:
(WebCore::getFamilyNameStringFromFamily): Use defaultGtkSystemFont()
to handle -webkit-system-font and -webkit-system-ui.
(WebCore::isCommonlyUsedGenericFamily): Handle -webkit-system-font and
-webkit-system-ui as generic family names.
* platform/graphics/gtk/GtkUtilities.cpp:
(WebCore::defaultGtkSystemFont): Added.
* platform/graphics/gtk/GtkUtilities.h: Add prototype for defaultGtkSystemFont().

LayoutTests:

* platform/gtk/fonts/systemFont-expected.html: Added.
* platform/gtk/fonts/systemFont.html: Added.

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

2 years agoWeb Inspector: Styles Redesign: support editing of rule selectors
nvasilyev@apple.com [Tue, 3 Oct 2017 19:17:23 +0000 (19:17 +0000)]
Web Inspector: Styles Redesign: support editing of rule selectors
https://bugs.webkit.org/show_bug.cgi?id=177012

Reviewed by Matt Baker.

Clicking or focusing (by tabbing from another field) on a CSS selector should select the text and make the selector
field editable.

Keyboard behavior while editing:
- Enter should commit changes.
- Escape should discard changes.
- Tab should commit changes and navigate to the first property name.
- Shift-Tab should commit changes and navigate to the last rule's property value, if there's one.

* UserInterface/Views/SpreadsheetCSSStyleDeclarationEditor.js:
(WI.SpreadsheetStyleProperty.prototype._update):
Add tabIndex so the keyboard navigation (Tab & Shift-Tab) to and from selectors works as expected.

* UserInterface/Views/SpreadsheetCSSStyleDeclarationSection.css:
(.spreadsheet-css-declaration .selector:focus,):
(.spreadsheet-css-declaration .selector.spreadsheet-selector-field):
(.spreadsheet-css-declaration .selector.spreadsheet-selector-field.editing):
* UserInterface/Views/SpreadsheetCSSStyleDeclarationSection.js:
(WI.SpreadsheetCSSStyleDeclarationSection.prototype.get selectorEditable):
(WI.SpreadsheetCSSStyleDeclarationSection.prototype.initialLayout):
(WI.SpreadsheetCSSStyleDeclarationSection.prototype.layout):
Split layout into _renderOrigin and _renderSelector, so selector field can be updated separately
from everything else.

(WI.SpreadsheetCSSStyleDeclarationSection.prototype.cssStyleDeclarationTextEditorFocused):
(WI.SpreadsheetCSSStyleDeclarationSection.prototype.spreadsheetSelectorFieldDidChange):
(WI.SpreadsheetCSSStyleDeclarationSection.prototype.spreadsheetSelectorFieldDidDiscard):
(WI.SpreadsheetCSSStyleDeclarationSection.prototype._discardSelectorChange):
(WI.SpreadsheetCSSStyleDeclarationSection.prototype._renderSelector):
(WI.SpreadsheetCSSStyleDeclarationSection.prototype._renderOrigin):

(WI.SpreadsheetSelectorField):
(WI.SpreadsheetSelectorField.prototype.get editing):
(WI.SpreadsheetSelectorField.prototype.startEditing):
(WI.SpreadsheetSelectorField.prototype.stopEditing):
(WI.SpreadsheetSelectorField.prototype._handleClick):
(WI.SpreadsheetSelectorField.prototype._handleFocus):
(WI.SpreadsheetSelectorField.prototype._handleBlur):
(WI.SpreadsheetSelectorField.prototype._handleKeyDown):

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

2 years ago[GTK] Prefer -webkit-system-font
aperez@igalia.com [Tue, 3 Oct 2017 19:02:35 +0000 (19:02 +0000)]
[GTK] Prefer -webkit-system-font
https://bugs.webkit.org/show_bug.cgi?id=177814

Reviewed by Carlos Garcia Campos.

Use "font-family: -webkit-system-font" instead of "font: menu".

* UIProcess/API/gtk/WebKitRemoteInspectorProtocolHandler.cpp:
(WebKit::RemoteInspectorProtocolHandler::handleRequest): Edited HTML snippet.

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

2 years ago[XHR] Only exempt Dashboard widgets from XHR header restrictions
dbates@webkit.org [Tue, 3 Oct 2017 18:54:30 +0000 (18:54 +0000)]
[XHR] Only exempt Dashboard widgets from XHR header restrictions
https://bugs.webkit.org/show_bug.cgi?id=177824
<rdar://problem/34384301>

Reviewed by Alexey Proskuryakov.

Source/WebCore:

Currently we allow file URLs to set arbitrary XHR headers. In contrast, non-file URLs are
restricted from setting some XHR headers (e.g. COOKIE). Historically the relaxation for file
URL was for backwards compatibility to allow Dashboard widgets to work. Instead we should
apply the non-file URL policy to all URLs and only relax the policy for Dashboard widgets.

Tests: fast/xmlhttprequest/set-dangerous-headers-in-dashboard.html
       fast/xmlhttprequest/set-dangerous-headers.html

* xml/XMLHttpRequest.cpp:
(WebCore::XMLHttpRequest::setRequestHeader):

LayoutTests:

Add tests to ensure that file URLs are forbidden from setting the same set of blacklisted
headers as non-file URLs except when running in Dashboard compatibility mode.

* TestExpectations: Mark test fast/xmlhttprequest/set-dangerous-headers-in-dashboard.html
as WontFix on all platforms. We will selectively enable this test on Mac because it is the
only platform that supports Dashboard widgets.
* fast/xmlhttprequest/set-dangerous-headers-expected.txt: Added.
* fast/xmlhttprequest/set-dangerous-headers-in-dashboard-expected.txt: Added.
* fast/xmlhttprequest/set-dangerous-headers-in-dashboard.html: Added.
* fast/xmlhttprequest/set-dangerous-headers.html: Added. Derived from LayoutTests/http/tests/xmlhttprequest/set-dangerous-headers.html.
* platform/mac/TestExpectations: Enable test fast/xmlhttprequest/set-dangerous-headers-in-dashboard.html
on Mac.

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

2 years agoAdd ObjC SPI equivalent to WKPageLoaderClient.willGoToBackForwardListItem
achristensen@apple.com [Tue, 3 Oct 2017 18:54:11 +0000 (18:54 +0000)]
Add ObjC SPI equivalent to WKPageLoaderClient.willGoToBackForwardListItem
https://bugs.webkit.org/show_bug.cgi?id=177825
<rdar://problem/22387505>

Reviewed by Tim Horton.

Source/WebKit:

* UIProcess/API/APILoaderClient.h:
(API::LoaderClient::willGoToBackForwardListItem):
* UIProcess/API/APINavigationClient.h:
(API::NavigationClient::canHandleWillGoToBackForwardListItem const):
(API::NavigationClient::willGoToBackForwardListItem):
* UIProcess/API/C/WKPage.cpp:
(WKPageSetPageLoaderClient):
* UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h:
* UIProcess/Cocoa/NavigationState.h:
* UIProcess/Cocoa/NavigationState.mm:
(WebKit::NavigationState::setNavigationDelegate):
(WebKit::NavigationState::NavigationClient::canHandleWillGoToBackForwardListItem const):
(WebKit::NavigationState::NavigationClient::willGoToBackForwardListItem):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::willGoToBackForwardListItem):
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::shouldGoToHistoryItem const):

Tools:

* TestWebKitAPI/Tests/WebKitCocoa/Navigation.mm:
(-[BackForwardDelegate _webView:willGoToBackForwardListItem:inPageCache:]):
(-[BackForwardDelegate webView:didFinishNavigation:]):
(TEST):

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

2 years agoAllow assigning WeakPtr<Derived> to WeakPtr<Base>
antti@apple.com [Tue, 3 Oct 2017 18:48:57 +0000 (18:48 +0000)]
Allow assigning WeakPtr<Derived> to WeakPtr<Base>
https://bugs.webkit.org/show_bug.cgi?id=177817

Reviewed by Geoff Garen.

Source/WTF:

Add templated copy/move constructors/assignment operators, similar to RefPtr.

* wtf/WeakPtr.h:
(WTF::WeakPtrFactory::createWeakPtr const):
(WTF::weak_reference_upcast):
(WTF::weak_reference_downcast):
(WTF::WeakPtr<T>::WeakPtr):
(WTF::=):
(WTF::makeWeakPtr):

Tools:

* TestWebKitAPI/Tests/WTF/WeakPtr.cpp:
(TestWebKitAPI::Base::weakPtrFactory):
(TestWebKitAPI::TEST):

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

2 years agoREGRESSION(r221909): Failing fast/text/international/iso-8859-8.html
commit-queue@webkit.org [Tue, 3 Oct 2017 18:39:30 +0000 (18:39 +0000)]
REGRESSION(r221909): Failing fast/text/international/iso-8859-8.html
https://bugs.webkit.org/show_bug.cgi?id=177364

Patch by Fujii Hironori <Hironori.Fujii@sony.com> on 2017-10-03
Reviewed by Carlos Garcia Campos.

Source/WebCore:

Range.getClientRects returned an incorrect rect for a last
collapsed space of RenderText in HarfBuzz port.

HarfBuzzShaper::selectionRect needs to return a valid value even
if the arguments 'from' and 'to' point to the just after the end
of the text run.

Tests: fast/text/international/iso-8859-8.html

* platform/graphics/harfbuzz/HarfBuzzShaper.cpp:
(WebCore::HarfBuzzShaper::shape): Do not check the return value of
fillGlyphBuffer.
(WebCore::HarfBuzzShaper::fillGlyphBuffer): Change the return
value type from bool to void.
(WebCore::HarfBuzzShaper::selectionRect): Set the rightmost
position to fromX if foundFromX is false.
* platform/graphics/harfbuzz/HarfBuzzShaper.h: Change the return
value type of fillGlyphBuffer from bool to void.

LayoutTests:

* platform/gtk/TestExpectations: Unmark fast/text/international/iso-8859-8.html.

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

2 years agoWebAssembly: no VM / JS version of everything but Instance
jfbastien@apple.com [Tue, 3 Oct 2017 18:33:14 +0000 (18:33 +0000)]
WebAssembly: no VM / JS version of everything but Instance
https://bugs.webkit.org/show_bug.cgi?id=177473

Reviewed by Filip Pizlo.

JSTests:

- Exceeding max on memory growth now returns a range error as per
spec. This is a (very minor) breaking change: it used to throw OOM
error. Update the corresponding test.

* wasm/js-api/memory-grow.js:
(assertEq):
* wasm/js-api/table.js:
(assert.throws):

Source/JavaScriptCore:

This change entails cleaning up and splitting a bunch of code which we had
intertwined between C++ classes which represent JS objects, and pure C++
implementation objects. This specific change goes most of the way towards
allowing JSC's WebAssembly to work without VM / JS, up to but excluding
JSWebAssemblyInstance (there's Wasm::Instance, but it's not *the* thing
yet). Because of this we still have a few FIXME identifying places that need to
change. A follow-up change will go the rest of the way.

I went about this change in the simplest way possible: grep the
JavaScriptCore/wasm directory for "JS[^C_]" as well as "VM" and exclude the /js/
sub-directory (which contains the JS implementation of WebAssembly).

None of this change removes the need for a JIT entitlement to be able to use
WebAssembly. We don't have an interpreter, the process therefore still needs to
be allowed to JIT to use these pure-C++ APIs.

Interesting things to note:

  - Remove VM from Plan and associated places. It can just live as a capture in
    the callback lambda if it's needed.
  - Wasm::Memory shouldn't require a VM. It was only used to ask the GC to
    collect. We now instead pass two lambdas at construction time for this
    purpose: one to notify of memory pressure, and the other to ask for
    syncrhonous memory reclamation. This allows whoever creates the memory to
    dictate how to react to both these cases, and for a JS embedding that's to
    call the GC (async or sync, respectively).
  - Move grow logic from JSWebAssemblyMemory to Wasm::Memory::grow. Use Expected
    there, with an enum class for failure types.
  - Exceeding max on memory growth now returns a range error as per spec. This
    is a (very minor) breaking change: it used to throw OOM error. Update the
    corresponding test.
  - When generating the grow_memory opcode, no need to get the VM. Instead,
    reach directly for Wasm::Memory and grow it.
  - JSWebAssemblyMemory::grow can now always throw on failure, because it's only
    ever called from JS (not from grow_memory as before).
  - Wasm::Memory now takes a callback for successful growth. This allows JS
    wrappers to register themselves when growth succeeds without Wasm::Memory
    knowning anything about JS. It'll also allow creating a list of callbacks
    for when we add thread support (we'll want to notify many wrappers, all
    under a lock).
  - Wasm::Memory is now back to being the source of truth about address / size,
    used directly by generated code instead of JSWebAssemblyMemory.
  - Move wasmToJS from the general WasmBinding header to its own header under
    wasm/js. It's only used by wasm/js/JSWebAssemblyCodeBlock.cpp, and uses VM,
    and therefore isn't general WebAssembly.
  - Make Wasm::Context an actual type (just a struct holding a
    JSWebAssemlyInstance for now) instead of an alias for that. Notably this
    doesn't add anything to the Context and doesn't change what actually gets
    passed around in JIT code (fast TLS or registers) because these changes
    potentially impact performance. The entire purpose of this change is to
    allow passing Wasm::Context around without having to know about VM. Since VM
    contains a Wasm::Context the JS embedding is effectively the same, but with
    this setup a non-JS embedding is much better off.
  - Move JSWebAssembly into the JS folder.
  - OMGPlan: use Wasm::CodeBlock directly instead of JSWebAssemblyCodeBlock.
  - wasm->JS stubs are now on Wasm::CodeBlock's tail as raw pointers, instead of
    being on JSWebAssemblyCodeBlock, and are now called wasm->Embedder
    stubs. The owned reference is still on JSWebAssemblyCodeBlock, and is still
    called wasm->JS stub. This move means that the embedder must, after creating
    a Wasm::CodeBlock, somehow create the stubs to call back into the
    embedder. This isn't adding any indirection to the generated code because
    the B3 IR generator now reaches for Wasm::CodeBlock instead of
    JSWebAssemblyCodeBlock.
  - Move more CodeBlock things. Compilation completion is now marked by its own
    atomic<bool> flag instead of a nullptr plan: that required using a lock, and
    was causing a deadlock in stack-trace.js because before my changes
    JSWebAssemblyCodeBlock did its own completion checking separately from
    Wasm::CodeBlock, without getting the lock. Now that everything points to
    Wasm::CodeBlock and there's no cached completion marker, the lock was being
    acquired in a sanity-check assertion.
  - Embedder -> Wasm wrappers are now generated through a function that's passed
    in at compilation time, instead of being hard-coded as a JS -> Wasm wrapper.
  - WasmMemory doens't need to know about fault handling thunks. Only the IR
    generator should know, and should make sure that the exception throwing
    thunk is generated if any memory is present (note: with signal handling not
    all of them generate an exception check).
  - Make exception throwing pluggable: instead of having a hard-coded
    JS-specific lambda we now have a regular C++ function being called from JIT
    code when a WebAssembly exception is thrown. This allows any embedder to get
    called as they wish. For now a process can only have a single of these
    functions (i.e. only one embedder per process) because the trap handler is a
    singleton. That can be fixed in in #177475.
  - Create WasmEmbedder.h where all embedder plugging will live.
  - Split up JSWebAssemblyTable into Wasm::Table which is
    refcounted. JSWebAssemblyTable now only contains the JS functions in the
    table, and Wasm::Table is what's used by the JIT code to lookup where to
    call and do the instance check (for context switch). Note that this creates
    an extra allocation for all the instances in Wasm::Table, and in exchange
    removes an indirection in JIT code because the instance used to be obtained
    off of the JS function. Also note that it's the embedder than keeps the
    instances alive, not Wasm::Table (which holds a dumb pointer to the
    instance), because doing otherwise would cause reference cycles.
  - Add WasmInstance. It doesn't do much for now, owns globals.
  - JSWebAssembly instance now doesn't just contain the imported functions as
    JSObjects, it also has the corresponding import's instance and wasm
    entrypoint. This triples the space allocated per instance's imported
    function, but there shouldn't be that many imports. This has two upsides: it
    creates smaller and faster code, and makes is easier to disassociate
    embedder-specific things from embedder-neutral things. The small / faster
    win is in two places: B3 IR generator only needs offsetOfImportFunction for
    the call opcode (when the called index is an import) to know whether the
    import is wasm->wasm or wasm->embedder (this isn't known at compile-time
    because it's dependent on the import object), this is now done by seeing if
    that import function has an associated target instance (only wasm->wasm
    does); the other place is wasmBinding which uses offsetOfImportFunction to
    figure out the wasm->wasm target instance, and then gets
    WebAssemblyFunction::offsetOfWasmEntrypointLoadLocation to do a tail
    call. The disassociation comes because the target instance can be
    Wasm::Instance once we change what the Context is, and
    WasmEntrypointLoadLocation is already embedder-independent. As a next step I
    can move this tail allocation from JSWebAssemblyInstance to Wasm::Instance,
    and leave importFunction in as an opaque pointer which is embedder-specific,
    and in JS will remain WriteBarrier<JSObject>.
  - Rename VMEntryFrame to EntryFrame, and in many places pass a pointer to it
    around instead of VM. This is a first step in allowing entry frames which
    aren't stored on VM, but which are instead stored in an embedder-specific
    location. That change won't really affect JS except through code churn, but
    will allow WebAssembly to use some machinery in a generic manner without
    having a VM.

* JavaScriptCore.xcodeproj/project.pbxproj:
* Sources.txt:
* bytecode/PolymorphicAccess.cpp:
(JSC::AccessGenerationState::emitExplicitExceptionHandler):
* debugger/Debugger.cpp:
(JSC::Debugger::stepOutOfFunction):
(JSC::Debugger::returnEvent):
(JSC::Debugger::unwindEvent):
(JSC::Debugger::didExecuteProgram):
* dfg/DFGJITCompiler.cpp:
(JSC::DFG::JITCompiler::compileExceptionHandlers):
* dfg/DFGOSREntry.cpp:
(JSC::DFG::prepareOSREntry):
* dfg/DFGOSRExit.cpp:
(JSC::DFG::OSRExit::compileOSRExit):
(JSC::DFG::OSRExit::compileExit):
* dfg/DFGThunks.cpp:
(JSC::DFG::osrEntryThunkGenerator):
* ftl/FTLCompile.cpp:
(JSC::FTL::compile):
* ftl/FTLLink.cpp:
(JSC::FTL::link):
* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::lower):
* ftl/FTLOSRExitCompiler.cpp:
(JSC::FTL::compileStub):
* interpreter/CallFrame.cpp:
(JSC::CallFrame::wasmAwareLexicalGlobalObject):
(JSC::CallFrame::callerFrame):
(JSC::CallFrame::unsafeCallerFrame):
* interpreter/CallFrame.h:
(JSC::ExecState::callerFrame const):
(JSC::ExecState::callerFrameOrEntryFrame const):
(JSC::ExecState::unsafeCallerFrameOrEntryFrame const):
* interpreter/FrameTracers.h:
(JSC::NativeCallFrameTracer::NativeCallFrameTracer):
(JSC::NativeCallFrameTracerWithRestore::NativeCallFrameTracerWithRestore):
(JSC::NativeCallFrameTracerWithRestore::~NativeCallFrameTracerWithRestore):
* interpreter/Interpreter.cpp:
(JSC::UnwindFunctor::operator() const):
(JSC::UnwindFunctor::copyCalleeSavesToEntryFrameCalleeSavesBuffer const):
(JSC::Interpreter::unwind):
* interpreter/StackVisitor.cpp:
(JSC::StackVisitor::StackVisitor):
(JSC::StackVisitor::gotoNextFrame):
(JSC::StackVisitor::readNonInlinedFrame):
(JSC::StackVisitor::Frame::dump const):
* interpreter/StackVisitor.h:
(JSC::StackVisitor::Frame::callerIsEntryFrame const):
* interpreter/VMEntryRecord.h:
(JSC::VMEntryRecord::prevTopEntryFrame):
(JSC::VMEntryRecord::unsafePrevTopEntryFrame):
(JSC::EntryFrame::vmEntryRecordOffset):
* jit/AssemblyHelpers.cpp:
(JSC::AssemblyHelpers::restoreCalleeSavesFromEntryFrameCalleeSavesBuffer):
(JSC::AssemblyHelpers::loadWasmContextInstance):
(JSC::AssemblyHelpers::storeWasmContextInstance):
(JSC::AssemblyHelpers::loadWasmContextInstanceNeedsMacroScratchRegister):
(JSC::AssemblyHelpers::storeWasmContextInstanceNeedsMacroScratchRegister):
(JSC::AssemblyHelpers::copyCalleeSavesToEntryFrameCalleeSavesBufferImpl):
* jit/AssemblyHelpers.h:
(JSC::AssemblyHelpers::copyCalleeSavesToVMEntryFrameCalleeSavesBuffer):
(JSC::AssemblyHelpers::copyCalleeSavesToEntryFrameCalleeSavesBuffer):
(JSC::AssemblyHelpers::copyCalleeSavesFromFrameOrRegisterToEntryFrameCalleeSavesBuffer):
* jit/JIT.cpp:
(JSC::JIT::emitEnterOptimizationCheck):
(JSC::JIT::privateCompileExceptionHandlers):
* jit/JITExceptions.cpp:
(JSC::genericUnwind):
* jit/JITOpcodes.cpp:
(JSC::JIT::emit_op_throw):
(JSC::JIT::emit_op_catch):
(JSC::JIT::emitSlow_op_loop_hint):
* jit/JITOpcodes32_64.cpp:
(JSC::JIT::emit_op_throw):
(JSC::JIT::emit_op_catch):
* jit/JITOperations.cpp:
* jit/ThunkGenerators.cpp:
(JSC::throwExceptionFromCallSlowPathGenerator):
(JSC::nativeForGenerator):
* jsc.cpp:
(functionDumpCallFrame):
* llint/LLIntSlowPaths.cpp:
(JSC::LLInt::LLINT_SLOW_PATH_DECL):
* llint/LLIntThunks.cpp:
(JSC::vmEntryRecord):
* llint/LowLevelInterpreter.asm:
* llint/LowLevelInterpreter32_64.asm:
* llint/LowLevelInterpreter64.asm:
* runtime/Options.cpp:
(JSC::recomputeDependentOptions):
* runtime/Options.h:
* runtime/SamplingProfiler.cpp:
(JSC::FrameWalker::FrameWalker):
(JSC::FrameWalker::advanceToParentFrame):
(JSC::SamplingProfiler::processUnverifiedStackTraces):
* runtime/ThrowScope.cpp:
(JSC::ThrowScope::~ThrowScope):
* runtime/VM.cpp:
(JSC::VM::VM):
(JSC::VM::~VM):
* runtime/VM.h:
(JSC::VM::topEntryFrameOffset):
* runtime/VMTraps.cpp:
(JSC::isSaneFrame):
(JSC::VMTraps::tryInstallTrapBreakpoints):
(JSC::VMTraps::invalidateCodeBlocksOnStack):
* wasm/WasmB3IRGenerator.cpp:
(JSC::Wasm::B3IRGenerator::restoreWasmContextInstance):
(JSC::Wasm::B3IRGenerator::B3IRGenerator):
(JSC::Wasm::B3IRGenerator::restoreWebAssemblyGlobalState):
(JSC::Wasm::B3IRGenerator::addGrowMemory):
(JSC::Wasm::B3IRGenerator::addCurrentMemory):
(JSC::Wasm::B3IRGenerator::addCall):
(JSC::Wasm::B3IRGenerator::addCallIndirect):
(JSC::Wasm::parseAndCompile):
* wasm/WasmB3IRGenerator.h:
* wasm/WasmBBQPlan.cpp:
(JSC::Wasm::BBQPlan::BBQPlan):
(JSC::Wasm::BBQPlan::compileFunctions):
(JSC::Wasm::BBQPlan::complete):
* wasm/WasmBBQPlan.h:
* wasm/WasmBBQPlanInlines.h:
(JSC::Wasm::BBQPlan::initializeCallees):
* wasm/WasmBinding.cpp:
(JSC::Wasm::wasmToWasm):
* wasm/WasmBinding.h:
* wasm/WasmCodeBlock.cpp:
(JSC::Wasm::CodeBlock::create):
(JSC::Wasm::CodeBlock::CodeBlock):
(JSC::Wasm::CodeBlock::compileAsync):
(JSC::Wasm::CodeBlock::setCompilationFinished):
* wasm/WasmCodeBlock.h:
(JSC::Wasm::CodeBlock::offsetOfImportStubs):
(JSC::Wasm::CodeBlock::allocationSize):
(JSC::Wasm::CodeBlock::importWasmToEmbedderStub):
(JSC::Wasm::CodeBlock::offsetOfImportWasmToEmbedderStub):
(JSC::Wasm::CodeBlock::wasmToJSCallStubForImport):
(JSC::Wasm::CodeBlock::compilationFinished):
(JSC::Wasm::CodeBlock::jsEntrypointCalleeFromFunctionIndexSpace):
(JSC::Wasm::CodeBlock::wasmEntrypointCalleeFromFunctionIndexSpace):
* wasm/WasmContext.cpp:
(JSC::Wasm::Context::useFastTLS):
(JSC::Wasm::Context::load const):
(JSC::Wasm::Context::store):
* wasm/WasmContext.h:
* wasm/WasmEmbedder.h: Copied from Source/JavaScriptCore/wasm/WasmContext.h.
* wasm/WasmFaultSignalHandler.cpp:
* wasm/WasmFaultSignalHandler.h:
* wasm/WasmFormat.h:
* wasm/WasmInstance.cpp: Copied from Source/JavaScriptCore/wasm/WasmFaultSignalHandler.h.
(JSC::Wasm::Instance::Instance):
(JSC::Wasm::Instance::~Instance):
(JSC::Wasm::Instance::extraMemoryAllocated const):
* wasm/WasmInstance.h: Added.
(JSC::Wasm::Instance::create):
(JSC::Wasm::Instance::finalizeCreation):
(JSC::Wasm::Instance::module):
(JSC::Wasm::Instance::codeBlock):
(JSC::Wasm::Instance::memory):
(JSC::Wasm::Instance::table):
(JSC::Wasm::Instance::loadI32Global const):
(JSC::Wasm::Instance::loadI64Global const):
(JSC::Wasm::Instance::loadF32Global const):
(JSC::Wasm::Instance::loadF64Global const):
(JSC::Wasm::Instance::setGlobal):
(JSC::Wasm::Instance::offsetOfCachedStackLimit):
(JSC::Wasm::Instance::cachedStackLimit const):
(JSC::Wasm::Instance::setCachedStackLimit):
* wasm/WasmMemory.cpp:
(JSC::Wasm::Memory::Memory):
(JSC::Wasm::Memory::create):
(JSC::Wasm::Memory::~Memory):
(JSC::Wasm::Memory::grow):
* wasm/WasmMemory.h:
(JSC::Wasm::Memory::offsetOfMemory):
(JSC::Wasm::Memory::offsetOfSize):
* wasm/WasmMemoryInformation.cpp:
(JSC::Wasm::PinnedRegisterInfo::get):
(JSC::Wasm::PinnedRegisterInfo::PinnedRegisterInfo):
* wasm/WasmMemoryInformation.h:
(JSC::Wasm::PinnedRegisterInfo::toSave const):
* wasm/WasmMemoryMode.cpp: Copied from Source/JavaScriptCore/wasm/WasmFaultSignalHandler.h.
(JSC::Wasm::makeString):
* wasm/WasmMemoryMode.h: Copied from Source/JavaScriptCore/wasm/WasmFaultSignalHandler.h.
* wasm/WasmModule.cpp:
(JSC::Wasm::makeValidationCallback):
(JSC::Wasm::Module::validateSync):
(JSC::Wasm::Module::validateAsync):
(JSC::Wasm::Module::getOrCreateCodeBlock):
(JSC::Wasm::Module::compileSync):
(JSC::Wasm::Module::compileAsync):
* wasm/WasmModule.h:
* wasm/WasmModuleParser.cpp:
(JSC::Wasm::ModuleParser::parseTableHelper):
* wasm/WasmOMGPlan.cpp:
(JSC::Wasm::OMGPlan::OMGPlan):
(JSC::Wasm::OMGPlan::runForIndex):
* wasm/WasmOMGPlan.h:
* wasm/WasmPageCount.h:
(JSC::Wasm::PageCount::isValid const):
* wasm/WasmPlan.cpp:
(JSC::Wasm::Plan::Plan):
(JSC::Wasm::Plan::runCompletionTasks):
(JSC::Wasm::Plan::addCompletionTask):
(JSC::Wasm::Plan::tryRemoveContextAndCancelIfLast):
* wasm/WasmPlan.h:
(JSC::Wasm::Plan::dontFinalize):
* wasm/WasmSignature.cpp:
* wasm/WasmSignature.h:
* wasm/WasmTable.cpp: Added.
(JSC::Wasm::Table::create):
(JSC::Wasm::Table::~Table):
(JSC::Wasm::Table::Table):
(JSC::Wasm::Table::grow):
(JSC::Wasm::Table::clearFunction):
(JSC::Wasm::Table::setFunction):
* wasm/WasmTable.h: Copied from Source/JavaScriptCore/wasm/js/JSWebAssemblyTable.h.
(JSC::Wasm::Table::maximum const):
(JSC::Wasm::Table::size const):
(JSC::Wasm::Table::offsetOfSize):
(JSC::Wasm::Table::offsetOfFunctions):
(JSC::Wasm::Table::offsetOfInstances):
(JSC::Wasm::Table::isValidSize):
* wasm/WasmThunks.cpp:
(JSC::Wasm::throwExceptionFromWasmThunkGenerator):
(JSC::Wasm::triggerOMGTierUpThunkGenerator):
(JSC::Wasm::Thunks::setThrowWasmException):
(JSC::Wasm::Thunks::throwWasmException):
* wasm/WasmThunks.h:
* wasm/WasmWorklist.cpp:
(JSC::Wasm::Worklist::stopAllPlansForContext):
* wasm/WasmWorklist.h:
* wasm/js/JSToWasm.cpp: Added.
(JSC::Wasm::createJSToWasmWrapper):
* wasm/js/JSToWasm.h: Copied from Source/JavaScriptCore/wasm/WasmBinding.h.
* wasm/js/JSWebAssembly.cpp: Renamed from Source/JavaScriptCore/wasm/JSWebAssembly.cpp.
* wasm/js/JSWebAssembly.h: Renamed from Source/JavaScriptCore/wasm/JSWebAssembly.h.
* wasm/js/JSWebAssemblyCodeBlock.cpp:
(JSC::JSWebAssemblyCodeBlock::create):
(JSC::JSWebAssemblyCodeBlock::JSWebAssemblyCodeBlock):
* wasm/js/JSWebAssemblyCodeBlock.h:
* wasm/js/JSWebAssemblyInstance.cpp:
(JSC::JSWebAssemblyInstance::JSWebAssemblyInstance):
(JSC::JSWebAssemblyInstance::finishCreation):
(JSC::JSWebAssemblyInstance::visitChildren):
(JSC::JSWebAssemblyInstance::finalizeCreation):
(JSC::JSWebAssemblyInstance::create):
* wasm/js/JSWebAssemblyInstance.h:
(JSC::JSWebAssemblyInstance::instance):
(JSC::JSWebAssemblyInstance::context const):
(JSC::JSWebAssemblyInstance::table):
(JSC::JSWebAssemblyInstance::webAssemblyToJSCallee):
(JSC::JSWebAssemblyInstance::setMemory):
(JSC::JSWebAssemblyInstance::offsetOfTail):
(JSC::JSWebAssemblyInstance::importFunctionInfo):
(JSC::JSWebAssemblyInstance::offsetOfTargetInstance):
(JSC::JSWebAssemblyInstance::offsetOfWasmEntrypoint):
(JSC::JSWebAssemblyInstance::offsetOfImportFunction):
(JSC::JSWebAssemblyInstance::importFunction):
(JSC::JSWebAssemblyInstance::internalMemory):
(JSC::JSWebAssemblyInstance::wasmCodeBlock const):
(JSC::JSWebAssemblyInstance::offsetOfWasmTable):
(JSC::JSWebAssemblyInstance::offsetOfCallee):
(JSC::JSWebAssemblyInstance::offsetOfGlobals):
(JSC::JSWebAssemblyInstance::offsetOfWasmCodeBlock):
(JSC::JSWebAssemblyInstance::offsetOfWasmMemory):
(JSC::JSWebAssemblyInstance::cachedStackLimit const):
(JSC::JSWebAssemblyInstance::setCachedStackLimit):
(JSC::JSWebAssemblyInstance::wasmMemory):
(JSC::JSWebAssemblyInstance::wasmModule):
(JSC::JSWebAssemblyInstance::allocationSize):
(JSC::JSWebAssemblyInstance::module const):
* wasm/js/JSWebAssemblyMemory.cpp:
(JSC::JSWebAssemblyMemory::create):
(JSC::JSWebAssemblyMemory::adopt):
(JSC::JSWebAssemblyMemory::JSWebAssemblyMemory):
(JSC::JSWebAssemblyMemory::grow):
(JSC::JSWebAssemblyMemory::growSuccessCallback):
* wasm/js/JSWebAssemblyMemory.h:
* wasm/js/JSWebAssemblyModule.cpp:
(JSC::JSWebAssemblyModule::moduleInformation const):
(JSC::JSWebAssemblyModule::exportSymbolTable const):
(JSC::JSWebAssemblyModule::signatureIndexFromFunctionIndexSpace const):
(JSC::JSWebAssemblyModule::callee const):
(JSC::JSWebAssemblyModule::codeBlock):
(JSC::JSWebAssemblyModule::module):
* wasm/js/JSWebAssemblyModule.h:
* wasm/js/JSWebAssemblyTable.cpp:
(JSC::JSWebAssemblyTable::create):
(JSC::JSWebAssemblyTable::JSWebAssemblyTable):
(JSC::JSWebAssemblyTable::visitChildren):
(JSC::JSWebAssemblyTable::grow):
(JSC::JSWebAssemblyTable::getFunction):
(JSC::JSWebAssemblyTable::clearFunction):
(JSC::JSWebAssemblyTable::setFunction):
* wasm/js/JSWebAssemblyTable.h:
(JSC::JSWebAssemblyTable::isValidSize):
(JSC::JSWebAssemblyTable::maximum const):
(JSC::JSWebAssemblyTable::size const):
(JSC::JSWebAssemblyTable::table):
* wasm/js/WasmToJS.cpp: Copied from Source/JavaScriptCore/wasm/WasmBinding.cpp.
(JSC::Wasm::materializeImportJSCell):
(JSC::Wasm::wasmToJS):
(JSC::Wasm::wasmToJSException):
* wasm/js/WasmToJS.h: Copied from Source/JavaScriptCore/wasm/WasmBinding.h.
* wasm/js/WebAssemblyFunction.cpp:
(JSC::callWebAssemblyFunction):
* wasm/js/WebAssemblyInstanceConstructor.cpp:
(JSC::constructJSWebAssemblyInstance):
* wasm/js/WebAssemblyMemoryConstructor.cpp:
(JSC::constructJSWebAssemblyMemory):
* wasm/js/WebAssemblyMemoryPrototype.cpp:
(JSC::webAssemblyMemoryProtoFuncGrow):
* wasm/js/WebAssemblyModuleConstructor.cpp:
(JSC::constructJSWebAssemblyModule):
(JSC::WebAssemblyModuleConstructor::createModule):
* wasm/js/WebAssemblyModuleConstructor.h:
* wasm/js/WebAssemblyModuleRecord.cpp:
(JSC::WebAssemblyModuleRecord::link):
(JSC::WebAssemblyModuleRecord::evaluate):
* wasm/js/WebAssemblyPrototype.cpp:
(JSC::webAssemblyCompileFunc):
(JSC::instantiate):
(JSC::compileAndInstantiate):
(JSC::webAssemblyValidateFunc):
* wasm/js/WebAssemblyTableConstructor.cpp:
(JSC::constructJSWebAssemblyTable):
* wasm/js/WebAssemblyWrapperFunction.cpp:
(JSC::WebAssemblyWrapperFunction::create):

Source/WebCore:

* ForwardingHeaders/wasm/WasmModule.h: Added. This used to be
included in JSWebAssemblyModule.h.
* bindings/js/SerializedScriptValue.cpp: Update postMessage code
according to C++ API changes.

Source/WTF:

* wtf/StdLibExtras.h:
(WTF::default_construct_at): this makes code in WasmTable much
more readable, and is generally useful for generic code

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

2 years ago[AX] Do not trigger redundant layout on tables.
zalan@apple.com [Tue, 3 Oct 2017 18:24:44 +0000 (18:24 +0000)]
[AX] Do not trigger redundant layout on tables.
https://bugs.webkit.org/show_bug.cgi?id=177781
<rdar://problem/34777030>

Reviewed by Antti Koivisto.

Source/WebCore:

RenderTable::forceSectionsRecalc() marks the RenderTable dirty and schedules a layout.
Every time AccessibilityTable asks for the table element (including during construction),
we end up triggering a layout. This call was added (r191357) to ensure RenderTable's m_firstBody is always
up-to-date (in case of anonymous wrapper table renderer). Instead of relying on the m_firstBody,
let's just use the first child to find the table element. The first child always points to a valid
renderer (or nullptr), while m_firstBody is the result of section computation.

Covered by existing tests.

* accessibility/AccessibilityTable.cpp:
(WebCore::AccessibilityTable::tableElement const):

LayoutTests:

* TestExpectations: see webkit.org/b/177799

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

2 years agoRemove no longer needed WebRTC build infrastructure
commit-queue@webkit.org [Tue, 3 Oct 2017 18:09:29 +0000 (18:09 +0000)]
Remove no longer needed WebRTC build infrastructure
https://bugs.webkit.org/show_bug.cgi?id=177756

Patch by Youenn Fablet <youenn@apple.com> on 2017-10-03
Reviewed by Alejandro G. Castro.

Source/ThirdParty/libwebrtc:

* WebKit/project.json: Removed.
* WebKit/rtc_sdk_framework_objc_info_plist.plist: Removed.

Tools:

* Scripts/generate-libwebrtc-cmake: Removed.
* Scripts/webkitpy/libwebrtc/__init__.py: Removed.
* Scripts/webkitpy/libwebrtc/generate_cmake.py: Removed.

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