blob: 79afcd44aa583ad0db7ea522eeb4a228d7024693 [file] [log] [blame]
2017-04-11 Youenn Fablet <youenn@apple.com>
MediaStream id should be equal to msid
https://bugs.webkit.org/show_bug.cgi?id=170712
Reviewed by Eric Carlson.
Covered by rebased tests.
Setting MediaStream id to libwebrtc mediastream label.
Refactoring to use more Ref<> in MediaStream code.
Making PeerConnection use the libwebrtc backend by default for layout tests instead of the mock.
* Modules/mediastream/MediaStream.cpp:
(WebCore::MediaStream::create):
(WebCore::createTrackPrivateVector):
(WebCore::MediaStream::MediaStream):
* Modules/mediastream/MediaStream.h:
* Modules/mediastream/MediaStreamRegistry.cpp:
(WebCore::MediaStreamRegistry::lookUp):
* Modules/mediastream/UserMediaRequest.cpp:
(WebCore::UserMediaRequest::allow):
* Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
(WebCore::LibWebRTCMediaEndpoint::mediaStreamFromRTCStream):
(WebCore::LibWebRTCMediaEndpoint::addRemoteStream):
(WebCore::LibWebRTCMediaEndpoint::addRemoteTrack):
* Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:
* platform/graphics/MediaPlayer.cpp:
(WebCore::MediaPlayer::load):
* platform/graphics/MediaPlayer.h:
* platform/mediastream/MediaStreamPrivate.cpp:
(WebCore::MediaStreamPrivate::MediaStreamPrivate):
* platform/mediastream/MediaStreamPrivate.h:
(WebCore::MediaStreamPrivate::create):
* testing/Internals.cpp:
(WebCore::Internals::Internals):
2017-04-11 Chris Fleizach <cfleizach@apple.com>
AX: Web article navigation does not work (article rotor for Facebook, Twitter, Messages etc.)
https://bugs.webkit.org/show_bug.cgi?id=170330
<rdar://problem/31366105>
Reviewed by Joanmarie Diggs.
Add a search ability for the "article" role.
Test: accessibility/mac/search-predicate-article.html
* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::isAccessibilityObjectSearchMatchAtIndex):
* accessibility/AccessibilityObject.h:
* accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
(-[WebAccessibilityObjectWrapper _accessibilityArticleAncestor]):
* accessibility/mac/WebAccessibilityObjectWrapperBase.mm:
(createAccessibilitySearchKeyMap):
2017-04-11 Chris Fleizach <cfleizach@apple.com>
AX: PDF plugin needs to support PDF-DOM Mode
https://bugs.webkit.org/show_bug.cgi?id=170589
Reviewed by Tim Horton.
Provide WebCore support for accessibility connect to PDF document.
This includes the ability to connect a PDF annotation created node within WebKit to
its PDFAnnotation parent (through use of shadowPluginParent).
* accessibility/AXObjectCache.h:
* accessibility/mac/AXObjectCacheMac.mm:
(WebCore::AXPostNotificationWithUserInfo):
* accessibility/mac/WebAccessibilityObjectWrapperMac.h:
* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(-[WebAccessibilityObjectWrapper shadowPluginParent]):
(-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
* html/HTMLAttributeNames.in:
* plugins/PluginViewBase.h:
(WebCore::PluginViewBase::accessibilityShadowPluginParentForElement):
2017-04-11 Carlos Garcia Campos <cgarcia@igalia.com>
REGRESSION(r215153): Request Animation Frame broken when building without REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR
https://bugs.webkit.org/show_bug.cgi?id=170719
Reviewed by Žan Doberšek.
This is because when not using the display refresh monitor, the timer is always used, not only when throttling,
but since r215153 the rAF timer is always aligned to 30ms.
Fixes: fast/animation/request-animation-frame-too-rapid.html
* dom/ScriptedAnimationController.cpp:
(WebCore::ScriptedAnimationController::scheduleAnimation): Only do the timer alignment when throttling.
2017-04-11 Yoav Weiss <yoav@yoav.ws>
[link preload] Double downloads of preloaded content when it's in MemoryCache
https://bugs.webkit.org/show_bug.cgi?id=170122
Reviewed by Antti Koivisto.
No new tests, but unflaked http/tests/preload/single_download_preload_headers_charset.html.
The test was flaky because it appears as if MemoryCache is not being evicted between runs,
and running multiple iterations of the test resulted in preloaded being taken out of MemoryCache
and not having the unknown encoding flag. In those cases, the result was a double download and
a failed test.
* loader/TextResourceDecoder.cpp:
(WebCore::TextResourceDecoder::setEncoding): Set the m_encodingSet flag.
* loader/TextResourceDecoder.h: Added an m_encodingSet flag initialized to false.
* loader/cache/CachedCSSStyleSheet.cpp:
(WebCore::CachedCSSStyleSheet::setEncoding): Assert that stylesheets don't maintain decoded text.
* loader/cache/CachedResource.cpp:
(WebCore::CachedResource::CachedResource): Remove initialization of hasUnknownEncoding flag.
* loader/cache/CachedResource.h:
(WebCore::CachedResource::hasUnknownEncoding): Remove.
(WebCore::CachedResource::setHasUnknownEncoding): Remove.
(WebCore::CachedResource::CachedResource): Remove initialization of hasUnknownEncoding flag.
* loader/cache/CachedResourceLoader.cpp:
(WebCore::CachedResourceLoader::determineRevalidationPolicy): Set the encoding in case it changed.
2017-04-11 Miguel Gomez <magomez@igalia.com>
REGRESSION(r215211): [GTK] Lots of image related tests are timing out, causing the test bot to exit early
https://bugs.webkit.org/show_bug.cgi?id=170727
Reviewed by Carlos Garcia Campos.
Since r215211 ImageDecoder::isSizeAvailable() calls encodedDataStatus() in the different decoder implementations,
and those implementations force a partial decoding of the image if the size is not available yet. But
ImageDecoder::isSizeAvailable() was already being used inside the decoders assuming that it wasn't going to
force this partial decoding. Due to this, there are some situations where the partial decoding is not
desired but it's happening anyway. For example, the check in setSize(), which causes the partial decoding
to happen again and again because no value is actually set to the animation size (which causes the timouts
in the test bot).
To avoid this, replace all the calls to ImageDecoder::isSizeAvailable() inside the decoders with calls to
ImageDecoder::encodedDataStatus(), which doesn't force the partial decoding.
Covered by existent tests.
* platform/image-decoders/gif/GIFImageDecoder.cpp:
(WebCore::GIFImageDecoder::setSize):
* platform/image-decoders/ico/ICOImageDecoder.cpp:
(WebCore::ICOImageDecoder::decodeAtIndex):
* platform/image-decoders/jpeg/JPEGImageDecoder.h:
* platform/image-decoders/png/PNGImageDecoder.cpp:
(WebCore::PNGImageReader::decode):
(WebCore::PNGImageDecoder::frameBufferAtIndex):
* platform/image-decoders/webp/WEBPImageDecoder.cpp:
(WebCore::WEBPImageDecoder::decode):
2017-04-11 Miguel Gomez <magomez@igalia.com>
REGRESSION(r215211): [GTK] Lots of image related tests are crashing, causing the test bot to exit early
https://bugs.webkit.org/show_bug.cgi?id=170721
Reviewed by Carlos Garcia Campos.
r215211 caused an infinite loop because of calls between ImageDecoder::isSizeAvailable() and the specializations of
ImageDecoder::encodedDataStatus(). Change the different decoders so ImageDecoder::encodedDataStatus doesn't call
ImageDecoder::isSizeAvailable().
Covered by existent tests.
* platform/image-decoders/bmp/BMPImageDecoder.cpp:
(WebCore::BMPImageDecoder::encodedDataStatus):
* platform/image-decoders/gif/GIFImageDecoder.cpp:
(WebCore::GIFImageDecoder::encodedDataStatus):
* platform/image-decoders/ico/ICOImageDecoder.cpp:
(WebCore::ICOImageDecoder::encodedDataStatus):
* platform/image-decoders/jpeg/JPEGImageDecoder.cpp:
(WebCore::JPEGImageDecoder::encodedDataStatus):
* platform/image-decoders/png/PNGImageDecoder.cpp:
(WebCore::PNGImageDecoder::encodedDataStatus):
* platform/image-decoders/webp/WEBPImageDecoder.cpp:
(WebCore::WEBPImageDecoder::encodedDataStatus):
2017-04-10 Alex Christensen <achristensen@webkit.org>
Revert r215217
https://bugs.webkit.org/show_bug.cgi?id=170703
* Configurations/FeatureDefines.xcconfig:
2017-04-10 Chris Dumez <cdumez@apple.com>
Fix bad change in r215167.
https://bugs.webkit.org/show_bug.cgi?id=170656
Reviewed by Yusuke Suzuki.
Revert mistake made in r215167.
* rendering/RenderThemeGtk.cpp:
(WebCore::RenderThemeGtk::caretBlinkInterval):
2017-04-10 Alex Christensen <achristensen@webkit.org>
Continue enabling WebRTC
https://bugs.webkit.org/show_bug.cgi?id=170703
Reviewed by Youenn Fablet.
* Configurations/FeatureDefines.xcconfig:
2017-04-10 Jeremy Jones <jeremyj@apple.com>
PlayerLayerView +layerClass methods should use return type Class.
https://bugs.webkit.org/show_bug.cgi?id=165406
Reviewed by Sam Weinig.
No new tests because not behavior change.
* platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
(WebAVPictureInPicturePlayerLayerView_layerClass):
(WebAVPlayerLayerView_layerClass):
2017-04-10 Said Abou-Hallawa <sabouhallawa@apple.com>
CachedImage should stop decoding images when unknown type is detected
https://bugs.webkit.org/show_bug.cgi?id=170530
Reviewed by Tim Horton.
If the status of the encoded data is "unknown type", WebKit should stop
decoding the rest of the data. Ideally WebKit should also cancel loading
the rest of the encoded data.
To do that we need to add a function to the ImageDecoder to return the
encodedDataStatus(). We also need to change the return type of Image::setData()
and Image::dataChanged() form bool to EncodedDataStatus.
* WebCore.xcodeproj/project.pbxproj: Add ImageTypes.h to the WebCore project.
* loader/cache/CachedImage.cpp:
(WebCore::CachedImage::addIncrementalDataBuffer): Replace checking !sizeAvailable
by checking if encodedDataStatus isn't an error but it has not reached
sizeAvailable state
* loader/cache/CachedResourceClientWalker.h:
(WebCore::CachedResourceClientWalker::CachedResourceClientWalker): Unrelated clean-up.
(WebCore::CachedResourceClientWalker::next): Ditto.
* loader/icon/IconRecord.cpp:
(WebCore::IconRecord::setImageData): Image::setData() used to return a bool. Now it returns
an EncodedDataStatus. !setData() now means setData() < EncodedDataStatus::SizeAvailable.
* platform/graphics/BitmapImage.cpp:
(WebCore::BitmapImage::dataChanged): Replace the return of dataChanged() from bool
by EncodedDataStatus.
* platform/graphics/BitmapImage.h: Replace isSizeAvailable() by a new function
named encodedDataStatus().
* platform/graphics/Image.cpp:
(WebCore::Image::setData): Code clean-up and adding a clarification comment.
* platform/graphics/Image.h: Change the return of setData() and dataChanged() to be
EncodedDataStatus.
(WebCore::Image::dataChanged): Return EncodedDataStatus::Unknown as an indication
the size is not available but we do not have an error.
* platform/graphics/ImageTypes.h: Added.
Image definitions which are shared among Image, ImageDecoder, ImageSource,
ImageFrameCache and ImageFrame used to be added to ImageFrame.h. This has
been annoying since these definitions aren't related to ImageFrame only.
A new header file named ImageTypes.h is to the to include such definitions.
(WebCore::operator++):
* platform/graphics/ImageFrame.h:
(WebCore::operator++): Deleted.
* platform/graphics/ImageFrameCache.cpp:
(WebCore::ImageFrameCache::ImageFrameCache): This is the case of a BitmapImage without
a decoder but with a NativeImage. The status has to be EncodedDataStatus::Complete.
(WebCore::ImageFrameCache::growFrames): Replace if (isSizeAvailable()) by
if (encodedDataStatus() >= EncodedDataStatus::SizeAvailable).
(WebCore::ImageFrameCache::metadata): Ditto.
(WebCore::ImageFrameCache::encodedDataStatus): This is a replacement for isSizeAvailable().
Don't cache the EncodedDataStatus until it is Complete. Don't call didDecodeProperties()
until the status >= EncodedDataStatus::SizeAvailable.
(WebCore::ImageFrameCache::isSizeAvailable): Deleted.
* platform/graphics/ImageFrameCache.h: Replace isSizeAvailable() by encodedDataStatus().
* platform/graphics/ImageSource.cpp:
(WebCore::ImageSource::dataChanged): Make return an EncodedDataStatus instead of returning
a bool for isSizeAvailable.
* platform/graphics/ImageSource.h:
(WebCore::ImageSource::encodedDataStatus): Replace isSizeAvailable() by encodedDataStatus().
(WebCore::ImageSource::isSizeAvailable): Deleted.
* platform/graphics/cg/ImageDecoderCG.cpp:
(WebCore::ImageDecoder::encodedDataStatus): Replace isSizeAvailable() by encodedDataStatus().
The logic of this function is the following:
-- CGImageSourceGetStatus() can return kCGImageStatusUnexpectedEOF, kCGImageStatusInvalidData
or kCGImageStatusReadingHeader even if CG will end up recovering form the error and drawing
the image. Actually CG initializes the status of CGImageSource before receiving any data
with kCGImageStatusInvalidData. So the status will be considered an error only if all the
data is received but CG does not move the status of this CGImageSource to Complete.
-- If CGImageSourceGetStatus() returns Incomplete, this means CG already created the image
reader and therefore the image type is known.
-- If CGImageSourceGetStatus() returns UnknownType, this means CG could not create the
image reader and this should be considered an error.
(WebCore::ImageDecoder::isSizeAvailable): Deleted.
* platform/graphics/cg/ImageDecoderCG.h: Replace isSizeAvailable() by encodedDataStatus().
* platform/graphics/cg/PDFDocumentImage.cpp:
(WebCore::PDFDocumentImage::dataChanged): The PDFDocument is created only when allDataReceived.
* platform/graphics/cg/PDFDocumentImage.h: Change the return type from bool to EncodedDataStatus.
* platform/image-decoders/ImageDecoder.h:
(WebCore::ImageDecoder::encodedDataStatus): Add a new function encodedDataStatus(). Deduce the
status of the encoded data from the flags m_failed, m_isAllDataReceived and m_sizeAvailable in
this order.
(WebCore::ImageDecoder::isSizeAvailable): Make this function uses encodedDataStatus().
* platform/image-decoders/bmp/BMPImageDecoder.cpp:
(WebCore::BMPImageDecoder::encodedDataStatus): Replace isSizeAvailable() by encodedDataStatus().
(WebCore::BMPImageDecoder::isSizeAvailable): Deleted.
* platform/image-decoders/bmp/BMPImageDecoder.h:
* platform/image-decoders/gif/GIFImageDecoder.cpp:
(WebCore::GIFImageDecoder::encodedDataStatus): Ditto.
(WebCore::GIFImageDecoder::isSizeAvailable): Deleted.
* platform/image-decoders/gif/GIFImageDecoder.h:
* platform/image-decoders/ico/ICOImageDecoder.cpp:
(WebCore::ICOImageDecoder::encodedDataStatus): Ditto.
(WebCore::ICOImageDecoder::isSizeAvailable): Deleted.
* platform/image-decoders/ico/ICOImageDecoder.h:
* platform/image-decoders/jpeg/JPEGImageDecoder.cpp:
(WebCore::JPEGImageDecoder::encodedDataStatus): Ditto.
(WebCore::JPEGImageDecoder::isSizeAvailable): Deleted.
* platform/image-decoders/jpeg/JPEGImageDecoder.h:
* platform/image-decoders/png/PNGImageDecoder.cpp:
(WebCore::PNGImageDecoder::encodedDataStatus): Ditto.
(WebCore::PNGImageDecoder::isSizeAvailable): Deleted.
* platform/image-decoders/png/PNGImageDecoder.h:
* platform/image-decoders/webp/WEBPImageDecoder.cpp:
(WebCore::WEBPImageDecoder::encodedDataStatus): Ditto.
(WebCore::WEBPImageDecoder::isSizeAvailable): Deleted.
* platform/image-decoders/webp/WEBPImageDecoder.h:
* svg/graphics/SVGImage.cpp:
(WebCore::SVGImage::dataChanged): m_page is created only when allDataReceived is true.
* svg/graphics/SVGImage.h:
2017-04-10 Myles C. Maxfield <mmaxfield@apple.com>
Mark SVG-Within-OpenType as "Under Consideration"
https://bugs.webkit.org/show_bug.cgi?id=170706
Reviewed by Brady Eidson.
* features.json:
2017-04-10 Jeremy Jones <jeremyj@apple.com>
Add CoreAudioCaptureSource.
https://bugs.webkit.org/show_bug.cgi?id=170112
rdar://problem/30293338
Reviewed by Eric Carlson.
No new tests because this provides the same funcitonality as AVAudioCaptureSource.
Funcionality is covered by existing test cases.
Add CoreAudioCaptureSource for audio capture. And use it by default in AVCaptureDeviceManager.
Add UseAVFoundationAudioCapture setting to switch back to AVFoundation for audio capture.
* WebCore.xcodeproj/project.pbxproj:
* page/Settings.cpp:
(WebCore::Settings::useAVFoundationAudioCapture):
(WebCore::Settings::setUseAVFoundationAudioCapture):
* page/Settings.h:
* platform/mediastream/mac/AVCaptureDeviceManager.h:
* platform/mediastream/mac/AVCaptureDeviceManager.mm:
(WebCore::AVCaptureDeviceManager::setUseAVFoundationAudioCapture):
* platform/mediastream/mac/CoreAudioCaptureSource.cpp: Added.
(WebCore::CoreAudioCaptureSource::create):
(WebCore::CoreAudioCaptureSource::factory):
(WebCore::CoreAudioCaptureSource::CoreAudioCaptureSource):
(WebCore::CoreAudioCaptureSource::~CoreAudioCaptureSource):
(WebCore::CoreAudioCaptureSource::preferredSampleRate):
(WebCore::CoreAudioCaptureSource::preferredIOBufferDuration):
(WebCore::CoreAudioCaptureSource::configureMicrophoneProc):
(WebCore::CoreAudioCaptureSource::configureSpeakerProc):
(WebCore::CoreAudioCaptureSource::addMicrophoneDataConsumer):
(WebCore::CoreAudioCaptureSource::removeMicrophoneDataConsumer):
(WebCore::CoreAudioCaptureSource::addEchoCancellationSource):
(WebCore::CoreAudioCaptureSource::removeEchoCancellationSource):
(WebCore::CoreAudioCaptureSource::checkTimestamps):
(WebCore::CoreAudioCaptureSource::provideSpeakerData):
(WebCore::CoreAudioCaptureSource::speakerCallback):
(WebCore::CoreAudioCaptureSource::processMicrophoneSamples):
(WebCore::CoreAudioCaptureSource::microphoneCallback):
(WebCore::CoreAudioCaptureSource::defaultOutputDevice):
(WebCore::CoreAudioCaptureSource::defaultInputDevice):
(WebCore::CoreAudioCaptureSource::setupAudioUnits):
(WebCore::CoreAudioCaptureSource::startProducingData):
(WebCore::CoreAudioCaptureSource::stopProducingData):
(WebCore::CoreAudioCaptureSource::suspend):
(WebCore::CoreAudioCaptureSource::resume):
(WebCore::CoreAudioCaptureSource::capabilities):
(WebCore::CoreAudioCaptureSource::settings):
* platform/mediastream/mac/CoreAudioCaptureSource.h: Added.
* platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp:
(WebCore::RealtimeMediaSourceCenterMac::RealtimeMediaSourceCenterMac):
(WebCore::RealtimeMediaSourceCenterMac::defaultAudioFactory):
2017-04-10 Youenn Fablet <youenn@apple.com>
Wrap legacy MediaStream API in runtime flag
https://bugs.webkit.org/show_bug.cgi?id=169877
Reviewed by Alex Christensen.
Covered by binding tests.
Marking navigator.getUserMedia and MediaStreamEvent as runtime enabled if mediastream and webrtclegacy api flags
are on.
Updated binding generator to support multiple runtime flags.
* Modules/mediastream/MediaStreamEvent.idl:
* Modules/mediastream/NavigatorUserMedia.idl:
* bindings/scripts/CodeGeneratorJS.pm:
(GetRuntimeEnableFunctionName):
(GenerateImplementation):
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::JSTestObjPrototype::finishCreation):
* bindings/scripts/test/TestObj.idl:
2017-04-10 Youenn Fablet <youenn@apple.com>
Remove deprecated parts of media stream spec
https://bugs.webkit.org/show_bug.cgi?id=169879
Reviewed by Jon Lee.
Removing MediaStreamTrackState 'new' value which was unused.
Removing MediaStreamTrack _readonly attribute which was unused.
* Modules/mediastream/MediaStreamTrack.cpp:
(WebCore::MediaStreamTrack::readonly): Deleted.
* Modules/mediastream/MediaStreamTrack.h:
* Modules/mediastream/MediaStreamTrack.idl:
* platform/mediastream/MediaStreamTrackPrivate.cpp:
(WebCore::MediaStreamTrackPrivate::readonly): Deleted.
* platform/mediastream/MediaStreamTrackPrivate.h:
* platform/mediastream/RealtimeMediaSource.h:
2017-04-10 Ryan Haddad <ryanhaddad@apple.com>
Unreviewed, rolling out r215175.
This change caused a flaky crash in existing media tests.
Reverted changeset:
"Add fallback fonts to video captions stylesheet."
https://bugs.webkit.org/show_bug.cgi?id=170495
http://trac.webkit.org/changeset/215175
2017-04-10 Wenson Hsieh <wenson_hsieh@apple.com>
Data interaction on an image enclosed by an anchor should vend the anchor's URL
https://bugs.webkit.org/show_bug.cgi?id=170660
<rdar://problem/31043220>
Reviewed by Tim Horton.
When writing an image embedded inside an anchor to the pasteboard, actually use the enclosing anchor's href if
it exists. Previously, we were simply dropping this argument on the floor.
Covered by 2 new DataInteractionTests: ImageInLinkToInput and ImageInLinkWithoutHREFToInput.
* editing/ios/EditorIOS.mm:
(WebCore::Editor::writeImageToPasteboard):
2017-04-10 Jon Lee <jonlee@apple.com>
Update localizable strings to "full screen" from "fullscreen"
https://bugs.webkit.org/show_bug.cgi?id=170675
rdar://problem/28207034
Reviewed by Antoine Quint.
For localizable strings, it should consistently be "full screen" instead of "fullscreen".
* English.lproj/Localizable.strings:
* English.lproj/modern-media-controls-localized-strings.js:
* platform/LocalizedStrings.cpp:
(WebCore::contextMenuItemTagExitVideoFullscreen):
(WebCore::localizedMediaControlElementString):
* platform/cocoa/LocalizedStringsCocoa.mm:
(WebCore::exitFullScreenButtonAccessibilityTitle):
2017-04-10 Andreas Kling <akling@apple.com>
Don't generate extra scrolling tiles for non-visible pages.
https://bugs.webkit.org/show_bug.cgi?id=167213
<rdar://problem/30105774>
Reviewed by Antti Koivisto.
Reduce the tiling coverage to a minimum when the page is non-visible.
On macOS, this means that fully occluded web views can maintain a smaller set of tiles
in non-volatile surfaces, reducing net footprint.
Test: compositing/tiling/non-visible-window-tile-coverage.html
* rendering/RenderLayerBacking.cpp:
(WebCore::computePageTiledBackingCoverage): If the page's activity state is non-visible, use minimal tile coverage.
* platform/ScrollView.h:
* page/FrameView.h:
* page/FrameView.cpp:
(WebCore::FrameView::hide): Call adjustTiledBackingCoverage() in hide() since it now takes page visibility into account.
(WebCore::FrameView::enableSpeculativeTilingIfNeeded):
* testing/Internals.cpp:
(WebCore::Internals::setSpeculativeTilingDelayDisabledForTesting):
* testing/Internals.h:
* testing/Internals.idl: Add an internals API for disabling the 500ms delay before speculative tiling begins after
the main frame load finishes. This is needed for reliably testing this change.
2017-04-10 Per Arne Vollan <pvollan@apple.com>
Add fallback fonts to video captions stylesheet.
https://bugs.webkit.org/show_bug.cgi?id=170495
Reviewed by Myles C. Maxfield.
The kCTFontCascadeListAttribute key is used to obtain the cascade list for a font reference.
I have not added a test, since CaptionUserPreferences::testingMode() returns true when running tests,
preventing this code path from being executed.
* page/CaptionUserPreferencesMediaAF.cpp:
(WebCore::CaptionUserPreferencesMediaAF::captionsDefaultFontCSS):
2017-04-10 Chris Dumez <cdumez@apple.com>
Drop Timer::startOneShot() overload taking a double
https://bugs.webkit.org/show_bug.cgi?id=170659
Reviewed by Yusuke Suzuki.
Drop Timer::startOneShot() overload taking a double as people should use Seconds type now.
* Modules/geolocation/GeoNotifier.cpp:
(WebCore::GeoNotifier::startTimerIfNeeded):
* Modules/mediasession/WebMediaSessionManager.cpp:
(WebCore::WebMediaSessionManager::configureWatchdogTimer):
* Modules/mediasession/WebMediaSessionManager.h:
* Modules/mediastream/CanvasCaptureMediaStreamTrack.cpp:
(WebCore::CanvasCaptureMediaStreamTrack::Source::canvasChanged):
* Modules/vibration/Vibration.cpp:
(WebCore::Vibration::timerFired):
* Modules/websockets/WebSocketChannel.cpp:
(WebCore::WebSocketChannel::close):
* accessibility/AXObjectCache.cpp:
(WebCore::AXObjectCache::enqueuePasswordValueChangeNotification):
(WebCore::AXObjectCache::postLiveRegionChangeNotification):
(WebCore::AXObjectCache::focusAriaModalNode):
* css/CSSFontFace.cpp:
(WebCore::CSSFontFace::setStatus):
* css/StyleResolver.cpp:
(WebCore::StyleResolver::addToMatchedPropertiesCache):
* dom/Document.cpp:
(WebCore::Document::setVisualUpdatesAllowed):
(WebCore::Document::finishedParsing):
* dom/ScriptedAnimationController.cpp:
* editing/AlternativeTextController.cpp:
(WebCore::AlternativeTextController::startAlternativeTextUITimer):
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::addBehaviorRestrictionsOnEndIfNecessary):
(WebCore::HTMLMediaElement::handleSeekToPlaybackPosition):
* html/SearchInputType.cpp:
(WebCore::SearchInputType::startSearchEventTimer):
* html/ValidationMessage.cpp:
(WebCore::ValidationMessage::setMessageDOMAndStartTimer):
* html/canvas/WebGLRenderingContextBase.cpp:
* html/shadow/MediaControlElements.cpp:
(WebCore::MediaControlPanelElement::startTimer):
(WebCore::MediaControlPanelElement::makeTransparent):
* html/track/VTTRegion.cpp:
(WebCore::VTTRegion::startTimer):
* inspector/InspectorInstrumentation.cpp:
(WebCore::InspectorInstrumentation::frameScheduledNavigationImpl):
* inspector/InspectorInstrumentation.h:
(WebCore::InspectorInstrumentation::frameScheduledNavigation):
* inspector/InspectorPageAgent.cpp:
(WebCore::InspectorPageAgent::frameScheduledNavigation):
* inspector/InspectorPageAgent.h:
* loader/NavigationScheduler.cpp:
(WebCore::NavigationScheduler::startTimer):
* loader/cache/CachedResourceLoader.cpp:
(WebCore::CachedResourceLoader::documentDidFinishLoadEvent):
* loader/icon/IconDatabase.cpp:
* page/EventHandler.cpp:
* page/EventSource.cpp:
(WebCore::EventSource::scheduleReconnect):
* page/FocusController.cpp:
(WebCore::FocusController::setFocusedElementNeedsRepaint):
* page/FrameView.cpp:
(WebCore::FrameView::scrollPositionChanged):
(WebCore::FrameView::enableSpeculativeTilingIfNeeded):
* page/Settings.cpp:
(WebCore::Settings::Settings):
* page/Settings.h:
(WebCore::Settings::setTimeWithoutMouseMovementBeforeHidingControls):
(WebCore::Settings::timeWithoutMouseMovementBeforeHidingControls):
* page/SuspendableTimer.h:
* page/animation/CSSAnimationController.cpp:
* page/mac/EventHandlerMac.mm:
* page/mac/TextIndicatorWindow.mm:
(WebCore::TextIndicatorWindow::setTextIndicator):
* platform/HysteresisActivity.h:
(WebCore::HysteresisActivity::stop):
* platform/ScrollAnimationSmooth.cpp:
(WebCore::getAnimationParametersForGranularity):
(WebCore::ScrollAnimationSmooth::updatePerAxisData):
(WebCore::ScrollAnimationSmooth::animateScroll):
(WebCore::ScrollAnimationSmooth::animationTimerFired):
(WebCore::ScrollAnimationSmooth::startNextTimer):
* platform/ScrollAnimationSmooth.h:
* platform/Timer.h:
(WebCore::TimerBase::startRepeating):
* platform/audio/PlatformMediaSession.cpp:
(WebCore::PlatformMediaSession::scheduleClientDataBufferingCheck):
* platform/cocoa/ScrollController.mm:
(WebCore::ScrollController::scheduleStatelessScrollSnap):
* platform/gamepad/cocoa/GameControllerGamepadProvider.mm:
(WebCore::GameControllerGamepadProvider::gamepadHadInput):
* platform/gamepad/mac/HIDGamepadProvider.cpp:
(WebCore::HIDGamepadProvider::openAndScheduleManager):
(WebCore::HIDGamepadProvider::valuesChanged):
* platform/glib/MainThreadSharedTimerGLib.cpp:
(WebCore::MainThreadSharedTimer::setFireInterval):
* platform/graphics/BitmapImage.cpp:
(WebCore::BitmapImage::startTimer):
(WebCore::BitmapImage::internalStartAnimation):
(WebCore::BitmapImage::advanceAnimation):
(WebCore::BitmapImage::resetAnimation):
* platform/graphics/BitmapImage.h:
* platform/graphics/MediaPlaybackTargetPicker.cpp:
* platform/graphics/ShadowBlur.cpp:
(WebCore::ScratchBuffer::scheduleScratchBufferPurge):
* platform/graphics/ca/LayerPool.cpp:
(WebCore::LayerPool::schedulePrune):
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::changePipelineState):
* platform/graphics/mac/GraphicsContext3DMac.mm:
(WebCore::GraphicsContext3DManager::updateHighPerformanceState):
* platform/graphics/texmap/BitmapTexturePool.cpp:
(WebCore::BitmapTexturePool::scheduleReleaseUnusedTextures):
(WebCore::BitmapTexturePool::releaseUnusedTexturesTimerFired):
* platform/graphics/texmap/TextureMapperPlatformLayerProxy.cpp:
(WebCore::TextureMapperPlatformLayerProxy::scheduleReleaseUnusedBuffers):
(WebCore::TextureMapperPlatformLayerProxy::releaseUnusedBuffersTimerFired):
* platform/graphics/texmap/coordinated/CoordinatedImageBacking.cpp:
* platform/gtk/ScrollAnimatorGtk.cpp:
(WebCore::ScrollAnimatorGtk::overlayScrollbarAnimationTimerFired):
(WebCore::ScrollAnimatorGtk::showOverlayScrollbars):
(WebCore::ScrollAnimatorGtk::hideOverlayScrollbars):
* platform/gtk/ScrollAnimatorGtk.h:
* platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
(WebVideoFullscreenInterfaceAVKit::shouldExitFullscreenWithReason):
* platform/mac/ScrollAnimatorMac.mm:
(WebCore::ScrollAnimatorMac::startScrollbarPaintTimer):
* platform/mock/MediaPlaybackTargetPickerMock.cpp:
* platform/mock/PlatformSpeechSynthesizerMock.cpp:
(WebCore::PlatformSpeechSynthesizerMock::speak):
* platform/mock/TimerEventBasedMock.h:
(WebCore::TimerEvent::TimerEvent):
* platform/network/DNSResolveQueue.cpp:
(WebCore::DNSResolveQueue::add):
(WebCore::DNSResolveQueue::timerFired):
* platform/network/PingHandle.h:
* platform/network/curl/ResourceHandleManager.cpp:
(WebCore::ResourceHandleManager::downloadTimerCallback):
(WebCore::ResourceHandleManager::add):
(WebCore::ResourceHandleManager::cancel):
* platform/network/mac/NetworkStateNotifierMac.cpp:
* platform/network/soup/ResourceHandleSoup.cpp:
(WebCore::ResourceHandle::sendPendingRequest):
* rendering/ImageQualityController.cpp:
(WebCore::ImageQualityController::restartTimer):
* rendering/RenderLayerCompositor.cpp:
* rendering/RenderProgress.cpp:
(WebCore::RenderProgress::RenderProgress):
* rendering/RenderProgress.h:
* rendering/RenderText.cpp:
(WebCore::SecureTextTimer::restart):
* rendering/RenderTheme.cpp:
(WebCore::RenderTheme::animationRepeatIntervalForProgressBar):
* rendering/RenderTheme.h:
(WebCore::RenderTheme::mediaControlsFadeOutDuration):
* rendering/RenderThemeGtk.cpp:
(WebCore::RenderThemeGtk::animationRepeatIntervalForProgressBar):
* rendering/RenderThemeGtk.h:
* rendering/RenderThemeIOS.h:
* rendering/RenderThemeIOS.mm:
(WebCore::RenderThemeIOS::animationRepeatIntervalForProgressBar):
* rendering/RenderThemeMac.h:
* rendering/RenderThemeMac.mm:
(WebCore::RenderThemeMac::animationRepeatIntervalForProgressBar):
(WebCore::RenderThemeMac::animationDurationForProgressBar):
* replay/EventLoopInputDispatcher.cpp:
(WebCore::EventLoopInputDispatcher::dispatchInputSoon):
* svg/animation/SMILTimeContainer.cpp:
(WebCore::SMILTimeContainer::startTimer):
* testing/InternalSettings.cpp:
(WebCore::InternalSettings::setTimeWithoutMouseMovementBeforeHidingControls):
* testing/InternalSettings.h:
* testing/Internals.cpp:
(WebCore::Internals::setImageFrameDecodingDuration):
* xml/XMLHttpRequest.cpp:
(WebCore::XMLHttpRequest::createRequest):
2017-04-10 Miguel Gomez <magomez@igalia.com>
REGRESSION(r205841): [GTK] Test fast/images/animated-png.html is failing since r205841
https://bugs.webkit.org/show_bug.cgi?id=168425
Reviewed by Said Abou-Hallawa.
There is a problem with animations that are blending their frames into the previous frame. Due to a change
in how pixel components are premultiplied (the result is now rounded up), the parameters to the blending
operation may vary in one unit, causing the result of the blending to be different from the expected result.
In order to fix this, a new parameter is added to indicate whether we want to use rounding up when
premultiplying or not, and ImageBackingStore uses that parameter to disable rounding up.
Adjusted the expectation for fast/images/animated-png.html, as it must pass now.
* platform/graphics/Color.cpp:
(WebCore::premultipliedChannel):
(WebCore::makePremultipliedRGBA):
* platform/graphics/Color.h:
* platform/graphics/ImageBackingStore.h:
(WebCore::ImageBackingStore::blendPixel):
(WebCore::ImageBackingStore::pixelValue):
2017-04-09 Wenson Hsieh <wenson_hsieh@apple.com>
[WK2] Add infrastructure to perform actions after an asynchronous position information request finishes
https://bugs.webkit.org/show_bug.cgi?id=170658
<rdar://problem/31431450>
Reviewed by Tim Horton.
Minor adjustments to fix the build in the newest version of the SDK.
* platform/ios/WebItemProviderPasteboard.mm:
(-[WebItemProviderPasteboard setItemsFromObjectRepresentations:]):
(-[WebItemProviderPasteboard _tryToCreateAndAppendObjectOfClass:toArray:usingProvider:]):
2017-04-09 Yusuke Suzuki <utatane.tea@gmail.com>
[WTF] Annotate Seconds' member functions and operators with constexpr
https://bugs.webkit.org/show_bug.cgi?id=170662
Reviewed by Daniel Bates.
* page/Frame.cpp:
2017-04-09 Chris Dumez <cdumez@apple.com>
Drop Timer::startRepeating() overload taking a double
https://bugs.webkit.org/show_bug.cgi?id=170656
Reviewed by Yusuke Suzuki.
Drop Timer::startRepeating() overload taking a double as people should use Seconds type now.
* Modules/mediastream/CanvasCaptureMediaStreamTrack.cpp:
(WebCore::CanvasCaptureMediaStreamTrack::Source::startProducingData):
* editing/FrameSelection.cpp:
(WebCore::FrameSelection::updateAppearance):
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::startProgressEventTimer):
(WebCore::HTMLMediaElement::scheduleTimeupdateEvent):
* html/HTMLMediaElement.h:
* html/MediaController.cpp:
(MediaController::MediaController):
(MediaController::scheduleTimeupdateEvent):
* html/MediaController.h:
* html/MediaElementSession.cpp:
* inspector/InspectorOverlay.cpp:
(WebCore::InspectorOverlay::showPaintRect):
* loader/ProgressTracker.cpp:
* page/AutoscrollController.cpp:
* page/Frame.cpp:
* page/PageOverlay.cpp:
(WebCore::PageOverlay::startFadeAnimation):
* page/SuspendableTimer.h:
* page/WheelEventTestTrigger.cpp:
(WebCore::WheelEventTestTrigger::setTestCallbackAndStartNotificationTimer):
* platform/Theme.h:
(WebCore::Theme::caretBlinkInterval):
* platform/Timer.h:
* platform/cocoa/ScrollController.mm:
(WebCore::ScrollController::startSnapRubberbandTimer):
(WebCore::ScrollController::startScrollSnapTimer):
* platform/graphics/ca/TileGrid.cpp:
(WebCore::TileGrid::scheduleCohortRemoval):
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::setDownloadBuffering):
* platform/mediastream/mac/MockRealtimeAudioSourceMac.mm:
(WebCore::MockRealtimeAudioSourceMac::reconfigure):
* platform/mock/MockRealtimeAudioSource.cpp:
(WebCore::MockRealtimeAudioSource::startProducingData):
* platform/mock/MockRealtimeAudioSource.h:
(WebCore::MockRealtimeAudioSource::renderInterval):
* platform/mock/MockRealtimeVideoSource.cpp:
(WebCore::MockRealtimeVideoSource::startProducingData):
(WebCore::MockRealtimeVideoSource::applyFrameRate):
* rendering/RenderMarquee.cpp:
(WebCore::RenderMarquee::start):
(WebCore::RenderMarquee::updateMarqueeStyle):
* rendering/RenderTheme.h:
(WebCore::RenderTheme::caretBlinkInterval):
* rendering/RenderThemeGtk.cpp:
(WebCore::RenderThemeGtk::caretBlinkInterval):
* rendering/RenderThemeGtk.h:
* xml/XMLHttpRequestProgressEventThrottle.cpp:
(WebCore::XMLHttpRequestProgressEventThrottle::dispatchThrottledProgressEvent):
* xml/XMLHttpRequestProgressEventThrottle.h:
2017-04-09 Fujii Hironori <Hironori.Fujii@sony.com>
generate-bindings-all.pl shouldn't use Perl threads
https://bugs.webkit.org/show_bug.cgi?id=170106
Reviewed by Yusuke Suzuki.
The use of interpreter-based threads in Perl is officially
discouraged and not all Linux distributions and BSD compile Perl
with threads support. Use fork instead of threads to run
generate-bindings.pl in parallel.
* bindings/scripts/generate-bindings-all.pl:
(spawnGenerateBindingsIfNeeded): Added.
(executeCommand): Removed the workaround for Cygwin Perl threads.
(spawnCommand): Added.
(worker): Deleted.
2017-04-09 Said Abou-Hallawa <sabouhallawa@apple.com>
REGRESSION(r214635): Calculate image subsampling only for CG
https://bugs.webkit.org/show_bug.cgi?id=170353
Reviewed by Simon Fraser.
In r214635, we needed to calculate the image scaleFactor for all platforms.
It was needed do the calculation: sizeForDrawing = sizeOfImage * imageScaleFactor.
This made ImageSource::subsamplingLevelForScale() now returns a SubsamplingLevel
not equal to SubsamplingLevel::Default if the image scaleFactor is greater
than {1, 1} for all platforms. The subsamplingLevel should only be used for CG.
This is also a chance to make nativeImageDrawingScale() a across platform
function and move it to the GraphicsContext class.
* platform/graphics/BitmapImage.cpp:
(WebCore::BitmapImage::draw):
* platform/graphics/GraphicsContext.cpp:
(WebCore::GraphicsContext::scaleFactorForDrawing):
* platform/graphics/GraphicsContext.h:
* platform/graphics/ImageSource.cpp:
(WebCore::ImageSource::subsamplingLevelForScaleFactor):
(WebCore::ImageSource::subsamplingLevelForScale): Deleted.
* platform/graphics/ImageSource.h:
* platform/graphics/NativeImage.h:
* platform/graphics/cairo/NativeImageCairo.cpp:
(WebCore::nativeImageDrawingScale): Deleted.
* platform/graphics/cg/NativeImageCG.cpp:
(WebCore::nativeImageDrawingScale): Deleted.
* platform/graphics/win/NativeImageDirect2D.cpp:
(WebCore::nativeImageDrawingScale): Deleted.
2017-04-09 Chris Dumez <cdumez@apple.com>
Start dropping Timer API dealing with double
https://bugs.webkit.org/show_bug.cgi?id=170649
Reviewed by Yusuke Suzuki.
Start dropping Timer API dealing with double as people should use Seconds now.
* Modules/encryptedmedia/legacy/WebKitMediaKeySession.cpp:
(WebCore::WebKitMediaKeySession::generateKeyRequest):
(WebCore::WebKitMediaKeySession::update):
* Modules/geolocation/GeoNotifier.cpp:
(WebCore::GeoNotifier::setFatalError):
(WebCore::GeoNotifier::setUseCachedPosition):
* Modules/geolocation/Geolocation.cpp:
(WebCore::Geolocation::resume):
* Modules/indexeddb/IDBTransaction.cpp:
(WebCore::IDBTransaction::schedulePendingOperationTimer):
(WebCore::IDBTransaction::scheduleCompletedOperationTimer):
* Modules/indexeddb/server/UniqueIDBDatabase.cpp:
(WebCore::IDBServer::UniqueIDBDatabase::invokeOperationAndTransactionTimer):
* Modules/mediasource/SourceBuffer.cpp:
(WebCore::SourceBuffer::rangeRemoval):
(WebCore::SourceBuffer::appendBufferInternal):
* Modules/mediastream/MediaStream.cpp:
(WebCore::MediaStream::scheduleActiveStateChange):
* Modules/mediastream/RTCDTMFSender.cpp:
(WebCore::RTCDTMFSender::scheduleDispatchEvent):
* Modules/mediastream/RTCDataChannel.cpp:
(WebCore::RTCDataChannel::scheduleDispatchEvent):
* Modules/notifications/Notification.cpp:
* Modules/notifications/NotificationCenter.cpp:
(WebCore::NotificationCenter::requestPermission):
* Modules/vibration/Vibration.cpp:
(WebCore::Vibration::vibrate):
* Modules/websockets/WebSocket.cpp:
(WebCore::WebSocket::resume):
* Modules/websockets/WebSocketChannel.cpp:
(WebCore::WebSocketChannel::resume):
* accessibility/AXObjectCache.cpp:
(WebCore::AXObjectCache::postNotification):
* bindings/js/GCController.cpp:
(WebCore::GCController::garbageCollectOnNextRunLoop):
* css/CSSFontSelector.cpp:
(WebCore::CSSFontSelector::beginLoadingFontSoon):
* dom/Document.cpp:
(WebCore::Document::scheduleStyleRecalc):
(WebCore::Document::updateFocusAppearanceSoon):
(WebCore::Document::resumeScheduledTasks):
(WebCore::Document::requestFullScreenForElement):
(WebCore::Document::webkitDidEnterFullScreenForElement):
(WebCore::Document::webkitDidExitFullScreenForElement):
(WebCore::Document::decrementLoadEventDelayCount):
(WebCore::Document::didAssociateFormControl):
(WebCore::Document::setCachedDOMCookies):
* dom/DocumentEventQueue.cpp:
(WebCore::DocumentEventQueue::enqueueEvent):
* dom/EventSender.h:
(WebCore::EventSender<T>::dispatchEventSoon):
* dom/Microtasks.cpp:
(WebCore::MicrotaskQueue::append):
* dom/ScriptRunner.cpp:
(WebCore::ScriptRunner::resume):
(WebCore::ScriptRunner::notifyFinished):
* dom/ScriptableDocumentParser.cpp:
(WebCore::ScriptableDocumentParser::executeScriptsWaitingForStylesheetsSoon):
* editing/Editor.cpp:
(WebCore::Editor::respondToChangedSelection):
* editing/SpellChecker.cpp:
(WebCore::SpellChecker::didCheck):
* html/HTMLFormElement.cpp:
(WebCore::HTMLFormElement::finishRequestAutocomplete):
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::scheduleDelayedAction):
(WebCore::HTMLMediaElement::beginScanning):
* html/HTMLPlugInElement.cpp:
(WebCore::HTMLPlugInElement::setDisplayState):
* html/HTMLSourceElement.cpp:
(WebCore::HTMLSourceElement::scheduleErrorEvent):
(WebCore::HTMLSourceElement::resume):
* html/HTMLTrackElement.cpp:
(WebCore::HTMLTrackElement::scheduleLoad):
* html/MediaController.cpp:
(MediaController::currentTime):
(MediaController::scheduleEvent):
* html/MediaDocument.cpp:
(WebCore::MediaDocument::mediaElementSawUnsupportedTracks):
* html/MediaElementSession.cpp:
(WebCore::MediaElementSession::externalOutputDeviceAvailableDidChange):
* html/ValidationMessage.cpp:
(WebCore::ValidationMessage::setMessage):
(WebCore::ValidationMessage::requestToHideMessage):
* html/canvas/WebGLRenderingContextBase.cpp:
(WebCore::WebGLRenderingContextBase::loseContextImpl):
(WebCore::WebGLRenderingContextBase::forceRestoreContext):
(WebCore::WebGLRenderingContextBase::dispatchContextLostEvent):
* html/parser/HTMLParserScheduler.cpp:
(WebCore::HTMLParserScheduler::continueNextChunkTimerFired):
(WebCore::HTMLParserScheduler::scheduleForResume):
(WebCore::HTMLParserScheduler::resume):
* html/shadow/MediaControlElements.cpp:
(WebCore::MediaControlTextTrackContainerElement::updateSizes):
* html/track/LoadableTextTrack.cpp:
(WebCore::LoadableTextTrack::scheduleLoad):
* inspector/InspectorCSSAgent.cpp:
(WebCore::ChangeRegionOversetTask::scheduleFor):
* inspector/InspectorDOMAgent.cpp:
(WebCore::RevalidateStyleAttributeTask::scheduleFor):
* inspector/InspectorFrontendClientLocal.cpp:
(WebCore::InspectorBackendDispatchTask::dispatch):
(WebCore::InspectorBackendDispatchTask::timerFired):
* inspector/WebHeapAgent.cpp:
(WebCore::SendGarbageCollectionEventsTask::addGarbageCollection):
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::startDataLoadTimer):
(WebCore::DocumentLoader::deliverSubstituteResourcesAfterDelay):
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::startCheckCompleteTimer):
* loader/ImageLoader.cpp:
(WebCore::ImageLoader::updatedHasPendingEvent):
* loader/TextTrackLoader.cpp:
(WebCore::TextTrackLoader::notifyFinished):
(WebCore::TextTrackLoader::newCuesParsed):
(WebCore::TextTrackLoader::fileFailedToParse):
* loader/appcache/ApplicationCacheGroup.cpp:
(WebCore::ApplicationCacheGroup::scheduleReachedMaxAppCacheSizeCallback):
* loader/cache/CachedResource.cpp:
(WebCore::CachedResource::Callback::Callback):
* loader/cache/CachedResourceLoader.cpp:
(WebCore::CachedResourceLoader::loadDone):
* loader/cache/MemoryCache.cpp:
(WebCore::MemoryCache::pruneSoon):
* page/CaptionUserPreferences.cpp:
(WebCore::CaptionUserPreferences::notify):
* page/CaptionUserPreferencesMediaAF.cpp:
(WebCore::CaptionUserPreferencesMediaAF::setInterestedInCaptionPreferenceChanges):
* page/DOMWindow.cpp:
(WebCore::DOMWindow::postMessage):
* page/DeviceController.cpp:
(WebCore::DeviceController::addDeviceEventListener):
* page/EventHandler.cpp:
(WebCore::EventHandler::scheduleHoverStateUpdate):
* page/EventSource.cpp:
(WebCore::EventSource::scheduleInitialConnect):
* page/FrameView.cpp:
(WebCore::FrameView::layout):
(WebCore::FrameView::performPostLayoutTasks):
* page/Settings.cpp:
(WebCore::Settings::setLoadsImagesAutomatically):
(WebCore::Settings::setImagesEnabled):
* page/SuspendableTimer.h:
* page/animation/CSSAnimationController.cpp:
(WebCore::CSSAnimationControllerPrivate::startUpdateStyleIfNeededDispatcher):
* page/mac/ServicesOverlayController.mm:
(WebCore::ServicesOverlayController::invalidateHighlightsOfType):
* page/scrolling/AsyncScrollingCoordinator.cpp:
(WebCore::AsyncScrollingCoordinator::scheduleUpdateScrollPositionAfterAsyncScroll):
* page/scrolling/ios/ScrollingCoordinatorIOS.mm:
(WebCore::ScrollingCoordinatorIOS::scheduleTreeStateCommit):
* page/scrolling/mac/ScrollingCoordinatorMac.mm:
(WebCore::ScrollingCoordinatorMac::scheduleTreeStateCommit):
* platform/GenericTaskQueue.cpp:
(WebCore::TaskDispatcher<Timer>::postTask):
* platform/Scrollbar.cpp:
(WebCore::Scrollbar::autoscrollPressedPart):
(WebCore::Scrollbar::startTimerIfNeeded):
* platform/Scrollbar.h:
* platform/ScrollbarTheme.h:
(WebCore::ScrollbarTheme::initialAutoscrollTimerDelay):
(WebCore::ScrollbarTheme::autoscrollTimerDelay):
* platform/Timer.cpp:
* platform/Timer.h:
(WebCore::TimerBase::startRepeating):
(WebCore::TimerBase::startOneShot):
(WebCore::TimerBase::augmentFireInterval):
(WebCore::TimerBase::augmentRepeatInterval):
* platform/gamepad/mac/HIDGamepadProvider.cpp:
(WebCore::HIDGamepadProvider::deviceAdded):
* platform/graphics/MediaPlayer.cpp:
(WebCore::MediaPlayer::networkStateChanged):
* platform/graphics/avfoundation/MediaSelectionGroupAVFObjC.mm:
(WebCore::MediaSelectionGroupAVFObjC::updateOptions):
(WebCore::MediaSelectionGroupAVFObjC::setSelectedOption):
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::seekWithTolerance):
* platform/graphics/ca/TileCoverageMap.cpp:
(WebCore::TileCoverageMap::setNeedsUpdate):
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
(WebCore::MediaPlayerPrivateGStreamerBase::triggerRepaint):
* platform/graphics/gstreamer/VideoSinkGStreamer.cpp:
(VideoRenderRequestScheduler::requestRender):
* platform/graphics/texmap/TextureMapperPlatformLayerProxy.cpp:
(WebCore::TextureMapperPlatformLayerProxy::scheduleUpdateOnCompositorThread):
* platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
(WebCore::CoordinatedGraphicsLayer::addAnimation):
* platform/gtk/ScrollAnimatorGtk.cpp:
(WebCore::ScrollAnimatorGtk::showOverlayScrollbars):
* platform/gtk/ScrollbarThemeGtk.h:
* platform/ios/LegacyTileCache.mm:
(WebCore::LegacyTileCache::finishedCreatingTiles):
(WebCore::LegacyTileCache::setSpeculativeTileCreationEnabled):
* platform/ios/ScrollbarThemeIOS.h:
* platform/ios/ScrollbarThemeIOS.mm:
(WebCore::ScrollbarThemeIOS::initialAutoscrollTimerDelay):
(WebCore::ScrollbarThemeIOS::autoscrollTimerDelay):
* platform/mac/ScrollAnimatorMac.mm:
(WebCore::ScrollAnimatorMac::sendContentAreaScrolledSoon):
* platform/mac/ScrollbarThemeMac.h:
* platform/mac/ScrollbarThemeMac.mm:
(WebCore::ScrollbarThemeMac::preferencesChanged):
(WebCore::ScrollbarThemeMac::initialAutoscrollTimerDelay):
(WebCore::ScrollbarThemeMac::autoscrollTimerDelay):
* platform/mock/DeviceOrientationClientMock.cpp:
(WebCore::DeviceOrientationClientMock::setOrientation):
* platform/mock/GeolocationClientMock.cpp:
(WebCore::GeolocationClientMock::asyncUpdatePermission):
(WebCore::GeolocationClientMock::asyncUpdateController):
* platform/mock/MockMediaEndpoint.cpp:
(WebCore::MockMediaEndpoint::dispatchFakeIceCandidates):
(WebCore::MockMediaEndpoint::iceCandidateTimerFired):
(WebCore::MockMediaEndpoint::stepIceTransportStates):
(WebCore::MockMediaEndpoint::iceTransportTimerFired):
(WebCore::MockMediaEndpoint::unmuteRemoteSourcesByMid):
(WebCore::MockMediaEndpoint::unmuteTimerFired):
* platform/network/DataURLDecoder.cpp:
(WebCore::DataURLDecoder::DecodingResultDispatcher::startTimer):
* platform/network/ResourceHandle.cpp:
(WebCore::ResourceHandle::scheduleFailure):
(WebCore::ResourceHandle::setDefersLoading):
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::scheduleCompositingLayerUpdate):
* rendering/RenderNamedFlowThread.cpp:
(WebCore::RenderNamedFlowThread::dispatchRegionOversetChangeEventIfNeeded):
* rendering/RenderScrollbarTheme.h:
* rendering/RenderView.cpp:
(WebCore::RenderView::scheduleLazyRepaint):
* style/StyleScope.cpp:
(WebCore::Style::Scope::scheduleUpdate):
* svg/SVGElement.cpp:
(WebCore::SVGElement::sendSVGLoadEventIfPossibleAsynchronously):
* xml/XMLHttpRequest.cpp:
(WebCore::XMLHttpRequest::prepareToSend):
(WebCore::XMLHttpRequest::didFail):
(WebCore::XMLHttpRequest::resume):
* xml/XMLHttpRequestProgressEventThrottle.cpp:
(WebCore::XMLHttpRequestProgressEventThrottle::resume):
2017-04-08 Myles C. Maxfield <mmaxfield@apple.com>
[Variation Fonts] Width values of GX fonts are not mapped correctly
https://bugs.webkit.org/show_bug.cgi?id=170367
Reviewed by Simon Fraser.
For some reason, when I performed my calculations for how to map the 'wdth' axis of GX-style
variation fonts, I thought that font-stretch: 100% should map to a variation value of 0.0.
Instead, this should map to 1.0.
Test: fast/text/variations/gx-width.html
* platform/graphics/cocoa/FontCacheCoreText.cpp:
(WebCore::denormalizeSlope):
(WebCore::denormalizeVariationWidth):
(WebCore::normalizeVariationWidth):
(WebCore::normalizeWidth):
(WebCore::preparePlatformFont):
(WebCore::variationCapabilitiesForFontDescriptor):
(WebCore::denormalizeWidth): Deleted.
2017-04-08 Eric Carlson <eric.carlson@apple.com>
[MediaStream Mac] Revert change of Mac video capture format
https://bugs.webkit.org/show_bug.cgi?id=170642
<rdar://problem/31520492>
Reviewed by Sam Weinig.
Revert r214968 which changed macOS video capture format to kCVPixelFormatType_420YpCbCr8BiPlanarFullRange
from kCVPixelFormatType_420YpCbCr8Planar because AVSampleBufferDisplayLayer sometimes fails
to display the former.
* platform/mediastream/mac/AVVideoCaptureSource.mm:
2017-04-08 Said Abou-Hallawa <sabouhallawa@apple.com>
A synchronous DecodingOptions should be compatible with any asynchronous sizeForDrawing DecodingOptions
https://bugs.webkit.org/show_bug.cgi?id=170577
Reviewed by Simon Fraser.
Once a synchronous decoded frame is found, there is no need to decode it
again. This decoded frame is suitable for any sizeForDrawing. This will
prevent double decoding if one image client wants synchronous decoded
frame while the other needs an asynchronous decode frame for a specific
sizeForDrawing.
Test: fast/images/async-image-background-image-repeated.html
* platform/graphics/DecodingOptions.h:
(WebCore::DecodingOptions::DecodingOptions):
(WebCore::DecodingOptions::isNone):
(WebCore::DecodingOptions::isAsynchronousCompatibleWith):
2017-04-08 Simon Fraser <simon.fraser@apple.com>
Align the timers for throttled rAF to reduce power usage
https://bugs.webkit.org/show_bug.cgi?id=170630
rdar://problem/31490620
Reviewed by Chris Dumez.
Align the timers for all throttled ScriptedAnimationControllers in the process with
a resolution of 30ms, which reduces process wake-ups and thus saves power.
* dom/ScriptedAnimationController.cpp:
(WebCore::ScriptedAnimationController::scheduleAnimation):
2017-04-08 Chris Dumez <cdumez@apple.com>
Drop std::chrono support from Timer class
https://bugs.webkit.org/show_bug.cgi?id=170645
Reviewed by Sam Weinig.
Drop std::chrono support from Timer class now that we prefer using Seconds type.
* css/CSSImageGeneratorValue.cpp:
* html/HTMLPlugInImageElement.cpp:
* html/canvas/WebGLRenderingContextBase.cpp:
* loader/cache/CachedResource.cpp:
(WebCore::deadDecodedDataDeletionIntervalForResourceType):
(WebCore::CachedResource::destroyDecodedDataIfNeeded):
* loader/cache/MemoryCache.cpp:
(WebCore::MemoryCache::MemoryCache):
* loader/cache/MemoryCache.h:
(WebCore::MemoryCache::setDeadDecodedDataDeletionInterval):
(WebCore::MemoryCache::deadDecodedDataDeletionInterval):
* page/PerformanceMonitor.cpp:
* page/SuspendableTimer.h:
* page/mac/ServicesOverlayController.h:
* page/mac/ServicesOverlayController.mm:
(WebCore::ServicesOverlayController::selectionRectsDidChange):
(WebCore::ServicesOverlayController::remainingTimeUntilHighlightShouldBeShown):
(WebCore::ServicesOverlayController::determineActiveHighlight):
(WebCore::ServicesOverlayController::mouseEvent):
* platform/Timer.h:
(WebCore::TimerBase::startRepeating):
(WebCore::TimerBase::startOneShot):
(WebCore::TimerBase::augmentFireInterval):
(WebCore::TimerBase::augmentRepeatInterval):
(WebCore::DeferrableOneShotTimer::DeferrableOneShotTimer):
* platform/graphics/FontCache.cpp:
(WebCore::FontCache::fontForFamily):
* platform/graphics/ca/TileController.cpp:
* platform/graphics/cg/IOSurfacePool.cpp:
* platform/graphics/cg/SubimageCacheWithTimer.cpp:
* xml/XMLHttpRequest.cpp:
(WebCore::XMLHttpRequest::setTimeout):
(WebCore::XMLHttpRequest::createRequest):
* xml/XMLHttpRequest.h:
2017-04-08 Simon Fraser <simon.fraser@apple.com>
Update CSSProperties.json with correct fill-and-stroke status, and other cleanup
https://bugs.webkit.org/show_bug.cgi?id=170643
Reviewed by Chris Dumez.
Structural changes:
- move implementation-related "comment" blocks into "codegen-properties"
- move status-related "comment" blocks into "status"
Add the concept of "obsolete-category" and "obsolete-url" for properties
like the text-fill-and-stroke properties that used to be specified in SVG but
now have their own module shared with CSS.
Update the status of paint-order, stroke-linecap, stroke-linejoin, stroke-miterlimit
and stroke-width to "supported", overriding the default for css-text-fill-and-stroke which
is "under consideration".
Add display values "flow" and "flow-root" but mark them as unimplemented.
Fix makeprop.pl to ignore comments inside codegen-properties.
* css/CSSProperties.json:
* css/makeprop.pl:
(addProperty):
2017-04-08 Eric Carlson <eric.carlson@apple.com>
[MediaStream iOS] Update muted state when interrupted
https://bugs.webkit.org/show_bug.cgi?id=170605
<rdar://problem/31503896>
Reviewed by Youenn Fablet.
* platform/mediastream/RealtimeMediaSource.cpp:
(WebCore::RealtimeMediaSource::setMuted): Don't check both m_stopped and stopped(). Split code
to notify observers out into notifyMutedObservers.
(WebCore::RealtimeMediaSource::notifyMutedObservers): Split from setMuted.
* platform/mediastream/RealtimeMediaSource.h:
* platform/mediastream/mac/AVMediaCaptureSource.h:
* platform/mediastream/mac/AVMediaCaptureSource.mm:
(WebCore::AVMediaCaptureSource::captureSessionIsRunningDidChange): Set m_muted directly and
call notifyMutedObservers because the session has already stopped running.
(WebCore::AVMediaCaptureSource::isProducingData): Move from .h file to make debugging easier.
2017-04-08 Simon Fraser <simon.fraser@apple.com>
Unprefix CSS cursor values grab and grabbing
https://bugs.webkit.org/show_bug.cgi?id=170543
Reviewed by Jon Lee.
Add support for unprefixed "grab" and "grabbing" values for cursor (retaining
support for the prefixed values) which are now in <https://drafts.csswg.org/css-ui-3/#cursor>
Canonicalize the order of the values based on the order in the spec in the enums
and switch statements.
Tested by fast/css/cursor-parsing.html
* css/CSSPrimitiveValueMappings.h:
(WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
(WebCore::CSSPrimitiveValue::operator ECursor):
* css/CSSProperties.json:
* css/CSSValueKeywords.in:
* page/EventHandler.cpp:
(WebCore::EventHandler::selectCursor):
* rendering/style/RenderStyleConstants.h:
2017-04-08 Youenn Fablet <youenn@apple.com>
WebRTC tests gardening
https://bugs.webkit.org/show_bug.cgi?id=170508
Reviewed by Eric Carlson.
* Configurations/FeatureDefines.xcconfig: Changing webrtc enabling for ios.
2017-04-08 Youenn Fablet <youenn@apple.com>
MediaStreamTrack id should be preserved by PeerConnection
https://bugs.webkit.org/show_bug.cgi?id=170624
Reviewed by Eric Carlson.
Covered by updated test.
* Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
(WebCore::createReceiverForSource): Setting track id according source id.
2017-04-08 Chris Dumez <cdumez@apple.com>
Timer's nextFireInterval() / repeatInterval() should return Seconds
https://bugs.webkit.org/show_bug.cgi?id=170639
Reviewed by Simon Fraser.
Timer's nextFireInterval() / repeatInterval() should return Seconds, not double.
* loader/NavigationScheduler.cpp:
* page/DOMTimer.cpp:
(WebCore::DOMTimer::updateTimerIntervalIfNecessary):
* page/SuspendableTimer.cpp:
(WebCore::SuspendableTimer::suspend):
(WebCore::SuspendableTimer::repeatInterval):
* page/SuspendableTimer.h:
* page/animation/AnimationBase.cpp:
(WebCore::AnimationBase::timeToNextService):
(WebCore::AnimationBase::getTimeToNextEvent):
(WebCore::AnimationBase::goIntoEndingOrLoopingState):
* page/animation/AnimationBase.h:
* page/animation/CSSAnimationController.cpp:
(WebCore::CSSAnimationControllerPrivate::updateAnimations):
(WebCore::CSSAnimationControllerPrivate::updateAnimationTimerForRenderer):
(WebCore::CSSAnimationControllerPrivate::updateAnimationTimer):
(WebCore::CSSAnimationControllerPrivate::animationFrameCallbackFired):
* page/animation/CSSAnimationControllerPrivate.h:
* page/animation/CompositeAnimation.cpp:
(WebCore::CompositeAnimation::timeToNextService):
* page/animation/CompositeAnimation.h:
* page/animation/ImplicitAnimation.cpp:
(WebCore::ImplicitAnimation::timeToNextService):
* page/animation/ImplicitAnimation.h:
* page/animation/KeyframeAnimation.cpp:
(WebCore::KeyframeAnimation::timeToNextService):
* page/animation/KeyframeAnimation.h:
* platform/ThreadTimers.cpp:
(WebCore::ThreadTimers::sharedTimerFiredInternal):
* platform/Timer.cpp:
(WebCore::TimerBase::nextFireInterval):
* platform/Timer.h:
(WebCore::TimerBase::repeatInterval):
* platform/graphics/ca/TileController.cpp:
(WebCore::TileController::setIsInWindow):
(WebCore::TileController::scheduleTileRevalidation):
* platform/graphics/ca/TileController.h:
* platform/graphics/ca/TileGrid.cpp:
(WebCore::TileGrid::revalidateTiles):
2017-04-08 Csaba Osztrogonác <ossy@webkit.org>
Unreviewed Mac cmake buildfix after r215051, just for fun.
https://bugs.webkit.org/show_bug.cgi?id=169761
* PlatformMac.cmake:
2017-04-07 Simon Fraser <simon.fraser@apple.com>
Build fix: TimerBase::start(double, double) can't be inline and exported,
so make it non-inline.
* platform/Timer.cpp:
(WebCore::TimerBase::start):
* platform/Timer.h:
(WebCore::TimerBase::start): Deleted.
2017-04-07 Chris Dumez <cdumez@apple.com>
REGRESSION (r203941): iAd Producer widgets fail to play in iBooks
https://bugs.webkit.org/show_bug.cgi?id=170635
<rdar://problem/30797958>
Reviewed by Daniel Bates.
Extend the MouseEvent::initMouseEvent() workaround we added for iAd Producer
to iBooks since the iBooks widgets generated by iAd Producer contain the same
bug.
* dom/MouseEvent.cpp:
(WebCore::MouseEvent::initMouseEventQuirk):
2017-04-07 Chris Dumez <cdumez@apple.com>
Start using MonotonicTime / Seconds in Timer class
https://bugs.webkit.org/show_bug.cgi?id=170625
Reviewed by Simon Fraser.
Start using MonotonicTime / Seconds in Timer class. More work will be needed
for the transition to be complete. I plan to do this in a follow-up.
* page/DOMTimer.cpp:
(WebCore::DOMTimer::alignedFireTime):
* page/DOMTimer.h:
* page/SuspendableTimer.cpp:
(WebCore::SuspendableTimer::suspend):
(WebCore::SuspendableTimer::startRepeating):
(WebCore::SuspendableTimer::startOneShot):
(WebCore::SuspendableTimer::repeatInterval):
(WebCore::SuspendableTimer::augmentFireInterval):
(WebCore::SuspendableTimer::augmentRepeatInterval):
* page/SuspendableTimer.h:
(WebCore::SuspendableTimer::startRepeating):
(WebCore::SuspendableTimer::startOneShot):
(WebCore::SuspendableTimer::augmentFireInterval):
(WebCore::SuspendableTimer::augmentRepeatInterval):
* platform/ThreadTimers.cpp:
(WebCore::ThreadTimers::ThreadTimers):
(WebCore::ThreadTimers::setSharedTimer):
(WebCore::ThreadTimers::updateSharedTimer):
(WebCore::ThreadTimers::sharedTimerFiredInternal):
(WebCore::ThreadTimers::fireTimersInNestedEventLoop):
* platform/ThreadTimers.h:
* platform/Timer.cpp:
(WebCore::TimerHeapLessThanFunction::operator()):
(WebCore::TimerBase::TimerBase):
(WebCore::TimerBase::start):
(WebCore::TimerBase::stop):
(WebCore::TimerBase::nextFireInterval):
(WebCore::TimerBase::heapPop):
(WebCore::TimerBase::updateHeapIfNeeded):
(WebCore::TimerBase::setNextFireTime):
(WebCore::TimerBase::nextUnalignedFireInterval):
* platform/Timer.h:
(WebCore::TimerBase::start):
(WebCore::TimerBase::startOneShot):
(WebCore::TimerBase::repeatInterval):
(WebCore::TimerBase::repeatIntervalSeconds):
(WebCore::TimerBase::augmentFireInterval):
(WebCore::TimerBase::augmentRepeatInterval):
(WebCore::TimerBase::alignedFireTime):
(WebCore::TimerBase::isActive):
* testing/Internals.cpp:
(WebCore::Internals::isTimerThrottled):
2017-04-07 Yuichiro Kikura <y.kikura@gmail.com>
WebGPU: implement ComputeCommandEncoder and related components
https://bugs.webkit.org/show_bug.cgi?id=170444
Reviewed by Alex Christensen.
I implemented WebGPUComputeCommandEncoder and related components based on the WebGPU proposal.
https://webkit.org/wp-content/uploads/webgpu-api-proposal.html
Test: fast/canvas/webgpu/webgpu-dispatch.html
* CMakeLists.txt:
* DerivedSources.make:
* PlatformMac.cmake:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSWebGPUCommandBufferCustom.cpp: Added.
(WebCore::JSWebGPUCommandBuffer::completed):
* html/canvas/WebGPUCommandBuffer.cpp:
(WebCore::WebGPUCommandBuffer::createComputeCommandEncoder):
* html/canvas/WebGPUCommandBuffer.h:
* html/canvas/WebGPUCommandBuffer.idl:
* html/canvas/WebGPUComputeCommandEncoder.cpp: Added.
(WebCore::GPUSizeMake):
(WebCore::WebGPUComputeCommandEncoder::create):
(WebCore::WebGPUComputeCommandEncoder::WebGPUComputeCommandEncoder):
(WebCore::WebGPUComputeCommandEncoder::~WebGPUComputeCommandEncoder):
(WebCore::WebGPUComputeCommandEncoder::setComputePipelineState):
(WebCore::WebGPUComputeCommandEncoder::setBuffer):
(WebCore::WebGPUComputeCommandEncoder::dispatch):
(WebCore::WebGPUComputeCommandEncoder::endEncoding):
* html/canvas/WebGPUComputeCommandEncoder.h: Copied from Source/WebCore/html/canvas/WebGPUCommandBuffer.h.
(WebCore::WebGPUComputeCommandEncoder::computeCommandEncoder):
* html/canvas/WebGPUComputeCommandEncoder.idl: Copied from Source/WebCore/html/canvas/WebGPUCommandBuffer.idl.
* html/canvas/WebGPUComputePipelineState.cpp: Copied from Source/WebCore/platform/graphics/gpu/GPUCommandBuffer.cpp.
(WebCore::WebGPUComputePipelineState::create):
(WebCore::WebGPUComputePipelineState::WebGPUComputePipelineState):
(WebCore::WebGPUComputePipelineState::~WebGPUComputePipelineState):
* html/canvas/WebGPUComputePipelineState.h: Copied from Source/WebCore/html/canvas/WebGPUCommandBuffer.h.
(WebCore::WebGPUComputePipelineState::computePipelineState):
* html/canvas/WebGPUComputePipelineState.idl: Copied from Source/WebCore/html/canvas/WebGPUCommandBuffer.idl.
* html/canvas/WebGPURenderingContext.cpp:
(WebCore::WebGPURenderingContext::createComputePipelineState):
* html/canvas/WebGPURenderingContext.h:
* html/canvas/WebGPURenderingContext.idl:
* html/canvas/WebGPUSize.h: Copied from Source/WebCore/html/canvas/WebGPUCommandBuffer.idl.
* html/canvas/WebGPUSize.idl: Copied from Source/WebCore/html/canvas/WebGPUCommandBuffer.idl.
* platform/graphics/cocoa/GPUCommandBufferMetal.mm:
(WebCore::GPUCommandBuffer::completed):
* platform/graphics/cocoa/GPUComputeCommandEncoderMetal.mm: Added.
(WebCore::MTLSizeMake):
(WebCore::GPUComputeCommandEncoder::GPUComputeCommandEncoder):
(WebCore::GPUComputeCommandEncoder::setComputePipelineState):
(WebCore::GPUComputeCommandEncoder::setBuffer):
(WebCore::GPUComputeCommandEncoder::dispatch):
(WebCore::GPUComputeCommandEncoder::endEncoding):
(WebCore::GPUComputeCommandEncoder::platformComputeCommandEncoder):
* platform/graphics/cocoa/GPUComputePipelineStateMetal.mm: Copied from Source/WebCore/platform/graphics/gpu/GPUCommandBuffer.cpp.
(WebCore::GPUComputePipelineState::GPUComputePipelineState):
(WebCore::GPUComputePipelineState::platformComputePipelineState):
* platform/graphics/gpu/GPUCommandBuffer.cpp:
(WebCore::GPUCommandBuffer::createComputeCommandEncoder):
* platform/graphics/gpu/GPUCommandBuffer.h:
* platform/graphics/gpu/GPUComputeCommandEncoder.cpp: Copied from Source/WebCore/platform/graphics/gpu/GPUCommandBuffer.cpp.
(WebCore::GPUComputeCommandEncoder::create):
(WebCore::GPUComputeCommandEncoder::~GPUComputeCommandEncoder):
(WebCore::GPUComputeCommandEncoder::setComputePipelineState):
(WebCore::GPUComputeCommandEncoder::setBuffer):
(WebCore::GPUComputeCommandEncoder::endEncoding):
* platform/graphics/gpu/GPUComputeCommandEncoder.h: Copied from Source/WebCore/platform/graphics/gpu/GPUCommandBuffer.h.
* platform/graphics/gpu/GPUComputePipelineState.cpp: Copied from Source/WebCore/html/canvas/WebGPUCommandBuffer.idl.
(WebCore::GPUComputePipelineState::create):
(WebCore::GPUComputePipelineState::~GPUComputePipelineState):
* platform/graphics/gpu/GPUComputePipelineState.h: Copied from Source/WebCore/platform/graphics/gpu/GPUCommandBuffer.h.
* platform/graphics/gpu/GPUSize.h: Copied from Source/WebCore/html/canvas/WebGPUCommandBuffer.idl.
2017-04-07 Alex Christensen <achristensen@webkit.org>
Private browsing sessions should not look in keychain for client certificates
https://bugs.webkit.org/show_bug.cgi?id=170618
<rdar://problem/18457427>
Reviewed by Dan Bernstein.
Our client certificate testing in WebKit leaves much to be desired.
See rdar://problem/17694210 for reproduction steps.
* platform/spi/cf/CFNetworkSPI.h:
Add some new SPI.
2017-04-07 Zalan Bujtas <zalan@apple.com>
Simple line layout: FlowContents::segmentIndexForRunSlow skips empty runs.
https://bugs.webkit.org/show_bug.cgi?id=170552
Reviewed by Antti Koivisto.
The compare function passed to std::lower_bound completely misses empty runs.
Test: fast/text/simple-line-layout-hover-over-subsequent-linebreaks.html
* rendering/SimpleLineLayoutFlowContents.cpp:
(WebCore::SimpleLineLayout::FlowContents::segmentIndexForRunSlow):
2017-04-07 Chris Dumez <cdumez@apple.com>
We should log how much CPU a background process was using when killing it due to CPU limiting
https://bugs.webkit.org/show_bug.cgi?id=170619
Reviewed by Andreas Kling.
CPUMonitor now passes the CPU usage to the callback when it exceeds the threashold.
* platform/CPUMonitor.cpp:
(WebCore::CPUMonitor::timerFired):
* platform/CPUMonitor.h:
2017-04-07 Chris Dumez <cdumez@apple.com>
Audible autoplay videos should not get paused when outside the viewport
https://bugs.webkit.org/show_bug.cgi?id=170610
<rdar://problem/31505984>
Reviewed by Eric Carlson.
Audible autoplay videos should not get paused when outside the viewport as this
would be observable by the user.
Test: media/video-restricted-invisible-autoplay-allowed-if-audible.html
* html/MediaElementSession.cpp:
(WebCore::MediaElementSession::autoplayPermitted):
2017-04-07 Myles C. Maxfield <mmaxfield@apple.com>
REGRESSION(r211382): Complex text with justification erroneously overflows containers
https://bugs.webkit.org/show_bug.cgi?id=170399
<rdar://problem/31442008>
Reviewed by Simon Fraser.
When we perform justification, we adjust glyphs' advances to add extra space between words.
ComplexTextController maintains an invariant where m_totalWidth is equal to the sum of these
advances. However, in RTL text, inserting extra justification space to the left of a glyph
would break that invariant, and would increase the advances of two glyphs instead of just
one. Then, when we go to draw the text, the sum of the advances is wider than m_totalWidth,
which means the glyphs would be drawn outside of their container.
This regressed in r211382 simply because of an oversight and because there were no tests for
this codepath.
Test: ComplexTextControllerTest.TotalWidthWithJustification
* platform/graphics/ComplexTextController.cpp:
(WebCore::ComplexTextController::adjustGlyphsAndAdvances):
* rendering/InlineBox.h:
(WebCore::InlineBox::InlineBox):
2017-04-07 Chris Dumez <cdumez@apple.com>
Throttle / Align DOM Timers in cross-origin iframes to 30fps
https://bugs.webkit.org/show_bug.cgi?id=170613
<rdar://problem/31506444>
Reviewed by Simon Fraser.
Throttle / Align DOM Timers in cross-origin iframes to 30fps unless the user
has interacted with them, in order to reduce power use.
Test: http/tests/frame-throttling/timer-throttle-in-cross-origin-subframe.html
* dom/Document.cpp:
(WebCore::Document::domTimerAlignmentInterval):
(WebCore::Document::updateLastHandledUserGestureTimestamp):
* page/DOMTimer.h:
2017-04-07 John Wilander <wilander@apple.com>
Follow-up fix for Soup platform.
https://bugs.webkit.org/show_bug.cgi?id=170322
Unreviewed build fix. Error introduced by me in
https://trac.webkit.org/changeset/215104/webkit.
No new tests.
* platform/network/soup/SocketStreamHandleImpl.h:
Move parameter change to the right
SocketStreamHandleImpl::create() function.
2017-04-07 John Wilander <wilander@apple.com>
WebSocket streams should have network usage attributed to correct process
https://bugs.webkit.org/show_bug.cgi?id=170322
<rdar://problem/26413551>
Reviewed by Alex Christensen.
Tested manually since it requires a per-app VPN.
* page/SocketProvider.cpp:
(WebCore::SocketProvider::createSocketStreamHandle):
Sends in an empty struct since it doesn't have access to
platform dependent sourceApplicationAuditData.
* platform/network/SocketStreamHandle.h:
Declaration of a per-platform struct to hold CF data for
Cocoa platforms.
* platform/network/cf/SocketStreamHandleImpl.h:
(WebCore::SocketStreamHandleImpl::create):
Now takes WebCore::SourceApplicationAuditToken which is
passed on to the constructor.
* platform/network/cf/SocketStreamHandleImplCFNet.cpp:
(WebCore::SocketStreamHandleImpl::SocketStreamHandleImpl):
Now takes WebCore::SourceApplicationAuditToken which is
passed on to the streams once created.
(WebCore::SocketStreamHandleImpl::createStreams):
Now sets kCFStreamPropertySourceApplication for the two
streams.
* platform/network/curl/SocketStreamHandleImpl.h:
(WebCore::SocketStreamHandleImpl::create):
Added unused WebCore::SourceApplicationAuditToken parameter.
* platform/network/soup/SocketStreamHandleImpl.h:
* platform/network/soup/SocketStreamHandleImplSoup.cpp:
(WebCore::SocketStreamHandleImpl::create):
Added unused WebCore::SourceApplicationAuditToken parameter.
2017-04-07 Alex Christensen <achristensen@webkit.org>
REGRESSION(r204512): WebSocket errors with "Failed to send WebSocket frame." if too much data is sent
https://bugs.webkit.org/show_bug.cgi?id=170463
Reviewed by Michael Catanzaro.
This only reproduces when using WebSockets to communicate with an external server.
When communicating with a local server, CFWriteStreamWrite succeeds too reliably, so
CFWriteStreamCanAcceptBytes returns true, when sometimes it doesn't when communicating
across the real internet.
* platform/network/cf/SocketStreamHandleImplCFNet.cpp:
(WebCore::SocketStreamHandleImpl::platformSendInternal):
* platform/network/soup/SocketStreamHandleImplSoup.cpp:
(WebCore::SocketStreamHandleImpl::platformSendInternal):
Returning std::nullopt means there was an error, which is not true when the socket stream
is in a state where it cannot be written to because it is actively communicating.
Returning 0 means 0 new bytes were sent, so we will try again later.
2017-04-07 Eric Carlson <eric.carlson@apple.com>
MediaSample should store video sample rotation instead of orientation
https://bugs.webkit.org/show_bug.cgi?id=170598
Reviewed by Youenn Fablet.
No new tests, no functional change.
* platform/MediaSample.h:
(WebCore::MediaSample::videoRotation):
(WebCore::MediaSample::videoOrientation): Deleted.
* platform/graphics/avfoundation/MediaSampleAVFObjC.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::videoTransformationMatrix):
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::enqueueVideoSample):
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::updateDisplayLayer):
* platform/mediastream/mac/AVVideoCaptureSource.mm:
(WebCore::AVVideoCaptureSource::processNewFrame):
* platform/mediastream/mac/RealtimeIncomingVideoSource.cpp:
(WebCore::RealtimeIncomingVideoSource::OnFrame):
(WebCore::RealtimeIncomingVideoSource::processNewSample):
* platform/mediastream/mac/RealtimeIncomingVideoSource.h:
* platform/mediastream/mac/RealtimeOutgoingVideoSource.cpp:
(WebCore::RealtimeOutgoingVideoSource::videoSampleAvailable):
2017-04-07 Brent Fulgham <bfulgham@apple.com>
WebKit should percent encode single quotes in query strings
https://bugs.webkit.org/show_bug.cgi?id=170561
<rdar://problem/7415154>
Reviewed by Alex Christensen.
Modify the characterClassTable to instruct the URLParser to convert
the single-quote character ' to %27 in URL query strings.
Tests: URLParserTest in TestWebKitAPI.
fast/events/popup-blocked-from-unique-frame-via-window-open-named-sibling-frame.html
fast/frames/xss-auditor-handles-file-urls.html
http/tests/security/xssAuditor
* platform/URLParser.cpp:
2017-04-07 Zalan Bujtas <zalan@apple.com>
Text insertion cursor disappears after pressing enter
https://bugs.webkit.org/show_bug.cgi?id=169291
<rdar://problem/30899611>
Reviewed by Tim Horton.
Positon upstream/downstream (as the result of VisiblePosition -> canonicalPosition) require
linebox tree. In addition to regular text, we need to bail out of simple line layout on line breaks too.
Test: editing/simple-line-layout-caret-is-gone.html
* dom/Position.cpp:
(WebCore::ensureLineBoxesIfNeeded):
(WebCore::Position::upstream):
(WebCore::Position::downstream):
(WebCore::Position::getInlineBoxAndOffset):
* rendering/RenderLineBreak.cpp:
(WebCore::RenderLineBreak::ensureLineBoxes):
(WebCore::RenderLineBreak::positionForPoint):
(WebCore::RenderLineBreak::setSelectionState):
(WebCore::RenderLineBreak::collectSelectionRects):
(WebCore::ensureLineBoxes): Deleted.
* rendering/RenderLineBreak.h:
2017-04-07 Xan Lopez <xlopez@igalia.com>
[GTK] Fix codec name in OWR ASSERT
https://bugs.webkit.org/show_bug.cgi?id=170600
Reviewed by Carlos Garcia Campos.
* platform/mediastream/openwebrtc/MediaEndpointOwr.cpp:
(WebCore::MediaEndpointOwr::prepareMediaSession): uppercase the
codec name we are looking for, that's how they appear in the
vector.
2017-04-07 Per Arne Vollan <pvollan@apple.com>
Add hasVideo property to WebAVPlayerController.
https://bugs.webkit.org/show_bug.cgi?id=170545
rdar://problem/31325182
Reviewed by Eric Carlson.
Add a new "hasVideo" property which can be used to discover if any video content is present in the playback item,
whether video content is currently enabled or not.
* platform/ios/WebAVPlayerController.h:
* platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
(WebVideoFullscreenInterfaceAVKit::hasVideoChanged):
2017-04-07 Miguel Gomez <magomez@igalia.com>
[GTK+] Animations not played properly when using synchronous decoding
https://bugs.webkit.org/show_bug.cgi?id=170591
Reviewed by Carlos Garcia Campos.
Fix an index error when destroying decoded frames that was sometimes deleting the frame we wanted
to keep.
Covered by exitent tests.
* platform/graphics/ImageFrameCache.cpp:
(WebCore::ImageFrameCache::destroyDecodedData):
2017-04-07 Xan Lopez <xan@igalia.com>
[GTK] Add message about missing codecs to ASSERT in OWR
https://bugs.webkit.org/show_bug.cgi?id=170596
Reviewed by Carlos Garcia Campos.
* platform/mediastream/openwebrtc/MediaEndpointOwr.cpp:
(WebCore::MediaEndpointOwr::prepareMediaSession): add a message
about the missing coded to the ASSERT.
2017-04-07 Tomas Popela <tpopela@redhat.com>
AX: Don't crash if no renderer is available for AccessibilityRenderObject
https://bugs.webkit.org/show_bug.cgi?id=170448
Reviewed by Chris Fleizach.
Don't crash or assert if no renderer is available, but early return
gracefully (as in other places in the AccessibilityRenderObject.cpp).
Spotted by running some tests through dogtail.
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::isOffScreen):
(WebCore::AccessibilityRenderObject::isUnvisited):
(WebCore::AccessibilityRenderObject::isVisited):
2017-04-07 Carlos Garcia Campos <cgarcia@igalia.com>
[GTK] Update the priorities used in glib main loop sources
https://bugs.webkit.org/show_bug.cgi?id=170457
Reviewed by Žan Doberšek.
* platform/glib/MainThreadSharedTimerGLib.cpp:
(WebCore::MainThreadSharedTimer::MainThreadSharedTimer):
* platform/graphics/texmap/TextureMapperPlatformLayerProxy.cpp:
(WebCore::TextureMapperPlatformLayerProxy::TextureMapperPlatformLayerProxy):
(WebCore::TextureMapperPlatformLayerProxy::activateOnCompositingThread):
2017-04-07 Zan Dobersek <zdobersek@igalia.com>
[GCrypt] Implement AES_CBC support
https://bugs.webkit.org/show_bug.cgi?id=170550
Reviewed by Michael Catanzaro.
Implement the CryptoAlgorithmAES_CBC::platform{Encrypt,Decrypt}
functionality for configurations that use libgcrypt. This is done
by leveraging the gcry_cipher_* APIs for the AES algorithm that's
deduced appropriately from the key size and the CBC cipher mode.
Additionally, the PKCS#7 padding is implemented for each operation,
as demanded by the Web Crypto specification.
No new tests -- current ones cover this sufficiently, but are not yet
enabled due to missing platform-specific SUBTLE_CRYPTO implementations.
* crypto/gcrypt/CryptoAlgorithmAES_CBCGCrypt.cpp:
(WebCore::gcryptEncrypt):
(WebCore::gcryptDecrypt):
(WebCore::CryptoAlgorithmAES_CBC::platformEncrypt):
(WebCore::CryptoAlgorithmAES_CBC::platformDecrypt):
2017-04-07 Zan Dobersek <zdobersek@igalia.com>
[GCrypt] Implement raw and JWK imports and exports for EC keys
https://bugs.webkit.org/show_bug.cgi?id=170546
Reviewed by Michael Catanzaro.
Implement import and export operations for EC keys, covering the raw
and JWK import/export types.
CryptoKeyEC::platformImportRaw() builds a public-key s-expression,
providing the curve name and the key data, and yields the gcry_sexp_t
object to the new CryptoKeyEC.
CryptoKeyEC::platformImportJWKPublic() first constructs a Vector<uint8_t>
object that contains the EC point in the uncompressed format. It then
puts that data into a newly-constructed public-key s-expression that is
then used to construct the new CryptoKeyEC object.
CryptoKeyEC::platformImportJWKPrivate() constructs the EC point data just
the same, but it also lays out the private key field element data into
the private-key s-expression that's then handed off to the CryptoKeyEC
object.
CryptoKeyEC::platformExportRaw() constructs a new EC operations context
and then uses it to retrieve the q parameter as an MPI. A Vector<uint8_t>
is retrieved from the MPI data through the extractMPIData() helper
function.
CryptoKeyEC::platformAddFieldElements() similarly uses the EC operations
context to retrieve the q parameter data, which it then splits into the
x and y field elements and Base64 URL-encodes them into a form that can
be placed in a JsonWebKey. If the key is private, the d parameter is
retrieved in the same fashion and again Base64 URL-encoded and stored
in the JsonWebKey object.
No new tests -- current ones cover this sufficiently, but are not yet
enabled due to other missing platform-specific SUBTLE_CRYPTO
implementations.
* crypto/gcrypt/CryptoKeyECGCrypt.cpp:
(WebCore::uncompressedPointSizeForCurve):
(WebCore::uncompressedFieldElementSizeForCurve):
(WebCore::extractMPIData):
(WebCore::CryptoKeyEC::platformImportRaw):
(WebCore::CryptoKeyEC::platformImportJWKPublic):
(WebCore::CryptoKeyEC::platformImportJWKPrivate):
(WebCore::CryptoKeyEC::platformExportRaw):
(WebCore::CryptoKeyEC::platformAddFieldElements):
2017-04-07 Zan Dobersek <zdobersek@igalia.com>
[GCrypt] Implement CryptoKeyRSA::generatePair()
https://bugs.webkit.org/show_bug.cgi?id=170350
Reviewed by Michael Catanzaro.
Start implementing the libgcrypt-based platform bits of CryptoKeyRSA.
Implement generatePair() by constructing a genkey s-expression
that requests a generation of an RSA key that should use a modulus
of the specified bit-length and the specified exponent. The exponent
is extracted from an uint8_t array through a helper function. The
modulus length value is checked to be at least 16, since libgcrypt
does not support generating primes of less than that length in bits.
The returned s-expression upon request will contain the data for
both the public and the private key. gcry_sexp_t handles representing
those s-expressions are then passed to CryptoKeyRSA::create() before
invoking the success callback with a new CryptoKeyPair object in a
separate ScriptExecutionContext task.
The CryptoKeyRSA constructor simply has the notImplemented() call
removed. The destructor now invokes the HandleDeleter<gcry_sexp_t>
object instance to destroy the object represented by the
m_platformKey handle.
The methods in CryptoKeyRSA.cpp are also reordered to follow the
declaration order used in the header.
No new tests -- current ones cover this sufficiently, but are not yet
enabled due to other missing platform-specific SUBTLE_CRYPTO
implementations.
* crypto/gcrypt/CryptoKeyRSAGCrypt.cpp:
(WebCore::CryptoKeyRSA::CryptoKeyRSA):
(WebCore::CryptoKeyRSA::~CryptoKeyRSA):
(WebCore::exponentVectorToUInt32):
(WebCore::CryptoKeyRSA::generatePair):
(WebCore::CryptoKeyRSA::importSpki):
(WebCore::CryptoKeyRSA::importPkcs8):
(WebCore::CryptoKeyRSA::exportPkcs8):
(WebCore::CryptoKeyRSA::buildAlgorithm):
(WebCore::CryptoKeyRSA::exportData):
* crypto/keys/CryptoKeyRSA.h:
2017-04-06 Youenn Fablet <youenn@apple.com>
[Debug] ASSERT(!throwScope.exception()) on imported/w3c/web-platform-tests/fetch/api/cors/cors-preflight-status-worker.html
https://bugs.webkit.org/show_bug.cgi?id=170395
<rdar://problem/31394017>
Reviewed by Mark Lam.
* bindings/js/JSDOMPromise.cpp:
(WebCore::DeferredPromise::reject): Exiting early in case of scope having an exception.
Adding an assertion to ensure this is a worker termination exception.
2017-04-06 Andreas Kling <akling@apple.com>
Inaudible background tabs should become eligible for memory kill after 8 minutes
https://bugs.webkit.org/show_bug.cgi?id=170574
<rdar://problem/31488686>
Reviewed by Gavin Barraclough.
Lower the delay for potentially marking background tabs as inactive from 60 minutes to 8 minutes.
Letting a tab misbehave in the background for an entire hour was overly charitable.
* page/PerformanceMonitor.cpp:
2017-04-06 Wenson Hsieh <wenson_hsieh@apple.com>
Scroll offset jumps after a programmatic scroll in an overflow container with scroll snapping
https://bugs.webkit.org/show_bug.cgi?id=170560
<rdar://problem/31484693>
Reviewed by Tim Horton.
Test: css3/scroll-snap/scroll-snap-programmatic-overflow-scroll.html
Logic for maintaining the scroll snap state in ScrollController was previously removed from iOS when refactoring
ScrollController. This was done because scroll snapping on iOS is driven not by the ScrollController (as it is
on Mac) but rather by sending scroll snap offsets to the UI process and hooking into UIScrollView delegates to
handle retargeted scrolling.
However, on iOS, this ScrollController state is still important for the purposes of keeping the last active
snap point index in sync with the UI process when the scroll offset changes outside of a user gesture (i.e.
programmatic scrolling). Since the UI process does not get a chance to update the active snap offset during a
programmatic scroll, our last active snap offset state was only being updated to the last snap position that the
user manually scrolled to, making programmatic scrolling jump to this offset.
To fix this, we need to update scroll snap state on iOS within ScrollController. Also adds a new Layout test
that exercises programmatic scrolling in an overflow scrolling container on all platforms.
* platform/cocoa/ScrollController.mm:
(WebCore::otherScrollEventAxis):
(WebCore::ScrollController::updateScrollSnapState):
(WebCore::ScrollController::updateScrollSnapPoints):
2017-04-05 Simon Fraser <simon.fraser@apple.com>
Throttle requestAnimationFrame in cross-origin iframes to 30fps
https://bugs.webkit.org/show_bug.cgi?id=170534
Reviewed by Dan Bates.
Add a throttling reason to ScriptedAnimationController which is NonInteractedCrossOriginFrame,
set on cross-origin iframes whose documents have never seen a user interaction. It's cleared
as soon as an interaction on this frame or a child frame is detected.
Move the initialization of the LowPowerMode throttling reason to Document::requestAnimationFrame(),
since it's more appropriate to compute NonInteractedCrossOriginFrame here than down in ScriptedAnimationController,
and best to do both in the same place.
Tests: http/tests/frame-throttling/raf-throttle-in-cross-origin-subframe.html
* dom/Document.cpp:
(WebCore::Document::requestAnimationFrame):
(WebCore::Document::updateLastHandledUserGestureTimestamp):
* dom/Document.h:
(WebCore::Document::hasHadUserInteraction):
* dom/ScriptedAnimationController.cpp:
(WebCore::ScriptedAnimationController::ScriptedAnimationController):
(WebCore::throttlingReasonToString):
(WebCore::ScriptedAnimationController::interval):
* dom/ScriptedAnimationController.h:
* loader/FrameLoader.cpp:
(WebCore::shouldAskForNavigationConfirmation):
2017-04-05 Simon Fraser <simon.fraser@apple.com>
Use the Accelerate framework to optimize FEColorMatrix operations
https://bugs.webkit.org/show_bug.cgi?id=170518
Reviewed by Tim Horton.
On macOS and iOS, we can use the Accelerate framework (vImage) to do color matrix
math to optimize color matrix, hue rotate, saturation and luminosity to alpha filters.
Change ImageBuffer::getUnmultipliedImageData() and getPremultipliedImageData() to
return the size of the returned Uint8ClampedArray in physical pixels, because we
need to pass that to vImage.
* html/canvas/CanvasRenderingContext2D.cpp:
(WebCore::CanvasRenderingContext2D::getImageData):
* platform/graphics/ImageBuffer.h:
* platform/graphics/cairo/ImageBufferCairo.cpp:
(WebCore::ImageBuffer::getUnmultipliedImageData):
(WebCore::ImageBuffer::getPremultipliedImageData):
* platform/graphics/cg/ImageBufferCG.cpp:
(WebCore::ImageBuffer::getUnmultipliedImageData):
(WebCore::ImageBuffer::getPremultipliedImageData):
* platform/graphics/filters/FEColorMatrix.cpp:
(WebCore::effectApplyAccelerated):
(WebCore::effectType):
(WebCore::FEColorMatrix::platformApplySoftware):
* platform/graphics/filters/FEDropShadow.cpp:
(WebCore::FEDropShadow::platformApplySoftware):
* platform/graphics/win/ImageBufferDirect2D.cpp:
(WebCore::ImageBuffer::getUnmultipliedImageData):
(WebCore::ImageBuffer::getPremultipliedImageData):
2017-04-04 Simon Fraser <simon.fraser@apple.com>
Do some minor FEColorMatrix code cleanup and optimization
https://bugs.webkit.org/show_bug.cgi?id=170474
Reviewed by Dean Jackson.
Don't switch inside of a pixel processing loop; repeat the loop inside switch (filterType).
Change matrix() and saturateAndHueRotate() to dereference the source pixels once, instead
of multiple times, which is faster.
This kind of code benefits from aligning things with spaces for readability, so do so,
violating webkit style.
Add some off-by-default performance logging code.
Increases pixel processing performance from about 86ms per megapixel to 65ms per megapixel.
* platform/graphics/filters/FEColorMatrix.cpp:
(WebCore::matrix):
(WebCore::saturateAndHueRotate):
(WebCore::effectType):
(WebCore::FEColorMatrix::platformApplySoftware):
2017-04-06 Ryan Haddad <ryanhaddad@apple.com>
Unreviewed, rolling out r215041.
The LayoutTest for this change is failing on ios-simulator.
Reverted changeset:
"Rendering flexbox children across columns"
https://bugs.webkit.org/show_bug.cgi?id=164166
http://trac.webkit.org/changeset/215041
2017-04-06 Ryan Haddad <ryanhaddad@apple.com>
Unreviewed, rolling out r215046.
This change broke internal builds.
Reverted changeset:
"WebRTC tests gardening"
https://bugs.webkit.org/show_bug.cgi?id=170508
http://trac.webkit.org/changeset/215046
2017-04-06 Joseph Pecoraro <pecoraro@apple.com>
Web Inspector: Only Capture Extra Network Load Metrics when there is a Web Inspector Frontend
https://bugs.webkit.org/show_bug.cgi?id=170525
Reviewed by Youenn Fablet.
Covered by existing tests that when Web Inspector is open we enable collecting the extra data.
* inspector/InspectorInstrumentation.cpp:
(WebCore::InspectorInstrumentation::firstFrontendCreated):
(WebCore::InspectorInstrumentation::lastFrontendDeleted):
* inspector/InspectorInstrumentation.h:
(WebCore::InspectorInstrumentation::frontendCreated):
(WebCore::InspectorInstrumentation::frontendDeleted):
When the first frontend is created enable a new loader strategy to
collect extra network load metrics. When the last frontend is closed
disable the extra metrics.
* loader/LoaderStrategy.h:
* platform/PlatformStrategies.h:
New load strategy to enable/disable new metrics.
2017-04-06 Joseph Pecoraro <pecoraro@apple.com>
Web Inspector: Show all headers in the Request Headers section of the Resource details sidebar
https://bugs.webkit.org/show_bug.cgi?id=16531
<rdar://problem/5712895>
Reviewed by Timothy Hatcher.
Test: http/tests/inspector/network/resource-request-headers.html
* loader/ResourceTiming.cpp:
(WebCore::ResourceTiming::ResourceTiming):
Eliminate unnecessary data from the NetworkLoadTiming object
when it is used for ResourceTiming. This clears up some memory
that will otherwise never be used.
* platform/network/NetworkLoadMetrics.h:
(WebCore::NetworkLoadMetrics::isolatedCopy):
(WebCore::NetworkLoadMetrics::reset):
(WebCore::NetworkLoadMetrics::clearNonTimingData):
(WebCore::NetworkLoadMetrics::operator==):
(WebCore::NetworkLoadMetrics::encode):
(WebCore::NetworkLoadMetrics::decode):
Include an optional HTTPHeaderMap for a refined list of
request headers for this network load.
* inspector/InspectorNetworkAgent.cpp:
(WebCore::InspectorNetworkAgent::buildObjectForMetrics):
Include request headers with other optional metrics data
when the load is completed.
2017-04-06 Tim Horton <timothy_horton@apple.com>
Follow up to r209304, remove line numbers from one more StyleRule construction
https://bugs.webkit.org/show_bug.cgi?id=170564
Reviewed by Simon Fraser.
* css/StyleRule.cpp:
(WebCore::StyleRuleViewport::StyleRuleViewport):
This one was missed in r209304.
2017-04-06 Timothy Horton <timothy_horton@apple.com>
Remove an unused member and constructor parameter from CSSPropertyParser
https://bugs.webkit.org/show_bug.cgi?id=170562
Reviewed by Simon Fraser.
* css/parser/CSSParser.cpp:
(WebCore::CSSParser::parseSingleValue):
(WebCore::CSSParser::parseValueWithVariableReferences):
* css/parser/CSSParserImpl.cpp:
(WebCore::CSSParserImpl::consumeDeclarationValue):
* css/parser/CSSPropertyParser.cpp:
(WebCore::CSSPropertyParser::CSSPropertyParser):
(WebCore::CSSPropertyParser::parseValue):
(WebCore::CSSPropertyParser::parseSingleValue):
* css/parser/CSSPropertyParser.h:
It is possible to get Clang to complain about the unused member, though
I'm not sure why it doesn't in the build today.
2017-04-06 Zalan Bujtas <zalan@apple.com>
Simple line layout: Hittest always returns the first renderer in the block.
https://bugs.webkit.org/show_bug.cgi?id=170520
<rdar://problem/30979175>
Reviewed by Antti Koivisto.
This is incorrect now with <br> support (multiple renderers within the same block flow).
Test: fast/dom/Document/CaretRangeFromPoint/simple-line-layout-hittest-with-caret-range-from-point.html
* rendering/RenderText.cpp:
(WebCore::RenderText::positionForPoint): Related fix. We don't yet support positionForPoint with multiple renderes.
* rendering/SimpleLineLayoutFlowContents.h:
(WebCore::SimpleLineLayout::FlowContents::segmentForRun): Empty runs are all valid.
* rendering/SimpleLineLayoutFunctions.cpp:
(WebCore::SimpleLineLayout::hitTestFlow):
(WebCore::SimpleLineLayout::collectFlowOverflow):
* rendering/SimpleLineLayoutResolver.cpp:
(WebCore::SimpleLineLayout::LineResolver::Iterator::operator*): This should eventually return a list of renderes.
* rendering/SimpleLineLayoutResolver.h:
(WebCore::SimpleLineLayout::RunResolver::flowContents):
2017-04-06 Jon Davis <jond@apple.com>
Updates feature status for recently shipped features
https://bugs.webkit.org/show_bug.cgi?id=170359
Reviewed by Brian Burg.
Added missing Gamepad entry.
Changed "Done" status to "Supported".
Also changed status from "In Development" to "Supported" for:
- CSS Grid Layout Level 1
- CSS Inline Layout Module Level 3
- CSS Scroll Snap Points Module Level 1
- CSS Color Level 4
- Fetch API
- Indexed Database 2.0
- Media Capture and Streams
- Pointer Lock
- Preload
- Input Events
* features.json:
2017-03-31 Jiewen Tan <jiewen_tan@apple.com>
[WebCrypto] Add support for AES-CTR
https://bugs.webkit.org/show_bug.cgi?id=169761
<rdar://problem/31331321>
Reviewed by Brent Fulgham.
This patch adds support for AES-CTR. Operations of AES-CTR include: encrypt, decrypt, generateKey,
importKey, exportKey, wrapKey, and unwrapKey. This implementation follows the latest WebCryptoAPI
spec: https://www.w3.org/TR/WebCryptoAPI/#aes-ctr.
Tests: crypto/subtle/aes-ctr-encrypt-malformed-parameters.html
crypto/subtle/aes-ctr-encrypt-overflow.html
crypto/subtle/aes-ctr-generate-export-key-jwk-length-128.html
crypto/subtle/aes-ctr-generate-export-key-jwk-length-192.html
crypto/subtle/aes-ctr-generate-export-key-jwk-length-256.html
crypto/subtle/aes-ctr-generate-export-raw-key.html
crypto/subtle/aes-ctr-generate-key-encrypt-decrypt.html
crypto/subtle/aes-ctr-generate-key.html
crypto/subtle/aes-ctr-import-jwk-key-length-128.html
crypto/subtle/aes-ctr-import-jwk-key-length-192.html
crypto/subtle/aes-ctr-import-jwk-key-length-256.html
crypto/subtle/aes-ctr-import-key-decrypt.html
crypto/subtle/aes-ctr-import-key-encrypt.html
crypto/subtle/aes-ctr-import-key-unwrap-jwk-key.html
crypto/subtle/aes-ctr-import-key-unwrap-raw-key.html
crypto/subtle/aes-ctr-import-key-wrap-jwk-key.html
crypto/subtle/aes-ctr-import-key-wrap-raw-key.html
crypto/subtle/aes-ctr-import-raw-key.html
crypto/workers/subtle/aes-ctr-import-key-decrypt.html
crypto/workers/subtle/aes-ctr-import-key-encrypt.html
crypto/workers/subtle/aes-ctr-import-key-unwrap-key.html
crypto/workers/subtle/aes-ctr-import-key-wrap-key.html
* CMakeLists.txt:
* DerivedSources.make:
* PlatformGTK.cmake:
* PlatformMac.cmake:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSSubtleCryptoCustom.cpp:
(WebCore::normalizeCryptoAlgorithmParameters):
* crypto/CryptoAlgorithmParameters.h:
* crypto/algorithms/CryptoAlgorithmAES_CTR.cpp: Added.
(WebCore::usagesAreInvalidForCryptoAlgorithmAES_CTR):
(WebCore::parametersAreValid):
(WebCore::CryptoAlgorithmAES_CTR::create):
(WebCore::CryptoAlgorithmAES_CTR::identifier):
(WebCore::CryptoAlgorithmAES_CTR::encrypt):
(WebCore::CryptoAlgorithmAES_CTR::decrypt):
(WebCore::CryptoAlgorithmAES_CTR::generateKey):
(WebCore::CryptoAlgorithmAES_CTR::importKey):
(WebCore::CryptoAlgorithmAES_CTR::exportKey):
(WebCore::CryptoAlgorithmAES_CTR::getKeyLength):
* crypto/algorithms/CryptoAlgorithmAES_CTR.h: Added.
* crypto/gcrypt/CryptoAlgorithmAES_CTRGCrypt.cpp: Added.
(WebCore::CryptoAlgorithmAES_CTR::platformEncrypt):
(WebCore::CryptoAlgorithmAES_CTR::platformDecrypt):
* crypto/mac/CryptoAlgorithmAES_CTRMac.cpp: Added.
(WebCore::bigIntegerToSize):
(WebCore::transformAES_CTR):
(WebCore::CryptoAlgorithmAES_CTR::platformEncrypt):
(WebCore::CryptoAlgorithmAES_CTR::platformDecrypt):
* crypto/mac/CryptoAlgorithmRegistryMac.cpp:
(WebCore::CryptoAlgorithmRegistry::platformRegisterAlgorithms):
* crypto/parameters/AesCtrParams.idl: Added.
* crypto/parameters/CryptoAlgorithmAesCtrParams.h: Added.
2017-04-06 Youenn Fablet <youenn@apple.com>
WebRTC tests gardening
https://bugs.webkit.org/show_bug.cgi?id=170508
Reviewed by Eric Carlson.
* Configurations/FeatureDefines.xcconfig: Changing webrtc enabling for ios.
2017-04-06 Andreas Kling <akling@apple.com>
Stop forcing CA commit when memory pressure changes.
https://bugs.webkit.org/show_bug.cgi?id=170522
<rdar://problem/31460236>
Reviewed by Antti Koivisto.
Don't force a CA commit when reaching critical memory pressure. We're already doing a ton
of work in response to the pressure, and this was really a hack to try to react quickly on
512 MB devices which we don't support anymore.
* page/MemoryRelease.cpp:
(WebCore::releaseCriticalMemory):
2017-04-06 Romain Bellessort <romain.bellessort@crf.canon.fr>
[Readable Streams API] Implement ReadableStreamBYOBRequest respondWithNewView()
https://bugs.webkit.org/show_bug.cgi?id=170339
Reviewed by Youenn Fablet.
Implemented ReadableStreamBYOBRequest respondWithNewView().
Added new tests to check respondWithNewView() behaviour.
* Modules/streams/ReadableByteStreamInternals.js:
(readableByteStreamControllerRespondWithNewView): Added.
* Modules/streams/ReadableStreamBYOBRequest.js:
(respondWithNewView): Updated.
2017-04-06 Eric Carlson <eric.carlson@apple.com>
[MediaStream] Host application should be able to mute and unmute media streams
https://bugs.webkit.org/show_bug.cgi?id=170519
<rdar://problem/31174326>
Unreviewed, fix crash introduced in r214980.
* Modules/mediastream/MediaStream.cpp:
(WebCore::MediaStream::MediaStream): NULL-check page.
2017-04-06 Dave Hyatt <hyatt@apple.com>
Rendering flexbox children across columns
https://bugs.webkit.org/show_bug.cgi?id=164166
<rdar://problem/29055587>
Reviewed by Zalan Bujtas.
Added fast/multicol/flexbox-rows.html.
* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::adjustForUnsplittableChild):
Treat block-level flexboxes that occur inside block flows the same as replaced
and unsplittable elements and push them to the next page if they don't fit. We don't
update the minimum page height though, since the flexbox is not really unsplittable.
2017-04-05 Simon Fraser <simon.fraser@apple.com>
Set lastHandledUserGestureTimestamp on all ancestor documents, not just the top document
https://bugs.webkit.org/show_bug.cgi?id=170479
Reviewed by Sam Weinig.
When interacting with a subframe document, set lastHandledUserGestureTimestamp on all ancestor
documents up to the root.
This will be used in future for requestAnimationFrame throttling.
Test: fast/frames/user-gesture-timestamp-propagation.html
* dom/Document.cpp:
(WebCore::Document::updateLastHandledUserGestureTimestamp):
* dom/Document.h:
* dom/UserGestureIndicator.cpp:
(WebCore::UserGestureIndicator::UserGestureIndicator):
* testing/Internals.cpp:
(WebCore::Internals::lastHandledUserGestureTimestamp):
* testing/Internals.h:
* testing/Internals.idl:
2017-04-05 Eric Carlson <eric.carlson@apple.com>
[MediaStream] Host application should be able to mute and unmute media streams
https://bugs.webkit.org/show_bug.cgi?id=170519
<rdar://problem/31174326>
Unreviewed, address review comments missed in the initial checkin.
* Modules/mediastream/MediaStream.cpp:
(WebCore::MediaStream::MediaStream): Mute the private stream if the page doesn't allow
capture.
(WebCore::MediaStream::pageMutedStateDidChange): setMuted -> setCaptureTracksMuted.
* platform/mediastream/MediaStreamPrivate.cpp:
(WebCore::MediaStreamPrivate::addTrack): Don't track muted state, the capture source already does.
(WebCore::MediaStreamPrivate::startProducingData): Ditto.
(WebCore::MediaStreamPrivate::setCaptureTracksMuted): Renamed from setMuted.
(WebCore::MediaStreamPrivate::setMuted): Deleted.
* platform/mediastream/MediaStreamPrivate.h:
2017-04-05 Eric Carlson <eric.carlson@apple.com>
[MediaStream] Host application should be able to mute and unmute media streams
https://bugs.webkit.org/show_bug.cgi?id=170519
<rdar://problem/31174326>
Reviewed by Youenn Fablet.
No new tests, fast/mediastream/MediaStream-page-muted.html was updated.
* Modules/mediastream/MediaStream.cpp:
(WebCore::MediaStream::~MediaStream): Fix a typo.
(WebCore::MediaStream::pageMutedStateDidChange): Don't store muted state, let the private
stream store it.
(WebCore::MediaStream::mediaState): Deal with new muted state flags.
* Modules/mediastream/MediaStream.h:
* dom/Document.cpp:
(WebCore::Document::prepareForDestruction): Clear media state before the frame is cleared.
* page/MediaProducer.h: Add muted flags.
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::checkSelectedVideoTrack): The display layer
should not be visible when the video track is muted.
* platform/mediastream/MediaStreamPrivate.cpp:
(WebCore::MediaStreamPrivate::addTrack): Mute the new track if necessary.
(WebCore::MediaStreamPrivate::startProducingData): Do nothing when muted.
(WebCore::MediaStreamPrivate::setExternallyMuted): New, mute/unmute tracks.
* platform/mediastream/MediaStreamPrivate.h:
* platform/mediastream/RealtimeMediaSource.cpp:
(WebCore::RealtimeMediaSource::setMuted): Start/stop producing data.
* testing/Internals.cpp:
(WebCore::Internals::pageMediaState): Support new media stream muted flags.
2017-04-05 Andreas Kling <akling@apple.com>
Make inactive web processes behave as though under memory pressure.
https://bugs.webkit.org/show_bug.cgi?id=170042
<rdar://problem/31038445>
Reviewed by Antti Koivisto.
Prevent PerformanceMonitor from marking the process as inactive at startup.
This fixes the API test failure that caused this patch to get rolled out.
* page/PerformanceMonitor.h:
2017-04-05 Youenn Fablet <youenn@apple.com>
Switch to kCVPixelFormatType_420YpCbCr8BiPlanarFullRange for Mac video capture format
https://bugs.webkit.org/show_bug.cgi?id=170509
Reviewed by Eric Carlson.
Covered by existing tests.
* platform/mediastream/mac/AVVideoCaptureSource.mm:
2017-04-05 Javier Fernandez <jfernandez@igalia.com>
[css-align] Implement the place-items shorthand
https://bugs.webkit.org/show_bug.cgi?id=168847
Reviewed by David Hyatt.
The CSS Box Alignment specification defines a new shorthand to set the
Content Alignment properties (align-items and justify-items) at the
same time.
This patch provides the implementation of the CSS parsing logic and the
required regression tests. For the time being, as it happens with the
rest of the new alignment properties, the new parsing logic is
implemented behind the CSS Grid Layout runtime flag.
Test: css3/parse-place-items.html
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::ComputedStyleExtractor::propertyValue):
* css/CSSProperties.json:
* css/StyleProperties.cpp:
(WebCore::StyleProperties::getPropertyValue):
(WebCore::StyleProperties::getAlignmentShorthandValue):
* css/StyleProperties.h:
* css/parser/CSSPropertyParser.cpp:
(WebCore::isAutoOrNormalOrStretch):
(WebCore::consumeSelfPositionOverflowPosition):
(WebCore::consumeSimplifiedItemPosition):
(WebCore::CSSPropertyParser::consumePlaceItemsShorthand):
* css/parser/CSSPropertyParser.h:
2017-04-05 Ryan Haddad <ryanhaddad@apple.com>
Unreviewed, rolling out r214932.
This change broke an internal build.
Reverted changeset:
"[ios-simulator] API test WebKit2.DataDetectionReferenceDate
timing out"
https://bugs.webkit.org/show_bug.cgi?id=161967
http://trac.webkit.org/changeset/214932
2017-04-05 Ryan Haddad <ryanhaddad@apple.com>
Unreviewed, rolling out r214962.
Roll r214937 back in because it wasn't at fault for the build
breakage.
Reverted changeset:
"Unreviewed, rolling out r214937."
https://bugs.webkit.org/show_bug.cgi?id=170365
http://trac.webkit.org/changeset/214962
2017-04-05 Ryan Haddad <ryanhaddad@apple.com>
Unreviewed, rolling out r214937.
This change broke an internal build.
Reverted changeset:
"REGRESSION (r202472): Data Detection overwrites existing
links in detected ranges"
https://bugs.webkit.org/show_bug.cgi?id=170365
http://trac.webkit.org/changeset/214937
2017-04-05 Carlos Alberto Lopez Perez <clopez@igalia.com>
[WebRTC][OpenWebRTC] Add support for SDP BUNDLE ("a:group:BUNDLE" and "a=bundle-only" lines)
https://bugs.webkit.org/show_bug.cgi?id=170157
Reviewed by Alejandro G. Castro.
This implements support on the SDPProcessor for generating an "a=group:BUNDLE"
attribute with the MID identifiers specified in the bundle group in the most
recent answer.
It also implements support for generating "a=bundle-only" attributes on the
"m=" sections of the SDP according to the bundlePolicy defined.
Test: fast/mediastream/RTCPeerConnection-inspect-offer-bundlePolicy-bundle-only.html
* Modules/mediastream/MediaEndpointPeerConnection.cpp:
(WebCore::MediaEndpointPeerConnection::createOfferTask):
(WebCore::MediaEndpointPeerConnection::createAnswerTask):
* Modules/mediastream/SDPProcessor.cpp:
(WebCore::getBundlePolicyName):
(WebCore::configurationToJSON):
* Modules/mediastream/sdp.js:
(SDP.generate):
* platform/mediastream/MediaEndpointSessionConfiguration.h:
(WebCore::MediaEndpointSessionConfiguration::bundlePolicy):
(WebCore::MediaEndpointSessionConfiguration::setBundlePolicy):
(WebCore::MediaEndpointSessionConfiguration::clone):
2017-04-05 Jer Noble <jer.noble@apple.com>
[MSE] Seeks to currentTime=0 will fail if currentTime is already 0.
https://bugs.webkit.org/show_bug.cgi?id=170510
<rdar://problem/30988403>
Reviewed by Eric Carlson.
Test: media/media-source/media-source-unnecessary-seek-seeked.html
The AVSampleBufferRenderSynchronizer won't fire a time jumped notification if no seek is actully
necessary. So short circuit the seek logic if the seek time is identical to the current synchronizer
time.
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::seekInternal):
2017-04-05 Chris Dumez <cdumez@apple.com>
<input type="range"> changing to disabled while active breaks all pointer events
https://bugs.webkit.org/show_bug.cgi?id=170447
<rdar://problem/31442875>
Reviewed by Geoffrey Garen.
When a range's slider is being moved, we set SliderThumbElement's m_inDragMode flag
to true and mark the range elements as the CapturingMouseEventsElement. When we get
the mouseUp event, we are supposed to exit drag mode. However, when the range element
gets disabled while dragging, we do not get the mouseUp event and we need to make
sure we exit dragging mode anyway. r112547 tried to fix this by calling stopDragging()
in SliderThumbElement::defaultEventHandler() when the input element is disabled.
While this often works, this is fragile and we sometimes fail to exit dragging mode
when we should.
This patch addressed the issue by calling stopDragging() in
SliderThumbElement::disabledAttributeChanged() instead. This is much safer as we
guarantee will exit dragging mode whenever the range element gets disabled, even
if SliderThumbElement::defaultEventHandler() does not get called after that.
Test: fast/forms/range/disabled-while-dragging.html
* html/RangeInputType.cpp:
(WebCore::RangeInputType::disabledAttributeChanged):
* html/RangeInputType.h:
* html/shadow/SliderThumbElement.cpp:
(WebCore::SliderThumbElement::defaultEventHandler):
(WebCore::SliderThumbElement::disabledAttributeChanged):
* html/shadow/SliderThumbElement.h:
2017-04-05 Eric Carlson <eric.carlson@apple.com>
[MediaStream] Video doesn't render in fullscreen on iOS
https://bugs.webkit.org/show_bug.cgi?id=170404
Reviewed by Youenn Fablet.
No new tests, filed https://bugs.webkit.org/show_bug.cgi?id=170512.
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::MediaPlayerPrivateMediaStreamAVFObjC): Include
video fullscreen manager on iOS too.
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::videoTransformationMatrix): Add paramater
to force transform recalculation.
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::enqueueVideoSample): Restructure code since
the display layer resize happens elsewhere.
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::ensureLayers): Include video fullscreen
manager on iOS too.
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::destroyLayers): Ditto.
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::platformLayer): Ditto.
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::setVideoFullscreenLayer): Ditto.
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::backgroundLayerBoundsChanged): Change the
display layer size and position immediately instead of waiting for the next sample buffer
so the display is correct when fullscreen mode changes when paused.
2017-04-05 Youenn Fablet <youenn@apple.com>
Deprecate and remove URL.createObjectURL(mediastream)
https://bugs.webkit.org/show_bug.cgi?id=167518
<rdar://problem/31149607>
Reviewed by Eric Carlson.
Covered by updated tests.
* CMakeLists.txt:
* DerivedSources.cpp:
* DerivedSources.make:
* Modules/mediastream/DOMURLMediaStream.cpp: Removed.
* Modules/mediastream/DOMURLMediaStream.h: Removed.
* Modules/mediastream/DOMURLMediaStream.idl: Removed.
* WebCore.xcodeproj/project.pbxproj:
* html/DOMURL.idl:
2017-04-05 Alejandro G. Castro <alex@igalia.com>
[Webrtc] Mock realtime sources factories should be static after r213941
https://bugs.webkit.org/show_bug.cgi?id=170282
Reviewed by Alex Christensen.
If we don't make the variables static we would be returning a
local variable.
* platform/mock/MockRealtimeAudioSource.cpp:
(WebCore::MockRealtimeAudioSource::factory):
* platform/mock/MockRealtimeVideoSource.cpp:
(WebCore::MockRealtimeVideoSource::factory):
2017-04-05 Alex Christensen <achristensen@webkit.org>
Fix CMake build.
* platform/graphics/avfoundation/objc/MediaSampleAVFObjC.mm:
Some JavaScript inline functions were not being accessed from this file with different enable flags.
* platform/spi/cf/CFNetworkSPI.h:
* platform/spi/cocoa/NSURLConnectionSPI.h:
Moved NSURLSession-specific SPI from NSURLConnectionSPI.h to CFNetworkSPI.h.
2017-04-05 Chris Dumez <cdumez@apple.com>
_blank / _self / _parent / _top browsing context names should be case-insensitive
https://bugs.webkit.org/show_bug.cgi?id=169747
Reviewed by Alex Christensen.
_blank / _self / _parent / _top browsing context names should be case-insensitive
as per the HTML specification:
- https://html.spec.whatwg.org/#browsing-context-names
This aligns our behavior with Firefox as well. See discussion at:
- https://github.com/whatwg/html/issues/2443
Tests: imported/w3c/web-platform-tests/html/browsers/windows/browsing-context-names/browsing-context-_blank.html
imported/w3c/web-platform-tests/html/browsers/windows/browsing-context-names/browsing-context-choose-parent-001.html
imported/w3c/web-platform-tests/html/browsers/windows/browsing-context-names/browsing-context-choose-parent-002.html
imported/w3c/web-platform-tests/html/browsers/windows/browsing-context-names/browsing-context-choose-parent-003.html
imported/w3c/web-platform-tests/html/browsers/windows/browsing-context-names/browsing-context-choose-parent-004.html
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::continueLoadAfterNewWindowPolicy):
(WebCore::createWindow):
* page/DOMWindow.cpp:
(WebCore::DOMWindow::open):
* page/FrameTree.cpp:
(WebCore::FrameTree::uniqueChildName):
(WebCore::FrameTree::find):
2017-04-05 Miguel Gomez <magomez@igalia.com>
[GTK+] PNG animations that should run once are not played at all
https://bugs.webkit.org/show_bug.cgi?id=170499
Reviewed by Carlos Garcia Campos.
The repetition count reported bu the PNGImageDecoder is wrong. It's returning m_playCount - 1, which
means 0 for the animations that need to be played once. Change it to return an appropriate value.
Covered by existent tests.
* platform/image-decoders/png/PNGImageDecoder.cpp:
(WebCore::PNGImageDecoder::repetitionCount):
* platform/image-decoders/png/PNGImageDecoder.h:
2017-04-05 Andy Estes <aestes@apple.com>
REGRESSION (r202472): Data Detection overwrites existing links in detected ranges
https://bugs.webkit.org/show_bug.cgi?id=170365
<rdar://problem/29205721>
Reviewed by Tim Horton.
r202472 changed the node traversal in searchForLinkRemovingExistingDDLinks() to only
consider nodes that are descendants of startNode, but we need to traverse all nodes between
startNode and endNode to find existing non-DD links.
As a result, we'd add a Data Detector link to the following snippet and make the original
links un-clickable:
<a href='#'>tomorrow</a> <a href='#'>night</a>
Fix this by not specifying a stayWithin node when calling NodeTraversal::next(). The loop
will terminate when we reach endNode.
Updated WebKit2.DataDetectionReferenceDate API test.
* editing/cocoa/DataDetection.mm:
(WebCore::searchForLinkRemovingExistingDDLinks):
2017-04-04 Carlos Garcia Campos <cgarcia@igalia.com>
Move WebErrors from WebProcess to Shared and get rid of ErrorsGtk in WebCore
https://bugs.webkit.org/show_bug.cgi?id=156974
Reviewed by Sam Weinig.
Remove ErrorsGtk.
* PlatformGTK.cmake:
* platform/gtk/ErrorsGtk.cpp: Removed.
* platform/gtk/ErrorsGtk.h: Removed.
2017-04-05 Andy Estes <aestes@apple.com>
[ios-simulator] API test WebKit2.DataDetectionReferenceDate timing out
https://bugs.webkit.org/show_bug.cgi?id=161967
Reviewed by Alexey Proskuryakov.
DataDetectorsCoreSPI.h defined DDQueryOffset as a struct of two CFIndexes, which is 16 bytes
on LP64, but the struct is actually defined as two CFIndex-typed 32-bit bitfields, which is
8 bytes on LP64. This breaks the ABI on Public SDK builds when calling functions that take
or return DDQueryOffsets.
* platform/spi/cocoa/DataDetectorsCoreSPI.h: Updated the DDQueryOffset definition for
Public SDK builds, and added a static_assert to detect future size changes at compile time.
2017-04-04 Jer Noble <jer.noble@apple.com>
Move AVSampleBufferDisplayLayer declarations into AVFoundationSPI.h
https://bugs.webkit.org/show_bug.cgi?id=170471
Reviewed by Eric Carlson.
Move the declaration of AVSampleBufferDisplayLayer (and related classes) into AVFoundationSPI.
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
* platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
* platform/spi/mac/AVFoundationSPI.h:
2017-04-04 Youenn Fablet <youenn@apple.com>
Canvas is tainted when painting a video with MediaStreamTrack
https://bugs.webkit.org/show_bug.cgi?id=170486
Reviewed by Eric Carlson.
Test: http/tests/media/media-stream/getusermedia-with-canvas.html
Adding the notion of isolated source so that we can later on implement WebRTC isolated tracks.
For now, canvas will not be tainted if painted from a MediaStreamTrack.
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::didPassCORSAccessCheck):
* platform/mediastream/MediaStreamTrackPrivate.h:
(WebCore::MediaStreamTrackPrivate::isIsolated):
* platform/mediastream/RealtimeMediaSource.h:
2017-04-04 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r214894, r214895, r214907, r214912,
and r214918.
https://bugs.webkit.org/show_bug.cgi?id=170491
Caused build failures on Mac (Requested by rniwa on #webkit).
Reverted changesets:
"Build fix."
http://trac.webkit.org/changeset/214894
"Rolling back the build fix, as it broke other builds."
http://trac.webkit.org/changeset/214895
"Move AVSampleBufferDisplayLayer declarations into
AVFoundationSPI.h"
https://bugs.webkit.org/show_bug.cgi?id=170471
http://trac.webkit.org/changeset/214907
"Unreviewed build fix: fix compilation error on Sierra."
http://trac.webkit.org/changeset/214912
"More build fixing."
http://trac.webkit.org/changeset/214918
2017-04-04 Youenn Fablet <youenn@apple.com>
[Mac] Add back web audio support for getUserMedia MediaStreamTrack
https://bugs.webkit.org/show_bug.cgi?id=170482
Reviewed by Eric Carlson.
´Covered by reenabled test.
Exporting method and class used in WebKit2.
* WebCore.xcodeproj/project.pbxproj:
* platform/audio/mac/CAAudioStreamDescription.h:
* platform/mediastream/mac/WebAudioSourceProviderAVFObjC.h:
2017-04-04 Alexey Proskuryakov <ap@apple.com>
More build fixing.
* platform/spi/mac/AVFoundationSPI.h:
2017-04-04 Simon Fraser <simon.fraser@apple.com>
Do some minor FEColorMatrix code cleanup and optimization
https://bugs.webkit.org/show_bug.cgi?id=170474
Reviewed by Dean Jackson.
Don't switch inside of a pixel processing loop; repeat the loop inside switch (filterType).
Change matrix() and saturateAndHueRotate() to dereference the source pixels once, instead
of multiple times, which is faster.
This kind of code benefits from aligning things with spaces for readability, so do so,
violating webkit style.
Add some off-by-default performance logging code.
Increases pixel processing performance from about 86ms per megapixel to 65ms per megapixel.
* platform/graphics/filters/FEColorMatrix.cpp:
(WebCore::matrix):
(WebCore::saturateAndHueRotate):
(WebCore::effectType):
(WebCore::FEColorMatrix::platformApplySoftware):
2017-04-04 Brent Fulgham <bfulgham@apple.com>
Do not assert when CharacterData representing an Attr fires events
https://bugs.webkit.org/show_bug.cgi?id=170454
<rdar://problem/30979320>
Reviewed by Ryosuke Niwa.
Make the NoEventDispatchAssertion in CharacterData::notifyParentAfterChange conditional
since Attr elements should be allowed to fire events.
Tests: fast/dom/no-assert-for-malformed-js-url-attribute.html
* dom/CharacterData.cpp:
(WebCore::CharacterData::notifyParentAfterChange):
2017-04-04 Youenn Fablet <youenn@apple.com>
LayoutTest webrtc/libwebrtc/descriptionGetters.html is a flaky failure
https://bugs.webkit.org/show_bug.cgi?id=169481
Reviewed by Eric Carlson.
No need to enumerate all network interfaces in most layout tests.
Adding an Internals API for that in case we want to use TCP localhost candidates.
* testing/Internals.cpp:
(WebCore::Internals::Internals):
(WebCore::Internals::setEnumeratingAllNetworkInterfacesEnabled):
* testing/Internals.h:
* testing/Internals.idl:
2017-04-04 Jer Noble <jer.noble@apple.com>
Unreviewed build fix: fix compilation error on Sierra.
* platform/spi/mac/AVFoundationSPI.h:
2017-04-04 Jer Noble <jer.noble@apple.com>
Move AVSampleBufferDisplayLayer declarations into AVFoundationSPI.h
https://bugs.webkit.org/show_bug.cgi?id=170471
Reviewed by Eric Carlson.
Move the declaration of AVSampleBufferDisplayLayer (and related classes) into AVFoundationSPI.
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::addDisplayLayer): Deleted.
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::removeDisplayLayer): Deleted.
* platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
* platform/spi/mac/AVFoundationSPI.h:
2017-04-04 Saam Barati <sbarati@apple.com>
WebAssembly: JSWebAssemblyCallee should not be a JSCell
https://bugs.webkit.org/show_bug.cgi?id=170135
Reviewed by Michael Saboff.
* bindings/js/JSDOMWindowBase.cpp:
(WebCore::callerDOMWindow):
2017-04-04 Simon Fraser <simon.fraser@apple.com>
Change Document's lastHandledUserGestureTimestamp to be a MonotonicTime
https://bugs.webkit.org/show_bug.cgi?id=170468
Reviewed by Zalan Bujtas.
Change the double to MonotonicTime. No behavior change.
* dom/Document.cpp:
(WebCore::Document::updateLastHandledUserGestureTimestamp):
* dom/Document.h:
(WebCore::Document::lastHandledUserGestureTimestamp):
* html/HTMLPlugInImageElement.cpp:
(WebCore::documentHadRecentUserGesture):
* loader/FrameLoader.cpp:
(WebCore::shouldAskForNavigationConfirmation):
2017-04-04 Youenn Fablet <youenn@apple.com>
[Debug] ASSERT(!throwScope.exception()) on imported/w3c/web-platform-tests/fetch/api/cors/cors-preflight-status-worker.html
https://bugs.webkit.org/show_bug.cgi?id=170395
<rdar://problem/31394017>
Reviewed by Mark Lam.
No change of behavior.
* bindings/js/JSDOMPromise.cpp:
(WebCore::DeferredPromise::reject): Adding early ASSERT that creating an exception is happening correctly.
2017-04-04 Alexey Proskuryakov <ap@apple.com>
Rolling back the build fix, as it broke other builds.
* platform/spi/mac/AVFoundationSPI.h:
2017-04-04 Alexey Proskuryakov <ap@apple.com>
Build fix.
Rubber-stamped by Jer Noble.
* platform/spi/mac/AVFoundationSPI.h:
2017-04-04 Tim Horton <timothy_horton@apple.com>
[Mac] -[WKWebView findMatchesForString:relativeToMatch:findOptions:maxResults:resultCollector:] invokes the resultCollector with didWrap = NO even when it wraps
https://bugs.webkit.org/show_bug.cgi?id=165801
<rdar://problem/29649535>
Reviewed by Wenson Hsieh.
New API tests: WebKit2.FindInPageWrapping*
* page/FrameTree.cpp:
(WebCore::FrameTree::traverseNextWithWrap):
(WebCore::FrameTree::traversePreviousWithWrap):
(WebCore::FrameTree::traverseNextInPostOrderWithWrap):
* page/FrameTree.h:
Add CanWrap and DidWrap boolean enums, and add an optional out argument
to traverse*WithWrap indicating whether a wrap actually occurred.
* history/CachedPage.cpp:
(WebCore::firePageShowAndPopStateEvents):
* history/PageCache.cpp:
(WebCore::destroyRenderTree):
Adjust to the new CanWrap enum.
* page/Page.cpp:
(WebCore::incrementFrame):
(WebCore::Page::findString):
(WebCore::Page::findStringMatchingRanges):
(WebCore::Page::rangeOfString):
(WebCore::Page::findMatchesForText):
(WebCore::Page::unmarkAllTextMatches):
* page/Page.h:
Adjust to the new CanWrap enum, and optionally plumb DidWrap through
to callers of findString().
2017-04-04 Carlos Garcia Campos <cgarcia@igalia.com>
[GTK] PLATFORM(GTK) && !USE(COORDINATED_GRAPHICS_THREADED) is no longer possible
https://bugs.webkit.org/show_bug.cgi?id=170458
Reviewed by Carlos Alberto Lopez Perez.
That is not supported anymore, so we can remove dead code from VideoSinkGStreamer.cpp
* platform/graphics/gstreamer/VideoSinkGStreamer.cpp:
(VideoRenderRequestScheduler::VideoRenderRequestScheduler):
2017-04-04 Per Arne Vollan <pvollan@apple.com>
Unreviewed Windows build fix.
* bindings/js/JSDOMGuardedObject.h:
2017-04-03 Wenson Hsieh <wenson_hsieh@apple.com>
Data interaction should register type identifiers in order of priority
https://bugs.webkit.org/show_bug.cgi?id=170428
<rdar://problem/30633296>
Reviewed by Tim Horton.
Currently, due to the shared logic for writing to a UIPasteboard (in the case of copy/paste) and the shared
UIItemProvider-based pasteboard wrapper (in the case of data interaction), we don't enforce any particular
ordering in which type identifiers are registered in the generated item provider. This is because
-[UIPasteboard setItems:] only takes an unordered mapping of type identifiers to objects.
To fix this, we introduce a separate way to set pasteboard data that first writes a list of object
representations in order of priority (which is dependent on the content being interacted with) and then register
individual type-data mappings at the end.
Augmented existing API tests in DataInteractionTests to check for the existence and priority of type identifiers
in the UIItemProviders created upon starting data interaction. Also adds a new unit test:
DataInteractionTests.TextAreaToInput.
* WebCore.xcodeproj/project.pbxproj:
* editing/cocoa/EditorCocoa.mm:
(WebCore::archivedDataForAttributedString):
(WebCore::Editor::writeSelectionToPasteboard):
(WebCore::Editor::writeSelection):
* platform/Pasteboard.h:
* platform/PasteboardWriterData.h:
* platform/PlatformPasteboard.h:
* platform/ios/AbstractPasteboard.h:
* platform/ios/AbstractPasteboard.mm: Copied from Source/WebCore/platform/ios/AbstractPasteboard.h.
Introduce WebPasteboardItemData, a wrapper around a list of objects representating the pasteboard data in order
of priority, and a dictionary containing additional NSData blobs that contain data useful for private clients.
(+[WebPasteboardItemData itemWithRepresentingObjects:additionalData:]):
(-[WebPasteboardItemData initWithRepresentingObjects:additionalData:]):
(-[WebPasteboardItemData representingObjects]):
(-[WebPasteboardItemData additionalData]):
* platform/ios/PlatformPasteboardIOS.mm:
(WebCore::richTextRepresentationsForPasteboardWebContent):
(WebCore::PlatformPasteboard::writeObjectRepresentations):
(WebCore::PlatformPasteboard::write):
Tweaked to check whether the pasteboard responds to -setItemsFromObjectRepresentations:. If so, uses the
PlatformPasteboard::writeObjectRepresentations codepath to write data to the pasteboard, respecting type
priority.
* platform/ios/WebItemProviderPasteboard.mm:
(-[WebItemProviderPasteboard pasteboardTypes]):
(-[WebItemProviderPasteboard setItemProviders:]):
(-[WebItemProviderPasteboard setItemsFromObjectRepresentations:]):
Replaces -setItems: with -setItemsFromObjectRepresentations:, which respects the priority of each object
representation of the data in the pasteboard.
(-[WebItemProviderPasteboard setItems:]): Deleted.
2017-04-03 Javier Fernandez <jfernandez@igalia.com>
[css-align] Adapt place-content alignment shorthand to the new baseline syntax
https://bugs.webkit.org/show_bug.cgi?id=170340
Reviewed by David Hyatt.
Now that the align-content and justify-content CSS properties are
adapted to the new baseline-position CSS values syntax we can adapt the
shorthand that controls such properties to the new syntax as well.
No new tests, just adding some additional cases to the tests we already have.
* css/StyleProperties.cpp:
(WebCore::StyleProperties::getPropertyValue):
(WebCore::StyleProperties::placeContentPropertyValue):
* css/StyleProperties.h:
* css/parser/CSSPropertyParser.cpp:
(WebCore::isContentDistributionKeyword):
(WebCore::isContentPositionKeyword):
(WebCore::isOverflowKeyword):
(WebCore::getBaselineKeyword):
(WebCore::consumeContentDistributionOverflowPosition):
(WebCore::consumeSimplifiedContentPosition):
2017-04-03 Nan Wang <n_wang@apple.com>
AX: Expose link children when doing search predication on iOS
https://bugs.webkit.org/show_bug.cgi?id=170424
<rdar://problem/31413335>
The children of links are accessible elements on iOS instead of the link itself,
so we should expose the children when doing predicated searches as well.
Reviewed by Chris Fleizach.
Test: accessibility/ios-simulator/ios-search-predicate-link-children.html
* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::isAccessibilityObjectSearchMatchAtIndex):
2017-04-03 Jer Noble <jer.noble@apple.com>
No audio output for MediaStream-backed audio elements on iOS
https://bugs.webkit.org/show_bug.cgi?id=170427
Reviewed by Eric Carlson.
The logic for setting the output timestamp offset in AudioSampleDataSource was reversed; instead of
subtracting out the timestamp of the first pull request, it effectively doubled it.
* platform/audio/mac/AudioSampleDataSource.mm:
(WebCore::AudioSampleDataSource::pullSamplesInternal):
2017-04-03 Dave Hyatt <hyatt@apple.com>
Japanese fonts in vertical text should support synthesized italics
https://bugs.webkit.org/show_bug.cgi?id=169301
Reviewed by Simon Fraser.
Updated test in fast/text/international.
* platform/graphics/Font.cpp:
(WebCore::Font::nonSyntheticItalicFont): Deleted.
* platform/graphics/Font.h:
Removed the non-synthetic italic font member, since it's not used.
* platform/graphics/FontCascadeFonts.cpp:
(WebCore::glyphDataForNonCJKCharacterWithGlyphOrientation):
Patched to ensure that a text-orientation-fallback font data is always
returned in the synthetic oblique case, so that non-CJK and CJK are
guaranteed to be broken up so that their slants can be applied differently.
(WebCore::FontCascadeFonts::glyphDataForSystemFallback):
(WebCore::FontCascadeFonts::glyphDataForNormalVariant):
(WebCore::glyphDataForCJKCharacterWithoutSyntheticItalic): Deleted.
Patched to no longer turn off synthetic oblique for CJK.
* platform/graphics/cocoa/FontCascadeCocoa.mm:
(WebCore::FontCascade::drawGlyphs):
Apply the correct italic transform to CJK when in vertical text.
2017-04-03 Chris Dumez <cdumez@apple.com>
REGRESSION (r206744): CSS background-image in style attribute ignored when using createHTMLDocument method of DOM parsing
https://bugs.webkit.org/show_bug.cgi?id=170285
<rdar://problem/31378543>
Reviewed by Andy Estes.
r206744 caused up to stop trying to resolve relative URLs when trying to load an image
referred to by CSS. We already try to resolve the relative URL when parsing the CSS
property so this will usually work fine. However, in the case when the CSS property
is parsed in detached document and then moved to another document, we will not have
the complete URL.
Test: fast/images/background-image-relative-url-changes-document.html
* css/CSSImageValue.cpp:
(WebCore::CSSImageValue::loadImage):
2017-04-03 Jeremy Jones <jeremyj@apple.com>
Do not set WebAVPlayerLayerView background to black in fullscreen.
https://bugs.webkit.org/show_bug.cgi?id=170132
rdar://problem/30839278
Reviewed by Tim Horton.
No new tests because no behavior change.
The black background on WebAVPlayerLayerView interferes with the fullscreen animation
and has been removed.
* platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
(WebVideoFullscreenInterfaceAVKit::enterFullscreen):
(WebVideoFullscreenInterfaceAVKit::enterFullscreenStandard):
2017-04-03 Antti Koivisto <antti@apple.com>
REGRESSION (r207669): FileMaker Pro Help pages do not render correctly
https://bugs.webkit.org/show_bug.cgi?id=170402
<rdar://problem/31004344>
Reviewed by Simon Fraser.
If a new stylesheet load is started from the load event the document.styleSheets does not
always reflect the already loaded stylesheets.
Test: fast/css/document-stylesheets-dynamic.html
* style/StyleScope.cpp:
(WebCore::Style::Scope::updateActiveStyleSheets):
Remove an old optimization where we would not update active stylesheets if there were pending
(head) stylesheet loads and they had not been updated already.
This is probably not a valuable optimization anymore with the new lazy stylesheet update strategy.
* style/StyleScope.h:
2017-04-03 Anders Carlsson <andersca@apple.com>
Tweak ApplePaySession API
https://bugs.webkit.org/show_bug.cgi?id=170409
rdar://problem/31405459
Reviewed by Tim Horton.
Rename "address" to "addressLines". Add "postalAddress". Reorder the ApplePayError constructor parameters.
* Modules/applepay/ApplePayError.cpp:
(WebCore::ApplePayError::create):
(WebCore::ApplePayError::ApplePayError):
* Modules/applepay/ApplePayError.h:
* Modules/applepay/ApplePayError.idl:
* Modules/applepay/PaymentRequest.h:
2017-04-03 Zan Dobersek <zdobersek@igalia.com>
[GCrypt] Implement CryptoKeyEC::keySizeInBits(), ::platformGeneratePair()
https://bugs.webkit.org/show_bug.cgi?id=170345
Reviewed by Michael Catanzaro.
Start implementing the libgcrypt-based platform bits of CryptoKeyEC.
Implement keySizeInBits() by returning the appropriate size for this
object's curve type. An assertion is added to ensure that this size
matches the one that's returned by gcry_pk_get_nbits() for this
object's EC key as represented by the m_platformKey gcry_sexp_t object.
Implement platformGeneratePair() by constructing a genkey s-expression
that requests a generation of an EC key for the specified curve type.
The s-expression is then passed to gcry_pk_genkey(), and the public
and private key data is then retrieved from the returned s-expression
upon success and used to create the public and private CryptoKeyEC
objects.
The PlatformECKey type alias is changed to match gcry_sexp_t. The
CryptoKeyEC destructor releases the gcry_sexp_t object through
a PAL::GCrypt::HandleDeleter<gcry_sexp_t> instance.
The method definitions in the CryptoKeyECGCrypt.cpp file are also
sorted to match the declaration order in the header.
No new tests -- current ones cover this sufficiently, but are not yet
enabled due to other missing platform-specific SUBTLE_CRYPTO
implementations.
* crypto/gcrypt/CryptoKeyECGCrypt.cpp:
(WebCore::curveSize):
(WebCore::curveName):
(WebCore::CryptoKeyEC::~CryptoKeyEC):
(WebCore::CryptoKeyEC::keySizeInBits):
(WebCore::CryptoKeyEC::platformGeneratePair):
(WebCore::CryptoKeyEC::platformImportSpki):
(WebCore::CryptoKeyEC::platformImportPkcs8):
(WebCore::CryptoKeyEC::platformExportRaw):
(WebCore::CryptoKeyEC::platformAddFieldElements):
(WebCore::CryptoKeyEC::platformExportSpki):
* crypto/keys/CryptoKeyEC.h:
2017-04-03 Zan Dobersek <zdobersek@igalia.com>
[GCrypt] Implement AES_KW support
https://bugs.webkit.org/show_bug.cgi?id=170274
Reviewed by Michael Catanzaro.
Implement the CryptoAlgorithmAES_KW::platform{Wrap,Unwrap}Key()
functionality for configurations that use libgcrypt. This is done
by leveraging the gcry_cipher_* APIs for the AES algorithm that's
deducted appropriately from the key size and the AESWRAP cipher mode.
No new tests -- current ones cover this sufficiently, but are not yet
enabled due to other missing platform-specific SUBTLE_CRYPTO
implementations.
* crypto/gcrypt/CryptoAlgorithmAES_KWGCrypt.cpp:
(WebCore::gcryptWrapKey):
(WebCore::gcryptUnwrapKey):
(WebCore::CryptoAlgorithmAES_KW::platformWrapKey):
(WebCore::CryptoAlgorithmAES_KW::platformUnwrapKey):
2017-04-03 Zan Dobersek <zdobersek@igalia.com>
[GCrypt] Implement AES_GCM support
https://bugs.webkit.org/show_bug.cgi?id=170271
Reviewed by Michael Catanzaro.
Implement the CryptoAlgorithmAES_GCM::platform{Encrypt,Decrypt}
functionality for configurations that use libgcrypt. This is done
by leveraging the gcry_cipher_* APIs for the AES algorithm that's
deducted appropriately from the key size and the GCM cipher mode.
No new tests -- current ones cover this sufficiently, but are not yet
enabled due to other missing platform-specific SUBTLE_CRYPTO
implementations.
* crypto/gcrypt/CryptoAlgorithmAES_GCMGCrypt.cpp:
(WebCore::gcryptEncrypt):
(WebCore::gcryptDecrypt):
(WebCore::CryptoAlgorithmAES_GCM::platformEncrypt):
(WebCore::CryptoAlgorithmAES_GCM::platformDecrypt):
2017-04-03 Zan Dobersek <zdobersek@igalia.com>
[GCrypt] Implement PBKDF2 support
https://bugs.webkit.org/show_bug.cgi?id=170270
Reviewed by Michael Catanzaro.
Implement the CryptoAlgorithmPBKDF2::platformDeriveBits() functionality
for configurations that use libgcrypt. This is done by leveraging the
gcry_kdf_derive() API, using GCRY_KDF_PBKDF2 as the preferred KDF
along with the properly deducted SHA algorithm.
No new tests -- current ones cover this sufficiently, but are not yet
enabled due to other missing platform-specific SUBTLE_CRYPTO
implementations.
* crypto/gcrypt/CryptoAlgorithmPBKDF2GCrypt.cpp:
(WebCore::gcryptDeriveBits):
(WebCore::CryptoAlgorithmPBKDF2::platformDeriveBits):
2017-04-01 Simon Fraser <simon.fraser@apple.com>
Clean up touch event handler registration when moving nodes between documents
https://bugs.webkit.org/show_bug.cgi?id=170384
rdar://problem/30816694
Reviewed by Chris Dumez.
Make sure that Node::didMoveToNewDocument() does the correct unregistration on the
old document, and registration on the new document for nodes with touch event listeners,
and gesture event listeners. Touch "handler" nodes (those for overflow and sliders) are
already correctly moved via renderer-related teardown.
Add assertions that fire when removal was not complete.
Use references in more places.
Tests: fast/events/touch/ios/gesture-node-move-between-documents.html
fast/events/touch/ios/overflow-node-move-between-documents.html
fast/events/touch/ios/slider-node-move-between-documents.html
fast/events/touch/ios/touch-node-move-between-documents.html
* dom/EventNames.h:
(WebCore::EventNames::gestureEventNames):
* dom/Node.cpp:
(WebCore::Node::willBeDeletedFrom):
(WebCore::Node::didMoveToNewDocument):
(WebCore::tryAddEventListener):
(WebCore::tryRemoveEventListener):
* html/shadow/SliderThumbElement.cpp:
(WebCore::SliderThumbElement::registerForTouchEvents):
(WebCore::SliderThumbElement::unregisterForTouchEvents):
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::registerAsTouchEventListenerForScrolling):
(WebCore::RenderLayer::unregisterAsTouchEventListenerForScrolling):
2017-04-03 Youenn Fablet <youenn@apple.com>
captureStream is getting black frames with webgl canvas
https://bugs.webkit.org/show_bug.cgi?id=170325
Reviewed by Dean Jackson.
Test: fast/mediastream/captureStream/canvas3d.html
Changing the webgl context to save buffers in case the canvas is captured.
Adding a canvas changed notification in case of clear.
In the future, we might want to change this notification and do it when endPaint or similar is called.
Adding an Internals API to grab the RGBA equivalent of the next track frame.
For that purpose, adding a bunch of WEBCORE_EXPORT.
* Modules/mediastream/CanvasCaptureMediaStreamTrack.cpp:
(WebCore::CanvasCaptureMediaStreamTrack::Source::Source): Adding constraints support so that track settings
getter actually transmits the width and height of the source.
(WebCore::CanvasCaptureMediaStreamTrack::Source::canvasChanged): ensuring webgl canvas context keep their drawing buffer.
* Modules/mediastream/MediaStreamTrack.h:
* bindings/js/JSDOMGuardedObject.h:
* bindings/js/JSDOMPromise.h:
(WebCore::DeferredPromise::resolve):
(WebCore::DeferredPromise::reject):
* dom/ActiveDOMCallback.h:
* html/HTMLCanvasElement.cpp:
(WebCore::HTMLCanvasElement::captureStream):
* html/ImageData.h:
* html/ImageData.idl:
* html/canvas/WebGLRenderingContext.cpp:
(WebCore::WebGLRenderingContext::clear): ensuring canvas observers get notified in case of clear calls.
* html/canvas/WebGLRenderingContextBase.h:
(WebCore::WebGLRenderingContextBase::preserveDrawingBuffer): Added to allow canvas capture to update this property.
* platform/MediaSample.h:
(WebCore::MediaSample::getRGBAImageData): Added for internals API.
* platform/graphics/avfoundation/MediaSampleAVFObjC.h:
* platform/graphics/avfoundation/objc/MediaSampleAVFObjC.mm:
(WebCore::MediaSampleAVFObjC::getRGBAImageData):
* platform/graphics/cv/PixelBufferConformerCV.cpp:
(WebCore::PixelBufferConformerCV::convert): Helper routine for getRGBAImageData.
* platform/graphics/cv/PixelBufferConformerCV.h:
* platform/mediastream/RealtimeMediaSourceSettings.h:
(WebCore::RealtimeMediaSourceSettings::setSupportedConstraints):
(WebCore::RealtimeMediaSourceSettings::setSupportedConstraits): Deleted.
* platform/mediastream/mac/AVMediaCaptureSource.mm:
(WebCore::AVMediaCaptureSource::initializeSettings):
* platform/mediastream/openwebrtc/RealtimeAudioSourceOwr.h:
* platform/mediastream/openwebrtc/RealtimeVideoSourceOwr.h:
* platform/mock/MockRealtimeMediaSource.cpp:
(WebCore::MockRealtimeMediaSource::initializeSettings):
* testing/Internals.cpp:
(WebCore::Internals::grabNextMediaStreamTrackFrame):
(WebCore::Internals::videoSampleAvailable):
* testing/Internals.h:
* testing/Internals.idl:
2017-04-03 Per Arne Vollan <pvollan@apple.com>
Implement stroke-miterlimit.
https://bugs.webkit.org/show_bug.cgi?id=169078
Reviewed by Dean Jackson.
Support stroke-miterlimit for text rendering, see https://drafts.fxtf.org/paint/.
Tests: fast/css/stroke-miterlimit-default.html
fast/css/stroke-miterlimit-large.html
fast/css/stroke-miterlimit-zero.html
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::ComputedStyleExtractor::propertyValue):
* css/CSSProperties.json:
* css/SVGCSSComputedStyleDeclaration.cpp:
(WebCore::ComputedStyleExtractor::svgPropertyValue):
* rendering/TextPaintStyle.cpp:
(WebCore::computeTextPaintStyle):
(WebCore::updateGraphicsContext):
* rendering/TextPaintStyle.h:
* rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::diff):
* rendering/style/RenderStyle.h:
(WebCore::RenderStyle::strokeMiterLimit):
(WebCore::RenderStyle::setStrokeMiterLimit):
(WebCore::RenderStyle::initialStrokeMiterLimit):
(WebCore::RenderStyle::setStrokeDashOffset):
* rendering/style/RenderStyleConstants.cpp:
* rendering/style/RenderStyleConstants.h:
* rendering/style/SVGRenderStyle.cpp:
(WebCore::SVGRenderStyle::diff):
* rendering/style/SVGRenderStyle.h:
(WebCore::SVGRenderStyle::initialStrokeDashArray):
(WebCore::SVGRenderStyle::strokeDashArray):
(WebCore::SVGRenderStyle::initialStrokeMiterLimit): Deleted.
(WebCore::SVGRenderStyle::strokeMiterLimit): Deleted.
(WebCore::SVGRenderStyle::setStrokeMiterLimit): Deleted.
* rendering/style/SVGRenderStyleDefs.cpp:
(WebCore::StyleStrokeData::StyleStrokeData):
(WebCore::StyleStrokeData::operator==):
* rendering/style/SVGRenderStyleDefs.h:
* rendering/style/StyleRareInheritedData.cpp:
(WebCore::StyleRareInheritedData::StyleRareInheritedData):
(WebCore::StyleRareInheritedData::operator==):
* rendering/style/StyleRareInheritedData.h:
* rendering/svg/RenderSVGShape.cpp:
(WebCore::RenderSVGShape::hasSmoothStroke):
* rendering/svg/SVGRenderSupport.cpp:
(WebCore::SVGRenderSupport::applyStrokeStyleToContext):
* rendering/svg/SVGRenderTreeAsText.cpp:
(WebCore::writeStyle):
2017-04-03 Alejandro G. Castro <alex@igalia.com>
[OWR] Fix class structure for the OWR mock classes after last modifications
https://bugs.webkit.org/show_bug.cgi?id=170173
Reviewed by Youenn Fablet.
In case of OWR MockRealtimeMediaSource inherits from
RealtimeMediaSourceOwr, so we have to change some of the function
interfaces.
* platform/mock/MockRealtimeMediaSource.h:
2017-04-02 Alexey Proskuryakov <ap@apple.com>
Build fix for
Add missing text styles
https://bugs.webkit.org/show_bug.cgi?id=170295
* rendering/RenderThemeIOS.mm:
(WebCore::RenderThemeIOS::cachedSystemFontDescription):
(WebCore::RenderThemeIOS::updateCachedSystemFontDescription):
2017-04-01 Zalan Bujtas <zalan@apple.com>
Long Arabic text in ContentEditable with css white-space=pre hangs Safari
https://bugs.webkit.org/show_bug.cgi?id=170245
Reviewed by Myles C. Maxfield.
While searching for mid-word break, we measure the text by codepoints in a loop until the accumulated width > available width.
When we see that the accumulated width for the individual codepoints overflows, we join the codepoints and re-measure them.
These 2 widths could be considerably different for number of reasons (ligatures is a prime example). When we figure that
the run still fits, we go back to the main loop (since we are not supposed to wrap the line here) and take the next codepoint.
However this time we start the measurement from the last whitespace, so we end up remeasuring a potentially long chuck of text
until we hit the wrapping point. This is way too expensive.
This patch changes the logic so that we just go back to measuring individual codepoints until we hit the constrain again.
Covered by existing tests.
* rendering/line/BreakingContext.h:
(WebCore::BreakingContext::handleText): canUseSimpleFontCodePath() is just to mitigate the potential risk of regression and
complex text is more likely to fall into this category.
2017-04-01 Jon Lee <jonlee@apple.com>
Add missing text styles
https://bugs.webkit.org/show_bug.cgi?id=170295
rdar://problem/30219503
Reviewed by Dean Jackson.
Updated existing test to include new text styles.
* css/CSSValueKeywords.in: Add title0 and title4.
* platform/spi/cocoa/CoreTextSPI.h:
* rendering/RenderThemeIOS.mm:
(WebCore::RenderThemeIOS::cachedSystemFontDescription):
(WebCore::RenderThemeIOS::updateCachedSystemFontDescription):
2017-04-01 Dan Bernstein <mitz@apple.com>
[iOS] <input type=file> label should be specified using plural rules
https://bugs.webkit.org/show_bug.cgi?id=170388
Reviewed by Alexey Proskuryakov.
* English.lproj/Localizable.strings: Updated using update-webkit-localizable-strings.
* English.lproj/Localizable.stringsdict: Added an entry for the new key "%lu photo(s) and
%lu video(s)", with plural rules covering all the different combinations in English.
Other localizations may specify additional combinations as needed.
2017-04-01 Alexey Proskuryakov <ap@apple.com>
Rolling back <https://trac.webkit.org/r214697>, as it made WebKit2.DataDetectionReferenceDate time out.
Was REGRESSION (r202472): Data Detection overwrites existing links in detected ranges
https://bugs.webkit.org/show_bug.cgi?id=170365
* editing/cocoa/DataDetection.mm:
(WebCore::searchForLinkRemovingExistingDDLinks):
2017-04-01 Chris Dumez <cdumez@apple.com>
We should pause silent WebAudio rendering in background tabs
https://bugs.webkit.org/show_bug.cgi?id=170299
<rdar://problem/31289132>
Reviewed by Eric Carlson.
We should pause silent WebAudio rendering in background tabs since it uses CPU and is
not observable by the user. Such silent WebAudio rendering seems to be used by
doubleclick ads.
Test: webaudio/silent-audio-interrupted-in-background.html
* Modules/webaudio/AudioContext.cpp:
(WebCore::AudioContext::lazyInitialize):
(WebCore::AudioContext::uninitialize):
Have AudioContext register / unregister itself with the Document to get
visibility change notifications, similarly to what HTMLMediaElement was
already doing.
(WebCore::AudioContext::visibilityStateChanged):
Begin / End session interruption whenever the page visiblity changes.
* Modules/webaudio/AudioContext.h:
* WebCore.xcodeproj/project.pbxproj:
* dom/Document.cpp:
(WebCore::Document::registerForVisibilityStateChangedCallbacks):
(WebCore::Document::unregisterForVisibilityStateChangedCallbacks):
(WebCore::Document::visibilityStateChanged):
* dom/Document.h:
* dom/Element.h:
* dom/VisibilityChangeClient.h: Added.
(WebCore::VisibilityChangeClient::~VisibilityChangeClient):
* html/HTMLMediaElement.h:
Introduce a new VisibilityChangeClient interface and have both AudioContext
and HTMLMediaElement subclass it. Previously, the visibilityStateChanged()
function was on Element but this prevented AudioContext from registering
itself since AudioContext is not an Element.
2017-04-01 Dan Bernstein <mitz@apple.com>
[Cocoa] A couple of UI strings use three periods instead of an ellipsis
https://bugs.webkit.org/show_bug.cgi?id=170386
Reviewed by Tim Horton.
* English.lproj/Localizable.strings: Updated using update-webkit-localizable-strings.
* platform/LocalizedStrings.cpp:
(WebCore::mediaElementLoadingStateText): Changed "Loading..." to "Loading…".
* platform/cocoa/LocalizedStringsCocoa.mm:
(WebCore::contextMenuItemTagStyles): Changed "Styles..." to "Styles…".
2017-04-01 Dan Bernstein <mitz@apple.com>
Localizable strings files are out of date
https://bugs.webkit.org/show_bug.cgi?id=170383
Reviewed by Tim Horton.
Ran update-webkit-localizable-strings.
* English.lproj/Localizable.strings:
2017-04-01 Dan Bernstein <mitz@apple.com>
[Xcode] In engineering builds, linker warns about libwebrtc.dylib’s install name being invalid
https://bugs.webkit.org/show_bug.cgi?id=170385
Reviewed by Tim Horton.
* Configurations/DebugRelease.xcconfig: Set WK_RELOCATABLE_FRAMEWORKS to YES like we do
in some other projects’ DebugRelease.xcconfig. Engineering builds are always relocatable.
* Configurations/WebCore.xcconfig: When WebCore is relocatable, tell the linker that it’s
not going to be in the shared cache, even if its install name implies that it might be.
2017-04-01 Alexey Proskuryakov <ap@apple.com>
Rolling back http://trac.webkit.org/r214663 - memory corruption
* Modules/streams/ReadableByteStreamInternals.js:
(cloneArrayBuffer):
* bindings/js/JSDOMGlobalObject.cpp:
(WebCore::JSDOMGlobalObject::addBuiltinGlobals):
* bindings/js/StructuredClone.cpp:
(WebCore::structuredCloneArrayBuffer):
(WebCore::cloneArrayBufferImpl): Deleted.
(WebCore::cloneArrayBuffer): Deleted.
* bindings/js/StructuredClone.h:
* bindings/js/WebCoreBuiltinNames.h:
* testing/Internals.cpp:
(WebCore::markerTypeFrom):
(WebCore::Internals::resetToConsistentState):
(WebCore::Internals::isLoadingFromMemoryCache):
(WebCore::Internals::setImageFrameDecodingDuration):
(WebCore::deferredStyleRulesCountForList):
(WebCore::deferredGroupRulesCountForList):
(WebCore::deferredKeyframesRulesCountForList):
(WebCore::Internals::eventThrottlingBehaviorOverride):
(WebCore::Internals::enableMockSpeechSynthesizer):
(WebCore::Internals::rangeForDictionaryLookupAtLocation):
(WebCore::Internals::nodesFromRect):
(WebCore::Internals::layerIDForElement):
(WebCore::Internals::setElementUsesDisplayListDrawing):
(WebCore::Internals::setElementTracksDisplayListReplay):
(WebCore::Internals::styleRecalcCount):
(WebCore::Internals::compositingUpdateCount):
(WebCore::Internals::setCaptionDisplayMode):
(WebCore::Internals::endMediaSessionInterruption):
(WebCore::Internals::postRemoteControlCommand):
(WebCore::appendOffsets):
(WebCore::Internals::scrollSnapOffsets):
(WebCore::Internals::setShowAllPlugins):
(WebCore::Internals::cloneArrayBuffer): Deleted.
* testing/Internals.h:
* testing/Internals.idl:
2017-03-31 Zalan Bujtas <zalan@apple.com>
<table>: Including <caption>, <thead> or <tbody> causes clipping across page breaks
https://bugs.webkit.org/show_bug.cgi?id=170348
<rdar://problem/24727151>
Reviewed by David Hyatt.
1. In RenderFlowThread::offsetFromLogicalTopOfFirstRegion() we need to take table section offset into account (they are skipped
during the containing block traversal).
2. Trigger paginated relayout when body is moved vertically due to caption/thead etc.
Test: fast/multicol/table-section-page-break.html
* rendering/RenderFlowThread.cpp:
(WebCore::RenderFlowThread::offsetFromLogicalTopOfFirstRegion):
* rendering/RenderTable.cpp:
(WebCore::RenderTable::layout):
2017-03-31 Simon Fraser <simon.fraser@apple.com>
Rename DOMWindow's m_touchEventListenerCount to m_touchAndGestureEventListenerCount
https://bugs.webkit.org/show_bug.cgi?id=170371
Reviewed by Tim Horton.
This count tracks touch and gesture event listeners, so name it appropriately.
* page/DOMWindow.cpp:
(WebCore::DOMWindow::addEventListener):
(WebCore::DOMWindow::removeEventListener):
(WebCore::DOMWindow::removeAllEventListeners):
* page/DOMWindow.h:
2017-03-31 Simon Fraser <simon.fraser@apple.com>
When destroying a Node, assert that it's been removed from all the touch handler maps
https://bugs.webkit.org/show_bug.cgi?id=170363
rdar://problem/31377469
Reviewed by Tim Horton.
Assert that the Node has been removed from the touch handler maps in all documents on destruction.
* dom/Document.h:
(WebCore::Document::hasTouchEventHandlers):
(WebCore::Document::touchEventTargetsContain):
* dom/Node.cpp:
(WebCore::Node::~Node):
2017-03-31 Alexey Proskuryakov <ap@apple.com>
Rolling back https://trac.webkit.org/r214689, as it caused many crashes.
Was:
Fix memory leak in CreateSessionDescriptionObserver::OnSuccess
https://bugs.webkit.org/show_bug.cgi?id=170357
* Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
(WebCore::LibWebRTCMediaEndpoint::createSessionDescriptionSucceeded):
2017-03-31 Youenn Fablet <youenn@apple.com>
Fix memory leak in RealtimeVideoIncomingSource
https://bugs.webkit.org/show_bug.cgi?id=170356
Reviewed by Eric Carlson.
No change of behavior.
* platform/mediastream/mac/RealtimeIncomingVideoSource.cpp:
(WebCore::RealtimeIncomingVideoSource::OnFrame): Adopting the newly created pointer.
2017-03-31 Andy Estes <aestes@apple.com>
REGRESSION (r202472): Data Detection overwrites existing links in detected ranges
https://bugs.webkit.org/show_bug.cgi?id=170365
<rdar://problem/29205721>
Reviewed by Tim Horton.
r202472 changed the node traversal in searchForLinkRemovingExistingDDLinks() to only
consider nodes that are descendants of startNode, but we need to traverse all nodes between
startNode and endNode to find existing non-DD links.
As a result, we'd add a Data Detector link to the following snippet and make the original
links un-clickable:
<a href='#'>tomorrow</a> <a href='#'>night</a>
Fix this by not specifying a stayWithin node when calling NodeTraversal::next(). The loop
will terminate when we reach endNode.
Updated WebKit2.DataDetectionReferenceDate API test.
* editing/cocoa/DataDetection.mm:
(WebCore::searchForLinkRemovingExistingDDLinks):
2017-03-31 Eric Carlson <eric.carlson@apple.com>
Incoming video source doesn't propogate frame rotation
https://bugs.webkit.org/show_bug.cgi?id=170364
Reviewed by Youenn Fablet.
No new tests, the mock video source doesn't support rotation. Test will be added when
this is fixed in https://bugs.webkit.org/show_bug.cgi?id=169822. The changes were
verified manually.
* platform/mediastream/mac/RealtimeIncomingVideoSource.cpp:
(WebCore::RealtimeIncomingVideoSource::OnFrame): Convert frame rotation to sample
orientation and swap width and height when necessary.
(WebCore::RealtimeIncomingVideoSource::processNewSample):
* platform/mediastream/mac/RealtimeIncomingVideoSource.h:
2017-03-31 Chris Dumez <cdumez@apple.com>
Possible null dereference under SourceBuffer::sourceBufferPrivateDidReceiveSample()
https://bugs.webkit.org/show_bug.cgi?id=159639
Reviewed by Eric Carlson.
Add a null check for trackBuffer.description before dereferencing as it seems
it can be null.
* Modules/mediasource/SourceBuffer.cpp:
(WebCore::SourceBuffer::sourceBufferPrivateDidReceiveSample):
2017-03-31 Youenn Fablet <youenn@apple.com>
Fix memory leak in CreateSessionDescriptionObserver::OnSuccess
https://bugs.webkit.org/show_bug.cgi?id=170357
Reviewed by Geoffrey Garen.
No change of behavior.
* Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
(WebCore::LibWebRTCMediaEndpoint::createSessionDescriptionSucceeded): Adopting the raw pointer parameter.
2017-03-31 Fujii Hironori <Hironori.Fujii@sony.com>
[WinCairo] WebCore::PlatformDisplay::terminateEGLDisplay causes a crash in libGLESv2.dll while processing atexit
https://bugs.webkit.org/show_bug.cgi?id=170331
Reviewed by Michael Catanzaro.
WebCore::PlatformDisplay uses atexit to destruct EGL displays
while exiting process. But, when the atexit will be processed,
heap of libGLESv2.dll would be already destructed and causing a
crash on Windows. Do not use atexit for Windows.
AppleWin port does not use PlatformDisplay. Thus, it does not have
this bug.
* platform/graphics/PlatformDisplay.cpp:
(WebCore::PlatformDisplay::initializeEGLDisplay): Do not use atexit for Windows.
(WebCore::PlatformDisplay::shutDownEglDisplays): Added.
* platform/graphics/PlatformDisplay.h: Added a declaration of shutDownEglDisplays.
2017-03-31 Yoav Weiss <yoav@yoav.ws>
Remove PRELOAD_DEBUG related code.
https://bugs.webkit.org/show_bug.cgi?id=170352
Reviewed by Youenn Fablet.
As the PRELOAD_DEBUG related code stopped building and it seems like no one noticed,
it seems safe to assume that we can remove that code. This patch removes it.
No new tests as there's no functional change.
* loader/cache/CachedResourceLoader.cpp:
(WebCore::CachedResourceLoader::preload):
(WebCore::CachedResourceLoader::clearPreloads):
(WebCore::CachedResourceLoader::printPreloadStats): Deleted.
2017-03-31 Brady Eidson <beidson@apple.com>
Clean up the "StorageType" enum.
https://bugs.webkit.org/show_bug.cgi?id=170349
Reviewed by Tim Horton.
- Make this `enum` into an `enum class`
- Add a new type specific for "transient local storage"
No new tests (No behavior change).
* WebCore.xcodeproj/project.pbxproj:
* inspector/InspectorDOMStorageAgent.cpp:
(WebCore::InspectorDOMStorageAgent::didDispatchDOMStorageEvent):
* inspector/InspectorInstrumentation.h:
* loader/EmptyClients.cpp:
* storage/Storage.cpp:
(WebCore::Storage::isDisabledByPrivateBrowsing):
* storage/StorageArea.h:
(): Deleted.
* storage/StorageEventDispatcher.cpp:
(WebCore::StorageEventDispatcher::dispatchSessionStorageEventsToFrames):
(WebCore::StorageEventDispatcher::dispatchLocalStorageEventsToFrames):
* storage/StorageType.h:
(WebCore::isLocalStorage):
2017-03-31 Chris Dumez <cdumez@apple.com>
Unreviewed, Mark "HTML interactive form validation" as done.
It is shipping in Safari 10.1.
* features.json:
2017-03-31 Csaba Osztrogonác <ossy@webkit.org>
Mac cmake buildfix after r214666
https://bugs.webkit.org/show_bug.cgi?id=170342
Unreviewed buildfix.
* PlatformMac.cmake:
* testing/MockPreviewLoaderClient.h:
2017-03-31 Sam Weinig <sam@webkit.org>
Remove unneeded custom constructors include.
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/ios: Removed.
* bindings/js/ios/TouchConstructors.cpp: Removed.
2017-03-31 John Wilander <wilander@apple.com>
Resource Load Statistics: Check if the store exists before clearing it
https://bugs.webkit.org/show_bug.cgi?id=170324
<rdar://problem/31258505>
Reviewed by Brent Fulgham.
No new tests. Added a null check.
* loader/ResourceLoadObserver.cpp:
(WebCore::ResourceLoadObserver::clearInMemoryAndPersistentStore):
Added a null check.
2017-03-31 Romain Bellessort <romain.bellessort@crf.canon.fr>
[Readable Streams API] Implement cloneArrayBuffer in WebCore
https://bugs.webkit.org/show_bug.cgi?id=170008
Reviewed by Youenn Fablet.
Implemented cloneArrayBuffer based on existing structuredCloneArrayBuffer
implementation. The code has been factorized so that both cloneArrayBuffer
and structuredCloneArrayBuffer rely on the same code (which is basically
the previous implementation of structuredCloneArrayBuffer + the ability
to clone only a part of considered buffer).
Added test to check cloneArrayBuffer behaviour.
* Modules/streams/ReadableByteStreamInternals.js: Deleted cloneArrayBuffer JS implementation.
* bindings/js/JSDOMGlobalObject.cpp:
(WebCore::JSDOMGlobalObject::addBuiltinGlobals): Add cloneArrayBuffer private declaration.
* bindings/js/StructuredClone.cpp:
(WebCore::cloneArrayBufferImpl): Added (mostly based on previous structuredCloneArrayBuffer).
(WebCore::cloneArrayBuffer): Added.
(WebCore::structuredCloneArrayBuffer): Updated.
* bindings/js/StructuredClone.h: Added cloneArrayBuffer declaration.
* bindings/js/WebCoreBuiltinNames.h: Added cloneArrayBuffer declaration.
* testing/Internals.cpp: Added support for testing cloneArrayBuffer.
* testing/Internals.h: Added support for testing cloneArrayBuffer.
* testing/Internals.idl: Added support for testing cloneArrayBuffer.
2017-03-31 Antoine Quint <graouts@apple.com>
[mac-wk1] LayoutTest media/modern-media-controls/airplay-button/airplay-button.html is a flaky timeout
https://bugs.webkit.org/show_bug.cgi?id=168409
<rdar://problem/30799198>
Unreviewed. Yet more logging to determine under what circumstance ScriptedAnimationController gets suspended.
* dom/Document.cpp:
(WebCore::Document::requestAnimationFrame):
2017-03-30 Zan Dobersek <zdobersek@igalia.com>
Unreviewed GTK+ build fix. Add missing ANGLE build targets
to the build.
* CMakeLists.txt:
2017-03-30 Simon Fraser <simon.fraser@apple.com>
Ensure that Node::willBeDeletedFrom() always removes touch event handlers from the document
https://bugs.webkit.org/show_bug.cgi?id=170323
rdar://problem/23647630
Reviewed by Chris Dumez.
There are two instances where nodes are registered as touch event handlers without
having normal touch event listeners: slider thumb elements, and elements with overflow scrolling,
on iOS.
For such nodes, hasEventTargetData() will be false, but we want to ensure
that they are removed from the Document's touchEventHandler set, so move the
call to document.removeTouchEventHandler() outside of the conditional block.
This should be cheap in most cases when the touchEventHandler is empty.
* dom/Node.cpp:
(WebCore::Node::willBeDeletedFrom):
2017-03-30 Simon Fraser <simon.fraser@apple.com>
Minor cleanup checking for gesture event names
https://bugs.webkit.org/show_bug.cgi?id=170319
Reviewed by Tim Horton.
Just use isGestureEventType() in a couple of places.
* dom/Node.cpp:
(WebCore::tryAddEventListener):
(WebCore::tryRemoveEventListener):
2017-03-30 Simon Fraser <simon.fraser@apple.com>
Rename a touch event function, and new touch region test results
https://bugs.webkit.org/show_bug.cgi?id=170309
rdar://problem/31329520
Reviewed by Chris Dumez.
Adapt to a naming change in WebKitAdditions.
* dom/Document.cpp:
(WebCore::Document::removeAllEventListeners):
* page/FrameView.cpp:
(WebCore::FrameView::layout):
* rendering/RenderElement.cpp:
(WebCore::RenderElement::styleWillChange):
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::scrollTo):
(WebCore::RenderLayer::calculateClipRects):
2017-03-30 Matt Rajca <mrajca@apple.com>
YouTube sometimes does not respect "user gesture" restriction for videos.
https://bugs.webkit.org/show_bug.cgi?id=170297
I discovered a code path that does not honor the "user gesture" requirement and playback is able to begin
even though we have a restriction in place. When using Media Source Extensions, which YouTube does, we transition
from a "Have Metadata" to a "Future Data" state that causes playback to begin, however, we never check
if we have a playback restriction in place.
Reviewed by Eric Carlson.
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::setReadyState):
2017-03-30 Said Abou-Hallawa <sabouhallawa@apple.com>
REGRESSION (r213764): Background image from sprite sheet incorrectly scaled
https://bugs.webkit.org/show_bug.cgi?id=169547
Reviewed by Simon Fraser.
The bug happens when drawing only a rectangle of an image not the whole
image. In BitmapImage::draw(), sizeForDrawing was calculated as the destRect
scaled by the transformation which is applied to the GraphicsContext. Two
problems with this approach. The first one is destRect can be only part of
the image. The second problem is, the ratio destRect / srcRect is another
scaling that needs to be considered.
To fix this issue, first the base size has to be size of the image and not
destRect.size(). Secondly, we need to scale this base size with the context
transformation multiplied by the ratio destRect / srcRect. This scaling is
exactly the same scaling which is calculated in subsamplingScale(). Finally
we use this scaled size as the sizeForDrawing to send to the ImageDecoder.
Test: fast/images/sprite-sheet-image-draw.html
* platform/graphics/BitmapImage.cpp:
(WebCore::BitmapImage::draw): Fix the bug.
(WebCore::BitmapImage::stopAnimation): Stops the async image decoding for animated images only.
The decoding for large images will be stopped when BitmapImage::newFrameNativeImageAvailableAtIndex()
is called and the decoding queue is idle.
(WebCore::BitmapImage::newFrameNativeImageAvailableAtIndex): Add image logging.
* platform/graphics/BitmapImage.h: Move sourceURL() to the Image class.
* platform/graphics/GraphicsContext.cpp: Pass imagePaintingOptions.m_decodingMode to Image::drawTiled().
(WebCore::GraphicsContext::drawTiledImage): Pass imagePaintingOptions.m_decodingMode) to Image::drawTiled().
* platform/graphics/Image.cpp:
(WebCore::Image::sourceURL): Moved from BitmapImage.
(WebCore::Image::drawTiled): Add a DecodingMode argument instead of calling always with DecodingMode::Synchronous.
* platform/graphics/Image.h:
* platform/graphics/ImageFrameCache.cpp:
(WebCore::ImageFrameCache::cacheAsyncFrameNativeImageAtIndex): Add image logging.
(WebCore::ImageFrameCache::startAsyncDecodingQueue): Ditto,
(WebCore::ImageFrameCache::requestFrameAsyncDecodingAtIndex): Ditto.
(WebCore::ImageFrameCache::stopAsyncDecodingQueue): Ditto.
(WebCore::ImageFrameCache::sourceURL): A helper function to avoid checking the value of m_image.
* platform/graphics/ImageFrameCache.h:
* platform/graphics/NativeImage.h: Rename subsamplingScale() to nativeImageDrawingScale() and return image scaling instead.
* platform/graphics/cairo/NativeImageCairo.cpp:
(WebCore::nativeImageDrawingScale): Ditto.
(WebCore::subsamplingScale): Deleted.
* platform/graphics/cg/NativeImageCG.cpp:
(WebCore::nativeImageDrawingScale): Ditto.
(WebCore::subsamplingScale): Deleted.
* platform/graphics/win/NativeImageDirect2D.cpp:
(WebCore::nativeImageDrawingScale): Ditto.
(WebCore::subsamplingScale): Deleted.
2017-03-30 Matt Baker <mattbaker@apple.com>
Web Inspector: Assertion failure in InspectorStyleProperty::setRawTextFromStyleDeclaration
https://bugs.webkit.org/show_bug.cgi?id=170279
<rdar://problem/30200492>
Reviewed by David Hyatt.
The SourceRange for a CSSPropertySourceData should be relative to the start
of the declaration body, not the start of the StyleSheetHandler’s parsed
text. This only affected the ranges of unparsed (parsedOK == false) properties
lacking a trailing semi-colon.
This patch doesn't change the behavior of InspectorStyleSheet other than
silencing an irksome assert, as String::substring does a safety check on
the passed in length.
* inspector/InspectorStyleSheet.cpp:
(WebCore::fixUnparsedProperties):
2017-03-30 Youenn Fablet <youenn@apple.com> and Jon Lee <jonlee@apple.com>
Clean up RTCDataChannel
https://bugs.webkit.org/show_bug.cgi?id=169732
Reviewed by Chris Dumez.
Test: webrtc/datachannel/datachannel-event.html
webrtc/datachannel/bufferedAmountLowThreshold.html
Making RTCDataChannel interface closer to the spec updating implementation accordingly.
See https://w3c.github.io/webrtc-pc/#rtcdatachannel.
In particular adding RTCDataChannelEvent constructor, and missing bufferedAmount related attributes.
Doing some additional cleaning refactoring.
Making bufferedAmountIsDecreasing take a bufferedAmount argument so that we get the actual value passed by
libwebrtc without needing to get it from the libwebrtc network thread again.
In the future, we should store the bufferedAmount value in RTCDataChannel and update its value on each libwebrtc
OnBufferedAmountChange. Special treatment may be needed when the data channel is closed, in which case the bufferedAmount should just be
updated to increase in the send method.
Added some FIXMEs as RTCDataChannel is not aligned with the spec related to send and bufferedAmount.
* Modules/mediastream/RTCDataChannel.cpp:
(WebCore::RTCDataChannel::send):
(WebCore::RTCDataChannel::close):
(WebCore::RTCDataChannel::didChangeReadyState):
(WebCore::RTCDataChannel::bufferedAmountIsDecreasing):
* Modules/mediastream/RTCDataChannel.h:
* Modules/mediastream/RTCDataChannel.idl:
* Modules/mediastream/RTCDataChannelEvent.cpp:
(WebCore::RTCDataChannelEvent::create):
(WebCore::RTCDataChannelEvent::RTCDataChannelEvent):
(WebCore::RTCDataChannelEvent::channel):
* Modules/mediastream/RTCDataChannelEvent.h:
* Modules/mediastream/RTCDataChannelEvent.idl:
* Modules/mediastream/RTCPeerConnection.idl:
* Modules/mediastream/libwebrtc/LibWebRTCDataChannelHandler.cpp:
(WebCore::LibWebRTCDataChannelHandler::OnStateChange):
* Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
(WebCore::LibWebRTCMediaEndpoint::addDataChannel):
* WebCore.xcodeproj/project.pbxproj:
* dom/EventNames.h:
* platform/mediastream/RTCDataChannelHandler.h:
* platform/mediastream/RTCDataChannelHandlerClient.h:
* platform/mediastream/RTCDataChannelState.h: Added.
* platform/mediastream/RTCPeerConnectionHandlerClient.h:
* platform/mock/RTCDataChannelHandlerMock.cpp:
(WebCore::RTCDataChannelHandlerMock::setClient):
(WebCore::RTCDataChannelHandlerMock::close):
* platform/mock/RTCNotifiersMock.cpp:
(WebCore::IceConnectionNotifier::IceConnectionNotifier):
(WebCore::SignalingStateNotifier::SignalingStateNotifier):
(WebCore::DataChannelStateNotifier::DataChannelStateNotifier):
* platform/mock/RTCNotifiersMock.h:
2017-03-30 Javier Fernandez <jfernandez@igalia.com>
[css-align] Adapt content-alignment properties to the new baseline syntax
https://bugs.webkit.org/show_bug.cgi?id=170262
Reviewed by David Hyatt.
The baseline-position syntax has changed recently, so we need to update
the CSS properties using the old syntax. This patch address only the
content-alignment (align-content and justify-content).
I used this patch to adapt the implementation of the parsing logic for
these properties to the new Blink's CSS Parsing Design.
The new baseline syntax is "[first | last ]? baseline" which implies
modifying the parsing and computed value logic.
There are several layout tests affected by this change, so I'll update
them accordingly.
No new tests, just added/modified some cases to the tests we
already have using the new baseline values.
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::valueForContentPositionAndDistributionWithOverflowAlignment):
* css/CSSContentDistributionValue.cpp:
(WebCore::CSSContentDistributionValue::customCSSText):
* css/CSSPrimitiveValueMappings.h:
(WebCore::CSSPrimitiveValue::operator ItemPosition):
(WebCore::CSSPrimitiveValue::operator ContentPosition):
* css/CSSValueKeywords.in:
* css/parser/CSSPropertyParser.cpp:
(WebCore::isBaselineKeyword):
(WebCore::consumeBaselineKeyword):
(WebCore::consumeContentDistributionOverflowPosition):
(WebCore::consumeSelfPositionOverflowPosition):
2017-03-30 James Craig <jcraig@apple.com>
AX: Expose a new AXSubrole for explicit ARIA "group" role
https://bugs.webkit.org/show_bug.cgi?id=169810
<rdar://problem/31039693>
Reviewed by Chris Fleizach.
Split GroupRole into generics (GroupRole) and explicit groups
(ApplicationGroupRole) so we can expose a subrole on the explicit
groups. Account for the change in ARIA Tree and Menu hierachies.
Update the computedRoleValue for WebKit Inspector usage, too.
Updated existing tests.
Test: accessibility/list-detection2.html:
Test: accessibility/roles-computedRoleString.html:
Test: inspector/dom/getAccessibilityPropertiesForNode.html:
Test: inspector/dom/highlightFrame.html:
Test: inspector/dom/highlightSelector.html:
* accessibility/AccessibilityNodeObject.cpp:
(WebCore::AccessibilityNodeObject::helpText):
(WebCore::AccessibilityNodeObject::hierarchicalLevel):
(WebCore::AccessibilityNodeObject::remapAriaRoleDueToParent):
* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::accessibleNameDerivesFromContent):
(WebCore::AccessibilityObject::ariaTreeItemContent):
(WebCore::initializeRoleMap):
(WebCore::AccessibilityObject::computedRoleString):
* accessibility/AccessibilityObject.h:
* accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
(atkRole):
* accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
(-[WebAccessibilityObjectWrapper determineIsAccessibilityElement]):
* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(createAccessibilityRoleMap):
(-[WebAccessibilityObjectWrapper subrole]):
2017-03-30 Chris Dumez <cdumez@apple.com>
We are spending a lot of time bzero'ing AudioChannel buffers on uni-watch.com
https://bugs.webkit.org/show_bug.cgi?id=170288
<rdar://problem/31289132>
Reviewed by Eric Carlson.
We are spending a lot of time bzero'ing AudioChannel buffers on uni-watch.com due
to doubleclick ads using WebAudio with a 0-gain GainNode. We should optimize the
0-gain case as much as possible.
No new tests, only an optimization.
* Modules/webaudio/AudioNode.cpp:
(WebCore::AudioNode::processIfNecessary):
Drop call to unsilenceOutputs() before calling AudioNode::process(). The AudioChannel
API already takes care of clearing its 'silent' flag whenever its buffer changes so
there should be no need to explicitly clearing the 'silent' flag before calling
process(). This was causing us to zero out buffers that were already filled with
zeros because AudioChannel::zero() would no longer return early, not knowing the
channel is already silent. This reduces the number of bzero() calls by ~3.5x on
uni-watch.com (from 100 calls every ~20ms to 100 calls every ~70ms.
* Modules/webaudio/AudioNode.h:
* platform/audio/mac/AudioDestinationMac.cpp:
(WebCore::AudioDestinationMac::render):
Avoid clamping the values in the channel buffer if the channel is silent since this
will have no effect (given that the buffer only contains zeros).
2017-03-30 Eric Carlson <eric.carlson@apple.com>
[Crash] WebCore::AudioBuffer::AudioBuffer don't checking illegal value
https://bugs.webkit.org/show_bug.cgi?id=169956
Reviewed by Youenn Fablet.
Test: webaudio/audiobuffer-crash.html
* Modules/webaudio/AudioBuffer.cpp:
(WebCore::AudioBuffer::AudioBuffer): Invalidate the object and return early if the channel
array allocation fails.
(WebCore::AudioBuffer::AudioBuffer): Ditto.
(WebCore::AudioBuffer::invalidate): Invalidate the object.
* Modules/webaudio/AudioBuffer.h:
2017-03-30 Antoine Quint <graouts@apple.com>
[mac-wk1] LayoutTest media/modern-media-controls/airplay-button/airplay-button.html is a flaky timeout
https://bugs.webkit.org/show_bug.cgi?id=168409
<rdar://problem/30799198>
Unreview. Print the backtrace when we suspend scripted animations.
* page/Page.cpp:
(WebCore::Page::suspendScriptedAnimations):
2017-03-30 Antoine Quint <graouts@apple.com>
[mac-wk1] LayoutTest media/modern-media-controls/airplay-button/airplay-button.html is a flaky timeout
https://bugs.webkit.org/show_bug.cgi?id=168409
<rdar://problem/30799198>
Unreview. Pring the backtrace when we suspend ScriptedAnimationController.
* dom/ScriptedAnimationController.cpp:
(WebCore::ScriptedAnimationController::suspend):
2017-03-30 Antoine Quint <graouts@apple.com>
[Modern Media Controls] Invalid placard icon is not visible for short video
https://bugs.webkit.org/show_bug.cgi?id=170277
<rdar://problem/31327955>
Reviewed by Eric Carlson.
Make the minimum dimension needed to display a placard icon configurable and let the
invalid placard use a 50pt dimension. We also make a drive-by fix to reset "text-align"
for media controls as having a "text-align: center" inherited value would mess up
positioning of the placard icon and make it flush to the right of the placard.
Test: media/modern-media-controls/invalid-placard/invalid-placard-constrained-metrics.html
* Modules/modern-media-controls/controls/invalid-placard.js:
(InvalidPlacard):
* Modules/modern-media-controls/controls/media-controls.css:
(.media-controls):
* Modules/modern-media-controls/controls/placard.js:
(Placard.prototype.layout):
2017-03-30 Zan Dobersek <zdobersek@igalia.com>
[GCrypt] Register missing algorithms in CryptoAlgorithmRegistry::platformRegisterAlgoritmhs()
https://bugs.webkit.org/show_bug.cgi?id=170273
Reviewed by Michael Catanzaro.
* crypto/gcrypt/CryptoAlgorithmRegistryGCrypt.cpp:
(WebCore::CryptoAlgorithmRegistry::platformRegisterAlgorithms):
Add registerAlgorithm<> calls for AES_CFB, AES_GCM, ECDH and
PBKDF2 algorithms.
2017-03-30 Brent Fulgham <bfulgham@apple.com>
Remove unused MediaControlsApple implementation
https://bugs.webkit.org/show_bug.cgi?id=170258
<rdar://problem/31331056>
Reviewed by Eric Carlson.
Remove dead code related to old media controls. We switched to HTML5-based media controls
several years ago.
No new tests. Removing this dead code should have no change in behavior.
* WebCore.xcodeproj/project.pbxproj: Remove unused files.
* dom/EventListener.h: Remove unused event type.
* html/shadow/MediaControlsApple.cpp: Removed.
* html/shadow/MediaControlsApple.h: Removed.
2017-03-30 Fujii Hironori <Hironori.Fujii@sony.com>
[WinCairo] ImageCairoWin.cpp: error C2660: 'WebCore::BitmapImage::draw': function does not take 6 arguments
https://bugs.webkit.org/show_bug.cgi?id=170275
Reviewed by Said Abou-Hallawa.
Apply the similar change of ImageCGWin.cpp of r214450 to ImageCairoWin.cpp.
* platform/graphics/win/ImageCairoWin.cpp:
(WebCore::BitmapImage::getHBITMAPOfSize): Pass DecodingMode::Synchronous to Image::draw().
(WebCore::BitmapImage::drawFrameMatchingSourceSize): Ditto.
2017-03-27 Sergio Villar Senin <svillar@igalia.com>
[css-grid] Clamp the number of autorepeat tracks
https://bugs.webkit.org/show_bug.cgi?id=170120
Reviewed by Manuel Rego Casasnovas.
As suggested by the specs we do clamp the maximum number of tracks per grid in order to
minimize potential OOM situations. However we were not considering the case of the recently
added auto repeat syntax. Abnormally huge values for the width/height on the grid container
could lead to a number of auto repeat tracks higher than the maximum.
A new API was added to Internals in order to test limits without having to create huge
grids. This new API allows clients to set an arbitrary limit to the number of tracks. The
addition of this new API forced us to add GridPosition.cpp to the project to define the
global variable we use for testing. We took the chance to move part of the implementation
from the header file to the source file.
Last but not least, several new ASSERTs were added to Grid.cpp implementation to ensure that
we do not surpass the grid track limits.
Test: fast/css-grid-layout/grid-auto-repeat-huge-grid.html
* CMakeLists.txt:
* WebCore.xcodeproj/project.pbxproj:
* css/parser/CSSPropertyParser.cpp:
(WebCore::consumeGridTrackRepeatFunction):
* rendering/Grid.cpp:
(WebCore::Grid::ensureGridSize): Added ASSERT.
(WebCore::Grid::setSmallestTracksStart): Ditto.
(WebCore::Grid::setAutoRepeatTracks): Ditto.
(WebCore::Grid::setAutoRepeatEmptyColumns): Ditto.
(WebCore::Grid::setAutoRepeatEmptyRows): Ditto.
* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::clampAutoRepeatTracks): New method.
(WebCore::RenderGrid::placeItemsOnGrid): Clamp the number of auto repeat tracks before
passing them to the Grid.
* rendering/RenderGrid.h:
* rendering/style/GridArea.h:
(WebCore::GridSpan::GridSpan):
* rendering/style/GridPosition.cpp: Added.
(WebCore::GridPosition::setExplicitPosition):
(WebCore::GridPosition::setAutoPosition):
(WebCore::GridPosition::setSpanPosition):
(WebCore::GridPosition::setNamedGridArea):
(WebCore::GridPosition::integerPosition):
(WebCore::GridPosition::namedGridLine):
(WebCore::GridPosition::spanPosition):
(WebCore::GridPosition::operator==):
* rendering/style/GridPosition.h:
(WebCore::GridPosition::shouldBeResolvedAgainstOppositePosition):
(WebCore::GridPosition::max):
(WebCore::GridPosition::min):
(WebCore::GridPosition::setMaxPositionForTesting):
(WebCore::GridPosition::setExplicitPosition): Deleted.
(WebCore::GridPosition::setAutoPosition): Deleted.
(WebCore::GridPosition::setSpanPosition): Deleted.
(WebCore::GridPosition::setNamedGridArea): Deleted.
(WebCore::GridPosition::integerPosition): Deleted.
(WebCore::GridPosition::namedGridLine): Deleted.
(WebCore::GridPosition::spanPosition): Deleted.
(WebCore::GridPosition::operator==): Deleted.
* rendering/style/GridPositionsResolver.cpp:
(WebCore::GridPositionsResolver::explicitGridColumnCount):
(WebCore::GridPositionsResolver::explicitGridRowCount):
* testing/Internals.cpp:
(WebCore::Internals::setGridMaxTracksLimit):
* testing/Internals.h:
* testing/Internals.idl:
2017-03-29 Ryosuke Niwa <rniwa@webkit.org>
Disconnecting a HTMLObjectElement does not always unload its content document
https://bugs.webkit.org/show_bug.cgi?id=169606
Reviewed by Andy Estes.
When removing a node, we first disconnect all subframes then update the focused element as we remove each child.
However, when the removed element is a focused object element with a content document, removeFocusedNodeOfSubtree
can update the style tree synchronously inside Document::setFocusedElement, and reload the document.
Avoid this by instantiating a SubframeLoadingDisabler on the parent of the focused element.
Test: fast/dom/removing-focused-object-element.html
* dom/Document.cpp:
(WebCore::Document::removeFocusedNodeOfSubtree):
2017-03-29 Myles C. Maxfield <mmaxfield@apple.com>
Migrate to kCTFontCSSWidthAttribute
https://bugs.webkit.org/show_bug.cgi?id=170265
Reviewed by Darin Adler.
Previously, we were mapping from Core Text widths to CSS widths in WebKit.
However, on some OSes, Core Text can directly tell us what the CSS width
value is.
No new tests because there is no behavior change.
* platform/graphics/cocoa/FontCacheCoreText.cpp:
(WebCore::getCSSAttribute):
(WebCore::capabilitiesForFontDescriptor):
* platform/spi/cocoa/CoreTextSPI.h:
2017-03-28 Simon Fraser <simon.fraser@apple.com>
Make it possible to dump touch event regions for testing
https://bugs.webkit.org/show_bug.cgi?id=170209
<rdar://problem/31309258>
Reviewed by Tim Horton.
Expose internals.touchEventRectsForEvent() and internals.passiveTouchEventListenerRects(), which
fetch data via Page.
Because the regions are normally updated on a timer, we have to force an eager update via Document::updateTouchEventRegions().
Test: fast/events/touch/ios/touch-event-regions.html
* page/Page.cpp:
(WebCore::Page::nonFastScrollableRects):
(WebCore::Page::touchEventRectsForEvent):
(WebCore::Page::passiveTouchEventListenerRects):
* page/Page.h:
* testing/Internals.cpp:
(WebCore::Internals::touchEventRectsForEvent):
(WebCore::Internals::passiveTouchEventListenerRects):
* testing/Internals.h:
* testing/Internals.idl:
2017-03-29 Zalan Bujtas <zalan@apple.com>
RenderBlockFlow::addFloatsToNewParent should check if float is already added to the object list.
https://bugs.webkit.org/show_bug.cgi?id=170259
<rdar://problem/31300584>
Reviewed by Simon Fraser.
r210145 assumed that m_floatingObjects would simply ignore the floating box if it was already in the list.
Test: fast/block/float/placing-multiple-floats-crash.html
* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::addFloatsToNewParent):
2017-03-29 Myles C. Maxfield <mmaxfield@apple.com>
Try to normalize variation ranges
https://bugs.webkit.org/show_bug.cgi?id=170119
Unreviewed.
Addressing post-review comment.
* platform/graphics/cocoa/FontCacheCoreText.cpp:
(WebCore::isGXVariableFont):
2017-03-29 Myles C. Maxfield <mmaxfield@apple.com>
Try to normalize variation ranges
https://bugs.webkit.org/show_bug.cgi?id=170119
Reviewed by Simon Fraser.
TrueType GX-style variation fonts use one particular scale for values on their
weight/width/slope axes - usually the values lie between -1 and 1 on that scale.
However, OpenType 1.8-style fonts use the CSS scale for values on these axes.
For the purposes of font selection, these values need to lie on the same scale.
However, when font selection is completed and the variation values are actually
being applied to the fonts, values which lie on the font's actual scale need to
be applied. This patch adds normalize*() and denormalize*() functions to perform
both of these operations.
The conversion itself between the two scales isn't an exact mapping. Mapping
slope is just a linear relationship with 0deg <=> 0 and 20deg <=> 1 (as per the
CSS Fonts spec). Mapping widths is similar, it uses a 2-component piecewise
linear relationship which includes the values given in the Microsoft OpenType
spec for the OS/2 table's usWidthClass field. Weights are more difficult, so I
plotted the CSS weights and the GX-style weights for every style of San
Francisco, saw that the relationship appears to be linear, and ran a linear
regression to compute the line equation.
As for the actual discrimination of determining whether a font is a GX-style
font or not, we can use the presence of the 'STAT' table. This table didn't
exist when GX fonts were being created, and OpenType 1.8 variable fonts are
required to have this table.
Facebook uses the string ".SFNSText" in their @font-face blocks. This font is
a variation font, but uses the GX-style values. Facebook asks us to create
this font with a weight of 700, and because the values in the font are around
1.0, we were erroneously thinking that the font wasn't bold, so we were then
applying synthetic bold. This was causing text on facebook to look fuzzy and
ugly.
Test: fast/text/variations/font-selection-properties-expected.html
* platform/graphics/cocoa/FontCacheCoreText.cpp:
(WebCore::isGXVariableFont):
(WebCore::normalizeWeight):
(WebCore::normalizeSlope):
(WebCore::denormalizeWeight):
(WebCore::denormalizeWidth):
(WebCore::denormalizeSlope):
(WebCore::normalizeWidth):
(WebCore::preparePlatformFont): Instead of using FontSelectionValues for the
intermediate values, we should use floats instead. This is because
FontSelectionValues are fixed-point numbers with the denominator having 2 bits.
When using this data type to represent values on the GX scale, which are usually
between 0 and 1, you lose a lot of fidelity. Instead, our intermediate
calculations should be done with floats, and converted to FontSelectionValues at
the end when they are representative of values on the CSS scale.
(WebCore::stretchFromCoreTextTraits):
(WebCore::fontWeightFromCoreText):
(WebCore::extractVariationBounds):
(WebCore::variationCapabilitiesForFontDescriptor):
(WebCore::capabilitiesForFontDescriptor):
2017-03-29 Saam Barati <sbarati@apple.com>
LinkBuffer and ExecutableAllocator shouldn't have anything to do with VM
https://bugs.webkit.org/show_bug.cgi?id=170210
Reviewed by Mark Lam.
* cssjit/SelectorCompiler.cpp:
(WebCore::SelectorCompiler::compileSelector):
(WebCore::SelectorCompiler::SelectorCodeGenerator::compile):
2017-03-29 Javier Fernandez <jfernandez@igalia.com>
[css-align] Adapt self-alignment properties to the new baseline syntax
https://bugs.webkit.org/show_bug.cgi?id=170235
Reviewed by David Hyatt.
The baseline-position syntax has changed recently, so we need to update
the CSS properties using the old syntax. This patch address only the
self-alignment (align-self and justify-self) and default-alignment
(align-items and justify-items).
The content-distribution properties (align-content and justify-content)
will be updated in a follow up patch.
The new baseline syntax is "[first | last ]? baseline" which implies
modifying the parsing and computed value logic.
There are several layout tests affected by this change, so I'll update
them accordingly.
No new tests, just added/modified some cases to the tests we already have using the new baseline values.
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::valueForItemPositionWithOverflowAlignment):
* css/CSSValueKeywords.in:
* css/StyleBuilderConverter.h:
(WebCore::StyleBuilderConverter::convertSelfOrDefaultAlignmentData):
* css/parser/CSSPropertyParser.cpp:
(WebCore::consumeBaselineKeyword):
(WebCore::consumeSelfPositionOverflowPosition):
2017-03-29 Chris Dumez <cdumez@apple.com>
Animated SVG images are not paused in pages loaded in the background
https://bugs.webkit.org/show_bug.cgi?id=170043
<rdar://problem/31234412>
Reviewed by Simon Fraser.
Animated SVG images are not paused in pages loaded in the background. We rely
on FrameView::isOffscreen() to stop images animations in background tab (See
logic in RenderElement's shouldRepaintForImageAnimation()). This works fine
if a tab is visble and then becomes hidden (i.e. by switching to another
tab). However, in the case where the tab gets loaded while in the background
(e.g. opening link in new background tab, or session restore), then the
animations would not be paused, due to FrameView::isOffscreen() erroneously
returning false in this case.
Normally, the following chain of events happens:
- Page is visible, we construct a main frame and its FrameView for loading
the page. When a FrameView is constructed, we call FrameView::show() to
make it visible. Then, if the page becomes non-visible, we call
Page::setIsVisibleInternal(false) which calls FrameView::hide(). After
that, FrameView::isOffscreen() correctly returns true because we properly
called FrameView::hide().
However, when doing a load while the Page is hidden, the following was
happening:
- Page is not visible, we call Page::setIsVisibleInternal(false) which tries
to call FrameView::hide() for the main frame but it does not have a FrameView
yet (because the load has not started). We start the load and end up creating
a FrameView. The FrameView constructor was calling FrameView::show()
unconditionally, thus making the FrameView think is visible, even though its
page isn't. At this point, FrameView::isOffscreen() was returning false
and animations would keep running, even though the page is not visible.
To address the issue, we now call FrameView::show() in FrameView::create() only
if the Page is actually visible, instead of calling it unconditionally. If the
page ever becomes visible, Page::setIsVisibleInternal(true) will be called and
it will take care of calling FrameView::show() then.
Tests: svg/animations/animations-paused-in-background-page-iframe.html
svg/animations/animations-paused-in-background-page.html
* page/FrameView.cpp:
(WebCore::FrameView::create):
2017-03-29 Wenson Hsieh <wenson_hsieh@apple.com>
Links with empty hrefs should not be drag sources
https://bugs.webkit.org/show_bug.cgi?id=170241
<rdar://problem/31305505>
Reviewed by Tim Horton.
The m_dragSouceAction member of DragController represents the drag source actions that are available to the
document, rather than the available actions given the dragging element. Thus, it is not correct to only check
that (m_dragSourceAction & DragSourceActionAttachment) before proceeding down the attachment dragging codepath.
This should be additionally guarded with a check that the element being dragged is, in fact, an attachment
element.
New API test (see Tools/ChangeLog).
* page/DragController.cpp:
(WebCore::DragController::startDrag):
2017-03-29 Jeremy Jones <jeremyj@apple.com>
WebVideoFullscreenInterfaceAVKit needs a strong self ref before dispatching to the main thread.
https://bugs.webkit.org/show_bug.cgi?id=170129
Reviewed by David Kilzer.
No new tests becuase no new behavior.
Hold a strong reference to WebVideoFullscreenInterfaceAVKit when dispatching to the main thread.
Make WebVideoFullscreenInterfaceAVKit safe to retain from non-main thread.
* platform/ios/WebVideoFullscreenInterfaceAVKit.h:
* platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
(WebVideoFullscreenInterfaceAVKit::exitFullscreen):
2017-03-29 Zan Dobersek <zdobersek@igalia.com>
[GCrypt] Add a Handle<> class to help with GCrypt object lifetime control
https://bugs.webkit.org/show_bug.cgi?id=170238
Reviewed by Michael Catanzaro.
The platform-specific CryptoAlgorithmHMAC implementation is modified
to showcase the GCrypt::Handle<> use. HandleDeleter<gcry_mac_hd_t>
is added accordingly.
* crypto/gcrypt/CryptoAlgorithmHMACGCrypt.cpp:
(WebCore::calculateSignature):
2017-03-29 Myles C. Maxfield <mmaxfield@apple.com>
Variation fonts: Make sure that feature detection and preprocessor macros are right
https://bugs.webkit.org/show_bug.cgi?id=169518
Reviewed by Simon Fraser.
When I added variable fonts support, I made all OSes parse the newly accepted values,
instead of just the OSes which support variable fonts.
Test: fast/text/font-variations-feature-detection.html
* css/parser/CSSPropertyParser.cpp:
(WebCore::consumeFontStretch):
(WebCore::consumeFontStyle):
* css/parser/CSSPropertyParserHelpers.cpp:
(WebCore::CSSPropertyParserHelpers::divisibleBy100):
(WebCore::CSSPropertyParserHelpers::consumeFontWeightNumber):
2017-03-29 Antoine Quint <graouts@apple.com>
[Modern Media Controls] Controls bar may disappear while captions menu is visible (redux)
https://bugs.webkit.org/show_bug.cgi?id=170239
<rdar://problem/31320685>
Reviewed by Dean Jackson.
We did some work in webkit.org/b/168751 to prevent the controls bar from disappearing while the
captions menu is visible. But there were two cases where the behavior was not as intended:
1. the controls bar would hide upon exiting the video.
2. clicking on the controls bar while the caption panel is up would hide the controls bar
as well as the captions panel.
Instead of determining that the "userInteractionEnabled" property being set to "false" is indicative
of secondary UI, such as the tracks panel, being attached to the controls bar, we now have an
explicit property to specify this. Now, when "hasSecondaryUIAttached" is "true", we prevent the
controls bar from fading when exiting the media.
Additionally, when dismissing the tracks panel, we check whether a mouse event lead to this and check
if the mouse was positioned over the controls bar. If that is the case, we no longer hide the controls
bar and only dismiss the tracks panel.
Test: media/modern-media-controls/tracks-panel/tracks-panel-controls-bar-remains-visible-after-clicking-over-it.html
* Modules/modern-media-controls/controls/controls-bar.js:
(ControlsBar.prototype.set userInteractionEnabled):
(ControlsBar.prototype.handleEvent):
(ControlsBar.prototype._autoHideTimerFired):
* Modules/modern-media-controls/controls/macos-media-controls.js:
(MacOSMediaControls.prototype.showTracksPanel):
(MacOSMediaControls.prototype.hideTracksPanel):
2017-03-29 Antoine Quint <graouts@apple.com>
[Modern Media Controls] Volume slider is initially empty
https://bugs.webkit.org/show_bug.cgi?id=170237
<rdar://problem/31319077>
Reviewed by Dean Jackson.
Fixing fallout from https://bugs.webkit.org/show_bug.cgi?id=167935 where we changed the behavior
of layout() to happen prior to a commit. In this one instance, we were overriding layout() to run
after a commit, so we now override commit(). Otherwise, the <canvas> that we draw the volume slider
into would have its "width" and "height" properties set after we drew, which would clear the <canvas>.
* Modules/modern-media-controls/controls/slider.js:
(Slider.prototype.commit):
(Slider.prototype.layout): Deleted.
2017-03-29 Zan Dobersek <zdobersek@igalia.com>
[GCrypt] Move over empty GnuTLS-based SUBTLE_CRYPTO implementation files
https://bugs.webkit.org/show_bug.cgi?id=170232
Reviewed by Michael Catanzaro.
Migrate the GnuTLS SUBTLE_CRYPTO implementation files to the gcrypt/
directory. The implementation files themselves are no-op, so this is
a simple move-and-rename operation that will enable proceeding with
the libgcrypt-based implementation of SUBTLE_CRYPTO functionality.
No change in behavior. The SUBTLE_CRYPTO feature should build as it
did before, and the implementations are empty anyway.
* PlatformGTK.cmake:
* crypto/gcrypt/CryptoAlgorithmAES_CBCGCrypt.cpp: Renamed from Source/WebCore/crypto/gnutls/CryptoAlgorithmAES_CBCGnuTLS.cpp.
* crypto/gcrypt/CryptoAlgorithmAES_CFBGCrypt.cpp: Renamed from Source/WebCore/crypto/gnutls/CryptoAlgorithmAES_CFBGnuTLS.cpp.
* crypto/gcrypt/CryptoAlgorithmAES_GCMGCrypt.cpp: Renamed from Source/WebCore/crypto/gnutls/CryptoAlgorithmAES_GCMGnuTLS.cpp.
* crypto/gcrypt/CryptoAlgorithmAES_KWGCrypt.cpp: Renamed from Source/WebCore/crypto/gnutls/CryptoAlgorithmAES_KWGnuTLS.cpp.
* crypto/gcrypt/CryptoAlgorithmECDHGCrypt.cpp: Renamed from Source/WebCore/crypto/gnutls/CryptoAlgorithmECDHGnuTLS.cpp.
* crypto/gcrypt/CryptoAlgorithmPBKDF2GCrypt.cpp: Renamed from Source/WebCore/crypto/gnutls/CryptoAlgorithmPBKDF2GnuTLS.cpp.
* crypto/gcrypt/CryptoAlgorithmRSAES_PKCS1_v1_5GCrypt.cpp: Renamed from Source/WebCore/crypto/gnutls/CryptoAlgorithmRSAES_PKCS1_v1_5GnuTLS.cpp.
* crypto/gcrypt/CryptoAlgorithmRSASSA_PKCS1_v1_5GCrypt.cpp: This one already exists.
* crypto/gcrypt/CryptoAlgorithmRSA_OAEPGCrypt.cpp: Renamed from Source/WebCore/crypto/gnutls/CryptoAlgorithmRSA_OAEPGnuTLS.cpp.
* crypto/gcrypt/CryptoAlgorithmRegistryGCrypt.cpp: Renamed from Source/WebCore/crypto/gnutls/CryptoAlgorithmRegistryGnuTLS.cpp.
* crypto/gcrypt/CryptoKeyECGCrypt.cpp: Renamed from Source/WebCore/crypto/gnutls/CryptoKeyECGnuTLS.cpp.
* crypto/gcrypt/CryptoKeyRSAGCrypt.cpp: Renamed from Source/WebCore/crypto/gnutls/CryptoKeyRSAGnuTLS.cpp.
* crypto/gcrypt/SerializedCryptoKeyWrapGCrypt.cpp: Renamed from Source/WebCore/crypto/gnutls/SerializedCryptoKeyWrapGnuTLS.cpp.
* crypto/gnutls/CryptoAlgorithmRSASSA_PKCS1_v1_5GnuTLS.cpp: Removed.
2017-03-29 Zan Dobersek <zdobersek@igalia.com>
[GnuTLS] Remove unused CryptoDigestGnuTLS, CryptoAlgorithmHMACGnuTLS implementation files
https://bugs.webkit.org/show_bug.cgi?id=170231
Reviewed by Michael Catanzaro.
* crypto/gnutls/CryptoAlgorithmHMACGnuTLS.cpp: Removed. The GCrypt counterpart
is already in use, and this file wasn't even being built.
2017-03-29 Youenn Fablet <youenn@apple.com>
Move DTMF WebRTC extension behind its own compile flag
https://bugs.webkit.org/show_bug.cgi?id=170226
Reviewed by Eric Carlson.
Moving RTCDTMFSender and RTCDTMFToneChangeEvent behinf a WEB_RTC_DTMF compile flag.
This compile flag is not set on any supported platform yet.
Disabling related test and updated test expectations.
* Modules/mediastream/RTCDTMFSender.cpp:
* Modules/mediastream/RTCDTMFSender.h:
* Modules/mediastream/RTCDTMFSender.idl:
* Modules/mediastream/RTCDTMFToneChangeEvent.cpp:
* Modules/mediastream/RTCDTMFToneChangeEvent.h:
* Modules/mediastream/RTCDTMFToneChangeEvent.idl:
* dom/EventNames.in:
* dom/EventTargetFactory.in:
* platform/mediastream/RTCDTMFSenderHandler.h:
* platform/mediastream/RTCDTMFSenderHandlerClient.h:
2017-03-29 Antoine Quint <graouts@apple.com>
[mac-wk1] LayoutTest media/modern-media-controls/airplay-button/airplay-button.html is a flaky timeout
https://bugs.webkit.org/show_bug.cgi?id=168409
<rdar://problem/30799198>
Reviewed by Dean Jackson.
Add a new internals setting to opt into ScriptedAnimationController logging through DOM events dispatched
through the document. This should allow this flaky test to get information as to why the frame isn't
firing when it times out.
* dom/ScriptedAnimationController.cpp:
(WebCore::ScriptedAnimationController::suspend):
(WebCore::ScriptedAnimationController::resume):
(WebCore::ScriptedAnimationController::addThrottlingReason):
(WebCore::ScriptedAnimationController::removeThrottlingReason):
(WebCore::ScriptedAnimationController::registerCallback):
(WebCore::ScriptedAnimationController::cancelCallback):
(WebCore::ScriptedAnimationController::serviceScriptedAnimations):
(WebCore::ScriptedAnimationController::scheduleAnimation):
(WebCore::ScriptedAnimationController::dispatchLoggingEventIfRequired):
* dom/ScriptedAnimationController.h:
* page/Settings.in:
* testing/InternalSettings.cpp:
(WebCore::InternalSettings::resetToConsistentState):
(WebCore::InternalSettings::shouldDispatchRequestAnimationFrameEvents):
(WebCore::InternalSettings::setShouldDispatchRequestAnimationFrameEvents):
* testing/InternalSettings.h:
* testing/InternalSettings.idl:
2017-03-28 Youenn Fablet <youenn@apple.com>
[WebRTC] After r214441 addIceCandidate no longer accepts an RTCIceCandidateInit dictionary
https://bugs.webkit.org/show_bug.cgi?id=170192
Reviewed by Jon Lee.
Covered by updated tests.
* Modules/mediastream/RTCIceCandidate.idl: Candidate is no longer a required field in RTCIceCandidateInit.
* Modules/mediastream/RTCPeerConnectionInternals.js: Reworking defaultsToNull to handle both undefined and null cases.
2017-03-28 Youenn Fablet <youenn@apple.com>
LibWebRTCProvider should allow setting encoder and decoder factories
https://bugs.webkit.org/show_bug.cgi?id=170212
Reviewed by Eric Carlson.
No change of behavior.
Adding the ability to set encoder/decoder libwebrtc factory getters.
Setting default cocoa factory getters.
* platform/mediastream/libwebrtc/LibWebRTCProvider.cpp:
(WebCore::staticFactoryAndThreads):
(WebCore::initializePeerConnectionFactoryAndThreads):
(WebCore::LibWebRTCProvider::setDecoderFactoryGetter):
(WebCore::LibWebRTCProvider::setEncoderFactoryGetter):
(WebCore::LibWebRTCProvider::setPeerConnectionFactory):
* platform/mediastream/libwebrtc/LibWebRTCProvider.h:
2017-03-27 Brent Fulgham <bfulgham@apple.com>
Only attach Attributes to a given element one time
https://bugs.webkit.org/show_bug.cgi?id=170125
<rdar://problem/31279676>
Reviewed by Chris Dumez.
Attach the attribute node to the Element before calling 'setAttributeInternal', since that method may cause
arbitrary JavaScript events to fire.
Test: fast/dom/Attr/only-attach-attr-once.html
* dom/Element.cpp:
(WebCore::Element::attachAttributeNodeIfNeeded): Added.
(WebCore::Element::setAttributeNode): Use new method. Revise to attach attribute before calling 'setAttributeInternal'.
(WebCore::Element::setAttributeNodeNS): Ditto.
* dom/Element.h:
2017-03-28 Youenn Fablet <youenn@apple.com>
Stop RTCDataChannel when closing page
https://bugs.webkit.org/show_bug.cgi?id=170166
Reviewed by Eric Carlson.
Test: webrtc/datachannel/datachannel-gc.html
Making RTCDataChannel an ActiveDOMObject.
Closing the data channel backend and freeing upon close and stop.
* Modules/mediastream/RTCDataChannel.cpp:
(WebCore::RTCDataChannel::create):
(WebCore::RTCDataChannel::RTCDataChannel):
(WebCore::RTCDataChannel::close):
(WebCore::RTCDataChannel::stop):
* Modules/mediastream/RTCDataChannel.h:
* Modules/mediastream/RTCDataChannel.idl:
* Modules/mediastream/RTCPeerConnection.h:
2017-03-28 Myles C. Maxfield <mmaxfield@apple.com>
Ranges for variation font properties are not enforced
https://bugs.webkit.org/show_bug.cgi?id=169979
Reviewed by David Hyatt.
The spec specifies that:
- Font weights less than or equal to 0, or greater than or equal to 1000 are parse errors
- Font stretch values less than or equal to 0% are parse errors
- Font style values less than or equal to -90deg or greater than or equal to 90deg are parse errors
Test: fast/text/variations/out-of-bounds-selection-properties.html
* css/parser/CSSPropertyParser.cpp:
(WebCore::consumeFontWeightRange):
(WebCore::fontStretchIsWithinRange):
(WebCore::consumeFontStretch):
(WebCore::consumeFontStretchRange):
(WebCore::fontStyleIsWithinRange):
(WebCore::consumeFontStyle):
(WebCore::consumeFontStyleRange):
2017-03-28 Andy Estes <aestes@apple.com>
[iOS] Crash in -[WebPreviewLoader failed] when running http/tests/multipart/policy-ignore-crash.php
https://bugs.webkit.org/show_bug.cgi?id=170197
<rdar://problem/30314067>
Reviewed by Brady Eidson.
If QuickLook conversion fails, we call ResourceLoader::didFail() with the NSError from
QuickLook, which will call back into PreviewLoader::didFail(). We only care about network
failures in PreviewLoader, not conversion failures, so check if
m_finishedLoadingDataIntoConverter is set before continuing (like we do in
PreviewLoader::didFinishLoading()).
Fixes crash in http/tests/multipart/policy-ignore-crash.php.
* loader/ios/PreviewLoader.mm:
(WebCore::PreviewLoader::didFail):
2017-03-28 Chris Dumez <cdumez@apple.com>
Audio indicator is visible on uni-watch.com but there is no audible audio
https://bugs.webkit.org/show_bug.cgi?id=170200
<rdar://problem/31289132>
Reviewed by Eric Carlson.
Cherry-pick the following patch from Blink by <rtoy@chromium.org>:
- https://chromium.googlesource.com/chromium/src.git/+/439de5bb2a31384666db1a0e2dadb2b97d2f3ce4
When the gain of a GainNode is 0 or 1, the operation of the node can
be optimized. When gain = 1, just copy the input to the output. When
gain = 0; just zero out the output. Currently, the input is
multiplied by the gain to produce the output. This just optimizes the
multiplication away for the two special cases.
Also, have the GainNode set the silence hint if the gain is 0.
And fix a bug in processIfNecessary when unsilenceOutputs was causing the
silence hint to be cleared after the node's process method was finished
and may have set the silence hint. The processing should come after
unsilenceOutputs to preserve any hints from processing the node.
* Modules/webaudio/AudioNode.cpp:
(WebCore::AudioNode::processIfNecessary):
* Modules/webaudio/GainNode.cpp:
(WebCore::GainNode::process):
* platform/audio/AudioBus.cpp:
(WebCore::AudioBus::copyWithGainFrom):
2017-03-28 Chris Dumez <cdumez@apple.com>
Animated SVG images are not paused when outside viewport
https://bugs.webkit.org/show_bug.cgi?id=170155
<rdar://problem/31288893>
Reviewed by Antti Koivisto.
Make sure animated SVG images get paused when outside the viewport,
similarly to what was already done for animated GIF images. Also
make sure they are paused when they no longer have any renderers
using them.
Tests: svg/animations/animated-svg-image-outside-viewport-paused.html
svg/animations/animated-svg-image-removed-from-document-paused.html
* loader/cache/CachedImage.cpp:
(WebCore::CachedImage::didAddClient):
Restart the animation whenever a new CachedImage client is added. This
will cause us the re-evaluate if the animation should run. The animation
will pause again if the new renderer is not inside the viewport.
(WebCore::CachedImage::animationAdvanced):
Add a flag to newImageAnimationFrameAvailable() so that the renderers can
let us know if we can pause the animation. Pause the animation if all no
renderer requires it (i.e. they are all outside the viewport, or there
are no renderers).
* loader/cache/CachedImageClient.h:
(WebCore::CachedImageClient::newImageAnimationFrameAvailable):
By default, the CachedImageClients allow pausing. Only renderer will
potentially prevent pausing if they are inside the viewport.
* platform/graphics/BitmapImage.cpp:
(WebCore::BitmapImage::isAnimating):
* platform/graphics/BitmapImage.h:
* platform/graphics/Image.h:
(WebCore::Image::isAnimating):
Add isAnimating() flag on Image for layout testing purposes.
* rendering/RenderElement.cpp:
(WebCore::RenderElement::newImageAnimationFrameAvailable):
Set canPause flag to true if the renderer is not inside the viewport.
(WebCore::RenderElement::repaintForPausedImageAnimationsIfNeeded):
Call startAnimation() if the renderer is now visible to resume SVG
animations. Repainting is enough for GIF animations but not for SVG
animations, we have to explicitly resume them.
* rendering/RenderElement.h:
* rendering/RenderView.cpp:
(WebCore::RenderView::addRendererWithPausedImageAnimations):
(WebCore::RenderView::removeRendererWithPausedImageAnimations):
(WebCore::RenderView::resumePausedImageAnimationsIfNeeded):
* rendering/RenderView.h:
Store CachedImages with the renderers that have paused animations.
This is required for SVG where we need to explicitly resume the
animation on the CachedImage when the renderer becomes visible
again. Having access to the Image will also allow us to do smarter
visibility checks in RenderElement's shouldRepaintForImageAnimation(),
in the future.
* svg/SVGSVGElement.cpp:
(WebCore::SVGSVGElement::hasActiveAnimation):
* svg/SVGSVGElement.h:
Add hasActiveAnimation() method.
* svg/graphics/SVGImage.cpp:
(WebCore::SVGImage::startAnimation):
Check that animations are paused before starting them. This avoid
jumping due to unnecessary calls to rootElement->setCurrentTime(0).
(WebCore::SVGImage::isAnimating):
Add isAnimating() method for layout tests purposes.
* svg/graphics/SVGImage.h:
* svg/graphics/SVGImageClients.h:
Call animationAdvanced() on the observer instead of the generic
changedInRect() when the SVGImage is animating. This way, we go
through the same code path as GIF animations and we end up calling
CachedImage::animationAdvanced() which calls newImageAnimationFrameAvailable()
on RenderElement, which determines if the animation should keep
running or not.
* testing/Internals.cpp:
(WebCore::Internals::isImageAnimating):
* testing/Internals.h:
* testing/Internals.idl:
Add layout testing infrastructure.
2017-03-28 Antti Koivisto <antti@apple.com>
Missing render tree position invalidation when tearing down renderers for display:contents subtree
https://bugs.webkit.org/show_bug.cgi?id=170199
<rdar://problem/31260856>
Reviewed by Zalan Bujtas.
Test: fast/shadow-dom/slot-renderer-teardown.html
* style/RenderTreeUpdater.cpp:
(WebCore::RenderTreeUpdater::updateElementRenderer):
Invalidate the render tree position in case we do a teardown for an element without renderer.
2017-03-28 Ryan Haddad <ryanhaddad@apple.com>
Unreviewed, rolling out r214485.
This change caused LayoutTest crashes.
Reverted changeset:
"Stop RTCDataChannel when closing page"
https://bugs.webkit.org/show_bug.cgi?id=170166
http://trac.webkit.org/changeset/214485
2017-03-28 Anders Carlsson <andersca@apple.com>
ApplePayShippingContactUpdate.idl shouldn't have status field
https://bugs.webkit.org/show_bug.cgi?id=170202
rdar://problem/31307106
Reviewed by Beth Dakin.
* Modules/applepay/ApplePaySession.cpp:
(WebCore::convertAndValidate):
If status isn't set, infer it based on whether there are errors present or not.
* Modules/applepay/ApplePayShippingContactUpdate.h:
Make status optional here; it's still used by the old code path.
* Modules/applepay/ApplePayShippingContactUpdate.idl:
Remove status here.
2017-03-28 Brian Burg <bburg@apple.com>
Web Inspector: Add "Disable Caches" option that only applies to the inspected page while Web Inspector is open
https://bugs.webkit.org/show_bug.cgi?id=169865
<rdar://problem/31250573>
Reviewed by Joseph Pecoraro.
Rewrite the network agent's command for disabling resource caching to use Page::setResourceCachingEnabled.
The old implementation was doing weird stuff like setting no-cache headers and evicting the
contents of the memory cache, neither of which is correct. The new approach has no side effects
on the network, disk, or memory cache so it can be turned on temporarily without causing problems.
New tests:
- http/tests/inspector/network/set-resource-caching-disabled-disk-cache.html
- http/tests/inspector/network/set-resource-caching-disabled-memory-cache.html
* inspector/InspectorNetworkAgent.h:
* inspector/InspectorNetworkAgent.cpp:
(WebCore::InspectorNetworkAgent::setCacheDisabled): Deleted.
(WebCore::InspectorNetworkAgent::setResourceCachingDisabled): Added.
Implement new command.
(WebCore::InspectorNetworkAgent::willSendRequest):
(WebCore::InspectorNetworkAgent::mainFrameNavigated):
Remove crufty attempts to break caches. I believe these are intended to defeat caching
proxies and similar middlemen, but this is just as likely to cause unusual loading behavior.
* page/Page.h:
(WebCore::Page::isResourceCachingDisabled):
(WebCore::Page::setResourceCachingDisabledOverride):
Add an override setting so that Web Inspector's override does not mess up the value
of isResourceCachingDisabled that may have been set by a WebKit API client.
2017-03-28 Youenn Fablet <youenn@apple.com>
Fix addIceCandidate after r214441
https://bugs.webkit.org/show_bug.cgi?id=170146
Reviewed by Chris Dumez.
Covered by rebased test.
* Modules/mediastream/RTCPeerConnection.js:
(addIceCandidate): Setting function length to 1 and throwing if no parameter is passed.
2017-03-28 Youenn Fablet <youenn@apple.com>
Stop RTCDataChannel when closing page
https://bugs.webkit.org/show_bug.cgi?id=170166
Reviewed by Eric Carlson.
Test: webrtc/datachannel/datachannel-gc.html
Making RTCDataChannel an ActiveDOMObject.
Closing the data channel backend and freeing upon close and stop.
* Modules/mediastream/RTCDataChannel.cpp:
(WebCore::RTCDataChannel::create):
(WebCore::RTCDataChannel::RTCDataChannel):
(WebCore::RTCDataChannel::close):
(WebCore::RTCDataChannel::stop):
* Modules/mediastream/RTCDataChannel.h:
* Modules/mediastream/RTCDataChannel.idl:
* Modules/mediastream/RTCPeerConnection.h:
2017-03-27 Simon Fraser <simon.fraser@apple.com>
Enhance the touch region debug overlay to show regions for the different events
https://bugs.webkit.org/show_bug.cgi?id=170162
Reviewed by Tim Horton.
Have NonFastScrollableRegionOverlay use a different color for each region in EventTrackingRegions,
and to draw a legend showing what the colors mean.
On Mac, this overlay displays the non-fast scrollable region (which we don't keep separate from the wheel event
region).
* page/DebugPageOverlays.cpp:
(WebCore::NonFastScrollableRegionOverlay::updateRegion):
(WebCore::touchEventRegionColors):
(WebCore::drawRightAlignedText):
(WebCore::NonFastScrollableRegionOverlay::drawRect):
(WebCore::RegionOverlay::drawRect):
(WebCore::RegionOverlay::drawRegion):
2017-03-27 Simon Fraser <simon.fraser@apple.com>
Make sure the non-fast scrolling debug overlay is correctly updated
https://bugs.webkit.org/show_bug.cgi?id=170142
Reviewed by Tim Horton.
AsyncScrollingCoordinator::frameViewEventTrackingRegionsChanged() is called on a timer
from Document code, so the existing DebugPageOverlays::didLayout() call at the end
of FrameView::layout() wasn't sufficient to keep the non-fast scrollable region up-to-date
on iOS.
* page/scrolling/AsyncScrollingCoordinator.cpp:
(WebCore::AsyncScrollingCoordinator::frameViewEventTrackingRegionsChanged):
2017-03-28 Antoine Quint <graouts@apple.com>
[Modern Media Controls] AirPlay placard text looks bad on 1x displays
https://bugs.webkit.org/show_bug.cgi?id=170183
<rdar://problem/30663416>
Reviewed by Dean Jackson.
Use subpixel antialiasing for all text in modern media controls.
* Modules/modern-media-controls/controls/media-controls.css:
(.media-controls-container,):
2017-03-28 Antoine Quint <graouts@apple.com>
[Modern Media Controls] Improve appearance of tracks panel on macOS
https://bugs.webkit.org/show_bug.cgi?id=168929
<rdar://problem/30741589>
Reviewed by Eric Carlson.
We use a solid color for the focus state that matches the style used on macOS
and blend the titles the same way we blend other non-solid labels in the controls bar.
* Modules/modern-media-controls/controls/tracks-panel.css:
(.tracks-panel section):
(.tracks-panel section > h3):
(.tracks-panel section > ul > li:focus):
2017-03-28 Yoav Weiss <yoav@yoav.ws>
Add a warning for unused link preloads.
https://bugs.webkit.org/show_bug.cgi?id=165670
Reviewed by Youenn Fablet.
Tests: http/tests/preload/single_download_preload_headers_charset.php
http/tests/preload/unused_preload_warning.html
* dom/Document.cpp:
(WebCore::Document::prepareForDestruction): Stop the timer once the document is destructed.
* loader/LinkPreloadResourceClients.h: Add shouldMarkAsReferenced overides for the LinkPreloadResourceClient classes.
* loader/cache/CachedResource.cpp:
(WebCore::CachedResource::addClientToSet): Make sure LinkPreloadResourceClients don't set resource to be referenced.
* loader/cache/CachedResourceClient.h:
(WebCore::CachedResourceClient::shouldMarkAsReferenced): Make sure that ResourceClients mark preloads as referenced by default.
* loader/cache/CachedResourceLoader.cpp:
(WebCore::CachedResourceLoader::CachedResourceLoader): Initialize timer.
(WebCore::CachedResourceLoader::~CachedResourceLoader): Stop timer.
(WebCore::CachedResourceLoader::documentDidFinishLoadEvent): Trigger a timer if preloads weren't cleared at load time.
(WebCore::CachedResourceLoader::stopUnusedPreloadsTimer): Stop the timer.
(WebCore::CachedResourceLoader::warnUnusedPreloads): Iterate over m_preloads and issue a warning for non-referenced preloads.
* loader/cache/CachedResourceLoader.h:
* page/DOMWindow.cpp:
(WebCore::DOMWindow::willDetachDocumentFromFrame): Clear Resource Timing buffer when document detaches, to avoid test flakiness.
2017-03-28 Antoine Quint <graouts@apple.com>
REGRESSION: Double-clicking the captions button while the captions popover is open prevents the popover from being opened again
https://bugs.webkit.org/show_bug.cgi?id=170171
<rdar://problem/31095500>
Reviewed by Dean Jackson.
We used to consider that the tracks panel was presented as long as it had a parent, but since we were using for the animated
transition to complete before actually removing the panel from the node hierarchy, consecutive calls to hide then present
would fail to present the panel. We now use a private instance variable to track the presented state which is set immediately
as presentInParent() and hide() are called.
Test: media/modern-media-controls/tracks-support/tracks-support-show-panel-then-double-click-on-tracks-button.html
* Modules/modern-media-controls/controls/tracks-panel.js:
(TracksPanel.prototype.get presented):
(TracksPanel.prototype.presentInParent):
(TracksPanel.prototype.hide):
2017-03-28 Aaron Chu <aaron_chu@apple.com>
AX: Media controls should be able to be re-activated after faded away
https://bugs.webkit.org/show_bug.cgi?id=170048
<rdar://problem/30157179>
Reviewed by Antoine Quint.
Added a "foucsin" listener for the controls bar so that when an element
within fires a "focusin" event, the controls bar reappears if it is faded.
Test: media/modern-media-controls/media-controls/media-controls-appear-when-focus.html
* Modules/modern-media-controls/controls/controls-bar.js:
(ControlsBar.prototype.handleEvent):
2017-03-28 Antoine Quint <graouts@apple.com>
[Modern Media Controls] Improve media documents across macOS, iPhone and iPad
https://bugs.webkit.org/show_bug.cgi?id=169145
<rdar://problem/17048858>
Reviewed by Dean Jackson.
There were a variety of issues with media documents, some longstanding, and some specifically
about modern media controls.
One issue was that fullscreen and picture-in-picture buttons would show for audio media documents,
due to using a <video> element to load the audio file. We now have additional logic in MediaController
to identify if the loaded media is really an audio file, and using this information to hide the
fullscreen and picture-in-picture buttons.
Another issue was that we would inject style in MediaDocument.cpp that was specific to modern media
controls when we could have the modern-media-controls module injected CSS handle this styling. We now
use the injected style in the shadow root to size media documents based on the device characteristics
and ensuring that page styles are overridden.
We also simplify how MediaDocument.cpp sets the source of the media element to simply use the "src"
attribute and not a <source> element.
Finally, we introduce a MediaDocumentController class that is instantiated when we're dealing with
a media document to hide the controls while we determine the type of media we're loading (audio vs.
video) in order to apply the appropriate styling without flashes.
As a result of the new styles applied by the modern-media-controls module, media documents have a
similar behavior on macOS and iPad, where we only enforce a min-width for video allowing them
to play at their natural size otherwise, and enforcing a fixed width for audio. On iPhone however,
we want to always play the media at full width, with some padding in the case of audio.
Tests: media/modern-media-controls/fullscreen-support/fullscreen-support-disabled-video-with-audio-tracks-only.html
media/modern-media-controls/media-documents/ipad/media-document-audio-ios-sizing.html
media/modern-media-controls/media-documents/ipad/media-document-video-ios-sizing.html
media/modern-media-controls/media-documents/media-document-audio-ios-sizing.html
media/modern-media-controls/media-documents/media-document-audio-mac-sizing.html
media/modern-media-controls/media-documents/media-document-video-ios-sizing.html
media/modern-media-controls/media-documents/media-document-video-mac-sizing.html
media/modern-media-controls/pip-support/pip-support-disabled-video-with-audio-tracks-only.html
* Modules/modern-media-controls/controls/ios-inline-media-controls.css:
(:host(audio) .media-controls.ios.inline > .controls-bar:before,):
(:host(audio) .media-controls.ios.inline > .controls-bar:before): Deleted.
* Modules/modern-media-controls/controls/macos-media-controls.css:
(:host(audio) .media-controls.mac.inline > .controls-bar,):
(:host(audio) .media-controls.mac.inline > .controls-bar > .background-tint,):
(:host(audio) .media-controls.mac.inline > .controls-bar): Deleted.
(:host(audio) .media-controls.mac.inline > .controls-bar > .background-tint): Deleted.
* Modules/modern-media-controls/controls/media-document.css: Copied from Source/WebCore/Modules/modern-media-controls/controls/macos-media-controls.css.
(:host(.media-document)):
(:host(.media-document.ready)):
(:host(.media-document.audio.mac)):
(:host(.media-document.audio.ipad)):
(:host(.media-document.audio.iphone)):
(:host(.media-document.video.mac)):
(:host(.media-document.video.ipad)):
(:host(.media-document.video.iphone)):
* Modules/modern-media-controls/js-files:
* Modules/modern-media-controls/media/fullscreen-support.js:
(FullscreenSupport.prototype.syncControl):
(FullscreenSupport):
* Modules/modern-media-controls/media/media-controller.js:
(MediaController):
(MediaController.prototype.get isAudio):
* Modules/modern-media-controls/media/media-document-controller.js: Copied from Source/WebCore/Modules/modern-media-controls/media/fullscreen-support.js.
(MediaDocumentController):
(MediaDocumentController.prototype.handleEvent):
(MediaDocumentController.prototype._mediaDocumentHasMetadata):
(MediaDocumentController.prototype._mediaDocumentHasSize):
* Modules/modern-media-controls/media/pip-support.js:
(PiPSupport.prototype.syncControl):
(PiPSupport):
* html/MediaDocument.cpp:
(WebCore::MediaDocumentParser::createDocumentStructure):
2017-03-28 Myles C. Maxfield <mmaxfield@apple.com>
Follow-up patch after r214364.
https://bugs.webkit.org/show_bug.cgi?id=168895
Unreviewed.
* platform/graphics/FontDescription.cpp:
(WebCore::FontDescription::FontDescription):
2017-03-27 Said Abou-Hallawa <sabouhallawa@apple.com>
REGRESSION(213764): Large images should not be decoded asynchronously when they are drawn on a canvas
https://bugs.webkit.org/show_bug.cgi?id=169771
Reviewed by Simon Fraser.
Sometimes we have to draw the image immediately like when a canvas calls
drawImage. In this case we have to decode the image synchronously to guarantee
the drawing. Other times we need to decode with the native size of the image.
The animated images have to be decoded with native size always. Otherwise
the frame cache will be messed up if the same image is animated with different
sizes. Currently we always decode asynchronously with sizeForDrawing. We need
to decouple the decoding mode from the sizeForDrawing.
This patch introduce the DecodingOptions class which can store and compare the
following four cases:
-- Synchronous: The frame has be decoded with native size only.
-- Asynchronous + anySize: This is passed from the Image::draw() callers.
-- Asynchronous + fullSize: The image has to be decoded with its full size.
-- Asynchronous + sizeForDrawing: The image can be decoded with sizeForDrawing unless
it was decoded with either a full size or sizeForDrawing which is larger than the
requested sizeForDrawing.
A new argument of type DecodingMode will be added to Image::draw() function.
Only when the drawing comes from the render tree, it will be Asynchronous.
Otherwise it will be Synchronous.
Tests: fast/images/animated-image-different-dest-size.html
fast/images/async-image-background-image.html
fast/images/async-image-canvas-draw-image.html
* WebCore.xcodeproj/project.pbxproj:
* platform/graphics/BitmapImage.cpp:
(WebCore::BitmapImage::frameImageAtIndexCacheIfNeeded): Gets the frame image, cache it synchronously if
the current one is invalid. frameImageAtIndex() returns whatever stored in the cache.
(WebCore::BitmapImage::nativeImage): Call frameImageAtIndexCacheIfNeeded() instead of frameImageAtIndex().
(WebCore::BitmapImage::nativeImageForCurrentFrame): Ditto.
(WebCore::BitmapImage::nativeImageOfSize): Ditto.
(WebCore::BitmapImage::framesNativeImages): Ditto.
(WebCore::BitmapImage::draw): Change the logic to do the following:
-- The animated image has to be decoded with its full size.
-- The animated image expects the current frame to be ready for drawing.
-- The large image decoding does not need to call internalStartAnimation().
-- The large image has to request async image decoding but draw the current one if it exists.
(WebCore::BitmapImage::drawPattern): Draw the pattern synchronously.
(WebCore::BitmapImage::shouldUseAsyncDecodingForLargeImages): Delete the call to shouldUseAsyncDecodingForTesting()
since it is only applied for animated images.
(WebCore::BitmapImage::shouldUseAsyncDecodingForAnimatedImages): Call shouldUseAsyncDecodingForAnimatedImageForTesting().
(WebCore::BitmapImage::internalStartAnimation): Request decoding with the full size.
(WebCore::BitmapImage::advanceAnimation): Call shouldUseAsyncDecodingForAnimatedImageForTesting().
(WebCore::BitmapImage::internalAdvanceAnimation): Assert the current frame is not being decoding asynchronously for any size.
(WebCore::BitmapImage::frameImageAtIndex): Deleted. Moved to the header file but with a new purpose: return
the current frame from the frame cache as is; do not cache a new one.
(WebCore::BitmapImage::shouldUseAsyncDecodingForLargeImage): Deleted. Function was renamed to shouldUseAsyncDecodingForLargeImages.
(WebCore::BitmapImage::shouldUseAsyncDecodingForAnimatedImage): Deleted. Function was renamed to shouldUseAsyncDecodingForAnimatedImages.
* platform/graphics/BitmapImage.h:
* platform/graphics/CrossfadeGeneratedImage.cpp:
(WebCore::CrossfadeGeneratedImage::draw): Add a new argument of type DecodingMode.
* platform/graphics/CrossfadeGeneratedImage.h:
* platform/graphics/DecodingOptions.h: Added.
(WebCore::DecodingOptions::DecodingOptions): Default constructor: Synchronous mode.
(WebCore::DecodingOptions::operator==): Compares two DecodingOptions for equality.
(WebCore::DecodingOptions::isSynchronous): Is the frame decoded synchronously?
(WebCore::DecodingOptions::isAsynchronous): Is the frame decoded asynchronously?
(WebCore::DecodingOptions::isAsynchronousCompatibleWith): Is this DecodingOptions compatible with another one?
(WebCore::DecodingOptions::hasFullSize): Is the decoding mode asynchronous but for the image full size?
(WebCore::DecodingOptions::hasSizeForDrawing): Is this decoding mode asynchronous but for a sizeForDrawing?
(WebCore::DecodingOptions::sizeForDrawing): Returns the sizeForDrawing. m_decodingModeOrSize has to hold an IntSize.
(WebCore::DecodingOptions::maxDimension): Moved form ImageFrame.cpp.
(WebCore::DecodingOptions::has): A helper function.
(WebCore::DecodingOptions::hasDecodingMode): Does m_decodingModeOrSize a DecodingMode?
(WebCore::DecodingOptions::hasSize): Does m_decodingModeOrSize an IntSize?
* platform/graphics/GeneratedImage.h: Add a new argument of type DecodingMode.
* platform/graphics/GradientImage.cpp:
(WebCore::GradientImage::draw): Ditto.
* platform/graphics/GradientImage.h: Ditto.
* platform/graphics/GraphicsContext.cpp:
(WebCore::GraphicsContext::drawImage): Pass the ImagePaintingOptions::m_DecodingMode to Image::draw().
* platform/graphics/GraphicsContext.h:
(WebCore::ImagePaintingOptions::ImagePaintingOptions): Add a new member of type DecodingMode to ImagePaintingOptions.
* platform/graphics/Image.cpp:
(WebCore::Image::drawTiled): Pass DecodingMode::Synchronous to Image::draw().
* platform/graphics/Image.h: Add a new argument of type DecodingMode to Image::draw().
* platform/graphics/ImageFrame.cpp:
(WebCore::ImageFrame::operator=): Replace m_sizeForDrawing by m_decodingOptions.
(WebCore::ImageFrame::hasNativeImage): Check if m_nativeImage is valid and the subsamplingLevels match.
(WebCore::ImageFrame::hasFullSizeNativeImage): Checks hasNativeImage() and whether the image frame was
decoded for the image full size.
(WebCore::ImageFrame::hasDecodedNativeImageCompatibleWithOptions): Checks hasNativeImage() and the DecodingOptions match.
(WebCore::maxDimension): Deleted. Moved to DecodingOptions.h.
(WebCore::ImageFrame::isBeingDecoded): Deleted. The check for having an ImageFrame being decoded is
moved to ImageFrameCache.
(WebCore::ImageFrame::hasValidNativeImage): Deleted. No need to this function.
* platform/graphics/ImageFrame.h:
(WebCore::ImageFrame::hasNativeImage): Add an std::optional<SubsamplingLevel> argument.
(WebCore::ImageFrame::hasFullSizeNativeImage): Checks whether the ImageFrame was decoded for the image full size.
(WebCore::ImageFrame::enqueueSizeForDecoding): Deleted.
(WebCore::ImageFrame::dequeueSizeForDecoding): Deleted.
(WebCore::ImageFrame::clearSizeForDecoding): Deleted.
(WebCore::ImageFrame::isBeingDecoded): Deleted.
(WebCore::ImageFrame::sizeForDrawing): Deleted.
(WebCore::ImageFrame::hasDecodedNativeImage): Deleted.
The logic of knowing whether an ImageFrame is being decoded is moved to ImageFrameCache.
* platform/graphics/ImageFrameCache.cpp:
(WebCore::ImageFrameCache::cacheFrameMetadataAtIndex): Caches the metadata of an ImageFrame. If the NativeImage
was decoded for a sizeForDrawing, the size of the ImageFrame will be the nativeImageSize(). Otherwise, the
frameSizeAtIndex() will be called.
(WebCore::ImageFrameCache::cacheFrameNativeImageAtIndex): Cache a new NativeImage which involves caching new
metadata and updating the memory cache. No need to check if the existing native image is valid or not for the
DecodingOptions. Actually it would be a bug if it happens. This is why cacheNativeImageForFrameRequest() asserts
!frame.hasAsyncNativeImage() before calling cacheFrameNativeImageAtIndex().
(WebCore::ImageFrameCache::cacheAsyncFrameNativeImageAtIndex): Cache new NativeImage which was decoded asynchronously.
(WebCore::ImageFrameCache::startAsyncDecodingQueue): Call cacheAsyncFrameNativeImageAtIndex() instead of
cacheNativeImageForFrameRequest() for clarity.
(WebCore::ImageFrameCache::requestFrameAsyncDecodingAtIndex): Call hasAsyncNativeImage() instead of hasValidNativeImage()
Call frameIsDecodingCompatibleWithOptionsAtIndex() instead of frame.isBeingDecoded(). Replace the call to enqueueSizeForDecoding()
by appending the same ImageFrameRequest to m_frameCommitQueue.
(WebCore::ImageFrameCache::isAsyncDecodingQueueIdle): Use m_frameCommitQueue to answer the question whether the decodingQueue is idle.
(WebCore::ImageFrameCache::stopAsyncDecodingQueue): Use m_frameCommitQueue to loop through all the ImageFrames which are currently being decoded.
(WebCore::ImageFrameCache::frameAtIndexCacheIfNeeded): For getting the metadata, this function needs a valid frame. If it is requested
to decode the nativeImage, it has to do it synchronously.
(WebCore::ImageFrameCache::singlePixelSolidColor): Don't cache the frame if it is an animated image or the size is not a single pixel.
(WebCore::ImageFrameCache::frameIsBeingDecodedAndIsCompatibleWithOptionsAtIndex): Use m_frameCommitQueue to answer the question whether an ImageFrame
is being decoded and is compatible with DecodingOptions.
(WebCore::ImageFrameCache::frameHasFullSizeNativeImageAtIndex): Calls ImageFrame::hasFullNativeImage() for a frame.
(WebCore::ImageFrameCache::frameHasDecodedNativeImageCompatibleWithOptionsAtIndex): Calls ImageFrame::hasDecodedNativeImageCompatibleWithOptions() for a frame.
(WebCore::ImageFrameCache::frameImageAtIndex): Returns the current NativeImage without caching.
(WebCore::ImageFrameCache::frameImageAtIndexCacheIfNeeded): Returns the current NativeImage but cache it synchronously if needed.
(WebCore::ImageFrameCache::setFrameNativeImageAtIndex): Deleted.
(WebCore::ImageFrameCache::setFrameMetadataAtIndex): Deleted.
(WebCore::ImageFrameCache::replaceFrameNativeImageAtIndex): Deleted.
(WebCore::ImageFrameCache::frameIsBeingDecodedAtIndex): Deleted.
(WebCore::ImageFrameCache::frameHasImageAtIndex): Deleted.
(WebCore::ImageFrameCache::frameHasValidNativeImageAtIndex): Deleted.
(WebCore::ImageFrameCache::frameHasDecodedNativeImage): Deleted.
* platform/graphics/ImageFrameCache.h: Two ImageFrameRequest queues will be used.
-- The existing one m_frameRequestQueue which is shared between the main thread and decoding thread. The requests will be
dequeued from it before starting the decoding. The decoded NativeImage will be cached only on the main thread. The decoding
thread is not blocked by the callOnMainThread(). This means there might be multiple ImageFrameRequests which were dequeued
while their NativeImages have not been cached yet.
-- A new one m_frameCommitQueue which is track all the ImageFrameRequests whose NativeImages have not been cached yet.
(WebCore::ImageFrameCache::frameAtIndexCacheIfNeeded): Be explicit about caching the image frame. frameImageAtIndex()
returns the current image frame without caching. frameAtIndexCacheIfNeeded(). returns the current image frame but cache
it if needed.
(WebCore::ImageFrameCache::ImageFrameRequest::operator==): Compares two ImageFrameRequests for equality.
* platform/graphics/ImageSource.cpp:
(WebCore::ImageSource::frameImageAtIndexCacheIfNeeded):
(WebCore::ImageSource::frameImageAtIndex): Deleted.
* platform/graphics/ImageSource.h:
(WebCore::ImageSource::requestFrameAsyncDecodingAtIndex): Change the type of the argument from IntSize to be const std::optional<IntSize>.
(WebCore::ImageSource::frameIsBeingDecodedAndIsCompatibleWithOptionsAtIndex): Rename of frameIsBeingDecodedAtIndex(). Replace the argument of type
std::optional<IntSize> by an argument of type DecodingOptions.
(WebCore::ImageSource::frameHasFullSizeNativeImageAtIndex): A wrapper around the ImageFrameCache function.
(WebCore::ImageSource::frameHasDecodedNativeImageCompatibleWithOptionsAtIndex): Ditto.
(WebCore::ImageSource::frameImageAtIndex): Ditto.
(WebCore::ImageSource::frameIsBeingDecodedAtIndex): Deleted.
(WebCore::ImageSource::frameHasValidNativeImageAtIndex): Deleted.
(WebCore::ImageSource::frameHasDecodedNativeImage): Deleted.
* platform/graphics/NamedImageGeneratedImage.cpp:
(WebCore::NamedImageGeneratedImage::draw): Add a new argument of type DecodingMode.
* platform/graphics/NamedImageGeneratedImage.h: Ditto.
* platform/graphics/cairo/ImageBufferCairo.cpp:
(WebCore::ImageBuffer::draw): Add a new argument of type DecodingMode.
* platform/graphics/cg/ImageDecoderCG.cpp:
(WebCore::ImageDecoder::createFrameImageAtIndex): Replace the sizeForDrawing argument by a DecodingMode argument. Add a new handling
for decoding asynchronously for the image full size.
* platform/graphics/cg/ImageDecoderCG.h: Change the prototype of the function.
* platform/graphics/cg/PDFDocumentImage.cpp:
(WebCore::PDFDocumentImage::draw): Add a new argument of type DecodingMode.
* platform/graphics/cg/PDFDocumentImage.h:
* platform/graphics/win/ImageCGWin.cpp:
(WebCore::BitmapImage::getHBITMAPOfSize): Pass DecodingMode::Synchronous to Image::draw().
(WebCore::BitmapImage::drawFrameMatchingSourceSize): Ditto.
* platform/graphics/win/ImageDecoderDirect2D.cpp:
(WebCore::ImageDecoder::createFrameImageAtIndex): Replace the sizeForDrawing argument by a DecodingMode argument.
* platform/graphics/win/ImageDecoderDirect2D.h: Change the prototype of the function.
* platform/image-decoders/ImageDecoder.cpp:
(WebCore::ImageDecoder::createFrameImageAtIndex): Replace the sizeForDrawing argument by a DecodingMode argument.
* platform/image-decoders/ImageDecoder.h: Change the prototype of the function.
* rendering/RenderBoxModelObject.cpp:
(WebCore::RenderBoxModelObject::paintFillLayerExtended): Draw the background image asynchronously if the image size is large.
* rendering/RenderImage.cpp:
(WebCore::RenderImage::paintIntoRect): Draw the background image element asynchronously if the image size is large.
* svg/graphics/SVGImage.cpp:
(WebCore::SVGImage::drawForContainer): Pass DecodingMode::Synchronous to draw().
(WebCore::SVGImage::nativeImageForCurrentFrame): Ditto.
(WebCore::SVGImage::nativeImage): Ditto.
(WebCore::SVGImage::draw): Add a new argument of type DecodingMode.
* svg/graphics/SVGImage.h: Change the prototype of the function.
* svg/graphics/SVGImageForContainer.cpp:
(WebCore::SVGImageForContainer::draw): Add a new argument of type DecodingMode.
* svg/graphics/SVGImageForContainer.h: Change the prototype of the function.
2017-03-27 Youenn Fablet <youenn@apple.com>
Activate release libwebrtc logging when WebRTC log channel is on
https://bugs.webkit.org/show_bug.cgi?id=169659
Reviewed by Alex Christensen.
* platform/mediastream/libwebrtc/LibWebRTCProvider.cpp:
(WebCore::initializePeerConnectionFactoryAndThreads):
2017-03-27 Antti Koivisto <antti@apple.com>
Move visibleInViewportStateChanged callback from Element to render tree
https://bugs.webkit.org/show_bug.cgi?id=170039
Reviewed by Zalan Bujtas.
Make it easier to use from the render tree.
Also for simplicity move the bits from RenderObject rare data to RenderElement.
There is plenty of space there.
* dom/Element.h:
(WebCore::Element::isVisibleInViewportChanged): Deleted.
* html/HTMLMediaElement.h:
* rendering/RenderElement.cpp:
(WebCore::RenderElement::RenderElement):
(WebCore::RenderElement::willBeDestroyed):
(WebCore::RenderElement::registerForVisibleInViewportCallback):
(WebCore::RenderElement::unregisterForVisibleInViewportCallback):
(WebCore::RenderElement::setVisibleInViewportState):
(WebCore::RenderElement::visibleInViewportStateChanged):
* rendering/RenderElement.h:
(WebCore::RenderElement::visibleInViewportState):
* rendering/RenderObject.cpp:
(WebCore::RenderObject::setIsRegisteredForVisibleInViewportCallback): Deleted.
(WebCore::RenderObject::setVisibleInViewportState): Deleted.
* rendering/RenderObject.h:
(WebCore::RenderObject::hasOutlineAutoAncestor):
(WebCore::RenderObject::RenderObjectRareData::RenderObjectRareData):
(WebCore::RenderObject::isRegisteredForVisibleInViewportCallback): Deleted.
(WebCore::RenderObject::visibleInViewportState): Deleted.
* rendering/RenderVideo.cpp:
(WebCore::RenderVideo::visibleInViewportStateChanged):
* rendering/RenderVideo.h:
* rendering/RenderView.cpp:
(WebCore::RenderView::updateVisibleViewportRect):
2017-03-27 Youenn Fablet <youenn@apple.com>
addIceCandidate should not throw if passed null or undefined
https://bugs.webkit.org/show_bug.cgi?id=170118
Reviewed by Eric Carlson.
Covered by updated test.
A null/undefined candidate passed to addIceCandidate means end of Ice candidate..
* Modules/mediastream/PeerConnectionBackend.cpp:
(WebCore::PeerConnectionBackend::addIceCandidate):
* Modules/mediastream/PeerConnectionBackend.h:
(WebCore::PeerConnectionBackend::endOfIceCandidates):
* Modules/mediastream/RTCPeerConnection.cpp:
(WebCore::RTCPeerConnection::queuedAddIceCandidate):
* Modules/mediastream/RTCPeerConnection.h:
* Modules/mediastream/RTCPeerConnection.idl:
* Modules/mediastream/RTCPeerConnection.js:
(addIceCandidate):
2017-03-27 Antti Koivisto <antti@apple.com>
Allow the page to render before <link> stylesheet tags in body
https://bugs.webkit.org/show_bug.cgi?id=149157
<rdar://problem/24658830>
Reviewed by Simon Fraser.
Currently we block style and renderer building completely if document has any loading
stylesheets. In case a script queries something layout dependent we construct the render
tree with whatever style we have but block painting in it.
This patch changes behavior so that a loading stylesheet in body only blocks rendering for elements
that are after it. The expectation is that such stylesheets rarely affect elements before them
and the elements can be rendered without causing ugly visible styling changes.
The patch replaces the old flash-of-unstyled-content (FOUC) preventation mechanism with a more
fine-grained one. Paint blocking is now done on per-renderer basis with based on isNonFinal flag in
RenderStyle.
For stylesheets in head the behavior should be largely unchanged.
Test: http/tests/incremental/stylesheet-body-incremental-rendering.html
* css/StyleResolver.cpp:
(WebCore::StyleResolver::pseudoStyleRulesForElement):
* dom/Document.cpp:
(WebCore::Document::Document):
(WebCore::Document::resolveStyle):
(WebCore::Document::updateLayoutIgnorePendingStylesheets):
Remove the old FOUC preventation state tracking.
(WebCore::Document::shouldScheduleLayout):
(WebCore::Document::didRemoveAllPendingStylesheet):
Repaints will now get triggered by the normal style mechanism.
* dom/Document.h:
(WebCore::Document::hasNodesWithNonFinalStyle):
(WebCore::Document::setHasNodesWithNonFinalStyle):
Track if we need to recompute the style later because non-final or unstyled elements.
(WebCore::Document::didLayoutWithPendingStylesheets): Deleted.
(WebCore::Document::hasNodesWithPlaceholderStyle): Deleted.
(WebCore::Document::setHasNodesWithPlaceholderStyle): Deleted.
* html/HTMLFrameSetElement.cpp:
(WebCore::HTMLFrameSetElement::rendererIsNeeded):
* page/FrameView.cpp:
(WebCore::FrameView::qualifiesAsVisuallyNonEmpty):
Don't qualify as visually non-empty if we have loading stylesheets in head (even if there is
a fouc-prevented render tree).
(WebCore::FrameView::fireLayoutRelatedMilestonesIfNeeded):
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::paintContents):
Instead of a global test, block painting if isNonFinal is set in the renderer's style.
* rendering/RenderLayer.cpp:
(WebCore::shouldSuppressPaintingLayer):
* rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::changeRequiresRepaint):
The isNonFinal flag prevents painting so we need to trigger repaint when it gets cleared.
* rendering/style/RenderStyle.h:
(WebCore::RenderStyle::isNotFinal):
(WebCore::RenderStyle::setIsNotFinal):
(WebCore::RenderStyle::isPlaceholderStyle): Deleted.
(WebCore::RenderStyle::setIsPlaceholderStyle): Deleted.
There is no need for placeholder styles anymore. Reuse the bit for isNotFinal.
* rendering/style/StyleRareNonInheritedData.cpp:
(WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
(WebCore::StyleRareNonInheritedData::operator==):
* rendering/style/StyleRareNonInheritedData.h:
* style/StyleScope.cpp:
(WebCore::Style::Scope::analyzeStyleSheetChange):
(WebCore::Style::Scope::updateActiveStyleSheets):
* style/StyleTreeResolver.cpp:
(WebCore::Style::TreeResolver::styleForElement):
(WebCore::Style::TreeResolver::resolveElement):
If we have seens a loading stylesheet and don't have a renderer yet don't style the element.
In case there is a renderer or we are ignoring pending sheets, resolve the style normally
but mark it as non-final.
(WebCore::Style::makePlaceholderStyle): Deleted.
2017-03-27 Myles C. Maxfield <mmaxfield@apple.com>
Test variation font ranges in the CSS Font Loading API
https://bugs.webkit.org/show_bug.cgi?id=170022
Reviewed by Dean Jackson.
Test: fast/text/variations/font-loading-api-parse-ranges.html
Don't use keywords when reporting font variation range values.
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::ComputedStyleExtractor::fontNonKeywordWeightFromStyleValue):
(WebCore::ComputedStyleExtractor::fontWeightFromStyleValue):
(WebCore::ComputedStyleExtractor::fontNonKeywordStretchFromStyleValue):
(WebCore::ComputedStyleExtractor::fontStretchFromStyleValue):
(WebCore::ComputedStyleExtractor::fontNonKeywordStyleFromStyleValue):
(WebCore::ComputedStyleExtractor::fontStyleFromStyleValue):
* css/CSSComputedStyleDeclaration.h:
* css/FontFace.cpp:
(WebCore::FontFace::style):
(WebCore::FontFace::weight):
(WebCore::FontFace::stretch):
2017-03-27 Anders Carlsson <andersca@apple.com>
Propagate shipping contact update errors
https://bugs.webkit.org/show_bug.cgi?id=170141
rdar://problem/31276576
Reviewed by Tim Horton.
* Modules/applepay/ApplePaySession.cpp:
(WebCore::convertAndValidate):
2017-03-27 Ryan Haddad <ryanhaddad@apple.com>
Unreviewed, rolling out r214411.
Two of the LayoutTests for this change time out on ios-
simulator.
Reverted changeset:
"[Modern Media Controls] Improve media documents across macOS,
iPhone and iPad"
https://bugs.webkit.org/show_bug.cgi?id=169145
http://trac.webkit.org/changeset/214411
2017-03-27 Antoine Quint <graouts@apple.com>
[Modern Media Controls] Clicking on the tracks button when the tracks panel is up in a media document pauses the video
https://bugs.webkit.org/show_bug.cgi?id=168517
<rdar://problem/30577636>
Reviewed by Dean Jackson.
We completely turn off default event handling in MediaDocument.cpp since we're implementing the
behavior we expect to pause and resume the video in the modern-media-controls module already. This
gets rid of this odd case where the content would not see the "click" event while the C++ side would
handle it and pause the video.
* Modules/modern-media-controls/media/media-controller.js:
(MediaController):
(MediaController.prototype.handleEvent):
(MediaController.prototype._containerWasClicked): Deleted.
* html/MediaDocument.cpp:
(WebCore::MediaDocument::defaultEventHandler):
2017-03-27 Youenn Fablet <youenn@apple.com>
Tighten RTCDatachannel creation and parameter getters
https://bugs.webkit.org/show_bug.cgi?id=170081
Reviewed by Eric Carlson.
Covered by updated tests.
Adding some parameter checks when creating data channels.
Making some getters nullable as per the spec.
* Modules/mediastream/RTCDataChannel.h:
* Modules/mediastream/RTCDataChannel.idl:
* Modules/mediastream/RTCPeerConnection.cpp:
(WebCore::RTCPeerConnection::createDataChannel):
* Modules/mediastream/RTCPeerConnection.idl:
* Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
(WebCore::LibWebRTCMediaEndpoint::createDataChannel):
(WebCore::LibWebRTCMediaEndpoint::addDataChannel):
* platform/mediastream/RTCDataChannelHandler.h:
(): Deleted.
2017-03-27 Youenn Fablet <youenn@apple.com>
Add support for RTCRtpReceiver/RTCRtpSender getParameters
https://bugs.webkit.org/show_bug.cgi?id=170057
Reviewed by Alex Christensen.
Test: webrtc/video-getParameters.html
getParameters returns a dictionary of values taken from libwebrtc RtpReceiverInterface/RtpSenderInrterface objects.
Added a direct link between WebCore RTCRtpReceiver and libwebrtc RtpReceiverInterface object.
Making the link between WebCore RTCRtpSender and libwebrtc RtpSenderInrterface object through
PeerConnectionBackend to keep the current architecture shared with OpenWebRTC.
In the future, we should try to make the link more direct.
Added routines to support the conversion from libwebrtc to WebCore.
Ensured that RTCRtpReceiver is cleaning its backend when being stopped.
* CMakeLists.txt:
* DerivedSources.make:
* Modules/mediastream/MediaEndpointPeerConnection.cpp:
(WebCore::MediaEndpointPeerConnection::setRemoteDescriptionTask):
* Modules/mediastream/PeerConnectionBackend.h:
(WebCore::PeerConnectionBackend::getParameters):
* Modules/mediastream/RTCPeerConnection.cpp:
(WebCore::RTCPeerConnection::doClose):
(WebCore::RTCPeerConnection::getParameters):
* Modules/mediastream/RTCPeerConnection.h:
* Modules/mediastream/RTCRtpParameters.h: Added.
* Modules/mediastream/RTCRtpParameters.idl: Added.
* Modules/mediastream/RTCRtpReceiver.cpp:
(WebCore::RTCRtpReceiver::RTCRtpReceiver):
* Modules/mediastream/RTCRtpReceiver.h:
(WebCore::RTCRtpReceiver::Backend::~Backend):
(WebCore::RTCRtpReceiver::Backend::getParameters):
(WebCore::RTCRtpReceiver::create):
(WebCore::RTCRtpReceiver::stop):
(WebCore::RTCRtpReceiver::setBackend):
(WebCore::RTCRtpReceiver::getParameters):
* Modules/mediastream/RTCRtpReceiver.idl:
* Modules/mediastream/RTCRtpSender.cpp:
(WebCore::RTCRtpSender::create):
(WebCore::RTCRtpSender::RTCRtpSender):
(WebCore::RTCRtpSender::replaceTrack):
(WebCore::RTCRtpSender::getParameters):
* Modules/mediastream/RTCRtpSender.h:
(WebCore::RTCRtpSender::Backend::~Backend):
(WebCore::RTCRtpSender::isStopped):
(WebCore::RTCRtpSender::stop):
* Modules/mediastream/RTCRtpSender.idl:
* Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
(WebCore::LibWebRTCMediaEndpoint::addTrack):
(WebCore::LibWebRTCMediaEndpoint::addRemoteTrack):
(WebCore::LibWebRTCMediaEndpoint::OnAddTrack):
(WebCore::LibWebRTCMediaEndpoint::stop):
(WebCore::fillEncodingParameters):
(WebCore::fillHeaderExtensionParameters):
(WebCore::fillCodecParameters):
(WebCore::fillRtpParameters):
(WebCore::RTCRtpReceiverBackend::getParameters):
(WebCore::LibWebRTCMediaEndpoint::getRTCRtpSenderParameters):
* Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:
* Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
(WebCore::LibWebRTCPeerConnectionBackend::notifyAddedTrack):
(WebCore::LibWebRTCPeerConnectionBackend::getParameters):
* Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.h:
* WebCore.xcodeproj/project.pbxproj:
* platform/mediastream/mac/RealtimeOutgoingAudioSource.h:
2017-03-27 Myles C. Maxfield <mmaxfield@apple.com>
font variation properties don't need to accept numbers
https://bugs.webkit.org/show_bug.cgi?id=169357
Reviewed by Antti Koivisto.
The CSS Fonts level 4 spec stabilized the grammar accepted by font-weight,
font-style, and font-stretch. The changes are that font-style and
font-stretch no longer accept raw numbers, and the @font-face descriptor
ranges are now separated by spaces instead of slashes.
Tests: fast/text/font-selection-font-face-parse.html
fast/text/font-selection-font-loading-api-parse.html
fast/text/font-stretch-parse.html
fast/text/font-style-parse.html
fast/text/variations/font-selection-properties.html
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::ComputedStyleExtractor::fontWeightFromStyleValue):
(WebCore::fontWeightFromStyle):
(WebCore::ComputedStyleExtractor::fontStretchFromStyleValue):
(WebCore::fontStretchFromStyle):
(WebCore::ComputedStyleExtractor::fontStyleFromStyleValue):
(WebCore::fontStyleFromStyle):
* css/CSSComputedStyleDeclaration.h:
* css/FontFace.cpp:
(WebCore::FontFace::style):
(WebCore::FontFace::weight):
(WebCore::FontFace::stretch):
(WebCore::rangeIsSingleValue): Deleted.
* css/StyleBuilderConverter.h:
(WebCore::StyleBuilderConverter::convertFontStretchFromValue):
* css/parser/CSSPropertyParser.cpp:
(WebCore::consumeFontWeightRange):
(WebCore::consumeFontStretch):
(WebCore::consumeFontStretchRange):
(WebCore::consumeFontStyle):
(WebCore::consumeFontStyleRange):
2017-03-27 Youenn Fablet <youenn@apple.com>
Further optimize checkWebRTCAvailability
https://bugs.webkit.org/show_bug.cgi?id=169147
Reviewed by Alex Christensen.
Tested locally by removing libwebrtc.dylib.
Replacing dlopen check by checking an exported symbol, rtc::LogMessage::LogToDebug.
This check is more efficient and accurate. It should work in more configurations than the previous one.
* platform/mediastream/libwebrtc/LibWebRTCProvider.cpp:
(WebCore::isNullFunctionPointer):
(WebCore::LibWebRTCProvider::webRTCAvailable):
2017-03-27 Myles C. Maxfield <mmaxfield@apple.com>
Implement format specifier for variation fonts
https://bugs.webkit.org/show_bug.cgi?id=169327
Reviewed by Simon Fraser.
Variation fonts require the format("woff-variations"), format("truetype-variations"),
and format("opentype-variations") format specifies in @font-face rules.
Test: fast/text/variations/font-face-format.html
* platform/graphics/mac/FontCustomPlatformData.cpp:
(WebCore::FontCustomPlatformData::supportsFormat):
2017-03-27 Myles C. Maxfield <mmaxfield@apple.com>
Make sure animation works for font-weight, font-stretch, and font-style
https://bugs.webkit.org/show_bug.cgi?id=169683
Reviewed by Simon Fraser.
Hook up animation code for FontSelectionValues.
Tests: animations/font-variations/font-stretch.html
animations/font-variations/font-style.html
animations/font-variations/font-weight.html
* page/animation/CSSPropertyAnimation.cpp:
(WebCore::blendFunc):
(WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
* rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::setFontWeight):
(WebCore::RenderStyle::setFontStretch):
(WebCore::RenderStyle::setFontItalic):
* rendering/style/RenderStyle.h:
(WebCore::RenderStyle::fontWeight):
(WebCore::RenderStyle::fontStretch):
(WebCore::RenderStyle::fontItalic):
2017-03-27 Alex Christensen <achristensen@webkit.org>
Make WebSockets work in network process
https://bugs.webkit.org/show_bug.cgi?id=169930
Reviewed by Youenn Fablet.
Covered by 136 existing tests in http/tests/websocket/tests/hybi
This also does fine with the 544 websocket tests in the web-platform-tests which we have not yet imported.
Also added http/tests/websocket/tests/hybi/network-process-crash-error.html
to test a new condition that couldn't happen before this move: the NetworkProcess crashing.
* Modules/websockets/WebSocketChannel.cpp:
(WebCore::WebSocketChannel::fail):
We were asserting that didCloseSocketStream was called. It is still called,
but not synchronously like it used to. This assertion is now invalid, but tests
that would hit it still pass.
* platform/network/cf/SocketStreamHandleImplCFNet.cpp:
(WebCore::SocketStreamHandleImpl::platformSendInternal):
CFWriteStreamCanAcceptBytes crashes if you give it a null parameter, and that can happen now.
If we have no write stream, then we cannot write. Tests that hit this pass still.
2017-03-27 Antoine Quint <graouts@apple.com>
[Modern Media Controls] Improve media documents across macOS, iPhone and iPad
https://bugs.webkit.org/show_bug.cgi?id=169145
<rdar://problem/17048858>
Reviewed by Dean Jackson.
There were a variety of issues with media documents, some longstanding, and some specifically
about modern media controls.
One issue was that fullscreen and picture-in-picture buttons would show for audio media documents,
due to using a <video> element to load the audio file. We now have additional logic in MediaController
to identify if the loaded media is really an audio file, and using this information to hide the
fullscreen and picture-in-picture buttons.
Another issue was that we would inject style in MediaDocument.cpp that was specific to modern media
controls when we could have the modern-media-controls module injected CSS handle this styling. We now
use the injected style in the shadow root to size media documents based on the device characteristics
and ensuring that page styles are overridden.
We also simplify how MediaDocument.cpp sets the source of the media element to simply use the "src"
attribute and not a <source> element.
Finally, we introduce a MediaDocumentController class that is instantiated when we're dealing with
a media document to hide the controls while we determine the type of media we're loading (audio vs.
video) in order to apply the appropriate styling without flashes.
As a result of the new styles applied by the modern-media-controls module, media documents have a
similar behavior on macOS and iPad, where we only enforce a min-width for video allowing them
to play at their natural size otherwise, and enforcing a fixed width for audio. On iPhone however,
we want to always play the media at full width, with some padding in the case of audio.
Tests: media/modern-media-controls/fullscreen-support/fullscreen-support-disabled-video-with-audio-tracks-only.html
media/modern-media-controls/media-documents/ipad/media-document-audio-ios-sizing.html
media/modern-media-controls/media-documents/ipad/media-document-video-ios-sizing.html
media/modern-media-controls/media-documents/media-document-audio-ios-sizing.html
media/modern-media-controls/media-documents/media-document-audio-mac-sizing.html
media/modern-media-controls/media-documents/media-document-video-ios-sizing.html
media/modern-media-controls/media-documents/media-document-video-mac-sizing.html
media/modern-media-controls/pip-support/pip-support-disabled-video-with-audio-tracks-only.html
* Modules/modern-media-controls/controls/ios-inline-media-controls.css:
(:host(audio) .media-controls.ios.inline > .controls-bar:before,):
(:host(audio) .media-controls.ios.inline > .controls-bar:before): Deleted.
* Modules/modern-media-controls/controls/macos-media-controls.css:
(:host(audio) .media-controls.mac.inline > .controls-bar,):
(:host(audio) .media-controls.mac.inline > .controls-bar > .background-tint,):
(:host(audio) .media-controls.mac.inline > .controls-bar): Deleted.
(:host(audio) .media-controls.mac.inline > .controls-bar > .background-tint): Deleted.
* Modules/modern-media-controls/controls/media-document.css: Added.
(:host(.media-document)):
(:host(.media-document.ready)):
(:host(.media-document.audio.mac)):
(:host(.media-document.audio.ipad)):
(:host(.media-document.audio.iphone)):
(:host(.media-document.video.mac)):
(:host(.media-document.video.ipad)):
(:host(.media-document.video.iphone)):
* Modules/modern-media-controls/js-files:
* Modules/modern-media-controls/media/fullscreen-support.js:
(FullscreenSupport.prototype.syncControl):
(FullscreenSupport):
* Modules/modern-media-controls/media/media-controller.js:
(MediaController):
(MediaController.prototype.get isAudio):
* Modules/modern-media-controls/media/media-document-controller.js: Added.
(MediaDocumentController):
(MediaDocumentController.prototype.handleEvent):
(MediaDocumentController.prototype._mediaDocumentHasMetadata):
(MediaDocumentController.prototype._mediaDocumentHasSize):
* Modules/modern-media-controls/media/pip-support.js:
(PiPSupport.prototype.syncControl):
(PiPSupport):
* html/MediaDocument.cpp:
(WebCore::MediaDocumentParser::createDocumentStructure):
2017-03-25 Chris Dumez <cdumez@apple.com>
REGRESSION(r214195): zillow.com header video doesn't resume when switching to another tab and back
https://bugs.webkit.org/show_bug.cgi?id=170080
<rdar://problem/31252522>
Reviewed by Eric Carlson.
The video header on zillow.com would pause when switching to another tab after r214195. On
switching back to the zillow.com tab, we would resume the video but fail to take the poster
away, making it look like the video is still paused.
We normally take the poster away when HTMLMediaElement::mediaPlayerFirstVideoFrameAvailable()
is called. However, mediaPlayerFirstVideoFrameAvailable() was only ever called once because of
the m_haveReportedFirstVideoFrame flag in MediaPlayerPrivateAVFoundation::updateStates().
We now reset m_haveReportedFirstVideoFrame to false in updateStates() if hasAvailableVideoFrame()
return false, so that we call mediaPlayerFirstVideoFrameAvailable() again when the return
value of asAvailableVideoFrame() becomes true again (e.g. after the media session interruption
has ended).
* platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
(WebCore::MediaPlayerPrivateAVFoundation::updateStates):
2017-03-24 Wenson Hsieh <wenson_hsieh@apple.com>
[WK2] Add a UI delegate SPI hook to enable or disable navigation on drop
https://bugs.webkit.org/show_bug.cgi?id=169168
<rdar://problem/30688374>
Reviewed by Tim Horton.
Refactor client hooks for the drag destination action in WebCore to ask for the drag destination action mask
upon initializing the DragData. In DragController, rather than setting m_dragDestinationAction to the result of
m_client.actionMaskForDrag, we instead set it to the DragData's destination action.
Tests to come in a future patch.
* loader/EmptyClients.cpp:
* page/DragClient.h:
Rather than pass in a DragData, pass in only the platform data that we need to hand to the delegate. This is
because we now ask for drag destination actions prior to creating the DragData.
* page/DragController.cpp:
(WebCore::DragController::dragEnteredOrUpdated):
Update the available drag destination actions in WebCore using the destination actions stored in DragData rather
than calling out to the client delegate.
* loader/EmptyClients.cpp:
* platform/DragData.cpp:
(WebCore::DragData::DragData):
* platform/DragData.h:
(WebCore::DragData::dragDestinationAction):
(WebCore::DragData::operator =):
* platform/mac/DragDataMac.mm:
(WebCore::DragData::DragData):
2017-03-25 Aaron Chu <aaron_chu@apple.com>
AX: Media controls are unlabeled
https://bugs.webkit.org/show_bug.cgi?id=169947
<rdar://problem/30153323>
Reviewed by Antoine Quint.
Added a "label" property for Icons, which are used to set
the aria-label for the controls in modern media controls.
Test: Addition to all existing modern media controls tests.
* English.lproj/modern-media-controls-localized-strings.js:
* Modules/modern-media-controls/controls/icon-button.js:
(IconButton.prototype.set iconName):
(IconButton.prototype.handleEvent):
(IconButton.prototype._loadImage):
* Modules/modern-media-controls/controls/icon-service.js:
* Modules/modern-media-controls/controls/start-button.js:
(StartButton):
* Modules/modern-media-controls/js-files:
2017-03-25 Carlos Garcia Campos <cgarcia@igalia.com>
[XDG] MIMETypeRegistry::getMIMETypeForExtension should return a null/empty string when mime type is unknown
https://bugs.webkit.org/show_bug.cgi?id=170050
Reviewed by Michael Catanzaro.
That's what the callers expect, but we alre always returning XDG_MIME_TYPE_UNKNOWN which is
application/octet-stream.
Fixes: plugins/no-mime-with-valid-extension.html
* platform/xdg/MIMETypeRegistryXdg.cpp:
(WebCore::MIMETypeRegistry::getMIMETypeForExtension):
2017-03-24 Myles C. Maxfield <mmaxfield@apple.com>
Add font-optical-sizing to CSSComputedStyleDeclaration
https://bugs.webkit.org/show_bug.cgi?id=170083
Reviewed by Joseph Pecoraro.
Covered by existing tests.
* css/CSSComputedStyleDeclaration.cpp:
2017-03-24 Daniel Bates <dabates@apple.com>
media/restore-from-page-cache.html causes NoEventDispatchAssertion::isEventAllowedInMainThread() assertion failure
https://bugs.webkit.org/show_bug.cgi?id=170087
<rdar://problem/31254822>
Reviewed by Simon Fraser.
Reduce the scope of code that should never dispatch DOM events so as to allow updating contents size
after restoring a page from the page cache.
In r214014 we instantiate a NoEventDispatchAssertion in FrameLoader::commitProvisionalLoad()
around the call to CachedPage::restore() to assert when a DOM event is dispatched during
page restoration as such events can cause re-entrancy into the page cache. As it turns out
it is sufficient to ensure that no DOM events are dispatched after restoring all cached frames
as opposed to after CachedPage::restore() returns.
Also rename Document::enqueue{Pageshow, Popstate}Event() to dispatch{Pageshow, Popstate}Event(),
respectively, since they synchronously dispatch events :(. We hope in the future to make them
asynchronously dispatch events.
* dom/Document.cpp:
(WebCore::Document::implicitClose): Update for renaming.
(WebCore::Document::statePopped): Ditto.
(WebCore::Document::dispatchPageshowEvent): Renamed; formerly named enqueuePageshowEvent().
(WebCore::Document::dispatchPopstateEvent): Renamed; formerly named enqueuePopstateEvent().
(WebCore::Document::enqueuePageshowEvent): Deleted.
(WebCore::Document::enqueuePopstateEvent): Deleted.
* dom/Document.h:
* history/CachedPage.cpp:
(WebCore::firePageShowAndPopStateEvents): Moved logic from FrameLoader::didRestoreFromCachedPage() to here.
(WebCore::CachedPage::restore): Modified to call firePageShowAndPopStateEvents().
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::commitProvisionalLoad): Removed use of NoEventDispatchAssertion RAII object. We
will instantiate it in CachedPage::restore() with a smaller scope.
(WebCore::FrameLoader::didRestoreFromCachedPage): Deleted; moved logic from here to WebCore::firePageShowAndPopStateEvents().
* loader/FrameLoader.h:
2017-03-24 Ryan Haddad <ryanhaddad@apple.com>
Unreviewed, rolling out r214361.
This change caused flakiness in http/tests/preload tests.
Reverted changeset:
"Add a warning for unused link preloads."
https://bugs.webkit.org/show_bug.cgi?id=165670
http://trac.webkit.org/changeset/214361
2017-03-24 Antoine Quint <graouts@webkit.org>
[Modern Media Controls] Remove placard icon if height is compressed
https://bugs.webkit.org/show_bug.cgi?id=167935
<rdar://problem/30397128>
Reviewed by Dean Jackson.
We make the addition of certain Placard children conditional on the placard's metrics. Whenever the
media controls metrics changes, the placard, if any, is set to have the same metrics and layout() is
called where we ensure that there is enough space, per designs, to have the icon, description and even
the title visible. We also make some CSS improvements to guarantee that the description is laid out on
two lines at most and that both text labels are trimmed elegantly with an ellipsis shold the width be
insufficient to display the whole text.
Since we would have needed to have more width/height setter overrides to trigger layout, we now make
LayoutNode trigger layout() directly and remove the need for subclasses to do this on a per-class basis.
We also make layout() a method that can be called safely anytime as it's now no longer part of the DOM
commit step, a new commit() method is used instead of that.
Tests: media/modern-media-controls/layout-node/node-made-dirty-during-commit.html
media/modern-media-controls/media-controls/media-controls-placard-compressed-metrics.html
* Modules/modern-media-controls/controls/layout-node.js:
(LayoutNode.prototype.set width):
(LayoutNode.prototype.set height):
Trigger a call to layout() anytime "width" or "height" is set on any LayoutNode.
(LayoutNode.prototype.layout):
(LayoutNode.prototype.commit):
(performScheduledLayout):
Make layout() an empty method that subclasses can override easily outside of the DOM commit cycle,
its previous implementation is now called "commit()" which is a more accurate name.
* Modules/modern-media-controls/controls/media-controls.js:
(MediaControls.prototype.get placard):
(MediaControls.prototype.get showsPlacard):
(MediaControls.prototype.showPlacard):
(MediaControls.prototype.hidePlacard):
(MediaControls.prototype.layout):
(MediaControls.prototype.get width): Deleted.
(MediaControls.prototype.set width): Deleted.
Add a "placard" property to make it simpler to reference the placard instead of making assumptions in
several places in that class on the children order. Anytime we run a layout or show the placard, ensure
that the placard metrics are synced with the media controls metrics.
* Modules/modern-media-controls/controls/placard.css:
(.placard .container):
(.placard .title,):
(.placard .description):
We now ensure that both the title and description are trimmed with an ellipsis when we run out of space
to display them fully.
* Modules/modern-media-controls/controls/placard.js:
(Placard.):
(Placard.prototype.layout):
We add new constraints to only show the icon, title and description if the placard is tall and wide enough.
* Modules/modern-media-controls/controls/slider.js:
(Slider.prototype.get width): Deleted.
(Slider.prototype.set width): Deleted.
Removed custom "width" getters and setters now we can just override layout() in case node metrics change.
* Modules/modern-media-controls/controls/time-control.js:
(TimeControl.prototype.set useSixDigitsForTimeLabels):
(TimeControl.prototype.layout):
(TimeControl.prototype.get width): Deleted.
(TimeControl.prototype.set width): Deleted.
(TimeControl.prototype._availableWidthHasChanged): Deleted.
Removed custom "width" getters and setters now we can just override layout() in case node metrics change.
* Modules/modern-media-controls/media/media-controller.js:
(MediaController):
Ensure we flush pending updates at construction time so that we match the size of the media controls right
at the first media layout.
2017-03-24 Eric Carlson <eric.carlson@apple.com>
[MediaStream] "ideal" constraints passed to getUserMedia should affect fitness score
https://bugs.webkit.org/show_bug.cgi?id=170056
Reviewed by Youenn Fablet.
Include the fitness score calculated for ideal constraints in the calculation of a capture
overall device fitness score.
No new tests, existing tests updated.
* platform/mediastream/MediaConstraints.cpp:
(WebCore::StringConstraint::fitnessDistance): Drive-by fix: return early if ideal is empty,
not exact.
* platform/mediastream/RealtimeMediaSource.cpp:
(WebCore::RealtimeMediaSource::supportsSizeAndFrameRate): Return fitness distance.
(WebCore::RealtimeMediaSource::selectSettings): Include the fitness distance of supported
ideal constraints.
(WebCore::RealtimeMediaSource::supportsConstraint): New.
(WebCore::RealtimeMediaSource::applyConstraints):
* platform/mediastream/RealtimeMediaSource.h:
* platform/mock/MockRealtimeMediaSourceCenter.cpp:
(WebCore::MockRealtimeMediaSourceCenter::validateRequestConstraints): Sort candidate sources
by their fitness score.
* platform/mock/MockRealtimeVideoSource.cpp:
(WebCore::MockRealtimeVideoSource::initializeCapabilities): Each video source should support
one facing mode, not both.
2017-03-24 Dean Jackson <dino@apple.com>
Serialization of custom props in longhand should be "" not value of shorthand
https://bugs.webkit.org/show_bug.cgi?id=167699
<rdar://problem/30324200>
Reviewed by Sam Weinig.
https://www.w3.org/TR/css-variables/#variables-in-shorthands says
"Pending-substitution values must be serialized as the empty string, if
an API allows them to be observed."
We were returning the cssText instead.
Test: fast/css/variables/rule-property-get.html has been updated.
* css/StyleProperties.cpp:
(WebCore::StyleProperties::getPropertyValue): Return the empty string
if we're a pending substitution value.
2017-03-24 Wenson Hsieh <wenson_hsieh@apple.com>
Unreviewed, fix the ToT build on the latest SDK.
Add deprecated declaration guards around two synchronous UIItemProvider methods in WebItemProviderPasteboard.
<rdar://problem/30451096> tracks adoption of the asynchronous versions of these methods.
* platform/ios/WebItemProviderPasteboard.mm:
(-[WebItemProviderPasteboard dataForPasteboardType:inItemSet:]):
(-[WebItemProviderPasteboard _tryToCreateAndAppendObjectOfClass:toArray:usingProvider:]):
2017-03-24 Antoine Quint <graouts@webkit.org>
[Modern Media Controls] Captions don't move with the appearance of the inline controls
https://bugs.webkit.org/show_bug.cgi?id=170051
<rdar://problem/30754428>
Reviewed by Dean Jackson.
We now size the captions container to account for the controls bar height when visible. To do this,
we use CSS variables to specify the height of the controls bar in default inline mode, compact inline
mode and fullscreen mode.
Test: media/modern-media-controls/tracks-support/tracks-support-captions-offset-with-controls-bar.html
* Modules/modern-media-controls/controls/controls-bar.js:
(ControlsBar.prototype.set faded):
Notify the hosting MediaControls that the "faded" property changed.
* Modules/modern-media-controls/controls/ios-inline-media-controls.css:
(.media-controls.ios.inline > .controls-bar):
Use the new --inline-controls-bar-height CSS variable to specify the inline bar height.
* Modules/modern-media-controls/controls/macos-compact-inline-media-controls.css:
(.media-controls.mac.inline.compact > .controls-bar):
Use the new --inline-compact-controls-bar-height CSS variable to specify the inline bar height.
* Modules/modern-media-controls/controls/macos-fullscreen-media-controls.css:
(.media-controls.mac.fullscreen > .controls-bar):
Use the new --fullscreen-controls-bar-height CSS variable to specify the inline bar height.
* Modules/modern-media-controls/controls/macos-inline-media-controls.css:
(.media-controls.mac.inline > .controls-bar):
Use the new --inline-controls-bar-height CSS variable to specify the inline bar height.
* Modules/modern-media-controls/controls/media-controls.css:
(*):
Specify new CSS variables for the various controls bar heights.
* Modules/modern-media-controls/controls/media-controls.js:
(MediaControls.prototype.controlsBarFadedStateDidChange):
Notify the delegate of a controls bar "faded" property change.
* Modules/modern-media-controls/controls/text-tracks.css:
(video::-webkit-media-text-track-container):
(video::-webkit-media-text-track-container.visible-controls-bar):
(video::-webkit-media-text-track-container.visible-controls-bar.compact-controls-bar):
(video::-webkit-media-text-track-display):
Shorten the height of the captions container when the controls bar is visible. We also
fix a couple of prefixed properties that didn't need to be.
* Modules/modern-media-controls/media/media-controller.js:
(MediaController.prototype.controlsBarFadedStateDidChange):
(MediaController.prototype._updateControlsIfNeeded):
(MediaController.prototype._updateTextTracksClassList):
(MediaController):
Ensure we reflect the "faded" state of the controls bar on the captions container using
a CSS class, as well as whether the controls bar mode is compact.
2017-03-24 Brent Fulgham <bfulgham@apple.com>
Handle recursive calls to ProcessingInstruction::checkStyleSheet
https://bugs.webkit.org/show_bug.cgi?id=169982
<rdar://problem/31083051>
Reviewed by Antti Koivisto.
See if we triggered a recursive load of the stylesheet during the 'beforeload'
event handler. If so, reset to a valid state before completing the load.
We should also check after 'beforeload' that we were not disconnected from (or
moved to a new) document.
I also looked for other cases of this pattern and fixed them, too.
Tests: fast/dom/beforeload/image-removed-during-before-load.html
fast/dom/beforeload/recursive-css-pi-before-load.html
fast/dom/beforeload/recursive-link-before-load.html
fast/dom/beforeload/recursive-xsl-pi-before-load.html
* dom/ProcessingInstruction.cpp:
(WebCore::ProcessingInstruction::clearExistingCachedSheet): Added.
(WebCore::ProcessingInstruction::checkStyleSheet): Prevent recursive calls into
this function during 'beforeload' handling. Also, safely handle the case where
the element was disconnected in the 'beforeload' handler (similar to what
we do in HTMLLinkElement).
(WebCore::ProcessingInstruction::setCSSStyleSheet): Drive-by Fix: Protect the
current document to match what we do in setXSLStyleSheet.
* dom/ProcessingInstruction.h:
* html/HTMLLinkElement.cpp:
(WebCore::HTMLLinkElement::process): Prevent recursive calls into
this function during 'beforeload' handling.
* html/HTMLLinkElement.h:
* loader/ImageLoader.cpp:
(WebCore::ImageLoader::dispatchPendingBeforeLoadEvent): safely handle the case where
the element was disconnected in the 'beforeload' handler (similar to what
we do in HTMLLinkElement).
* style/StyleScope.cpp:
(WebCore::Style::Scope::hasPendingSheet): Added.
* style/StyleScope.h:
2017-03-24 Brady Eidson <beidson@apple.com>
A null compound index value crashes the Databases process.
<rdar://problem/30499831> and https://bugs.webkit.org/show_bug.cgi?id=170000
Reviewed by Alex Christensen.
Test: storage/indexeddb/modern/single-entry-index-invalid-key-crash.html
* bindings/js/IDBBindingUtilities.cpp:
(WebCore::createKeyPathArray): Fix the bug by rejecting arrays with any invalid keys in them.
Add some logging:
* Modules/indexeddb/IDBKeyPath.cpp:
(WebCore::loggingString):
* Modules/indexeddb/IDBKeyPath.h:
* Modules/indexeddb/IDBObjectStore.cpp:
(WebCore::IDBObjectStore::createIndex):
* Modules/indexeddb/shared/IDBIndexInfo.cpp:
(WebCore::IDBIndexInfo::loggingString):
2017-03-24 Ryan Haddad <ryanhaddad@apple.com>
Unreviewed, rolling out r214360.
This change caused 20+ LayoutTest failures.
Reverted changeset:
"Handle recursive calls to
ProcessingInstruction::checkStyleSheet"
https://bugs.webkit.org/show_bug.cgi?id=169982
http://trac.webkit.org/changeset/214360
2017-03-24 Youenn Fablet <youenn@apple.com>
Add support for qpSum in WebRTC stats
https://bugs.webkit.org/show_bug.cgi?id=170060
Reviewed by Eric Carlson.
* Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
(WebCore::fillRTCRTPStreamStats): exposing libwebrtc qpSum value.
2017-03-24 Daniel Bates <dabates@apple.com>
Prevent new navigations during document unload
https://bugs.webkit.org/show_bug.cgi?id=169934
<rdar://problem/31247584>
Reviewed by Chris Dumez.
Similar to our policy of preventing new navigations from onbeforeunload handlers
we should prevent new navigations that are initiated during the document unload
process.
The significant part of this change is the instantiation of the RAII object NavigationDisabler
in Document::prepareForDestruction(). The rest of this change just renames class
NavigationDisablerForBeforeUnload to NavigationDisabler now that this RAII class is
used to prevent navigation from both onbeforeunload event handlers and when unloading
a document.
Test: fast/frames/frame-unload-navigate-and-setTimeout-assert-fail.html
* dom/Document.cpp:
(WebCore::Document::prepareForDestruction): Disable new navigations when disconnecting
subframes. Also assert that the document is not in the page cache before we fall off
the end of the function.
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::isNavigationAllowed): Update for renaming below.
(WebCore::FrameLoader::shouldClose): Ditto.
* loader/NavigationScheduler.cpp:
(WebCore::NavigationScheduler::shouldScheduleNavigation): Ditto.
* loader/NavigationScheduler.h:
(WebCore::NavigationDisabler::NavigationDisabler): Renamed class; formerly named NavigationDisablerForBeforeUnload.
(WebCore::NavigationDisabler::~NavigationDisabler): Ditto.
(WebCore::NavigationDisabler::isNavigationAllowed): Ditto.
(WebCore::NavigationDisablerForBeforeUnload::NavigationDisablerForBeforeUnload): Deleted.
(WebCore::NavigationDisablerForBeforeUnload::~NavigationDisablerForBeforeUnload): Deleted.
(WebCore::NavigationDisablerForBeforeUnload::isNavigationAllowed): Deleted.
2017-03-24 Myles C. Maxfield <mmaxfield@apple.com>
Implement font-optical-sizing
https://bugs.webkit.org/show_bug.cgi?id=168895
Reviewed by Dean Jackson.
Upon advice from Microsoft, the only input to optical sizing is just the
font-size computed value. It is implemented by setting the 'opsz' font
variation axis. Because the propery has such a simple grammar, the
implementation is quite straightforward.
Test: fast/text/variations/optical-sizing.html
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::ComputedStyleExtractor::propertyValue):
* css/CSSPrimitiveValueMappings.h:
(WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
(WebCore::CSSPrimitiveValue::operator FontOpticalSizing):
* css/CSSProperties.json:
* css/parser/CSSParserFastPaths.cpp:
(WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
(WebCore::CSSParserFastPaths::isKeywordPropertyID):
* platform/graphics/FontCache.h:
(WebCore::FontDescriptionKey::makeFlagsKey):
* platform/graphics/FontDescription.h:
(WebCore::FontDescription::opticalSizing):
(WebCore::FontDescription::setOpticalSizing):
(WebCore::FontDescription::operator==):
(WebCore::FontCascadeDescription::initialOpticalSizing):
* platform/graphics/cocoa/FontCacheCoreText.cpp:
(WebCore::preparePlatformFont):
(WebCore::fontWithFamily):
(WebCore::FontCache::createFontPlatformData):
(WebCore::FontCache::systemFallbackForCharacters):
* platform/graphics/mac/FontCustomPlatformData.cpp:
(WebCore::FontCustomPlatformData::fontPlatformData):
* platform/text/TextFlags.h:
2017-03-24 Chris Dumez <cdumez@apple.com>
Unreviewed, rolling out r214329.
Significantly regressed Speedometer
Reverted changeset:
"window.crypto.getRandomValues() uses the insecure RC4 RNG"
https://bugs.webkit.org/show_bug.cgi?id=169623
http://trac.webkit.org/changeset/214329
2017-03-24 Yoav Weiss <yoav@yoav.ws>
Add a warning for unused link preloads.
https://bugs.webkit.org/show_bug.cgi?id=165670
Reviewed by Youenn Fablet.
This patch adds a warning message, to warn developers that are using
link preloads in cases where the downloaded resource is likely to
remain unused.
Test: http/tests/preload/unused_preload_warning.html
* dom/Document.cpp:
(WebCore::Document::prepareForDestruction): Stop the timer once the document is destructed.
* loader/LinkPreloadResourceClients.h: Add shouldMarkAsReferenced overides for the LinkPreloadResourceClient classes.
* loader/cache/CachedResource.cpp:
(WebCore::CachedResource::addClientToSet): Make sure LinkPreloadResourceClients don't set resource to be referenced.
* loader/cache/CachedResourceClient.h:
(WebCore::CachedResourceClient::shouldMarkAsReferenced): Make sure that ResourceClients mark preloads as referenced by default.
* loader/cache/CachedResourceLoader.cpp:
(WebCore::CachedResourceLoader::CachedResourceLoader): Initialize timer.
(WebCore::CachedResourceLoader::~CachedResourceLoader): Stop timer.
(WebCore::CachedResourceLoader::warnUnusedPreloads): Iterate over m_preloads and issue a warning for non-referenced preloads.
(WebCore::CachedResourceLoader::documentDidFinishLoadEvent): Trigger a timer if preloads weren't cleared at load time.
(WebCore::CachedResourceLoader::warnUnusedPreloads): Triggered by the timer, and called CachedResourceLoader::warnUnusedPreloads.
(WebCore::CachedResourceLoader::stopUnusedPreloadsTimer): Stop the timer.
2017-03-24 Brent Fulgham <bfulgham@apple.com>
Handle recursive calls to ProcessingInstruction::checkStyleSheet
https://bugs.webkit.org/show_bug.cgi?id=169982
<rdar://problem/31083051>
Reviewed by Antti Koivisto.
See if we triggered a recursive load of the stylesheet during the 'beforeload'
event handler. If so, reset to a valid state before completing the load.
We should also check after 'beforeload' that we were not disconnected from (or
moved to a new) document.
I also looked for other cases of this pattern and fixed them.
Tests: fast/dom/beforeload/image-removed-during-before-load.html
fast/dom/beforeload/recursive-css-pi-before-load.html
fast/dom/beforeload/recursive-link-before-load.html
fast/dom/beforeload/recursive-xsl-pi-before-load.html
* dom/ProcessingInstruction.cpp:
(WebCore::ProcessingInstruction::clearExistingCachedSheet): Added.
(WebCore::ProcessingInstruction::checkStyleSheet): Reset to valid state
if necessary after the 'beforeload' handler. Also, safely handle the case where
the element was disconnected in the 'beforeload' handler (similar to what
we do in HTMLLinkElement).
(WebCore::ProcessingInstruction::setCSSStyleSheet): Drive-by Fix: Protect the
current document to match what we do in setXSLStyleSheet.
* dom/ProcessingInstruction.h:
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::selectMediaResource): Safely handle the case where
the element was disconnected in the 'beforeload' handler.
(WebCore::HTMLMediaElement::selectNextSourceChild): Ditto.
* loader/ImageLoader.cpp:
(WebCore::ImageLoader::dispatchPendingBeforeLoadEvent): Ditto.
2017-03-24 Myles C. Maxfield <mmaxfield@apple.com>
font-style needs a new CSSValue to make CSSRule.cssText work correctly
https://bugs.webkit.org/show_bug.cgi?id=169258
Reviewed by David Hyatt.
With variation fonts, font-style's value can't be captured in a CSSPrimitiveValue (nor any other subclass
off CSSValue) any more. Instead, we need to create two new CSSValues which represent the grammar that font-
style and it's associated @font-face descriptor accept.
The grammar of the font-style property is "normal | italic | oblique [ <<angle>> ]?"
The grammar of the font-style descriptor is "normal | italic | oblique [ <<angle>> | <<angle>> <<angle>> ]?"
We currently still support numbers in place of the <<angle>> value (contrary to the spec). We will remove
this support in https://bugs.webkit.org/show_bug.cgi?id=169357.
Tests: fast/text/font-selection-font-face-parse.html:
fast/text/font-style-parse.html:
* CMakeLists.txt:
* WebCore.xcodeproj/project.pbxproj:
* css/CSSAllInOne.cpp:
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::fontStyleFromStyle):
(WebCore::fontShorthandValueForSelectionProperties):
* css/CSSFontFace.cpp:
(WebCore::calculateWeightRange):
(WebCore::calculateStretchRange):
(WebCore::calculateItalicRange):
* css/CSSFontFaceSet.cpp:
(WebCore::computeFontSelectionRequest):
(WebCore::CSSFontFaceSet::matchingFaces):
(WebCore::calculateWeightValue): Deleted.
(WebCore::calculateStretchValue): Deleted.
(WebCore::calculateStyleValue): Deleted.
* css/CSSFontFaceSet.h:
* css/CSSFontSelector.cpp:
(WebCore::CSSFontSelector::addFontFaceRule):
* css/CSSFontStyleRangeValue.cpp: Added.
(WebCore::CSSFontStyleRangeValue::customCSSText):
(WebCore::CSSFontStyleRangeValue::equals):
* css/CSSFontStyleRangeValue.h: Added.
* css/CSSFontStyleValue.cpp: Added.
(WebCore::CSSFontStyleValue::customCSSText):
(WebCore::CSSFontStyleValue::equals):
* css/CSSFontStyleValue.h: Added.
* css/CSSFontValue.cpp:
(WebCore::CSSFontValue::customCSSText):
* css/CSSFontValue.h:
* css/CSSValue.cpp:
(WebCore::CSSValue::equals):
(WebCore::CSSValue::cssText):
(WebCore::CSSValue::destroy):
* css/CSSValue.h:
(WebCore::CSSValue::isFontStyleValue):
(WebCore::CSSValue::isFontStyleRangeValue):
* css/FontFace.cpp:
(WebCore::FontFace::style):
(WebCore::FontFace::weight):
(WebCore::FontFace::stretch):
* css/StyleBuilderConverter.h:
(WebCore::StyleBuilderConverter::convertFontWeightFromValue):
(WebCore::StyleBuilderConverter::convertFontStretchFromValue):
(WebCore::StyleBuilderConverter::convertFontStyleFromValue):
(WebCore::StyleBuilderConverter::convertFontWeight):
(WebCore::StyleBuilderConverter::convertFontStretch):
(WebCore::StyleBuilderConverter::convertFontStyle):
* css/parser/CSSPropertyParser.cpp:
(WebCore::consumeFontStyle):
(WebCore::consumeFontStyleRange):
(WebCore::CSSPropertyParser::consumeSystemFont):
(WebCore::CSSPropertyParser::consumeFont):
* svg/SVGFontFaceElement.cpp:
(WebCore::SVGFontFaceElement::parseAttribute):
2017-03-24 Alex Christensen <achristensen@webkit.org>
REGRESSION: Content Blocker: Blocking "a[href*=randomString]" doesn't work
https://bugs.webkit.org/show_bug.cgi?id=169167
Reviewed by Simon Fraser.
When testing content extensions, we have always called an API function that internally
has called AtomicString::init somewhere before we start compiling the content extension.
On iOS, though, we call [_WKUserContentExtensionStore compileContentExtensionForIdentifier:...]
without having already called anything that calls AtomicString::init. The new CSS parser is now
failing to parse some selectors because CSSSelectorParser::defaultNamespace is returning starAtom,
which is a null atomic string before AtomicString::init is called.
Covered by a new API test.
* contentextensions/ContentExtensionParser.cpp:
(WebCore::ContentExtensions::isValidCSSSelector):
(WebCore::ContentExtensions::loadAction):
(WebCore::ContentExtensions::isValidSelector): Deleted.
* contentextensions/ContentExtensionParser.h:
Call AtomicString::init before checking if a css selector is valid.
2017-03-24 Youenn Fablet <youenn@apple.com>
Add libwebrtc backend support for RTCRtpSender::replaceTrack
https://bugs.webkit.org/show_bug.cgi?id=169841
Reviewed by Alex Christensen.
Tests: webrtc/audio-replace-track.html
webrtc/video-replace-track.html
Adding support for replaceTrack for audio and video sources.
Replacing tracks will always succeed for audio sources.
For video tracks, it will only succeed if the video resolution is not greater.
LibWebRTCPeerConnectionBackend will delegate the track replacing by replacing the source of the outgoing sources with the source wrapped in the replacing track.
Video test is not fully passing as size constraints for mock video sources are not providing the right video stream resolution.
* Modules/mediastream/RTCRtpSender.cpp:
(WebCore::RTCRtpSender::replaceTrack):
* Modules/mediastream/RTCRtpSender.h:
* Modules/mediastream/RTCRtpSender.idl:
* Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
(WebCore::LibWebRTCPeerConnectionBackend::replaceTrack):
* Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.h:
* platform/mediastream/mac/RealtimeOutgoingAudioSource.cpp:
(WebCore::RealtimeOutgoingAudioSource::setSource):
* platform/mediastream/mac/RealtimeOutgoingAudioSource.h:
* platform/mediastream/mac/RealtimeOutgoingVideoSource.cpp:
(WebCore::RealtimeOutgoingVideoSource::setSource):
* platform/mediastream/mac/RealtimeOutgoingVideoSource.h:
* platform/mock/MockRealtimeVideoSource.cpp:
(WebCore::MockRealtimeVideoSource::drawText):
(WebCore::MockRealtimeVideoSource::generateFrame):
2017-03-24 Jon Lee <jonlee@apple.com>
Remove comment from RTCStatsReport.idl to convert ssrc to DOMString.
Unreviewed.
Latest available Editor's Draft of WebRTC Statistics API is from 14 December 2016,
but since then, in https://github.com/w3c/webrtc-stats/pull/157, it was changed to become
unsigned long.
* Modules/mediastream/RTCStatsReport.idl:
2017-03-24 Youenn Fablet <youenn@apple.com>
Add support for DataChannel and MediaStreamTrack stats
https://bugs.webkit.org/show_bug.cgi?id=170031
Reviewed by Eric Carlson.
Tests: webrtc/datachannel/datachannel-stats.html
webrtc/video-mediastreamtrack-stats.html
Exposing libwebrtc stats through WebRTC stats API, gathered for data channel and media stream tracks.
* Modules/mediastream/RTCStatsReport.h:
(WebCore::RTCStatsReport::MediaStreamTrackStats::MediaStreamTrackStats):
(WebCore::RTCStatsReport::DataChannelStats::DataChannelStats):
* Modules/mediastream/RTCStatsReport.idl:
* Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
(WebCore::fillRTCMediaStreamTrackStats):
(WebCore::fillRTCDataChannelStats):
(WebCore::LibWebRTCMediaEndpoint::StatsCollector::OnStatsDelivered):
2017-03-24 Youenn Fablet <youenn@apple.com>
Fix framesEncoded/framesDecoded RTC stats
https://bugs.webkit.org/show_bug.cgi?id=170024
Reviewed by Eric Carlson.
Test: webrtc/video-stats.html
Adding access to these fields now that they are available.
* Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
(WebCore::fillInboundRTPStreamStats):
(WebCore::fillOutboundRTPStreamStats):
2017-03-24 Carlos Garcia Campos <cgarcia@igalia.com>
Unreviewed. Fix GTK+ test /webkit2/WebKitWebView/default-menu after r214244.
Fix mnemonic string of contextMenuItemTagOpenAudioInNewWindow() that I copy pasted from
contextMenuItemTagOpenVideoInNewWindow().
* platform/LocalizedStrings.cpp:
(WebCore::contextMenuItemTagOpenAudioInNewWindow):
2017-03-24 Carlos Garcia Campos <cgarcia@igalia.com>
[GStreamer] MediaPlayerPrivateGStreamerOwr shouldn't be the default engine
https://bugs.webkit.org/show_bug.cgi?id=170049
Reviewed by Žan Doberšek.
This is causing several media tests to fail after r214338. When trying to load something like this:
http://127.0.0.1:8000/media/resources/serve-video.php?name=../../../../media/content/silence.wav&type=audio/wav&content-length=no&icy-data=yes
since r214338, the content type is known and inferred from the extension in this case, what ends up calling
nextMediaEngine() in MediaPlayer::loadWithNextMediaEngine. That returns the first registered media engine, that
is Owr that doesn't know how to load that and fails.
Fixes: http/tests/media/media-play-stream-chunked-icy.html
http/tests/media/media-seeking-no-ranges-server.html
http/tests/media/video-auth.html
http/tests/media/video-play-stall-before-meta-data.html
http/tests/security/contentSecurityPolicy/audio-redirect-allowed.html
http/tests/security/contentSecurityPolicy/audio-redirect-allowed2.html
http/tests/security/contentSecurityPolicy/audio-redirect-blocked.html
http/tests/security/contentSecurityPolicy/video-redirect-allowed.html
http/tests/security/contentSecurityPolicy/video-redirect-allowed2.html
http/tests/security/contentSecurityPolicy/video-redirect-blocked.html
* platform/graphics/MediaPlayer.cpp:
(WebCore::buildMediaEnginesVector):
2017-03-24 Per Arne Vollan <pvollan@apple.com>
Text stroke is sometimes clipped on video captions.
https://bugs.webkit.org/show_bug.cgi?id=170006
Reviewed by Eric Carlson.
Set 'overflow' property to 'visible' on cue element to avoid clipping of text stroke.
Updated test media/track/track-css-stroke-cues.html.
* html/track/TextTrackCueGeneric.cpp:
(WebCore::TextTrackCueGenericBoxElement::applyCSSProperties):
* html/track/VTTCue.cpp:
(WebCore::VTTCueBox::applyCSSProperties):
2017-03-24 Carlos Garcia Campos <cgarcia@igalia.com>
[GTK] Add MIMETypeRegistry implementation using xdgmime and remove the GTK+ one
https://bugs.webkit.org/show_bug.cgi?id=170001
Reviewed by Michael Catanzaro.
The XDG implementation could be used by any port where shared-mime-info is expected to be available. It also
improves the current GTK+ implementation that is based on a very small map of mime types and extensions.
* CMakeLists.txt:
* PlatformGTK.cmake:
* platform/xdg/MIMETypeRegistryXdg.cpp: Renamed from Source/WebCore/platform/gtk/MIMETypeRegistryGtk.cpp.
(WebCore::MIMETypeRegistry::getMIMETypeForExtension):
(WebCore::MIMETypeRegistry::getPreferredExtensionForMIMEType):
2017-03-23 Jon Lee <jonlee@apple.com>
Update createDataChannel on RTCPeerConnection
https://bugs.webkit.org/show_bug.cgi?id=170044
Reviewed by Youenn Fablet.
* Modules/mediastream/RTCPeerConnection.idl: Change label to USVString.
2017-03-23 Antti Koivisto <antti@apple.com>
Revert r213712, caused iPad PLT regression
https://bugs.webkit.org/show_bug.cgi?id=170040
Unreviewed.
A few subtests have big regressions.
* css/StyleResolver.cpp:
(WebCore::StyleResolver::pseudoStyleRulesForElement):
* dom/Document.cpp:
(WebCore::Document::resolveStyle):
(WebCore::Document::updateLayoutIgnorePendingStylesheets):
(WebCore::Document::shouldScheduleLayout):
(WebCore::Document::didRemoveAllPendingStylesheet):
* dom/Document.h:
(WebCore::Document::didLayoutWithPendingStylesheets):
(WebCore::Document::hasNodesWithPlaceholderStyle):
(WebCore::Document::setHasNodesWithPlaceholderStyle):
(WebCore::Document::hasNodesWithNonFinalStyle): Deleted.
(WebCore::Document::setHasNodesWithNonFinalStyle): Deleted.
* html/HTMLFrameSetElement.cpp:
(WebCore::HTMLFrameSetElement::rendererIsNeeded):
* page/FrameView.cpp:
(WebCore::FrameView::qualifiesAsVisuallyNonEmpty):
(WebCore::FrameView::fireLayoutRelatedMilestonesIfNeeded):
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::paintContents):
* rendering/RenderLayer.cpp:
(WebCore::shouldSuppressPaintingLayer):
* rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::changeRequiresRepaint):
* rendering/style/RenderStyle.h:
(WebCore::RenderStyle::isPlaceholderStyle):
(WebCore::RenderStyle::setIsPlaceholderStyle):
(WebCore::RenderStyle::isNotFinal): Deleted.
(WebCore::RenderStyle::setIsNotFinal): Deleted.
* rendering/style/StyleRareNonInheritedData.cpp:
(WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
(WebCore::StyleRareNonInheritedData::operator==):
* rendering/style/StyleRareNonInheritedData.h:
* style/StyleScope.cpp:
(WebCore::Style::Scope::analyzeStyleSheetChange):
(WebCore::Style::Scope::updateActiveStyleSheets):
* style/StyleTreeResolver.cpp:
(WebCore::Style::makePlaceholderStyle):
(WebCore::Style::TreeResolver::styleForElement):
(WebCore::Style::TreeResolver::resolveElement):
2017-03-23 Wenson Hsieh <wenson_hsieh@apple.com>
Dragging on a large image should not revert to a file icon if data interaction is enabled
https://bugs.webkit.org/show_bug.cgi?id=170018
<rdar://problem/31184508>
Reviewed by Tim Horton.
If data interaction is enabled, don't fall back to showing a file icon when initiating a drag on an image element.
New API tests: DataInteractionTests.LargeImageToTargetDiv
DataInteractionTests.AttachmentElementItemProviders
* page/DragController.cpp:
(WebCore::DragController::doImageDrag):
(WebCore::DragController::shouldUseCachedImageForDragImage):
* page/DragController.h:
2017-03-23 Youenn Fablet <youenn@apple.com>
Rename RTCIceCandidateEvent to RTCPeerConnectionIceEvent
https://bugs.webkit.org/show_bug.cgi?id=169981
Reviewed by Eric Carlson.
* CMakeLists.txt:
* DerivedSources.make:
* Modules/mediastream/MediaEndpointPeerConnection.cpp:
* Modules/mediastream/PeerConnectionBackend.cpp:
(WebCore::PeerConnectionBackend::fireICECandidateEvent):
(WebCore::PeerConnectionBackend::doneGatheringCandidates):
* Modules/mediastream/RTCPeerConnection.cpp:
* Modules/mediastream/RTCPeerConnectionIceEvent.cpp: Renamed from Source/WebCore/Modules/mediastream/RTCIceCandidateEvent.cpp.
(WebCore::RTCPeerConnectionIceEvent::create):
(WebCore::RTCPeerConnectionIceEvent::RTCPeerConnectionIceEvent):
(WebCore::RTCPeerConnectionIceEvent::~RTCPeerConnectionIceEvent):
(WebCore::RTCPeerConnectionIceEvent::candidate):
(WebCore::RTCPeerConnectionIceEvent::eventInterface):
* Modules/mediastream/RTCPeerConnectionIceEvent.h: Renamed from Source/WebCore/Modules/mediastream/RTCIceCandidateEvent.h.
* Modules/mediastream/RTCPeerConnectionIceEvent.idl: Renamed from Source/WebCore/Modules/mediastream/RTCIceCandidateEvent.idl.
* WebCore.xcodeproj/project.pbxproj:
* dom/EventNames.in:
2017-03-23 Michael Catanzaro <mcatanzaro@igalia.com>
window.crypto.getRandomValues() uses the insecure RC4 RNG
https://bugs.webkit.org/show_bug.cgi?id=169623
Reviewed by Alex Christensen.
* PlatformMac.cmake:
* WebCore.xcodeproj/project.pbxproj:
* crypto/CryptoKey.cpp:
(WebCore::CryptoKey::randomData): Use this on Mac now.
* crypto/mac/CryptoKeyMac.cpp: Removed.
* page/Crypto.cpp:
(WebCore::Crypto::getRandomValues): Rollout r214188.
2017-03-23 Chris Dumez <cdumez@apple.com>
SVG animations are not paused when their <svg> element is removed from the document
https://bugs.webkit.org/show_bug.cgi?id=170030
<rdar://problem/31230252>
Reviewed by Dean Jackson.
SVG animations were not paused when their <svg> element was removed from the document.
This patch fixes the issue.
Test: svg/animations/animations-paused-when-removed-from-document.html
* svg/SVGSVGElement.cpp:
(WebCore::SVGSVGElement::insertedInto):
(WebCore::SVGSVGElement::removedFrom):
2017-03-22 Myles C. Maxfield <mmaxfield@apple.com>
font shorthand should accept variation values
https://bugs.webkit.org/show_bug.cgi?id=168998
Reviewed by Simon Fraser.
The CSS Fonts 4 spec has stabilized as to which variation values are allowed in
the font shorthand property. Weights are allowed because a 0 weight is considered
as a parse error, so there is no conflict with a unitless font-size of 0.
font-style accepts angles, so there is no conflict there. However, font-stretch
accepts percentages, which are also accepted by font-size, which means the newly
extended grammar for font-stretch can't be accepted in the shorthand.
Tests: fast/text/font-style-parse.html
fast/text/font-weight-parse.html
* css/parser/CSSPropertyParser.cpp:
(WebCore::consumeFontWeight):
(WebCore::consumeFontStyle):
(WebCore::CSSPropertyParser::consumeFont):
(WebCore::consumeFontWeightCSS21): Deleted.
* css/parser/CSSPropertyParserHelpers.cpp:
(WebCore::CSSPropertyParserHelpers::consumeFontWeightNumber):
* css/parser/CSSPropertyParserHelpers.h:
2017-03-23 Chris Dumez <cdumez@apple.com>
SVG animations are not paused when inserted into a hidden page
https://bugs.webkit.org/show_bug.cgi?id=170026
<rdar://problem/31228704>
Reviewed by Andreas Kling.
SVG animations were not paused when inserted into a hidden page. We would pause
animations in a page when the page becomes hidden. However, new animations
inserted in the page after this point would start, despite the page being
hidden.
Tests:
- svg/animations/animations-paused-when-inserted-in-hidden-document.html
- svg/animations/animations-paused-when-inserted-in-hidden-document2.html
* dom/Document.cpp:
(WebCore::Document::accessSVGExtensions):
* svg/SVGDocumentExtensions.cpp:
(WebCore::SVGDocumentExtensions::SVGDocumentExtensions):
(WebCore::SVGDocumentExtensions::addTimeContainer):
(WebCore::reportMessage):
* svg/SVGDocumentExtensions.h:
* testing/Internals.cpp:
(WebCore::Internals::areSVGAnimationsPaused):
* testing/Internals.h:
* testing/Internals.idl:
== Rolled over to ChangeLog-2017-03-23 ==