WebKit-https.git
3 years agohttps://bugs.webkit.org/show_bug.cgi?id=166839
lforschler@apple.com [Mon, 9 Jan 2017 17:39:14 +0000 (17:39 +0000)]
https://bugs.webkit.org/show_bug.cgi?id=166839
Add php7 support for macOS.
Tools:

Mirror the debian logic to look for a php7 module on disk, and return the appropriate apache config file.

Reviewed by Alexey Proskuryakov.

* Scripts/webkitpy/port/base.py:
(Port._is_darwin_php_version_7):
(Port._debian_php_version):
(Port):
(Port._darwin_php_version):
(Port._apache_config_file_name_for_platform):

LayoutTests:

This patch mirrors the solution that debian uses, by adding a php7 specific apache conf file.

Reviewed by Alexey Proskuryakov.

* http/conf/apache2.4-php7-httpd.conf: Added.

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

3 years agoCreate new php7 config, preserving history via svn cp
lforschler@apple.com [Mon, 9 Jan 2017 17:33:15 +0000 (17:33 +0000)]
Create new php7 config, preserving history via svn cp

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

3 years agoEvaluating window named element may return wrong result
dbates@webkit.org [Mon, 9 Jan 2017 17:19:46 +0000 (17:19 +0000)]
Evaluating window named element may return wrong result
https://bugs.webkit.org/show_bug.cgi?id=166792
<rdar://problem/29801059>

Reviewed by Chris Dumez.

* bindings/js/JSDOMWindowProperties.cpp:
(WebCore::jsDOMWindowPropertiesGetOwnPropertySlotNamedItemGetter):

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

3 years agoREGRESSION(r178955): Touching Settings.in doesn't cause JSInternalSettingsGenerated...
cdumez@apple.com [Mon, 9 Jan 2017 16:54:59 +0000 (16:54 +0000)]
REGRESSION(r178955): Touching Settings.in doesn't cause JSInternalSettingsGenerated.cpp to be updated on first build
https://bugs.webkit.org/show_bug.cgi?id=166814

Reviewed by Darin Adler.

Stop using .INTERMEDIATE in DerivedSources.make was it seems to break dependency
chains for some reason. We started using .INTERMEDIATE for scripts that generate
several targets when run a single time. It avoided running the script several
times (once per target) unnecessarily, and fixed issues with parallel builds.

To address the same issue without using .INTERMEDIATE, we now use pattern rules
(i.e. rules that have '%'). As per the documentation [1]:
"Pattern rules may have more than one target. Unlike normal rules, this does not
 act as many different rules with the same prerequisites and recipe. If a pattern
 rule has multiple targets, make knows that the rule’s recipe is responsible for
 making all of the targets. The recipe is executed only once to make all the
 targets".

 We are therefore solving the same problem as with .INTERMEDIATE. However, I have
 confirmed that using pattern rules does not break dependency chains. For example,
 modifying Settings.in re-generates both InternalSettingsGenerated.idl *and*
 JSInternalSettingsGenerated.cpp.

 [1] https://www.gnu.org/software/make/manual/html_node/Pattern-Intro.html#Pattern-Intro

* DerivedSources.make:

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

3 years agoUnreviewed, rolling out r210493 and r210495.
commit-queue@webkit.org [Mon, 9 Jan 2017 16:31:18 +0000 (16:31 +0000)]
Unreviewed, rolling out r210493 and r210495.
https://bugs.webkit.org/show_bug.cgi?id=166842

Causes makeprops.pl to run on every build (Requested by smfr
on #webkit).

Reverted changesets:

"Avoid triggering rebuilds for minor changes of
CSSProperties.json"
https://bugs.webkit.org/show_bug.cgi?id=166810
http://trac.webkit.org/changeset/210493

"Avoid triggering rebuilds for minor changes of
CSSProperties.json"
https://bugs.webkit.org/show_bug.cgi?id=166810
http://trac.webkit.org/changeset/210495

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

3 years agoMarking inspector/debugger/breakpoint-action-log.html as flaky on macOS.
ryanhaddad@apple.com [Mon, 9 Jan 2017 16:02:39 +0000 (16:02 +0000)]
Marking inspector/debugger/breakpoint-action-log.html as flaky on macOS.
https://bugs.webkit.org/show_bug.cgi?id=165772

Unreviewed test gardening.

* platform/mac/TestExpectations:

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

3 years ago[GTK] Should support key and code properties on keyboard events
gns@gnome.org [Mon, 9 Jan 2017 14:14:57 +0000 (14:14 +0000)]
[GTK] Should support key and code properties on keyboard events
https://bugs.webkit.org/show_bug.cgi?id=166759

Reviewed by Carlos Garcia Campos.

Source/WebCore:

This change fixes a bunch of tests which are currently failing, such as:
- fast/events/arrow-keys-on-body.html
- fast/events/constructors/keyboard-event-constructor.html
- fast/events/key-events-in-input-button.html
- fast/events/key-events-in-input-text.html
- fast/events/keyboardevent-code.html
- fast/events/keyboardevent-key.html

* platform/PlatformKeyboardEvent.h:
* platform/gtk/PlatformKeyboardEventGtk.cpp:
(WebCore::PlatformKeyboardEvent::keyValueForGdkKeyCode): match web key value
to GDK key symbol.
(WebCore::PlatformKeyboardEvent::keyCodeForHardwareKeyCode): match web key code
to hardware code as reported by GDK.
(WebCore::PlatformKeyboardEvent::PlatformKeyboardEvent): add web key value and
code to the keyboard event upon creation.

Source/WebKit2:

* Shared/WebEvent.h:
* Shared/WebKeyboardEvent.cpp:
(WebKit::WebKeyboardEvent::WebKeyboardEvent): accept web key value and code on construction.
* Shared/gtk/WebEventFactory.cpp:
(WebKit::WebEventFactory::createWebKeyboardEvent): pass web key value and code on construction.

Source/WTF:

* wtf/FeatureDefines.h: enable key and code properties support for GTK.

Tools:

* WebKitTestRunner/gtk/EventSenderProxyGtk.cpp:
(WTR::getGDKKeySymForKeyRef): add missing modifier keys which were being reported as 'l' and 'r' only
on tests.

LayoutTests:

* platform/gtk/fast/events/keyboardevent-code-expected.txt: Added. Hardware
codes are different for Mac and Linux for a couple of keys, so we need
platform-specific results.

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

3 years ago[Win] Some tests are flaky because certain DLLs are writing to stdout.
pvollan@apple.com [Mon, 9 Jan 2017 12:46:34 +0000 (12:46 +0000)]
[Win] Some tests are flaky because certain DLLs are writing to stdout.
https://bugs.webkit.org/show_bug.cgi?id=166760

Reviewed by Darin Adler.

Some tests are flaky because certain DLLs are writing to stdout, giving incorrect test results.
We can work around that by duplicating and redirecting stdout.

* DumpRenderTree/PixelDumpSupport.cpp:
(dumpWebViewAsPixelsAndCompareWithExpected):
(printPNG):
* DumpRenderTree/win/AccessibilityControllerWin.cpp:
(logEventProc):
* DumpRenderTree/win/DRTDesktopNotificationPresenter.cpp:
(DRTDesktopNotificationPresenter::showDesktopNotification):
(DRTDesktopNotificationPresenter::cancelDesktopNotification):
(DRTDesktopNotificationPresenter::requestNotificationPermission):
* DumpRenderTree/win/DumpRenderTree.cpp:
(dumpFrameScrollPosition):
(dumpHistoryItem):
(dumpBackForwardList):
(dump):
(runTest):
(main):
* DumpRenderTree/win/DumpRenderTreeWin.h:
* DumpRenderTree/win/EditingDelegate.cpp:
(EditingDelegate::shouldBeginEditingInDOMRange):
(EditingDelegate::shouldEndEditingInDOMRange):
(EditingDelegate::shouldInsertNode):
(EditingDelegate::shouldInsertText):
(EditingDelegate::shouldDeleteDOMRange):
(EditingDelegate::shouldChangeSelectedDOMRange):
(EditingDelegate::shouldApplyStyle):
(EditingDelegate::shouldChangeTypingStyle):
(EditingDelegate::doPlatformCommand):
(EditingDelegate::webViewDidBeginEditing):
(EditingDelegate::webViewDidChange):
(EditingDelegate::webViewDidEndEditing):
(EditingDelegate::webViewDidChangeTypingStyle):
(EditingDelegate::webViewDidChangeSelection):
* DumpRenderTree/win/FrameLoadDelegate.cpp:
(FrameLoadDelegate::didStartProvisionalLoadForFrame):
(FrameLoadDelegate::didReceiveServerRedirectForProvisionalLoadForFrame):
(FrameLoadDelegate::didChangeLocationWithinPageForFrame):
(FrameLoadDelegate::didFailProvisionalLoadWithError):
(FrameLoadDelegate::didCommitLoadForFrame):
(FrameLoadDelegate::didReceiveTitle):
(FrameLoadDelegate::didFinishLoadForFrame):
(FrameLoadDelegate::didFailLoadWithError):
(FrameLoadDelegate::willPerformClientRedirectToURL):
(FrameLoadDelegate::didCancelClientRedirectForFrame):
(FrameLoadDelegate::windowScriptObjectAvailable):
(FrameLoadDelegate::didFinishDocumentLoadForFrame):
(FrameLoadDelegate::didHandleOnloadEventsForFrame):
(FrameLoadDelegate::didDisplayInsecureContent):
(FrameLoadDelegate::didRunInsecureContent):
(FrameLoadDelegate::webViewProgressFinishedNotification):
* DumpRenderTree/win/HistoryDelegate.cpp:
(HistoryDelegate::didNavigateWithNavigationData):
(HistoryDelegate::didPerformClientRedirectFromURL):
(HistoryDelegate::didPerformServerRedirectFromURL):
(HistoryDelegate::updateHistoryTitle):
(HistoryDelegate::populateVisitedLinksForWebView):
* DumpRenderTree/win/PolicyDelegate.cpp:
(PolicyDelegate::decidePolicyForNavigationAction):
(PolicyDelegate::unableToImplementPolicyWithError):
* DumpRenderTree/win/ResourceLoadDelegate.cpp:
(ResourceLoadDelegate::willSendRequest):
(ResourceLoadDelegate::didReceiveAuthenticationChallenge):
(ResourceLoadDelegate::didReceiveResponse):
(ResourceLoadDelegate::didFinishLoadingFromDataSource):
(ResourceLoadDelegate::didFailLoadingWithError):
* DumpRenderTree/win/TestRunnerWin.cpp:
(TestRunner::addDisallowedURL):
(TestRunner::originsWithApplicationCache):
(TestRunner::setStorageDatabaseIdleInterval):
(TestRunner::closeIdleLocalStorageDatabases):
(TestRunner::copyDecodedHostName):
(TestRunner::copyEncodedHostName):
(TestRunner::numberOfPendingGeolocationPermissionRequests):
(TestRunner::isGeolocationProviderActive):
(TestRunner::pathToLocalResource):
(TestRunner::setMockDeviceOrientation):
(TestRunner::setMockGeolocationPosition):
(TestRunner::setMockGeolocationPositionUnavailableError):
(TestRunner::setSpatialNavigationEnabled):
(TestRunner::setAutomaticLinkDetectionEnabled):
(TestRunner::isCommandEnabled):
(TestRunner::authenticateSession):
(TestRunner::addChromeInputField):
(TestRunner::removeChromeInputField):
(TestRunner::focusWebView):
(TestRunner::grantWebNotificationPermission):
(TestRunner::denyWebNotificationPermission):
(TestRunner::removeAllWebNotificationPermissions):
(TestRunner::simulateWebNotificationClick):
(TestRunner::imageCountInGeneralPasteboard):
* DumpRenderTree/win/UIDelegate.cpp:
(UIDelegate::runJavaScriptAlertPanelWithMessage):
(UIDelegate::runJavaScriptConfirmPanelWithMessage):
(UIDelegate::runJavaScriptTextInputPanelWithPrompt):
(UIDelegate::runBeforeUnloadConfirmPanelWithMessage):
(UIDelegate::webViewAddMessageToConsole):
(UIDelegate::exceededDatabaseQuota):
(UIDelegate::setStatusText):
(UIDelegate::didPressMissingPluginButton):

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

3 years agoMove cache coders to WTF
antti@apple.com [Mon, 9 Jan 2017 12:43:49 +0000 (12:43 +0000)]
Move cache coders to WTF
https://bugs.webkit.org/show_bug.cgi?id=166825

Rubber-stamped by Sam Weinig.

Source/WebKit2:

* NetworkProcess/cache/NetworkCache.h:
* NetworkProcess/cache/NetworkCacheCoder.h: Removed.
* NetworkProcess/cache/NetworkCacheCoders.cpp:
(WebKit::NetworkCache::Coder<AtomicString>::encode): Deleted.
(WebKit::NetworkCache::Coder<AtomicString>::decode): Deleted.
(WebKit::NetworkCache::Coder<CString>::encode): Deleted.
(WebKit::NetworkCache::Coder<CString>::decode): Deleted.
(WebKit::NetworkCache::Coder<String>::encode): Deleted.
(WebKit::NetworkCache::decodeStringText): Deleted.
(WebKit::NetworkCache::Coder<String>::decode): Deleted.
(WebKit::NetworkCache::Coder<SHA1::Digest>::encode): Deleted.
(WebKit::NetworkCache::Coder<SHA1::Digest>::decode): Deleted.
(WebKit::NetworkCache::Coder<WebCore::HTTPHeaderMap>::encode): Deleted.
(WebKit::NetworkCache::Coder<WebCore::HTTPHeaderMap>::decode): Deleted.
* NetworkProcess/cache/NetworkCacheCoders.h:
(): Deleted.
(WebKit::NetworkCache::Coder<std::optional<T>>::encode): Deleted.
(WebKit::NetworkCache::Coder<std::optional<T>>::decode): Deleted.
* NetworkProcess/cache/NetworkCacheCodersCocoa.cpp:
(WebKit::NetworkCache::encodeCFData): Deleted.
(WebKit::NetworkCache::decodeCFData): Deleted.
(WebKit::NetworkCache::encodeSecTrustRef): Deleted.
(WebKit::NetworkCache::decodeSecTrustRef): Deleted.
(WebKit::NetworkCache::encodeCertificateChain): Deleted.
(WebKit::NetworkCache::decodeCertificateChain): Deleted.
(WebKit::NetworkCache::Coder<WebCore::CertificateInfo>::encode): Deleted.
(WebKit::NetworkCache::Coder<WebCore::CertificateInfo>::decode): Deleted.
* NetworkProcess/cache/NetworkCacheDecoder.cpp: Removed.
* NetworkProcess/cache/NetworkCacheDecoder.h: Removed.
* NetworkProcess/cache/NetworkCacheEncoder.cpp: Removed.
* NetworkProcess/cache/NetworkCacheEncoder.h: Removed.
* NetworkProcess/cache/NetworkCacheEntry.cpp:
(WebKit::NetworkCache::Entry::encodeAsStorageRecord):
(WebKit::NetworkCache::Entry::decodeStorageRecord):
* NetworkProcess/cache/NetworkCacheKey.cpp:
(WebKit::NetworkCache::Key::encode):
(WebKit::NetworkCache::Key::decode):
* NetworkProcess/cache/NetworkCacheKey.h:
* NetworkProcess/cache/NetworkCacheStorage.cpp:
(WebKit::NetworkCache::decodeRecordMetaData):
(WebKit::NetworkCache::encodeRecordMetaData):
* NetworkProcess/cache/NetworkCacheSubresourcesEntry.cpp:
(WebKit::NetworkCache::SubresourceInfo::encode):
(WebKit::NetworkCache::SubresourceInfo::decode):
(WebKit::NetworkCache::SubresourcesEntry::encodeAsStorageRecord):
(WebKit::NetworkCache::SubresourcesEntry::decodeStorageRecord):
* NetworkProcess/cache/NetworkCacheSubresourcesEntry.h:
* UIProcess/API/APIUserContentExtensionStore.cpp:
(API::encodeContentExtensionMetaData):
(API::decodeContentExtensionMetaData):
* WebKit2.xcodeproj/project.pbxproj:

Source/WTF:

Make it possible to use robust serialization of WTF types on the lower levels of the stack.

* WTF.xcodeproj/project.pbxproj:
* wtf/persistence: Added.
* wtf/persistence/Coder.h: Copied from Source/WebKit2/NetworkProcess/cache/NetworkCacheCoder.h.
(WebKit::NetworkCache::Coder::encode): Deleted.
(WebKit::NetworkCache::Coder::decode): Deleted.
* wtf/persistence/Coders.cpp: Copied from Source/WebKit2/NetworkProcess/cache/NetworkCacheCoders.cpp.
(WebKit::NetworkCache::Coder<AtomicString>::encode): Deleted.
(WebKit::NetworkCache::Coder<AtomicString>::decode): Deleted.
(WebKit::NetworkCache::Coder<CString>::encode): Deleted.
(WebKit::NetworkCache::Coder<CString>::decode): Deleted.
(WebKit::NetworkCache::Coder<String>::encode): Deleted.
(WebKit::NetworkCache::decodeStringText): Deleted.
(WebKit::NetworkCache::Coder<String>::decode): Deleted.
(WebKit::NetworkCache::Coder<SHA1::Digest>::encode): Deleted.
(WebKit::NetworkCache::Coder<SHA1::Digest>::decode): Deleted.
(WebKit::NetworkCache::Coder<WebCore::HTTPHeaderMap>::encode): Deleted.
(WebKit::NetworkCache::Coder<WebCore::HTTPHeaderMap>::decode): Deleted.
* wtf/persistence/Coders.h: Copied from Source/WebKit2/NetworkProcess/cache/NetworkCacheCoders.h.
(WebKit::NetworkCache::Coder<std::optional<T>>::encode): Deleted.
(WebKit::NetworkCache::Coder<std::optional<T>>::decode): Deleted.
* wtf/persistence/Decoder.cpp: Copied from Source/WebKit2/NetworkProcess/cache/NetworkCacheDecoder.cpp.
(WebKit::NetworkCache::Decoder::Decoder): Deleted.
(WebKit::NetworkCache::Decoder::~Decoder): Deleted.
(WebKit::NetworkCache::Decoder::bufferIsLargeEnoughToContain): Deleted.
(WebKit::NetworkCache::Decoder::decodeFixedLengthData): Deleted.
(WebKit::NetworkCache::Decoder::decodeNumber): Deleted.
(WebKit::NetworkCache::Decoder::decode): Deleted.
(WebKit::NetworkCache::Decoder::verifyChecksum): Deleted.
* wtf/persistence/Decoder.h: Copied from Source/WebKit2/NetworkProcess/cache/NetworkCacheDecoder.h.
(WebKit::NetworkCache::Decoder::length): Deleted.
(WebKit::NetworkCache::Decoder::currentOffset): Deleted.
(WebKit::NetworkCache::Decoder::decodeEnum): Deleted.
(WebKit::NetworkCache::Decoder::decode): Deleted.
(WebKit::NetworkCache::Decoder::bufferIsLargeEnoughToContain): Deleted.
* wtf/persistence/Encoder.cpp: Copied from Source/WebKit2/NetworkProcess/cache/NetworkCacheEncoder.cpp.
(WebKit::NetworkCache::Encoder::Encoder): Deleted.
(WebKit::NetworkCache::Encoder::~Encoder): Deleted.
(WebKit::NetworkCache::Encoder::grow): Deleted.
(WebKit::NetworkCache::Encoder::updateChecksumForData): Deleted.
(WebKit::NetworkCache::Encoder::encodeFixedLengthData): Deleted.
(WebKit::NetworkCache::Encoder::encodeNumber): Deleted.
(WebKit::NetworkCache::Encoder::encode): Deleted.
(WebKit::NetworkCache::Encoder::encodeChecksum): Deleted.
* wtf/persistence/Encoder.h: Copied from Source/WebKit2/NetworkProcess/cache/NetworkCacheEncoder.h.
(WebKit::NetworkCache::Encoder::encodeEnum): Deleted.
(WebKit::NetworkCache::Encoder::encode): Deleted.
(WebKit::NetworkCache::Encoder::operator<<): Deleted.
(WebKit::NetworkCache::Encoder::buffer): Deleted.
(WebKit::NetworkCache::Encoder::bufferSize): Deleted.
(WebKit::NetworkCache::Encoder::updateChecksumForNumber): Deleted.

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

3 years ago[GTK] WebProcess from WebKitGtk+ 2.15.2 SIGSEGVs in std::unique_ptr<SoupBuffer, WTF...
carlosgc@webkit.org [Mon, 9 Jan 2017 12:12:14 +0000 (12:12 +0000)]
[GTK] WebProcess from WebKitGtk+ 2.15.2 SIGSEGVs in std::unique_ptr<SoupBuffer, WTF::GPtrDeleter<SoupBuffer> >::get() const () at /usr/include/c++/6/bits/unique_ptr.h:305
https://bugs.webkit.org/show_bug.cgi?id=165848

Reviewed by Michael Catanzaro.

In r208881 several locks were added to ImageDecoder to prevent frameBufferAtIndex() from being called by multiple
threads at the same time, but I forgot isSizeAvailable() also calls frameBufferAtIndex(). However, what we
really need to protect is the GIFImageDecoder, to never allow decoding from more than one thread at the same
time. This patch reverts r208881 and adds a lock to GIFImageDecoder::decode() instead.

* platform/image-decoders/ImageDecoder.cpp:
(WebCore::ImageDecoder::frameIsCompleteAtIndex):
(WebCore::ImageDecoder::frameDurationAtIndex):
(WebCore::ImageDecoder::createFrameImageAtIndex):
* platform/image-decoders/ImageDecoder.h:
* platform/image-decoders/gif/GIFImageDecoder.cpp:
(WebCore::GIFImageDecoder::decode):
* platform/image-decoders/gif/GIFImageDecoder.h:

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

3 years ago[GTK] Replace WebKitWebSettings with WebKitSettings in documentation
tpopela@redhat.com [Mon, 9 Jan 2017 11:25:49 +0000 (11:25 +0000)]
[GTK] Replace WebKitWebSettings with WebKitSettings in documentation
https://bugs.webkit.org/show_bug.cgi?id=166836

Reviewed by Carlos Garcia Campos.

Don't use WebKitWebSettings (it was a WebKit1 thing) in documentation,
but replace it with WebKitSettings.

* UIProcess/API/gtk/WebKitSettings.cpp:
(webkit_settings_class_init):
* UIProcess/API/gtk/WebKitWebView.cpp:

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

3 years ago[OWR] Unskip fast/mediastream/MediaStream-video-element-track-stop.html
commit-queue@webkit.org [Mon, 9 Jan 2017 11:03:35 +0000 (11:03 +0000)]
[OWR] Unskip fast/mediastream/MediaStream-video-element-track-stop.html
https://bugs.webkit.org/show_bug.cgi?id=165316

Patch by Alejandro G. Castro <alex@igalia.com> on 2017-01-09
Reviewed by Philippe Normand.

Source/WebCore:

Fixed the ended support of the video element in the OWR player and
fixed the videoTracks support. Now the OW player properly adds and
removes the audio and video tracks. Added the getSettings support
to the mediastream interface. Solved also the size handling in
some of the enable/muted situations.

Unskipping fast/mediastream/MediaStream-video-element-track-stop.html.

* platform/GStreamer.cmake: Added the new
RealtimeMediaSourceOwr.cpp with the new code handling the
settings.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerOwr.cpp:
(WebCore::MediaPlayerPrivateGStreamerOwr::~MediaPlayerPrivateGStreamerOwr):
Release the new video and audio maps that creates a relationship
of the mediastream tracks with the mediatracks of the video element.
(WebCore::MediaPlayerPrivateGStreamerOwr::play): Set ended to
false when we start playing.
(WebCore::MediaPlayerPrivateGStreamerOwr::load): Create the media
tracks to the player so that the videoTracks API returns it, and
add an entry in the map to be able to restore it using the
mediastream track.
(WebCore::MediaPlayerPrivateGStreamerOwr::disableMediaTracks):
Move some part of the stop function to this one in order to use it
in pause method and avoid changing the video selection in that
case.
(WebCore::MediaPlayerPrivateGStreamerOwr::stop): Now we call the
function disableMediaTracks and we also change teh selected
videoTrack.
(WebCore::MediaPlayerPrivateGStreamerOwr::trackEnded): For
videoTrack reset the size and the selected element. In case there
is no media playing we Make sure we set the ended variable to true
and call the timeChange to modify the state of the player.
(WebCore::MediaPlayerPrivateGStreamerOwr::trackEnabledChanged):
Handle properly the situation when the user changed the enabled
value, we disable the media.
(WebCore::MediaPlayerPrivateGStreamerOwr::setSize): Modify the
size of the source.
(WebCore::MediaPlayerPrivateGStreamerOwr::naturalSize): Overrided
to make sure we return a size even when the sample is not ready
for gst.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerOwr.h:
Added the ended attribute and the maps.
* platform/mediastream/openwebrtc/MediaEndpointOwr.cpp:
(WebCore::MediaEndpointOwr::createMutedRemoteSource): Use the new
realtime video and audio sources classes, this new classes
implement the settings of each type of media element.
* platform/mediastream/openwebrtc/RealtimeMediaSourceCenterOwr.cpp:
(WebCore::RealtimeMediaSourceCenterOwr::mediaSourcesAvailable):
Use the new audio and video source classes instead of the general
one in order to handle the settings properly.
* platform/mediastream/openwebrtc/RealtimeMediaSourceOwr.cpp: Added
(WebCore::RealtimeMediaSourceOwr::settings): Initialize using the
subclass and return the new currentSettings attribute.
(WebCore::RealtimeMediaSourceOwr::supportedConstraints): Call the
subclass initialization of the supportedSettings.
* platform/mediastream/openwebrtc/RealtimeMediaSourceOwr.h:
(WebCore::RealtimeMediaSourceOwr::initializeSettings): Added to
initialize the settings before returning the value. Implemented in
the subclass.
(WebCore::RealtimeMediaSourceOwr::initializeSupportedConstraints):
Added to initialize the supported settings of the
media. Implemented in the subclass.
(WebCore::RealtimeMediaSourceOwr::settings): Moved to the cpp
file, implemented using the initialize functions of the subclass
* platform/mediastream/openwebrtc/RealtimeVideoSourceOwr.h: Added
this new class to handle the settings of the video elements. The
class initializes the settings and the supportedSettings.
* platform/mediastream/openwebrtc/RealtimeAudioSourceOwr.h: Added
this new class to handle the settings of the audio elements. The
class initializes the settings and the supportedSettings.

LayoutTests:

* platform/gtk/TestExpectations: Unskipped the test and moved the
stop one, now it does not timeout because we correctly handle the
ended value but still fails, we need more features in the mock
classes for owr.

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

3 years agoInject MarkedSpace size classes for a few more high-volume objects.
akling@apple.com [Mon, 9 Jan 2017 05:35:14 +0000 (05:35 +0000)]
Inject MarkedSpace size classes for a few more high-volume objects.
<https://webkit.org/b/166815>

Reviewed by Darin Adler.

Add the following classes to the list of manually injected size classes:

    - JSString
    - JSFunction
    - PropertyTable
    - Structure

Only Structure actually ends up with a new size class, the others already
can't get any tighter due to the current MarkedBlock::atomSize being 16.
I've put them in anyway to ensure that we have optimally carved-out cells
for them in the future, should they grow.

With this change, Structures get allocated in 128-byte cells instead of
160-byte cells, giving us 25% more Structures per MarkedBlock.

* heap/MarkedSpace.cpp:

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

3 years agoUnreviewed, since this test is slow it should run in fewer configurations. This resol...
fpizlo@apple.com [Mon, 9 Jan 2017 04:12:17 +0000 (04:12 +0000)]
Unreviewed, since this test is slow it should run in fewer configurations. This resolves the
occasional timeouts I was seeing.

* js/script-tests/regress-139548.js:

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

3 years agoIntroduce CPU(X86_SSE2) instead of various SSE2 checks
annulen@yandex.ru [Sun, 8 Jan 2017 17:44:57 +0000 (17:44 +0000)]
Introduce CPU(X86_SSE2) instead of various SSE2 checks
https://bugs.webkit.org/show_bug.cgi?id=166808

Reviewed by Michael Catanzaro.

Now copyLCharsFromUCharSource can use SSE2 implementation on non-Darwin
OSes, and all SSE2 code paths are available for MSVC on x86 if /arch:SSE2
or higher is enabled, and for MSVC on x86_64.

Source/WebCore:

No new tests needed.

* platform/audio/SincResampler.cpp:
(WebCore::SincResampler::process):
* platform/audio/VectorMath.cpp:
(WebCore::VectorMath::vsma):
(WebCore::VectorMath::vsmul):
(WebCore::VectorMath::vadd):
(WebCore::VectorMath::vmul):
(WebCore::VectorMath::zvmul):
(WebCore::VectorMath::vsvesq):
(WebCore::VectorMath::vmaxmgv):

Source/WTF:

* wtf/Platform.h:
* wtf/text/ASCIIFastPath.h:
(WTF::copyLCharsFromUCharSource):

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

3 years agoAvoid triggering rebuilds for minor changes of CSSProperties.json
simon.fraser@apple.com [Sun, 8 Jan 2017 06:02:25 +0000 (06:02 +0000)]
Avoid triggering rebuilds for minor changes of CSSProperties.json
https://bugs.webkit.org/show_bug.cgi?id=166810

Post-review cleanup suggested by Darin Adler.

* css/makeprop.pl:

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

3 years agoAdd a setting to create editable MiniBrowser windows by default
timothy_horton@apple.com [Sun, 8 Jan 2017 01:22:46 +0000 (01:22 +0000)]
Add a setting to create editable MiniBrowser windows by default
https://bugs.webkit.org/show_bug.cgi?id=166806

Reviewed by Beth Dakin.

* MiniBrowser/mac/AppDelegate.m:
(-[BrowserAppDelegate createBrowserWindowController:]):
(-[BrowserAppDelegate applicationDidFinishLaunching:]):
(-[BrowserAppDelegate _updateNewWindowKeyEquivalents]):
* MiniBrowser/mac/SettingsController.h:
* MiniBrowser/mac/SettingsController.m:
(-[SettingsController _populateMenu]):
(-[SettingsController validateMenuItem:]):
(-[SettingsController toggleCreateEditorByDefault:]):
(-[SettingsController createEditorByDefault]):
Add a setting and update the key equivalents accordingly.
Also make sure to make the right kind of window on launch.

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

3 years agoAvoid triggering rebuilds for minor changes of CSSProperties.json
simon.fraser@apple.com [Sat, 7 Jan 2017 23:39:32 +0000 (23:39 +0000)]
Avoid triggering rebuilds for minor changes of CSSProperties.json
https://bugs.webkit.org/show_bug.cgi?id=166810

Reviewed by Daniel Bates.

We expect to make lots of metadata-related changes to CSSProperties.json, and
these should not trigger rebuilds.

Have makeprop.pl write to temporary files first, then only replace the generated
files if the contents differ.

* css/makeprop.pl:
(replaceFileIfChanged):

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

3 years agoRemove PassRefPtr use from "inspector", "platform/sql", and "platform/text"
darin@apple.com [Sat, 7 Jan 2017 22:08:28 +0000 (22:08 +0000)]
Remove PassRefPtr use from "inspector", "platform/sql", and "platform/text"
https://bugs.webkit.org/show_bug.cgi?id=166797

Reviewed by Alex Christensen.

Source/WebCore:

* Modules/webdatabase/Database.cpp:
(WebCore::Database::performOpenAndVerify): Pass a reference instead of a pointer.

* dom/Document.cpp:
(WebCore::canonicalizedTitle): Map backslashes to currency symbols inside the
existing loop through the characters instead of calling a function confusingly
named "displayBuffer" to do it. More straightforward, possibly more efficient,
one less function.
(WebCore::Document::displayStringModifiedByEncoding): Call replace to map
backslashes to currency symbols instead of calling a special displayString
function. There was no real benefit to using that function; the String::replace
function has all the same optimizations, and this was also the only call site.

* editing/SpellChecker.cpp:
(WebCore::SpellChecker::invokeRequest): Pass a reference instead of a pointer.

* inspector/InspectorOverlay.cpp:
(WebCore::InspectorOverlay::overlayPage): Call createEmptyEditorClient instead
of using the class EmptyEditorClient directly.

* loader/EmptyClients.cpp: Moved most of the empty clients here from the header.
Also made lots more things private.
(WebCore::createEmptyEditorClient): Added.
(WebCore::emptyDiagnosticLoggingClient): Added.
* loader/EmptyClients.h: Updated for above changes. Made more things private.

* page/DatabaseProvider.h: Removed unneeded include.
* page/MainFrame.cpp: Ditto.

* page/Page.cpp:
(WebCore::Page::diagnosticLoggingClient): Call emptyDiagnosticLoggingClient
instead of using the class EmptyDiagnosticLoggingClient directly.

* platform/sql/SQLiteDatabase.cpp:
(WebCore::SQLiteDatabase::setAuthorizer): Take a reference instead of a
PassRefPtr.
* platform/sql/SQLiteDatabase.h: Updated for above.

* platform/text/BidiContext.cpp:
(WebCore::BidiContext::BidiContext): Moved this function here from the header.
(WebCore::copyContextAndRebaselineLevel): Return a Ref instead of a PassRefPtr,
and take a reference rather than a raw pointer.
(WebCore::BidiContext::copyStackRemovingUnicodeEmbeddingContexts): Return a
Ref instead of a PassRefPtr.
* platform/text/BidiContext.h: Updated for the above changes.

* platform/text/BidiResolver.h: Simplify initialization, use more references,
auto, modern for loops, refer to derived class as that rather than the non-C++
term subclass.

* platform/text/TextCheckerClient.h: Changd argument from PassRefPtr to a
reference.

* platform/text/TextEncoding.h:
(WebCore::TextEncoding::displayString): Deleted.
(WebCore::TextEncoding::displayBuffer): Deleted.

* rendering/RootInlineBox.cpp: Style tweaks and use a modern for loop.

* svg/graphics/SVGImage.cpp:
(WebCore::SVGImage::dataChanged): Call createEmptyEditorClient instead
of using the class EmptyEditorClient directly.

Source/WebKit/mac:

* WebCoreSupport/WebEditorClient.h: Updated to take a reference.
* WebCoreSupport/WebEditorClient.mm:
(WebEditorClient::requestCheckingOfString): Take a reference
instead of a PassRefPtr.

Source/WebKit/win:

* WebCoreSupport/WebEditorClient.h: Update argument to take a reference
instead of a PassRefPtr.

Source/WebKit2:

* WebProcess/WebCoreSupport/WebEditorClient.cpp:
(WebKit::WebEditorClient::requestCheckingOfString): Take a reference
instead of a PassRefPtr.
* WebProcess/WebCoreSupport/WebEditorClient.h: Updated for above change.

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

3 years ago[QuickLook] Update quicklook test expectations
aestes@apple.com [Sat, 7 Jan 2017 21:29:57 +0000 (21:29 +0000)]
[QuickLook] Update quicklook test expectations
https://bugs.webkit.org/show_bug.cgi?id=166798
<rdar://problem/26477735>

Reviewed by Alex Christensen.

Source/WebCore:

QuickLook uses UUIDs to generate x-apple-ql-id: URLs, so they will differ each time a
document is previewed. Since these URLs are included in QuickLook layout test results,
WebArchiveDumpSupport needs to replace them with predictable values when dumping a web
archive.

* testing/cocoa/WebArchiveDumpSupport.mm:
(WebCoreTestSupport::quickLookURLReplacements): Created a static Vector of CFStringRef pairs
to store x-apple-ql-id: URLs and their replacement values.
(WebCoreTestSupport::normalizeWebResourceURL): If the URL starts with “x-apple-ql-id://”,
replace the text between the scheme and the file extension with “resource”. Store the
original URL along with its replacement in quickLookURLReplacements().
(WebCoreTestSupport::createXMLStringFromWebArchiveData): Replaced all QuickLook URLs in the
final XML text with their replacement URLs.

LayoutTests:

For documents that generate HTML previews, updated the expected results to be web archives.
Web archives capture the same information that the expected HTML files did, but allow for
easy rebasing with --reset-results.

For documents that generate PDF previews, a webarchive expected result is inappropriate
since the generated PDF will differ between runs due to changing metadata (e.g. creation
date). These tests were kept as reftests but with updated expected results.

* platform/ios-simulator/TestExpectations: Unskipped quicklook/.
* quicklook/excel-expected.html: Removed.
* quicklook/excel-expected.txt: Added.
* quicklook/excel-legacy-expected.html: Removed.
* quicklook/excel-legacy-expected.txt: Added.
* quicklook/excel-legacy.html: Updated to dump as webarchive.
* quicklook/excel.html: Ditto.
* quicklook/keynote-09-expected.html: Removed.
* quicklook/keynote-09-expected.txt: Added.
* quicklook/keynote-09.html: Updated to dump as webarchive.
* quicklook/numbers-09-expected.html: Removed.
* quicklook/numbers-09-expected.txt: Added.
* quicklook/numbers-09.html: Updated to dump as webarchive.
* quicklook/pages-09-expected.html: Removed.
* quicklook/pages-09-expected.txt: Added.
* quicklook/pages-09.html: Updated to dump as webarchive.
* quicklook/powerpoint-expected.html: Removed.
* quicklook/powerpoint-expected.txt: Added.
* quicklook/powerpoint-legacy-expected.html: Removed.
* quicklook/powerpoint-legacy-expected.txt: Added.
* quicklook/powerpoint-legacy.html: Updated to dump as webarchive.
* quicklook/powerpoint.html: Updated to dump as webarchive.
* quicklook/resources/excel-expected.html: Removed.
* quicklook/resources/excel-legacy-expected.html: Removed.
* quicklook/resources/keynote-09-expected/index.css: Removed.
* quicklook/resources/keynote-09-expected/index.html: Removed.
* quicklook/resources/keynote-09-expected/index.js: Removed.
* quicklook/resources/keynote-expected.pdf: Updated.
* quicklook/resources/numbers-09-expected/canvas.js: Removed.
* quicklook/resources/numbers-09-expected/index.html: Removed.
* quicklook/resources/numbers-09-expected/navigation.css: Removed.
* quicklook/resources/numbers-09-expected/navigation.html: Removed.
* quicklook/resources/numbers-09-expected/sheet_1.html: Removed.
* quicklook/resources/numbers-expected.pdf: Updated.
* quicklook/resources/pages-09-expected/index.css: Removed.
* quicklook/resources/pages-09-expected/index.html: Removed.
* quicklook/resources/pages-expected.pdf: Updated.
* quicklook/resources/powerpoint-expected.html: Removed.
* quicklook/resources/powerpoint-legacy-expected.html: Removed.
* quicklook/resources/webkit-icon.pdf: Removed.
* quicklook/resources/webkit-icon.png: Removed.
* quicklook/resources/webkit-icon.tiff: Removed.
* quicklook/resources/word-expected.html: Removed.
* quicklook/resources/word-legacy-expected.html: Removed.
* quicklook/word-expected.html: Removed.
* quicklook/word-expected.txt: Added.
* quicklook/word-legacy-expected.html: Removed.
* quicklook/word-legacy-expected.txt: Added.
* quicklook/word-legacy.html: Updated to dump as webarchive.
* quicklook/word.html: Updated to dump as webarchive.

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

3 years agoFix the 32-bit build.
timothy_horton@apple.com [Sat, 7 Jan 2017 21:23:39 +0000 (21:23 +0000)]
Fix the 32-bit build.

* MiniBrowser/mac/BrowserWindowController.h:
* MiniBrowser/mac/BrowserWindowController.m:

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

3 years agoFix the 32-bit build.
timothy_horton@apple.com [Sat, 7 Jan 2017 21:18:13 +0000 (21:18 +0000)]
Fix the 32-bit build.

* MiniBrowser/mac/BrowserWindowController.m:

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

3 years agoMake it possible to drop HTML files on the MiniBrowser icon
timothy_horton@apple.com [Sat, 7 Jan 2017 21:15:55 +0000 (21:15 +0000)]
Make it possible to drop HTML files on the MiniBrowser icon
https://bugs.webkit.org/show_bug.cgi?id=166802

Reviewed by Simon Fraser.

* MiniBrowser/mac/AppDelegate.m:
(-[BrowserAppDelegate application:openFile:]):
* MiniBrowser/mac/Info.plist:
If you're using an editable window, the usual trick of dropping on the
window doesn't work anymore (it makes an <attachment> instead).

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

3 years agoMiniBrowser window gets smaller each time it is instantiated
timothy_horton@apple.com [Sat, 7 Jan 2017 21:13:10 +0000 (21:13 +0000)]
MiniBrowser window gets smaller each time it is instantiated
https://bugs.webkit.org/show_bug.cgi?id=166807

Reviewed by Andy Estes.

* MiniBrowser/mac/BrowserWindowController.m:
(-[BrowserWindowController windowDidLoad]):
* MiniBrowser/mac/BrowserWindow.xib:
Turn on full-window content view support with IB, instead of waiting
until after the views have been loaded. This seems to resolve the
longstanding ever-shrinking-window problem.

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

3 years agoAdd indent/outdent items to MiniBrowser's new format menu
timothy_horton@apple.com [Sat, 7 Jan 2017 21:12:26 +0000 (21:12 +0000)]
Add indent/outdent items to MiniBrowser's new format menu
https://bugs.webkit.org/show_bug.cgi?id=166805

Reviewed by Dan Bernstein.

* MiniBrowser/mac/MainMenu.xib:

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

3 years agoAdd a stock Format menu to MiniBrowser
timothy_horton@apple.com [Sat, 7 Jan 2017 21:11:53 +0000 (21:11 +0000)]
Add a stock Format menu to MiniBrowser
https://bugs.webkit.org/show_bug.cgi?id=166804

Reviewed by Andy Estes.

* MiniBrowser/mac/MainMenu.xib:
Many of the features automatically work with editable web views.
However, this seems to expose a bug where none of the font-related features
(Cmd-B, for example) work until the first time the font panel is shown,
per process, which will need to be investigated separately.

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

3 years agoRemove unused applicationWillTerminate methods from MiniBrowser
timothy_horton@apple.com [Sat, 7 Jan 2017 21:11:02 +0000 (21:11 +0000)]
Remove unused applicationWillTerminate methods from MiniBrowser
https://bugs.webkit.org/show_bug.cgi?id=166803

Reviewed by Andy Estes.

* MiniBrowser/mac/AppDelegate.m:
(-[BrowserAppDelegate applicationWillTerminate:]): Deleted.
* MiniBrowser/mac/BrowserWindowController.h:
* MiniBrowser/mac/BrowserWindowController.m:
(-[BrowserWindowController applicationTerminating]): Deleted.
* MiniBrowser/mac/WK1BrowserWindowController.m:
(-[WK1BrowserWindowController applicationTerminating]): Deleted.
* MiniBrowser/mac/WK2BrowserWindowController.m:
(-[WK2BrowserWindowController applicationTerminating]): Deleted.

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

3 years agoAdd the ability to create empty contentEditable windows in MiniBrowser
timothy_horton@apple.com [Sat, 7 Jan 2017 21:10:21 +0000 (21:10 +0000)]
Add the ability to create empty contentEditable windows in MiniBrowser
https://bugs.webkit.org/show_bug.cgi?id=166801

Reviewed by Wenson Hsieh.

* MiniBrowser/mac/AppDelegate.h:
* MiniBrowser/mac/AppDelegate.m:
(-[BrowserAppDelegate createBrowserWindowController:]):
(-[BrowserAppDelegate newWindow:]):
(-[BrowserAppDelegate newEditorWindow:]):
(-[BrowserAppDelegate openDocument:]):
(-[BrowserAppDelegate _updateNewWindowKeyEquivalents]):
* MiniBrowser/mac/BrowserWindowController.h:
* MiniBrowser/mac/BrowserWindowController.m:
(-[BrowserWindowController loadHTMLString:]):
(-[BrowserWindowController toggleEditable:]):
* MiniBrowser/mac/MainMenu.xib:
* MiniBrowser/mac/WK1BrowserWindowController.m:
(-[WK1BrowserWindowController awakeFromNib]):
(-[WK1BrowserWindowController loadHTMLString:]):
(-[WK1BrowserWindowController validateMenuItem:]):
(-[WK1BrowserWindowController setEditable:]):
(-[WK1BrowserWindowController updateTitle:]):
* MiniBrowser/mac/WK2BrowserWindowController.m:
(-[WK2BrowserWindowController awakeFromNib]):
(-[WK2BrowserWindowController validateMenuItem:]):
(-[WK2BrowserWindowController setEditable:]):
(-[WK2BrowserWindowController updateTitle:]):
(-[WK2BrowserWindowController loadHTMLString:]):
Merge more functionality from WebEditingTester.
Add two menu items for creating empty editable WebKit1/2 windows.
Add a menu item to the Edit menu to toggle editability on any window.

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

3 years agoImplement find-in-page in MiniBrowser
timothy_horton@apple.com [Sat, 7 Jan 2017 21:09:41 +0000 (21:09 +0000)]
Implement find-in-page in MiniBrowser
https://bugs.webkit.org/show_bug.cgi?id=166799

Reviewed by Andy Estes.

* MiniBrowser/mac/BrowserWindow.xib:
* MiniBrowser/mac/BrowserWindowController.h:
* MiniBrowser/mac/BrowserWindowController.m:
(-[BrowserWindowController find:]): Deleted.
* MiniBrowser/mac/MainMenu.xib:
* MiniBrowser/mac/WK1BrowserWindowController.m:
(-[WK1BrowserWindowController toggleShrinkToFit:]):
(-[WK1BrowserWindowController find:]): Deleted.
* MiniBrowser/mac/WK2BrowserWindowController.m:
(-[WK2BrowserWindowController awakeFromNib]):
(-[WK2BrowserWindowController dealloc]):
(-[WK2BrowserWindowController validateMenuItem:]):
(-[WK2BrowserWindowController performTextFinderAction:]):
(-[WK2BrowserWindowController findBarView]):
(-[WK2BrowserWindowController setFindBarView:]):
(-[WK2BrowserWindowController isFindBarVisible]):
(-[WK2BrowserWindowController setFindBarVisible:]):
(-[WK2BrowserWindowController contentView]):
(-[WK2BrowserWindowController findBarViewDidChangeHeight]):
(-[WK2BrowserWindowController performFindPanelAction:]): Deleted.
(-[WK2BrowserWindowController find:]): Deleted.
Implement find-in-page using WKWebView's conformance to the NSTextFinderClient
protocol. At first glance, it's pretty broken, but vaguely works.

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

3 years agoShare the implementation of MiniBrowser view hiding functionality
timothy_horton@apple.com [Sat, 7 Jan 2017 21:08:43 +0000 (21:08 +0000)]
Share the implementation of MiniBrowser view hiding functionality
https://bugs.webkit.org/show_bug.cgi?id=166800

Reviewed by Andy Estes.

* MiniBrowser/mac/BrowserWindowController.m:
(-[BrowserWindowController showHideWebView:]):
(-[BrowserWindowController removeReinsertWebView:]):
* MiniBrowser/mac/WK1BrowserWindowController.m:
(-[WK1BrowserWindowController showHideWebView:]): Deleted.
(-[WK1BrowserWindowController removeReinsertWebView:]): Deleted.
* MiniBrowser/mac/WK2BrowserWindowController.m:
(-[WK2BrowserWindowController showHideWebView:]): Deleted.
(-[WK2BrowserWindowController removeReinsertWebView:]): Deleted.
Move the implementation of these two things to the shared superclass,
since they don't depend on WebKit-specific things.
Also, there was no reason to retain the (WK)WebView while it was unparented,
as the BrowserWindowController maintains a reference the entire time.

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

3 years ago[QuickLook] Consolidate usage of QuickLookHandle into SubresourceLoader
aestes@apple.com [Sat, 7 Jan 2017 21:00:30 +0000 (21:00 +0000)]
[QuickLook] Consolidate usage of QuickLookHandle into SubresourceLoader
https://bugs.webkit.org/show_bug.cgi?id=166713

Reviewed by Alex Christensen.

Source/WebCore:

QuickLook conversion was originally implemented by intercepting document loads at the
ResourceHandle level, with separate paths for NSURLConnection and CFURLConnection handles.
When QuickLook was ported to WebKit2, a third path was added in WebResourceLoader.

This change removes these three separate paths and implements a single conversion path in
SubresourceLoader, where QuickLook can intercept document loads regardless of the networking
API being used.

No change in behavior. Covered by existing tests.

* loader/ResourceLoader.h: Removed override from didCreateQuickLookHandle() since this
function is no longer declared in ResourceHandleClient.
* loader/SubresourceLoader.cpp:
(WebCore::SubresourceLoader::shouldCreateQuickLookHandleForResponse): Added a helper
function to check if a QuickLookHandle should be created for a response.
(WebCore::SubresourceLoader::didReceiveResponse): Created a QuickLookHandle if necessary
and stored it in the DocumentLoader.
(WebCore::SubresourceLoader::didReceiveData): If there is a QuickLookHandle, call
QuickLookHandle::didReceiveBuffer(), and return early if QuickLook is converting.
(WebCore::SubresourceLoader::didReceiveBuffer): Ditto for QuickLookHandle::didReceiveBuffer().
(WebCore::SubresourceLoader::didFinishLoading): Ditto for QuickLookHandle::didFinishLoading().
(WebCore::SubresourceLoader::didFail): If there is a QuickLookHandle, call QuickLookHandle::didFail().
* loader/SubresourceLoader.h: Declared shouldCreateQuickLookHandleForResponse().
* loader/ios/QuickLook.h: Removed declarations used by the ResourceHandles and declared new
functions used by SubresourceLoader.
* loader/ios/QuickLook.mm:
(WebCore::QuickLookHandle::QuickLookHandle): Removed the NSURLConnection * parameter, since
we’d now always pass nil.
(WebCore::QuickLookHandle::create): Removed create() functions used by ResourceHandles.
(WebCore::QuickLookHandle::didReceiveData): Added. Copies the data into an NSData, wraps it
in an NSArray, and passes it to didReceiveDataArray().
(WebCore::QuickLookHandle::didReceiveBuffer): Added. Creates a NSArray of NSData from the
SharedBuffer and passes it to didReceiveDataArray().
(-[WebQuickLookHandleAsDelegate initWithConnectionDelegate:]): Deleted.
(-[WebQuickLookHandleAsDelegate connection:didReceiveDataArray:]): Deleted.
(-[WebQuickLookHandleAsDelegate connection:didReceiveData:lengthReceived:]): Deleted.
(-[WebQuickLookHandleAsDelegate connectionDidFinishLoading:]): Deleted.
(-[WebQuickLookHandleAsDelegate connection:didFailWithError:]): Deleted.
(-[WebQuickLookHandleAsDelegate detachHandle]): Deleted.
(WebCore::QuickLookHandle::cfResponse): Deleted.
(WebCore::QuickLookHandle::didReceiveDataArray): Passed dataArray to m_converter and m_client.
* platform/SharedBuffer.h: Const-qualified createNSDataArray().
* platform/cocoa/SharedBufferCocoa.mm:
(WebCore::SharedBuffer::createNSDataArray): Ditto.
* platform/network/ResourceHandle.cpp: Stopped including QuickLook.h.
* platform/network/ResourceHandle.h: Removed m_quickLook.
(WebCore::ResourceHandle::quickLookHandle): Deleted.
* platform/network/ResourceHandleClient.h:
(WebCore::ResourceHandleClient::didCreateQuickLookHandle): Deleted.
* platform/network/cf/SynchronousResourceHandleCFURLConnectionDelegate.cpp:
(WebCore::SynchronousResourceHandleCFURLConnectionDelegate::didReceiveResponse): Removed QuickLook code.
(WebCore::SynchronousResourceHandleCFURLConnectionDelegate::didReceiveData): Ditto.
(WebCore::SynchronousResourceHandleCFURLConnectionDelegate::didFinishLoading): Ditto.
(WebCore::SynchronousResourceHandleCFURLConnectionDelegate::didFail): Ditto.
(WebCore::SynchronousResourceHandleCFURLConnectionDelegate::didReceiveDataArray): Ditto.
* platform/network/mac/ResourceHandleMac.mm:
(WebCore::ResourceHandle::setQuickLookHandle): Deleted.
* platform/network/mac/WebCoreResourceHandleAsDelegate.mm:
(-[WebCoreResourceHandleAsDelegate connection:didReceiveResponse:]): Removed QuickLook code.
(-[WebCoreResourceHandleAsDelegate connection:didReceiveDataArray:]): Ditto.
(-[WebCoreResourceHandleAsDelegate connection:didReceiveData:lengthReceived:]): Ditto.
(-[WebCoreResourceHandleAsDelegate connectionDidFinishLoading:]): Ditto.
(-[WebCoreResourceHandleAsDelegate connection:didFailWithError:]): Ditto.

Source/WebKit2:

* WebProcess/Network/WebResourceLoader.cpp:
(WebKit::WebResourceLoader::didReceiveResponse): Removed QuickLook code.
(WebKit::WebResourceLoader::didReceiveData): Ditto.
(WebKit::WebResourceLoader::didFinishResourceLoad): Ditto.
(WebKit::WebResourceLoader::didFailResourceLoad): Ditto.
(WebKit::WebResourceLoader::didReceiveResource): Ditto.

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

3 years agoAnother attempt to fix the Mac CMake build after r210467.
aestes@apple.com [Sat, 7 Jan 2017 18:51:46 +0000 (18:51 +0000)]
Another attempt to fix the Mac CMake build after r210467.

* DumpRenderTree/PlatformMac.cmake:
* WebKitTestRunner/PlatformMac.cmake:

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

3 years agoAttempt to fix the Mac CMake build after r210467.
aestes@apple.com [Sat, 7 Jan 2017 18:30:55 +0000 (18:30 +0000)]
Attempt to fix the Mac CMake build after r210467.

* testing/cocoa/WebArchiveDumpSupport.h:

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

3 years agoAttempt to fix the iOS Production build after r210467.
aestes@apple.com [Sat, 7 Jan 2017 13:55:57 +0000 (13:55 +0000)]
Attempt to fix the iOS Production build after r210467.

* WebCore.xcodeproj/project.pbxproj:

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

3 years agoAdd a slice intrinsic to the DFG/FTL
sbarati@apple.com [Sat, 7 Jan 2017 07:53:07 +0000 (07:53 +0000)]
Add a slice intrinsic to the DFG/FTL
https://bugs.webkit.org/show_bug.cgi?id=166707

Reviewed by Filip Pizlo.

JSTests:

* stress/array-slice-intrinsic.js: Added.
(assert):
(shallowEq):
(runTest1):
(runTest2):
* stress/array-slice-jettison-on-constructor-change.js: Added.
(assert):
(runTest1):
(runTest2):
(addRandomProperties):
(runTests):
* stress/array-slice-osr-exit-2.js: Added.
(assert):
(Foo):
(shallowEq):
(runTest1):
(runTest2):
(addRandomProperties):
(runTests):
* stress/array-slice-osr-exit.js: Added.
(assert):
(Foo):
(shallowEq):
(runTest1):
(runTest2):
(addRandomProperties):
(runTests):

Source/JavaScriptCore:

The gist of this patch is to inline Array.prototype.slice
into the DFG/FTL. The implementation in the DFG-backend
and FTLLowerDFGToB3 is just a straight forward implementation
of what the C function is doing. The more interesting bits
of this patch are setting up the proper watchpoints and conditions
in the executing code to prove that its safe to skip all of the
observable JS actions that Array.prototype.slice normally does.

We perform the following proofs:
1. Array.prototype.constructor has not changed (via a watchpoint).
2. That Array.prototype.constructor[Symbol.species] has not changed (via a watchpoint).
3. The global object is not having a bad time.
3. The array that is being sliced has an original array structure.
5. Array.prototype/Object.prototype have not transitioned.

Conditions 1, 2, and 3 are strictly required.

4 is ensuring a couple things:
1. That a "constructor" property hasn't been added to the array
we're slicing since we're supposed to perform a Get(array, "constructor").
2. That we're not slicing an instance of a subclass of Array.

We could relax 4.1 in the future if we find other ways to test if
the incoming array hasn't changed the "constructor" property.

I'm seeing a 5% speedup on crypto-pbkdf2 and often a 1% speedup on
the total benchmark (the results are sometimes noisy).

* bytecode/ExitKind.cpp:
(JSC::exitKindToString):
* bytecode/ExitKind.h:
* dfg/DFGAbstractInterpreterInlines.h:
(JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects):
* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::handleIntrinsicCall):
* dfg/DFGClobberize.h:
(JSC::DFG::clobberize):
* dfg/DFGDoesGC.cpp:
(JSC::DFG::doesGC):
* dfg/DFGFixupPhase.cpp:
(JSC::DFG::FixupPhase::fixupNode):
* dfg/DFGNode.h:
(JSC::DFG::Node::hasHeapPrediction):
(JSC::DFG::Node::hasArrayMode):
* dfg/DFGNodeType.h:
* dfg/DFGPredictionPropagationPhase.cpp:
* dfg/DFGSafeToExecute.h:
(JSC::DFG::safeToExecute):
* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::compileArraySlice):
* dfg/DFGSpeculativeJIT.h:
* dfg/DFGSpeculativeJIT32_64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* dfg/DFGSpeculativeJIT64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* ftl/FTLCapabilities.cpp:
(JSC::FTL::canCompile):
* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::compileNode):
(JSC::FTL::DFG::LowerDFGToB3::compileArraySlice):
* jit/AssemblyHelpers.cpp:
(JSC::AssemblyHelpers::emitLoadStructure):
* runtime/ArrayPrototype.cpp:
(JSC::ArrayPrototype::finishCreation):
(JSC::speciesWatchpointIsValid):
(JSC::speciesConstructArray):
(JSC::arrayProtoFuncSlice):
(JSC::arrayProtoPrivateFuncConcatMemcpy):
(JSC::ArrayPrototype::initializeSpeciesWatchpoint):
(JSC::ArrayPrototypeAdaptiveInferredPropertyWatchpoint::handleFire):
(JSC::speciesWatchpointsValid): Deleted.
(JSC::ArrayPrototype::attemptToInitializeSpeciesWatchpoint): Deleted.
* runtime/ArrayPrototype.h:
(JSC::ArrayPrototype::speciesWatchpointStatus): Deleted.
(): Deleted.
* runtime/Intrinsic.h:
* runtime/JSGlobalObject.cpp:
(JSC::JSGlobalObject::JSGlobalObject):
(JSC::JSGlobalObject::init):
* runtime/JSGlobalObject.h:
(JSC::JSGlobalObject::arraySpeciesWatchpoint):

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

3 years agoAttempt to fix the EFL build following <http://trac.webkit.org/changeset/210461>
dbates@webkit.org [Sat, 7 Jan 2017 07:42:19 +0000 (07:42 +0000)]
Attempt to fix the EFL build following <trac.webkit.org/changeset/210461>
(https://bugs.webkit.org/show_bug.cgi?id=166781)

* UIProcess/API/C/WKWebsitePolicies.cpp:
(WKWebsitePoliciesGetAutoplayPolicy): Invoke ASSERT_NOT_REACHED() and return kWKWebsiteAutoplayPolicyUseHeuristics
if the specified policy is not covered by a switch case.
(WKWebsitePoliciesSetAutoplayPolicy): Substituted "return" for "break" in each switch case and
invoke ASSERT_NOT_REACHED() if the specified policy is not covered by a switch case.

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

3 years agoEnsure navigation only allowed for documents not in the page cache
dbates@webkit.org [Sat, 7 Jan 2017 07:14:03 +0000 (07:14 +0000)]
Ensure navigation only allowed for documents not in the page cache
https://bugs.webkit.org/show_bug.cgi?id=166773
<rdar://problem/29762809>

Reviewed by Brent Fulgham.

It is wise to ensure that navigation is only allowed when initiated from a document that
is not in- or about to be put in- the page cache. Such a navigation would surprise a
person that had navigated away from the initiating document among other issues.

* dom/Document.cpp:
(WebCore::Document::canNavigate): Only allow navigation if the document is not in the
page cache.
* html/HTMLAnchorElement.cpp:
(WebCore::HTMLAnchorElement::handleClick): Ditto.
* html/HTMLLinkElement.cpp:
(WebCore::HTMLLinkElement::handleClick): Ditto.
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::urlSelected): Assert triggering event's document is not in the
page cache.
(WebCore::FrameLoader::submitForm): Allow submission if the document is not in the
page cache.
(WebCore::FrameLoader::loadFrameRequest): Assert triggering event's document is not in
the page cache.
* mathml/MathMLElement.cpp:
(WebCore::MathMLElement::defaultEventHandler): Only allow navigation if the document is
not in the page cache.
* svg/SVGAElement.cpp:
(WebCore::SVGAElement::defaultEventHandler): Ditto.

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

3 years agoCrash in WebCore::MediaPlayerPrivateMediaSourceAVFObjC::sizeWillChangeAtTime(const...
jer.noble@apple.com [Sat, 7 Jan 2017 07:12:00 +0000 (07:12 +0000)]
Crash in WebCore::MediaPlayerPrivateMediaSourceAVFObjC::sizeWillChangeAtTime(const MediaTime&, const FloatSize&)::block_invoke
https://bugs.webkit.org/show_bug.cgi?id=166738

Reviewed by Eric Carlson.

AVFoundation can potentially call the same boundary time observer multiple times, and
in that case, it's possible that the observer queue will be empty when we attempt
to remove the first item from the queue. There's an ASSERT() in Deque for this case,
but we need to explicitly protect against this case.

Drive-by fix: Explicitly unregister the observer before releasing it.

* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::sizeWillChangeAtTime):

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

3 years agoREGRESSION(r208886) Web Inspector: Toggling CSS Properties in Styles Sidebar (comment...
commit-queue@webkit.org [Sat, 7 Jan 2017 06:53:54 +0000 (06:53 +0000)]
REGRESSION(r208886) Web Inspector: Toggling CSS Properties in Styles Sidebar (comment / uncomment)
https://bugs.webkit.org/show_bug.cgi?id=166786
<rdar://problem/29767412>

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2017-01-06
Reviewed by Brian Burg.

* inspector/InspectorStyleSheet.cpp:
(WebCore::InspectorStyle::populateAllProperties):
Match earlier behavior and don't send the frontend information about
disabled (commented out) properties. Follow-up later to send this
information when implementing proper handling of them in the frontend.

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

3 years agoUnreviewed, rebaseline W3C test after r210468.
cdumez@apple.com [Sat, 7 Jan 2017 06:52:27 +0000 (06:52 +0000)]
Unreviewed, rebaseline W3C test after r210468.

The test now fails differently due the the behavior change in r210468.
The test fails because we do not support History.scrollRestoration.

* web-platform-tests/html/browsers/browsing-the-web/history-traversal/persisted-user-state-restoration/scroll-restoration-fragment-scrolling-cross-origin-expected.txt:

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

3 years ago[WebIDL] Remove custom bindings from CanvasRenderingContext2D
weinig@apple.com [Sat, 7 Jan 2017 06:19:44 +0000 (06:19 +0000)]
[WebIDL] Remove custom bindings from CanvasRenderingContext2D
https://bugs.webkit.org/show_bug.cgi?id=166793

Reviewed by Darin Adler.

* WebCore.xcodeproj/project.pbxproj:
Move JSCanvasRenderingContext2DCustom.cpp to the GC only group.

* bindings/js/JSCanvasRenderingContext2DCustom.cpp:
(WebCore::toJS): Deleted.
(WebCore::toHTMLCanvasStyle): Deleted.
(WebCore::JSCanvasRenderingContext2D::strokeStyle): Deleted.
(WebCore::JSCanvasRenderingContext2D::setStrokeStyle): Deleted.
(WebCore::JSCanvasRenderingContext2D::fillStyle): Deleted.
(WebCore::JSCanvasRenderingContext2D::setFillStyle): Deleted.
Remove non-GC related custom bindings.

* html/canvas/CanvasRenderingContext2D.cpp:
(WebCore::CanvasRenderingContext2D::setStrokeStyle):
(WebCore::CanvasRenderingContext2D::setFillStyle):
(WebCore::toStyle):
(WebCore::CanvasRenderingContext2D::strokeStyle):
(WebCore::CanvasRenderingContext2D::fillStyle):
* html/canvas/CanvasRenderingContext2D.h:
* html/canvas/CanvasRenderingContext2D.idl:
Made existing setStrokeStyle/setFillStyle functions (which take CanvasStyle's)
private, and implemented new ones that operate on Variants, matching the spec.

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

3 years agoRemove PassRefPtr use from "rendering" directory, other improvements
darin@apple.com [Sat, 7 Jan 2017 05:23:54 +0000 (05:23 +0000)]
Remove PassRefPtr use from "rendering" directory, other improvements
https://bugs.webkit.org/show_bug.cgi?id=166717

Reviewed by Sam Weinig.

* css/CSSComputedStyleDeclaration.cpp:
(WebCore::shapePropertyValue): Use auto.
* css/CSSFilterImageValue.cpp:
(WebCore::CSSFilterImageValue::image): Use auto. Pass references.
(WebCore::CSSFilterImageValue::filterImageChanged): Use modern for loop.

* css/StyleBuilderConverter.h:
(WebCore::StyleBuilderConverter::convertShapeValue): Use overloaded
ShapeValue::create function instead of differently named functions.
* page/animation/CSSPropertyAnimation.cpp:
(WebCore::blendFunc): Ditto.

* platform/graphics/filters/Filter.h: Added a protected constructor that takes
a filter resolution.

* rendering/FilterEffectRenderer.cpp:
(WebCore::FilterEffectRenderer::FilterEffectRenderer): Use new constructor so
we don't have to call setFilterResolution and can initialize m_sourceGraphic.
(WebCore::FilterEffectRenderer::create): Moved here from the header.
(WebCore::FilterEffectRenderer::buildReferenceFilter): Take references and not
PssRefPtr. Use auto and references.
(WebCore::FilterEffectRenderer::build): Take a reference. Updated to work with
references rather than pointer. Use auto.
(WebCore::FilterEffectRenderer::allocateBackingStoreIfNeeded): Use early return.
(WebCore::FilterEffectRenderer::clearIntermediateResults): Use modern for loop.
(WebCore::FilterEffectRenderer::apply): Use references.
(WebCore::FilterEffectRenderer::output): Moved here from header.
(WebCore::FilterEffectRenderer::setMaxEffectRects): Moved here from header.
(WebCore::FilterEffectRenderer::outputRect): Moved here from header.
(WebCore::FilterEffectRendererHelper::prepareFilterEffect): Take references.
(WebCore::FilterEffectRendererHelper::beginFilterEffect): Use auto and references.
(WebCore::FilterEffectRendererHelper::applyFilterEffect): Ditto.
* rendering/FilterEffectRenderer.h: Updated for the above changes. Made a lot more
things private.

* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::filterPainter): Added. Helper so setupFilters does not
have to do things twice.
(WebCore::RenderLayer::hasFilterThatIsPainting): Updated to call filterPainter.
(WebCore::RenderLayer::setupFilters): Ditto.
(WebCore::RenderLayer::calculateClipRects): Pass reference.
* rendering/RenderLayer.h: Updated for the above changes.

* rendering/style/ContentData.cpp:
(WebCore::ContentData::clone): Use auto.
(WebCore::ImageContentData::createContentRenderer): Updated for reference.
* rendering/style/ContentData.h: Use Ref&& instead of PassRefPtr. Made more
things private.

* rendering/style/NinePieceImage.cpp:
(WebCore::NinePieceImage::defaultData): Made this a static member so it can
get at the now-private class NinePieceImage::Data.
(WebCore::NinePieceImage::NinePieceImage): Use RefPtr&& instead of PassRefPtr.
Use construction instead of calling m_data.access() over and over again.
(WebCore::NinePieceImage::Data::Data): Renamed from NinePieceImageData.
Moved initialization to class definition. Added a new overload for the normal
creation case.
(WebCore::NinePieceImage::Data::create): Ditto.
(WebCore::NinePieceImage::Data::copy): Ditto.
(WebCore::NinePieceImage::Data::operator==): Ditto.
* rendering/style/NinePieceImage.h: Cut down on includes. Moved the class
named NinePieceImageData in to become the private struct NinePieceImage::Data.

* rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::setContent): Pass Ref&& instead of RefPtr&& when
creating ImageContentData.

* rendering/style/ShapeValue.cpp:
(WebCore::ShapeValue::isImageValid): Tighten up by using data member directly
and using a local variabel.
(WebCore::pointersOrValuesEqual): Deleted.
(WebCore::ShapeValue::operator==): Use arePointingToEqualData instead the
above deleted function template. Wrote as a single return statement for clarity.
* rendering/style/ShapeValue.h: Changed all the create function names to just
create, using overloading instead of separate names. Use Ref&& instead of PassRefPtr.
Removed unused constructor that took a type but no data.

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

3 years agoRegression(r189230): DOM Callbacks may use wrong global object
cdumez@apple.com [Sat, 7 Jan 2017 04:02:06 +0000 (04:02 +0000)]
Regression(r189230): DOM Callbacks may use wrong global object
https://bugs.webkit.org/show_bug.cgi?id=166784

Reviewed by Mark Lam.

Source/WebCore:

DOM Callbacks could end up using the wrong global object after r189230
because we were getting the globalObject from the callback object
instead of the one at the point the callback object was passed in by
JavaScript. This patch fixes the issue.

Test: fast/frames/frame-window-as-callback.html

* bindings/js/JSCallbackData.cpp:
(WebCore::JSCallbackData::invokeCallback):
* bindings/js/JSCallbackData.h:
(WebCore::JSCallbackData::globalObject):
(WebCore::JSCallbackData::JSCallbackData):
(WebCore::JSCallbackDataStrong::JSCallbackDataStrong):
(WebCore::JSCallbackDataStrong::callback):
(WebCore::JSCallbackDataStrong::invokeCallback):
(WebCore::JSCallbackDataWeak::JSCallbackDataWeak):
(WebCore::JSCallbackDataWeak::callback):
(WebCore::JSCallbackDataWeak::invokeCallback):
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateCallbackImplementationContent):

LayoutTests:

Add layout test coverage.

* fast/frames/frame-window-as-callback-expected.txt: Added.
* fast/frames/frame-window-as-callback.html: Added.
* fast/frames/resources/wrong-global-object.html: Added.

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

3 years ago[Cocoa] Consolidate duplicate copies of WebArchiveDumpSupport in DRT and WKTR into...
aestes@apple.com [Sat, 7 Jan 2017 03:49:04 +0000 (03:49 +0000)]
[Cocoa] Consolidate duplicate copies of WebArchiveDumpSupport in DRT and WKTR into WebCoreTestSupport
https://bugs.webkit.org/show_bug.cgi?id=166789

Reviewed by Alex Christensen.

Source/WebCore:

There were duplicate implementations of WebArchiveDumpSupport in DumpRenderTree and
WebKitTestRunner. This change consolidates these into a single implementation in
WebCoreTestSupport.

* PlatformMac.cmake: Added WebArchiveDumpSupport.mm to WebCoreTestSupport.
* WebCore.xcodeproj/project.pbxproj: Ditto. Also made WebArchiveDumpSupport.h a Private header.
* platform/spi/cf/CFNetworkSPI.h: Moved CFNetwork forward declarations from
WebArchiveDumpSupport to here.
* testing/cocoa/WebArchiveDumpSupport.h: Added.
* testing/cocoa/WebArchiveDumpSupport.mm: Merged WebArchiveDumpSupport.cpp and
WebArchiveDumpSupport{Cocoa,Mac}.mm into a single file.

Tools:

* DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj:
* DumpRenderTree/PlatformMac.cmake:
* DumpRenderTree/cf/WebArchiveDumpSupport.cpp: Removed.
* DumpRenderTree/cf/WebArchiveDumpSupport.h: Removed.
* DumpRenderTree/mac/DumpRenderTree.mm:
Called WebCoreTestSupport::createXMLStringFromWebArchiveData() instead of
createXMLStringFromWebArchiveData().
* DumpRenderTree/mac/WebArchiveDumpSupportMac.mm: Removed.
* WebKitTestRunner/Configurations/Base.xcconfig:
Added $(BUILT_PRODUCTS_DIR)/WebCoreTestSupport to HEADER_SEARCH_PATHS.
* WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
(WTR::InjectedBundlePage::dumpDOMAsWebArchive):
Called WebCoreTestSupport::createXMLStringFromWebArchiveData() instead of
createXMLStringFromWebArchiveData().
* WebKitTestRunner/InjectedBundle/cocoa/WebArchiveDumpSupportCocoa.mm: Removed.
* WebKitTestRunner/PlatformMac.cmake:
* WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj:
* WebKitTestRunner/cf/WebArchiveDumpSupport.h: Removed.

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

3 years agoMinor cleanups to IndentOutdentCommand and related code
timothy_horton@apple.com [Sat, 7 Jan 2017 02:59:12 +0000 (02:59 +0000)]
Minor cleanups to IndentOutdentCommand and related code
https://bugs.webkit.org/show_bug.cgi?id=166791

Reviewed by Simon Fraser.

Source/WebCore:

* editing/IndentOutdentCommand.cpp:
(WebCore::IndentOutdentCommand::IndentOutdentCommand):
(WebCore::IndentOutdentCommand::outdentRegion):
* editing/IndentOutdentCommand.h:
(WebCore::IndentOutdentCommand::create):
Remove the unused m_marginInPixels and fix the copyright header.

Tools:

* WebEditingTester/EditingOperations.m:
(editingOperations):
Add the outdent operation to WebEditingTester.

LayoutTests:

* editing/execCommand/19653-1-expected.txt:
* editing/execCommand/19653-1.html:
Adjust this indenting test. It had a mislabeled test case (it outdents, not indents),
and also was copy-pasted wrong (it wasn't indented in the first place).

However, since this technically reduces test coverage, keep the existing
(but now correctly labeled) test case, since it caught a bug in code I was changing.

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

3 years agoFix WinCairo build after r210319.
achristensen@apple.com [Sat, 7 Jan 2017 02:41:24 +0000 (02:41 +0000)]
Fix WinCairo build after r210319.
https://bugs.webkit.org/show_bug.cgi?id=166635

* DerivedSources.cpp:
A toJS call was ambiguous, but only if the generated IndexedDB bindings are compiled all-in-one in DerivedSources.cpp.
Compiling these few files separately (which happens automatically in the CMake build) fixes the build and won't increase
the total object files beyond MSVC's current 2GB limit.
* bindings/js/JSWebGLRenderingContextBaseCustom.cpp:
(WebCore::JSWebGLRenderingContextBaseOwner::isReachableFromOpaqueRoots):
Unknown was an ambiguous symbol.  It's also defined in winioctl.h.

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

3 years agoCreate a plan and a patch files for MotionMark and delete the Animometer's ones
commit-queue@webkit.org [Sat, 7 Jan 2017 01:41:21 +0000 (01:41 +0000)]
Create a plan and a patch files for MotionMark and delete the Animometer's ones
https://bugs.webkit.org/show_bug.cgi?id=166785

Patch by Said Abou-Hallawa <sabouhallawa@apple.com> on 2017-01-06
Reviewed by Ryosuke Niwa.

* Scripts/webkitpy/benchmark_runner/data/patches/MotionMark.patch: Renamed from Tools/Scripts/webkitpy/benchmark_runner/data/patches/Animometer.patch.
* Scripts/webkitpy/benchmark_runner/data/plans/motionmark.plan: Renamed from Tools/Scripts/webkitpy/benchmark_runner/data/plans/animometer.plan.

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

3 years agoAdd infrastructure for sending autoplay website policies to WebKit
commit-queue@webkit.org [Sat, 7 Jan 2017 01:06:24 +0000 (01:06 +0000)]
Add infrastructure for sending autoplay website policies to WebKit
https://bugs.webkit.org/show_bug.cgi?id=166781

Patch by Matt Rajca <mrajca@apple.com> on 2017-01-06
Reviewed by Alex Christensen.

* Shared/WebsitePolicies.h:
(WebKit::WebsitePolicies::encode):
(WebKit::WebsitePolicies::decode):
* UIProcess/API/APIWebsitePolicies.h:
* UIProcess/API/C/WKWebsitePolicies.cpp:
(WKWebsitePoliciesGetAutoplayPolicy):
(WKWebsitePoliciesSetAutoplayPolicy):
* UIProcess/API/C/WKWebsitePolicies.h:
* UIProcess/API/Cocoa/_WKWebsitePolicies.h:
* UIProcess/API/Cocoa/_WKWebsitePolicies.mm:
(-[_WKWebsitePolicies setAutoplayPolicy:]):
(-[_WKWebsitePolicies autoplayPolicy]):

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

3 years agoUnreviewed, rolling out r210110.
commit-queue@webkit.org [Sat, 7 Jan 2017 00:34:38 +0000 (00:34 +0000)]
Unreviewed, rolling out r210110.
https://bugs.webkit.org/show_bug.cgi?id=166783

Introduced a regression commenting out individual properties
(Requested by JoePeck on #webkit).

Reverted changeset:

"Web Inspector: Styles sidebar: Uncommenting CSS rules of
pseudo-elements doesn't work"
https://bugs.webkit.org/show_bug.cgi?id=165831
http://trac.webkit.org/changeset/210110

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

3 years agoRename the directory and the files of MotionMark from Animometer to MotionMark
commit-queue@webkit.org [Fri, 6 Jan 2017 23:38:32 +0000 (23:38 +0000)]
Rename the directory and the files of MotionMark from Animometer to MotionMark
https://bugs.webkit.org/show_bug.cgi?id=166659

Patch by Said Abou-Hallawa <sabouhallawa@apple.com> on 2017-01-06
Reviewed by Jon Lee.

Rename the directory and the files of the benchmark to its new name.

* MotionMark/developer.html: Renamed from PerformanceTests/Animometer/developer.html.
* MotionMark/index.html: Renamed from PerformanceTests/Animometer/index.html.
* MotionMark/resources/debug-runner/d3.min.js: Renamed from PerformanceTests/Animometer/resources/debug-runner/d3.min.js.
* MotionMark/resources/debug-runner/graph.js: Renamed from PerformanceTests/Animometer/resources/debug-runner/graph.js.
* MotionMark/resources/debug-runner/motionmark.css: Renamed from PerformanceTests/Animometer/resources/debug-runner/animometer.css.
* MotionMark/resources/debug-runner/motionmark.js: Renamed from PerformanceTests/Animometer/resources/debug-runner/animometer.js.
* MotionMark/resources/debug-runner/tests.js: Renamed from PerformanceTests/Animometer/resources/debug-runner/tests.js.
* MotionMark/resources/extensions.js: Renamed from PerformanceTests/Animometer/resources/extensions.js.
* MotionMark/resources/runner/benchmark-runner.js: Renamed from PerformanceTests/Animometer/resources/runner/benchmark-runner.js.
* MotionMark/resources/runner/crystal.svg: Renamed from PerformanceTests/Animometer/resources/runner/crystal.svg.
* MotionMark/resources/runner/lines.svg: Renamed from PerformanceTests/Animometer/resources/runner/lines.svg.
* MotionMark/resources/runner/logo.svg: Renamed from PerformanceTests/Animometer/resources/runner/logo.svg.
* MotionMark/resources/runner/motionmark.css: Renamed from PerformanceTests/Animometer/resources/runner/animometer.css.
* MotionMark/resources/runner/motionmark.js: Renamed from PerformanceTests/Animometer/resources/runner/animometer.js.
* MotionMark/resources/runner/tests.js: Renamed from PerformanceTests/Animometer/resources/runner/tests.js.
* MotionMark/resources/statistics.js: Renamed from PerformanceTests/Animometer/resources/statistics.js.
* MotionMark/resources/strings.js: Renamed from PerformanceTests/Animometer/resources/strings.js.
* MotionMark/tests/3d/resources/webgl.js: Renamed from PerformanceTests/Animometer/tests/3d/resources/webgl.js.
* MotionMark/tests/3d/webgl.html: Renamed from PerformanceTests/Animometer/tests/3d/webgl.html.
* MotionMark/tests/bouncing-particles/bouncing-canvas-images.html: Renamed from PerformanceTests/Animometer/tests/bouncing-particles/bouncing-canvas-images.html.
* MotionMark/tests/bouncing-particles/bouncing-canvas-shapes.html: Renamed from PerformanceTests/Animometer/tests/bouncing-particles/bouncing-canvas-shapes.html.
* MotionMark/tests/bouncing-particles/bouncing-css-images.html: Renamed from PerformanceTests/Animometer/tests/bouncing-particles/bouncing-css-images.html.
* MotionMark/tests/bouncing-particles/bouncing-css-shapes.html: Renamed from PerformanceTests/Animometer/tests/bouncing-particles/bouncing-css-shapes.html.
* MotionMark/tests/bouncing-particles/bouncing-svg-images.html: Renamed from PerformanceTests/Animometer/tests/bouncing-particles/bouncing-svg-images.html.
* MotionMark/tests/bouncing-particles/bouncing-svg-shapes.html: Renamed from PerformanceTests/Animometer/tests/bouncing-particles/bouncing-svg-shapes.html.
* MotionMark/tests/bouncing-particles/bouncing-tagged-images.html: Renamed from PerformanceTests/Animometer/tests/bouncing-particles/bouncing-tagged-images.html.
* MotionMark/tests/bouncing-particles/resources/bouncing-canvas-images.js: Renamed from PerformanceTests/Animometer/tests/bouncing-particles/resources/bouncing-canvas-images.js.
* MotionMark/tests/bouncing-particles/resources/bouncing-canvas-particles.js: Renamed from PerformanceTests/Animometer/tests/bouncing-particles/resources/bouncing-canvas-particles.js.
* MotionMark/tests/bouncing-particles/resources/bouncing-canvas-shapes.js: Renamed from PerformanceTests/Animometer/tests/bouncing-particles/resources/bouncing-canvas-shapes.js.
* MotionMark/tests/bouncing-particles/resources/bouncing-css-images.js: Renamed from PerformanceTests/Animometer/tests/bouncing-particles/resources/bouncing-css-images.js.
* MotionMark/tests/bouncing-particles/resources/bouncing-css-shapes.js: Renamed from PerformanceTests/Animometer/tests/bouncing-particles/resources/bouncing-css-shapes.js.
* MotionMark/tests/bouncing-particles/resources/bouncing-svg-images.js: Renamed from PerformanceTests/Animometer/tests/bouncing-particles/resources/bouncing-svg-images.js.
* MotionMark/tests/bouncing-particles/resources/bouncing-svg-particles.js: Renamed from PerformanceTests/Animometer/tests/bouncing-particles/resources/bouncing-svg-particles.js.
* MotionMark/tests/bouncing-particles/resources/bouncing-svg-shapes.js: Renamed from PerformanceTests/Animometer/tests/bouncing-particles/resources/bouncing-svg-shapes.js.
* MotionMark/tests/bouncing-particles/resources/bouncing-tagged-images.js: Renamed from PerformanceTests/Animometer/tests/bouncing-particles/resources/bouncing-tagged-images.js.
* MotionMark/tests/bouncing-particles/resources/image1.jpg: Renamed from PerformanceTests/Animometer/tests/bouncing-particles/resources/image1.jpg.
* MotionMark/tests/bouncing-particles/resources/image2.jpg: Renamed from PerformanceTests/Animometer/tests/bouncing-particles/resources/image2.jpg.
* MotionMark/tests/bouncing-particles/resources/image3.jpg: Renamed from PerformanceTests/Animometer/tests/bouncing-particles/resources/image3.jpg.
* MotionMark/tests/bouncing-particles/resources/image4.jpg: Renamed from PerformanceTests/Animometer/tests/bouncing-particles/resources/image4.jpg.
* MotionMark/tests/bouncing-particles/resources/image5.jpg: Renamed from PerformanceTests/Animometer/tests/bouncing-particles/resources/image5.jpg.
* MotionMark/tests/dom/compositing-transforms.html: Renamed from PerformanceTests/Animometer/tests/dom/compositing-transforms.html.
* MotionMark/tests/dom/focus.html: Renamed from PerformanceTests/Animometer/tests/dom/focus.html.
* MotionMark/tests/dom/leaves.html: Renamed from PerformanceTests/Animometer/tests/dom/leaves.html.
* MotionMark/tests/dom/particles.html: Renamed from PerformanceTests/Animometer/tests/dom/particles.html.
* MotionMark/tests/dom/resources/compositing-transforms.js: Renamed from PerformanceTests/Animometer/tests/dom/resources/compositing-transforms.js.
* MotionMark/tests/dom/resources/dom-particles.js: Renamed from PerformanceTests/Animometer/tests/dom/resources/dom-particles.js.
* MotionMark/tests/dom/resources/focus.js: Renamed from PerformanceTests/Animometer/tests/dom/resources/focus.js.
* MotionMark/tests/dom/resources/leaves.js: Renamed from PerformanceTests/Animometer/tests/dom/resources/leaves.js.
* MotionMark/tests/master/canvas-stage.html: Renamed from PerformanceTests/Animometer/tests/master/canvas-stage.html.
* MotionMark/tests/master/focus.html: Renamed from PerformanceTests/Animometer/tests/master/focus.html.
* MotionMark/tests/master/image-data.html: Renamed from PerformanceTests/Animometer/tests/master/image-data.html.
* MotionMark/tests/master/leaves.html: Renamed from PerformanceTests/Animometer/tests/master/leaves.html.
* MotionMark/tests/master/multiply.html: Renamed from PerformanceTests/Animometer/tests/master/multiply.html.
* MotionMark/tests/master/resources/canvas-stage.js: Renamed from PerformanceTests/Animometer/tests/master/resources/canvas-stage.js.
* MotionMark/tests/master/resources/canvas-tests.js: Renamed from PerformanceTests/Animometer/tests/master/resources/canvas-tests.js.
* MotionMark/tests/master/resources/compass.svg: Renamed from PerformanceTests/Animometer/tests/master/resources/compass.svg.
* MotionMark/tests/master/resources/compass100.png: Renamed from PerformanceTests/Animometer/tests/master/resources/compass100.png.
* MotionMark/tests/master/resources/console.svg: Renamed from PerformanceTests/Animometer/tests/master/resources/console.svg.
* MotionMark/tests/master/resources/console100.png: Renamed from PerformanceTests/Animometer/tests/master/resources/console100.png.
* MotionMark/tests/master/resources/contribute.svg: Renamed from PerformanceTests/Animometer/tests/master/resources/contribute.svg.
* MotionMark/tests/master/resources/contribute100.png: Renamed from PerformanceTests/Animometer/tests/master/resources/contribute100.png.
* MotionMark/tests/master/resources/debugger.svg: Renamed from PerformanceTests/Animometer/tests/master/resources/debugger.svg.
* MotionMark/tests/master/resources/debugger100.png: Renamed from PerformanceTests/Animometer/tests/master/resources/debugger100.png.
* MotionMark/tests/master/resources/focus.js: Renamed from PerformanceTests/Animometer/tests/master/resources/focus.js.
* MotionMark/tests/master/resources/image-data.js: Renamed from PerformanceTests/Animometer/tests/master/resources/image-data.js.
* MotionMark/tests/master/resources/inspector.svg: Renamed from PerformanceTests/Animometer/tests/master/resources/inspector.svg.
* MotionMark/tests/master/resources/inspector100.png: Renamed from PerformanceTests/Animometer/tests/master/resources/inspector100.png.
* MotionMark/tests/master/resources/layout.svg: Renamed from PerformanceTests/Animometer/tests/master/resources/layout.svg.
* MotionMark/tests/master/resources/layout100.png: Renamed from PerformanceTests/Animometer/tests/master/resources/layout100.png.
* MotionMark/tests/master/resources/leaves.js: Renamed from PerformanceTests/Animometer/tests/master/resources/leaves.js.
* MotionMark/tests/master/resources/multiply.js: Renamed from PerformanceTests/Animometer/tests/master/resources/multiply.js.
* MotionMark/tests/master/resources/particles.js: Renamed from PerformanceTests/Animometer/tests/master/resources/particles.js.
* MotionMark/tests/master/resources/performance.svg: Renamed from PerformanceTests/Animometer/tests/master/resources/performance.svg.
* MotionMark/tests/master/resources/performance100.png: Renamed from PerformanceTests/Animometer/tests/master/resources/performance100.png.
* MotionMark/tests/master/resources/script.svg: Renamed from PerformanceTests/Animometer/tests/master/resources/script.svg.
* MotionMark/tests/master/resources/script100.png: Renamed from PerformanceTests/Animometer/tests/master/resources/script100.png.
* MotionMark/tests/master/resources/shortcuts.svg: Renamed from PerformanceTests/Animometer/tests/master/resources/shortcuts.svg.
* MotionMark/tests/master/resources/shortcuts100.png: Renamed from PerformanceTests/Animometer/tests/master/resources/shortcuts100.png.
* MotionMark/tests/master/resources/standards.svg: Renamed from PerformanceTests/Animometer/tests/master/resources/standards.svg.
* MotionMark/tests/master/resources/standards100.png: Renamed from PerformanceTests/Animometer/tests/master/resources/standards100.png.
* MotionMark/tests/master/resources/storage.svg: Renamed from PerformanceTests/Animometer/tests/master/resources/storage.svg.
* MotionMark/tests/master/resources/storage100.png: Renamed from PerformanceTests/Animometer/tests/master/resources/storage100.png.
* MotionMark/tests/master/resources/styles.svg: Renamed from PerformanceTests/Animometer/tests/master/resources/styles.svg.
* MotionMark/tests/master/resources/styles100.png: Renamed from PerformanceTests/Animometer/tests/master/resources/styles100.png.
* MotionMark/tests/master/resources/svg-particles.js: Renamed from PerformanceTests/Animometer/tests/master/resources/svg-particles.js.
* MotionMark/tests/master/resources/text.js: Renamed from PerformanceTests/Animometer/tests/master/resources/text.js.
* MotionMark/tests/master/resources/timeline.svg: Renamed from PerformanceTests/Animometer/tests/master/resources/timeline.svg.
* MotionMark/tests/master/resources/timeline100.png: Renamed from PerformanceTests/Animometer/tests/master/resources/timeline100.png.
* MotionMark/tests/master/svg-particles.html: Renamed from PerformanceTests/Animometer/tests/master/svg-particles.html.
* MotionMark/tests/master/text.html: Renamed from PerformanceTests/Animometer/tests/master/text.html.
* MotionMark/tests/resources/main.js: Renamed from PerformanceTests/Animometer/tests/resources/main.js.
* MotionMark/tests/resources/math.js: Renamed from PerformanceTests/Animometer/tests/resources/math.js.
* MotionMark/tests/resources/stage.css: Renamed from PerformanceTests/Animometer/tests/resources/stage.css.
* MotionMark/tests/resources/star.svg: Renamed from PerformanceTests/Animometer/tests/resources/star.svg.
* MotionMark/tests/resources/yin-yang.png: Renamed from PerformanceTests/Animometer/tests/resources/yin-yang.png.
* MotionMark/tests/resources/yin-yang.svg: Renamed from PerformanceTests/Animometer/tests/resources/yin-yang.svg.
* MotionMark/tests/simple/resources/simple-canvas-paths.js: Renamed from PerformanceTests/Animometer/tests/simple/resources/simple-canvas-paths.js.
* MotionMark/tests/simple/resources/simple-canvas.js: Renamed from PerformanceTests/Animometer/tests/simple/resources/simple-canvas.js.
* MotionMark/tests/simple/resources/tiled-canvas-image.js: Renamed from PerformanceTests/Animometer/tests/simple/resources/tiled-canvas-image.js.
* MotionMark/tests/simple/simple-canvas-paths.html: Renamed from PerformanceTests/Animometer/tests/simple/simple-canvas-paths.html.
* MotionMark/tests/simple/tiled-canvas-image.html: Renamed from PerformanceTests/Animometer/tests/simple/tiled-canvas-image.html.
* MotionMark/tests/template/resources/template-canvas.js: Renamed from PerformanceTests/Animometer/tests/template/resources/template-canvas.js.
* MotionMark/tests/template/resources/template-css.js: Renamed from PerformanceTests/Animometer/tests/template/resources/template-css.js.
* MotionMark/tests/template/resources/template-svg.js: Renamed from PerformanceTests/Animometer/tests/template/resources/template-svg.js.
* MotionMark/tests/template/template-canvas.html: Renamed from PerformanceTests/Animometer/tests/template/template-canvas.html.
* MotionMark/tests/template/template-css.html: Renamed from PerformanceTests/Animometer/tests/template/template-css.html.
* MotionMark/tests/template/template-svg.html: Renamed from PerformanceTests/Animometer/tests/template/template-svg.html.

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

3 years agoThe ObjC API's JSVirtualMachine's map tables need to be guarded by a lock.
mark.lam@apple.com [Fri, 6 Jan 2017 23:38:31 +0000 (23:38 +0000)]
The ObjC API's JSVirtualMachine's map tables need to be guarded by a lock.
https://bugs.webkit.org/show_bug.cgi?id=166778
<rdar://problem/29761198>

Reviewed by Filip Pizlo.

Now that we have a concurrent GC, access to JSVirtualMachine's
m_externalObjectGraph and m_externalRememberedSet need to be guarded by a lock
since both the GC marker thread and the mutator thread may access them at the
same time.

* API/JSVirtualMachine.mm:
(-[JSVirtualMachine addExternalRememberedObject:]):
(-[JSVirtualMachine addManagedReference:withOwner:]):
(-[JSVirtualMachine removeManagedReference:withOwner:]):
(-[JSVirtualMachine externalDataMutex]):
(scanExternalObjectGraph):
(scanExternalRememberedSet):

* API/JSVirtualMachineInternal.h:
- Deleted externalObjectGraph method.  There's no need to expose this.

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

3 years ago@putByValDirect in Array.of and Array.from overwrites non-writable/configurable prope...
msaboff@apple.com [Fri, 6 Jan 2017 23:30:57 +0000 (23:30 +0000)]
@putByValDirect in Array.of and Array.from overwrites non-writable/configurable properties
https://bugs.webkit.org/show_bug.cgi?id=153486

Reviewed by Saam Barati.

JSTests:

New regression test.

* stress/regress-153486.js: Added.
(shouldEqual):
(makeUnwriteableUnconfigurableObject):
(testArrayOf):
(testArrayFrom):
(runTest):

Source/JavaScriptCore:

Moved read only check in putDirect() to all paths.

* runtime/SparseArrayValueMap.cpp:
(JSC::SparseArrayValueMap::putDirect):

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

3 years agoText highlight causes Yoon Gothic webfont to reflow.
zalan@apple.com [Fri, 6 Jan 2017 23:29:09 +0000 (23:29 +0000)]
Text highlight causes Yoon Gothic webfont to reflow.
https://bugs.webkit.org/show_bug.cgi?id=166753

Reviewed by Darin Adler.

Add word-break: keep-all; support for CJK and breaking NBSPs.

Add test later. Need to figure out what font file to use.

* rendering/SimpleLineLayoutTextFragmentIterator.cpp:
(WebCore::SimpleLineLayout::TextFragmentIterator::Style::Style):
(WebCore::SimpleLineLayout::TextFragmentIterator::nextBreakablePosition): Use BreakingContext's helper functions
to figure out the next breakable position.
(WebCore::SimpleLineLayout::TextFragmentIterator::skipToNextPosition):
* rendering/SimpleLineLayoutTextFragmentIterator.h:

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

3 years agoMarking fast/text/variations/advances.html as failing on Sierra.
ryanhaddad@apple.com [Fri, 6 Jan 2017 20:38:38 +0000 (20:38 +0000)]
Marking fast/text/variations/advances.html as failing on Sierra.
https://bugs.webkit.org/show_bug.cgi?id=166672

Unreviewed test gardening.

* platform/mac/TestExpectations:

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

3 years agoDeferGC::~DeferGC should be super cheap
fpizlo@apple.com [Fri, 6 Jan 2017 20:23:25 +0000 (20:23 +0000)]
DeferGC::~DeferGC should be super cheap
https://bugs.webkit.org/show_bug.cgi?id=166626

Reviewed by Saam Barati.
JSTests:

* stress/slow-path-generator-updating-current-node-dfg.js:
* stress/unshift-array-storage.js:

Source/JavaScriptCore:

Right now, ~DeferGC requires running the collector's full collectIfNecessaryOrDefer()
hook, which is super big. Normally, that hook would only be called from GC slow paths,
so it ought to be possible to add complex logic to it. It benefits the GC algorithm to
make that code smart, not necessarily fast.

The right thing for it to do is to have ~DeferGC check a boolean to see if
collectIfNecessaryOrDefer() had previously deferred anything, and only call it if that
is true. That's what this patch does.

Unfortunately, this means that we lose the collectAccordingToDeferGCProbability mode,
which we used for two tests. Since I could only see two tests that used this mode, I
felt that it was better to enhance the GC than to keep the tests. I filed bug 166627 to
bring back something like that mode.

Although this patch does make some paths faster, its real goal is to ensure that bug
165963 can add more logic to collectIfNecessaryOrDefer() without introducing a big
regression. Until then, I wouldn't be surprised if this patch was a progression, but I'm
not betting on it.

* heap/Heap.cpp:
(JSC::Heap::collectIfNecessaryOrDefer):
(JSC::Heap::decrementDeferralDepthAndGCIfNeededSlow):
(JSC::Heap::canCollect): Deleted.
(JSC::Heap::shouldCollectHeuristic): Deleted.
(JSC::Heap::shouldCollect): Deleted.
(JSC::Heap::collectAccordingToDeferGCProbability): Deleted.
(JSC::Heap::decrementDeferralDepthAndGCIfNeeded): Deleted.
* heap/Heap.h:
* heap/HeapInlines.h:
(JSC::Heap::incrementDeferralDepth):
(JSC::Heap::decrementDeferralDepth):
(JSC::Heap::decrementDeferralDepthAndGCIfNeeded):
(JSC::Heap::mayNeedToStop):
(JSC::Heap::stopIfNecessary):
* runtime/Options.h:

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

3 years agoSkip editing/caret/emoji.html on ios-simulator since it relies on EventSender.keydown().
ryanhaddad@apple.com [Fri, 6 Jan 2017 20:17:48 +0000 (20:17 +0000)]
Skip editing/caret/emoji.html on ios-simulator since it relies on EventSender.keydown().

Unreviewed test gardening.

* platform/ios-simulator/TestExpectations:

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

3 years agoAdd some missing longhand properties to CSSComputedStyleDeclaration and fix default...
commit-queue@webkit.org [Fri, 6 Jan 2017 20:02:45 +0000 (20:02 +0000)]
Add some missing longhand properties to CSSComputedStyleDeclaration and fix default values
https://bugs.webkit.org/show_bug.cgi?id=166674
<rdar://problem/6026159>

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2017-01-06
Reviewed by Darin Adler.

Source/WebCore:

* css/CSSComputedStyleDeclaration.cpp:
Add some missing longhand properties to the list of all longhand properties.

(WebCore::counterToCSSValue):
The default value for counter-increment and counter-reset should be "none"
not the empty string.

LayoutTests:

* fast/css/getComputedStyle/computed-style-font-family.html:
Skip font-variation-settings which is only available if the feature flag is enabled.

* fast/css/getComputedStyle/counterIncrement-without-counter-expected.txt:
* fast/css/getComputedStyle/counterIncrement-without-counter.html:
Fix the default value to be "none" instead of the empty string.

* svg/css/getComputedStyle-basic-expected.txt:
* fast/css/getComputedStyle/computed-style-expected.txt:
* fast/css/getComputedStyle/computed-style-without-renderer-expected.txt:
* fast/css/getComputedStyle/resources/property-names.js:
Add some always expected to be available longhand properties to check.

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

3 years ago[Form Validation] "character" in maxlength validation message should be singular...
cdumez@apple.com [Fri, 6 Jan 2017 18:55:35 +0000 (18:55 +0000)]
[Form Validation] "character" in maxlength validation message should be singular when maxlength is 1
https://bugs.webkit.org/show_bug.cgi?id=166712
<rdar://problem/29872292>

Reviewed by Darin Adler.

Source/WebCore:

Fix validation message to use singular form of "character" when maxLength value is 1.

Test: fast/forms/validation-message-maxLength.html

* English.lproj/Localizable.strings:
* English.lproj/Localizable.stringsdict: Added.
* WebCore.xcodeproj/project.pbxproj:
* extract-localizable-strings.pl:
* platform/LocalizedStrings.cpp:
* platform/LocalizedStrings.h:
* platform/cocoa/LocalizedStringsCocoa.mm:
(WebCore::localizedNString):
(WebCore::localizedString):
(WebCore::validationMessageTooLongText):

LayoutTests:

Add layout test coverage.

* fast/forms/validation-message-maxLength-expected.txt: Added.
* fast/forms/validation-message-maxLength.html: Added.
* platform/ios-simulator/TestExpectations:

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

3 years agoSupport webkit-test-runner key-value pairs in http tests
commit-queue@webkit.org [Fri, 6 Jan 2017 18:50:18 +0000 (18:50 +0000)]
Support webkit-test-runner key-value pairs in http tests
https://bugs.webkit.org/show_bug.cgi?id=149812

Patch by Antoine Quint <graouts@apple.com> on 2017-01-06
Reviewed by Alex Christensen.

We pass the absolute path for a test through to WKTR so that we can parse
tests that are running as URLs for webkit-test-runner options.

* DumpRenderTree/DumpRenderTreeCommon.cpp:
(parseInputLine):

Explicitly skip the --absolute-path option in DRT or else we'd crash.

* Scripts/webkitpy/port/driver.py:
(Driver._command_from_driver_input):

Pass the absolute path to the file through the CLI.

* WebKitTestRunner/TestController.cpp:
(WTR::updateTestOptionsFromTestHeader):
(WTR::TestController::testOptionsForTest):
(WTR::parseInputLine):
(WTR::TestController::runTest):
* WebKitTestRunner/TestController.h:

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

3 years agoAdd support for MediaKeySystemAccess.createMediaKeys()
jer.noble@apple.com [Fri, 6 Jan 2017 18:48:29 +0000 (18:48 +0000)]
Add support for MediaKeySystemAccess.createMediaKeys()
https://bugs.webkit.org/show_bug.cgi?id=166749

Reviewed by Eric Carlson.

Source/WebCore:

Test: media/encrypted-media/mock-MediaKeySystemAccess.html

Implement MediaKeySystemAccess::createMediaKeys(). This requires some
additions to CDM, CDMPrivate, and a new interface CDMInstance to support
eventual platform adoption and to implement mock support for testing.

* Modules/encryptedmedia/CDM.cpp:
(WebCore::CDM::loadAndInitialize):
(WebCore::CDM::createInstance):
* Modules/encryptedmedia/CDM.h:
* Modules/encryptedmedia/CDMInstance.h:
(WebCore::CDMInstance::~CDMInstance):
* Modules/encryptedmedia/CDMPrivate.h:
* Modules/encryptedmedia/MediaKeySystemAccess.cpp:
(WebCore::MediaKeySystemAccess::createMediaKeys):
* Modules/encryptedmedia/MediaKeySystemAccess.h:
* Modules/encryptedmedia/MediaKeys.cpp:
(WebCore::MediaKeys::MediaKeys):
* Modules/encryptedmedia/MediaKeys.h:
(WebCore::MediaKeys::create):
* Modules/encryptedmedia/MediaKeys.idl:
* Modules/encryptedmedia/NavigatorEME.cpp:
(WebCore::tryNextSupportedConfiguration):
* WebCore.xcodeproj/project.pbxproj:
* testing/MockCDMFactory.cpp:
(WebCore::MockCDM::MockCDM):
(WebCore::MockCDM::createInstance):
(WebCore::MockCDM::loadAndInitialize):
(WebCore::MockCDMInstance::MockCDMInstance):
(WebCore::MockCDMInstance::initializeWithConfiguration):
(WebCore::MockCDMInstance::setDistinctiveIdentifiersAllowed):
(WebCore::MockCDMInstance::setPersistentStateAllowed):
* testing/MockCDMFactory.h:
(WebCore::MockCDMFactory::canCreateInstances):
(WebCore::MockCDMFactory::setCanCreateInstances):
(WebCore::MockCDM::factory):
* testing/MockCDMFactory.idl:

LayoutTests:

* media/encrypted-media/mock-MediaKeySystemAccess-expected.txt: Added.
* media/encrypted-media/mock-MediaKeySystemAccess.html: Added.
* platform/mac/TestExpectations:

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

3 years agoAdd pass expectation for fast/text/emoji-num-glyphs.html on Sierra.
ryanhaddad@apple.com [Fri, 6 Jan 2017 17:32:21 +0000 (17:32 +0000)]
Add pass expectation for fast/text/emoji-num-glyphs.html on Sierra.

Unreviewed test gardening.

* platform/mac/TestExpectations:

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

3 years agoMarking three pointer-lock tests as crashing on mac-wk2 debug.
ryanhaddad@apple.com [Fri, 6 Jan 2017 17:13:53 +0000 (17:13 +0000)]
Marking three pointer-lock tests as crashing on mac-wk2 debug.
https://bugs.webkit.org/show_bug.cgi?id=166765

Unreviewed test gardening.

* platform/mac-wk2/TestExpectations:

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

3 years agoGive RenderObject a Page& getter.
akling@apple.com [Fri, 6 Jan 2017 14:05:29 +0000 (14:05 +0000)]
Give RenderObject a Page& getter.
<https://webkit.org/b/166735>

Reviewed by Darin Adler.

The render tree should now only ever be live while in a Frame that's connected to a Page.
Hence we can give RenderObject a Page& getter and simplify a lot of code that previously
had to get the Page from Document (or Frame) and perform null checks on it.

* dom/Document.cpp:
(WebCore::Document::destroyRenderTree): Assert that the Page is present when we tear the render tree down.

* page/Frame.cpp:
(WebCore::Frame::willDetachPage): Assert that there's no render tree when we're about to detach from the Page.
Also added a comment explaining the two main ways that render trees die.

* rendering/RenderObject.h:
(WebCore::RenderObject::page): Added. So neat!

* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::estimatedLoadingProgress):
* rendering/ImageQualityController.cpp:
(WebCore::ImageQualityController::chooseInterpolationQuality):
* rendering/InlineTextBox.cpp:
(WebCore::InlineTextBox::paint):
* rendering/RenderAttachment.cpp:
(WebCore::RenderAttachment::layout):
(WebCore::RenderAttachment::baselinePosition):
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::paintCaret):
* rendering/RenderBox.cpp:
(WebCore::RenderBox::styleDidChange):
(WebCore::setupWheelEventTestTrigger):
(WebCore::RenderBox::setScrollLeft):
(WebCore::RenderBox::setScrollTop):
* rendering/RenderElement.cpp:
(WebCore::RenderElement::paintFocusRing):
* rendering/RenderEmbeddedObject.cpp:
(WebCore::shouldUnavailablePluginMessageBeButton):
(WebCore::RenderEmbeddedObject::paint):
(WebCore::RenderEmbeddedObject::paintReplaced):
(WebCore::RenderEmbeddedObject::getReplacementTextGeometry):
(WebCore::RenderEmbeddedObject::handleUnavailablePluginIndicatorEvent):
(WebCore::RenderEmbeddedObject::getCursor):
* rendering/RenderHTMLCanvas.cpp:
(WebCore::RenderHTMLCanvas::paintReplaced):
* rendering/RenderIFrame.cpp:
(WebCore::RenderIFrame::flattenFrame):
* rendering/RenderImage.cpp:
(WebCore::RenderImage::paintReplaced):
(WebCore::RenderImage::paintAreaElementFocusRing):
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::~RenderLayer):
(WebCore::RenderLayer::forceUpdateScrollbarsOnMainThreadForPerformanceTesting):
(WebCore::RenderLayer::scrollRectToVisible):
(WebCore::RenderLayer::isActive):
(WebCore::RenderLayer::didStartScroll):
(WebCore::RenderLayer::didEndScroll):
(WebCore::RenderLayer::didUpdateScroll):
(WebCore::RenderLayer::createScrollbar):
(WebCore::RenderLayer::setupFontSubpixelQuantization):
(WebCore::RenderLayer::calculateClipRects):
* rendering/RenderLayer.h:
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::RenderLayerBacking):
(WebCore::RenderLayerBacking::createGraphicsLayer):
(WebCore::RenderLayerBacking::updateOverflowControlsLayers):
(WebCore::RenderLayerBacking::detachFromScrollingCoordinator):
(WebCore::RenderLayerBacking::paintContents):
(WebCore::RenderLayerBacking::shouldAggressivelyRetainTiles):
(WebCore::RenderLayerBacking::shouldTemporarilyRetainTileCohorts):
(WebCore::RenderLayerBacking::useGiantTiles):
(WebCore::RenderLayerBacking::verifyNotPainting):
(WebCore::RenderLayerBacking::startAnimation):
(WebCore::scrollingCoordinatorFromLayer): Deleted.
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::cacheAcceleratedCompositingFlags):
(WebCore::RenderLayerCompositor::scheduleLayerFlushNow):
(WebCore::RenderLayerCompositor::flushPendingLayerChanges):
(WebCore::updateScrollingLayerWithClient):
(WebCore::RenderLayerCompositor::updateCustomLayersAfterFlush):
(WebCore::RenderLayerCompositor::notifyFlushBeforeDisplayRefresh):
(WebCore::RenderLayerCompositor::layerTiledBackingUsageChanged):
(WebCore::RenderLayerCompositor::updateCompositingLayers):
(WebCore::RenderLayerCompositor::appendDocumentOverlayLayers):
(WebCore::RenderLayerCompositor::layerBecameNonComposited):
(WebCore::RenderLayerCompositor::updateBacking):
(WebCore::RenderLayerCompositor::pageScaleFactor):
(WebCore::RenderLayerCompositor::zoomedOutPageScaleFactor):
(WebCore::RenderLayerCompositor::contentsScaleMultiplierForNewTiles):
(WebCore::RenderLayerCompositor::updateLayerForHeader):
(WebCore::RenderLayerCompositor::updateLayerForFooter):
(WebCore::RenderLayerCompositor::setRootExtendedBackgroundColor):
(WebCore::RenderLayerCompositor::attachRootLayer):
(WebCore::RenderLayerCompositor::detachRootLayer):
(WebCore::RenderLayerCompositor::rootLayerAttachmentChanged):
(WebCore::RenderLayerCompositor::registerAllScrollingLayers):
(WebCore::RenderLayerCompositor::scrollingCoordinator):
(WebCore::RenderLayerCompositor::graphicsLayerFactory):
(WebCore::RenderLayerCompositor::createDisplayRefreshMonitor):
(WebCore::RenderLayerCompositor::page):
* rendering/RenderLayerCompositor.h:
* rendering/RenderListBox.cpp:
(WebCore::setupWheelEventTestTrigger):
(WebCore::RenderListBox::setScrollTop):
(WebCore::RenderListBox::isActive):
(WebCore::RenderListBox::forceUpdateScrollbarsOnMainThreadForPerformanceTesting):
(WebCore::RenderListBox::createScrollbar):
* rendering/RenderObject.cpp:
(WebCore::RenderObject::theme):
* rendering/RenderObject.h:
(WebCore::RenderObject::page):
* rendering/RenderSearchField.cpp:
(WebCore::RenderSearchField::addSearchResult):
(WebCore::RenderSearchField::showPopup):
(WebCore::RenderSearchField::valueChanged):
* rendering/RenderSnapshottedPlugIn.cpp:
(WebCore::RenderSnapshottedPlugIn::updateSnapshot):
* rendering/RenderTheme.cpp:
(WebCore::RenderTheme::paint):
(WebCore::RenderTheme::updateControlStatesForRenderer):
(WebCore::RenderTheme::isActive):
* rendering/RenderThemeMac.mm:
(WebCore::RenderThemeMac::paintCellAndSetFocusedElementNeedsRepaintIfNecessary):
(WebCore::RenderThemeMac::paintSliderThumb):
* rendering/RenderVideo.cpp:
(WebCore::RenderVideo::paintReplaced):
* rendering/RenderView.cpp:
(WebCore::RenderView::pageNumberForBlockProgressionOffset):
(WebCore::RenderView::pageCount):
* rendering/svg/RenderSVGRoot.cpp:
(WebCore::RenderSVGRoot::paintReplaced):
* style/StyleResolveForDocument.cpp:
(WebCore::Style::resolveForDocument):

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

3 years agoFixed duplicate test expectation entries on Windows.
pvollan@apple.com [Fri, 6 Jan 2017 09:47:25 +0000 (09:47 +0000)]
Fixed duplicate test expectation entries on Windows.

Unreviewed test gardening.

* platform/win/TestExpectations:

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

3 years agoWarning about unconnectable outlets when opening a MiniBrowser window
timothy_horton@apple.com [Fri, 6 Jan 2017 09:16:17 +0000 (09:16 +0000)]
Warning about unconnectable outlets when opening a MiniBrowser window
https://bugs.webkit.org/show_bug.cgi?id=166756

Reviewed by Dan Bernstein.

* MiniBrowser/mac/BrowserWindow.xib:
When launching MiniBrowser, it says:
Failed to connect (Share) outlet from (WK1BrowserWindowController) to
    (MBToolbarItem): missing setter or instance variable
Failed to connect (shareButton) outlet from (WK1BrowserWindowController) to
    (NSButtonCell): missing setter or instance variable.

It looks like someone added the connection from the share button
to the BrowserWindowController three times; only one of the connections
is valid. Remove the other two.

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

3 years agoTextFragmentIterator::runWidth does not need typename CharacterType<> anymore.
zalan@apple.com [Fri, 6 Jan 2017 04:09:49 +0000 (04:09 +0000)]
TextFragmentIterator::runWidth does not need typename CharacterType<> anymore.
https://bugs.webkit.org/show_bug.cgi?id=166751

Reviewed by Simon Fraser.

No change in functionality.

* rendering/SimpleLineLayoutTextFragmentIterator.cpp:
(WebCore::SimpleLineLayout::TextFragmentIterator::textWidth):
* rendering/SimpleLineLayoutTextFragmentIterator.h:

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

3 years agoFinding text doesn't work across shadow boundary
rniwa@webkit.org [Fri, 6 Jan 2017 03:45:16 +0000 (03:45 +0000)]
Finding text doesn't work across shadow boundary
https://bugs.webkit.org/show_bug.cgi?id=158503

Reviewed by Antti Koivisto.

Source/WebCore:

Added a new TextIterator behavior flag, TextIteratorTraversesFlatTree, which makes TextIterator traverse
the flat tree instead of the DOM tree, and made this behavior default in findPlainText.

Also added a new find options flag, DoNotTraverseFlatTree, to suppress this behavior in window.find(~)
and execCommand('FindString', false, ~) as they should not be able to peek information inside shadow trees.
Unfortunately these APIs have been deprecated in the standards so there is no specification to follow.

For now, we don't support finding a word or a keyword across a shadow boundary as this would require
making rangeOfString and other related functions return a Range-like object that can cross shadow boundaries.

Also added internals.rangeOfString to test Editor::rangeOfString, and replaced the bit-flag arguments
to internals.countMatchesForText and internals.countFindMatches by an array of strings for better portability.

Test: editing/text-iterator/find-string-on-flat-tree.html

* editing/Editor.cpp:
(WebCore::Editor::rangeOfString): Use the modern containingShadowRoot instead of nonBoundaryShadowTreeRootNode
since the start container can be a shadow root, which nonBoundaryShadowTreeRootNode asserts not be the case.
* editing/Editor.h:
* editing/EditorCommand.cpp:
(WebCore::executeFindString): Don't traverse across shadow boundaries.
* editing/FindOptions.h: Added DoNotTraverseFlatTree.
* editing/TextIterator.cpp:
(WebCore::assignedAuthorSlot): Added.
(WebCore::authorShadowRoot): Added.
(WebCore::firstChildInFlatTreeIgnoringUserAgentShadow): Added.
(WebCore::nextSiblingInFlatTreeIgnoringUserAgentShadow): Added.
(WebCore::firstChild): Added. Traverses the flat tree when TextIteratorTraversesFlatTree is set.
(WebCore::nextSibling): Ditto.
(WebCore::parentNodeOrShadowHost): Ditto.
(WebCore::TextIterator::advance): Don't set m_handledChildren to true when the current node has display: contents.
(WebCore::findPlainText): Use TextIteratorTraversesFlatTree unless DoNotTraverseFlatTree is set.
* editing/TextIteratorBehavior.h: Added TextIteratorTraversesFlatTree.
* page/DOMWindow.cpp:
(WebCore::DOMWindow::find): Don't traverse across shadow boundaries.
* testing/Internals.cpp:
(WebCore::parseFindOptions): Added.
(WebCore::Internals::rangeOfString): Added.
(WebCore::Internals::countMatchesForText): Replaced the find options by an array of strings instead of a bit mask.
(WebCore::Internals::countFindMatches): Ditto.
* testing/Internals.h:
* testing/Internals.idl: Added rangeOfString, and replaced find options bit-flag in countMatchesForText and
countFindMatches by an array of strings so that the tests themselves don't rely on a specific value of each bit flag.

LayoutTests:

Updated the existing tests per changes to use an array of find options instead of raw bit mask,
and added a regression test for finding text by traversing flat tree along with testing
window.find and execCommand('FindString', false, ~) not walking across shadow boundaries.

* editing/text-iterator/count-mark-lineboxes-expected.txt:
* editing/text-iterator/count-mark-lineboxes.html:
* editing/text-iterator/count-mark-simple-lines-expected.txt:
* editing/text-iterator/count-mark-simple-lines.html:
* editing/text-iterator/count-matches-in-form-expected.txt:
* editing/text-iterator/count-matches-in-form.html:
* editing/text-iterator/count-matches-in-frames.html:
* editing/text-iterator/find-string-on-flat-tree-expected.txt: Added.
* editing/text-iterator/find-string-on-flat-tree.html: Added.
* fast/text/mark-matches-broken-line-rendering.html:
* fast/text/mark-matches-overflow-clip.html:
* fast/text/mark-matches-rendering-simple-lines-expected.html:
* fast/text/mark-matches-rendering-simple-lines.html:
* fast/text/mark-matches-rendering.html:

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

3 years agoUnreviewed, teach run-javascriptcore-tests that this is a slow test.
fpizlo@apple.com [Fri, 6 Jan 2017 03:14:25 +0000 (03:14 +0000)]
Unreviewed, teach run-javascriptcore-tests that this is a slow test.

* js/script-tests/regress-139548.js:

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

3 years ago[Form Validation] lengthy validation messages should be truncated with an ellipsis
cdumez@apple.com [Fri, 6 Jan 2017 02:47:06 +0000 (02:47 +0000)]
[Form Validation] lengthy validation messages should be truncated with an ellipsis
https://bugs.webkit.org/show_bug.cgi?id=166747
<rdar://problem/29872021>

Reviewed by Simon Fraser.

Lengthy HTML validation messages should be truncated with an ellipsis.
Previously, they were truncated but there was no ellipsis.

No new tests, not easily testable. Manually tested on
- http://codepen.io/cdumez/full/zoOZmZ/ (last field)

* platform/ios/ValidationBubbleIOS.mm:
(WebCore::ValidationBubble::ValidationBubble):
* platform/mac/ValidationBubbleMac.mm:
(WebCore::ValidationBubble::ValidationBubble):

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

3 years agoRadio buttons have a fixed border radius making them look square when resized
simon.fraser@apple.com [Fri, 6 Jan 2017 01:55:07 +0000 (01:55 +0000)]
Radio buttons have a fixed border radius making them look square when resized
https://bugs.webkit.org/show_bug.cgi?id=148676
Source/WebCore:

rdar://problem/29889892

Reviewed by Tim Horton.

Change the 8px border-radius of iOS radio buttons to 50% so they remain circular
when the page overrides the size.

Test: fast/forms/ios/large-radio-button-is-round.html

* css/html.css:
(#if defined(WTF_PLATFORM_IOS) && WTF_PLATFORM_IOS):

LayoutTests:

Reviewed by Tim Horton.

* fast/forms/ios/large-radio-button-is-round-expected.html: Added.
* fast/forms/ios/large-radio-button-is-round.html: Added.

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

3 years agoCoreText variation axis identifiers don't work with 64-bit numbers
mmaxfield@apple.com [Fri, 6 Jan 2017 01:06:15 +0000 (01:06 +0000)]
CoreText variation axis identifiers don't work with 64-bit numbers
https://bugs.webkit.org/show_bug.cgi?id=166745
<rdar://problem/29856541>
<rdar://problem/29848883>

Reviewed by Tim Horton.

There is a bug where some CFNumbers are getting garbage results when
being placed into a 64-bit field. Luckily, we don't need the full
64-bits; 32-bits is sufficient.

Test: fast/text/international/system-language/hindi-system-font-punctuation.html

* platform/graphics/cocoa/FontCacheCoreText.cpp:
(WebCore::defaultVariationValues):

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

3 years agoCarets can split up marriages and families
mmaxfield@apple.com [Fri, 6 Jan 2017 01:04:34 +0000 (01:04 +0000)]
Carets can split up marriages and families
https://bugs.webkit.org/show_bug.cgi?id=166711
<rdar://problem/29019333>

Reviewed by Alex Christensen.

Source/WTF:

There are four code points which should be allowed to accept emoji modifiers:
- U+1F46A FAMILY
- U+1F46B MAN AND WOMAN HOLDING HANDS
- U+1F46C TWO MEN HOLDING HANDS
- U+1F46D TWO WOMEN HOLDING HANDS

Even though macOS's and iOS's emoji keyboard don't allow users to actually type
these combinations, we may still receive them from other platforms. We should
therefore treat these as joining sequences. Rendering isn't a problem because
the fonts accept the emoji modifiers, but our caret placement code isn't educated
about it. Currently, we treat these emoji groups as ligatures, allowing the caret
to be placed between the two code points, which visually shows as being horizontally
centered in the glyph. Instead, we should treat these code points as accepting
emoji modifiers.

Tests: editing/caret/emoji.html
       editing/caret/ios/emoji.html

* wtf/text/TextBreakIterator.cpp:
(WTF::cursorMovementIterator):

LayoutTests:

AFAICT we don't have a test where we arrow-through a set of emoji. We do
have tests where we backspace-through a set of emoji. Add a new test for
the arrow keys.

* platform/ios/TestExpectations:
* platform/mac/editing/caret/emoji-expected.txt: Added.
* editing/caret/emoji.html: Added.
* editing/caret/ios/emoji-expected.txt: Added.
* editing/caret/ios/emoji.html: Added.

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

3 years agoAutomaticThread timeout shutdown leaves a small window where notify() would think...
fpizlo@apple.com [Fri, 6 Jan 2017 00:24:11 +0000 (00:24 +0000)]
AutomaticThread timeout shutdown leaves a small window where notify() would think that the thread is still running
https://bugs.webkit.org/show_bug.cgi?id=166742

Reviewed by Geoffrey Garen.

Source/JavaScriptCore:

Update to new AutomaticThread API.

* dfg/DFGWorklist.cpp:

Source/WTF:

Remove the use of the RAII ThreadScope, since the use of RAII helped make this bug possible:
we'd do ~ThreadScope after we had done ~LockHolder, so in between when we decided to shut
down a thread and when it reported itself as being shut down, there was a window where a
notify() call would get confused.

Now, we run all thread shutdown stuff while the lock is held. We release the lock last. One
API implication is that threadWillStop becomes threadIsStopping and it's called while the
lock is held. This seems benign.

* wtf/AutomaticThread.cpp:
(WTF::AutomaticThread::start):
(WTF::AutomaticThread::threadIsStopping):
(WTF::AutomaticThread::ThreadScope::ThreadScope): Deleted.
(WTF::AutomaticThread::ThreadScope::~ThreadScope): Deleted.
(WTF::AutomaticThread::threadWillStop): Deleted.
* wtf/AutomaticThread.h:

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

3 years agoWeb Inspector: Remove unused delegate from VisualStyleSelectorSection
commit-queue@webkit.org [Thu, 5 Jan 2017 23:42:05 +0000 (23:42 +0000)]
Web Inspector: Remove unused delegate from VisualStyleSelectorSection
https://bugs.webkit.org/show_bug.cgi?id=166744

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2017-01-05
Reviewed by Alex Christensen.

* UserInterface/Views/VisualStyleDetailsPanel.js:
(WebInspector.VisualStyleDetailsPanel.prototype.initialLayout):
* UserInterface/Views/VisualStyleSelectorSection.js:
(WebInspector.VisualStyleSelectorSection):

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

3 years agoStart hittesting a clean tree in RenderEmbeddedObject::isReplacementObscured
zalan@apple.com [Thu, 5 Jan 2017 23:37:16 +0000 (23:37 +0000)]
Start hittesting a clean tree in RenderEmbeddedObject::isReplacementObscured
https://bugs.webkit.org/show_bug.cgi?id=166743
<rdar://problem/29024384>

Reviewed by Simon Fraser.

Unable to reproduce.

* rendering/RenderEmbeddedObject.cpp:
(WebCore::RenderEmbeddedObject::isReplacementObscured):

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

3 years agoRebaseline fast/canvas/webgl/context-creation-attributes.html after r210372.
ryanhaddad@apple.com [Thu, 5 Jan 2017 22:40:21 +0000 (22:40 +0000)]
Rebaseline fast/canvas/webgl/context-creation-attributes.html after r210372.

Unreviewed test gardening.

* fast/canvas/webgl/context-creation-attributes-expected.txt:

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

3 years agoCrash inside Editor::styleForSelectionStart
rniwa@webkit.org [Thu, 5 Jan 2017 22:18:36 +0000 (22:18 +0000)]
Crash inside Editor::styleForSelectionStart
https://bugs.webkit.org/show_bug.cgi?id=166710

Reviewed by Chris Dumez.

Added a null pointer check. This crash can happen when the DOM is mutated as editorState tries
to compute the style at the selection start.

No new tests since there is no reproducible test case, and I couldn't come up with one either.
This crash seems to retire some intricate dependency between when DOM is mutated, selection is
updated, and then performPostLayoutTasks ends up updating the editor state in response to
the element's editabilty changing.

* editing/cocoa/EditorCocoa.mm:
(WebCore::Editor::styleForSelectionStart):

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

3 years agoUnreviewed, rolling out r210370.
ryanhaddad@apple.com [Thu, 5 Jan 2017 21:35:05 +0000 (21:35 +0000)]
Unreviewed, rolling out r210370.

This change caused hundreds of LayoutTest failures on Sierra.

Reverted changeset:

"[Cocoa] Variation fonts without variations specified are not
rendered as if the default variations were specified"
https://bugs.webkit.org/show_bug.cgi?id=166672
http://trac.webkit.org/changeset/210370

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

3 years ago[SOUP] Network process crash in WebKit::CustomProtocolManagerImpl::didFailWithError
commit-queue@webkit.org [Thu, 5 Jan 2017 21:27:50 +0000 (21:27 +0000)]
[SOUP] Network process crash in WebKit::CustomProtocolManagerImpl::didFailWithError
https://bugs.webkit.org/show_bug.cgi?id=165082

Patch by Carlos Garcia Campos <cgarcia@igalia.com> on 2017-01-05
Reviewed by Alex Christensen.

Source/WebCore:

Simplified WebKitSoupRequestGenericClient.

* platform/network/soup/WebKitSoupRequestGeneric.cpp:
(webkitSoupRequestGenericSendAsync):
(webkitSoupRequestGenericSendFinish):
(webkitSoupRequestGenericGetRequest):
* platform/network/soup/WebKitSoupRequestGeneric.h:
* platform/network/soup/WebKitSoupRequestGenericClient.h:

Source/WebKit2:

CustomProtocolManager uses a Workqueue to receive the IPC messages since r149194. Then we added the Soup
implementation adopting that approach, but without making our implementation thread safe. The crash happens
because the CustomProtocolManager implementation is used by two threads at the same time, the main thread
because of a ping load (probably caused by an image load in the unload handler, I haven't been able to
reproduce the crash) and the work queue thread. The reasons to make CustomProtocolManager use a WorkQueue
are no longer valid because CustomProtocolManager is now only used in the network process and sync loads don't
use any nested run loop, they are just an IPC sync message. So this patch makes CustomProtocolManager a normal
message receiver again to ensure messages are handled in the main thread. It also adds the common implementation
to a new CustomProtocolManager.cpp file shared by Cocoa and Soup based ports.

* CMakeLists.txt: Add CustomProtocolManager.cpp.
* NetworkProcess/CustomProtocols/Cocoa/CustomProtocolManagerCocoa.mm:
(-[WKCustomProtocol initWithRequest:cachedResponse:client:]): Use new CustomProtocolManager API.
(-[WKCustomProtocol startLoading]): Ditto.
(-[WKCustomProtocol stopLoading]): Ditto.
(WebKit::CustomProtocolManager::registerProtocolClass): Register the NSURLProtocol class when not using the
network session.
(WebKit::CustomProtocolManager::didFailWithError): removeCustomProtocol now receives an ID.
(WebKit::CustomProtocolManager::didFinishLoading): Ditto.
* NetworkProcess/CustomProtocols/CustomProtocolManager.cpp: Added.
(WebKit::generateCustomProtocolID): Moved from CustomProtocolManagerCocoa.mm and CustomProtocolManagerSoup.cpp.
(WebKit::CustomProtocolManager::supplementName): Ditto.
(WebKit::CustomProtocolManager::CustomProtocolManager): Also removes the work queue initialization.
(WebKit::CustomProtocolManager::initialize): Copied and modernized the loop.
(WebKit::CustomProtocolManager::addCustomProtocol): Copied from CustomProtocolManagerCocoa.mm.
(WebKit::CustomProtocolManager::removeCustomProtocol): Ditto.
(WebKit::CustomProtocolManager::startLoading): Send the StartLoading message to the proxy.
(WebKit::CustomProtocolManager::stopLoading): Send the StopLoading message to the proxy.
* NetworkProcess/CustomProtocols/CustomProtocolManager.h:
* NetworkProcess/CustomProtocols/soup/CustomProtocolManagerImpl.cpp: Removed.
* NetworkProcess/CustomProtocols/soup/CustomProtocolManagerImpl.h: Removed.
* NetworkProcess/CustomProtocols/soup/CustomProtocolManagerSoup.cpp: Moved the implementation from
CustomProtocolManagerImpl and updated to the new CustomProtocolManager API.
(WebKit::CustomProtocolManager::WebSoupRequestAsyncData::WebSoupRequestAsyncData):
(WebKit::CustomProtocolManager::WebSoupRequestAsyncData::~WebSoupRequestAsyncData):
(WebKit::CustomProtocolManager::registerProtocolClass):
(WebKit::CustomProtocolManager::registerScheme):
(WebKit::CustomProtocolManager::supportsScheme):
(WebKit::CustomProtocolManager::didFailWithError):
(WebKit::CustomProtocolManager::didLoadData):
(WebKit::CustomProtocolManager::didReceiveResponse):
(WebKit::CustomProtocolManager::didFinishLoading):
(WebKit::CustomProtocolManager::wasRedirectedToRequest):
* NetworkProcess/cocoa/NetworkSessionCocoa.mm:
(WebKit::globalCustomProtocolManager):
(WebKit::NetworkSessionCocoa::defaultSession):
CustomProtocolManager is no longer refcounted, so just pass a pointer.
A static pointer has the same lifetime as the NetworkProcess object in the NetworkProcess,
and in the WebProcess it will remain nullptr, just like it used to.
* PlatformEfl.cmake:
* PlatformGTK.cmake:
* WebKit2.xcodeproj/project.pbxproj:

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

3 years agoTurn preferLowPowerWebGLRendering setting on by default
cdumez@apple.com [Thu, 5 Jan 2017 20:56:03 +0000 (20:56 +0000)]
Turn preferLowPowerWebGLRendering setting on by default
https://bugs.webkit.org/show_bug.cgi?id=166737
<rdar://problem/29870033>

Reviewed by Dean Jackson.

Temporarily turn preferLowPowerWebGLRendering setting on by default until
we deal better with WebGL content in background tabs.

Source/WebCore:

* page/Settings.in:

Source/WebKit/mac:

* WebView/WebPreferences.mm:
(+[WebPreferences initialize]):

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

3 years agoUpdate pointer-lock test expectations, enabling passing tests.
commit-queue@webkit.org [Thu, 5 Jan 2017 20:37:07 +0000 (20:37 +0000)]
Update pointer-lock test expectations, enabling passing tests.
https://bugs.webkit.org/show_bug.cgi?id=166656
rdar://problem/29851126

Patch by Jeremy Jones <jeremyj@apple.com> on 2017-01-05
Reviewed by Alex Christensen.

Several pointer lock tests are passing and are now marked as passing.
pointer-lock/lock-already-locked.html Pass
pointer-lock/lock-element-not-in-dom.html Pass
http/tests/pointer-lock/iframe-sandboxed-allow-pointer-lock.html Pass
http/tests/pointer-lock/iframe-sandboxed-nested-allow-pointer-lock.html Pass
http/tests/pointer-lock/pointerlockelement-different-origin.html Pass
http/tests/pointer-lock/pointerlockelement-same-origin.html Pass
http/tests/pointer-lock/requestPointerLock-can-not-transfer-between-documents.html Pass
http/tests/pointer-lock/iframe-sandboxed.html Pass
http/tests/pointer-lock/iframe-sandboxed-nested-disallow-then-allow-pointer-lock.html Pass

* platform/mac/TestExpectations:
* http/tests/pointer-lock/iframe-sandboxed-expected.txt: Updated.
* http/tests/pointer-lock/iframe-sandboxed-nested-disallow-then-allow-pointer-lock-expected.txt: Updated

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

3 years ago[Cocoa] Variation fonts without variations specified are not rendered as if the defau...
mmaxfield@apple.com [Thu, 5 Jan 2017 20:31:28 +0000 (20:31 +0000)]
[Cocoa] Variation fonts without variations specified are not rendered as if the default variations were specified
https://bugs.webkit.org/show_bug.cgi?id=166672
<rdar://problem/29779119>
<rdar://problem/29848883>

Reviewed by Simon Fraser.

CoreText has a bug (<rdar://problem/29859207>) where variation fonts without
a specified variation value are rendered as if the minimum value is specified,
rather than the default value. The solution is to apply default values where
they are omitted.

Test: fast/text/variations/advances.html

* platform/graphics/cocoa/FontCacheCoreText.cpp:
(WebCore::preparePlatformFont):

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

3 years agoMark the dedicated root linebox for trailing floats in empty inlines dirty.
zalan@apple.com [Thu, 5 Jan 2017 20:24:59 +0000 (20:24 +0000)]
Mark the dedicated root linebox for trailing floats in empty inlines dirty.
https://bugs.webkit.org/show_bug.cgi?id=166732
<rdar://problem/29100419>

Reviewed by Antti Koivisto.

Source/WebCore:

We normally attach floating boxes to the last root linebox. However when the floatbox is preceded by a <br>
we generate a dedicated root linebox (TrailingFloatsRootInlineBox) for the floatbox.
When this floatbox is a RenderInline descendant and this RenderInline does not generate lineboxes (it's ancestor RenderBlockFlow does)
we have to make sure that this special root linebox gets marked dirty when the associated floatbox changes.
(Unfortunately through the recursive calls on dirtyLinesFromChangedChild(), we lose the information about
the "changed child" since the inlines propagates the marking logic to the RenderBlockFlow, see FIXME.)

Test: fast/inline/trailing-floats-inline-crash2.html

* rendering/RenderLineBoxList.cpp:
(WebCore::RenderLineBoxList::dirtyLinesFromChangedChild):

LayoutTests:

* fast/inline/trailing-floats-inline-crash2-expected.txt: Added.
* fast/inline/trailing-floats-inline-crash2.html: Added.

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

3 years ago[Cocoa] Both modern-media-controls/images/iOS modern-media-controls/images/macOS...
commit-queue@webkit.org [Thu, 5 Jan 2017 20:15:27 +0000 (20:15 +0000)]
[Cocoa] Both modern-media-controls/images/iOS modern-media-controls/images/macOS are installed on both platforms
https://bugs.webkit.org/show_bug.cgi?id=163871

Patch by Antoine Quint <graouts@apple.com> on 2017-01-05
Reviewed by Eric Carlson.

We now only copy modern media controls images, if any, for the current platform.

* WebCore.xcodeproj/project.pbxproj:

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

3 years agoWeb Inspector: Test.html should support globals reportInternalError, reportUnhandledR...
bburg@apple.com [Thu, 5 Jan 2017 20:07:44 +0000 (20:07 +0000)]
Web Inspector: Test.html should support globals reportInternalError, reportUnhandledRejection, reportUncaughtException
https://bugs.webkit.org/show_bug.cgi?id=161358
<rdar://problem/28066446>

Reviewed by Joseph Pecoraro.

Source/WebInspectorUI:

We have a hodgepodge of redundant code that reports uncaught exceptions in the inspector page.
There is better handling of uncaught exceptions in the inspected page, such as including stack traces.

This patch consolidates a lot of this code and makes it possible to report
unhandled promise rejections, top-level uncaught exceptions, and exceptions
caught in a try-catch block. The formatting and sanitization code for all of
these things is shared and consistent. Finally, some tests have been added to
catch regressions in unhandled rejection/uncaught exception reporting.

* UserInterface/Test/FrontendTestHarness.js:
(FrontendTestHarness): Explicitly set initial flag state here so it's easy to find all flags.

(FrontendTestHarness.prototype.redirectConsoleToTestOutput):
Extract this code to sanitize stack frames and put it in TestHarness. It is used
by other methods that need to print stack frames.

(FrontendTestHarness.prototype.reportUnhandledRejection):
(FrontendTestHarness.prototype.reportUncaughtException):
Added. Sanitize stack trace data so it is deterministic. Log the message to the
original window.console but don't exit early. Sometimes the test page is not
fully loaded if we throw an exception quite early in the test() method, and there's
no harm in not early returning. If we do early return in this case, then a test that
uses reportUncaughtException on purpose may not complete because the call to completeTest()
would be skipped by returning early.

(FrontendTestHarness.prototype.reportUncaughtExceptionFromEvent):
Renamed from reportUncaughtException since the signature of that method suggests
it should have a single exception argument rather than lots of data arguments.

* UserInterface/Test/Test.js: Add globals.

* UserInterface/Test/TestHarness.js:
(TestHarness): Document class flags.
(TestHarness.sanitizeURL):
(TestHarness.sanitizeStackFrame):
(TestHarness.prototype.sanitizeStack):
Extract this code from other parts of the test harness. Make sanitizeStack
an instance method so that there is only one place that needs to check the
'suppressStackTraces' flag.

* UserInterface/Test/TestSuite.js:
(TestSuite.prototype.logThrownObject):
(TestSuite):
(AsyncTestSuite.prototype.runTestCases):
(AsyncTestSuite):
(SyncTestSuite.prototype.runTestCases):
(SyncTestSuite):
(TestSuite.messageFromThrownObject): Deleted.
Inline some helpers with only one use-site and consolidate redundant code
for adding an exception and message to the test results.

LayoutTests:

Improve uncaught exception reporting and add some tests to document
new and existing behavior.

* http/tests/inspector/resources/inspector-test.js:
(runTest.runTestMethodInFrontend):
(runTest): Outsource reporting of an uncaught exception while injecting
a method into the frontend. By doing this, we can make the report using
the actual exception object since it doesn't go through window.onerror.

* inspector/unit-tests/async-test-suite-expected.txt:
* inspector/unit-tests/async-test-suite.html:
* inspector/unit-tests/sync-test-suite-expected.txt:
* inspector/unit-tests/sync-test-suite.html:
Rebaseline and force suppression of stack traces, which are not deterministic
across commits due to logging specific lines and columns in TestCombined.js.

* inspector/unit-tests/globals-uncaught-exception-from-timer-callback-expected.txt: Added.
* inspector/unit-tests/globals-uncaught-exception-from-timer-callback.html: Added.
* inspector/unit-tests/globals-uncaught-exception-in-test-function-expected.txt: Added.
* inspector/unit-tests/globals-uncaught-exception-in-test-function.html: Added.
* inspector/unit-tests/globals-uncaught-exception-in-test-suite-expected.txt: Added.
* inspector/unit-tests/globals-uncaught-exception-in-test-suite.html: Added.
* inspector/unit-tests/globals-unhandled-rejection-in-test-function-expected.txt: Added.
* inspector/unit-tests/globals-unhandled-rejection-in-test-function.html: Added.
* inspector/unit-tests/globals-unhandled-rejection-in-test-suite-expected.txt: Added.
* inspector/unit-tests/globals-unhandled-rejection-in-test-suite.html: Added.
* inspector/unit-tests/globals-unhandled-rejection-in-timer-callback-expected.txt: Added.
* inspector/unit-tests/globals-unhandled-rejection-in-timer-callback.html: Added.

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

3 years agoSkip fast/scrolling/page-cache-back-overflow-scroll-restore.html on iOS simulator.
akling@apple.com [Thu, 5 Jan 2017 19:51:38 +0000 (19:51 +0000)]
Skip fast/scrolling/page-cache-back-overflow-scroll-restore.html on iOS simulator.
<https://webkit.org/b/166736>

* platform/ios-simulator/TestExpectations:

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

3 years agoAdd WebCore::URL::protocolHostAndPort
krollin@apple.com [Thu, 5 Jan 2017 19:18:03 +0000 (19:18 +0000)]
Add WebCore::URL::protocolHostAndPort
https://bugs.webkit.org/show_bug.cgi?id=166426

Reviewed by Alex Christensen.

Source/WebCore:

Added to support record/replay mechanism, which needs it in order to
implement fuzzy-matching of URLs that are similar to each other but
that nonetheless come from the same source/host.

Updated TestWebKitAPI/Tests/WebCore/URL.cpp.

* platform/URL.cpp:
(WebCore::URL::protocolHostAndPort):
* platform/URL.h:

Tools:

Add test for protocolHostAndPort.

* TestWebKitAPI/Tests/WebCore/URL.cpp:
(TestWebKitAPI::TEST_F):

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

3 years agoUse WTF::Function instead of std::function in network cache code
antti@apple.com [Thu, 5 Jan 2017 19:10:23 +0000 (19:10 +0000)]
Use WTF::Function instead of std::function in network cache code
https://bugs.webkit.org/show_bug.cgi?id=166721

Reviewed by Andreas Kling.

Use better move-only type. Fix some unnecessary function copies.

* NetworkProcess/cache/NetworkCache.cpp:
(WebKit::NetworkCache::Cache::retrieve):
(WebKit::NetworkCache::Cache::clear):
* NetworkProcess/cache/NetworkCache.h:
* NetworkProcess/cache/NetworkCacheData.h:
* NetworkProcess/cache/NetworkCacheDataCocoa.mm:
(WebKit::NetworkCache::Data::apply):
* NetworkProcess/cache/NetworkCacheDataSoup.cpp:
(WebKit::NetworkCache::Data::apply):
* NetworkProcess/cache/NetworkCacheFileSystem.cpp:
(WebKit::NetworkCache::traverseDirectory):
* NetworkProcess/cache/NetworkCacheFileSystem.h:
* NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp:
(WebKit::NetworkCache::SpeculativeLoadManager::canRetrieve):
(WebKit::NetworkCache::SpeculativeLoadManager::retrieve):

    Split retrieve() to canRetrieve() and retrieve() functions.
    This avoids the need to copy the completion handler in the caller.

* NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.h:
* NetworkProcess/cache/NetworkCacheStorage.cpp:
(WebKit::NetworkCache::Storage::ReadOperation::ReadOperation):
(WebKit::NetworkCache::Storage::traverse):
(WebKit::NetworkCache::Storage::clear):
* NetworkProcess/cache/NetworkCacheStorage.h:

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

3 years agoUnreviewed build fix after https://trac.webkit.org/changeset/210360
enrica@apple.com [Thu, 5 Jan 2017 18:54:47 +0000 (18:54 +0000)]
Unreviewed build fix after https://trac.webkit.org/changeset/210360

* UIProcess/Cocoa/WebViewImpl.mm:
(WebKit::WebViewImpl::performDragOperation):

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

3 years agoForm validation: Align email validation with the latest HTML specification
cdumez@apple.com [Thu, 5 Jan 2017 18:31:27 +0000 (18:31 +0000)]
Form validation: Align email validation with the latest HTML specification
https://bugs.webkit.org/show_bug.cgi?id=166697
<rdar://problem/29870245>

Reviewed by Alex Christensen.

Source/WebCore:

Align email validation with the latest HTML specification:
- https://html.spec.whatwg.org/#valid-e-mail-address

It particular, the following changes were made:
- The first and last character of the domain now needs to be a letter or a digit
- Parts of the domain can only be 63 characters in length

No new tests, extended existing test.

* html/EmailInputType.cpp:

LayoutTests:

Extended / updated existing layout test to cover behavior changes.

* fast/forms/ValidityState-typeMismatch-email-expected.txt:
* fast/forms/resources/ValidityState-typeMismatch-email.js:

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

3 years agoSupport File Promise during drag for macOS.
enrica@apple.com [Thu, 5 Jan 2017 18:29:00 +0000 (18:29 +0000)]
Support File Promise during drag for macOS.
https://bugs.webkit.org/show_bug.cgi?id=165204
rdar://problem/19595567

Reviewed by Tim Horton.

Source/WebCore:

Adds the support for handling File Promise type during
drag. DragData now has the knowledge of the NSFilesPromisePboardType and
checks for the data type during drag.

* page/mac/DragControllerMac.mm:
(WebCore::DragController::dragOperation):
* platform/DragData.h:
(WebCore::DragData::setFileNames):
(WebCore::DragData::fileNames):
* platform/mac/DragDataMac.mm:
(WebCore::DragData::containsFiles):
(WebCore::DragData::numberOfFiles):
(WebCore::DragData::asFilenames):
(WebCore::DragData::containsCompatibleContent):
(WebCore::DragData::containsPromise):
(WebCore::DragData::asURL):

Source/WebKit/mac:

Adds support for dropping a File Promise in a WebView.
The implementation uses new File Promise API available in Sierra.

* Misc/WebNSPasteboardExtras.mm:
(+[NSPasteboard _web_dragTypesForURL]):
* WebView/WebView.mm:
(-[WebView performDragOperation:]):

Source/WebKit2:

Adds support for dropping a File Promise in a WKWebView.
The implementation uses new File Promise API available in Sierra.

* Shared/WebCoreArgumentCoders.cpp:
(IPC::ArgumentCoder<DragData>::encode):
(IPC::ArgumentCoder<DragData>::decode):
* Shared/mac/PasteboardTypes.mm:
(WebKit::PasteboardTypes::forURL):
* UIProcess/Cocoa/WebViewImpl.h:
* UIProcess/Cocoa/WebViewImpl.mm:
(WebKit::WebViewImpl::createSandboxExtensionsIfNeeded):
(WebKit::WebViewImpl::performDragOperation):
(WebKit::maybeCreateSandboxExtensionFromPasteboard): Deleted.
(WebKit::createSandboxExtensionsForFileUpload): Deleted.

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

3 years ago[Win] Compile error.
pvollan@apple.com [Thu, 5 Jan 2017 18:05:29 +0000 (18:05 +0000)]
[Win] Compile error.
https://bugs.webkit.org/show_bug.cgi?id=166726

Source/JavaScriptCore:

Reviewed by Alex Christensen.

Add include folder.

* CMakeLists.txt:

Source/WebCore:

Reviewed by Alex Christensen.

Add include folder.

* CMakeLists.txt:

Source/WebKit:

Add include folder.

* CMakeLists.txt:

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

3 years ago[Win] Archive test result is failing.
pvollan@apple.com [Thu, 5 Jan 2017 17:34:47 +0000 (17:34 +0000)]
[Win] Archive test result is failing.
https://bugs.webkit.org/show_bug.cgi?id=166720

Reviewed by Alex Christensen.

Deleting the layout test result folder is sometimes failing
on Windows. This is not a critical error.

* BuildSlaveSupport/test-result-archive:
(archiveTestResults):

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

3 years ago[SOUP] AddressSanitizer: heap-use-after-free under WTF::String::fromUTF8()
commit-queue@webkit.org [Thu, 5 Jan 2017 17:30:57 +0000 (17:30 +0000)]
[SOUP] AddressSanitizer: heap-use-after-free under WTF::String::fromUTF8()
https://bugs.webkit.org/show_bug.cgi?id=166722

Patch by Milan Crha <mcrha@redhat.com> on 2017-01-05
Reviewed by Alex Christensen.

* platform/soup/PublicSuffixSoup.cpp:
(WebCore::topPrivatelyControlledDomain):
Use a variable to hold UTF-8 version of the domain, because
the soup_tld_get_base_domain() returns a pointer into the passed-in
string, which could be freed due to the temporary object being freed.

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

3 years agoRemove some unnecessary page cache checks in render tree code.
akling@apple.com [Thu, 5 Jan 2017 16:17:22 +0000 (16:17 +0000)]
Remove some unnecessary page cache checks in render tree code.
<https://webkit.org/b/166728>

Reviewed by Antti Koivisto.

There is no render tree in the page cache, so we don't need to be checking
for it in renderer code.

* rendering/RenderElement.cpp:
(WebCore::shouldRepaintForImageAnimation):
(WebCore::RenderElement::newImageAnimationFrameAvailable):
* rendering/RenderImage.cpp:
(WebCore::RenderImage::imageChanged):
* rendering/RenderObject.cpp:
(WebCore::printRenderTreeForLiveDocuments):
(WebCore::printLayerTreeForLiveDocuments):
* rendering/RenderView.cpp:
(WebCore::RenderView::lazyRepaintTimerFired):

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

3 years agoREGRESSION(r210226): overflow:scroll scroll position not restored on back navigation
akling@apple.com [Thu, 5 Jan 2017 16:02:44 +0000 (16:02 +0000)]
REGRESSION(r210226): overflow:scroll scroll position not restored on back navigation
<https://webkit.org/b/166724>

Reviewed by Antti Koivisto.

Source/WebCore:

Before r210226, the render tree being torn down and the document being destroyed
were roughly the same thing, since they would always happen together, from the
render tree's perspective.

Changing this caused us to skip over the code that saves the scroll position
for an element's RenderLayer when going into the page cache. Navigating back to
that page would then scroll the layer to (0,0) instead of the previous position.

The fix is simply to remove the check for documentBeingDestroyed() in ~RenderLayer().
Note that two checks are being removed, there was also a weird "optimization"
to avoid nulling out EventHandler's m_resizeLayer if it points to this layer.
That pointer would eventually get nulled out in EventHandler::clear() anyway,
but it feels better to not let that pointer dangle.

Test: fast/scrolling/page-cache-back-overflow-scroll-restore.html

* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::~RenderLayer):

LayoutTests:

Add a test that navigates back to a page with a scrolled overflow:scroll element.
The test verifies that the scroll position is restored.

* fast/scrolling/page-cache-back-overflow-scroll-restore-expected.txt: Added.
* fast/scrolling/page-cache-back-overflow-scroll-restore.html: Added.

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

3 years agoDisable smooth playhead animation for main content media in the Touch Bar
wenson_hsieh@apple.com [Thu, 5 Jan 2017 15:51:39 +0000 (15:51 +0000)]
Disable smooth playhead animation for main content media in the Touch Bar
https://bugs.webkit.org/show_bug.cgi?id=166715
<rdar://problem/29870673>

Reviewed by Eric Carlson.

Passing in a non-zero playback rate to WebPlaybackControlsManager's timing property causes unintended effects
further down the stack. Please see the Radar for more details.

* platform/mac/WebPlaybackSessionInterfaceMac.mm:
(WebCore::WebPlaybackSessionInterfaceMac::updatePlaybackControlsManagerTiming):

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

3 years agoFix iOS build due to missing #include's.
akling@apple.com [Thu, 5 Jan 2017 15:12:03 +0000 (15:12 +0000)]
Fix iOS build due to missing #include's.

* history/CachedFrame.cpp:

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

3 years agoRemove ChromeClient::needTouchEvents().
akling@apple.com [Thu, 5 Jan 2017 13:47:59 +0000 (13:47 +0000)]
Remove ChromeClient::needTouchEvents().
<https://webkit.org/b/166723>

Rubber-stamped by Antti Koivisto.

Source/WebCore:

Remove this hook since it's a no-op in every port.

* dom/Document.cpp:
(WebCore::Document::didBecomeCurrentDocumentInFrame):
(WebCore::Document::didAddTouchEventHandler):
(WebCore::Document::didRemoveTouchEventHandler):
* history/CachedFrame.cpp:
(WebCore::CachedFrameBase::restore):
* loader/EmptyClients.h:
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::transitionToCommitted):
* page/ChromeClient.h:

Source/WebKit/mac:

* WebCoreSupport/WebChromeClient.h:

Source/WebKit/win:

* WebCoreSupport/WebChromeClient.h:

Source/WebKit2:

* WebProcess/WebCoreSupport/WebChromeClient.h:

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

3 years agoUnreviewed test gardening.
pvollan@apple.com [Thu, 5 Jan 2017 13:14:05 +0000 (13:14 +0000)]
Unreviewed test gardening.

Update test expectations on Windows for failing tests. These failures are tracked in
https://bugs.webkit.org/show_bug.cgi?id=160447.

* platform/win/TestExpectations:

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